| 赞 | 204 |
| VIP | |
| 好人卡 | |
| 积分 | 122 |
| 经验 | |
| 最后登录 | 2025-11-17 |
| 在线时间 | 4435 小时 |
- 梦石
- 0
- 星屑
- 12161
- 在线时间
- 4435 小时
- 注册时间
- 2014-4-11
- 回帖
- 5616

|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有账号?注册会员
×
本帖最后由 yang1zhi 于 2016-1-31 21:09 编辑
这两个脚本怎么结合在一起。
一起使用后只有主角可以加点。切换人物无效。
看脚本,应该是把$game_party.actors都改成$game_party.waiting_actors
但是没用
只要出战人物能加点就好,待机的保留
试出来了
加点脚本- #==============================================================================
- # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
- #==============================================================================
- # 脚本使用设定:
- 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
- @ap = [@hp, self.maxhp].min
- @sp = [@sp, self.maxsp].min
- @mp = [@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 = "HP上升"
- s2 = "MP上升"
- s3 = $data_system.words.str+"上升"
- s4 = $data_system.words.dex+"上升"
- s5 = $data_system.words.agi+"上升"
- s6 = $data_system.words.int+"上升"
- s7 = "确认"
- s8 = "重置"
- @command_window = Window_Command.new(128, [s1, s2, s3, s4, s5, s6, s7, s8])
- @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 = 5 # 每提升一次力量附加提升多少力量
- #=========================================================================
- # 每提升一次灵巧,提升多少附加能力
- #=========================================================================
- @dex_hp = 0 # 每提升一次灵巧附加提升多少HP
- @dex_sp = 0 # 每提升一次灵巧附加提升多少SP
- @dex_str = 0 # 每提升一次灵巧附加提升多少力量
- @dex_agi = 0 # 每提升一次灵巧附加提升多少速度
- @dex_int = 0 # 每提升一次灵巧附加提升多少魔力
- @dex_dex = 5 # 每提升一次灵巧附加提升多少灵巧
- #=========================================================================
- # 每提升一次速度,提升多少附加能力
- #=========================================================================
- @agi_hp = 0 # 每提升一次速度附加提升多少HP
- @agi_sp = 0 # 每提升一次速度附加提升多少SP
- @agi_str = 0 # 每提升一次速度附加提升多少力量
- @agi_dex = 0 # 每提升一次速度附加提升多少灵巧
- @agi_int = 0 # 每提升一次速度附加提升多少魔力
- @agi_agi = 5 # 每提升一次速度附加提升多少速度
- #=========================================================================
- # 每提升一次魔力,提升多少附加能力
- #=========================================================================
- @int_hp = 0 # 每提升一次魔力附加提升多少HP
- @int_sp = 0 # 每提升一次魔力附加提升多少SP
- @int_str = 0 # 每提升一次魔力附加提升多少力量
- @int_dex = 0 # 每提升一次魔力附加提升多少灵巧
- @int_agi = 0 # 每提升一次魔力附加提升多少速度
- @int_int = 5 # 每提升一次魔力附加提升多少魔力
- #=========================================================================
- # 每提升一次体力,提升多少附加能力
- #=========================================================================
- @hp = 10 # 每提升一次体力提升多少HP
- @sp = 0 # 每提升一次体力提升多少SP
- @hp_str = 0 # 每提升一次体力提升多少力量
- @hp_dex = 0 # 每提升一次体力提升多少速度
- @hp_agi = 0 # 每提升一次体力提升多少灵巧
- @hp_int = 0 # 每提升一次体力提升多少魔力
- #=========================================================================
- # 每提升一次体力,提升多少附加能力
- #=========================================================================
- @ap = 0 # 每提升一次体力提升多少HP
- @mp = 10 # 每提升一次体力提升多少SP
- @hp_str = 0 # 每提升一次体力提升多少力量
- @hp_dex = 0 # 每提升一次体力提升多少速度
- @hp_agi = 0 # 每提升一次体力提升多少灵巧
- @hp_int = 0 # 每提升一次体力提升多少魔力
- # 定义说明文字
- @text_hp_sc = "HP可以延长生存的时间!"
- @text_hp_sc = "MP可以增加技能次数!"
- @text_str_sc = $data_system.words.str + "可以增加物理攻击和物理技能的威力!"
- @text_dex_sc = $data_system.words.dex + "可以提高攻击的命中率和必杀!"
- @text_agi_sc = $data_system.words.agi + "可以提高回避、命中、逃跑成功率!"
- @text_int_sc = $data_system.words.int + "可以提高魔法的效果,可以增加1点魔法!"
- @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 == 6
- # 演奏确定 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 == 7
- # 演奏确定 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_hp += @ap
- $temp_sp += @mp
- $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 2
- # 演奏确定 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 3
- # 演奏确定 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 4
- # 演奏确定 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 5
- # 演奏确定 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 # 增加HP
- 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 # 增加MP
- temptext1 = @text_hp + @ap.to_s + "点 " + @text_str + @hp_str.to_s + "点 " + @text_dex + @hp_dex.to_s + "点"
- temptext2 = @text_sp + @mp.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 2 # 增加力量
- 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 3 # 增加灵巧
- 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 4 # 增加速度
- 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 5 # 增加魔力
- 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 6 # 保存设定
- @help_window.lvup_text(@text_save)
- when 7 # 点数重置
- @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)
- @command_window.disable_item(5)
- 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)
- @command_window.able_item(5)
-
- end
- end
- end
- #==============================================================================
- # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
- #==============================================================================
复制代码
人物扩张脚本- # 赠品:人物扩张脚本
- # 窗口界面部分来自 桜雅 在土 XRXS26
- module BFS_Setting
- # 待机人物是否获得经验
- BACKWARD_EXP_GAINABLE = false
- # 3人以下的时候,菜单是否拉伸大小(建议不要使用)
- MENU_STATUS_STRETCH = false
- # 进入键
- MENU_MEMBER_CHANGE_KEY_GO = Input::RIGHT
- # 离开键
- MENU_MEMBER_CHANGE_KEY_END = Input::LEFT
- # 可更换角色最小编号
- MENU_MEMBER_CHANGE_INDEX_MIN = 0
- # 不能待机的角色编号
- FORCETOBATTLE_ACTORS = [1]
- # 不能加入战斗的角色编号
- UMBATTLABLE_ACTORS = []
- # 不能移动的角色编号
- UNMOVABLE_ACTORS = []
- # 列数
- COLUMN_MAX = 1
- # 光标高度
- CURSOR_HEIGHT = 96
- # 一行的高度
- LINE_HEIGHT = 116
- end
- class Game_Temp
- attr_accessor :friends_need_refresh
- alias rwkz_ini initialize
- def initialize
- rwkz_ini
- @friend_need_refresh = false
- end
- end
- class Scene_Map
- alias rwkz_main main
- def main
- if $game_temp.friends_need_refresh
- BFS_Friends.delete_all_friends
- BFS_Friends.prepare_for_transferring
- $game_temp.friends_need_refresh = false
- end
- rwkz_main
- end
- end
- class Game_Party
- attr_accessor :waiting_actors
- def gain_exp(exp)
- for i in 0...$game_party.actors.size
- actor = $game_party.actors[i]
- if actor.cant_get_exp? == false
- actor.exp += exp
- end
- end
- if BFS_Setting::BACKWARD_EXP_GAINABLE
- for i in 0...$game_party.waiting_actors.size
- actor = $game_party.waiting_actors[i]
- if actor.cant_get_exp? == false
- actor.exp += exp
- end
- end
- end
- end
- alias rk initialize
- def initialize
- rk
- @waiting_actors = []
- end
- def remove_actor(actor_id)
- if @actors.size == 1
- p "数据库中的角色数量会变为0,为了游戏的正常运行,请不要这样做。"
- p "因此,系统可能会忽略此次操作,见谅"
- p "如有特殊情况,请在脚本中删除这段文字"
- return
- end
- switch_leader if actor_id == $game_party.actors[0].id
- if @actors.include?($game_actors[actor_id])
- @actors.delete($game_actors[actor_id])
- if @waiting_actors != []
- waiting_leader = @waiting_actors[0]
- @waiting_actors.delete_at(0)
- @actors.push(waiting_leader)
- end
- else
- if @waiting_actors.include?($game_actors[actor_id])
- @waiting_actors.delete($game_actors[actor_id])
- else
- return
- end
- end
- friend_party_update
- BFS_Friends.delete_all_friends
- BFS_Friends.prepare_for_transferring
- $game_player.refresh
- $scene.spriteset.dispose
- $scene.spriteset = Spriteset_Map.new
- $scene.hud_update
- end
- def add_actor(actor_id)
- actor = $game_actors[actor_id]
- unless @actors.include?(actor) or @waiting_actors.include?(actor)
- if @actors.size < $game_variables[1]
- @actors.push(actor)
- $game_player.refresh
- friend_party_update
- BFS_Friends.add(actor_id)
- $scene.spriteset.dispose
- $scene.spriteset = Spriteset_Map.new
- BFS_Friends.weapon_recheck
- else
- if @waiting_actors.size < $game_variables[2]
- @waiting_actors.push(actor)
- end
- end
- end
- end
- end
- #==============================================================================
- # --- XRXS. 第二カーソル 機構 ---
- #------------------------------------------------------------------------------
- # ウィンドウに .index2 プロパティを追加します。
- #==============================================================================
- module XRXS_Cursor2
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- def initialize(x, y, w, h)
- super(x, y, h, w)
- # 補助ウィンドウ(透明)を作成:カーソル専用
- @xrxsc2_window = Window_Selectable.new(self.x, self.y, self.width, self.height)
- @xrxsc2_window.opacity = 0
- @xrxsc2_window.active = false
- @xrxsc2_window.index = -1
- end
- #--------------------------------------------------------------------------
- # ○ 第二カーソルの設置
- #--------------------------------------------------------------------------
- def index2
- return @xrxsc2_window.index
- end
- def index2=(index)
- @xrxsc2_window.index = index
- if index == -1
- @xrxsc2_window.cursor_rect.empty
- else
- @xrxsc2_window.x = self.x
- @xrxsc2_window.y = self.y
- @xrxsc2_window.cursor_rect = self.cursor_rect
- end
- end
- #--------------------------------------------------------------------------
- # ○ 先頭の行の設定
- #--------------------------------------------------------------------------
- def top_row=(row)
- super
- # 補助ウィンドウの oy を更新
- pre_oy = @xrxsc2_window.oy
- @xrxsc2_window.oy = self.oy
- @xrxsc2_window.cursor_rect.y -= self.oy - pre_oy
- end
- #--------------------------------------------------------------------------
- # ○ 解放
- #--------------------------------------------------------------------------
- def dispose
- @xrxsc2_window.dispose
- super
- end
- #--------------------------------------------------------------------------
- # ○ X, Y 座標
- #--------------------------------------------------------------------------
- def x=(n)
- super
- @xrxsc2_window.x = self.x unless @xrxsc2_window.nil?
- end
- def y=(n)
- super
- @xrxsc2_window.y = self.y unless @xrxsc2_window.nil?
- end
- end
- # ▼▲▼ XRXS26AX. +入れ替えメニュー ver.2 ▼▲▼ built 081113
- # by 桜雅 在土
- #==============================================================================
- # ■ Window_MenuStatus
- #==============================================================================
- class Window_MenuStatus < Window_Selectable
- #--------------------------------------------------------------------------
- # ○ インクルード
- #--------------------------------------------------------------------------
- include XRXS_Cursor2
- #--------------------------------------------------------------------------
- # ● 公開インスタンス変数
- #--------------------------------------------------------------------------
- attr_reader :column_max # 列数
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- def initialize
- h = 480
- if MENU_STATUS_STRETCH
- h = $game_variables[1] * 116 + 16
- end
- super(0, 0, 480, h)
- h = ($game_party.actors.size - 1) * LINE_HEIGHT + CURSOR_HEIGHT
- self.contents = Bitmap.new(width - 32, h)
- self.active = false
- self.index = -1
- end
- #--------------------------------------------------------------------------
- # ○ 1 ページに表示できる行数の取得
- #--------------------------------------------------------------------------
- def page_row_max
- if MENU_STATUS_STRETCH
- return $game_variables[1] # 戦闘パーティ最大数
- else
- return [$game_variables[1], 4].max # 戦闘パーティ最大数(最低4)
- end
- end
- #--------------------------------------------------------------------------
- # ○ 先頭の行の取得
- #--------------------------------------------------------------------------
- def top_row
- # ウィンドウ内容の転送元 Y 座標を、1 行の高さ LINE_HEIGHT で割る
- return self.oy / LINE_HEIGHT
- end
- #--------------------------------------------------------------------------
- # ○ 先頭の行の設定
- #--------------------------------------------------------------------------
- def top_row=(row)
- super
- self.oy = self.oy/32 * LINE_HEIGHT
- end
- #--------------------------------------------------------------------------
- # ● カーソルの矩形更新
- #--------------------------------------------------------------------------
- def update_cursor_rect
- super
- unless @index < 0
- y = (self.cursor_rect.y + self.oy) * LINE_HEIGHT/32 - self.oy
- self.cursor_rect.set(0, y, self.cursor_rect.width, CURSOR_HEIGHT)
- end
- end
- end
- #==============================================================================
- # ■ Scene_Menu
- #==============================================================================
- class Scene_Menu
- include BFS_Setting
- #--------------------------------------------------------------------------
- # ● フレーム更新
- #--------------------------------------------------------------------------
- alias xrxs26ax_update update
- def update
- # インデックスを保存
- @status_index = @status_window.index
- # 呼び戻す
- xrxs26ax_update
- end
- #--------------------------------------------------------------------------
- # ● フレーム更新 (コマンドウィンドウがアクティブの場合)
- #--------------------------------------------------------------------------
- alias xrxs26ax_update_command update_command
- def update_command
- # 呼び戻す
- xrxs26ax_update_command
- # 入れ替え移行キーが押されたとき、@command_window.indexが設定値以上
- if Input.trigger?(MENU_MEMBER_CHANGE_KEY_GO) and
- @command_window.index >= MENU_MEMBER_CHANGE_INDEX_MIN
- if $game_map.map_id == 6
- # 決定 SE を演奏
- $game_system.se_play($data_system.decision_se)
- # カーソル位置を記憶
- @command_index_before_menu_member_change = @command_window.index
- # 入れ替えウィンドウへ移行
- @command_window.active = false
- @command_window.index = -1
- @status_window.active = true
- @status_window.index = 0
- else
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● フレーム更新 (ステータスウィンドウがアクティブの場合)
- #--------------------------------------------------------------------------
- alias xrxs26ax_update_status update_status
- def update_status
- # 呼び戻す
- if @command_window.index != -1
- xrxs26ax_update_status
- return
- end
- # B ボタンか入れ替え終了キーが押されたとき
- if ((Input.trigger?(Input::B) or Input.trigger?(MENU_MEMBER_CHANGE_KEY_END)) and
- @status_window.index2 == -1 and
- @status_index%@status_window.column_max == 0)
- # キャンセル SE を演奏
- $game_system.se_play($data_system.cancel_se)
- # コマンドウィンドウをアクティブにする
- @command_window.active = true
- @command_window.index = 0
- @status_window.active = false
- @status_window.index = -1
- return
- end
- # B ボタンが押されたとき
- if Input.trigger?(Input::B) and @status_window.index2 >= 0
- @status_window.index = @status_window.index2
- @status_window.index2 = -1
- return
- end
- # 決定キーが押されたとき
- if Input.trigger?(Input::C)
- if @status_window.index2 == -1
- if UNMOVABLE_ACTORS.include?(@status_window.all_actors[@status_window.index].id)
- # ブザー SE を演奏
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- # 決定 SE を演奏
- $game_system.se_play($data_system.decision_se)
- # メンバーの入れ替え一人目の決定
- @status_window.index2 = @status_window.index
- else
- if UNMOVABLE_ACTORS.include?(@status_window.all_actors[@status_window.index].id)
- # ブザー SE を演奏
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- # どちらかが戦闘メンバー かつ どちらかが戦闘禁止アクター の場合
- if (@status_window.index < $game_variables[1] or
- @status_window.index2 < $game_variables[1]) and
- (UMBATTLABLE_ACTORS.include?(@status_window.all_actors[@status_window.index].id) or
- UMBATTLABLE_ACTORS.include?(@status_window.all_actors[@status_window.index2].id))
- # ブザー SE を演奏
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- # どちらかが待機メンバー かつ どちらかが待機禁止アクター の場合
- if (@status_window.index >= $game_variables[1] or
- @status_window.index2 >= $game_variables[1]) and
- (FORCETOBATTLE_ACTORS.include?(@status_window.all_actors[@status_window.index].id) or
- FORCETOBATTLE_ACTORS.include?(@status_window.all_actors[@status_window.index2].id))
- # ブザー SE を演奏
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- # 決定 SE を演奏
- $game_system.se_play($data_system.decision_se)
- # メンバーの入れ替え二人目の決定と入れ替えの実行
- actor2 = @status_window.all_actors[@status_window.index]
- actor = @status_window.all_actors[@status_window.index2]
- @status_window.all_actors[@status_window.index2] = actor2
- @status_window.all_actors[@status_window.index] = actor
- $game_party.actors.clear
- $game_party.waiting_actors.clear
- for i in [email]0...@status_window.all_actors.size[/email]
- if i < $game_variables[1]
- $game_party.actors.push(@status_window.all_actors[i])
- else
- $game_party.waiting_actors.push(@status_window.all_actors[i])
- end
- end
- $game_temp.friends_need_refresh = true
- @status_window.index = @status_window.index2
- @status_window.index2 = -1
- $game_party.friend_party_update
- # プレイヤーをリフレッシュ
- $game_player.refresh
- # ステータスウィンドウをリフレッシュ
- @status_window.refresh
- end
- return
- end
- end
- end
- #==============================================================================
- # ■ Window_MenuStatus
- #==============================================================================
- class Window_MenuStatus < Window_Selectable
- #--------------------------------------------------------------------------
- # ○ インクルード
- #--------------------------------------------------------------------------
- include BFS_Setting
- #--------------------------------------------------------------------------
- # ● 公開インスタンス変数
- #--------------------------------------------------------------------------
- attr_reader :newitem_window
- attr_reader :all_actors
- attr_reader :bottomkeyhelp_window
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- alias xrxs26bx_initialize initialize
- def initialize
- # 呼び戻す
- xrxs26bx_initialize
- # 寄生してウィンドウを作成
- # ボトルキーヘルプウィンドウ
- @bottomkeyhelp_window = Window_BottomKeyHelp.new
- @bottomkeyhelp_window.visible = false
- # 設定変更
- self.height = 448
- self.contents = Bitmap.new(width - 32, height - 32)
- @all_actors = $game_party.actors + $game_party.waiting_actors
- refresh
- end
- #--------------------------------------------------------------------------
- # ● リフレッシュ
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- @item_max = @all_actors.size
- @column_max = 2
- y = ($game_variables[1]+1)/2 * 64 + 28
- self.contents.font.size = 16
- self.contents.font.color = system_color
- self.contents.draw_text(4, 0, 92, 28, "参战")
- self.contents.draw_text(4, y, 92, 28, "休息")
- for i in [email]0...@all_actors.size[/email]
- x = 64 + i%2 * 224
- y = i/2 * 72 + 24
- actor = @all_actors[i]
- if i >= $game_variables[1]
- y += 32
- self.contents.font.color = disabled_color
- self.contents.draw_text(x, y, 120, 32, actor.name)
- else
- draw_actor_name(actor , x , y )
- end
- draw_actor_graphic(actor, x - 40, y + 64)
- draw_actor_level(actor , x + 94, y )
- draw_actor_hp(actor , x, y + 16)
- draw_actor_sp(actor , x, y + 32)
- draw_actor_state(actor , x, y + 48)
- end
- end
- #--------------------------------------------------------------------------
- # ○ フレーム更新
- #--------------------------------------------------------------------------
- def update
- # ウィンドウを更新
- @bottomkeyhelp_window.update
- super
- end
- #--------------------------------------------------------------------------
- # ○ 解放
- #--------------------------------------------------------------------------
- def dispose
- @bottomkeyhelp_window.dispose
- super
- end
- #--------------------------------------------------------------------------
- # ● カーソルの矩形更新
- #--------------------------------------------------------------------------
- def update_cursor_rect
- if @index < 0
- self.cursor_rect.empty
- else
- y = @index/2 * 72 + 28
- if @index >= $game_variables[1]
- y += 32
- end
- self.cursor_rect.set(@index%2 * 224, y, 224, 72)
- end
- end
- end
- #==============================================================================
- # ■ Scene_Menu
- #==============================================================================
- class Scene_Menu
- #--------------------------------------------------------------------------
- # ● フレーム更新
- #--------------------------------------------------------------------------
- alias xrxs26bx_update update
- def update
- # 登録
- if @bottomkeyhelp_window.nil?
- @bottomkeyhelp_window = @status_window.bottomkeyhelp_window
- @bottomkeyhelp_window.visible = true
- set_keyhelp1
- end
- # 呼び戻す
- xrxs26bx_update
- end
- #--------------------------------------------------------------------------
- # ● フレーム更新 (コマンドウィンドウがアクティブの場合)
- #--------------------------------------------------------------------------
- alias xrxs26bx_update_command update_command
- def update_command
- # 呼び戻す
- xrxs26bx_update_command
- # 入れ替え移行キーが押されたとき
- if @command_window.index == -1 and @status_window.active
- set_keyhelp2
- end
- end
- #--------------------------------------------------------------------------
- # ● フレーム更新 (ステータスウィンドウがアクティブの場合)
- #--------------------------------------------------------------------------
- alias xrxs26bx_update_status update_status
- def update_status
- # 保存
- last_index = @status_window.index2
- # 呼び戻す
- xrxs26bx_update_status
- #
- if last_index != @status_window.index2
- # 一人目を選択した場合
- if @status_window.index2 >= 0
- set_keyhelp3
- else
- set_keyhelp2
- end
- end
- # 戻った場合
- unless @status_window.active
- set_keyhelp1
- end
- end
- #--------------------------------------------------------------------------
- # ○ キーヘルプを設定 1
- #--------------------------------------------------------------------------
- def set_keyhelp1
- @bottomkeyhelp_window.clear
- @bottomkeyhelp_window.add("B","关闭本窗口")
- @bottomkeyhelp_window.add("C","确定")
- @bottomkeyhelp_window.add("→","人物顺序调整")
- end
- #--------------------------------------------------------------------------
- # ○ キーヘルプを設定 2
- #--------------------------------------------------------------------------
- def set_keyhelp2
- @bottomkeyhelp_window.clear
- @bottomkeyhelp_window.add("←,B","返回")
- @bottomkeyhelp_window.add("C","第一个人物确定")
- end
- #--------------------------------------------------------------------------
- # ○ キーヘルプを設定 3
- #--------------------------------------------------------------------------
- def set_keyhelp3
- @bottomkeyhelp_window.clear
- @bottomkeyhelp_window.add("B","返回")
- @bottomkeyhelp_window.add("C","第二个人物确定")
- end
- end
-
- #==============================================================================
- # □ Window_BottomKeyHelp
- #------------------------------------------------------------------------------
- # 画面下で操作説明をする透明なウィンドウです。
- #==============================================================================
- class Window_BottomKeyHelp < Window_Base
- #--------------------------------------------------------------------------
- # ○ オブジェクト初期化
- #--------------------------------------------------------------------------
- def initialize
- super(0, 432, 640, 64)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.opacity = 0
- clear
- end
- #--------------------------------------------------------------------------
- # ○ クリア
- #--------------------------------------------------------------------------
- def clear
- self.contents.clear
- @now_x = 608
- end
- #--------------------------------------------------------------------------
- # ○ 追加
- #--------------------------------------------------------------------------
- def add(key, explanation)
- # 計算
- self.contents.font.size = 20
- x = self.contents.text_size(key).width
- self.contents.font.size = 16
- x += self.contents.text_size(explanation).width + 8
- @now_x -= x
- # 描写
- self.contents.font.size = 20
- self.contents.font.color = system_color
- self.contents.draw_text(@now_x, 0, x, 32, key, 0)
- self.contents.font.size = 16
- self.contents.font.color = normal_color
- self.contents.draw_text(@now_x, 0, x, 32, explanation, 2)
- # 余白
- @now_x -= 32
- end
- end
- #==============================================================================
- # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
- #==============================================================================
复制代码 |
|