Pol  Revision:cb584c9
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 nullptr 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=nullptr)
 
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_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 219 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().

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 nullptr if none is defined in the template

Definition at line 237 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().

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 228 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().

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 nullptr if none is defined in the template

Definition at line 278 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().

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

Definition at line 80 of file weapon.cpp.

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

const DoorDesc & Pol::Items::fast_find_doordesc ( 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 nullptr if not found.

Definition at line 128 of file equipmnt.cpp.

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

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

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 67 of file itemdesc.cpp.

References get_objtype_byname().

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

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

Definition at line 927 of file itemdesc.cpp.

References find_itemdesc().

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

bool Pol::Items::has_itemdesc ( u32  objtype)
void Pol::Items::insert_intrinsic_equipment ( const std::string &  name,
Equipment equip 
)
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_npc_intrinsic_equip ( )
void Pol::Items::load_package_itemdesc ( Plib::Package pkg)
bool Pol::Items::objtype_is_lockable ( u32  objtype)

Definition at line 900 of file itemdesc.cpp.

References find_itemdesc().

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

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

Definition at line 1099 of file item.cpp.

References preload_test_scripts().

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 
)
Core::UACTION Pol::Items::remove_action ( Clib::ConfigElem elem,
const char *  name 
)
void Pol::Items::remove_resources ( u32  objtype,
u16   
)
void Pol::Items::return_resources ( u32  objtype,
u16   
)
void Pol::Items::unload_armor_templates ( )
bool Pol::Items::valid_equip_layer ( const Item item)
inline

Definition at line 388 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 202 of file armor.cpp.

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

Referenced by Pol::xmain_inner().