class RPG::UsableItem::Damage
Attributes
critical[RW]
element_id[RW]
formula[RW]
type[RW]
variance[RW]
Public Class Methods
new()
click to toggle source
# File lib/rgss3/rpg.rb, line 527 def initialize @type = 0 @element_id = 0 @formula = '0' @variance = 20 @critical = false end
Public Instance Methods
drain?()
click to toggle source
# File lib/rgss3/rpg.rb, line 546 def drain? [5,6].include?(@type) end
eval(a, b, v)
click to toggle source
# File lib/rgss3/rpg.rb, line 552 def eval(a, b, v) [Kernel.eval(@formula), 0].max * sign rescue 0 end
none?()
click to toggle source
# File lib/rgss3/rpg.rb, line 534 def none? @type == 0 end
recover?()
click to toggle source
# File lib/rgss3/rpg.rb, line 543 def recover? [3,4].include?(@type) end
sign()
click to toggle source
# File lib/rgss3/rpg.rb, line 549 def sign recover? ? -1 : 1 end
to_hp?()
click to toggle source
# File lib/rgss3/rpg.rb, line 537 def to_hp? [1,3,5].include?(@type) end
to_mp?()
click to toggle source
# File lib/rgss3/rpg.rb, line 540 def to_mp? [2,4,6].include?(@type) end