--- deliantra/server/include/object.h 2006/09/11 23:33:29 1.29
+++ deliantra/server/include/object.h 2007/07/31 17:33:14 1.139
@@ -1,41 +1,66 @@
/*
- CrossFire, A Multiplayer game for X-windows
-
- Copyright (C) 2001 Mark Wedel & Crossfire Development Team
- Copyright (C) 1992 Frank Tore Johansen
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
- The authors can be reached via e-mail at crossfire-devel@real-time.com
-*/
+ * This file is part of Crossfire TRT, the Roguelike Realtime MORPG.
+ *
+ * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Crossfire TRT team
+ * Copyright (©) 2001,2007 Mark Wedel & Crossfire Development Team
+ * Copyright (©) 1992,2007 Frank Tore Johansen
+ *
+ * Crossfire TRT is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ * The authors can be reached via e-mail to
+ */
#ifndef OBJECT_H
#define OBJECT_H
+#include
+
#include "cfperl.h"
#include "shstr.h"
-typedef uint32 tag_t;
-#define NUM_BODY_LOCATIONS 12
-#define BODY_ARMS 1
+typedef int tag_t;
+
+enum {
+ body_skill,
+ body_combat,
+ body_range,
+ body_shield,
+ body_arm,
+ body_torso,
+ body_head,
+ body_neck,
+ body_finger,
+ body_shoulder,
+ body_foot,
+ body_hand,
+ body_wrist,
+ body_waist,
+ NUM_BODY_LOCATIONS
+};
+
+enum slottype_t
+{
+ slot_none,
+ slot_combat,
+ slot_ranged,
+};
/* See common/item.c */
typedef struct Body_Locations
{
- const char *save_name; /* Name used to load/save it to disk */
+ keyword save_name; /* Name used to load/save it to disk */
const char *use_name; /* Name used when describing an item we can use */
const char *nonuse_name; /* Name to describe objects we can't use */
} Body_Locations;
@@ -58,6 +83,19 @@
shstr key, value;
};
+struct UUID
+{
+ uint64 seq;
+
+ UUID () { }
+ UUID (uint64 seq) : seq(seq) { }
+ operator uint64() { return seq; }
+ void operator =(uint64 seq) { this->seq = seq; }
+};
+
+extern void init_uuid ();
+extern UUID gen_uuid ();
+extern const uint64 UUID_SKIP;
/* Definition for WILL_APPLY values. Replaces having harcoded values
* sprinkled in the code. Note that some of these also replace fields
@@ -70,82 +108,63 @@
#define WILL_APPLY_DOOR 0x08
#define WILL_APPLY_FOOD 0x10
-
-/* However, if you're keeping a pointer of some sort, you probably
- * don't just want it copied, so you'll need to add to common/object.C,
- * e.g. copy_object.
- */
-
-// these are not being copied
-ACC_CLASS (object)
-struct object_keep : refcounted
+struct body_slot
{
- tag_t ACC (RW, count); /* Unique object number for this object */
-
- /* These variables are not changed by copy_object() */
- struct pl *ACC (RW, contr); /* Pointer to the player which control this object */
- struct object *ACC (RW, next); /* Pointer to the next object in the free/used list */
- struct object *ACC (RW, prev); /* Pointer to the previous object in the free/used list */
- struct object *ACC (RW, active_next); /* Next & previous object in the 'active' */
- struct object *ACC (RW, active_prev); /* List. This is used in process_events */
- /* so that the entire object list does not */
- /* need to be gone through. */
- struct object *ACC (RW, below); /* Pointer to the object stacked below this one */
- struct object *ACC (RW, above); /* Pointer to the object stacked above this one */
- /* Note: stacked in the *same* environment */
- struct object *inv; /* Pointer to the first object in the inventory */
- struct object *ACC (RW, container); /* Current container being used. I think this
- * is only used by the player right now.
- */
- struct object *ACC (RW, env); /* Pointer to the object which is the environment.
- * This is typically the container that the object is in.
- */
- struct object *ACC (RW, more); /* Pointer to the rest of a large body of objects */
- struct object *ACC (RW, head); /* Points to the main object of a large body */
- struct mapstruct *ACC (RW, map); /* Pointer to the map in which this object is present */
+ signed char info:4; /* body info as loaded from the file */
+ signed char used:4; /* Calculated value based on items equipped */
};
+INTERFACE_CLASS (object)
// these are being copied
-struct object_copy : attachable