| 赞 | 50 |
| VIP | |
| 好人卡 | |
| 积分 | 176 |
| 经验 | |
| 最后登录 | 2026-11-3 |
| 在线时间 | 4250 小时 |
- 梦石
- 0
- 星屑
- 17566
- 在线时间
- 4250 小时
- 注册时间
- 2013-7-18
- 回帖
- 2491
|
发表于 2021-1-13 19:56:08
|
显示全部楼层
- # 脚本使用设定:
- LEVEL_UP_POINT = 8 # 每升一级所增加的点数
- LEVEL_UP_VARIABLE = 300 # 储存角色点数的变量编号与角色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, 99999999999999].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,0, 255, 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, 0, 255, 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(0,191, 255, 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(0, 191, 255, 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(0, 255, 0, 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,215,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,215,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,215,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,215,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
- self.opacity = 0
- 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
-
- @menu_com = Sprite.new
- @menu_com.bitmap = RPG::Cache.picture("菜单.jpg")
-
-
- 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 = 0 # 每提升一次力量附加提升多少HP
- @str_sp = 0 # 每提升一次力量附加提升多少SP
- @str_dex = 0 # 每提升一次力量附加提升多少灵巧
- @str_agi = 0 # 每提升一次力量附加提升多少速度
- @str_int = 0 # 每提升一次力量附加提升多少魔力
- @str_str = 2 # 每提升一次力量附加提升多少力量
- #=========================================================================
- # 每提升一次灵巧,提升多少附加能力
- #=========================================================================
- @dex_hp = 0 # 每提升一次灵巧附加提升多少HP
- @dex_sp = 0 # 每提升一次灵巧附加提升多少SP
- @dex_str = 0 # 每提升一次灵巧附加提升多少力量
- @dex_agi = 0 # 每提升一次灵巧附加提升多少速度
- @dex_int = 0 # 每提升一次灵巧附加提升多少魔力
- @dex_dex = 2 # 每提升一次灵巧附加提升多少灵巧
- #=========================================================================
- # 每提升一次速度,提升多少附加能力
- #=========================================================================
- @agi_hp = 0 # 每提升一次速度附加提升多少HP
- @agi_sp = 0 # 每提升一次速度附加提升多少SP
- @agi_str = 0 # 每提升一次速度附加提升多少力量
- @agi_dex = 0 # 每提升一次速度附加提升多少灵巧
- @agi_int = 0 # 每提升一次速度附加提升多少魔力
- @agi_agi = 2 # 每提升一次速度附加提升多少速度
- #=========================================================================
- # 每提升一次魔力,提升多少附加能力
- #=========================================================================
- @int_hp = 0 # 每提升一次魔力附加提升多少HP
- @int_sp = 0 # 每提升一次魔力附加提升多少SP
- @int_str = 0 # 每提升一次魔力附加提升多少力量
- @int_dex = 0 # 每提升一次魔力附加提升多少灵巧
- @int_agi = 0 # 每提升一次魔力附加提升多少速度
- @int_int = 2 # 每提升一次魔力附加提升多少魔力
- #=========================================================================
- # 每提升一次体力,提升多少附加能力
- #=========================================================================
- @hp = 35 # 每提升一次体力提升多少HP
- @sp = 14 # 每提升一次体力提升多少SP
- @hp_str = 0 # 每提升一次魔力附加提升多少力量
- @hp_dex = 0 # 每提升一次魔力附加提升多少灵巧
- @hp_agi = 0 # 每提升一次魔力附加提升多少速度
- @hp_int = 0 # 每提升一次魔力附加提升多少魔力
-
- # 定义说明文字
- @text_hp_sc = "体质可以增加HP和SP!Q,W 换人"
- @text_str_sc = $data_system.words.str + "可以增加物理攻击的伤害! Q,W 换人"
- @text_dex_sc = $data_system.words.dex + "可以提高命中率! Q,W 换人"
- @text_agi_sc = $data_system.words.agi + "可以提高攻击速度,逃跑成功率! Q,W 换人"
- @text_int_sc = $data_system.words.int + "可以增加魂技的伤害! Q,W 换人"
- @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(20, "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_Menu.new(5)
- return
- end
- #=============================================================
- # 按下 C 键的情况下
- #=============================================================
- if Input.repeat?(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_Lvup.new(@actor_index , @command_window.index)
- #$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
复制代码
---------------------------能力破限:
- #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
- #_/ ◆ 限界突破 - KGC_LimitBreak ◆
- #_/ ◇ Last update : 2008/01/10 ◇
- #_/----------------------------------------------------------------------------
- #_/ 各種設定値の上限を変更します。
- #_/============================================================================
- #_/ なるべく [Scene_Debug] のすぐ下に導入してください。
- #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
- #==============================================================================
- # ★ カスタマイズ項目 ★
- #==============================================================================
- module KGC
- module LimitBreak
- # ◆能力値算出方式
- # 0..データベース通り。
- # (100以降は計算式として ACTOR_LV100_CALC を使用)
- #
- # 1..データベースを用いた2次関数。
- # a:レベル1の値 b:レベル2の値 c:レベル3の値 x:現レベル
- # として、
- # ax^2 + bx + c
- # を用いて能力値を算出。
- #
- # 2..データベースを用いた1次関数。
- # b:レベル2の値 c:レベル3の値 x:現レベル
- # として、
- # bx + c
- # を用いて能力値を算出。
- # (レベル2,3の値を使うのは、2次関数方式との使い分けを楽にするため)
- CALC_PARAMETER_METHOD = 0
- # ◆レベル 100 以降の能力値計算式
- # (CALC_PARAMETER_METHOD が 0 のときに使用)
- # 【lv..現レベル p[x]..レベル x の能力値】
- # この計算結果をレベル 99 の能力値に加算。
- ACTOR_LV100_CALC = "(p[99] - p[98]) * (lv - 99)"
- # ◆アクターのレベル上限
- # アクターID順に配列に格納(最初は nil)
- ACTOR_LV_LIMIT = [nil]
- # ◆上限未指定アクターのレベル上限
- # 上限未指定(nil)のアクターはこの値を使用。
- ACTOR_LV_LIMIT_DEFAULT = 9999
- $actover = ACTOR_LV_LIMIT_DEFAULT + 1
- # ◆アクターの経験値上限
- ACTOR_EXP_LIMIT = 4200000000
- # ◆アクターのHP上限
- ACTOR_HP_LIMIT = 999999999
- # ◆アクターのSP上限
- ACTOR_SP_LIMIT = 999999
- # ◆アクターの「腕力, 器用さ, 素早さ, 魔力」上限
- ACTOR_ETC_LIMIT = 99999
- # ◆敵のHP上限
- ENEMY_HP_LIMIT = 4200000000
- # ◆敵のSP上限
- ENEMY_SP_LIMIT = 999999
- # ◆敵の「腕力, 器用さ, 素早さ, 魔力」上限
- ENEMY_ETC_LIMIT = 99999
- # ◆アクター能力値修正値(百分率)
- # アクターの能力値がデータベースの設定値の○%になる。
- # (上限値が高い場合に使用。データベースの値を使う場合は 100)
- ACTOR_MAXHP_REVISE = 100 # MAXHP
- ACTOR_MAXSP_REVISE = 100 # MAXSP
- ACTOR_STR_REVISE = 100 # 腕力
- ACTOR_DEX_REVISE = 100 # 器用さ
- ACTOR_AGI_REVISE = 100 # 素早さ
- ACTOR_INT_REVISE = 100 # 魔力
- # ◆敵能力値修正値(百分率)
- # 敵の能力値がデータベースの設定値の○%になる。
- ENEMY_MAXHP_REVISE = 100 # MAXHP
- ENEMY_MAXSP_REVISE = 100 # MAXSP
- ENEMY_STR_REVISE = 100 # 腕力
- ENEMY_DEX_REVISE = 100 # 器用さ
- ENEMY_AGI_REVISE = 100 # 素早さ
- ENEMY_INT_REVISE = 100 # 魔力
- ENEMY_ATK_REVISE = 100 # 攻撃力
- ENEMY_PDEF_REVISE = 100 # 物理防御
- ENEMY_MDEF_REVISE = 100 # 魔法防御
- # ◆所持金上限
- GOLD_LIMIT = 999999999
- # ◆アイテム所持数上限
- ITEM_LIMIT = [99999] # ← これは消さないこと!
- # この下に、アイテム所持数の上限を
- # ITEM_LIMIT[アイテムID] = 所持数上限
- # という書式で設定。
- # <例> アイテム 1 は 99 個所持可能
- # ITEM_LIMIT[1] = 99
- # ◆武器所持数上限
- # 指定方法はアイテムと同じ。
- WEAPON_LIMIT = [9999] # ← これは消さないこと!
- # ◆防具所持数上限
- # 指定方法はアイテムと同じ。
- ARMOR_LIMIT = [9999] # ← これは消さないこと!
- # ◆アイテム所持数上限 (デフォルト)
- # 上限を指定しなかったアイテム、武器、防具はこの値を上限として使用。
- ITEM_LIMIT_DEFAULT = 99999
- module_function
- #--------------------------------------------------------------------------
- # ○ 敵能力値直接指定
- # ここで、敵の最大HPなどを直接指定することができます。
- # データベースに入りきらない数値を指定する場合に使用してください。
- #--------------------------------------------------------------------------
- def set_enemy_status
- # <例> ID:10 の敵のHPを 2000000 にする場合
- # $data_enemies[10].maxhp = 2000000
- # <例> ID:16 の敵の攻撃力を 5000 にする場合
- # $data_enemies[16].atk = 5000
- end
- end
- end
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
- $imported = {} if $imported == nil
- $imported["LimitBreak"] = true
- if $game_special_elements == nil
- $game_special_elements = {}
- $data_system = load_data("Data/System.rxdata")
- end
- module KGC::LimitBreak
- module_function
- #--------------------------------------------------------------------------
- # ● 敵の能力補正を適用
- #--------------------------------------------------------------------------
- def revise_enemy_parameters
- (1...$data_enemies.size).each { |i|
- enemy = $data_enemies[i]
- enemy.maxhp = enemy.maxhp * ENEMY_MAXHP_REVISE / 100
- enemy.maxsp = enemy.maxsp * ENEMY_MAXSP_REVISE / 100
- enemy.str = enemy.str * ENEMY_STR_REVISE / 100
- enemy.dex = enemy.dex * ENEMY_DEX_REVISE / 100
- enemy.agi = enemy.agi * ENEMY_AGI_REVISE / 100
- enemy.int = enemy.int * ENEMY_INT_REVISE / 100
- enemy.atk = enemy.atk * ENEMY_ATK_REVISE / 100
- enemy.pdef = enemy.pdef * ENEMY_PDEF_REVISE / 100
- enemy.mdef = enemy.mdef * ENEMY_MDEF_REVISE / 100
- }
- end
- end
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
- #==============================================================================
- # ■ RPG::Item
- #==============================================================================
- class RPG::Item
- #--------------------------------------------------------------------------
- # ● 所持数上限
- #--------------------------------------------------------------------------
- def number_limit
- if KGC::LimitBreak::ITEM_LIMIT[self.id] != nil
- return KGC::LimitBreak::ITEM_LIMIT[self.id]
- else
- return KGC::LimitBreak::ITEM_LIMIT_DEFAULT
- end
- end
- end
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
- #==============================================================================
- # ■ RPG::Weapon
- #==============================================================================
- class RPG::Weapon
- #--------------------------------------------------------------------------
- # ● 所持数上限
- #--------------------------------------------------------------------------
- def number_limit
- if KGC::LimitBreak::WEAPON_LIMIT[self.id] != nil
- return KGC::LimitBreak::WEAPON_LIMIT[self.id]
- else
- return KGC::LimitBreak::ITEM_LIMIT_DEFAULT
- end
- end
- end
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
- #==============================================================================
- # ■ RPG::Armor
- #==============================================================================
- class RPG::Armor
- #--------------------------------------------------------------------------
- # ● 所持数上限
- #--------------------------------------------------------------------------
- def number_limit
- if KGC::LimitBreak::ARMOR_LIMIT[self.id] != nil
- return KGC::LimitBreak::ARMOR_LIMIT[self.id]
- else
- return KGC::LimitBreak::ITEM_LIMIT_DEFAULT
- end
- end
- end
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
- #==============================================================================
- # ■ Game_Battler (分割定義 1)
- #==============================================================================
- class Game_Battler
- #--------------------------------------------------------------------------
- # ● MaxHP の取得
- #--------------------------------------------------------------------------
- def maxhp
- n = [base_maxhp + @maxhp_plus, 1].max
- @states.each { |i| n *= $data_states[i].maxhp_rate / 100.0 }
- n = [[Integer(n), 1].max, maxhp_limit].min
- return n
- end
- #--------------------------------------------------------------------------
- # ● MaxSP の取得
- #--------------------------------------------------------------------------
- def maxsp
- n = [base_maxsp + @maxsp_plus, 0].max
- @states.each { |i| n *= $data_states[i].maxsp_rate / 100.0 }
- n = [[Integer(n), 0].max, maxsp_limit].min
- return n
- end
- #--------------------------------------------------------------------------
- # ● 腕力の取得
- #--------------------------------------------------------------------------
- def str
- n = [base_str + @str_plus, 1].max
- @states.each { |i| n *= $data_states[i].str_rate / 100.0 }
- n = [[Integer(n), 1].max, parameter_limit].min
- return n
- end
- #--------------------------------------------------------------------------
- # ● 器用さの取得
- #--------------------------------------------------------------------------
- def dex
- n = [base_dex + @dex_plus, 1].max
- @states.each { |i| n *= $data_states[i].dex_rate / 100.0 }
- n = [[Integer(n), 1].max, parameter_limit].min
- return n
- end
- #--------------------------------------------------------------------------
- # ● 素早さの取得
- #--------------------------------------------------------------------------
- def agi
- n = [base_agi + @agi_plus, 1].max
- @states.each { |i| n *= $data_states[i].agi_rate / 100.0 }
- n = [[Integer(n), 1].max, parameter_limit].min
- return n
- end
- #--------------------------------------------------------------------------
- # ● 魔力の取得
- #--------------------------------------------------------------------------
- def int
- n = [base_int + @int_plus, 1].max
- @states.each { |i| n *= $data_states[i].int_rate / 100.0 }
- n = [[Integer(n), 1].max, parameter_limit].min
- return n
- end
- #--------------------------------------------------------------------------
- # ● MaxHP の設定
- # maxhp : 新しい MaxHP
- #--------------------------------------------------------------------------
- def maxhp=(maxhp)
- @maxhp_plus += maxhp - self.maxhp
- @maxhp_plus = [[@maxhp_plus, -maxhp_limit].max, maxhp_limit].min
- @hp = [@hp, self.maxhp].min
- end
- #--------------------------------------------------------------------------
- # ● MaxSP の設定
- # maxsp : 新しい MaxSP
- #--------------------------------------------------------------------------
- def maxsp=(maxsp)
- @maxsp_plus += maxsp - self.maxsp
- @maxsp_plus = [[@maxsp_plus, -maxsp_limit].max, maxsp_limit].min
- @sp = [@sp, self.maxsp].min
- end
- #--------------------------------------------------------------------------
- # ● 腕力の設定
- # str : 新しい腕力
- #--------------------------------------------------------------------------
- def str=(str)
- @str_plus += str - self.str
- @str_plus = [[@str_plus, -parameter_limit].max, parameter_limit].min
- end
- #--------------------------------------------------------------------------
- # ● 器用さの設定
- # dex : 新しい器用さ
- #--------------------------------------------------------------------------
- def dex=(dex)
- @dex_plus += dex - self.dex
- @dex_plus = [[@dex_plus, -parameter_limit].max, parameter_limit].min
- end
- #--------------------------------------------------------------------------
- # ● 素早さの設定
- # agi : 新しい素早さ
- #--------------------------------------------------------------------------
- def agi=(agi)
- @agi_plus += agi - self.agi
- @agi_plus = [[@agi_plus, -parameter_limit].max, parameter_limit].min
- end
- #--------------------------------------------------------------------------
- # ● 魔力の設定
- # int : 新しい魔力
- #--------------------------------------------------------------------------
- def int=(int)
- @int_plus += int - self.int
- @int_plus = [[@int_plus, -parameter_limit].max, parameter_limit].min
- end
- end
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
- #==============================================================================
- # ■ Game_Actor
- #==============================================================================
- class Game_Actor < Game_Battler
- #--------------------------------------------------------------------------
- # ● EXP 計算
- #--------------------------------------------------------------------------
- def make_exp_list
- actor = $data_actors[@actor_id]
- @exp_list[1] = 0
- pow_i = 2.4 + actor.exp_inflation / 100.0
- (2..(self.final_level + 1)).each { |i|
- if i > self.final_level
- @exp_list[i] = 0
- else
- n = actor.exp_basis * ((i + 3) ** pow_i) / (5 ** pow_i)
- @exp_list[i] = @exp_list[i-1] + Integer(n)
- end
- }
- end
- #--------------------------------------------------------------------------
- # ● EXP の変更
- # exp : 新しい EXP
- #--------------------------------------------------------------------------
- def exp=(exp)
- if $imported["ExpGoldIncrease"]
- rate = calc_exp_increase_rate(KGC::EXPGLD_INC_PERMIT_DOUBLE)
- exp = @exp + (exp - @exp) * rate / 100
- end
- @exp = [[exp, KGC::LimitBreak::ACTOR_EXP_LIMIT].min, 0].max
- # レベルアップ
- while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
- @level += 1
- # スキル習得
- $data_classes[@class_id].learnings.each { |j|
- if j.level == @level
- learn_skill(j.skill_id)
- end
- }
- end
- # レベルダウン
- while @exp < @exp_list[@level]
- @level -= 1
- end
- # 現在の HP と SP が最大値を超えていたら修正
- @hp = [@hp, self.maxhp].min
- @sp = [@sp, self.maxsp].min
- end
- #--------------------------------------------------------------------------
- # ○ パラメータの取得
- #--------------------------------------------------------------------------
- if KGC::LimitBreak::CALC_PARAMETER_METHOD == 0
- def parameter(type)
- if @level >= 100
- calc_text = KGC::LimitBreak::ACTOR_LV100_CALC.dup
- calc_text.gsub!(/lv/i) { "@level" }
- calc_text.gsub!(/p\[(\d+)\]/i) {
- "$data_actors[@actor_id].parameters[type, #{$1.to_i}]"
- }
- return $data_actors[@actor_id].parameters[type, 99] + eval(calc_text)
- else
- return $data_actors[@actor_id].parameters[type, @level]
- end
- end
- elsif KGC::LimitBreak::CALC_PARAMETER_METHOD == 1
- def parameter(type)
- a = $data_actors[@actor_id].parameters[type, 1]
- b = $data_actors[@actor_id].parameters[type, 2]
- c = $data_actors[@actor_id].parameters[type, 3]
- return a * @level * @level + b * @level + c
- end
- elsif KGC::LimitBreak::CALC_PARAMETER_METHOD == 2
- def parameter(type)
- b = $data_actors[@actor_id].parameters[type, 2]
- c = $data_actors[@actor_id].parameters[type, 3]
- return b * @level + c
- end
- end
- #--------------------------------------------------------------------------
- # ● 基本 MaxHP の取得
- #--------------------------------------------------------------------------
- def base_maxhp
- n = self.parameter(0)
- return n * KGC::LimitBreak::ACTOR_MAXHP_REVISE / 100
- end
- #--------------------------------------------------------------------------
- # ● MaxHP の取得
- #--------------------------------------------------------------------------
- def maxhp
- n = [base_maxhp + @maxhp_plus, 1].max
- @states.each { |i| n *= $data_states[i].maxhp_rate / 100.0 }
- n = [[Integer(n), 1].max, maxhp_limit].min
- return n
- end
- #--------------------------------------------------------------------------
- # ● 基本 MaxSP の取得
- #--------------------------------------------------------------------------
- def base_maxsp
- n = self.parameter(1)
- return n * KGC::LimitBreak::ACTOR_MAXSP_REVISE / 100
- end
- #--------------------------------------------------------------------------
- # ● MaxSP の取得
- #--------------------------------------------------------------------------
- def maxsp
- n = [base_maxsp + @maxsp_plus, 0].max
- @states.each { |i| n *= $data_states[i].maxsp_rate / 100.0 }
- n = [[Integer(n), 0].max, maxsp_limit].min
- return n
- end
- #--------------------------------------------------------------------------
- # ● 基本腕力の取得
- #--------------------------------------------------------------------------
- def base_str
- n = self.parameter(2)
- if $imported["EquipExtension"]
- n += equipment_parameter(2)
- else
- equip_item_list.each { |item| n += (item != nil ? item.str_plus : 0) }
- end
- return [[n * KGC::LimitBreak::ACTOR_STR_REVISE / 100, 1].max, parameter_limit].min
- end
- #--------------------------------------------------------------------------
- # ● 基本器用さの取得
- #--------------------------------------------------------------------------
- def base_dex
- n = self.parameter(3)
- if $imported["EquipExtension"]
- n += equipment_parameter(3)
- else
- equip_item_list.each { |item| n += (item != nil ? item.dex_plus : 0) }
- end
- return [[n * KGC::LimitBreak::ACTOR_DEX_REVISE / 100, 1].max, parameter_limit].min
- end
- #--------------------------------------------------------------------------
- # ● 基本素早さの取得
- #--------------------------------------------------------------------------
- def base_agi
- n = self.parameter(4)
- if $imported["EquipExtension"]
- n += equipment_parameter(4)
- else
- equip_item_list.each { |item| n += (item != nil ? item.agi_plus : 0) }
- end
- return [[n * KGC::LimitBreak::ACTOR_AGI_REVISE / 100, 1].max, parameter_limit].min
- end
- #--------------------------------------------------------------------------
- # ● 基本魔力の取得
- #--------------------------------------------------------------------------
- def base_int
- n = self.parameter(5)
- if $imported["EquipExtension"]
- n += equipment_parameter(5)
- else
- equip_item_list.each { |item| n += (item != nil ? item.int_plus : 0) }
- end
- return [[n * KGC::LimitBreak::ACTOR_INT_REVISE / 100, 1].max, parameter_limit].min
- end
- #--------------------------------------------------------------------------
- # ● レベルの変更
- # level : 新しいレベル
- #--------------------------------------------------------------------------
- def level=(level)
- # 上下限チェック
- level = [[level, self.final_level].min, 1].max
- # EXP を変更
- self.exp = @exp_list[level]
- end
- #--------------------------------------------------------------------------
- # ● 最終レベルの取得
- #--------------------------------------------------------------------------
- def final_level
- return (KGC::LimitBreak::ACTOR_LV_LIMIT[@actor_id] != nil ?
- KGC::LimitBreak::ACTOR_LV_LIMIT[@actor_id] : KGC::LimitBreak::ACTOR_LV_LIMIT_DEFAULT)
- end
- #--------------------------------------------------------------------------
- # ○ MaxHP 限界値の取得
- #--------------------------------------------------------------------------
- def maxhp_limit
- return KGC::LimitBreak::ACTOR_HP_LIMIT
- end
- #--------------------------------------------------------------------------
- # ○ MaxSP 限界値の取得
- #--------------------------------------------------------------------------
- def maxsp_limit
- return KGC::LimitBreak::ACTOR_SP_LIMIT
- end
- #--------------------------------------------------------------------------
- # ○ パラメータ限界値の取得
- #--------------------------------------------------------------------------
- def parameter_limit
- return KGC::LimitBreak::ACTOR_ETC_LIMIT
- end
- #--------------------------------------------------------------------------
- # ○ 装備武器リストの取得
- #--------------------------------------------------------------------------
- def equip_weapon_list
- result = [$data_weapons[@weapon_id]]
- return result.compact
- end
- #--------------------------------------------------------------------------
- # ○ 装備防具リストの取得
- #--------------------------------------------------------------------------
- def equip_armor_list
- result = []
- (1..4).each { |i| result << $data_armors[eval("@armor#{i}_id")] }
- return result.compact
- end
- #--------------------------------------------------------------------------
- # ○ 装備品リストの取得
- #--------------------------------------------------------------------------
- def equip_item_list
- return equip_weapon_list + equip_armor_list
- end
- end
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
- #==============================================================================
- # ■ Game_Enemy
- #==============================================================================
- class Game_Enemy < Game_Battler
- #--------------------------------------------------------------------------
- # ○ MaxHP 限界値の取得
- #--------------------------------------------------------------------------
- def maxhp_limit
- return KGC::LimitBreak::ENEMY_HP_LIMIT
- end
- #--------------------------------------------------------------------------
- # ○ MaxSP 限界値の取得
- #--------------------------------------------------------------------------
- def maxsp_limit
- return KGC::LimitBreak::ENEMY_SP_LIMIT
- end
- #--------------------------------------------------------------------------
- # ○ パラメータ限界値の取得
- #--------------------------------------------------------------------------
- def parameter_limit
- return KGC::LimitBreak::ENEMY_ETC_LIMIT
- end
- end
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
- #==============================================================================
- # ■ Game_Party
- #==============================================================================
- class Game_Party
- #--------------------------------------------------------------------------
- # ● ゴールドの増加 (減少)
- # n : 金額
- #--------------------------------------------------------------------------
- def gain_gold(n)
- # 所持金の限界値変更
- @gold = [[@gold + n, 0].max, KGC::LimitBreak::GOLD_LIMIT].min
- end
- #--------------------------------------------------------------------------
- # ● アイテムの増加 (減少)
- # item_id : アイテム ID
- # n : 個数
- #--------------------------------------------------------------------------
- def gain_item(item_id, n)
- # ハッシュの個数データを更新
- if item_id > 0
- limit = $data_items[item_id].number_limit
- @items[item_id] = [[item_number(item_id) + n, 0].max, limit].min
- end
- end
- #--------------------------------------------------------------------------
- # ● 武器の増加 (減少)
- # weapon_id : 武器 ID
- # n : 個数
- #--------------------------------------------------------------------------
- def gain_weapon(weapon_id, n)
- # ハッシュの個数データを更新
- if weapon_id > 0
- limit = $data_weapons[weapon_id].number_limit
- @weapons[weapon_id] = [[weapon_number(weapon_id) + n, 0].max, limit].min
- end
- end
- #--------------------------------------------------------------------------
- # ● 防具の増加 (減少)
- # armor_id : 防具 ID
- # n : 個数
- #--------------------------------------------------------------------------
- def gain_armor(armor_id, n)
- # ハッシュの個数データを更新
- if armor_id > 0
- limit = $data_armors[armor_id].number_limit
- @armors[armor_id] = [[armor_number(armor_id) + n, 0].max, limit].min
- end
- end
- end
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
- #==============================================================================
- # ■ Window_ShopBuy
- #==============================================================================
- class Window_ShopBuy < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 項目の描画
- # index : 項目番号
- #--------------------------------------------------------------------------
- def draw_item(index)
- item = @data[index]
- # アイテムの所持数を取得
- case item
- when RPG::Item
- number = $game_party.item_number(item.id)
- when RPG::Weapon
- number = $game_party.weapon_number(item.id)
- when RPG::Armor
- number = $game_party.armor_number(item.id)
- end
- # 価格が所持金以下、かつ所持数が上限でなければ通常文字色に、
- # そうでなければ無効文字色に設定
- if item.price <= $game_party.gold && number < item.number_limit
- self.contents.font.color = normal_color
- else
- self.contents.font.color = disabled_color
- end
- x = 4
- y = index * 32
- rect = Rect.new(x, y, self.width - 32, 32)
- self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
- bitmap = RPG::Cache.icon(item.icon_name)
- opacity = self.contents.font.color == normal_color ? 255 : 128
- self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
- self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
- self.contents.draw_text(x + 240, y, 88, 32, item.price.to_s, 2)
- end
- end
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
- #==============================================================================
- # ■ Scene_Title
- #==============================================================================
- class Scene_Title
- #--------------------------------------------------------------------------
- # ● コマンド : ニューゲーム
- #--------------------------------------------------------------------------
- alias command_new_game_KGC_LimitBreak command_new_game
- def command_new_game
- command_new_game_KGC_LimitBreak
- KGC::LimitBreak.revise_enemy_parameters
- KGC::LimitBreak.set_enemy_status
- end
- #--------------------------------------------------------------------------
- # ● コマンド : コンティニュー
- #--------------------------------------------------------------------------
- alias command_continue_KGC_LimitBreak command_continue
- def command_continue
- command_continue_KGC_LimitBreak
- KGC::LimitBreak.revise_enemy_parameters
- KGC::LimitBreak.set_enemy_status
- end
- #--------------------------------------------------------------------------
- # ● 戦闘テスト
- #--------------------------------------------------------------------------
- alias battle_test_KGC_LimitBreak battle_test
- def battle_test
- battle_test_KGC_LimitBreak
- KGC::LimitBreak.revise_enemy_parameters
- KGC::LimitBreak.set_enemy_status
- end
- end
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
- #==============================================================================
- # ■ Scene_Shop
- #==============================================================================
- class Scene_Shop
- #--------------------------------------------------------------------------
- # ● フレーム更新 (購入ウィンドウがアクティブの場合)
- #--------------------------------------------------------------------------
- def update_buy
- # ステータスウィンドウのアイテムを設定
- @status_window.item = @buy_window.item
- # B ボタンが押された場合
- if Input.trigger?(Input::B)
- # キャンセル SE を演奏
- $game_system.se_play($data_system.cancel_se)
- # ウィンドウの状態を初期モードへ
- @command_window.active = true
- @dummy_window.visible = true
- @buy_window.active = false
- @buy_window.visible = false
- @status_window.visible = false
- @status_window.item = nil
- # ヘルプテキストを消去
- @help_window.set_text("")
- return
- end
- # C ボタンが押された場合
- if Input.trigger?(Input::C)
- # アイテムを取得
- @item = @buy_window.item
- # アイテムが無効の場合、または価格が所持金より上の場合
- if @item == nil or @item.price > $game_party.gold
- # ブザー SE を演奏
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- # アイテムの所持数を取得
- case @item
- when RPG::Item
- number = $game_party.item_number(@item.id)
- when RPG::Weapon
- number = $game_party.weapon_number(@item.id)
- when RPG::Armor
- number = $game_party.armor_number(@item.id)
- end
- # すでに上限まで個所持している場合
- limit = @item.number_limit
- if number >= limit
- # ブザー SE を演奏
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- # 決定 SE を演奏
- $game_system.se_play($data_system.decision_se)
- # 最大購入可能個数を計算
- max = (@item.price == 0 ? limit : $game_party.gold / @item.price)
- max = [max, limit - number].min
- # ウィンドウの状態を個数入力モードへ
- @buy_window.active = false
- @buy_window.visible = false
- @number_window.set(@item, max, @item.price)
- @number_window.active = true
- @number_window.visible = true
- end
- end
- end
复制代码
---------以上是我用的加点和能力破限。
|
评分
-
查看全部评分
|