Project1
标题:
关于群体嘲讽类保护类技能脚本
[打印本页]
作者:
rpg916162895
时间:
2013-10-4 00:54
标题:
关于群体嘲讽类保护类技能脚本
本帖最后由 rpg916162895 于 2013-10-5 01:13 编辑
我这里有个保护类技能的脚本,就是将敌人对队友的攻击转移到自己身上,但局限是只能是单体指定。求突破,改进成可以单体指定,也可以同时保护自己方所有人。
#===========================================================================
#本脚本来自www.66rpg.com
#===========================================================================
#脚本制作by bluefool
#介绍: 一个援护技能,能将敌人对指定同伴的普通攻击和单体技能\魔法攻击实行遮挡,
#实施护卫的角色此回合不能进行其他活动
#下面设置援护技能ID(要求是一个对己方单体有效的技能)
BLUE_COVER = [57,58]
#下面设置援护是否对魔法攻击有效(这里设定为技能攻击力(不是威力)为0的为魔法攻击)
BLUE_ID = 1 #(等于1为有效,0为无效)
class Scene_Battle
#--------------------------------------------------------------------------
# ● 生成行动循序
#--------------------------------------------------------------------------
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
unless BLUE_COVER.include?(actor.current_action.skill_id)
@action_battlers.push(actor)
else
actor.sp -= $data_skills[actor.current_action.skill_id].sp_cost
end
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 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
for actor in $game_party.actors
if BLUE_COVER.include?(actor.current_action.skill_id) and actor != target
if $game_party.actors[actor.current_action.target_index] == target
target.damage = "cover"
target.damage_pop = true
target = actor
end
end
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))
if $data_skills[@active_battler.current_action.skill_id].atk_f > 0 or BLUE_ID == 1
for actor in $game_party.actors
if BLUE_COVER.include?(actor.current_action.skill_id) and not @target_battlers.include?(actor)
if @target_battlers.include?($game_party.actors[actor.current_action.target_index])
for i in @target_battlers
i.damage = "cover"
i.damage_pop = true
end
@target_battlers.clear
@target_battlers.push(actor)
end
end
end
end
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
end
#============================================================================
#本脚本来自www.66rpg.com
#============================================================================
复制代码
作者:
chd114
时间:
2013-10-4 10:12
····你的这个是伤害转移···又不是真的嘲讽技能
直接给角色附加嘲讽状态让怪物优先攻击不就好了···
作者:
rpg916162895
时间:
2013-10-4 12:11
chd114 发表于 2013-10-4 10:12
····你的这个是伤害转移···又不是真的嘲讽技能直接给角色附加嘲讽状态让怪物优先攻击不就 ...
那怎么设置怪物攻击优先级啊{:2_271:}不懂的太多了
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1