| 40 |
'#name' => t('location'), |
'#name' => t('location'), |
| 41 |
'#class' => 'object', // this determines mainly how the attribute tables are created for objects, but may also affect processing |
'#class' => 'object', // this determines mainly how the attribute tables are created for objects, but may also affect processing |
| 42 |
'#description' => t('This attribute keeps track of the object containing this one. Every tangible object is generally located in another object. Some may not be, such as top containing rooms -- they are in a sort of undefined limbo.'), |
'#description' => t('This attribute keeps track of the object containing this one. Every tangible object is generally located in another object. Some may not be, such as top containing rooms -- they are in a sort of undefined limbo.'), |
| 43 |
'#verify' => '_rpg_drudge_location_verify', // this function will be called before setting the attribute, and must return true to continue |
'#verify' => '_rpg_drudge_location_verify', // this function will be called before setting the attribute, and must return TRUE to continue |
| 44 |
'#set' => '_rpg_drudge_location_set', // this function will be called when setting the attribute on an object |
'#set' => '_rpg_drudge_location_set', // this function will be called when setting the attribute on an object |
| 45 |
'#form_display' => '_rpg_drudge_form_display_admin', |
'#form_display' => '_rpg_drudge_form_display_admin', |
| 46 |
); |
); |
| 48 |
'#name' => t('contents'), |
'#name' => t('contents'), |
| 49 |
'#class' => 'object_array', |
'#class' => 'object_array', |
| 50 |
'#description' => t('This is an array of all the objects contained directly in this object.'), |
'#description' => t('This is an array of all the objects contained directly in this object.'), |
| 51 |
'#form_display' => '_rpg_drudge_form_display_false', |
'#form_display' => '_rpg_drudge_form_display_FALSE', |
| 52 |
); |
); |
| 53 |
$type['#attributes']['moveable'] = array( |
$type['#attributes']['moveable'] = array( |
| 54 |
'#name' => t('moveable'), |
'#name' => t('moveable'), |
| 55 |
'#class' => 'boolean', |
'#class' => 'boolean', |
| 56 |
'#description' => t('If an object is moveable, then it may be taken by an actor. Objects not moveable are generally fixed, too heavy, or part of the scenery.'), |
'#description' => t('If an object is moveable, then it may be taken by an actor. Objects not moveable are generally fixed, too heavy, or part of the scenery.'), |
| 57 |
'#default_value' => true, // objects of this type will begin with this value for the attribute |
'#default_value' => TRUE, // objects of this type will begin with this value for the attribute |
| 58 |
'#form_display' => '_rpg_drudge_form_display_admin', |
'#form_display' => '_rpg_drudge_form_display_admin', |
| 59 |
); |
); |
| 60 |
$type['#attributes']['visible'] = array( |
$type['#attributes']['visible'] = array( |
| 61 |
'#name' => t('visible'), |
'#name' => t('visible'), |
| 62 |
'#class' => 'boolean', |
'#class' => 'boolean', |
| 63 |
'#description' => t('Can this object be seen in normal circumstances?'), |
'#description' => t('Can this object be seen in normal circumstances?'), |
| 64 |
'#default_value' => true, |
'#default_value' => TRUE, |
| 65 |
'#form_display' => '_rpg_drudge_form_display_admin', |
'#form_display' => '_rpg_drudge_form_display_admin', |
| 66 |
); |
); |
| 67 |
$type['#attributes']['light'] = array( |
$type['#attributes']['light'] = array( |
| 75 |
'#name' => t('listable'), |
'#name' => t('listable'), |
| 76 |
'#class' => 'boolean', |
'#class' => 'boolean', |
| 77 |
'#description' => t("Will this object be listed in its location's contents?"), |
'#description' => t("Will this object be listed in its location's contents?"), |
| 78 |
'#default_value' => true, |
'#default_value' => TRUE, |
| 79 |
'#form_display' => '_rpg_drudge_form_display_admin', |
'#form_display' => '_rpg_drudge_form_display_admin', |
| 80 |
); |
); |
| 81 |
$type['#attributes']['listable_contents'] = array( |
$type['#attributes']['listable_contents'] = array( |
| 105 |
$type['#attributes']['may_take'] = array( |
$type['#attributes']['may_take'] = array( |
| 106 |
'#name' => t('may take'), |
'#name' => t('may take'), |
| 107 |
'#class' => 'figured', // figured class attributes may not be manually set |
'#class' => 'figured', // figured class attributes may not be manually set |
| 108 |
'#description' => t('May an object be taken by the actor? This will return true if the object is contained within the same room as the actor, is visible, may be touched, is moveable, and is not possessed by another actor.'), |
'#description' => t('May an object be taken by the actor? This will return TRUE if the object is contained within the same room as the actor, is visible, may be touched, is moveable, and is not possessed by another actor.'), |
| 109 |
'#get' => '_rpg_drudge_may_take', // this function will be called to return the value of an attribute. |
'#get' => '_rpg_drudge_may_take', // this function will be called to return the value of an attribute. |
| 110 |
); |
); |
| 111 |
$type['#attributes']['may_attack'] = array( |
$type['#attributes']['may_attack'] = array( |
| 166 |
return $type; |
return $type; |
| 167 |
} |
} |
| 168 |
|
|
| 169 |
|
function rpg_drudge_rpg_type_unmoveable() { |
| 170 |
|
$type = array(); |
| 171 |
|
$type['#type'] = 'unmoveable'; |
| 172 |
|
$type['#name'] = t('Unmoveable'); |
| 173 |
|
$type['#shortdesc'] = t('An unmoveable object simply may not be moved.'); |
| 174 |
|
$type['#longdesc'] = $type['#shortdesc']; |
| 175 |
|
|
| 176 |
|
$type['#parents'] = array('tangible'); |
| 177 |
|
|
| 178 |
|
$type['#attributes'] = array(); |
| 179 |
|
$type['#attributes']['moveable'] = array( |
| 180 |
|
'#name' => t('moveable'), |
| 181 |
|
'#class' => 'boolean', |
| 182 |
|
'#description' => t('If an object is moveable, then it may be taken by an actor. Objects not moveable are generally fixed, too heavy, or part of the scenery.'), |
| 183 |
|
'#default_value' => FALSE, |
| 184 |
|
'#form_display' => '_rpg_drudge_form_display_admin', |
| 185 |
|
); |
| 186 |
|
return $type; |
| 187 |
|
} |
| 188 |
|
|
| 189 |
function rpg_drudge_rpg_type_actor() { |
function rpg_drudge_rpg_type_actor() { |
| 190 |
$type = array(); |
$type = array(); |
| 191 |
$type['#type'] = 'actor'; |
$type['#type'] = 'actor'; |
| 226 |
'#name' => t('moveable'), |
'#name' => t('moveable'), |
| 227 |
'#class' => 'boolean', |
'#class' => 'boolean', |
| 228 |
'#description' => t('Actors are generally unmoveable by other actors, with the exception of small actors such as mice.'), |
'#description' => t('Actors are generally unmoveable by other actors, with the exception of small actors such as mice.'), |
| 229 |
'#default_value' => false, // objects of this type will begin with this value for the attribute |
'#default_value' => FALSE, // objects of this type will begin with this value for the attribute |
| 230 |
'#form_display' => '_rpg_drudge_form_display_admin', |
'#form_display' => '_rpg_drudge_form_display_admin', |
| 231 |
); |
); |
| 232 |
|
|
| 293 |
$type['#shortdesc'] = t('Rooms contain objects, including characters, and may be viewed from inside.'); |
$type['#shortdesc'] = t('Rooms contain objects, including characters, and may be viewed from inside.'); |
| 294 |
$type['#longdesc'] = $type['#shortdesc']; |
$type['#longdesc'] = $type['#shortdesc']; |
| 295 |
|
|
| 296 |
$type['#parents'] = array('tangible'); |
$type['#parents'] = array('tangible', 'unmoveable'); |
| 297 |
|
|
| 298 |
$type['#attributes'] = array(); |
$type['#attributes'] = array(); |
| 299 |
$type['#attributes']['title'] = array( |
$type['#attributes']['title'] = array( |
| 383 |
$type['#shortdesc'] = t('Exits connect rooms together, and may be traversed.'); |
$type['#shortdesc'] = t('Exits connect rooms together, and may be traversed.'); |
| 384 |
$type['#longdesc'] = $type['#shortdesc']; |
$type['#longdesc'] = $type['#shortdesc']; |
| 385 |
|
|
| 386 |
$type['#parents'] = array('tangible'); |
$type['#parents'] = array('tangible', 'unmoveable'); |
| 387 |
|
|
| 388 |
$type['#attributes'] = array(); |
$type['#attributes'] = array(); |
| 389 |
$type['#attributes']['dest'] = array( |
$type['#attributes']['dest'] = array( |
| 485 |
'#name' => t('location'), |
'#name' => t('location'), |
| 486 |
'#class' => 'object', // this determines mainly how the attribute tables are created for objects, but may also affect processing |
'#class' => 'object', // this determines mainly how the attribute tables are created for objects, but may also affect processing |
| 487 |
'#description' => t('When more than one countable objects are in the same location, combine them.'), |
'#description' => t('When more than one countable objects are in the same location, combine them.'), |
| 488 |
'#verify' => '_rpg_drudge_location_verify', // this function will be called before setting the attribute, and must return true to continue |
'#verify' => '_rpg_drudge_location_verify', // this function will be called before setting the attribute, and must return TRUE to continue |
| 489 |
'#set' => '_rpg_drudge_countable_location_set', // this function will be called when setting the attribute on an object |
'#set' => '_rpg_drudge_countable_location_set', // this function will be called when setting the attribute on an object |
| 490 |
'#form_display' => '_rpg_drudge_form_display_admin', |
'#form_display' => '_rpg_drudge_form_display_admin', |
| 491 |
); |
); |