赞 | 11 |
VIP | 94 |
好人卡 | 57 |
积分 | 39 |
经验 | 47770 |
最后登录 | 2024-11-12 |
在线时间 | 1582 小时 |
Lv3.寻梦者
- 梦石
- 0
- 星屑
- 3852
- 在线时间
- 1582 小时
- 注册时间
- 2006-5-5
- 帖子
- 2743
|
1、用以下方法改变升级后的状态问题
Scene_Battle 2 的173行开始,有如下3段内容:
if actor.level > last_level
@status_window.level_up(i)
end
这里就是升级的内容,只要在if那个下面一行添加
actor.hp = actor.maxhp; actor.sp = actor.maxsp
就可以补满血和能量。
2、使用升级脚本,下面这套试验过不少情况,比较稳定- #==============================================================================
- # 本脚本来自www.66RPG.com,使用和转载请保留此信息
- #==============================================================================
- # ————————————————————————————————————
- # ▼▲▼ XRXS_BP10. LEVEL UP!能力上昇表示ウィンドウ plus ▼▲▼
- # by 桜雅 在土
- #——以下3个如果需要修改,直接输入文件名即可
- $data_system_level_up_se = "" #升级时的音效设置
- $data_system_level_up_me = "Audio/ME/007-Fanfare01" # 升级时播放的ME
- $data_system_skilllearn_se = "Audio/SE/106-Heal02" # 学会特技时播放的声效。
- #==============================================================================
- # ■ Window_LevelUpWindow
- #------------------------------------------------------------------------------
- # バトル終了時、レベルアップした場合にステータスを表示するウィンドウです。
- #==============================================================================
- class Window_LevelUpWindow < Window_Base
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- def initialize(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
- super(0, 128, 160, 192)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.visible = false
- self.back_opacity = 160
- refresh(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
- end
- #--------------------------------------------------------------------------
- # ● リフレッシュ
- #--------------------------------------------------------------------------
- def refresh(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
- self.contents.clear
- self.contents.font.color = system_color
- self.contents.font.size = 14
- self.contents.draw_text( 0, 0, 160, 24, "LEVEL UP!!")
- self.contents.font.size = 18
- self.contents.draw_text( 0, 28, 160, 24, $data_system.words.hp)
- self.contents.draw_text( 0, 50, 160, 24, $data_system.words.sp)
- self.contents.font.size = 14
- self.contents.draw_text( 0, 72, 80, 24, $data_system.words.str)
- self.contents.draw_text( 0, 94, 80, 24, $data_system.words.dex)
- self.contents.draw_text( 0, 116, 80, 24, $data_system.words.agi)
- self.contents.draw_text( 0, 138, 80, 24, $data_system.words.int)
- self.contents.draw_text(92, 0, 128, 24, "→")
- self.contents.draw_text(76, 28, 128, 24, "=")
- self.contents.draw_text(76, 50, 128, 24, "=")
- self.contents.draw_text(76, 72, 128, 24, "=")
- self.contents.draw_text(76, 94, 128, 24, "=")
- self.contents.draw_text(76, 116, 128, 24, "=")
- self.contents.draw_text(76, 138, 128, 24, "=")
- self.contents.font.color = normal_color
- self.contents.draw_text( 0, 0, 88, 24, last_lv.to_s, 2)
- self.contents.draw_text( 0, 28, 72, 24, "+" + up_hp.to_s, 2)
- self.contents.draw_text( 0, 50, 72, 24, "+" + up_sp.to_s, 2)
- self.contents.draw_text( 0, 72, 72, 24, "+" + up_str.to_s, 2)
- self.contents.draw_text( 0, 94, 72, 24, "+" + up_dex.to_s, 2)
- self.contents.draw_text( 0, 116, 72, 24, "+" + up_agi.to_s, 2)
- self.contents.draw_text( 0, 138, 72, 24, "+" + up_int.to_s, 2)
- self.contents.font.size = 20
- self.contents.draw_text( 0, 0, 128, 24, actor.level.to_s, 2)
- self.contents.draw_text( 0, 26, 128, 24, actor.maxhp.to_s, 2)
- self.contents.draw_text( 0, 48, 128, 24, actor.maxsp.to_s, 2)
- self.contents.draw_text( 0, 70, 128, 24, actor.str.to_s, 2)
- self.contents.draw_text( 0, 92, 128, 24, actor.dex.to_s, 2)
- self.contents.draw_text( 0, 114, 128, 24, actor.agi.to_s, 2)
- self.contents.draw_text( 0, 136, 128, 24, actor.int.to_s, 2)
- end
- end
- #==============================================================================
- # ■ Window_SkillLearning
- #------------------------------------------------------------------------------
- # レベルアップ時などにスキルを習得した場合にそれを表示するウィンドウです。
- #==============================================================================
- class Window_SkillLearning < Window_Base
- #--------------------------------------------------------------------------
- # ● 公開インスタンス変数
- #--------------------------------------------------------------------------
- attr_reader :learned # スキルを習得したかどうか
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- def initialize(class_id, last_lv, now_lv)
- super(160, 64, 320, 64)
- self.contents = Bitmap.new(width - 32, height - 28) # わざと▽を表示
- self.visible = false
- self.back_opacity = 160
- @learned = false
- refresh(class_id, last_lv, now_lv)
- end
- #--------------------------------------------------------------------------
- # ● リフレッシュ
- #--------------------------------------------------------------------------
- def refresh(class_id, last_lv, now_lv)
- for i in 0...$data_classes[class_id].learnings.size
- learn_lv = $data_classes[class_id].learnings[i].level
- # 今回のレベルアップ範囲で習得するスキルの場合
- if learn_lv > last_lv and learn_lv <= now_lv
- @learned = true
- # SEの再生
- if $data_system_skilllearn_se != ""
- Audio.se_play($data_system_skilllearn_se)
- end
- # 各描写
- skill_name = $data_skills[$data_classes[class_id].learnings[i].skill_id].name
- self.contents.clear
- self.contents.font.color = text_color(0)
- self.contents.draw_text(0,0,448,32, "学会特技:"+skill_name)
- self.contents.font.color = text_color(6)
- self.contents.draw_text(0,0,448,32, " "+skill_name)
- self.contents.font.color = text_color(0)
- self.visible = true
- # メインループ
- loop do
- # ゲーム画面を更新
- Graphics.update
- # 入力情報を更新
- Input.update
- # フレーム更新
- update
- # 画面が切り替わったらループを中断
- if @learned == false
- break
- end
- end
- # メインループここまで
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● フレーム更新
- #--------------------------------------------------------------------------
- def update
- # C ボタンが押された場合
- if Input.trigger?(Input::C)
- @learned = false
- self.visible = false
- end
- end
- end
- #==============================================================================
- # ■ Window_BattleStatus
- #==============================================================================
- class Window_BattleStatus < Window_Base
- #--------------------------------------------------------------------------
- # ● 追加?公開インスタンス変数
- #--------------------------------------------------------------------------
- attr_accessor :level_up_flags # LEVEL UP!表示
- end
- #==============================================================================
- # ■ Game_Battler
- #==============================================================================
- class Game_Battler
- #--------------------------------------------------------------------------
- # ● 追加?公開インスタンス変数
- #--------------------------------------------------------------------------
- attr_accessor :exp_gain_ban # EXP取得一時禁止
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- alias xrxs_bp10_initialize initialize
- def initialize
- @exp_gain_ban = false
- xrxs_bp10_initialize
- end
- #--------------------------------------------------------------------------
- # ● ステート [EXP を獲得できない] 判定
- #--------------------------------------------------------------------------
- alias xrxs_bp10_cant_get_exp? cant_get_exp?
- def cant_get_exp?
- if @exp_gain_ban == true
- return true
- else
- return xrxs_bp10_cant_get_exp?
- end
- end
- end
- #==============================================================================
- # ■ Scene_Battle
- #==============================================================================
- class Scene_Battle
- #--------------------------------------------------------------------------
- # ● アフターバトルフェーズ開始
- #--------------------------------------------------------------------------
- alias xrxs_bp10_start_phase5 start_phase5
- def start_phase5
- # EXP 獲得禁止
- for i in 0...$game_party.actors.size
- $game_party.actors[i].exp_gain_ban = true
- end
- xrxs_bp10_start_phase5
- # EXP 獲得禁止の解除
- for i in 0...$game_party.actors.size
- $game_party.actors[i].exp_gain_ban = false
- end
- # EXPを初期化
- @exp_gained = 0
- for enemy in $game_troop.enemies
- # 獲得 EXPを追加 # エネミーが隠れ状態でない場合
- @exp_gained += enemy.exp if not enemy.hidden
- end
- # 設定
- @phase5_step = 1
- @exp_gain_actor = -1
- # リザルトウィンドウを表示
- @result_window.visible = true
- end
- #--------------------------------------------------------------------------
- # ● フレーム更新 (アフターバトルフェーズ)
- #--------------------------------------------------------------------------
- #alias xrxs_bp10_update_phase5 update_phase5
- def update_phase5
- case @phase5_step
- when 1
- update_phase5_step1
- else
- # ウェイトカウントが 0 より大きい場合
- if @phase5_wait_count > 0
- # ウェイトカウントを減らす
- @phase5_wait_count -= 1
- # ウェイトカウントが 0 になった場合
- if @phase5_wait_count == 0
- # リザルトウィンドウを表示
- #@result_window.visible = true
- # メインフェーズフラグをクリア
- $game_temp.battle_main_phase = false
- # ステータスウィンドウをリフレッシュ
- @status_window.refresh
- end
- return
- end
- # C ボタンが押された場合
- if Input.trigger?(Input::C)
- # バトル終了
- battle_end(0)
- end
- # レベルアップしている場合は強制バトル終了
- battle_end(0) if @levelup_window != nil and @phase5_wait_count <= 0
- end
- end
- #--------------------------------------------------------------------------
- # ● フレーム更新 (アフターバトルフェーズ 1 : レベルアップ)
- #--------------------------------------------------------------------------
- def update_phase5_step1
- # C ボタンが押された場合
- if Input.trigger?(Input::C)
- # ウィンドウを閉じて次のアクターへ
- @levelup_window.visible = false if @levelup_window != nil
- @status_window.level_up_flags[@exp_gain_actor] = false
- phase5_next_levelup
- end
- end
- #--------------------------------------------------------------------------
- # ● 次のアクターのレベルアップ表示へ
- #--------------------------------------------------------------------------
- def phase5_next_levelup
- begin
- # 次のアクターへ
- @exp_gain_actor += 1
- # 最後のアクターの場合
- if @exp_gain_actor >= $game_party.actors.size
- # アフターバトルフェーズ開始
- @phase5_step = 0
- return
- end
- actor = $game_party.actors[@exp_gain_actor]
- if actor.cant_get_exp? == false
- # 現在の能力値を保持
- last_level = actor.level
- last_maxhp = actor.maxhp
- last_maxsp = actor.maxsp
- last_str = actor.str
- last_dex = actor.dex
- last_agi = actor.agi
- last_int = actor.int
- # 経験値取得の決定的瞬間(謎
- actor.exp += @exp_gained
- # 判定
- if actor.level > last_level
- # レベルアップした場合
- @status_window.level_up(@exp_gain_actor)
- # リザルトウィンドウを消す
- @result_window.visible = false
- # SEの再生
- if $data_system_level_up_se != ""
- Audio.se_play($data_system_level_up_se)
- end
- # MEの再生
- if $data_system_level_up_me != ""
- Audio.me_stop
- Audio.me_play($data_system_level_up_me)
- end
- # LEVEL-UPウィンドウの設定
- @levelup_window = Window_LevelUpWindow.new(actor, last_level,
- actor.maxhp - last_maxhp, actor.maxsp - last_maxsp, actor.str - last_str,
- actor.dex - last_dex, actor.agi - last_agi, actor.int - last_int)
- @levelup_window.x = 160 * @exp_gain_actor
- @levelup_window.visible = true
- # ステータスウィンドウをリフレッシュ
- @status_window.refresh
- # スキル習得ウィンドウの設定
- @skilllearning_window = Window_SkillLearning.new(actor.class_id, last_level, actor.level)
- # ウェイトカウントを設定
- @phase5_wait_count = 40
- @phase5_step = 1
- return
- end
- end
- end until false
- end
- end
- #==============================================================================
- # 本脚本来自www.66RPG.com,使用和转载请保留此信息
- #==============================================================================
复制代码 3、地图就用下面的脚本,把按键打开改成公共事件打开就可以了- # ————————————————————————————————————
- # 本脚本来自www.66rpg.com,转载请保留此信息
- # ————————————————————————————————————
- #==============================================================================
- # ■ 縮小地图的表示(ver 0.999)
- # by ピニョン clum-sea
- #==============================================================================
- #==============================================================================
- # □ 前期定义
- #==============================================================================
- module PLAN_Map_Window
- WIN_X = 8 # 地图的 X 座標
- WIN_Y = 8 # 地图的 Y 座標
- WIN_WIDTH = 8*32 # 地图的宽度
- WIN_HEIGHT = 6*32 # 地图的高度
- ZOOM = 7.0 # 地图的放缩比例
- WINDOWSKIN = "" # 自定义地图窗口素材,如果留空则是默认的
- ON_OFF_KEY = Input::CTRL # 打开地图的按钮,A就是键盘的Z键
- SWITCH = 135 # 禁用地图功能的开关,默认这个就是打开100号开关则禁止
- # 使用地图功能,关闭则可以使用地图功能
- WINDOW_MOVE = true # 窗口中的地图跟随移动,(true:跟随, false:固定)
-
- OVER_X = 632 - WIN_WIDTH # 移動后的 X 座標(初期位置と往復します)
- OVER_Y = 8 # 移動后的 Y 座標(初期位置と往復します)
- OPACITY = 192 # 窗口的透明度
- C_OPACITY = 192 # 地图的透明度
- VISIBLE = false # 最初是否可见
- end
- #==============================================================================
- # ■ Game_Temp
- #==============================================================================
- class Game_Temp
- attr_accessor :map_visible # 地图的表示状態
- alias plan_map_window_initialize initialize
- def initialize
- plan_map_window_initialize
- @map_visible = false
- end
- end
- #==============================================================================
- # ■ Scene_Map
- #==============================================================================
- class Scene_Map
- #--------------------------------------------------------------------------
- # ● 主处理
- #--------------------------------------------------------------------------
- alias plan_map_window_main main
- def main
- @map_window = Window_Map.new
- @map_window.visible = $game_temp.map_visible
- plan_map_window_main
- @map_window.dispose
- end
- #--------------------------------------------------------------------------
- # ● 更新
- #--------------------------------------------------------------------------
- alias plan_map_window_update update
- def update
- $game_temp.map_visible = @map_window.visible
- plan_map_window_update
- unless $game_switches[PLAN_Map_Window::SWITCH]
- if Input.trigger?(PLAN_Map_Window::ON_OFF_KEY)
- if @map_window.visible
- @map_window.visible = false
- else
- @map_window.visible = true
- end
- end
- else
- if @map_window.visible
- @map_window.visible = false
- end
- end
- if @map_window.visible
- @map_window.update
- end
- end
- #--------------------------------------------------------------------------
- # ● 场所移动的变化
- #--------------------------------------------------------------------------
- alias plan_map_window_transfer_player transfer_player
- def transfer_player
- visible = @map_window.visible
- @map_window.visible = false
- plan_map_window_transfer_player
- @map_window.dispose
- @map_window = Window_Map.new
- @map_window.visible = visible
- end
- end
- #==============================================================================
- # ■ Window_Map
- #==============================================================================
- class Window_Map < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化
- #--------------------------------------------------------------------------
- def initialize
- x = PLAN_Map_Window::WIN_X
- y = PLAN_Map_Window::WIN_Y
- w = PLAN_Map_Window::WIN_WIDTH
- h = PLAN_Map_Window::WIN_HEIGHT
- super(x, y, w, h)
- unless PLAN_Map_Window::WINDOWSKIN.empty?
- self.windowskin = RPG::Cache.windowskin(PLAN_Map_Window::WINDOWSKIN)
- end
- self.contents = Bitmap.new(width - 32, height - 32)
- self.opacity = PLAN_Map_Window::OPACITY
- self.contents_opacity = PLAN_Map_Window::C_OPACITY
- @map_data = $game_map.data
- @tileset = RPG::Cache.tileset($game_map.tileset_name)
- @autotiles = []
- for i in 0..6
- autotile_name = $game_map.autotile_names[i]
- @autotiles[i] = RPG::Cache.autotile(autotile_name)
- end
- @old_real_x = $game_player.real_x
- @old_real_y = $game_player.real_y
- @all_map = make_all_map
- self.visible = PLAN_Map_Window::VISIBLE
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 缩小图做成
- #--------------------------------------------------------------------------
- def make_all_map
- all_map = Bitmap.new($game_map.width * 32, $game_map.height * 32)
- for y in 0...$game_map.height
- for x in 0...$game_map.width
- for z in 0...3
- tile_num = @map_data[x, y, z]
- next if tile_num == nil
- if tile_num < 384
- if tile_num >= 48
- tile_num -= 48
- src_rect = Rect.new(32, 2 * 32, 32, 32)
- all_map.blt(x * 32, y * 32, @autotiles[tile_num / 48], src_rect)
- end
- else
- tile_num -= 384
- src_rect = Rect.new(tile_num % 8 * 32, tile_num / 8 * 32, 32, 32)
- all_map.blt(x * 32, y * 32, @tileset, src_rect)
- end
- end
- end
- end
- w = ($game_map.width / PLAN_Map_Window::ZOOM) * 32
- h = ($game_map.height / PLAN_Map_Window::ZOOM) * 32
- ret_bitmap = Bitmap.new(w, h)
- src_rect = Rect.new(0, 0, all_map.width, all_map.height)
- dest_rect = Rect.new(0, 0, ret_bitmap.width, ret_bitmap.height)
- ret_bitmap.stretch_blt(dest_rect, all_map, src_rect)
- all_map.dispose
- return ret_bitmap
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- one_tile_size = 32 / PLAN_Map_Window::ZOOM
- x = $game_player.real_x - 128 * (self.contents.width / one_tile_size) / 2
- y = $game_player.real_y - 128 * (self.contents.height / one_tile_size) / 2
- x = x * one_tile_size / 128
- y = y * one_tile_size / 128
- half_width = self.contents.width * 128 / 2
- rest_width = ($game_map.width * 128 - $game_player.real_x) * one_tile_size
- rev_x = 0
- if @all_map.width < self.contents.width
- rev_x = (half_width - $game_player.real_x * one_tile_size) / 128
- rev_x -= (self.contents.width - @all_map.width) / 2
- x += rev_x
- elsif half_width > $game_player.real_x * one_tile_size
- rev_x = (half_width - $game_player.real_x * one_tile_size) / 128
- x += rev_x
- elsif half_width > rest_width
- rev_x = -((half_width - rest_width) / 128)
- x += rev_x
- end
- half_height = self.contents.height * 128 / 2
- rest_height = ($game_map.height * 128 - $game_player.real_y) * one_tile_size
- rev_y = 0
- if @all_map.height < self.contents.height
- rev_y = (half_height - $game_player.real_y * one_tile_size) / 128
- rev_y -= (self.contents.height - @all_map.height) / 2
- y += rev_y
- elsif half_height > $game_player.real_y * one_tile_size
- rev_y = (half_height - $game_player.real_y * one_tile_size) / 128
- y += rev_y
- elsif half_height > rest_height
- rev_y = -((half_height - rest_height) / 128)
- y += rev_y
- end
- src_rect = Rect.new(x, y, self.contents.width, self.contents.height)
- self.contents.blt(0, 0, @all_map, src_rect)
- if PLAN_Map_Window::WINDOW_MOVE == true
- w = self.x..self.x + self.width
- h = self.y..self.y + self.height
- if w === $game_player.screen_x and h === $game_player.screen_y
- if self.x == PLAN_Map_Window::WIN_X and self.y == PLAN_Map_Window::WIN_Y
- self.x = PLAN_Map_Window::OVER_X
- self.y = PLAN_Map_Window::OVER_Y
- else
- self.x = PLAN_Map_Window::WIN_X
- self.y = PLAN_Map_Window::WIN_Y
- end
- end
- end
- if $game_party.actors.size > 0
- for i in [2, 1, 0]
- tile = @map_data[$game_player.x, $game_player.y, i]
- next if tile == 0
- return if $game_map.priorities[tile] > 0
- end
- actor = $game_party.actors[0]
- bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
- width = bitmap.width / 4
- height = bitmap.height / 4
- src_rect = Rect.new(0, 0, width, height)
- w = width / PLAN_Map_Window::ZOOM
- h = height / PLAN_Map_Window::ZOOM
- x = self.contents.width / 2 - w / 2 + one_tile_size / 2 - rev_x
- y = self.contents.height / 2 - h / 2 - rev_y
- dest_rect = Rect.new(x, y, w, h)
- self.contents.stretch_blt(dest_rect, bitmap, src_rect)
- end
- end
- #--------------------------------------------------------------------------
- # ● 更新
- #--------------------------------------------------------------------------
- def update
- super
- if @old_real_x != $game_player.real_x or @old_real_y != $game_player.real_y
- @old_real_x = $game_player.real_x
- @old_real_y = $game_player.real_y
- refresh
- end
- end
- #--------------------------------------------------------------------------
- # ● 解放
- #--------------------------------------------------------------------------
- def dispose
- super
- @all_map.dispose
- end
- end
复制代码 |
评分
-
查看全部评分
|