Effect.rb

RubyMud/Effect.rb · 560 B

From the archive rbmud-0.1rc2.tar.gz

Download the archive   « Back to the archive contents

module RubyMud

# Effects can be placed on BaseObjects
class Effect
	include Tickable

	attr_accessor :name,:actor,:target

	def initialize(actor, target, name)
		@actor = actor
		@target = target
		@name = name
		
		# Insert the effect to the target's effect list
		if (@target != nil)	
			@target.Effects.push(self)	
		end
	end

	# Called when the effect is applied
	def do()
	end

	# The effect is being removed from the target
	# Here the effect can do cleanup, eg. removing 
	# flags from the target's stats list
	def removing()
	end

end 


end #module

Site Stats

Snippets: 1791
Codebases: 571