赞 | 7 |
VIP | 866 |
好人卡 | 185 |
积分 | 32 |
经验 | 130059 |
最后登录 | 2024-11-27 |
在线时间 | 3618 小时 |
Lv3.寻梦者 双子人
- 梦石
- 0
- 星屑
- 3190
- 在线时间
- 3618 小时
- 注册时间
- 2009-4-4
- 帖子
- 4154
|
- #==============================================================================
- # 本脚本来自www.66RPG.com,使用和转载请保留此信息
- #==============================================================================
- # 脚本使用设定:
- LEVEL_UP_POINT = 2 # 每升一级所增加的点数
- LEVEL_UP_VARIABLE = 30 # 储存角色点数的变量编号与角色id编号的差值
- # 默认情况 = 100,
- # 则是数据库里1号角色的加点数存于101号变量
- # 3号角色的加点数存于103号变量。
- # 你可以直接操作变量赠与角色可分配点数
- # 每增加一次点数,各项能力值的变化:357-410行
-
- # 使用方法介绍:
- # 本脚本不会取代原默认加点,也就是说,默认的升级还在,但可以用这个功能手动追加点数。
- # 如果你想纯粹使用手动加点(而升级不提升能力),只要把数据库中角色升级能力,
- # 1-99级全部等于一个相同数值就行了。
- # 呼唤加点场景的方法:$scene = Scene_Lvup.new(角色编号,返回菜单编号)。
- # 默认都是0号
- # 加点场景中,page up,page down换人,如果想加点完毕后返回地图,
- # 464行$scene = Scene_Menu.new(0)改为$scene = Scene_Map.new
- # 推荐脚本搭配:魔法商店脚本,两者结合,制作自由型RPG
- class Game_Actor < Game_Battler
- #--------------------------------------------------------------------------
- # ● 定义实例变量
- #--------------------------------------------------------------------------
- attr_accessor :have_vit # 增加的VIT
- attr_accessor :have_str
- attr_accessor :have_dex
- attr_accessor :have_agi
- attr_accessor :have_int
- attr_accessor :have_true
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # actor_id : 角色 ID
- #--------------------------------------------------------------------------
- alias xz_setup setup
- def setup(actor_id)
- if have_true == 1
- #空的地方
- else
- @have_vit = 0
- @have_str = 0
- @have_dex = 0
- @have_agi = 0
- @have_int = 0
- @have_true = 1
- end
- xz_setup(actor_id)
- end
- end
- #==============================================================================
- # ■ Window_Steps
- #------------------------------------------------------------------------------
- # 菜单画面显示步数的窗口。
- #==============================================================================
- class Window_Aa < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize(actor)
- super(400, 0, 240, 320)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.opacity = 0
- self.back_opacity = 0
- @actor = actor
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- self.contents.font.color = system_color
- self.contents.draw_text(4, 0, 240, 32, "分配记录:")
- self.contents.draw_text(4, 32, 240, 32, "VIT("+ @actor.have_vit.to_s + "/150)")
- self.contents.draw_text(4, 64, 240, 32, "STR("+ @actor.have_str.to_s + "/150)")
- self.contents.draw_text(4, 96, 240, 32, "DEX("+ @actor.have_dex.to_s + "/150)")
- self.contents.draw_text(4, 128, 240, 32, "AGI("+ @actor.have_agi.to_s + "/150)")
- self.contents.draw_text(4, 160, 240, 32, "INT("+ @actor.have_int.to_s + "/150)")
- self.contents.draw_text(4, 192, 240, 32, "每次加点消耗2点加点")
- self.contents.draw_text(4, 224, 240, 32, "累计100点后消耗3点加点")
- self.contents.draw_text(4, 256, 240, 32, "累计150后不能加了")
- end
- end
- class Window_Selectable2 < Window_Base
- #--------------------------------------------------------------------------
- # ● 定义实例变量
- #--------------------------------------------------------------------------
- attr_reader :index # 光标位置
- attr_reader :help_window # 帮助窗口
- #--------------------------------------------------------------------------
- # ● 初始画对像
- # x : 窗口的 X 坐标
- # y : 窗口的 Y 坐标
- # width : 窗口的宽
- # height : 窗口的高
- #--------------------------------------------------------------------------
- def initialize(x, y, width, height)
- super(x, y, width, height)
- @item_max = 1
- @column_max = 1
- @index = -1
- end
- #--------------------------------------------------------------------------
- # ● 设置光标的位置
- # index : 新的光标位置
- #--------------------------------------------------------------------------
- def index=(index)
- @index = index
- # 刷新帮助文本 (update_help 定义了继承目标)
- if self.active and @help_window != nil
- update_help
- end
- # 刷新光标矩形
- update_cursor_rect
- end
- #--------------------------------------------------------------------------
- # ● 获取行数
- #--------------------------------------------------------------------------
- def row_max
- # 由项目数和列数计算出行数
- return (@item_max + @column_max - 1) / @column_max
- end
- #--------------------------------------------------------------------------
- # ● 获取开头行
- #--------------------------------------------------------------------------
- def top_row
- # 将窗口内容的传送源 Y 坐标、1 行的高 32 等分
- return self.oy / 40
- end
- #--------------------------------------------------------------------------
- # ● 设置开头行
- # row : 显示开头的行
- #--------------------------------------------------------------------------
- def top_row=(row)
- # row 未满 0 的场合更正为 0
- if row < 0
- row = 0
- end
- # row 超过 row_max - 1 的情况下更正为 row_max - 1
- if row > row_max - 1
- row = row_max - 1
- end
- # row 1 行高的 32 倍、窗口内容的传送源 Y 坐标
- self.oy = row * 40
- end
- #--------------------------------------------------------------------------
- # ● 获取 1 页可以显示的行数
- #--------------------------------------------------------------------------
- def page_row_max
- # 窗口的高度,设置画面的高度减去 32 ,除以 1 行的高度 32
- return (self.height - 40) / 40
- end
- #--------------------------------------------------------------------------
- # ● 获取 1 页可以显示的项目数
- #--------------------------------------------------------------------------
- def page_item_max
- # 将行数 page_row_max 乘上列数 @column_max
- return page_row_max * @column_max
- end
- #--------------------------------------------------------------------------
- # ● 帮助窗口的设置
- # help_window : 新的帮助窗口
- #--------------------------------------------------------------------------
- def help_window=(help_window)
- @help_window = help_window
- # 刷新帮助文本 (update_help 定义了继承目标)
- if self.active and @help_window != nil
- update_help
- end
- end
- #--------------------------------------------------------------------------
- # ● 更新光标矩形
- #--------------------------------------------------------------------------
- def update_cursor_rect
- # 光标位置不满 0 的情况下
- if @index < 0
- self.cursor_rect.empty
- return
- end
- # 获取当前的行
- row = @index / @column_max
- # 当前行被显示开头行前面的情况下
- if row < self.top_row
- # 从当前行向开头行滚动
- self.top_row = row
- end
- # 当前行被显示末尾行之后的情况下
- if row > self.top_row + (self.page_row_max - 1)
- # 从当前行向末尾滚动
- self.top_row = row - (self.page_row_max - 1)
- end
- # 计算光标的宽度
- cursor_width = self.width / @column_max - 40
- # 计算光标坐标
- x = @index % @column_max * (cursor_width + 40)
- y = @index / @column_max * 40 - self.oy
- # 更新光标矩形
- self.cursor_rect.set(x, y, cursor_width, 40)
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update
- super
- # 可以移动光标的情况下
- if self.active and @item_max > 0 and @index >= 0
- # 方向键下被按下的情况下
- if Input.repeat?(Input::DOWN)
- # 列数不是 1 并且不与方向键下的按下状态重复的情况、
- # 或光标位置在(项目数-列数)之前的情况下
- if (@column_max == 1 and Input.trigger?(Input::DOWN)) or
- @index < @item_max - @column_max
- # 光标向下移动
- $game_system.se_play($data_system.cursor_se)
- @index = (@index + @column_max) % @item_max
- end
- end
- # 方向键上被按下的情况下
- if Input.repeat?(Input::UP)
- # 列数不是 1 并且不与方向键下的按下状态重复的情况、
- # 或光标位置在列之后的情况下
- if (@column_max == 1 and Input.trigger?(Input::UP)) or
- @index >= @column_max
- # 光标向上移动
- $game_system.se_play($data_system.cursor_se)
- @index = (@index - @column_max + @item_max) % @item_max
- end
- end
- # 方向键右被按下的情况下
- if Input.repeat?(Input::RIGHT)
- # 列数为 2 以上并且、光标位置在(项目数 - 1)之前的情况下
- if @column_max >= 2 and @index < @item_max - 1
- # 光标向右移动
- $game_system.se_play($data_system.cursor_se)
- @index += 1
- end
- end
- # 方向键左被按下的情况下
- if Input.repeat?(Input::LEFT)
- # 列数为 2 以上并且、光标位置在 0 之后的情况下
- if @column_max >= 2 and @index > 0
- # 光标向左移动
- $game_system.se_play($data_system.cursor_se)
- @index -= 1
- end
- end
- # R 键被按下的情况下
- if Input.repeat?(Input::R)
- # 显示的最后行在数据中最后行上方的情况下
- if self.top_row + (self.page_row_max - 1) < (self.row_max - 1)
- # 光标向后移动一页
- $game_system.se_play($data_system.cursor_se)
- @index = [@index + self.page_item_max, @item_max - 1].min
- self.top_row += self.page_row_max
- end
- end
- # L 键被按下的情况下
- if Input.repeat?(Input::L)
- # 显示的开头行在位置 0 之后的情况下
- if self.top_row > 0
- # 光标向前移动一页
- $game_system.se_play($data_system.cursor_se)
- @index = [@index - self.page_item_max, 0].max
- self.top_row -= self.page_row_max
- end
- end
- end
- # 刷新帮助文本 (update_help 定义了继承目标)
- if self.active and @help_window != nil
- update_help
- end
- # 刷新光标矩形
- update_cursor_rect
- end
- end
- #==============================================================================
- # ■ Window_Command
- #------------------------------------------------------------------------------
- # 一般的命令选择行窗口。
- #==============================================================================
- class Window_Command2 < Window_Selectable2
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # width : 窗口的宽
- # commands : 命令字符串序列
- #--------------------------------------------------------------------------
- def initialize(width, commands)
- # 由命令的个数计算出窗口的高
- super(0, 0, width, commands.size * 40 + 40)
- @item_max = commands.size
- @commands = commands
- self.contents = Bitmap.new(width - 40, @item_max * 40)
- refresh
- self.index = 0
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- for i in 0...@item_max
- draw_item(i, normal_color)
- end
- end
- #--------------------------------------------------------------------------
- # ● 描绘项目
- # index : 项目编号
- # color : 文字色
- #--------------------------------------------------------------------------
- def draw_item(index, color)
- self.contents.font.color = color
- rect = Rect.new(4, 40 * index, self.contents.width - 8, 40)
- self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
- self.contents.draw_text(rect, @commands[index])
- end
- #--------------------------------------------------------------------------
- # ● 项目无效化
- # index : 项目编号
- #--------------------------------------------------------------------------
- def disable_item(index)
- draw_item(index, disabled_color)
- end
- def able_item(index)
- draw_item(index, normal_color)
- end
- end
- #==============================================================================
- # ■ 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 + 60 , 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 + 60 , y, 48, 32, maxhp.to_s ,2)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 155 - 64, y, 36, 32, "( ", 2)
- if $temp_hp >=0
- self.contents.font.color = Color.new(255, 128, 128, 255)
- self.contents.draw_text(x + 155 - 64, y, 36, 32, " +",2)
- else
- self.contents.font.color = Color.new(255,255,0,255)
- self.contents.draw_text(x + 155 - 64, y, 36, 32, " -",2)
- end
- self.contents.draw_text(x + 200 - 64, y, 36, 32, $temp_hp.to_s, 2)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 215 - 64, 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 + 60 , 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 + 60 , y, 48, 32, maxsp.to_s ,2)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 155 - 64, y, 36, 32, "( ", 2)
- if $temp_sp >=0
- self.contents.font.color = Color.new(255, 128, 128, 255)
- self.contents.draw_text(x + 155 - 64, y, 36, 32, " +",2)
- else
- self.contents.font.color = Color.new(255,255,0,255)
- self.contents.draw_text(x + 155 - 64, y, 36, 32, " -",2)
- end
- self.contents.draw_text(x + 200 - 64, y, 36, 32, $temp_sp.to_s, 2)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 215 - 64, 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 - 64, y, 16, 32, "(")
- if $temp_str >= 0
- self.contents.font.color = lvup
- self.contents.draw_text(x + 272 - 64, y, 80, 32, "+",0)
- else
- self.contents.font.color = Color.new(255,255,0,255)
- self.contents.draw_text(x + 272 - 64, y, 80, 32, "-",0)
- end
- self.contents.draw_text(x + 272 - 64, y, 80, 32, $temp_str.abs.to_s,1)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 272 - 80, 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 - 64, y, 16, 32, "(")
- if $temp_dex >= 0
- self.contents.font.color = lvup
- self.contents.draw_text(x + 272 - 64, y, 80, 32, "+",0)
- else
- self.contents.font.color = Color.new(255,255,0,255)
- self.contents.draw_text(x + 272 - 64, y, 80, 32, "-",0)
- end
- self.contents.draw_text(x + 272 - 64, y, 80, 32, $temp_dex.abs.to_s,1)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 272 - 80, 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 - 64, y, 16, 32, "(")
- if $temp_agi >= 0
- self.contents.font.color = lvup
- self.contents.draw_text(x + 272 - 64, y, 80, 32, "+",0)
- else
- self.contents.font.color = Color.new(255,255,0,255)
- self.contents.draw_text(x + 272 - 64, y, 80, 32, "-",0)
- end
- self.contents.draw_text(x + 272 - 64, y, 80, 32, $temp_agi.abs.to_s,1)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 272 - 80, 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 - 64, y, 16, 32, "(")
- if $temp_int >= 0
- self.contents.font.color = lvup
- self.contents.draw_text(x + 272 - 64, y, 80, 32, "+",0)
- else
- self.contents.font.color = Color.new(255,255,0,255)
- self.contents.draw_text(x + 272 - 64, y, 80, 32, "-",0)
- end
- self.contents.draw_text(x + 272 - 64, y, 80, 32, $temp_int.abs.to_s,1)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 272 - 80, 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 + 110, y, 36, 32, parameter_value.to_s)
- if type != 4
- self.contents.draw_text(x + 140, y, 36, 32, "→")
- end
- self.contents.font.color = lvup
- self.contents.draw_text(x + 170, 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, 576, 320)
- self.contents = Bitmap.new(width - 32, height - 32)
- @actor = actor
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- draw_actor_graphic(@actor, 18, 96)
- draw_actor_name(@actor, 4, 0)
- draw_actor_class(@actor, 4 + 144, 0)
- draw_actor_level(@actor, 36, 32)
- draw_actor_state(@actor, 33, 64)
- draw_actor_hp_lvup(@actor, 96, 32)
- draw_actor_sp_lvup(@actor, 96, 64)
- draw_actor_lvup(@actor, 4, 96, 0)
- draw_actor_lvup(@actor, 4, 128, 1)
- draw_actor_lvup(@actor, 4, 160, 2)
- draw_actor_lvup(@actor, 4, 192, 3)
- draw_actor_lvup(@actor, 4, 224, 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 = "提升VIT"
- 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_Command2.new(128, [s1, s2, s3, s4, s5, s6, s7])
- @command_window.index = @menu_index
- # 获取角色
- @actor = $game_party.actors[@actor_index]
- @aa = Window_Aa.new(@actor)
- # 将角色的剩余点数带入
- $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
-
- #添加部分——————
- $vit_a = 0
- $str_a = 0
- $dex_a = 0
- $agi_a = 0
- $int_a = 0
- #添加部分——————
-
- #=========================================================================
- # 特别提示:这些设置也可以使用小数,但是可能出现0值意外错误
- # (各种编程语言都有这种意外),建议还是使用整数,正负不限
- #=========================================================================
- # 每提升一次力量,提升多少附加能力
- #=========================================================================
- @str_hp = 6 # 每提升一次力量附加提升多少HP
- @str_sp = 0 # 每提升一次力量附加提升多少SP
- @str_dex = 0 # 每提升一次力量附加提升多少灵巧
- @str_agi = 0 # 每提升一次力量附加提升多少速度
- @str_int = 0 # 每提升一次力量附加提升多少魔力
- @str_str = 1 # 每提升一次力量附加提升多少力量
- #=========================================================================
- # 每提升一次灵巧,提升多少附加能力
- #=========================================================================
- @dex_hp = 0 # 每提升一次灵巧附加提升多少HP
- @dex_sp = 0 # 每提升一次灵巧附加提升多少SP
- @dex_str = 0 # 每提升一次灵巧附加提升多少力量
- @dex_agi = 0 # 每提升一次灵巧附加提升多少速度
- @dex_int = 0 # 每提升一次灵巧附加提升多少魔力
- @dex_dex = 1 # 每提升一次灵巧附加提升多少灵巧
- #=========================================================================
- # 每提升一次速度,提升多少附加能力
- #=========================================================================
- @agi_hp = 0 # 每提升一次速度附加提升多少HP
- @agi_sp = 0 # 每提升一次速度附加提升多少SP
- @agi_str = 0 # 每提升一次速度附加提升多少力量
- @agi_dex = 0 # 每提升一次速度附加提升多少灵巧
- @agi_int = 0 # 每提升一次速度附加提升多少魔力
- @agi_agi = 0.5 # 每提升一次速度附加提升多少速度
- #=========================================================================
- # 每提升一次魔力,提升多少附加能力
- #=========================================================================
- @int_hp = 0 # 每提升一次魔力附加提升多少HP
- @int_sp = 2 # 每提升一次魔力附加提升多少SP
- @int_str = 0 # 每提升一次魔力附加提升多少力量
- @int_dex = 0 # 每提升一次魔力附加提升多少灵巧
- @int_agi = 0 # 每提升一次魔力附加提升多少速度
- @int_int = 1 # 每提升一次魔力附加提升多少魔力
- #=========================================================================
- # 每提升一次体力,提升多少附加能力
- #=========================================================================
- @hp = 22 # 每提升一次体力提升多少HP
- @sp = 5 # 每提升一次体力提升多少SP
- @hp_str = 0 # 每提升一次体力提升多少力量
- @hp_dex = 0 # 每提升一次体力提升多少速度
- @hp_agi = 0 # 每提升一次体力提升多少灵巧
- @hp_int = 0 # 每提升一次体力提升多少魔力
- # 定义说明文字
- @text_hp_sc = "HP是维持生命的指标,SP是使用魔法损耗的能量。"
- @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 + "可以提高魔法的效果。"
- @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
- @aa.dispose
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update
- # 刷新窗口
- @aa.update
- @command_window.update
- # 选项明暗判断(因为太消耗资源,所以屏蔽掉了)
- s_disable
- @lvup_window.update
- #=============================================================
- # 按下 B 键的情况下
- #=============================================================
- if Input.trigger?(Input::B)
- #添加部分——————
- @actor.have_vit -= $vit_a
- @actor.have_str -= $str_a
- @actor.have_dex -= $dex_a
- @actor.have_agi -= $agi_a
- @actor.have_int -= $int_a
- #添加部分——————
-
- #添加部分——————
- $vit_a = 0
- $str_a = 0
- $dex_a = 0
- $agi_a = 0
- $int_a = 0
- #添加部分——————
- # 演奏取消 SE
- $game_system.se_play($data_system.cancel_se)
- # 切换到地图画面
- $scene = Scene_Menu.new(5)
- 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_Menu.new(5)
- return
- end
- if @command_window.index == 6
- # 演奏确定 SE
- $game_system.se_play($data_system.cancel_se)
- # 将角色的剩余点数带入
- $point = $game_variables[@actor.id + LEVEL_UP_VARIABLE]
- # 初始化临时量
- #添加部分——————
- @actor.have_vit -= $vit_a
- @actor.have_str -= $str_a
- @actor.have_dex -= $dex_a
- @actor.have_agi -= $agi_a
- @actor.have_int -= $int_a
- #添加部分——————
-
- #添加部分——————
- $vit_a = 0
- $str_a = 0
- $dex_a = 0
- $agi_a = 0
- $int_a = 0
- #添加部分——————
-
-
- $temp_str = 0
- $temp_dex = 0
- $temp_agi = 0
- $temp_int = 0
- $temp_hp = 0
- $temp_sp = 0
- @aa.refresh
- @lvup_window.refresh
- return
- end
- if $point == 0 or $point == 1
- # 演奏冻结 SE
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- case @command_window.index
- when 0
- if @actor.have_vit >= 150 or (@actor.have_vit >= 100 and $point == 2)
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- # 演奏确定 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 -= 2
- $point -= 1 if @actor.have_vit >= 100
-
- $vit_a += 1
- @actor.have_vit += 1
- @aa.refresh
-
- @lvup_window.refresh
- s_disable
- return
- when 1
- if @actor.have_str >= 150 or (@actor.have_str >= 100 and $point == 2)
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- # 演奏确定 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 -= 2
- $point -= 1 if @actor.have_str >= 100
-
- $str_a += 1
- @actor.have_str += 1
- @aa.refresh
-
- @lvup_window.refresh
- s_disable
- return
- when 2
- if @actor.have_dex >= 150 or (@actor.have_dex >= 100 and $point == 2)
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- # 演奏确定 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 -= 2
- $point -= 1 if @actor.have_dex >= 100
-
- $dex_a += 1
- @actor.have_dex += 1
- @aa.refresh
-
- @lvup_window.refresh
- s_disable
- return
- when 3
- if @actor.have_agi >= 150 or (@actor.have_agi >= 100 and $point == 2)
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- # 演奏确定 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 -= 2
- $point -= 1 if @actor.have_agi >= 100
-
- $agi_a += 1
- @actor.have_agi += 1
- @aa.refresh
-
- @lvup_window.refresh
- s_disable
- return
- when 4
- if @actor.have_int >= 150 or (@actor.have_int >= 100 and $point == 2)
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- # 演奏确定 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 -= 2
- $point -= 1 if @actor.have_int >= 100
-
- $int_a += 1
- @actor.have_int += 1
- @aa.refresh
-
- @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 + "点 Page UP ↑"
- temptext2 = @text_sp + @sp.to_s + "点 " + @text_agi + @hp_agi.to_s + "点 " + @text_int + @hp_int.to_s + "点 Page DOWN↓"
- @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 + "点 Page UP ↑"
- temptext2 = @text_sp + @str_sp.to_s + "点 " + @text_agi + @str_agi.to_s + "点 " + @text_int + @str_int.to_s + "点 Page DOWN↓"
- @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 + "点 Page UP ↑"
- temptext2 = @text_sp + @dex_sp.to_s + "点 " + @text_agi + @dex_agi.to_s + "点 " + @text_int + @dex_int.to_s + "点 Page DOWN↓"
- @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 + "点 Page UP ↑"
- temptext2 = @text_sp + @agi_sp.to_s + "点 " + @text_agi + @agi_agi.to_s + "点 " + @text_int + @agi_int.to_s + "点 Page DOWN↓"
- @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 + "点 Page UP ↑"
- temptext2 = @text_sp + @int_sp.to_s + "点 " + @text_agi + @int_agi.to_s + "点 " + @text_int + @int_int.to_s + "点 Page DOWN↓"
- @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)
- #添加部分——————
- @actor.have_vit -= $vit_a
- @actor.have_str -= $str_a
- @actor.have_dex -= $dex_a
- @actor.have_agi -= $agi_a
- @actor.have_int -= $int_a
- #添加部分——————
-
- #添加部分——————
- $vit_a = 0
- $str_a = 0
- $dex_a = 0
- $agi_a = 0
- $int_a = 0
- #添加部分——————
- # 演奏光标 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)
- #添加部分——————
- @actor.have_vit -= $vit_a
- @actor.have_str -= $str_a
- @actor.have_dex -= $dex_a
- @actor.have_agi -= $agi_a
- @actor.have_int -= $int_a
- #添加部分——————
-
- #添加部分——————
- $vit_a = 0
- $str_a = 0
- $dex_a = 0
- $agi_a = 0
- $int_a = 0
- #添加部分——————
- # 演奏光标 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 or $point == 1
- @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
- if @actor.have_vit >= 150 or (@actor.have_vit >= 100 and $point == 2)
- @command_window.disable_item(0)
- else
- @command_window.able_item(0)
- end
- if @actor.have_str >= 150 or (@actor.have_str >= 100 and $point == 2)
- @command_window.disable_item(1)
- else
- @command_window.able_item(1)
- end
- if @actor.have_dex >= 150 or (@actor.have_dex >= 100 and $point == 2)
- @command_window.disable_item(2)
- else
- @command_window.able_item(2)
- end
- if @actor.have_agi >= 150 or (@actor.have_agi >= 100 and $point == 2)
- @command_window.disable_item(3)
- else
- @command_window.able_item(3)
- end
- if @actor.have_int >= 150 or (@actor.have_int >= 100 and $point == 2)
- @command_window.disable_item(4)
- else
- @command_window.able_item(4)
- end
- end
- end
- end
- #==============================================================================
- # 本脚本来自www.66RPG.com,使用和转载请保留此信息
- #==============================================================================
复制代码 改好 |
评分
-
查看全部评分
|