赞 | 0 |
VIP | 0 |
好人卡 | 1 |
积分 | 1 |
经验 | 1672 |
最后登录 | 2015-6-28 |
在线时间 | 7 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 7 小时
- 注册时间
- 2014-5-3
- 帖子
- 14
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
战斗系统为横版(有5个要分别打在原来的战斗脚本上替换,第五个自己插入在空白处。)
战斗系统1:战斗系统2:战斗系统3:战斗系统4:- #==============================================================================
- # ■ Scene_Battle (分割定义 4)
- #------------------------------------------------------------------------------
- # 处理战斗画面的类。
- #==============================================================================
- class Scene_Battle
- #--------------------------------------------------------------------------
- # ● 开始主回合
- #--------------------------------------------------------------------------
- def start_phase4
- # 转移到回合 4
- @phase = 4
- # 回合数计数
- $game_temp.battle_turn += 1
- # 搜索全页的战斗事件
- for index in 0...$data_troops[@troop_id].pages.size
- # 获取事件页
- page = $data_troops[@troop_id].pages[index]
- # 本页的范围是 [回合] 的情况下
- if page.span == 1
- # 设置已经执行标志
- $game_temp.battle_event_flags[index] = false
- end
- end
- # 设置角色为非选择状态
- @actor_index = -1
- @active_battler = nil
- # 有效化同伴指令窗口
- @party_command_window.active = false
- @party_command_window.visible = false
- # 无效化角色指令窗口
- @actor_command_window.active = false
- @actor_command_window.visible = false
- # 设置主回合标志
- $game_temp.battle_main_phase = true
- # 生成敌人行动
- for enemy in $game_troop.enemies
- enemy.make_action
- end
- # 生成行动顺序
- make_action_orders
- # 移动到步骤 1
- @phase4_step = 1
- end
- #--------------------------------------------------------------------------
- # ● 生成行动循序
- #--------------------------------------------------------------------------
- def make_action_orders
- # 初始化序列 @action_battlers
- @action_battlers = []
- # 添加敌人到 @action_battlers 序列
- for enemy in $game_troop.enemies
- @action_battlers.push(enemy)
- end
- # 添加角色到 @action_battlers 序列
- for actor in $game_party.actors
- @action_battlers.push(actor)
- end
- # 确定全体的行动速度
- for battler in @action_battlers
- battler.make_action_speed
- end
- # 按照行动速度从大到小排列
- @action_battlers.sort! {|a,b|
- b.current_action.speed - a.current_action.speed }
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面 (主回合)
- #--------------------------------------------------------------------------
- def update_phase4
- case @phase4_step
- when 1
- update_phase4_step1
- when 2
- update_phase4_step2
- when 3
- update_phase4_step3
- when 4
- update_phase4_step4
- when 5
- update_phase4_step5
- when 6
- update_phase4_step6
- end
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面 (主回合步骤 1 : 准备行动)
- #--------------------------------------------------------------------------
- def update_phase4_step1
- # 隐藏帮助窗口
- @help_window.visible = false
- # 判定胜败
- if judge
- # 胜利或者失败的情况下 : 过程结束
- return
- end
- # 强制行动的战斗者不存在的情况下
- if $game_temp.forcing_battler == nil
- # 设置战斗事件
- setup_battle_event
- # 执行战斗事件中的情况下
- if $game_system.battle_interpreter.running?
- return
- end
- end
- # 强制行动的战斗者存在的情况下
- if $game_temp.forcing_battler != nil
- # 在头部添加后移动
- @action_battlers.delete($game_temp.forcing_battler)
- @action_battlers.unshift($game_temp.forcing_battler)
- end
- # 未行动的战斗者不存在的情况下 (全员已经行动)
- if @action_battlers.size == 0
- # 开始同伴命令回合
- start_phase2
- return
- end
- # 初始化动画 ID 和公共事件 ID
- @animation1_id = 0
- @animation2_id = 0
- @common_event_id = 0
- # 未行动的战斗者移动到序列的头部
- @active_battler = @action_battlers.shift
- # 如果已经在战斗之外的情况下
- if @active_battler.index == nil
- return
- end
- # 连续伤害
- if @active_battler.hp > 0 and @active_battler.slip_damage?
- @active_battler.slip_damage_effect
- @active_battler.damage_pop = true
- end
- # 当角色生命>0并且中了22号状态
- if @active_battler.hp > 0 and @active_battler.state?(22)
- @active_battler.hp += @active_battler.maxhp/10 # 恢复1/10的最大生命
- end
- # 自然解除状态
- @active_battler.remove_states_auto
- # 刷新状态窗口
- @status_window.refresh
- # 移至步骤 2
- @phase4_step = 2
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面 (主回合步骤 2 : 开始行动)
- #--------------------------------------------------------------------------
- def update_phase4_step2
- # 如果不是强制行动
- unless @active_battler.current_action.forcing
- # 限制为 [敌人为普通攻击] 或 [我方为普通攻击] 的情况下
- if @active_battler.restriction == 2 or @active_battler.restriction == 3
- # 设置行动为攻击
- @active_battler.current_action.kind = 0
- @active_battler.current_action.basic = 0
- end
- # 限制为 [不能行动] 的情况下
- if @active_battler.restriction == 4
- # 清除行动强制对像的战斗者
- $game_temp.forcing_battler = nil
- # 移至步骤 1
- @phase4_step = 1
- return
- end
- end
- # 清除对像战斗者
- @target_battlers = []
- # 行动种类分支
- case @active_battler.current_action.kind
- when 0 # 基本
- make_basic_action_result
- when 1 # 特技
- make_skill_action_result
- when 2 # 物品
- make_item_action_result
- when 3 # 逃跑
- make_escape_action_result
- end
- # 移至步骤 3
- if @phase4_step == 2
- @phase4_step = 3
- end
- end
- #--------------------------------------------------------------------------
- # ● 生成基本行动结果
- #--------------------------------------------------------------------------
- def make_basic_action_result
- # 攻击的情况下
- if @active_battler.current_action.basic == 0
- # 设置攻击 ID
- @animation1_id = @active_battler.animation1_id
- @animation2_id = @active_battler.animation2_id
- # 行动方的战斗者是敌人的情况下
- if @active_battler.is_a?(Game_Enemy)
- if @active_battler.restriction == 3
- target = $game_troop.random_target_enemy
- elsif @active_battler.restriction == 2
- target = $game_party.random_target_actor
- else
- index = @active_battler.current_action.target_index
- target = $game_party.smooth_target_actor(index)
- end
- end
- # 行动方的战斗者是角色的情况下
- if @active_battler.is_a?(Game_Actor)
- if @active_battler.restriction == 3
- target = $game_party.random_target_actor
- elsif @active_battler.restriction == 2
- target = $game_troop.random_target_enemy
- else
- index = @active_battler.current_action.target_index
- target = $game_troop.smooth_target_enemy(index)
- end
- end
- # 设置对像方的战斗者序列
- @target_battlers = [target]
- # 应用通常攻击效果
- for target in @target_battlers
- target.attack_effect(@active_battler)
- end
- return
- end
- # 防御的情况下
- if @active_battler.current_action.basic == 1
- # 帮助窗口显示"防御"
- @help_window.set_text($data_system.words.guard, 1)
- return
- end
- # 逃跑的情况下
- if @active_battler.is_a?(Game_Enemy) and
- @active_battler.current_action.basic == 2
- # 帮助窗口显示"逃跑"
- @help_window.set_text("逃跑", 1)
- # 逃跑
- @active_battler.escape
- return
- end
- # 什么也不做的情况下
- if @active_battler.current_action.basic == 3
- # 清除强制行动对像的战斗者
- $game_temp.forcing_battler = nil
- # 移至步骤 1
- @phase4_step = 1
- return
- end
- end
- #--------------------------------------------------------------------------
- # ● 设置物品或特技对像方的战斗者
- # scope : 特技或者是物品的范围
- #--------------------------------------------------------------------------
- def set_target_battlers(scope)
- # 行动方的战斗者是敌人的情况下
- if @active_battler.is_a?(Game_Enemy)
- # 效果范围分支
- case scope
- when 1 # 敌单体
- index = @active_battler.current_action.target_index
- @target_battlers.push($game_party.smooth_target_actor(index))
- when 2 # 敌全体
- for actor in $game_party.actors
- if actor.exist?
- @target_battlers.push(actor)
- end
- end
- when 3 # 我方单体
- index = @active_battler.current_action.target_index
- @target_battlers.push($game_troop.smooth_target_enemy(index))
- when 4 # 我方全体
- for enemy in $game_troop.enemies
- if enemy.exist?
- @target_battlers.push(enemy)
- end
- end
- when 5 # 我方单体 (HP 0)
- index = @active_battler.current_action.target_index
- enemy = $game_troop.enemies[index]
- if enemy != nil and enemy.hp0?
- @target_battlers.push(enemy)
- end
- when 6 # 我方全体 (HP 0)
- for enemy in $game_troop.enemies
- if enemy != nil and enemy.hp0?
- @target_battlers.push(enemy)
- end
- end
- when 7 # 使用者
- @target_battlers.push(@active_battler)
- end
- end
- # 行动方的战斗者是角色的情况下
- if @active_battler.is_a?(Game_Actor)
- # 效果范围分支
- case scope
- when 1 # 敌单体
- index = @active_battler.current_action.target_index
- @target_battlers.push($game_troop.smooth_target_enemy(index))
- when 2 # 敌全体
- for enemy in $game_troop.enemies
- if enemy.exist?
- @target_battlers.push(enemy)
- end
- end
- when 3 # 我方单体
- index = @active_battler.current_action.target_index
- @target_battlers.push($game_party.smooth_target_actor(index))
- when 4 # 我方全体
- for actor in $game_party.actors
- if actor.exist?
- @target_battlers.push(actor)
- end
- end
- when 5 # 我方单体 (HP 0)
- index = @active_battler.current_action.target_index
- actor = $game_party.actors[index]
- if actor != nil and actor.hp0?
- @target_battlers.push(actor)
- end
- when 6 # 我方全体 (HP 0)
- for actor in $game_party.actors
- if actor != nil and actor.hp0?
- @target_battlers.push(actor)
- end
- end
- when 7 # 使用者
- @target_battlers.push(@active_battler)
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 生成特技行动结果
- #--------------------------------------------------------------------------
- def make_skill_action_result
- # 获取特技
- @skill = $data_skills[@active_battler.current_action.skill_id]
- # 如果不是强制行动
- unless @active_battler.current_action.forcing
- # 因为 SP 耗尽而无法使用的情况下
- unless @active_battler.skill_can_use?(@skill.id)
- # 清除强制行动对像的战斗者
- $game_temp.forcing_battler = nil
- # 移至步骤 1
- @phase4_step = 1
- return
- end
- end
- # 消耗 SP
- @active_battler.sp -= @skill.sp_cost
- # 刷新状态窗口
- @status_window.refresh
- # 在帮助窗口显示特技名
- @help_window.set_text(@skill.name, 1)
- # 设置动画 ID
- @animation1_id = @skill.animation1_id
- @animation2_id = @skill.animation2_id
- # 设置公共事件 ID
- @common_event_id = @skill.common_event_id
- # 设置对像侧战斗者
- set_target_battlers(@skill.scope)
- # 应用特技效果
- for target in @target_battlers
- target.skill_effect(@active_battler, @skill)
- end
- end
- #--------------------------------------------------------------------------
- # ● 生成物品行动结果
- #--------------------------------------------------------------------------
- def make_item_action_result
- # 获取物品
- @item = $data_items[@active_battler.current_action.item_id]
- # 因为物品耗尽而无法使用的情况下
- unless $game_party.item_can_use?(@item.id)
- # 移至步骤 1
- @phase4_step = 1
- return
- end
- # 消耗品的情况下
- if @item.consumable
- # 使用的物品减 1
- $game_party.lose_item(@item.id, 1)
- end
- # 在帮助窗口显示物品名
- @help_window.set_text(@item.name, 1)
- # 设置动画 ID
- @animation1_id = @item.animation1_id
- @animation2_id = @item.animation2_id
- # 设置公共事件 ID
- @common_event_id = @item.common_event_id
- # 确定对像
- index = @active_battler.current_action.target_index
- target = $game_party.smooth_target_actor(index)
- # 设置对像侧战斗者
- set_target_battlers(@item.scope)
- # 应用物品效果
- for target in @target_battlers
- target.item_effect(@item)
- end
- end
- #--------------------------------------------------------------------------
- # ● 生成逃跑行动结果
- #--------------------------------------------------------------------------
- def make_escape_action_result
- # 计算敌人速度的平均值
- enemies_agi = 0
- enemies_number = 0
- for enemy in $game_troop.enemies
- if enemy.exist?
- enemies_agi += enemy.agi
- enemies_number += 1
- end
- end
- if enemies_number > 0
- enemies_agi /= enemies_number
- end
- # 计算角色速度的平均值
- actors_agi = 0
- actors_number = 0
- for actor in $game_party.actors
- if actor.exist?
- actors_agi += actor.agi
- actors_number += 1
- end
- end
- if actors_number > 0
- actors_agi /= actors_number
- end
- # 逃跑成功判定
- success = rand(100) < 75 * actors_agi / enemies_agi
- # 成功逃跑的情况下
- if success
- ############################
- $game_variables[21] += 1
- $data_common_events[425]
- ############################
- # 演奏逃跑 SE
- $game_system.se_play($data_system.escape_se)
- # 还原为战斗开始前的 BGM
- $game_system.bgm_play($game_temp.map_bgm)
- # 战斗结束
- battle_end(1)
- # 逃跑失败的情况下
- else
- # 清除全体同伴的行动
- $game_party.clear_actions
- # 开始主回合
- start_phase4
- end
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面 (主回合步骤 3 : 行动方动画)
- #--------------------------------------------------------------------------
- def update_phase4_step3
- # 行动方动画 (ID 为 0 的情况下是白色闪烁)
- if @animation1_id == 0
- @active_battler.white_flash = true
- else
- @active_battler.animation_id = @animation1_id
- @active_battler.animation_hit = true
- end
- # 移至步骤 4
- @phase4_step = 4
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面 (主回合步骤 4 : 对像方动画)
- #--------------------------------------------------------------------------
- def update_phase4_step4
- # 对像方动画
- for target in @target_battlers
- target.animation_id = @animation2_id
- target.animation_hit = (target.damage != "Miss")
- if target.is_a?(Game_Actor)
- end
- end
- # 限制动画长度、最低 8 帧
- @wait_count = 8
- # 移至步骤 5
- @phase4_step = 5
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面 (主回合步骤 5 : 显示伤害)
- #--------------------------------------------------------------------------
- def update_phase4_step5
- # 隐藏帮助窗口
- @help_window.visible = false
- # 刷新状态窗口
- @status_window.refresh
- # 显示伤害
- for target in @target_battlers
- if @active_battler.current_action.kind == 1 and @skill.name == "精灵球"
- $game_switches[500] = false
- rate_a = [( target.int*10 ),100].min
- rate_b = (100 - rate_a)
- bingo = (rand(100) < rate_b)
- if bingo
- #成功偷窃,生成偷窃物品
- make_steal_result
- #成功偷窃,设置伤害文字为Success
- target.damage = ""
- target.damage = "Success!!"
- #播放偷窃成功音效
- Audio.se_play("Audio/SE/"+"002-System02",100,100)
- $game_switches[500] = true
- $game_variables[103] += 1
- else
- #偷窃失败,设置伤害为Failed
- target.damage = ""
- target.damage = "Failed!!"
- #播放偷窃失败音效
- Audio.se_play("Audio/SE/"+"010-System10",100,100)
- end
- target.damage_pop = true
- elsif target.damage != nil
- target.damage_pop = true
- end
- end
- # 移至步骤 6
- @phase4_step = 6
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面 (主回合步骤 6 : 刷新)
- #--------------------------------------------------------------------------
- def update_phase4_step6
- # 清除强制行动对像的战斗者
- $game_temp.forcing_battler = nil
- # 公共事件 ID 有效的情况下
- if @common_event_id > 0
- # 设置事件
- common_event = $data_common_events[@common_event_id]
- $game_system.battle_interpreter.setup(common_event.list, 0)
- end
- # 移至步骤 1
- @phase4_step = 1
- end
- end
复制代码 战斗系统5:- #-----------------------------------------------------------------------
- class Scene_Battle
- #表示这是一个Scene_Battle类
-
- def make_steal_result
- #在这个类中定义一个方法:make_steal_result
- item_ser_num = rand(50)
- #获取随机数item_ser_num,值为0~49中的一个
- item_ser = 0
- #初始化item_ser为0,这个变量是用来表示偷到的物品种类,是武器,还是道具或者(可参照公共事件和下面的脚本理解)
- item_id = 101
- #初始化item_id为0,这个变量用来储存偷到的物品ID
- item_num = 102
- #初始化item_num为0,这个变量用来储存偷到的该物品数量
- case item_ser_num
- #对item_ser_num这个随机数进行条件分歧
- when 0
- #当其值为0的时候
- item_ser = 1
- #item_ser = 1,表示这是一个武器
- item_id = 7
- #item_id = ,表示ID为7
- item_num = 1
- #表示数量为1
- when 1
- #当其值为1的时候
- item_ser = 1
- #表示这是一个武器
- item_id = (rand(3) + 1)
- #ID为1~3中的一个
- item_num = 1
- #数量为1
- when 2
- #当其值为2的时候
- item_ser = 2
- #表示这是一个防具
- item_id = (rand(3) + 5)
- #ID为5~7中的任意一个
- item_num = 1
- #数量为1
- when 3..9
- #当其值为3~9之间的一个数字时
- item_ser = 0
- #表示这是一个物品
- item_id = $game_variables[99]
- #ID为9~11中的任意一个数
- item_num = 1
- #数量为1
- else #酒类
- #如果不是以上提到的任何数字且在49以内
- item_ser = 0
- #表示这是一个物品
- item_id = $game_variables[99]
- #ID为89~93中任意一个数字
- item_num = 1
- #数量为1个
- end
- #结束对于item_ser_num的条件分歧
- case item_ser
- #对于item_ser(即物品种类)进行条件分歧
- when 0 #物品
- $game_variables[100] = 0
- #是物品的话,第100号变量 = 0,用来告诉公共事件这是个物品
- when 1 #武器
- $game_variables[100] = 1
- #是武器的话,第100号变量 = 1,用来告诉公共事件这是个武器
- when 2 #防具
- $game_variables[100] = 2
- #是防具的话,第100号变量 = 2,用来告诉公共事件这是个防具
- end
- #结束对于item_ser的条件分歧
-
- $game_variables[101] = item_id
- #用第101号变量存储得到的道具ID
- $game_variables[102] = item_num
- #用第102号变量存储得到的道具数量
- end
- end
- #结束
- #------------------------------------------------------------
复制代码 战斗系统行走图战斗:- #==============================================================================
- # 本脚本来自www.66RPG.com,使用和转载请保留此信息
- #==============================================================================
- #==============================================================================
- #冲突脚本:宠物脚本1.2版(66主页拿的宠物脚本应该都会冲突)
- #注意:以下一共有两个脚本,插入后就能达到战斗动画。
- #插入脚本后先进入游戏进行战斗一下,然后就会明白素材问题了
- #素材问题:脚本采用了战斗图自动选择行走图~~~
- #使用方法:插入main前即可
- #==============================================================================
- #==============================================================================
- # ■ Sprite_Battler
- #==============================================================================
- class Sprite_Battler < RPG::Sprite
- #--------------------------------------------------------------------------
- # ● instance变量
- #--------------------------------------------------------------------------
- attr_accessor :battler # butler
- #--------------------------------------------------------------------------
- # ● 初始化
- # viewport : viewport
- # battler : butler(Game_Battler)
- #--------------------------------------------------------------------------
- def initialize(viewport, battler = nil)
- super(viewport)
- @battler = battler
- @battler_visible = false
- # 定义动画用变量
- @hoko_wait = 0
- @hoko_pattern = 0
- end
- #--------------------------------------------------------------------------
- # ● 解放
- #--------------------------------------------------------------------------
- def dispose
- if self.bitmap != nil
- self.bitmap.dispose
- end
- super
- end
- #--------------------------------------------------------------------------
- # ● 更新
- #--------------------------------------------------------------------------
- def update
- super
- # butler nil 的场合
- if @battler == nil
- self.bitmap = nil
- loop_animation(nil)
- return
- end
- # 如果文件名或者色相与现在的东西不同
- if @battler.battler_name != @battler_name or
- @battler.battler_hue != @battler_hue
- # 取得位图设定
- @battler_name = @battler.battler_name
- @battler_hue = @battler.battler_hue
- # battler→character变更
- #self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
- self.bitmap = RPG::Cache.character(@battler_name, @battler_hue)
- # width→宽度 height→高度
- @width = bitmap.width / 4
- @height = bitmap.height / 4
- self.ox = @width / 2
- self.oy = @height
- self.src_rect.set(@hoko_pattern * @width, 0, @width, @height)
- # 战斗不能再隐藏要是状态把不透明度做为 0
- if @battler.dead? or @battler.hidden
- self.opacity = 0
- end
- end
- # 如果动画ID与现在的东西有差异
- if @battler.damage == nil and
- @battler.state_animation_id != @state_animation_id
- @state_animation_id = @battler.state_animation_id
- loop_animation($data_animations[@state_animation_id])
- end
- # 应该被表示actor的场合
- if @battler.is_a?(Game_Actor) and @battler_visible
- # 不是主要阶段的时候把不透明度稍稍下降
- if $game_temp.battle_main_phase
- self.opacity += 3 if self.opacity < 255
- else
- self.opacity -= 3 if self.opacity > 207
- end
- end
- # 闪烁
- if @battler.blink
- blink_on
- else
- blink_off
- end
- # 不可见的场合
- unless @battler_visible
- # 出现
- if not @battler.hidden and not @battler.dead? and
- (@battler.damage == nil or @battler.damage_pop)
- appear
- @battler_visible = true
- end
- end
- # 可见的场合
- if @battler_visible
- # 逃走
- if @battler.hidden
- $game_system.se_play($data_system.escape_se)
- escape
- @battler_visible = false
- end
- # 白闪光
- if @battler.white_flash
- whiten
- @battler.white_flash = false
- end
- # 动画
- if @battler.animation_id != 0
- animation = $data_animations[@battler.animation_id]
- animation(animation, @battler.animation_hit)
- @battler.animation_id = 0
- end
- # 损坏
- if @battler.damage_pop
- damage(@battler.damage, @battler.critical)
- @battler.damage = nil
- @battler.critical = false
- @battler.damage_pop = false
- end
- # korapusu
- if @battler.damage == nil and @battler.dead?
- if @battler.is_a?(Game_Enemy)
- $game_system.se_play($data_system.enemy_collapse_se)
- else
- $game_system.se_play($data_system.actor_collapse_se)
- end
- collapse
- @battler_visible = false
- end
- # 行走动画
- hoko_anime()
- # p @hoko_pattern
- end
- # 设定行走图位置的坐标
- self.x = @battler.screen_x
- self.y = @battler.screen_y - 43
- self.z = @battler.screen_z
- end
- #--------------------------------------------------------------------------
- # ● 行走动画(@hoko_pattern * @width, 0, @width, @height)能设置行走图方向
- #--------------------------------------------------------------------------
- def hoko_anime()
- @hoko_wait += 1
- if @hoko_wait > 6 # wait 等待
- @hoko_wait = 0
- @hoko_pattern += 1
- if @hoko_pattern > 3
- @hoko_pattern = 0
- # p "0"
- end #pattern图案/width宽度/height高度
- self.src_rect.set(@hoko_pattern * @width, @height * 2, @width, @height)
- if battler.is_a?(Game_Actor)
- self.src_rect.set(@hoko_pattern * @width, @height, @width, @height)
- end
- end
- end
- end #enemy敌人
- #==============================================================================
- #冲突脚本:宠物脚本1.2版(66主页拿的宠物脚本应该都会冲突)
- #注意:以下一共有两个脚本,插入后就能达到战斗动画。
- #插入脚本后先进入游戏进行战斗一下,然后就会明白素材问题了
- #素材问题:脚本采用了战斗图自动选择行走图~~~
- #==============================================================================
- #==============================================================================
- # ■ Game_BattleAction
- #------------------------------------------------------------------------------
- #是处理动作 (战斗中的行动)的级。这个级 在 Game_Battler kura# su内部被使用。
- #==============================================================================
- class Game_BattleAction
- #--------------------------------------------------------------------------
- # ● instance变量
- #--------------------------------------------------------------------------
- attr_accessor :speed # 速度
- attr_accessor :kind # 类别(基本/ 技艺 / 物品)
- attr_accessor :basic # 基本(攻击/防御/逃跑)
- attr_accessor :skill_id # 特技ID
- attr_accessor :item_id # 物品ID
- attr_accessor :target_index # 对象禁书目录
- attr_accessor :forcing # 强制标志
- #--------------------------------------------------------------------------
- # ● 初始化
- #--------------------------------------------------------------------------
- def initialize
- clear
- end
- #--------------------------------------------------------------------------
- # ● clearness
- #--------------------------------------------------------------------------
- def clear
- @speed = 0
- @kind = 0
- @basic = 3
- @skill_id = 0
- @item_id = 0
- @target_index = -1
- @forcing = false
- end
- #--------------------------------------------------------------------------
- # ● 判断
- #--------------------------------------------------------------------------
- def valid?
- return (not (@kind == 0 and @basic == 3))
- end
- #--------------------------------------------------------------------------
- # ● 单体判断
- #--------------------------------------------------------------------------
- def for_one_friend?
- # 类别特技,效果范围包含伙伴单体(HP 0 的)场合
- if @kind == 1 and [3, 5].include?($data_skills[@skill_id].scope)
- return true
- end
- # 类别以条款,效果范围包含伙伴单体(HP 0 的)场合
- if @kind == 2 and [3, 5].include?($data_items[@item_id].scope)
- return true
- end
- return false
- end
- #--------------------------------------------------------------------------
- # ● 单体用(HP 0)判断
- #--------------------------------------------------------------------------
- def for_one_friend_hp0?
- # 特技效果范围单体(HP 0 )的场合
- if @kind == 1 and [5].include?($data_skills[@skill_id].scope)
- return true
- end
- # 物品效果范围单体(HP 0 )的场合
- if @kind == 2 and [5].include?($data_items[@item_id].scope)
- return true
- end
- return false
- end
- #--------------------------------------------------------------------------
- # ● random目标 (actor用)
- #--------------------------------------------------------------------------
- def decide_random_target_for_actor
- # 效果范围分歧
- if for_one_friend_hp0?
- battler = $game_party.random_target_actor_hp0
- elsif for_one_friend?
- battler = $game_party.random_target_actor
- else
- battler = $game_troop.random_target_enemy
- end
- # 如果对象存在取得禁书目录,
- # 对象不存在的情况clearness动作
- if battler != nil
- @target_index = battler.index
- else
- clear
- end
- end
- #--------------------------------------------------------------------------
- # ● random目标 (enemy用)
- #--------------------------------------------------------------------------
- def decide_random_target_for_enemy
- # 效果范围分歧
- if for_one_friend_hp0?
- battler = $game_troop.random_target_enemy_hp0
- elsif for_one_friend?
- battler = $game_troop.random_target_enemy
- else
- battler = $game_party.random_target_actor
- end
- # 如果对象存在取得禁书目录,
- # 对象不存在的情况clearness动作
- if battler != nil
- @target_index = battler.index
- else
- clear
- end
- end
- #--------------------------------------------------------------------------
- # ● 最后目标 (actor)
- #--------------------------------------------------------------------------
- def decide_last_target_for_actor
- # 单体actor效果范围,(enemy)
- if @target_index == -1
- battler = nil
- elsif for_one_friend?
- battler = $game_party.actors[@target_index]
- else
- battler = $game_troop.enemies[@target_index]
- end
- # 对象不存在的情况clearness动作
- if battler == nil or not battler.exist?
- clear
- end
- end
- #--------------------------------------------------------------------------
- # ● 最后目标 (enemy)
- #--------------------------------------------------------------------------
- def decide_last_target_for_enemy
- # 单体enemy效果范围 (actor)
- if @target_index == -1
- battler = nil
- elsif for_one_friend?
- battler = $game_troop.enemies[@target_index]
- else
- battler = $game_party.actors[@target_index]
- end
- # 对象不存在的情况clearness动作
- if battler == nil or not battler.exist?
- clear
- end
- end
- end
- #==============================================================================
- # 本脚本来自www.66RPG.com,使用和转载请保留此信息
- #==============================================================================
复制代码 口袋妖怪新创意(加点脚本):- #==============================================================================
- # 本脚本来自www.66RPG.com,使用和转载请保留此信息
- #==============================================================================
- # 脚本使用设定:
- LEVEL_UP_POINT = 1 # 每升一级所增加的点数
- LEVEL_UP_VARIABLE = 110 # 储存角色点数的变量编号与角色id编号的差值
- # 默认情况 = 100,
- # 则是数据库里1号角色的加点数存于101号变量
- # 3号角色的加点数存于103号变量。
- # 你可以直接操作变量赠与角色可分配点数
- # 每增加一次点数,各项能力值的变化:357-410行
-
- # 使用方法介绍:
- # 本脚本不会取代原猩豆δ埽皇且桓龈郊庸δ堋?BR># 也就是说,默认的升级还在,但可以用这个功能手动追加点数。
- # 如果你想纯粹使用手动加点(而升级不提升能力),只要把数据库中角色升级能力,
- # 1-99级全部等于一个相同数值就行了。
- # 呼唤加点场景的方法:$scene = Scene_Lvup.new(角色编号,返回菜单编号)。
- # 默认都是0号
- # 加点场景中,page up,page down换人,如果想加点完毕后返回地图,
- # 464行$scene = Scene_Menu.new(0)改为$scene = Scene_Map.new
- # 推荐脚本搭配:魔法商店脚本,两者结合,制作自由型RPG
- #==============================================================================
- # ■ Window_Command
- #------------------------------------------------------------------------------
- # 一般的命令选择行窗口。(追加定义)
- #==============================================================================
- class Window_Command < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 项目有效化
- # index : 项目编号
- #--------------------------------------------------------------------------
- def able_item(index)
- draw_item(index, normal_color)
- end
- end
- #==============================================================================
- # ■ Game_Actor
- #------------------------------------------------------------------------------
- # 处理角色的类。(再定义)
- #==============================================================================
- class Game_Actor < Game_Battler
- #--------------------------------------------------------------------------
- # ● 更改 EXP
- # exp : 新的 EXP
- #--------------------------------------------------------------------------
- def exp=(exp)
- @exp = [[exp, 9999999].min, 0].max
- # 升级
- while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
- @level += 1
- # 增加4点可自由分配的点数
- $game_variables[self.id + LEVEL_UP_VARIABLE] += LEVEL_UP_POINT
- # 学会特技
- for j in $data_classes[@class_id].learnings
- if j.level == @level
- learn_skill(j.skill_id)
- end
- end
- end
- # 降级
- while @exp < @exp_list[@level]
- @level -= 1
- end
- # 修正当前的 HP 与 SP 超过最大值
- @hp = [@hp, self.maxhp].min
- @sp = [@sp, self.maxsp].min
- end
- end
- #==============================================================================
- # ■ Window_Base
- #------------------------------------------------------------------------------
- # 游戏中全部窗口的超级类(追加定义)
- #==============================================================================
- class Window_Base < Window
- #--------------------------------------------------------------------------
- # ● 描绘 HP
- # actor : 角色
- # x : 描画目标 X 坐标
- # y : 描画目标 Y 坐标
- # width : 描画目标的宽
- #--------------------------------------------------------------------------
- def draw_actor_hp_lvup(actor, x, y)
- self.contents.font.color = system_color
- self.contents.draw_text(x , y, 96, 32, "最大" + $data_system.words.hp)
- if $temp_hp == 0
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 120 , y, 48, 32, actor.maxhp.to_s, 2)
- else
- maxhp = actor.maxhp + $temp_hp
- self.contents.font.color = Color.new(255, 128, 128, 255)
- self.contents.draw_text(x + 120 , y, 48, 32, maxhp.to_s ,2)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 155, y, 36, 32, "( ", 2)
- if $temp_hp >=0
- self.contents.font.color = Color.new(255, 128, 128, 255)
- self.contents.draw_text(x + 155, y, 36, 32, " +",2)
- else
- self.contents.font.color = Color.new(255,255,0,255)
- self.contents.draw_text(x + 155, y, 36, 32, " -",2)
- end
- self.contents.draw_text(x + 200, y, 36, 32, $temp_hp.to_s, 2)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 215, y, 36, 32, ")", 2)
- end
- end
- #--------------------------------------------------------------------------
- # ● 描绘 SP
- # actor : 角色
- # x : 描画目标 X 坐标
- # y : 描画目标 Y 坐标
- # width : 描画目标的宽
- #--------------------------------------------------------------------------
- def draw_actor_sp_lvup(actor, x, y)
- self.contents.font.color = system_color
- self.contents.draw_text(x , y, 96, 32, "最大" + $data_system.words.sp)
- if $temp_sp == 0
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 120 , y, 48, 32, actor.maxsp.to_s, 2)
- else
- maxsp = actor.maxsp + $temp_sp
- self.contents.font.color = Color.new(255, 128, 128, 255)
- self.contents.draw_text(x + 120 , y, 48, 32, maxsp.to_s ,2)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 155, y, 36, 32, "( ", 2)
- if $temp_sp >=0
- self.contents.font.color = Color.new(255, 128, 128, 255)
- self.contents.draw_text(x + 155, y, 36, 32, " +",2)
- else
- self.contents.font.color = Color.new(255,255,0,255)
- self.contents.draw_text(x + 155, y, 36, 32, " -",2)
- end
- self.contents.draw_text(x + 200, y, 36, 32, $temp_sp.to_s, 2)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 215, y, 36, 32, ")", 2)
- end
- end
- #--------------------------------------------------------------------------
- # ● 描绘能力值
- # actor : 角色
- # x : 描画目标 X 坐标
- # y : 描画目标 Y 坐标
- # type : 能力值种类 (0~4)
- #--------------------------------------------------------------------------
- def draw_actor_lvup(actor, x, y, type)
- # 定义数字颜色
- lvup = normal_color
- upcolor = Color.new(255, 128, 128, 255)
- self.contents.font.color = normal_color
- case type
- when 0
- parameter_name = $data_system.words.str
- parameter_value = actor.str
- parameter_value_temp = parameter_value + $temp_str
- if $temp_str != 0
- lvup = upcolor
- self.contents.draw_text(x + 256, y, 16, 32, "(")
- if $temp_str >= 0
- self.contents.font.color = lvup
- self.contents.draw_text(x + 272, y, 80, 32, "+",0)
- else
- self.contents.font.color = Color.new(255,255,0,255)
- self.contents.draw_text(x + 272, y, 80, 32, "-",0)
- end
- self.contents.draw_text(x + 272, y, 80, 32, $temp_str.abs.to_s,1)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
- end
- when 1
- parameter_name = $data_system.words.dex
- parameter_value = actor.dex
- parameter_value_temp = parameter_value + $temp_dex
- if $temp_dex != 0
- lvup = upcolor
- self.contents.draw_text(x + 256, y, 16, 32, "(")
- if $temp_dex >= 0
- self.contents.font.color = lvup
- self.contents.draw_text(x + 272, y, 80, 32, "+",0)
- else
- self.contents.font.color = Color.new(255,255,0,255)
- self.contents.draw_text(x + 272, y, 80, 32, "-",0)
- end
- self.contents.draw_text(x + 272, y, 80, 32, $temp_dex.abs.to_s,1)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
- end
- when 2
- parameter_name = $data_system.words.agi
- parameter_value = actor.agi
- parameter_value_temp = parameter_value + $temp_agi
- if $temp_agi != 0
- lvup = upcolor
- self.contents.draw_text(x + 256, y, 16, 32, "(")
- if $temp_agi >= 0
- self.contents.font.color = lvup
- self.contents.draw_text(x + 272, y, 80, 32, "+",0)
- else
- self.contents.font.color = Color.new(255,255,0,255)
- self.contents.draw_text(x + 272, y, 80, 32, "-",0)
- end
- self.contents.draw_text(x + 272, y, 80, 32, $temp_agi.abs.to_s,1)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
- end
- when 3
- parameter_name = $data_system.words.int
- parameter_value = actor.int
- parameter_value_temp = parameter_value + $temp_int
- if $temp_int != 0
- lvup = upcolor
- self.contents.draw_text(x + 256, y, 16, 32, "(")
- if $temp_int >= 0
- self.contents.font.color = lvup
- self.contents.draw_text(x + 272, y, 80, 32, "+",0)
- else
- self.contents.font.color = Color.new(255,255,0,255)
- self.contents.draw_text(x + 272, y, 80, 32, "-",0)
- end
- self.contents.draw_text(x + 272, y, 80, 32, $temp_int.abs.to_s,1)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 272, y, 80, 32, ")", 2)
- end
- when 4
- parameter_name = "剩余点数"
- parameter_value = $point
- if $point != 0
- lvup = upcolor
- end
- end
- self.contents.font.color = system_color
- self.contents.draw_text(x, y, 120, 32, parameter_name)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s)
- if type != 4
- self.contents.draw_text(x + 150, y, 36, 32, "→")
- end
- self.contents.font.color = lvup
- self.contents.draw_text(x + 180, y, 60, 32, parameter_value_temp.to_s)
- self.contents.font.color = normal_color
- end
- end
- #==============================================================================
- # ■ Window_lvup
- #------------------------------------------------------------------------------
- # 显示升级状态窗口。
- #==============================================================================
- class Window_Lvup < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # actor : 角色
- #--------------------------------------------------------------------------
- def initialize(actor)
- super(0, 0, 512, 320)
- self.contents = Bitmap.new(width - 32, height - 32)
- @actor = actor
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- draw_actor_graphic(@actor, 40, 112)
- draw_actor_name(@actor, 4, 0)
- draw_actor_class(@actor, 4 + 144, 0)
- draw_actor_level(@actor, 96, 32)
- draw_actor_state(@actor, 96, 64)
- draw_actor_hp_lvup(@actor, 96+128, 32)
- draw_actor_sp_lvup(@actor, 96+128, 64)
- draw_actor_lvup(@actor, 96, 128, 0)
- draw_actor_lvup(@actor, 96, 160, 1)
- draw_actor_lvup(@actor, 96, 192, 2)
- draw_actor_lvup(@actor, 96, 224, 3)
- draw_actor_lvup(@actor, 96, 256, 4)
- end
- end
- #==============================================================================
- # ■ Window_Help
- #------------------------------------------------------------------------------
- # 特技及物品的说明、角色的状态显示的窗口。
- #==============================================================================
- class Window_Lvup_Help < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize
- super(0, 320, 640, 160)
- self.contents = Bitmap.new(width - 32, height - 32)
- @test = "" #——这个东西用来检测,节约内存专用
- end
- #--------------------------------------------------------------------------
- # ● 设置文本
- #--------------------------------------------------------------------------
- def lvup_text(text1, text2 = nil, text3 = nil, text4 = nil, text5 = nil)
- if @test != text1
- @test = text1
- else
- return
- end
- self.contents.clear
- self.contents.font.color = normal_color
- self.contents.draw_text(5, 0, self.width - 40, 32, text1)
- if text2 != nil
- self.contents.draw_text(5 , 32, self.width - 40, 32, text2)
- end
- self.contents.font.size -= 5
- if text3 != nil
- self.contents.draw_text(5 , 64, self.width - 40, 32, text3)
- end
- if text4 != nil
- self.contents.draw_text(5 , 96, self.width - 40, 32, text4)
- end
- if text5 != nil
- self.contents.draw_text(5 , 96, self.width - 40, 32, text5)
- end
- self.contents.font.size += 5
- 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 = "增加PP"
- 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值意外错误
- # (各种编程语言都有这种意外),建议还是使用整数,正负不限
- #=========================================================================
- #=========================================================================
- # 每提升一次HP,提升多少附加能力
- #=========================================================================
- @hp_hp = 11 # 每提升一次体力提升多少HP
- @hp_sp = 0 # 每提升一次体力提升多少SP
- @hp_str = 0 # 每提升一次体力提升多少力量
- @hp_dex = 0 # 每提升一次体力提升多少速度
- @hp_agi = 0 # 每提升一次体力提升多少灵巧
- @hp_int = 0 # 每提升一次体力提升多少魔力
- #=========================================================================
- # 每提升一次SP,提升多少附加能力
- #=========================================================================
- @sp_hp = 1 # 每提升一次体力提升多少HP
- @sp_sp = 10 # 每提升一次体力提升多少SP
- @sp_str = 0 # 每提升一次体力提升多少力量
- @sp_dex = 0 # 每提升一次体力提升多少速度
- @sp_agi = 0 # 每提升一次体力提升多少灵巧
- @sp_int = 0 # 每提升一次体力提升多少魔力
- #=========================================================================
- # 每提升一次力量,提升多少附加能力
- #=========================================================================
- @str_hp = 1 # 每提升一次力量附加提升多少HP
- @str_sp = 0 # 每提升一次力量附加提升多少SP
- @str_dex = 0 # 每提升一次力量附加提升多少灵巧
- @str_agi = 0 # 每提升一次力量附加提升多少速度
- @str_int = 0 # 每提升一次力量附加提升多少魔力
- @str_str = 1 # 每提升一次力量附加提升多少力量
- #=========================================================================
- # 每提升一次灵巧,提升多少附加能力
- #=========================================================================
- @dex_hp = 1 # 每提升一次灵巧附加提升多少HP
- @dex_sp = 0 # 每提升一次灵巧附加提升多少SP
- @dex_str = 0 # 每提升一次灵巧附加提升多少力量
- @dex_agi = 0 # 每提升一次灵巧附加提升多少速度
- @dex_int = 0 # 每提升一次灵巧附加提升多少魔力
- @dex_dex = 1 # 每提升一次灵巧附加提升多少灵巧
- #=========================================================================
- # 每提升一次速度,提升多少附加能力
- #=========================================================================
- @agi_hp = 1 # 每提升一次速度附加提升多少HP
- @agi_sp = 0 # 每提升一次速度附加提升多少SP
- @agi_str = 0 # 每提升一次速度附加提升多少力量
- @agi_dex = 0 # 每提升一次速度附加提升多少灵巧
- @agi_int = 0 # 每提升一次速度附加提升多少魔力
- @agi_agi = 1 # 每提升一次速度附加提升多少速度
- #=========================================================================
- # 每提升一次魔力,提升多少附加能力
- #=========================================================================
- @int_hp = 1 # 每提升一次魔力附加提升多少HP
- @int_sp = 0 # 每提升一次魔力附加提升多少SP
- @int_str = 0 # 每提升一次魔力附加提升多少力量
- @int_dex = 0 # 每提升一次魔力附加提升多少灵巧
- @int_agi = 0 # 每提升一次魔力附加提升多少速度
- @int_int = 1 # 每提升一次魔力附加提升多少魔力
- # 定义说明文字
- @text_hp_sc = "HP可以增加生存的能力,可以延长生存的时间!"
- @text_sp_sc = "PP可以增加特技的次数,还可提升自身特防!"
- @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(0, "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(3)
- #################################################
- 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_Menu.new(3)
- #################################################
- 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_hp
- $temp_sp += @hp_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_sp += @sp_sp
- $temp_hp += @sp_hp
- $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_hp.to_s + "点 " + @text_str + @hp_str.to_s + "点 " + @text_dex + @hp_dex.to_s + "点"
- temptext2 = @text_sp + @hp_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 # 增加SP
- temptext1 = @text_hp + @sp_hp.to_s + "点 " + @text_str + @sp_str.to_s + "点 " + @text_dex + @sp_dex.to_s + "点"
- temptext2 = @text_sp + @sp_sp.to_s + "点 " + @text_agi + @sp_agi.to_s + "点 " + @text_int + @sp_int.to_s + "点"
- @help_window.lvup_text(@text_sp_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
- #==============================================================================
- # 本脚本来自www.66RPG.com,使用和转载请保留此信息
- #==============================================================================
复制代码 |
|