|
1 |
|
2 -- This is an example of one way of coding a class, using the { } constructor, see the cat for another method |
|
3 |
|
4 classes.obj_fireplace = |
|
5 { |
|
6 _properties = { name = "fire", longname = "an ornate fireplace", desc = "You see a decorative fireplace, in which a warming fire is burning.", static = true }; |
|
7 _parent = nil; -- This class inherits methods and properties from no other class (except classes.default). If you don't set _parent, this is the default |
|
8 } |
|
9 |
|
10 function classes.obj_fireplace:touch(e) |
|
11 e.person:_say("/me touches the fire", false); -- Everyone else in the room will see this, user will not |
|
12 e.person:_say("Oouuchhh!!!!"); -- By default, all see the message |
|
13 e.person:_tell("That hurt!"); -- Only the user sees this |
|
14 end |