Pol  Revision:4b29d2b
weapon.cpp
Go to the documentation of this file.
1 
10 #include "weapon.h"
11 
12 #include <stddef.h>
13 #include <string>
14 
15 #include "../../bscript/bstruct.h"
16 #include "../../bscript/impstr.h"
17 #include "../../clib/cfgelem.h"
18 #include "../../clib/logfacility.h"
19 #include "../../clib/passert.h"
20 #include "../../clib/streamsaver.h"
21 #include "../../clib/strutil.h"
22 #include "../../plib/systemstate.h"
23 #include "../containr.h"
24 #include "../dice.h"
25 #include "../equipdsc.h"
26 #include "../extobj.h"
27 #include "../globals/settings.h"
28 #include "../globals/uvars.h"
29 #include "../layers.h"
30 #include "../mobile/charactr.h"
31 #include "../realms/realm.h"
32 #include "../ufunc.h"
33 #include "../umanip.h"
34 #include "../uobject.h"
35 #include "itemdesc.h"
36 #include "wepntmpl.h"
37 
38 namespace Pol
39 {
40 namespace Items
41 {
42 /*
43 WeaponDesc::WeaponDesc() :
44 skillid( SKILLID_WRESTLING ),
45 speed( 100 ),
46 delay( 0 ),
47 damage_dice(),
48 projectile(false),
49 projectile_type(0),
50 maxhp(1)
51 {
52 }
53 */
54 
56 {
57  unsigned short tmp = elem.remove_ushort( name, static_cast<unsigned short>( deflt ) );
58  if ( Core::UACTION_IS_VALID( tmp ) )
59  {
60  return static_cast<Core::UACTION>( tmp );
61  }
62  else
63  {
64  elem.throw_error( std::string( name ) + " is out of range" );
65  }
66 }
68 {
69  unsigned short tmp = elem.remove_ushort( name );
70  if ( Core::UACTION_IS_VALID( tmp ) )
71  {
72  return static_cast<Core::UACTION>( tmp );
73  }
74  else
75  {
76  elem.throw_error( std::string( name ) + " is out of range" );
77  }
78 }
79 
80 Core::UACTION default_anim( bool two_handed )
81 {
82  if ( two_handed )
84  else
86 }
87 
89  : EquipDesc( objtype, elem, WEAPONDESC, pkg ),
90  pAttr( nullptr ),
91  delay( elem.remove_ushort( "DELAY", 0 ) ),
92  hit_script( elem.remove_string( "HITSCRIPT", "" ), pkg, "scripts/items/" ),
93  damage_dice(),
94  projectile( elem.remove_bool( "PROJECTILE", false ) ),
95  projectile_type( 0 ),
96  projectile_anim( 0 ),
97  projectile_sound( 0 ),
98  projectile_action( static_cast<Core::UACTION>( 0 ) ),
99  anim( remove_action( elem, "Anim", Core::ACTION_HUMAN_ATTACK ) ),
100  mounted_anim( remove_action( elem, "MountedAnim", anim ) ),
101  hit_sound( elem.remove_ushort( "HITSOUND", 0 ) ),
102  miss_sound( elem.remove_ushort( "MISSSOUND", 0 ) ),
103  two_handed( elem.remove_bool( "TWOHANDED", false ) ),
104  minrange( elem.remove_ushort( "MINRANGE", projectile ? 2 : 0 ) ),
105  maxrange( elem.remove_ushort( "MAXRANGE", projectile ? 20 : 1 ) )
106 {
107  if ( delay == 0 )
108  speed = elem.remove_ushort( "SPEED" );
109  else
110  speed = 35;
111 
112  std::string attrname = elem.remove_string( "Attribute", "" );
113  if ( attrname.empty() )
114  {
115  attrname = elem.remove_string( "SkillID", "" );
116 
117  // throw the error this time
118  if ( attrname.empty() )
119  attrname = elem.remove_string( "Attribute" );
120 
121  elem.warn( "Element specifies a SkillID instead of an Attribute" );
122  }
123 
125  if ( !pAttr )
126  {
127  elem.throw_error( "Attribute " + attrname + " not found" );
128  }
129 
130  if ( elem.has_prop( "INTRINSIC" ) )
131  {
132  elem.throw_error( "Weapon has INTRINSIC property, which is no longer needed" );
133  }
134 
135  if ( speed <= 0 )
136  {
137  elem.throw_error( "Weapon has illegal Speed value (Speed must be positive)" );
138  }
139  if ( maxhp <= 0 )
140  {
141  elem.throw_error( "Weapon has illegal MaxHP value (MaxHP must be positive)" );
142  }
143 
144  std::string errmsg;
145  if ( !damage_dice.load( elem.remove_string( "DAMAGE" ).c_str(), &errmsg ) )
146  {
147  elem.throw_error( "Error parsing DAMAGE string for WeaponTemplate\n" + errmsg );
148 
149  /*cerr << "Error parsing DAMAGE string for WeaponTemplate " << objtype << endl;
150  cerr << " " << errmsg << endl;
151  throw runtime_error( "Configuration error" );*/
152  }
153 
154 
155  if ( projectile )
156  {
157  projectile_type = elem.remove_ushort( "ProjectileType" );
158  projectile_anim = elem.remove_ushort( "ProjectileAnim" );
159  projectile_sound = elem.remove_ushort( "ProjectileSound" );
160  }
161 }
162 
163 unsigned short WeaponDesc::get_random_damage() const
164 {
165  return damage_dice.roll();
166 }
167 
169 {
170  using namespace Bscript;
171  base::PopulateStruct( descriptor );
172  descriptor->addMember( "Speed", new BLong( speed ) );
173  descriptor->addMember( "Delay", new BLong( delay ) );
174 
175  descriptor->addMember( "Projectile", new BLong( projectile ) );
176  descriptor->addMember( "ProjectileType", new BLong( projectile_type ) );
177  descriptor->addMember( "ProjectileAnim", new BLong( projectile_anim ) );
178  descriptor->addMember( "ProjectileSound", new BLong( projectile_sound ) );
179 
180  descriptor->addMember( "HitSound", new BLong( hit_sound ) );
181  descriptor->addMember( "MissSound", new BLong( miss_sound ) );
182 
183  descriptor->addMember( "MinRange", new BLong( minrange ) );
184  descriptor->addMember( "MaxRange", new BLong( maxrange ) );
185 
186  // descriptor->addMember( "Intrinsic", new BLong(is_intrinsic) );
187  descriptor->addMember( "TwoHanded", new BLong( two_handed ) );
188 
189  descriptor->addMember( "Anim", new BLong( anim ) );
190  descriptor->addMember( "MountedAnim", new BLong( mounted_anim ) );
191 
192  std::string tempstr;
193  damage_dice.die_string( tempstr );
194  descriptor->addMember( "Damage", new String( tempstr ) );
195  descriptor->addMember( "MinDamage", new BLong( damage_dice.min_value() ) );
196  descriptor->addMember( "MaxDamage", new BLong( damage_dice.max_value() ) );
197 
198  descriptor->addMember( "HitScript", new String( hit_script.relativename( pkg ) ) );
199  descriptor->addMember( "Attribute", new String( pAttr->name ) );
200 }
201 
203 {
204  return base::estimatedSize() + sizeof( const Mobile::Attribute* ) /*pAttr*/
205  + sizeof( unsigned short ) /*speed*/
206  + sizeof( unsigned short ) /*delay*/
207  + sizeof( Core::ScriptDef ) /*hit_script*/
208  + sizeof( Core::Dice ) /*damage_dice*/
209  + sizeof( bool ) /*projectile*/
210  + sizeof( unsigned short ) /*projectile_type*/
211  + sizeof( unsigned short ) /*projectile_anim*/
212  + sizeof( unsigned short ) /*projectile_sound*/
213  + sizeof( Core::UACTION ) /*projectile_action*/
214  + sizeof( Core::UACTION ) /*anim*/
215  + sizeof( Core::UACTION ) /*mounted_anim*/
216  + sizeof( unsigned short ) /*hit_sound*/
217  + sizeof( unsigned short ) /*miss_sound*/
218  + sizeof( bool ) /*two_handed*/
219  + sizeof( unsigned short ) /*minrange*/
220  + sizeof( unsigned short ) /*maxrange*/
222 }
223 
229  const Plib::Package* pkg )
230 {
231  auto tmpl = new WeaponDesc( Core::settingsManager.extobj.wrestling, elem, pkg );
232  tmpl->is_intrinsic = true;
233  auto wpn = new UWeapon( *tmpl, tmpl );
234  wpn->layer = Core::LAYER_HAND1;
235  wpn->tmpl = tmpl;
236 
238 
239  return wpn;
240 }
241 
245 {
246  const ItemDesc& id = find_itemdesc( Core::settingsManager.extobj.wrestling );
247  if ( id.save_on_exit )
248  throw std::runtime_error( "Wrestling weapon " +
249  Clib::hexint( Core::settingsManager.extobj.wrestling ) +
250  " must specify SaveOnExit 0" );
251 
252  if ( id.type == ItemDesc::WEAPONDESC )
253  {
254  const WeaponDesc* weapon_descriptor = static_cast<const WeaponDesc*>( &id );
255  Core::gamestate.wrestling_weapon = new UWeapon( *weapon_descriptor, weapon_descriptor );
256 
257  {
258  // sets wrestling weapondesc as intrinsic
259  WeaponDesc* wdesc = const_cast<WeaponDesc*>( weapon_descriptor );
260  wdesc->is_intrinsic = true;
261  wdesc->is_pc_intrinsic = true;
262  }
265 
266  Items::insert_intrinsic_equipment( "PC_weapon", Core::gamestate.wrestling_weapon );
267  }
268 
269  // wrestling_weapon = find_intrinsic_weapon( "Wrestling" );
270  if ( Core::gamestate.wrestling_weapon == nullptr )
271  throw std::runtime_error( "A WeaponTemplate for Wrestling is required in itemdesc.cfg" );
272 }
273 
279  const Plib::Package* pkg )
280 {
281  std::string tmp;
282  if ( elem.remove_prop( "AttackSpeed", &tmp ) )
283  {
284  // Construct a WeaponTemplate for this NPC template.
285  Clib::ConfigElem wpnelem;
286  wpnelem.set_rest( elem.rest() );
287  wpnelem.set_source( elem );
288  wpnelem.add_prop( "Objtype", "0xFFFF" );
289  wpnelem.add_prop( "Graphic", "1" );
290  wpnelem.add_prop( "Speed", tmp );
291 
292  if ( elem.remove_prop( "AttackDelay", &tmp ) )
293  wpnelem.add_prop( "Delay", tmp );
294 
295  wpnelem.add_prop( "Damage", elem.remove_string( "AttackDamage" ) );
296 
297  if ( elem.has_prop( "AttackSkillId" ) )
298  wpnelem.add_prop( "SkillId", elem.remove_string( "AttackSkillId" ) );
299  else
300  wpnelem.add_prop( "Attribute", elem.remove_string( "AttackAttribute" ) );
301 
302  wpnelem.add_prop( "HitSound", elem.remove_string( "AttackHitSound", "0" ) );
303  wpnelem.add_prop( "MissSound", elem.remove_string( "AttackMissSound", "0" ) );
304  wpnelem.add_prop( "Anim", elem.remove_string( "AttackAnimation", "0" ));
305  wpnelem.add_prop( "MaxHp", "1" );
306  if ( elem.remove_prop( "AttackHitScript", &tmp ) )
307  wpnelem.add_prop( "HitScript", tmp );
308  if ( elem.remove_prop( "AttackMinRange", &tmp ) )
309  wpnelem.add_prop( "MinRange", tmp );
310  if ( elem.remove_prop( "AttackMaxRange", &tmp ) )
311  wpnelem.add_prop( "MaxRange", tmp );
312 
313  if ( elem.has_prop( "AttackProjectile" ) )
314  {
315  wpnelem.add_prop( "Projectile", "1" );
316  wpnelem.add_prop( "ProjectileType", elem.remove_string( "AttackProjectileType" ) );
317  wpnelem.add_prop( "ProjectileAnim", elem.remove_string( "AttackProjectileAnim" ) );
318  wpnelem.add_prop( "ProjectileSound", elem.remove_string( "AttackProjectileSound" ) );
319  }
320 
321  while ( elem.remove_prop( "AttackCProp", &tmp ) )
322  wpnelem.add_prop( "CProp", tmp );
323 
324  return create_intrinsic_weapon( elem.rest(), wpnelem, pkg );
325  }
326  else
327  {
328  return nullptr;
329  }
330 }
331 
332 UWeapon::UWeapon( const WeaponDesc& descriptor, const WeaponDesc* permanent_descriptor )
333  : Equipment( descriptor, Core::UOBJ_CLASS::CLASS_WEAPON, permanent_descriptor ),
334  hit_script_( descriptor.hit_script )
335 {
336 }
337 
339 {
341 }
342 
343 unsigned short UWeapon::speed() const
344 {
345  int speed_ = WEAPON_TMPL->speed + speed_mod();
346 
347  if ( speed_ < 0 )
348  return 0;
349  else if ( speed_ <= USHRT_MAX )
350  return static_cast<u16>( speed_ );
351  else
352  return USHRT_MAX;
353 }
354 
355 unsigned short UWeapon::delay() const
356 {
357  return WEAPON_TMPL->delay;
358 }
359 
361 {
362  return *( WEAPON_TMPL->pAttr );
363 }
364 
365 unsigned short UWeapon::get_random_damage() const
366 {
367  int dmg = int( WEAPON_TMPL->get_random_damage() ) * hp_ / maxhp();
368  dmg += damage_mod();
369  if ( dmg < 0 )
370  return 0;
371  else if ( dmg <= USHRT_MAX )
372  return static_cast<unsigned short>( dmg );
373  else
374  return USHRT_MAX;
375 }
376 
378 {
379  passert( tmpl != nullptr );
380  return WEAPON_TMPL->projectile;
381 }
382 
383 unsigned short UWeapon::projectile_sound() const
384 {
385  passert( tmpl != nullptr );
386  return WEAPON_TMPL->projectile_sound;
387 }
388 
389 unsigned short UWeapon::projectile_anim() const
390 {
391  passert( tmpl != nullptr );
392  return WEAPON_TMPL->projectile_anim;
393 }
394 
395 /*
396 UACTION UWeapon::projectile_action() const
397 {
398 return tmpl->projectile_action;
399 }
400 */
401 
403 {
404  passert( tmpl != nullptr );
405  return WEAPON_TMPL->anim;
406 }
407 
409 {
410  passert( tmpl != nullptr );
411  return WEAPON_TMPL->mounted_anim;
412 }
413 
414 unsigned short UWeapon::hit_sound() const
415 {
416  passert( tmpl != nullptr );
417  return WEAPON_TMPL->hit_sound;
418 }
419 
420 unsigned short UWeapon::miss_sound() const
421 {
422  passert( tmpl != nullptr );
423  return WEAPON_TMPL->miss_sound;
424 }
425 
427 {
428  passert( tmpl != nullptr );
429  return *WEAPON_TMPL;
430 }
431 
433 {
434  passert( tmpl != nullptr );
435 
436  Item* item = cont->find_objtype_noninuse( WEAPON_TMPL->projectile_type );
437  if ( item != nullptr )
438  {
439  subtract_amount_from_item( item, 1 );
440  return true;
441  }
442  else
443  {
444  return false;
445  }
446 }
447 
448 bool UWeapon::in_range( const Mobile::Character* wielder, const Mobile::Character* target ) const
449 {
450  unsigned short dist = pol_distance( wielder, target );
451  INFO_PRINT_TRACE( 22 ) << "in_range(0x" << fmt::hexu( wielder->serial ) << ",0x"
452  << fmt::hexu( target->serial ) << "):\n"
453  << "dist: " << dist << "\n"
454  << "minrange: " << WEAPON_TMPL->minrange << "\n"
455  << "maxrange: " << WEAPON_TMPL->maxrange << "\n"
456  << "has_los: " << wielder->realm->has_los( *wielder, *target ) << "\n";
457  return ( dist >= WEAPON_TMPL->minrange && dist <= WEAPON_TMPL->maxrange &&
458  wielder->realm->has_los( *wielder, *target ) );
459 }
460 
461 // FIXME weak, weak..
463 {
464  UWeapon* wpn = static_cast<UWeapon*>( base::clone() );
465  wpn->hit_script_ = hit_script_;
466  wpn->damage_mod( this->damage_mod() );
467  wpn->speed_mod( this->speed_mod() );
468 
469  return wpn;
470 }
471 
473 {
474  base::printProperties( sw );
475 
476  short speed_mod_ = speed_mod();
477  short dmg_mod = damage_mod();
478 
479  if ( dmg_mod )
480  sw() << "\tdmg_mod\t" << dmg_mod << pf_endl;
481  if ( speed_mod_ )
482  sw() << "tspeed_mod\t" << speed_mod_ << pf_endl;
483  if ( !( hit_script_ == WEAPON_TMPL->hit_script ) )
484  sw() << "\tHitScript\t" << hit_script_.relativename( tmpl->pkg ) << pf_endl;
485 }
486 
488 {
489  base::readProperties( elem );
490 
491  damage_mod( static_cast<s16>( elem.remove_int( "DMG_MOD", 0 ) ) );
492  speed_mod( static_cast<s16>( elem.remove_int( "SPEED_MOD", 0 ) ) );
493 
494  // if the HITSCRIPT is not specified in the data file, keep the value from the template.
495  if ( elem.has_prop( "HITSCRIPT" ) )
496  set_hit_script( elem.remove_string( "HITSCRIPT" ) );
497 }
498 
499 void UWeapon::set_hit_script( const std::string& scriptname )
500 {
501  if ( scriptname.empty() )
502  {
503  hit_script_.clear();
504  }
505  else
506  {
507  passert( tmpl != nullptr );
508  hit_script_.config( scriptname, tmpl->pkg, "scripts/items/", true );
509  }
510 }
511 }
512 }
UWeapon * create_intrinsic_weapon(const char *name, Clib::ConfigElem &elem, const Plib::Package *pkg)
Creates a new intrinsic weapon and returns it.
Definition: weapon.cpp:228
virtual Item * clone() const POL_OVERRIDE
Definition: equipmnt.cpp:63
Core::UACTION remove_action(Clib::ConfigElem &elem, const char *name, Core::UACTION deflt)
Definition: weapon.cpp:55
std::string remove_string(const char *propname)
Definition: cfgfile.cpp:381
Core::UACTION mounted_anim() const
Definition: weapon.cpp:408
unsigned short roll(void) const
Definition: dice.cpp:26
void register_intrinsic_equipment(const std::string &name, Equipment *equip)
Must be called when a new intrinsic equipment is created.
Definition: equipmnt.cpp:137
virtual size_t estimatedSize() const POL_OVERRIDE
Definition: weapon.cpp:338
bool consume_projectile(Core::UContainer *cont) const
Definition: weapon.cpp:432
unsigned short min_value(void) const
Definition: dice.cpp:178
unsigned short hit_sound() const
Definition: weapon.cpp:414
bool in_range(const Mobile::Character *wielder, const Mobile::Character *target) const
Definition: weapon.cpp:448
unsigned short get_random_damage() const
Definition: weapon.cpp:163
virtual void printProperties(Clib::StreamWriter &sw) const POL_OVERRIDE
Definition: weapon.cpp:472
size_t estimatedSize() const
Definition: scrdef.cpp:140
Core::Dice damage_dice
Definition: wepntmpl.h:44
int remove_int(const char *propname)
Definition: cfgfile.cpp:340
const Core::EquipDesc * tmpl
Definition: equipmnt.h:84
std::string relativename(const Plib::Package *pkg=nullptr) const
Definition: scrdef.cpp:102
unsigned short speed
Definition: wepntmpl.h:39
void insert_intrinsic_equipment(const std::string &name, Equipment *equip)
Adds a new intrisinc equipment to the map of known ones.
Definition: equipmnt.cpp:154
Core::UACTION anim
Definition: wepntmpl.h:51
UWeapon(const WeaponDesc &descriptor, const WeaponDesc *permanent_descriptor)
Definition: weapon.cpp:332
virtual void readProperties(Clib::ConfigElem &elem) POL_OVERRIDE
Definition: weapon.cpp:487
virtual void printProperties(Clib::StreamWriter &sw) const POL_OVERRIDE
Definition: equipmnt.cpp:70
void addMember(const char *name, BObjectRef val)
Definition: bstruct.cpp:305
virtual size_t estimatedSize() const POL_OVERRIDE
Definition: equipmnt.cpp:109
const Mobile::Attribute & attribute() const
Definition: weapon.cpp:360
const ItemDesc & find_itemdesc(unsigned int objtype)
Definition: itemdesc.cpp:933
bool is_projectile() const
Definition: weapon.cpp:377
unsigned short projectile_type
Definition: wepntmpl.h:47
const WeaponDesc & descriptor() const
Definition: weapon.cpp:426
unsigned short delay() const
Definition: weapon.cpp:355
unsigned short maxhp() const
Definition: item.cpp:325
unsigned short projectile_sound() const
Definition: weapon.cpp:383
unsigned short projectile_sound
Definition: wepntmpl.h:49
void warn(const std::string &errmsg) const
Definition: cfgfile.cpp:298
std::string hexint(unsigned short v)
Definition: strutil.cpp:23
unsigned short u16
Definition: rawtypes.h:26
const char * rest() const
Definition: cfgfile.cpp:71
unsigned int u32
Definition: rawtypes.h:27
void set_hit_script(const std::string &scriptname)
Definition: weapon.cpp:499
unsigned short maxhp
Definition: itemdesc.h:129
virtual size_t estimatedSize() const POL_OVERRIDE
Definition: weapon.cpp:202
POL_NORETURN void throw_error(const std::string &errmsg) const
Definition: cfgfile.cpp:285
unsigned short miss_sound
Definition: wepntmpl.h:54
const Plib::Package * pkg
Definition: itemdesc.h:84
unsigned short delay
Definition: wepntmpl.h:40
unsigned short get_random_damage() const
Definition: weapon.cpp:365
void config(const std::string &name, const Plib::Package *pkg, const char *mainpfx, bool warn_if_not_found=true)
Definition: scrdef.cpp:55
void add_prop(std::string propname, std::string propval)
Definition: cfgfile.cpp:490
unsigned short hit_sound
Definition: wepntmpl.h:53
bool has_los(const Core::ULWObject &att, const Core::ULWObject &tgt) const
Definition: realmlos.cpp:146
Core::UACTION anim() const
Definition: weapon.cpp:402
#define passert(exp)
Definition: passert.h:62
void die_string(std::string &str) const
Definition: dice.cpp:171
unsigned short miss_sound() const
Definition: weapon.cpp:420
Core::ScriptDef hit_script_
Definition: weapon.h:131
Core::UACTION mounted_anim
Definition: wepntmpl.h:52
GameState gamestate
Definition: uvars.cpp:74
virtual void PopulateStruct(Bscript::BStruct *descriptor) const POL_OVERRIDE
Definition: equipdsc.cpp:18
SettingsManager settingsManager
Definition: settings.cpp:14
virtual void readProperties(Clib::ConfigElem &elem) POL_OVERRIDE
Definition: equipmnt.cpp:75
Items::Item * find_objtype_noninuse(u32 objtype) const
Definition: containr.cpp:449
const Mobile::Attribute * pAttr
Definition: wepntmpl.h:37
bool remove_prop(const char *propname, std::string *value)
Definition: cfgfile.cpp:128
unsigned short minrange
Definition: wepntmpl.h:58
unsigned short max_value(void) const
Definition: dice.cpp:188
void subtract_amount_from_item(Item *item, unsigned short amount)
Definition: ufunc.cpp:1584
#define INFO_PRINT_TRACE(n)
Definition: logfacility.h:226
unsigned short maxrange
Definition: wepntmpl.h:59
unsigned short pol_distance(unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2)
Definition: ufunc.cpp:481
bool has_prop(const char *propname) const
Definition: cfgfile.cpp:112
#define WEAPON_TMPL
Definition: weapon.h:45
Realms::Realm * realm
Definition: baseobject.h:56
unsigned short projectile_anim
Definition: wepntmpl.h:48
unsigned short remove_ushort(const char *propname)
Definition: cfgfile.cpp:318
std::string name
Definition: osmod.cpp:943
unsigned short hp_
Definition: item.h:271
void set_source(const ConfigElem &elem)
Definition: cfgfile.cpp:86
UWeapon * create_intrinsic_weapon_from_npctemplate(Clib::ConfigElem &elem, const Plib::Package *pkg)
Creates a new intrinic weapon for an NPC template and returns it.
Definition: weapon.cpp:278
void load_intrinsic_weapons()
Creates the intrinsic wrestling weapon for PCs must be called at startup.
Definition: weapon.cpp:244
bool inuse() const
Definition: item.h:314
Items::UWeapon * wrestling_weapon
Definition: uvars.h:146
bool load(const char *dice, std::string *errormsg)
Definition: dice.cpp:42
virtual size_t estimatedSize() const POL_OVERRIDE
Definition: equipdsc.cpp:22
#define pf_endl
Definition: proplist.cpp:25
void set_rest(const char *newrest)
Definition: cfgfile.cpp:76
bool UACTION_IS_VALID(unsigned short action)
Definition: action.h:67
Core::ScriptDef hit_script
Definition: wepntmpl.h:42
Definition: berror.cpp:12
Core::UACTION default_anim(bool two_handed)
Definition: weapon.cpp:80
virtual void PopulateStruct(Bscript::BStruct *descriptor) const POL_OVERRIDE
Definition: weapon.cpp:168
unsigned short projectile_anim() const
Definition: weapon.cpp:389
std::string name
Definition: attribute.h:40
unsigned short speed() const
Definition: weapon.cpp:343
static Attribute * FindAttribute(const std::string &str)
Definition: attribute.cpp:22
virtual Item * clone() const POL_OVERRIDE
Definition: weapon.cpp:462