本帖最后由 taroxd 于 2014-8-17 15:21 编辑
class Window_ActorCommand < Window_Command def visible_line_number @actor && @actor.id != 1 ? 3 : 4 end def make_command_list return unless @actor add_attack_command add_skill_commands add_guard_command add_item_command if @actor.id == 1 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_Actor def damage_valid? @actor_id != 1 || $game_party.alive_members == [self] end end
class Window_ActorCommand < Window_Command
def visible_line_number
@actor && @actor.id != 1 ? 3 : 4
end
def make_command_list
return unless @actor
add_attack_command
add_skill_commands
add_guard_command
add_item_command if @actor.id == 1
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_Actor
def damage_valid?
@actor_id != 1 || $game_party.alive_members == [self]
end
end
第三个问题,自行在 Game_Enemy 里实现 damage_valid? 方法 |