加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
如上图:
只是在默认脚本添加了一段判断而已。
脚本代码:
#============================================================================== # ** Scene_Battle #------------------------------------------------------------------------------ # 這個類用來執行顯示作戰畫面的程式。 #============================================================================== class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # * 顯示HP傷害資訊 # target : 目標參戰者 # obj : 技能或物品 #-------------------------------------------------------------------------- def display_hp_damage(target, obj = nil) if target.hp_damage == 0 # 無HP傷害 return if obj != nil and obj.damage_to_mp return if obj != nil and obj.base_damage == 0 fmt = target.actor? ? Vocab::ActorNoDamage : Vocab::EnemyNoDamage text = sprintf(fmt, target.name) elsif target.absorbed # HP被汲取 fmt = target.actor? ? Vocab::ActorDrain : Vocab::EnemyDrain text = sprintf(fmt, target.name, Vocab::hp, target.hp_damage) elsif target.hp_damage > 0 # HP傷害 if target.actor? text = sprintf(Vocab::ActorDamage, target.name, target.hp_damage) Sound.play_actor_damage $game_troop.screen.start_shake(5, 5, 10) else ###### skill = @active_battler.action.skill if skill.is_a?(RPG::Skill) case skill.id when 83 text = sprintf(Vocab::EnemyDamage2, target.name, target.hp_damage) else text = sprintf(Vocab::EnemyDamage, target.name, target.hp_damage) end end ###### # text = sprintf(Vocab::EnemyDamage, target.name, target.hp_damage) Sound.play_enemy_damage target.blink = true end else # HP恢復 fmt = target.actor? ? Vocab::ActorRecovery : Vocab::EnemyRecovery text = sprintf(fmt, target.name, Vocab::hp, -target.hp_damage) Sound.play_recovery end @message_window.add_instant_text(text) wait(30) end end
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
# 這個類用來執行顯示作戰畫面的程式。
#==============================================================================
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# * 顯示HP傷害資訊
# target : 目標參戰者
# obj : 技能或物品
#--------------------------------------------------------------------------
def display_hp_damage(target, obj = nil)
if target.hp_damage == 0 # 無HP傷害
return if obj != nil and obj.damage_to_mp
return if obj != nil and obj.base_damage == 0
fmt = target.actor? ? Vocab::ActorNoDamage : Vocab::EnemyNoDamage
text = sprintf(fmt, target.name)
elsif target.absorbed # HP被汲取
fmt = target.actor? ? Vocab::ActorDrain : Vocab::EnemyDrain
text = sprintf(fmt, target.name, Vocab::hp, target.hp_damage)
elsif target.hp_damage > 0 # HP傷害
if target.actor?
text = sprintf(Vocab::ActorDamage, target.name, target.hp_damage)
Sound.play_actor_damage
$game_troop.screen.start_shake(5, 5, 10)
else
######
skill = @active_battler.action.skill
if skill.is_a?(RPG::Skill)
case skill.id
when 83
text = sprintf(Vocab::EnemyDamage2, target.name, target.hp_damage)
else
text = sprintf(Vocab::EnemyDamage, target.name, target.hp_damage)
end
end
######
# text = sprintf(Vocab::EnemyDamage, target.name, target.hp_damage)
Sound.play_enemy_damage
target.blink = true
end
else
# HP恢復
fmt = target.actor? ? Vocab::ActorRecovery : Vocab::EnemyRecovery
text = sprintf(fmt, target.name, Vocab::hp, -target.hp_damage)
Sound.play_recovery
end
@message_window.add_instant_text(text)
wait(30)
end
end
请问是重定义了什么内容还是其他什么问题造成的? |