|
6 | 6 | #include "script_game_object.h" |
7 | 7 | #include "script_game_object_impl.h" |
8 | 8 | #include "InventoryOwner.h" |
9 | | -#include "Pda.h" |
| 9 | +#include "PDA.h" |
10 | 10 | #include "xrMessages.h" |
11 | 11 | #include "character_info.h" |
12 | | -#include "gametask.h" |
13 | | -#include "actor.h" |
| 12 | +#include "GameTask.h" |
| 13 | +#include "Actor.h" |
14 | 14 | #include "Level.h" |
15 | 15 | #include "date_time.h" |
16 | | -#include "uigamesp.h" |
| 16 | +#include "UIGameSP.h" |
17 | 17 | #include "restricted_object.h" |
18 | 18 | #include "xrScriptEngine/script_engine.hpp" |
19 | 19 | #include "attachable_item.h" |
20 | 20 | #include "script_entity.h" |
21 | 21 | #include "string_table.h" |
22 | 22 | #include "alife_registry_wrappers.h" |
23 | 23 | #include "relation_registry.h" |
24 | | -#include "custommonster.h" |
25 | | -#include "actorcondition.h" |
| 24 | +#include "CustomMonster.h" |
| 25 | +#include "ActorCondition.h" |
26 | 26 | #include "xrAICore/Navigation/level_graph.h" |
27 | | -#include "huditem.h" |
| 27 | +#include "HudItem.h" |
28 | 28 | #include "ui/UItalkWnd.h" |
29 | | -#include "inventory.h" |
30 | | -#include "infoportion.h" |
| 29 | +#include "Inventory.h" |
| 30 | +#include "InfoPortion.h" |
31 | 31 | #include "AI/Monsters/BaseMonster/base_monster.h" |
32 | | -#include "weaponmagazined.h" |
33 | | -#include "ai/stalker/ai_stalker.h" |
| 32 | +#include "WeaponMagazined.h" |
| 33 | +#include "Ai/Stalker/ai_stalker.h" |
34 | 34 | #include "agent_manager.h" |
35 | 35 | #include "agent_member_manager.h" |
36 | 36 | #include "stalker_animation_manager.h" |
|
42 | 42 | #include "ai/stalker/ai_stalker_impl.h" |
43 | 43 | #include "smart_cover_object.h" |
44 | 44 | #include "smart_cover.h" |
45 | | -#include "customdetector.h" |
| 45 | +#include "CustomDetector.h" |
46 | 46 | #include "doors_manager.h" |
47 | 47 | #include "doors_door.h" |
48 | 48 | #include "Torch.h" |
49 | | -#include "physicobject.h" |
| 49 | +#include "PhysicObject.h" |
50 | 50 |
|
51 | 51 | bool CScriptGameObject::GiveInfoPortion(LPCSTR info_id) |
52 | 52 | { |
@@ -1693,3 +1693,32 @@ bool CScriptGameObject::is_door_blocked_by_npc() const |
1693 | 1693 | VERIFY2(m_door, make_string("object %s hasn't been registered as a door already", m_game_object->cName().c_str())); |
1694 | 1694 | return ai().doors().is_door_blocked(m_door); |
1695 | 1695 | } |
| 1696 | + |
| 1697 | + |
| 1698 | +//Alundaio: Methods for exporting the ability to detach/attach addons for magazined weapons |
| 1699 | +void CScriptGameObject::Weapon_AddonAttach(CScriptGameObject& item) |
| 1700 | +{ |
| 1701 | + auto weapon = smart_cast<CWeaponMagazined*>(&object()); |
| 1702 | + if (!weapon) |
| 1703 | + { |
| 1704 | + ai().script_engine().script_log(LuaMessageType::Error, "CWeaponMagazined : cannot access class member Weapon_AddonAttach!"); |
| 1705 | + return; |
| 1706 | + } |
| 1707 | + |
| 1708 | + if (weapon->CanAttach((PIItem)&item)) |
| 1709 | + weapon->Attach((PIItem)&item, true); |
| 1710 | +} |
| 1711 | + |
| 1712 | +void CScriptGameObject::Weapon_AddonDetach(pcstr item_section) |
| 1713 | +{ |
| 1714 | + auto weapon = smart_cast<CWeaponMagazined*>(&object()); |
| 1715 | + if (!weapon) |
| 1716 | + { |
| 1717 | + ai().script_engine().script_log(LuaMessageType::Error, "CWeaponMagazined : cannot access class member Weapon_AddonDetach!"); |
| 1718 | + return; |
| 1719 | + } |
| 1720 | + |
| 1721 | + if (weapon->CanDetach(item_section)) |
| 1722 | + weapon->Detach(item_section, true); |
| 1723 | +} |
| 1724 | +//Alundaio: END |
0 commit comments