require "Stat.rb" module RubyMud class Hp < Stat # When HP is zero or less the mobile dies def OnChange() if (@value > 0) return end # First we add a corpse flag to the mobile #@owner.Stats.push(IsCorpse.new(@owner)) # Then we write to the room that the mobile has been killed # The snag is that if we want this here, we also need to pass # in the object that made the change to the value ... Which might # be a good idea anyway so that we can write out who killed the # mobile and also award xp ... but do we want that logic here ?! end def initialize(owner,value) super(owner,value) end end end #module