diff options
| author | Franklin Wei <git@fwei.tk> | 2016-01-24 21:55:16 -0500 |
|---|---|---|
| committer | Franklin Wei <git@fwei.tk> | 2016-01-24 21:55:16 -0500 |
| commit | 7ba1da83c715175fb76c17098793091e6e8db788 (patch) | |
| tree | 5766f3524929288e18758f3647a52de537191aae /worlds | |
| parent | 6e3d6b3186bc07003d17ad7c54bb013c9b5d6dcf (diff) | |
| download | netcosm-7ba1da83c715175fb76c17098793091e6e8db788.zip netcosm-7ba1da83c715175fb76c17098793091e6e8db788.tar.gz netcosm-7ba1da83c715175fb76c17098793091e6e8db788.tar.bz2 netcosm-7ba1da83c715175fb76c17098793091e6e8db788.tar.xz | |
some more work on objects, still can't serialize
Diffstat (limited to 'worlds')
| -rw-r--r-- | worlds/test.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/worlds/test.c b/worlds/test.c index d31dd11..c3fa65a 100644 --- a/worlds/test.c +++ b/worlds/test.c @@ -8,9 +8,8 @@ const char *sword_desc(struct object_t *obj, user_t *user) static void portal_init(room_id id) { debugf("portal room init.\n"); - struct object_t *new = obj_new(); + struct object_t *new = obj_new("weapon"); new->name = "sword"; - new->hook_desc = sword_desc; obj_add(id, new); } @@ -78,3 +77,25 @@ const struct roomdata_t netcosm_world[] = { const size_t netcosm_world_sz = ARRAYLEN(netcosm_world); const char *netcosm_world_name = "Alacron 0.1"; + +/************ OBJECT DEFINITIONS ************/ + +const char *shiny(struct object_t *obj, user_t *user) +{ + if(user->state == STATE_ADMIN) + return "It's VERRRYYY SHIIINNNNYYYY!!!!"; + else + return "It's kinda shiny."; +} + +const struct obj_class_t netcosm_obj_classes[] = { + { "weapon", + NULL, + NULL, + NULL, + NULL, + NULL, + shiny }, +}; + +const size_t netcosm_obj_classes_sz = ARRAYLEN(netcosm_obj_classes); |