The Room class is the mother of all rooms.
Event :arrive
e
The event
return
Undefined
# File lib/core/room.rb, line 71 def arrive(e) ch = get_object(e.msg) # add character add_contents(ch.id) ch.location = id characters(e.msg).each do |x| add_event(id,x.id,:show, ch.name+" has arrived.") if x.account end ch.parse('look') end
Event :describe
e
The event
return
Undefined
# File lib/core/room.rb, line 36 def describe(e) msg = "[COLOR Green](#{id.to_s}) #{name}[/COLOR]\n#{desc}\n" add_event(id,e.from,:show,msg) end
e
The event
return
Undefined
# File lib/core/room.rb, line 44 def describe_exits(e) msg = "[COLOR Red]Exits:\n" s = exits.size if s == 0 msg << "None.[/COLOR]" else i = 0 exits.each do |exid| ex = get_object(exid) key = ex.name.split(%r;/).first msg << key i += 1 case s - i when 1 then s > 2 ? msg << ", and " : msg << " and " when 0 then msg << "." else msg << ", " end end msg << "[/COLOR]" end add_event(id,e.from,:show,msg) end