--- deliantra/server/include/object.h 2007/05/19 00:08:11 1.125
+++ deliantra/server/include/object.h 2007/07/05 08:10:30 1.136
@@ -1,25 +1,24 @@
/*
- * CrossFire, A Multiplayer Online RPG
- *
- * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team
- * 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
+ * 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 2 of the License, or
+ * 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
+ * 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@schmorp.de
+ * along with this program. If not, see .
+ *
+ * The authors can be reached via e-mail to
*/
#ifndef OBJECT_H
@@ -61,7 +60,7 @@
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;
@@ -109,11 +108,6 @@
#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_to ()
- */
-
struct body_slot
{
signed char info:4; /* body info as loaded from the file */
@@ -253,8 +247,8 @@
UUID ACC (RW, uuid); // Unique Identifier, survives saves etc.
int ACC (RO, count);
- int ACC (RO, index); // index into objects
- int ACC (RO, active); // index into actives
+ object_vector_index ACC (RO, index); // index into objects
+ object_vector_index ACC (RO, active); // index into actives
player_ptr ACC (RW, contr); /* Pointer to the player which control this object */
@@ -320,16 +314,13 @@
open_container (0);
}
- // overwrite the attachable invoke function with a version that also checks ev_want_type
- bool invoke (event_type event, ...)
+ MTH object *force_find (const shstr name);
+ MTH void force_add (const shstr name, int duration = 0);
+
+ // overwrite the attachable should_invoke function with a version that also checks ev_want_type
+ bool should_invoke (event_type event)
{
- if (ev_want_event [event] || ev_want_type [type] || cb)
- {
- va_list ap;
- va_start (ap, event);
- vinvoke (event, ap);
- va_end (ap);
- }
+ return ev_want_event [event] || ev_want_type [type] || cb;
}
MTH void instantiate ();
@@ -413,6 +404,11 @@
return head ? head : this;
}
+ MTH bool is_head ()
+ {
+ return head_ () == this;
+ }
+
MTH std::string long_desc (object *who = 0);
MTH std::string describe_monster (object *who = 0);
MTH std::string describe_item (object *who = 0);
@@ -495,9 +491,7 @@
MTH struct region *region () const;
protected:
- friend struct archetype;
-
- void link ();
+ void link ();
void unlink ();
object ();
@@ -523,20 +517,6 @@
return ob;
}
-typedef object_vector