Game Development Reference
In-Depth Information
else
sprintf(fmt, @mp_drain, Vocab::mp, @battler.name)
end
elsif @mp_damage > 0
fmt = @battler.actor? ? Vocab::ActorLoss : Vocab::EnemyLoss
sprintf(fmt, @battler.name, @mp_damage, Vocab::mp)
elsif @mp_damage < 0
fmt = @battler.actor? ? Vocab::ActorRecovery : Vocab::EnemyRecovery
sprintf(fmt, @battler.name, -@mp_damage, Vocab::mp)
else
""
end
end
The tp_damage_text Method
The final method is tp_damage_text , which covers what happens when a skill or item lowers or increases the TP of an
actor or enemy. All we have to do here is flip the two latter parameters once again.
#--------------------------------------------------------------------------
# * Get Text for TP Damage
#--------------------------------------------------------------------------
def tp_damage_text
if @tp_damage > 0
fmt = @battler.actor? ? Vocab::ActorLoss : Vocab::EnemyLoss
sprintf(fmt, @battler.name, Vocab::tp, @tp_damage)
elsif @tp_damage < 0
fmt = @battler.actor? ? Vocab::ActorGain : Vocab::EnemyGain
sprintf(fmt, @battler.name, Vocab::tp, -@tp_damage)
else
""
end
end
end
Once flipped, we get the following result:
#--------------------------------------------------------------------------
# * Get Text for TP Damage
#--------------------------------------------------------------------------
def tp_damage_text
if @tp_damage > 0
fmt = @battler.actor? ? Vocab::ActorLoss : Vocab::EnemyLoss
sprintf(fmt, @battler.name, @tp_damage, Vocab::tp)
elsif @tp_damage < 0
fmt = @battler.actor? ? Vocab::ActorGain : Vocab::EnemyGain
sprintf(fmt, @battler.name, -@tp_damage, Vocab::tp)
else
""
end
end
end
 
Search WWH ::




Custom Search