赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 3519 |
最后登录 | 2023-2-27 |
在线时间 | 134 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 55
- 在线时间
- 134 小时
- 注册时间
- 2010-7-1
- 帖子
- 61
|
- #==============================================================================
- # 本脚本来自www.66RPG.com,使用和转载请保留此信息
- #==============================================================================
- # 泛用型升级提示 v1.1
- #
- # 核心部分 By 叶子
- # 窗口部分 原作者:桜雅 在土 修改:叶子
- #
- # Date: 2-12-2006 -v1.0
- # 3-2-2006 -v1.1
- #==============================================================================
- #
- # 在对话时,调用“增加EXP”或“增减等级”指令前,请等待3帧以上,否则对话框来不及消失。
- #
- # 当打开此号数的开关的时候,等级上升将不会提示,比如默认打开45号开关,等级上升不再提示
- $不显示升级窗口 = 99
- #==============================================================================
- class Game_Actor
- #--------------------------------------------------------------------------
- # ● 更改 EXP
- # exp : 新的 EXP
- #--------------------------------------------------------------------------
- def exp=(exp)
- # 记录旧等级
- last_level = @level
- @exp = [[exp, 9999999].min, 0].max
- # 升级
- while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
- @level += 1
- # 学会特技
- for j in $data_classes[@class_id].learnings
- if j.level == @level
- learn_skill(j.skill_id)
- end
- end
- end
- # 降级
- while @exp < @exp_list[@level]
- @level -= 1
- end
- # 修正当前的 HP 与 SP 超过最大值
- @hp = [@hp, self.maxhp].min
- @sp = [@sp, self.maxsp].min
- # 升级了的话,升级显示处理
- if @level > last_level and $game_switches[$不显示升级窗口] == false and
- not $BTEST
- show_level_up_result(last_level)
- end
- end
- #--------------------------------------------------------------------------
- # ● 升级显示处理
- #--------------------------------------------------------------------------
- def show_level_up_result(last_level)
- actor_parameters = self.last_parameters(last_level)
- last_maxhp = actor_parameters[0]
- last_maxsp = actor_parameters[1]
- last_str = actor_parameters[2]
- last_dex = actor_parameters[3]
- last_agi = actor_parameters[4]
- last_int = actor_parameters[5]
- level_up_window = Window_LevelUpWindow_A.new self,last_level,last_maxhp,
- last_maxsp,last_str,last_dex,last_agi,last_int
- level_up_window.visible = true
- skill_learning_window = Window_SkillLearning_A.new(@class_id,
- last_level, @level)
- # 循环
- loop do
- # 刷新游戏画面
- Graphics.update
- # 刷新输入信息
- Input.update
- # 按下C就关闭窗口
- if Input.trigger?(Input::C)
- unless skill_learning_window.refresh
- level_up_window.dispose
- skill_learning_window.dispose
- return true
- end
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 一次取得全部旧属性
- #--------------------------------------------------------------------------
- def last_parameters(level)
- #---------------------------
- # maxhp
- #---------------------------
- n = [[$data_actors[@actor_id].parameters[0, level] + @maxhp_plus, 1].max, 9999].min
- for i in @states
- n *= $data_states[i].maxhp_rate / 100.0
- end
- n = [[Integer(n), 1].max, 9999].min
- maxhp = n
- #---------------------------
- # maxsp
- #---------------------------
- n = [[$data_actors[@actor_id].parameters[1, level] + @maxsp_plus, 0].max, 9999].min
- for i in @states
- n *= $data_states[i].maxsp_rate / 100.0
- end
- n = [[Integer(n), 0].max, 9999].min
- maxsp = n
- #---------------------------
- # str
- #---------------------------
- n = $data_actors[@actor_id].parameters[2, level]
- weapon = $data_weapons[@weapon_id]
- armor1 = $data_armors[@armor1_id]
- armor2 = $data_armors[@armor2_id]
- armor3 = $data_armors[@armor3_id]
- armor4 = $data_armors[@armor4_id]
- n += weapon != nil ? weapon.str_plus : 0
- n += armor1 != nil ? armor1.str_plus : 0
- n += armor2 != nil ? armor2.str_plus : 0
- n += armor3 != nil ? armor3.str_plus : 0
- n += armor4 != nil ? armor4.str_plus : 0
- n = [[n + @str_plus, 1].max, 999].min
- for i in @states
- n *= $data_states[i].str_rate / 100.0
- end
- n = [[Integer(n), 1].max, 999].min
- str = n
- #---------------------------
- # dex
- #---------------------------
- n = $data_actors[@actor_id].parameters[3, level]
- weapon = $data_weapons[@weapon_id]
- armor1 = $data_armors[@armor1_id]
- armor2 = $data_armors[@armor2_id]
- armor3 = $data_armors[@armor3_id]
- armor4 = $data_armors[@armor4_id]
- n += weapon != nil ? weapon.dex_plus : 0
- n += armor1 != nil ? armor1.dex_plus : 0
- n += armor2 != nil ? armor2.dex_plus : 0
- n += armor3 != nil ? armor3.dex_plus : 0
- n += armor4 != nil ? armor4.dex_plus : 0
- n = [[n + @dex_plus, 1].max, 999].min
- for i in @states
- n *= $data_states[i].dex_rate / 100.0
- end
- n = [[Integer(n), 1].max, 999].min
- dex = n
- #---------------------------
- # agi
- #---------------------------
- n = $data_actors[@actor_id].parameters[4, level]
- weapon = $data_weapons[@weapon_id]
- armor1 = $data_armors[@armor1_id]
- armor2 = $data_armors[@armor2_id]
- armor3 = $data_armors[@armor3_id]
- armor4 = $data_armors[@armor4_id]
- n += weapon != nil ? weapon.agi_plus : 0
- n += armor1 != nil ? armor1.agi_plus : 0
- n += armor2 != nil ? armor2.agi_plus : 0
- n += armor3 != nil ? armor3.agi_plus : 0
- n += armor4 != nil ? armor4.agi_plus : 0
- n = [[n + @agi_plus, 1].max, 999].min
- for i in @states
- n *= $data_states[i].agi_rate / 100.0
- end
- n = [[Integer(n), 1].max, 999].min
- agi = n
- #---------------------------
- # int
- #---------------------------
- n = $data_actors[@actor_id].parameters[5, level]
- weapon = $data_weapons[@weapon_id]
- armor1 = $data_armors[@armor1_id]
- armor2 = $data_armors[@armor2_id]
- armor3 = $data_armors[@armor3_id]
- armor4 = $data_armors[@armor4_id]
- n += weapon != nil ? weapon.int_plus : 0
- n += armor1 != nil ? armor1.int_plus : 0
- n += armor2 != nil ? armor2.int_plus : 0
- n += armor3 != nil ? armor3.int_plus : 0
- n += armor4 != nil ? armor4.int_plus : 0
- n = [[n + @int_plus, 1].max, 999].min
- for i in @states
- n *= $data_states[i].int_rate / 100.0
- end
- n = [[Integer(n), 1].max, 999].min
- int = n
- return [maxhp, maxsp, str, dex, agi, int]
- end
- end
- #==============================================================================
- # 本脚本来自www.66RPG.com,使用和转载请保留此信息
- #==============================================================================
- #==============================================================================
- # 本脚本来自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 = "" # 学会特技时播放的声效。
- #==============================================================================
- # ■ Window_LevelUpWindow
- #------------------------------------------------------------------------------
- # バトル終了時、レベルアップした場合にステータスを表示するウィンドウです。
- #==============================================================================
- class Window_LevelUpWindow_A < Window_Base
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- def initialize(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
- super(210, 100, 220, 222)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.visible = false
- self.back_opacity = 160
- # 防止被对话框遮住
- self.z = 9999
- refresh(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)
- # 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
- 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 = text_color(6)
- self.contents.font.size = 20
- self.contents.draw_text(0, 0, 160, 24, actor.name.to_s)
- self.contents.font.color = system_color
- self.contents.font.size = 18
- self.contents.draw_text( 0, 26, 160, 24, "等级")
- self.contents.font.size = 18
- self.contents.draw_text( 0, 48, 80, 24, $data_system.words.hp)
- self.contents.draw_text( 0, 70, 80, 24, $data_system.words.sp)
- self.contents.draw_text( 0, 92, 80, 24, $data_system.words.str)
- self.contents.draw_text( 0, 114, 80, 24, $data_system.words.dex)
- self.contents.draw_text( 0, 136, 80, 24, $data_system.words.agi)
- self.contents.draw_text( 0, 158, 80, 24, $data_system.words.int)
- self.contents.draw_text(110, 26, 128, 24, "→")
- self.contents.draw_text(110, 48, 128, 24, "→")
- self.contents.draw_text(110, 70, 128, 24, "→")
- self.contents.draw_text(110, 92, 128, 24, "→")
- self.contents.draw_text(110, 114, 128, 24, "→")
- self.contents.draw_text(110, 136, 128, 24, "→")
- self.contents.draw_text(110, 158, 128, 24, "→")
- self.contents.font.color = normal_color
- self.contents.draw_text( 60, 26, 88, 24, last_lv.to_s)
- self.contents.draw_text( 60, 48, 72, 24, up_hp.to_s)
- self.contents.draw_text( 60, 70, 72, 24, up_sp.to_s)
- self.contents.draw_text( 60, 92, 72, 24, up_str.to_s)
- self.contents.draw_text( 60, 114, 72, 24, up_dex.to_s)
- self.contents.draw_text( 60, 136, 72, 24, up_agi.to_s)
- self.contents.draw_text( 60, 158, 72, 24, up_int.to_s)
- self.contents.draw_text( 145, 26, 128, 24, actor.level.to_s)
- self.contents.draw_text( 145, 48, 128, 24, actor.maxhp.to_s)
- self.contents.draw_text( 145, 70, 128, 24, actor.maxsp.to_s)
- self.contents.draw_text( 145, 92, 128, 24, actor.str.to_s)
- self.contents.draw_text( 145, 114, 128, 24, actor.dex.to_s)
- self.contents.draw_text( 145, 136, 128, 24, actor.agi.to_s)
- self.contents.draw_text( 145, 158, 128, 24, actor.int.to_s)
- end
- end
- #==============================================================================
- # ■ Window_SkillLearning
- #------------------------------------------------------------------------------
- # レベルアップ時などにスキルを習得した場合にそれを表示するウィンドウです。
- #==============================================================================
- class Window_SkillLearning_A < Window_Base
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- def initialize(class_id, last_lv, now_lv)
- super(210, 322, 220, 56)
- self.contents = Bitmap.new(width - 32, height - 16) # わざと▽を表示
- self.visible = false
- self.back_opacity = 160
- # 防止被对话框遮住
- self.z = 9999
- @learn_skills = []
- 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
- @learn_skills.push $data_skills[
- $data_classes[class_id].learnings[i].skill_id].name
- end
- end
- refresh
- end
- #--------------------------------------------------------------------------
- # ● リフレッシュ
- #--------------------------------------------------------------------------
- def refresh
- # 各描写
- skill_name = @learn_skills.shift
- if skill_name == nil
- return false
- end
- # SEの再生
- if $data_system_skilllearn_se != ""
- Audio.se_play($data_system_skilllearn_se, 100, 70)
- end
- self.contents.clear
- self.contents.font.size = 18
- self.contents.font.color = text_color(0)
- self.contents.draw_text(0,0,156,24, "学会特技:"+skill_name)
- self.contents.font.color = text_color(6)
- self.contents.draw_text(0,0,156,24, " "+skill_name)
- self.contents.font.color = text_color(0)
- self.visible = true
- return true
- end
- end
- #==============================================================================
- # 本脚本来自www.66RPG.com,使用和转载请保留此信息
- #==============================================================================
复制代码- #==============================================================================
- # 本脚本来自www.66RPG.com,使用和转载请保留此信息
- #==============================================================================
- # 脚本使用设定:
- LEVEL_UP_POINT = 3 # 每升一级所增加的点数
- LEVEL_UP_VARIABLE = 100 # 储存角色点数的变量编号与角色id编号的差值
- # 默认情况 = 100,
- # 则是数据库里1号角色的加点数存于101号变量
- # 3号角色的加点数存于103号变量。
- # 你可以直接操作变量赠与角色可分配点数
- # 每增加一次点数,各项能力值的变化:357-410行
-
- # 使用方法介绍:
- # 本脚本不会取代原猩豆δ埽皇且桓龈郊庸δ堋?BR># 也就是说,默认的升级还在,但可以用这个功能手动追加点数。
- # 如果你想纯粹使用手动加点(而升级不提升能力),只要把数据库中角色升级能力,
- # 1-99级全部等于一个相同数值就行了。
- # 呼唤加点场景的方法:$scene = Scene_Lvup.new(角色编号,返回菜单编号)。
- # 默认都是0号
- # 加点场景中,page up,page down换人,如果想加点完毕后返回地图,
- # 464行$scene = Scene_Menu.new(0)改为$scene = Scene_Map.new
- # 推荐脚本搭配:魔法商店脚本,两者结合,制作自由型RPG
- #==============================================================================
- # ■ Window_Command
- #------------------------------------------------------------------------------
- # 一般的命令选择行窗口。(追加定义)
- #==============================================================================
- class Window_Command < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 项目有效化
- # index : 项目编号
- #--------------------------------------------------------------------------
- def able_item(index)
- draw_item(index, normal_color)
- end
- end
- #==============================================================================
- # ■ Game_Actor
- #------------------------------------------------------------------------------
- # 处理角色的类。(再定义)
- #==============================================================================
- class Game_Actor < Game_Battler
- #--------------------------------------------------------------------------
- # ● 更改 EXP
- # exp : 新的 EXP
- #--------------------------------------------------------------------------
- def exp=(exp)
- @exp = [[exp, 9999999].min, 0].max
- # 升级
- while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
- @level += 1
- # 增加4点可自由分配的点数
- $game_variables[self.id + LEVEL_UP_VARIABLE] += LEVEL_UP_POINT
- # 学会特技
- for j in $data_classes[@class_id].learnings
- if j.level == @level
- learn_skill(j.skill_id)
- end
- end
- end
- # 降级
- while @exp < @exp_list[@level]
- @level -= 1
- end
- # 修正当前的 HP 与 SP 超过最大值
- @hp = [@hp, self.maxhp].min
- @sp = [@sp, self.maxsp].min
- end
- end
- #==============================================================================
- # ■ Window_Base
- #------------------------------------------------------------------------------
- # 游戏中全部窗口的超级类(追加定义)
- #==============================================================================
- class Window_Base < Window
- #--------------------------------------------------------------------------
- # ● 描绘 HP
- # actor : 角色
- # x : 描画目标 X 坐标
- # y : 描画目标 Y 坐标
- # width : 描画目标的宽
- #--------------------------------------------------------------------------
- def draw_actor_hp_lvup(actor, x, y)
- self.contents.font.color = system_color
- self.contents.draw_text(x , y, 96, 32, "最大" + $data_system.words.hp)
- if $temp_hp == 0
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 120 , y, 48, 32, actor.maxhp.to_s, 2)
- else
- maxhp = actor.maxhp + $temp_hp
- self.contents.font.color = Color.new(255, 128, 128, 255)
- self.contents.draw_text(x + 120 , y, 48, 32, maxhp.to_s ,2)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 155, y, 36, 32, "( ", 2)
- if $temp_hp >=0
- self.contents.font.color = Color.new(255, 128, 128, 255)
- self.contents.draw_text(x + 155, y, 36, 32, " +",2)
- else
- self.contents.font.color = Color.new(255,255,0,255)
- self.contents.draw_text(x + 155, y, 36, 32, " -",2)
- end
- self.contents.draw_text(x + 200, y, 36, 32, $temp_hp.to_s, 2)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 215, y, 36, 32, ")", 2)
- end
- end
- #--------------------------------------------------------------------------
- # ● 描绘 SP
- # actor : 角色
- # x : 描画目标 X 坐标
- # y : 描画目标 Y 坐标
- # width : 描画目标的宽
- #--------------------------------------------------------------------------
- def draw_actor_sp_lvup(actor, x, y)
- self.contents.font.color = system_color
- self.contents.draw_text(x , y, 96, 32, "最大" + $data_system.words.sp)
- if $temp_sp == 0
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 120 , y, 48, 32, actor.maxsp.to_s, 2)
- else
- maxsp = actor.maxsp + $temp_sp
- self.contents.font.color = Color.new(255, 128, 128, 255)
- self.contents.draw_text(x + 120 , y, 48, 32, maxsp.to_s ,2)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 155, y, 36, 32, "( ", 2)
- if $temp_sp >=0
- self.contents.font.color = Color.new(255, 128, 128, 255)
- self.contents.draw_text(x + 155, y, 36, 32, " +",2)
- else
- self.contents.font.color = Color.new(255,255,0,255)
- self.contents.draw_text(x + 155, y, 36, 32, " -",2)
- end
- self.contents.draw_text(x + 200, y, 36, 32, $temp_sp.to_s, 2)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 215, y, 36, 32, ")", 2)
- end
- end
- #--------------------------------------------------------------------------
- # ● 描绘能力值
- # actor : 角色
- # x : 描画目标 X 坐标
- # y : 描画目标 Y 坐标
- # type : 能力值种类 (0~4)
- #--------------------------------------------------------------------------
- def draw_actor_lvup(actor, x, y, type)
- # 定义数字颜色
- lvup = normal_color
- upcolor = Color.new(255, 128, 128, 255)
- self.contents.font.color = normal_color
- case type
- when 0
- parameter_name = $data_system.words.str
- parameter_value = actor.str
- parameter_value_temp = parameter_value + $temp_str
- if $temp_str != 0
- lvup = upcolor
- self.contents.draw_text(x + 256, y, 16, 32, "(")
- if $temp_str >= 0
- self.contents.font.color = lvup
- self.contents.draw_text(x + 272, y, 80, 32, "+",0)
- else
- self.contents.font.color = Color.new(255,255,0,255)
- self.contents.draw_text(x + 272, y, 80, 32, "-",0)
- end
- self.contents.draw_text(x + 272, y, 80, 32, $temp_str.abs.to_s,1)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
- end
- when 1
- parameter_name = $data_system.words.dex
- parameter_value = actor.dex
- parameter_value_temp = parameter_value + $temp_dex
- if $temp_dex != 0
- lvup = upcolor
- self.contents.draw_text(x + 256, y, 16, 32, "(")
- if $temp_dex >= 0
- self.contents.font.color = lvup
- self.contents.draw_text(x + 272, y, 80, 32, "+",0)
- else
- self.contents.font.color = Color.new(255,255,0,255)
- self.contents.draw_text(x + 272, y, 80, 32, "-",0)
- end
- self.contents.draw_text(x + 272, y, 80, 32, $temp_dex.abs.to_s,1)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
- end
- when 2
- parameter_name = $data_system.words.agi
- parameter_value = actor.agi
- parameter_value_temp = parameter_value + $temp_agi
- if $temp_agi != 0
- lvup = upcolor
- self.contents.draw_text(x + 256, y, 16, 32, "(")
- if $temp_agi >= 0
- self.contents.font.color = lvup
- self.contents.draw_text(x + 272, y, 80, 32, "+",0)
- else
- self.contents.font.color = Color.new(255,255,0,255)
- self.contents.draw_text(x + 272, y, 80, 32, "-",0)
- end
- self.contents.draw_text(x + 272, y, 80, 32, $temp_agi.abs.to_s,1)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
- end
- when 3
- parameter_name = $data_system.words.int
- parameter_value = actor.int
- parameter_value_temp = parameter_value + $temp_int
- if $temp_int != 0
- lvup = upcolor
- self.contents.draw_text(x + 256, y, 16, 32, "(")
- if $temp_int >= 0
- self.contents.font.color = lvup
- self.contents.draw_text(x + 272, y, 80, 32, "+",0)
- else
- self.contents.font.color = Color.new(255,255,0,255)
- self.contents.draw_text(x + 272, y, 80, 32, "-",0)
- end
- self.contents.draw_text(x + 272, y, 80, 32, $temp_int.abs.to_s,1)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
- end
- when 4
- parameter_name = "剩余点数"
- parameter_value = $point
- if $point != 0
- lvup = upcolor
- end
- end
- self.contents.font.color = system_color
- self.contents.draw_text(x, y, 120, 32, parameter_name)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s)
- if type != 4
- self.contents.draw_text(x + 150, y, 36, 32, "→")
- end
- self.contents.font.color = lvup
- self.contents.draw_text(x + 180, y, 60, 32, parameter_value_temp.to_s)
- self.contents.font.color = normal_color
- end
- end
- #==============================================================================
- # ■ Window_lvup
- #------------------------------------------------------------------------------
- # 显示升级状态窗口。
- #==============================================================================
- class Window_Lvup < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # actor : 角色
- #--------------------------------------------------------------------------
- def initialize(actor)
- super(0, 0, 512, 320)
- self.contents = Bitmap.new(width - 32, height - 32)
- @actor = actor
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- draw_actor_graphic(@actor, 40, 112)
- draw_actor_name(@actor, 4, 0)
- draw_actor_class(@actor, 4 + 144, 0)
- draw_actor_level(@actor, 96, 32)
- draw_actor_state(@actor, 96, 64)
- draw_actor_hp_lvup(@actor, 96+128, 32)
- draw_actor_sp_lvup(@actor, 96+128, 64)
- draw_actor_lvup(@actor, 96, 128, 0)
- draw_actor_lvup(@actor, 96, 160, 1)
- draw_actor_lvup(@actor, 96, 192, 2)
- draw_actor_lvup(@actor, 96, 224, 3)
- draw_actor_lvup(@actor, 96, 256, 4)
- end
- end
- #==============================================================================
- # ■ Window_Help
- #------------------------------------------------------------------------------
- # 特技及物品的说明、角色的状态显示的窗口。
- #==============================================================================
- class Window_Lvup_Help < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize
- super(0, 320, 640, 160)
- self.contents = Bitmap.new(width - 32, height - 32)
- @test = "" #——这个东西用来检测,节约内存专用
- end
- #--------------------------------------------------------------------------
- # ● 设置文本
- #--------------------------------------------------------------------------
- def lvup_text(text1, text2 = nil, text3 = nil, text4 = nil)
- if @test != text1
- @test = text1
- else
- return
- end
- self.contents.clear
- self.contents.font.color = normal_color
- self.contents.draw_text(4, 0, self.width - 40, 32, text1)
- if text2 != nil
- self.contents.draw_text(4 , 32, self.width - 40, 32, text2)
- end
- self.contents.font.size -= 4
- if text3 != nil
- self.contents.draw_text(4 , 64, self.width - 40, 32, text3)
- end
- if text4 != nil
- self.contents.draw_text(4 , 96, self.width - 40, 32, text4)
- end
- self.contents.font.size += 4
- end
- end
- #==============================================================================
- # ■ Scene_lvup
- #------------------------------------------------------------------------------
- # 处理升级画面的类。
- #==============================================================================
- class Scene_Lvup
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # actor_index : 角色索引
- # menu_index : 选项起始位置
- #--------------------------------------------------------------------------
- def initialize(actor_index = 0 , menu_index = 0)
- @actor_index = actor_index
- @menu_index = menu_index
- end
- #--------------------------------------------------------------------------
- # ● 主处理
- #--------------------------------------------------------------------------
- def main
- s1 = "增加体力"
- s2 = "增加"+$data_system.words.str
- s3 = "增加"+$data_system.words.dex
- s4 = "增加"+$data_system.words.agi
- s5 = "增加"+$data_system.words.int
- s6 = "确认加点"
- s7 = "点数重置"
- @command_window = Window_Command.new(128, [s1, s2, s3, s4, s5, s6, s7])
- @command_window.index = @menu_index
- # 获取角色
- @actor = $game_party.actors[@actor_index]
- # 将角色的剩余点数带入
- $point = $game_variables[@actor.id + LEVEL_UP_VARIABLE]
- # 初始化临时量
- $temp_str = 0
- $temp_dex = 0
- $temp_agi = 0
- $temp_int = 0
- $temp_hp = 0
- $temp_sp = 0
- #=========================================================================
- # 特别提示:这些设置也可以使用小数,但是可能出现0值意外错误
- # (各种编程语言都有这种意外),建议还是使用整数,正负不限
- #=========================================================================
- # 每提升一次力量,提升多少附加能力
- #=========================================================================
- @str_hp = 1 # 每提升一次力量附加提升多少HP
- @str_sp = 0 # 每提升一次力量附加提升多少SP
- @str_dex = 0 # 每提升一次力量附加提升多少灵巧
- @str_agi = 0 # 每提升一次力量附加提升多少速度
- @str_int = 0 # 每提升一次力量附加提升多少魔力
- @str_str = 5 # 每提升一次力量附加提升多少力量
- #=========================================================================
- # 每提升一次灵巧,提升多少附加能力
- #=========================================================================
- @dex_hp = 3 # 每提升一次灵巧附加提升多少HP
- @dex_sp = 2 # 每提升一次灵巧附加提升多少SP
- @dex_str = 1 # 每提升一次灵巧附加提升多少力量
- @dex_agi = 1 # 每提升一次灵巧附加提升多少速度
- @dex_int = 0 # 每提升一次灵巧附加提升多少魔力
- @dex_dex = 5 # 每提升一次灵巧附加提升多少灵巧
- #=========================================================================
- # 每提升一次速度,提升多少附加能力
- #=========================================================================
- @agi_hp = 3 # 每提升一次速度附加提升多少HP
- @agi_sp = 2 # 每提升一次速度附加提升多少SP
- @agi_str = 0 # 每提升一次速度附加提升多少力量
- @agi_dex = 0 # 每提升一次速度附加提升多少灵巧
- @agi_int = 0 # 每提升一次速度附加提升多少魔力
- @agi_agi = 6 # 每提升一次速度附加提升多少速度
- #=========================================================================
- # 每提升一次魔力,提升多少附加能力
- #=========================================================================
- @int_hp = 1 # 每提升一次魔力附加提升多少HP
- @int_sp = 15 # 每提升一次魔力附加提升多少SP
- @int_str = 0 # 每提升一次魔力附加提升多少力量
- @int_dex = 0 # 每提升一次魔力附加提升多少灵巧
- @int_agi = 0 # 每提升一次魔力附加提升多少速度
- @int_int = 10 # 每提升一次魔力附加提升多少魔力
- #=========================================================================
- # 每提升一次体力,提升多少附加能力
- #=========================================================================
- @hp = 20 # 每提升一次体力提升多少HP
- @sp = 0 # 每提升一次体力提升多少SP
- @hp_str = 1 # 每提升一次体力提升多少力量
- @hp_dex = 0 # 每提升一次体力提升多少速度
- @hp_agi = 0 # 每提升一次体力提升多少灵巧
- @hp_int = 0 # 每提升一次体力提升多少魔力
- # 定义说明文字
- @text_hp_sc = "可以增加生命"
- @text_str_sc = "可以增加物理攻击!"
- @text_dex_sc = "可以提高攻击的防御!"
- @text_agi_sc = "可以提高逃跑成功率!"
- @text_int_sc = "可以提高魔法攻击力!"
- @text_save = "保存分配情况并返回游戏"
- @text_reset= "重新分配能力点数"
- @text_2 = "每增加一次此项能力值,可以提升能力值"
- @text_hp = "最大" + $data_system.words.hp + "值"
- @text_sp = "最大" + $data_system.words.sp + "值"
- @text_str = "最大" + $data_system.words.str + "值"
- @text_dex = "最大" + $data_system.words.dex + "值"
- @text_agi = "最大" + $data_system.words.agi + "值"
- @text_int = "最大" + $data_system.words.int + "值"
- s_disable
- # 生成状态窗口
- @lvup_window = Window_Lvup.new(@actor)
- @lvup_window.x = 128
- @lvup_window.y = 0
- # 生成帮助窗口并初始化帮助文本
- @help_window = Window_Lvup_Help.new
- # 执行过渡
- Graphics.transition(40, "Graphics/Transitions/" + $data_system.battle_transition)
- # 主循环
- loop do
- # 刷新游戏画面
- Graphics.update
- # 刷新输入信息
- Input.update
- # 刷新画面
- update
- # 如果切换画面就中断循环
- if $scene != self
- break
- end
- end
- # 准备过渡
- Graphics.freeze
- # 释放窗口
- @command_window.dispose
- @lvup_window.dispose
- @help_window.dispose
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update
- # 刷新窗口
- @command_window.update
- # 选项明暗判断(因为太消耗资源,所以屏蔽掉了)
- s_disable
- @lvup_window.update
- #=============================================================
- # 按下 B 键的情况下
- #=============================================================
- if Input.trigger?(Input::B)
- # 演奏取消 SE
- $game_system.se_play($data_system.cancel_se)
- # 切换到地图画面
- $scene = Scene_Map.new
- return
- end
- #=============================================================
- # 按下 C 键的情况下
- #=============================================================
- if Input.trigger?(Input::C)
- if @command_window.index == 5
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- # 将角色的剩余点数带回
- $game_variables[@actor.id + LEVEL_UP_VARIABLE] = $point
- # 将角色点数实际加上
- @actor.str += $temp_str
- @actor.dex += $temp_dex
- @actor.agi += $temp_agi
- @actor.int += $temp_int
- @actor.maxhp += $temp_hp
- @actor.maxsp += $temp_sp
- # 切换到地图画面
- $scene = Scene_Map.new
- return
- end
- if @command_window.index == 6
- # 演奏确定 SE
- $game_system.se_play($data_system.cancel_se)
- # 将角色的剩余点数带入
- $point = $game_variables[@actor.id + LEVEL_UP_VARIABLE]
- # 初始化临时量
- $temp_str = 0
- $temp_dex = 0
- $temp_agi = 0
- $temp_int = 0
- $temp_hp = 0
- $temp_sp = 0
- @lvup_window.refresh
- return
- end
- if $point == 0
- # 演奏冻结 SE
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- case @command_window.index
- when 0
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- $temp_hp += @hp
- $temp_sp += @sp
- $temp_str += @hp_str
- $temp_dex += @hp_dex
- $temp_agi += @hp_agi
- $temp_int += @hp_int
- $point -= 1
- @lvup_window.refresh
- s_disable
- return
- when 1
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- $temp_str += @str_str
- $temp_hp += @str_hp
- $temp_sp += @str_sp
- $temp_dex += @str_dex
- $temp_agi += @str_agi
- $temp_int += @str_int
- $point -= 1
- @lvup_window.refresh
- s_disable
- return
- when 2
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- $temp_dex += @dex_dex
- $temp_hp += @dex_hp
- $temp_sp += @dex_sp
- $temp_str += @dex_str
- $temp_agi += @dex_agi
- $temp_int += @dex_int
- $point -= 1
- @lvup_window.refresh
- s_disable
- return
- when 3
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- $temp_agi += @agi_agi
- $temp_hp += @agi_hp
- $temp_sp += @agi_sp
- $temp_str += @agi_str
- $temp_dex += @agi_dex
- $temp_int += @agi_int
- $point -= 1
- @lvup_window.refresh
- s_disable
- return
- when 4
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- $temp_int += @int_int
- $temp_hp += @int_hp
- $temp_sp += @int_sp
- $temp_str += @int_str
- $temp_dex += @int_dex
- $temp_agi += @int_agi
- $point -= 1
- @lvup_window.refresh
- s_disable
- return
- end
- end
- #=============================================================
- # 什么都没有按下的情况
- #=============================================================
- case @command_window.index
- when 0 # 增加体力
- temptext1 = @text_hp + @hp.to_s + "点 " + @text_str + @hp_str.to_s + "点 " + @text_dex + @hp_dex.to_s + "点"
- temptext2 = @text_sp + @sp.to_s + "点 " + @text_agi + @hp_agi.to_s + "点 " + @text_int + @hp_int.to_s + "点"
- @help_window.lvup_text(@text_hp_sc , @text_2 , temptext1 , temptext2)
- when 1 # 增加力量
- temptext1 = @text_hp + @str_hp.to_s + "点 " + @text_str + @str_str.to_s + "点 " + @text_dex + @str_dex.to_s + "点"
- temptext2 = @text_sp + @str_sp.to_s + "点 " + @text_agi + @str_agi.to_s + "点 " + @text_int + @str_int.to_s + "点"
- @help_window.lvup_text(@text_str_sc , @text_2 , temptext1 , temptext2)
- when 2 # 增加灵巧
- temptext1 = @text_hp + @dex_hp.to_s + "点 " + @text_str + @dex_agi.to_s + "点 " + @text_dex + @dex_dex.to_s + "点"
- temptext2 = @text_sp + @dex_sp.to_s + "点 " + @text_agi + @dex_agi.to_s + "点 " + @text_int + @dex_int.to_s + "点"
- @help_window.lvup_text(@text_dex_sc , @text_2 , temptext1 , temptext2)
- when 3 # 增加速度
- temptext1 = @text_hp + @agi_hp.to_s + "点 " + @text_str + @agi_str.to_s + "点 " + @text_dex + @agi_dex.to_s + "点"
- temptext2 = @text_sp + @agi_sp.to_s + "点 " + @text_agi + @agi_agi.to_s + "点 " + @text_int + @agi_int.to_s + "点"
- @help_window.lvup_text(@text_agi_sc , @text_2 , temptext1 , temptext2)
- when 4 # 增加魔力
- temptext1 = @text_hp + @int_hp.to_s + "点 " + @text_str + @int_str.to_s + "点 " + @text_dex + @int_dex.to_s + "点"
- temptext2 = @text_sp + @int_sp.to_s + "点 " + @text_agi + @int_agi.to_s + "点 " + @text_int + @int_int.to_s + "点"
- @help_window.lvup_text(@text_int_sc , @text_2 , temptext1 , temptext2)
- when 5 # 保存设定
- @help_window.lvup_text(@text_save)
- when 6 # 点数重置
- @help_window.lvup_text(@text_reset)
- end
- #=============================================================
- # 按下R与L换人的情况
- #=============================================================
- if Input.trigger?(Input::R)
- # 演奏光标 SE
- $game_system.se_play($data_system.cursor_se)
- # 移至下一位角色
- @actor_index += 1
- @actor_index %= $game_party.actors.size
- # 切换到别的状态画面
- $scene = Scene_Lvup.new(@actor_index , @command_window.index)
- return
- end
- # 按下 L 键的情况下
- if Input.trigger?(Input::L)
- # 演奏光标 SE
- $game_system.se_play($data_system.cursor_se)
- # 移至上一位角色
- @actor_index += $game_party.actors.size - 1
- @actor_index %= $game_party.actors.size
- # 切换到别的状态画面
- $scene = Scene_Lvup.new(@actor_index , @command_window.index)
- return
- end
- end
- #--------------------------------------------------------------------------
- # ● 选项明暗判断
- #--------------------------------------------------------------------------
- def s_disable
- # 判断剩余点数是否为0,如果为0,那么增加选项表示为暗色
- if $point == 0
- @command_window.disable_item(0)
- @command_window.disable_item(1)
- @command_window.disable_item(2)
- @command_window.disable_item(3)
- @command_window.disable_item(4)
- else
- @command_window.able_item(0)
- @command_window.able_item(1)
- @command_window.able_item(2)
- @command_window.able_item(3)
- @command_window.able_item(4)
- end
- end
- end
- #==============================================================================
- # 本脚本来自www.66RPG.com,使用和转载请保留此信息
- #==============================================================================
复制代码 升级后,没有加点 |
|