赞 | 1 |
VIP | 95 |
好人卡 | 8 |
积分 | 1 |
经验 | 23267 |
最后登录 | 2020-10-15 |
在线时间 | 433 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 65
- 在线时间
- 433 小时
- 注册时间
- 2007-5-1
- 帖子
- 993
|
好吧,在下不才,根据沉影不器大师的脚本依样画葫芦改了改:
- #==============================================================================
- # 战斗中机率反击 by 沉影不器
- #------------------------------------------------------------------------------
- # 脚本设定为:
- # ① 只有受到物理攻击才能反击
- # ② 默认发动反击的机率为50%,可自定义
- # ③ 防御可提高30%反击机率
- # ④ 默认受击者拥有15号状态时才能反击,可自定义
- #------------------------------------------------------------------------------
- # ◎ 参数设定
- #------------------------------------------------------------------------------
- # 发动反击的机率
- PROBA = 50
- # 受击对象拥有该ID状态时才反击
- CATK_STATE_ID = 15
- #==============================================================================
- # ■ Scene_Battle
- #==============================================================================
- class Scene_Battle < Scene_Base
- #--------------------------------------------------------------------------
- # ● 执行战斗行动: 攻击
- #--------------------------------------------------------------------------
- def execute_action_attack
- text = sprintf(Vocab::DoAttack, @active_battler.name)
- @message_window.add_instant_text(text)
- targets = @active_battler.action.make_targets
- display_attack_animation(targets)
- wait(20)
- for target in targets
- target.attack_effect(@active_battler)
- display_action_effects(target)
- if target.state?(CATK_STATE_ID)
- proba = PROBA
- # 防御时增加反击机率
- proba += 30 if target.guarding?
- # 计算机率
- next if rand(100) > proba
- @active_battler.attack_effect(target)
- Sound.play_evasion
- text = sprintf(Vocab::Counterattack, @active_battler.name, target.name)
- @message_window.add_instant_text(text)
- display_attack_animation([@active_battler])
- wait(20)
- display_action_effects(@active_battler)
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 执行战斗行动:使用技能
- #--------------------------------------------------------------------------
- def execute_action_skill
- skill = @active_battler.action.skill
- text = @active_battler.name + skill.message1
- @message_window.add_instant_text(text)
- unless skill.message2.empty?
- wait(10)
- @message_window.add_instant_text(skill.message2)
- end
- targets = @active_battler.action.make_targets
- display_animation(targets, skill.animation_id)
- @active_battler.mp -= @active_battler.calc_mp_cost(skill)
- $game_temp.common_event_id = skill.common_event_id
- for target in targets
- target.skill_effect(@active_battler, skill)
- display_action_effects(target, skill)
- end
- if target.state?(CATK_STATE_ID)
- for target in targets
- proba = PROBA
- # 防御时增加反击机率
- proba += 30 if target.guarding?
- # 计算机率
- next if rand(100) > proba
- @active_battler.attack_effect(target)
- Sound.play_evasion
- text = sprintf(Vocab::Counterattack, @active_battler.name, target.name)
- @message_window.add_instant_text(text)
- display_attack_animation([@active_battler])
- wait(20)
- display_action_effects(@active_battler)
- end
- end
- end
- end
- #==============================================================================
- # ■ Vocab
- #==============================================================================
- module Vocab
- # 反击
- Counterattack = "%s遭到%s反击!"
- end
复制代码
这个脚本是受击者拥有15号状态时才能反击,注意事项:
1.近程武器(就是能反击的武器),请附加上反击状态。
2.能反击的技能,请在【附加状态变更】一栏附加反击状态。
3.反击状态设置为【100%成功率】,0回合后100%解除,挨揍时解除。 系统信息:本贴获得楼主认可,66RPG感谢您的热情解答~ |
|