From b346e948cb167c18efc33f32f0e7cfb21050fc96 Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Sun, 24 Jan 2016 16:58:59 -0500 Subject: objects partially implemented, fixes some bugs --- worlds/test.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'worlds') diff --git a/worlds/test.c b/worlds/test.c index b93b795..d31dd11 100644 --- a/worlds/test.c +++ b/worlds/test.c @@ -1,12 +1,26 @@ #include +const char *sword_desc(struct object_t *obj, user_t *user) +{ + return "It is very shiny."; +} + +static void portal_init(room_id id) +{ + debugf("portal room init.\n"); + struct object_t *new = obj_new(); + new->name = "sword"; + new->hook_desc = sword_desc; + obj_add(id, new); +} + const struct roomdata_t netcosm_world[] = { { "portal_room", "Portal Room", "You stand in the middle of a stone room. In to the east lies a portal to the world. Above it, there is a sign that reads `Alacron, 238 A.B.A.`.", { NONE_N, NONE_NE, "world_start", NONE_SE, NONE_S, NONE_SW, NONE_W, NONE_NW, NONE_UP, NONE_DN, "world_start", NONE_OT }, - NULL, + portal_init, NULL, NULL, }, -- cgit v1.1