--- deliantra/server/include/object.h 2010/03/26 00:05:45 1.227 +++ deliantra/server/include/object.h 2010/04/07 19:54:45 1.236 @@ -2,8 +2,8 @@ * This file is part of Deliantra, the Roguelike Realtime MMORPG. * * Copyright (©) 2005,2006,2007,2008,2009,2010 Marc Alexander Lehmann / Robin Redeker / the Deliantra team - * Copyright (©) 2001,2007 Mark Wedel & Crossfire Development Team - * Copyright (©) 1992,2007 Frank Tore Johansen + * Copyright (©) 2001 Mark Wedel & Crossfire Development Team + * Copyright (©) 1992 Frank Tore Johansen * * Deliantra is free software: you can redistribute it and/or modify it under * the terms of the Affero GNU General Public License as published by the @@ -25,8 +25,6 @@ #ifndef OBJECT_H #define OBJECT_H -#include - #include "cfperl.h" #include "shstr.h" @@ -34,7 +32,9 @@ typedef int tag_t; -enum { +// also see common/item.C +enum +{ body_skill, body_combat, body_range, @@ -52,13 +52,6 @@ NUM_BODY_LOCATIONS }; -enum slottype_t -{ - slot_none, - slot_combat, - slot_ranged, -}; - /* See common/item.c */ typedef struct Body_Locations @@ -291,6 +284,16 @@ const_utf8_string query_short_name (const object *op); const_utf8_string query_name (const object *op); const_utf8_string query_base_name (const object *op, int plural); +sint64 query_cost (const object *tmp, object *who, int flag); +const char *query_cost_string (const object *tmp, object *who, int flag); + +int change_ability_duration (object *spell, object *caster); +int min_casting_level (object *caster, object *spell); +int casting_level (object *caster, object *spell); +sint16 SP_level_spellpoint_cost (object *caster, object *spell, int flags); +int SP_level_dam_adjust (object *caster, object *spob); +int SP_level_duration_adjust (object *caster, object *spob); +int SP_level_range_adjust (object *caster, object *spob); struct object : zero_initialised, object_copy { @@ -362,7 +365,6 @@ static object *read (object_thawer &f, maptile *map = 0); // map argument due to toal design bogosity, must go. bool write (object_freezer &f); - MTH int slottype () const; MTH static object *create (); const mapxy &operator =(const mapxy &pos); MTH void copy_to (object *dst); @@ -379,6 +381,7 @@ // recursively destroy all objects in inventory, optionally dropping them to the ground instead MTH void destroy_inv (bool drop_to_ground = false); + MTH void destroy_inv_fast (); // like destroy_inv (false), but only works when *this is destroyed, too MTH object *insert (object *item); // insert into inventory MTH void play_sound (faceidx sound) const; MTH void say_msg (const_utf8_string msg) const; @@ -399,7 +402,15 @@ insert_at (this, this); } - // high-level move functions, return true if successful + // high-level move method. + // object op is trying to move in direction dir. + // originator is typically the same as op, but + // can be different if originator is causing op to + // move (originator is pushing op) + // returns 0 if the object is not able to move to the + // desired space, 1 otherwise (in which case we also + // move the object accordingly. This function is + // very similiar to move_object. int move (int dir, object *originator); int move (int dir) @@ -408,7 +419,7 @@ } // changes move_type to a new value - handles move_on/move_off effects - void change_move_type (MoveType mt); + MTH void change_move_type (MoveType mt); static bool can_merge_slow (object *op1, object *op2); @@ -423,8 +434,7 @@ MTH void set_owner (object *owner); MTH void set_speed (float speed); MTH void set_glow_radius (sint8 rad); - MTH bool change_weapon (object *ob); - MTH bool change_skill (object *ob); + MTH bool change_skill (object *ob); // deprecated? MTH void open_container (object *new_container); MTH void close_container () @@ -605,6 +615,9 @@ return !!contr; } + /* elmex: this method checks whether the object is in a shop */ + MTH bool is_in_shop () const; + MTH bool affects_los () const { return glow_radius || flag [FLAG_BLOCKSVIEW]; @@ -654,6 +667,7 @@ void enter_exit (object *exit);//Perl MTH void enter_map (maptile *newmap, int x, int y); void player_goto (const_utf8_string path, int x, int y); // only for players + MTH bool apply (object *ob, int aflags = AP_APPLY); // ob may be 0 // returns the mapspace this object is in mapspace &ms () const;