Pol  Revision:e50bd96
Pol::Items Namespace Reference

Classes

class  ArmorDesc
 
class  BoatDesc
 
class  ContainerDesc
 
class  DoorDesc
 
class  Equipment
 
class  HouseDesc
 
class  Item
 
class  ItemDesc
 
class  MapDesc
 
class  MultiDesc
 
struct  ResourceComponent
 
class  SpellbookDesc
 
class  SpellScrollDesc
 
class  UArmor
 
class  UWeapon
 
class  WeaponDesc
 

Functions

void allocate_intrinsic_equipment_serials ()
 Deferred allocator for serials during startup, see comments in register_intrinsic_equipment() More...
 
void allocate_intrinsic_weapon_serials ()
 
UArmorcreate_intrinsic_shield (const char *name, Clib::ConfigElem &elem, const Plib::Package *pkg)
 Creates a new intrinsic shield and returns it. More...
 
UArmorcreate_intrinsic_shield_from_npctemplate (Clib::ConfigElem &elem, const Plib::Package *pkg)
 Creates a new intrinic shield for an NPC template and returns it. More...
 
UWeaponcreate_intrinsic_weapon (Clib::ConfigElem &elem)
 
UWeaponcreate_intrinsic_weapon (const char *name, Clib::ConfigElem &elem, const Plib::Package *pkg)
 Creates a new intrinsic weapon and returns it. More...
 
UWeaponcreate_intrinsic_weapon_from_npctemplate (Clib::ConfigElem &elem, const Plib::Package *pkg)
 Creates a new intrinic weapon for an NPC template and returns it. More...
 
const ItemDescCreateItemDescriptor (Bscript::BStruct *itemdesc_struct)
 
Core::UACTION default_anim (bool two_handed)
 
const DoorDescfast_find_doordesc (u32 objtype)
 
const ContainerDescfind_container_desc (u32 objtype)
 
Equipmentfind_intrinsic_equipment (const std::string &name, u8 layer)
 Looks up for an existing intrinsic equipment and return it or NULL if not found. More...
 
const ItemDescfind_itemdesc (unsigned int objtype)
 
const MultiDescfind_multidesc (u32 objtype)
 
unsigned int get_objtype_byname (const char *str)
 
unsigned int get_objtype_from_string (const std::string &str)
 
unsigned short getcolor (unsigned int objtype)
 
unsigned short getgraphic (u32 objtype)
 
bool has_itemdesc (u32 objtype)
 
void insert_intrinsic_equipment (const std::string &name, Equipment *equip)
 Adds a new intrisinc equipment to the map of known ones. More...
 
bool isa_weapon (u32 objtype)
 
void load_armor_templates ()
 
void load_intrinsic_weapons ()
 Creates the intrinsic wrestling weapon for PCs must be called at startup. More...
 
void load_itemdesc (Clib::ConfigElem &elem)
 
void load_itemdesc ()
 
void load_npc_intrinsic_equip ()
 Recreates intrinsic equipment for defined NPCs must be called at startup. More...
 
void load_package_itemdesc (Plib::Package *pkg)
 
bool objtype_is_lockable (u32 objtype)
 
void preload_test_scripts (const std::string &script_ecl)
 
void preload_test_scripts ()
 
void read_itemdesc_file (const char *filename, Plib::Package *pkg=NULL)
 
void register_intrinsic_equipment (const std::string &name, Equipment *equip)
 Must be called when a new intrinsic equipment is created. More...
 
Core::UACTION remove_action (Clib::ConfigElem &elem, const char *name, Core::UACTION deflt)
 
Core::UACTION remove_action (Clib::ConfigElem &elem, const char *name)
 
void remove_resources (u32 objtype, u16)
 
void return_resources (u32 objtype, u16)
 
void unload_armor_templates ()
 
void unload_itemdesc ()
 
bool valid_equip_layer (int layer)
 
bool valid_equip_layer (const Item *item)
 
void validate_intrinsic_shield_template ()
 Must be called at startup, validates the intrinsic shield element. More...
 
void write_objtypes_txt ()
 

Function Documentation

void Pol::Items::allocate_intrinsic_equipment_serials ( )
void Pol::Items::allocate_intrinsic_weapon_serials ( )
UArmor* Pol::Items::create_intrinsic_shield ( const char *  name,
Clib::ConfigElem elem,
const Plib::Package pkg 
)

Creates a new intrinsic shield and returns it.

Parameters
namethe unique shield's name
elemthe config element to create from
pkgthe package

Definition at line 217 of file armor.cpp.

References Pol::Core::EquipDesc::is_intrinsic, Pol::Core::LAYER_HAND2, register_intrinsic_equipment(), Pol::Core::settingsManager, Pol::Items::Equipment::tmpl, and Pol::Items::UArmor::UArmor().

+ Here is the call graph for this function:

UArmor * Pol::Items::create_intrinsic_shield_from_npctemplate ( Clib::ConfigElem elem,
const Plib::Package pkg 
)

Creates a new intrinic shield for an NPC template and returns it.

Parameters
elemThe conig element defining the NPC
pkgThe package
Returns
The created shield or NULL if none is defined in the template

Definition at line 235 of file armor.cpp.

References Pol::Clib::ConfigElem::add_prop(), Pol::Items::UArmor::create_intrinsic_shield, Pol::Clib::ConfigElem::remove_prop(), Pol::Clib::ConfigElemBase::rest(), Pol::Clib::ConfigElem::set_rest(), and Pol::Clib::ConfigElem::set_source().

Referenced by load_npc_intrinsic_equip(), and Pol::Mobile::NPC::readNpcProperties().

+ Here is the call graph for this function:

UWeapon* Pol::Items::create_intrinsic_weapon ( Clib::ConfigElem elem)
UWeapon* Pol::Items::create_intrinsic_weapon ( const char *  name,
Clib::ConfigElem elem,
const Plib::Package pkg 
)

Creates a new intrinsic weapon and returns it.

Parameters
namethe unique weapon's name
elemthe config element to create from
pkgthe package

Definition at line 237 of file weapon.cpp.

References Pol::Core::LAYER_HAND1, register_intrinsic_equipment(), Pol::Core::settingsManager, and Pol::Items::WeaponDesc::WeaponDesc().

Referenced by create_intrinsic_weapon_from_npctemplate().

+ Here is the call graph for this function:

UWeapon * Pol::Items::create_intrinsic_weapon_from_npctemplate ( Clib::ConfigElem elem,
const Plib::Package pkg 
)

Creates a new intrinic weapon for an NPC template and returns it.

Parameters
elemThe conig element defining the NPC
pkgThe package
Returns
The created weapon or NULL if none is defined in the template

Definition at line 287 of file weapon.cpp.

References Pol::Clib::ConfigElem::add_prop(), create_intrinsic_weapon(), Pol::Clib::ConfigElem::has_prop(), Pol::Items::ItemDesc::pkg, Pol::Clib::ConfigElem::remove_prop(), Pol::Clib::ConfigElem::remove_string(), Pol::Clib::ConfigElemBase::rest(), Pol::Clib::ConfigElem::set_rest(), and Pol::Clib::ConfigElem::set_source().

Referenced by Pol::Items::UWeapon::hit_script(), load_npc_intrinsic_equip(), and Pol::Mobile::NPC::readNpcProperties().

+ Here is the call graph for this function:

Core::UACTION Pol::Items::default_anim ( bool  two_handed)

Definition at line 89 of file weapon.cpp.

References Pol::Core::ACTION_RIDINGHORSE4, and Pol::Core::ACTION_RIDINGHORSE7.

const DoorDesc & Pol::Items::fast_find_doordesc ( u32  objtype)

Definition at line 949 of file itemdesc.cpp.

References Pol::Items::ItemDesc::DOORDESC, find_itemdesc(), passert, and Pol::Items::ItemDesc::type.

+ Here is the call graph for this function:

const ContainerDesc & Pol::Items::find_container_desc ( u32  objtype)
Equipment * Pol::Items::find_intrinsic_equipment ( const std::string &  name,
u8  layer 
)

Looks up for an existing intrinsic equipment and return it or NULL if not found.

Definition at line 123 of file equipmnt.cpp.

References Pol::Core::gamestate, and Pol::Core::GameState::intrinsic_equipments.

Referenced by Pol::Mobile::NPC::readNpcProperties().

const MultiDesc & Pol::Items::find_multidesc ( u32  objtype)
unsigned int Pol::Items::get_objtype_byname ( const char *  str)
unsigned int Pol::Items::get_objtype_from_string ( const std::string &  str)

Definition at line 65 of file itemdesc.cpp.

References get_objtype_byname().

Referenced by Pol::Core::USpell::USpell().

+ Here is the call graph for this function:

unsigned short Pol::Items::getcolor ( unsigned int  objtype)

Definition at line 925 of file itemdesc.cpp.

References find_itemdesc().

Referenced by Pol::Core::Menu::read_menus().

+ Here is the call graph for this function:

bool Pol::Items::has_itemdesc ( u32  objtype)
void Pol::Items::insert_intrinsic_equipment ( const std::string &  name,
Equipment equip 
)

Adds a new intrisinc equipment to the map of known ones.

Definition at line 149 of file equipmnt.cpp.

References Pol::Core::gamestate, Pol::Core::GameState::intrinsic_equipments, Pol::Items::Equipment::is_intrinsic(), Pol::Items::Item::layer, and passert_always_r.

Referenced by Pol::Core::load_intrinsic_weapons(), and register_intrinsic_equipment().

+ Here is the call graph for this function:

bool Pol::Items::isa_weapon ( u32  objtype)
void Pol::Items::load_armor_templates ( )
void Pol::Items::load_itemdesc ( Clib::ConfigElem elem)
void Pol::Items::load_itemdesc ( )

Definition at line 1189 of file itemdesc.cpp.

References Pol::Clib::FileExists(), load_package_itemdesc(), Pol::Items::ItemDesc::pkg, read_itemdesc_file(), Pol::Plib::systemstate, and write_objtypes_txt().

Referenced by Pol::Core::load_data().

+ Here is the call graph for this function:

void Pol::Items::load_npc_intrinsic_equip ( )

Recreates intrinsic equipment for defined NPCs must be called at startup.

Definition at line 176 of file equipmnt.cpp.

References create_intrinsic_shield_from_npctemplate(), create_intrinsic_weapon_from_npctemplate(), Pol::Clib::FileExists(), Pol::Plib::GetPackageCfgPath(), Pol::Clib::ConfigFile::read(), Pol::Clib::ConfigElem::set_rest(), and Pol::Plib::systemstate.

Referenced by Pol::Core::load_data().

+ Here is the call graph for this function:

void Pol::Items::load_package_itemdesc ( Plib::Package pkg)

Definition at line 1121 of file itemdesc.cpp.

References Pol::Clib::FileExists(), Pol::Plib::GetPackageCfgPath(), Pol::Items::ItemDesc::pkg, and read_itemdesc_file().

Referenced by load_itemdesc().

+ Here is the call graph for this function:

bool Pol::Items::objtype_is_lockable ( u32  objtype)

Definition at line 898 of file itemdesc.cpp.

References find_itemdesc().

Referenced by Pol::Items::Item::create().

+ Here is the call graph for this function:

void Pol::Items::preload_test_scripts ( const std::string &  script_ecl)
void Pol::Items::preload_test_scripts ( )

Definition at line 1102 of file item.cpp.

References preload_test_scripts().

+ Here is the call graph for this function:

void Pol::Items::register_intrinsic_equipment ( const std::string &  name,
Equipment equip 
)
Core::UACTION Pol::Items::remove_action ( Clib::ConfigElem elem,
const char *  name,
Core::UACTION  deflt 
)

Definition at line 64 of file weapon.cpp.

References Pol::Clib::ConfigElem::remove_ushort(), Pol::Clib::ConfigElem::throw_error(), and Pol::Core::UACTION_IS_VALID().

+ Here is the call graph for this function:

Core::UACTION Pol::Items::remove_action ( Clib::ConfigElem elem,
const char *  name 
)

Definition at line 76 of file weapon.cpp.

References Pol::Clib::ConfigElem::remove_ushort(), Pol::Clib::ConfigElem::throw_error(), and Pol::Core::UACTION_IS_VALID().

+ Here is the call graph for this function:

void Pol::Items::remove_resources ( u32  objtype,
u16   
)

Definition at line 1222 of file itemdesc.cpp.

References find_itemdesc(), and Pol::Items::ItemDesc::resources.

Referenced by Pol::Items::Item::create(), and Pol::Items::Item::setamount().

+ Here is the call graph for this function:

void Pol::Items::return_resources ( u32  objtype,
u16   
)

Definition at line 1231 of file itemdesc.cpp.

References Pol::Clib::exit_signalled, find_itemdesc(), and Pol::Items::ItemDesc::resources.

Referenced by Pol::Items::Item::setamount(), and Pol::Items::Item::~Item().

+ Here is the call graph for this function:

void Pol::Items::unload_armor_templates ( )
bool Pol::Items::valid_equip_layer ( const Item item)
inline

Definition at line 371 of file item.h.

References Pol::Items::Item::tile_layer.

void Pol::Items::validate_intrinsic_shield_template ( )

Must be called at startup, validates the intrinsic shield element.

Definition at line 200 of file armor.cpp.

References Pol::Items::ItemDesc::ARMORDESC, find_itemdesc(), Pol::Clib::hexint(), and Pol::Core::settingsManager.

Referenced by Pol::xmain_inner().

+ Here is the call graph for this function:

void Pol::Items::write_objtypes_txt ( )