Pol
Revision:cb584c9
|
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 () |
UArmor * | create_intrinsic_shield (const char *name, Clib::ConfigElem &elem, const Plib::Package *pkg) |
Creates a new intrinsic shield and returns it. More... | |
UArmor * | create_intrinsic_shield_from_npctemplate (Clib::ConfigElem &elem, const Plib::Package *pkg) |
Creates a new intrinic shield for an NPC template and returns it. More... | |
UWeapon * | create_intrinsic_weapon (Clib::ConfigElem &elem) |
UWeapon * | create_intrinsic_weapon (const char *name, Clib::ConfigElem &elem, const Plib::Package *pkg) |
Creates a new intrinsic weapon and returns it. More... | |
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. More... | |
const ItemDesc * | CreateItemDescriptor (Bscript::BStruct *itemdesc_struct) |
Core::UACTION | default_anim (bool two_handed) |
const DoorDesc & | fast_find_doordesc (u32 objtype) |
const ContainerDesc & | find_container_desc (u32 objtype) |
Equipment * | find_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 ItemDesc & | find_itemdesc (unsigned int objtype) |
const MultiDesc & | find_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 () |
void Pol::Items::allocate_intrinsic_equipment_serials | ( | ) |
Deferred allocator for serials during startup, see comments in register_intrinsic_equipment()
Definition at line 167 of file equipmnt.cpp.
References ctBEu32, Pol::Core::gamestate, Pol::Core::GetNewItemSerialNumber(), Pol::Core::ObjectHash::Insert(), Pol::Core::GameState::intrinsic_equipments, Pol::Core::ObjectStorageManager::objecthash, Pol::Core::objStorageManager, Pol::Core::ULWObject::serial, and Pol::Core::UObject::serial_ext.
Referenced by Pol::xmain_inner().
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.
name | the unique shield's name |
elem | the config element to create from |
pkg | the 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.
elem | The conig element defining the NPC |
pkg | The package |
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 | ) |
Referenced by Pol::Items::UWeapon::hit_script().
UWeapon* Pol::Items::create_intrinsic_weapon | ( | const char * | name, |
Clib::ConfigElem & | elem, | ||
const Plib::Package * | pkg | ||
) |
Creates a new intrinsic weapon and returns it.
name | the unique weapon's name |
elem | the config element to create from |
pkg | the 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.
elem | The conig element defining the NPC |
pkg | The package |
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().
const ItemDesc * Pol::Items::CreateItemDescriptor | ( | Bscript::BStruct * | itemdesc_struct | ) |
Definition at line 965 of file itemdesc.cpp.
References Pol::Clib::ConfigElem::add_prop(), Pol::Bscript::BDictionary::contents(), Pol::Bscript::BStruct::contents(), Pol::Items::ItemDesc::create(), Pol::Core::GameState::dynamic_item_descriptors, find_itemdesc(), Pol::Core::gamestate, Pol::Bscript::BObjectImp::getStringRep(), Pol::Bscript::BObjectImp::isa(), Pol::Items::ItemDesc::objtype, OSTRINGSTREAM, OSTRINGSTREAM_STR, Pol::Bscript::BObjectImp::OTArray, Pol::Bscript::BObjectImp::OTDictionary, Pol::Items::ItemDesc::pkg, Pol::Bscript::ObjArray::ref_arr, Pol::Clib::ConfigElemBase::rest(), Pol::Clib::ConfigElem::set_rest(), Pol::Clib::ConfigElem::set_source(), Pol::Clib::ConfigElem::set_type(), Pol::Clib::strlower(), and Pol::Bscript::BObjectImp::typeOf().
Referenced by Pol::Core::getObjtypeParam().
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.
Definition at line 951 of file itemdesc.cpp.
References Pol::Items::ItemDesc::DOORDESC, find_itemdesc(), passert, and Pol::Items::ItemDesc::type.
const ContainerDesc & Pol::Items::find_container_desc | ( | u32 | objtype | ) |
Definition at line 942 of file itemdesc.cpp.
References Pol::Items::ItemDesc::CONTAINERDESC, find_itemdesc(), Pol::Clib::hexint(), passert_r, Pol::Items::ItemDesc::SPELLBOOKDESC, and Pol::Items::ItemDesc::type.
Referenced by Pol::Core::check_config().
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().
const ItemDesc & Pol::Items::find_itemdesc | ( | unsigned int | objtype | ) |
Definition at line 933 of file itemdesc.cpp.
References Pol::Core::GameState::desctable, Pol::Core::GameState::empty_itemdesc, and Pol::Core::gamestate.
Referenced by Pol::Module::_complete_create_item_at_location(), Pol::Testing::add_multi(), Pol::Core::check_config(), Pol::Items::ItemDesc::create(), Pol::Items::Item::create(), CreateItemDescriptor(), fast_find_doordesc(), Pol::Multi::CustomHouseDesign::FillComponents(), find_container_desc(), find_multidesc(), getcolor(), getgraphic(), Pol::Core::getObjtypeParam(), Pol::Multi::isboat(), Pol::Multi::ishouse(), Pol::Items::ItemDesc::ItemDesc(), Pol::Items::Item::itemdesc(), Pol::Core::load_intrinsic_weapons(), Pol::Module::UOExecutorModule::mf_DestroyItem(), Pol::Module::UOExecutorModule::mf_DestroyMulti(), Pol::Module::PolSystemExecutorModule::mf_GetItemDescriptor(), Pol::Module::UOExecutorModule::mf_TargetMultiPlacement(), Pol::Module::UOExecutorModule::mf_UseItem(), objtype_is_lockable(), Pol::Module::oldSellHandler(), read_itemdesc_file(), Pol::Core::read_multi(), remove_resources(), return_resources(), validate_intrinsic_shield_template(), Pol::Multi::UHouse::walk_on(), Pol::Core::write_dirty_data(), and Pol::Core::write_object_dirty_owners().
Definition at line 958 of file itemdesc.cpp.
References Pol::Items::ItemDesc::BOATDESC, find_itemdesc(), Pol::Items::ItemDesc::HOUSEDESC, passert, and Pol::Items::ItemDesc::type.
Referenced by Pol::Core::MultiPlacementCursor::send_placemulti().
unsigned int Pol::Items::get_objtype_byname | ( | const char * | str | ) |
Definition at line 58 of file itemdesc.cpp.
References Pol::Core::gamestate, and Pol::Core::GameState::objtype_byname.
Referenced by Pol::Core::equip_from_template(), get_objtype_from_string(), Pol::Core::getObjtypeParam(), and Pol::Module::UOExecutorModule::mf_GetObjtypeByName().
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().
unsigned short Pol::Items::getgraphic | ( | u32 | objtype | ) |
Definition at line 906 of file itemdesc.cpp.
References Pol::Items::ItemDesc::BOATDESC, find_itemdesc(), Pol::Items::ItemDesc::graphic, Pol::Clib::hexint(), Pol::Items::ItemDesc::HOUSEDESC, Pol::Items::ItemDesc::objtype, Pol::Plib::systemstate, and Pol::Items::ItemDesc::type.
Referenced by Pol::Core::check_config(), Pol::Core::ResourceDef::findmarker(), Pol::Module::UOExecutorModule::mf_AddMenuItem(), Pol::Module::UOExecutorModule::mf_ListMultisInBox(), read_itemdesc_file(), Pol::Core::Menu::read_menus(), Pol::Multi::MultiDef::readobjects(), Pol::Multi::MultiDef::readshapes(), and Pol::Core::UObject::UObject().
bool Pol::Items::has_itemdesc | ( | u32 | objtype | ) |
Definition at line 895 of file itemdesc.cpp.
References Pol::Core::GameState::desctable, and Pol::Core::gamestate.
Referenced by Pol::Core::getObjtypeParam(), Pol::Items::ItemDesc::ItemDesc(), and read_itemdesc_file().
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 154 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().
bool Pol::Items::isa_weapon | ( | u32 | objtype | ) |
Referenced by Pol::Items::UWeapon::hit_script().
void Pol::Items::load_armor_templates | ( | ) |
void Pol::Items::load_intrinsic_weapons | ( | ) |
Creates the intrinsic wrestling weapon for PCs must be called at startup.
Definition at line 244 of file weapon.cpp.
References find_itemdesc(), Pol::Core::gamestate, Pol::Clib::hexint(), insert_intrinsic_equipment(), Pol::Items::Item::inuse(), Pol::Core::EquipDesc::is_intrinsic, Pol::Core::EquipDesc::is_pc_intrinsic, Pol::Items::Item::layer, Pol::Core::LAYER_HAND1, Pol::Items::ItemDesc::save_on_exit, Pol::Core::settingsManager, Pol::Items::ItemDesc::type, Pol::Items::ItemDesc::WEAPONDESC, and Pol::Core::GameState::wrestling_weapon.
Referenced by Pol::xmain_inner().
void Pol::Items::load_itemdesc | ( | Clib::ConfigElem & | elem | ) |
void Pol::Items::load_itemdesc | ( | ) |
Definition at line 1190 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().
void Pol::Items::load_npc_intrinsic_equip | ( | ) |
Recreates intrinsic equipment for defined NPCs must be called at startup.
Definition at line 181 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().
void Pol::Items::load_package_itemdesc | ( | Plib::Package * | pkg | ) |
Definition at line 1122 of file itemdesc.cpp.
References Pol::Clib::FileExists(), Pol::Plib::GetPackageCfgPath(), Pol::Items::ItemDesc::pkg, and read_itemdesc_file().
Referenced by load_itemdesc().
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 | ) |
Definition at line 1082 of file item.cpp.
References Pol::Core::ScriptDef::exists(), Pol::Core::find_script2(), Pol::Core::ScriptDef::quickconfig(), and Pol::Plib::systemstate.
Referenced by Pol::Core::load_data(), preload_test_scripts(), Pol::Core::unload_all_scripts(), and Pol::Core::unload_script().
void Pol::Items::preload_test_scripts | ( | ) |
Definition at line 1099 of file item.cpp.
References preload_test_scripts().
void Pol::Items::read_itemdesc_file | ( | const char * | filename, |
Plib::Package * | pkg = nullptr |
||
) |
Definition at line 1076 of file itemdesc.cpp.
References Pol::Items::ItemDesc::create(), Pol::Core::GameState::desctable, Pol::Plib::Package::dir(), ERROR_PRINT, find_itemdesc(), Pol::Core::gamestate, getgraphic(), has_itemdesc(), Pol::Clib::hexint(), Pol::Items::ItemDesc::objtype, Pol::Items::ItemDesc::pkg, Pol::Clib::ConfigFile::read(), and Pol::Clib::ConfigElem::throw_error().
Referenced by load_itemdesc(), and load_package_itemdesc().
void Pol::Items::register_intrinsic_equipment | ( | const std::string & | name, |
Equipment * | equip | ||
) |
Must be called when a new intrinsic equipment is created.
Definition at line 137 of file equipmnt.cpp.
References ctBEu32, Pol::Core::GetNewItemSerialNumber(), Pol::Core::ObjectHash::Insert(), insert_intrinsic_equipment(), Pol::Items::Item::inuse(), Pol::Core::ObjectStorageManager::objecthash, Pol::Core::objStorageManager, Pol::Core::ULWObject::serial, Pol::Core::UObject::serial_ext, and Pol::Core::stateManager.
Referenced by create_intrinsic_shield(), and create_intrinsic_weapon().
Core::UACTION Pol::Items::remove_action | ( | Clib::ConfigElem & | elem, |
const char * | name, | ||
Core::UACTION | deflt | ||
) |
Definition at line 55 of file weapon.cpp.
References Pol::Clib::ConfigElem::remove_ushort(), Pol::Clib::ConfigElem::throw_error(), and Pol::Core::UACTION_IS_VALID().
Core::UACTION Pol::Items::remove_action | ( | Clib::ConfigElem & | elem, |
const char * | name | ||
) |
Definition at line 67 of file weapon.cpp.
References Pol::Clib::ConfigElem::remove_ushort(), Pol::Clib::ConfigElem::throw_error(), and Pol::Core::UACTION_IS_VALID().
Definition at line 1223 of file itemdesc.cpp.
References find_itemdesc(), and Pol::Items::ItemDesc::resources.
Referenced by Pol::Items::Item::create(), and Pol::Items::Item::setamount().
Definition at line 1232 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().
void Pol::Items::unload_armor_templates | ( | ) |
void Pol::Items::unload_itemdesc | ( | ) |
Definition at line 1203 of file itemdesc.cpp.
References Pol::Core::GameState::dynamic_item_descriptors, Pol::Core::GameState::empty_itemdesc, Pol::Core::gamestate, Pol::Core::GameState::objtype_byname, and Pol::Core::GameState::old_objtype_conversions.
Referenced by Pol::Core::unload_data().
|
inline |
Definition at line 383 of file item.h.
References Pol::Core::HIGHEST_LAYER, and Pol::Core::LOWEST_LAYER.
Referenced by Pol::Core::UCorpse::add(), Pol::Mobile::Character::equippable(), Pol::Core::WornItemsContainer::GetItemOnLayer(), Pol::Core::UCorpse::GetItemOnLayer(), Pol::Mobile::Character::is_equipped(), Pol::Core::UCorpse::on_insert_add_item(), Pol::Core::WornItemsContainer::PutItemOnLayer(), Pol::Core::UCorpse::PutItemOnLayer(), Pol::Core::UCorpse::remove(), Pol::Core::WornItemsContainer::RemoveItemFromLayer(), Pol::Core::UCorpse::RemoveItemFromLayer(), and Pol::Mobile::Character::unequip().
|
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().
void Pol::Items::write_objtypes_txt | ( | ) |
Definition at line 1132 of file itemdesc.cpp.
References Pol::Plib::SystemState::config, Pol::Core::gamestate, Pol::Clib::hexint(), Pol::Core::PolConfig::max_objtype, Pol::Plib::Package::name(), Pol::Items::ItemDesc::objtypename, Pol::Items::ItemDesc::pkg, and Pol::Plib::systemstate.
Referenced by load_itemdesc().