加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 chd114 于 2014-10-3 01:02 编辑
class Game_Enemy < Game_Battler def damage_valid? return true if $game_troop.alive_members == [self] return false if $data_enemies[@enemy_id].note.include?("<我不是杂鱼>") return true end end class Game_Actor def damage_valid? return true if $game_party.alive_members == [self] @team=[] (0...$game_party.alive_members.size).all?{|i|@team.push($game_party.alive_members[i].id)} if @actor_id==19 return false unless @team.include?(20)#20号队友存在时19号队友不受到伤害 end return false if $data_actors[@actor_id].note.include?("<我不是杂鱼>") return true end end class Game_Battler def damage_valid? true end alias assign_hp_20140817 hp= def hp=(hp) assign_hp_20140817(hp) if hp >= @hp || damage_valid? end alias mdv_20140817 make_damage_value def make_damage_value(user, item) mdv_20140817(user, item) if damage_valid? end end
class Game_Enemy < Game_Battler
def damage_valid?
return true if $game_troop.alive_members == [self]
return false if $data_enemies[@enemy_id].note.include?("<我不是杂鱼>")
return true
end
end
class Game_Actor
def damage_valid?
return true if $game_party.alive_members == [self]
@team=[]
(0...$game_party.alive_members.size).all?{|i|@team.push($game_party.alive_members[i].id)}
if @actor_id==19
return false unless @team.include?(20)#20号队友存在时19号队友不受到伤害
end
return false if $data_actors[@actor_id].note.include?("<我不是杂鱼>")
return true
end
end
class Game_Battler
def damage_valid?
true
end
alias assign_hp_20140817 hp=
def hp=(hp)
assign_hp_20140817(hp) if hp >= @hp || damage_valid?
end
alias mdv_20140817 make_damage_value
def make_damage_value(user, item)
mdv_20140817(user, item) if damage_valid?
end
end
原版的脚本是备注一个就能达到队友存在即无敌的效果,但是我想修改成指定20号队友存在时19号队友无敌的效果,可return false unless @team.include?(20)
return false unless @team.include?(20)
的return false没效果,如果改成return true又会变成无论20号队友在不在都无敌···
@taroxd @invwindy @VIPArcher |