Project1
标题:
如何实现逃跑消耗SP
[打印本页]
作者:
苹果星ねこ
时间:
2012-5-23 18:23
标题:
如何实现逃跑消耗SP
每执行逃跑都消耗100SP
角色不足100SP会声音提示无法逃跑,要怎么做 dsu_plus_rewardpost_czw
作者:
英顺的马甲
时间:
2012-5-23 20:09
Scene_Battle2找到def update_phase2_escape下面插入
for actor in $game_party.actors
if actor.axist?
actor.sp = [actor.sp - 这里是扣的数量,0].max
end
end
复制代码
作者:
大东
时间:
2012-5-23 21:33
本帖最后由 大东 于 2012-5-23 21:35 编辑
还可以做一个技能,脚底抹油,消耗sp,公共事件,条件,条件成立,逃跑!不过原有脚本中的逃跑得删除掉!应该在战斗相关的里面,楼主可到相关脚本中找一下!
作者:
LOVE丶莫颜
时间:
2012-5-23 23:16
不会再逃跑那里把它弄成是技能吗..
然后用技能套用事件,就好了。
如条件分支...
执行....
...
作者:
kangxi0109
时间:
2012-5-24 12:40
本帖最后由 kangxi0109 于 2012-5-24 12:42 编辑
在Scene_Battle 2里面改:
#--------------------------------------------------------------------------
# ● 画面更新 (同伴指令回合 : 逃跑)
#--------------------------------------------------------------------------
def update_phase2_escape
# 计算敌人速度的平均值
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
# 逃跑成功判定
#------------------------------------------------
if @active_battler.sp >= 100
@active_battler.sp-=100
success = rand(100) < 50 * actors_agi / enemies_agi
else
success = false
end
#------------------------------------------------
# 成功逃跑的情况下
if success
# 演奏逃跑 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
#------------------------------------------------
# 帮助窗口显示"逃跑"
@help_window.set_text("sp不足,无法逃跑!", 1)
@party_command_window.visible = false
@help_window.visible = true
@wait_count = 20#窗口显示的时间,帧
#------------------------------------------------
# 开始主回合
start_phase4
end
end
复制代码
作者:
hys111111
时间:
2012-5-24 12:49
本帖最后由 hys111111 于 2012-5-25 12:53 编辑
已修复
#==============================================================================
# ■ Scene_Battle (分割定义 已被篡改)
#------------------------------------------------------------------------------
# 逃跑时,全体同伴都要逃跑。
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# ● 刷新画面 (同伴命令回合)
#--------------------------------------------------------------------------
def update_phase2
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
if $game_temp.battle_can_escape
@sp_can_escape = 1
for actor in $game_party.actors
if actor.sp < 100
@sp_can_escape = 0
break
end
end
else
@sp_can_escape = 0
end
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# 按下 C 键的情况下
if Input.trigger?(Input::C)
# 同伴指令窗口光标位置分支
case @party_command_window.index
when 0 # 战斗
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 开始角色的命令回合
start_phase3
when 1 # 逃跑
# 不能逃跑的情况下
if @sp_can_escape == 0 #修改部分
# 演奏冻结 SE
$game_system.se_play($data_system.buzzer_se)
return
end
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
for actor in $game_party.actors
actor.sp -= 100
end
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 逃走处理
update_phase2_escape
end
return
end
end
end
#==============================================================================
# ■ Window_PartyCommand
#------------------------------------------------------------------------------
# 战斗画面、选择战斗与逃跑的窗口。
#==============================================================================
class Window_PartyCommand < Window_Selectable
#--------------------------------------------------------------------------
# ● 初始化对像
#--------------------------------------------------------------------------
def initialize
super(0, 0, 640, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 160
@commands = ["战斗", "逃跑"]
@item_max = 2
@column_max = 2
draw_item(0, normal_color)
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
if $game_temp.battle_can_escape
@sp_can_escape = 1
for actor in $game_party.actors
if actor.sp < 100
@sp_can_escape = 0
break
end
end
else
@sp_can_escape = 0
end
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
draw_item(1, @sp_can_escape == 1 ? normal_color : disabled_color)
self.active = false
self.visible = false
self.index = 0
end
end
复制代码
作者:
祥仔BOY
时间:
2012-5-24 15:59
应该可以做个逃跑技能吧
作者:
kangxi0109
时间:
2012-5-25 08:14
本帖最后由 kangxi0109 于 2012-5-25 08:15 编辑
如果想要显示声音的话,可以在"帮助窗口显示"逃跑""下面加一行:$game_system.se_play($data_system.buzzer_se)
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1