DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
ActionFoldEntityToSlot.c
См. документацию.
2{
4
10
11 override bool HasTarget () { return false; }
12
13 override bool ActionCondition ( PlayerBase player, ActionTarget target, ItemBase item )
14 {
15 EntityAI att = player.GetInventory().FindAttachment(m_SlotID);
16 if ( item && att == null )
17 return true;
18 return false;
19 }
20
21 override bool ActionConditionContinue ( ActionData action_data ) { return true; }
22
23 override void OnExecuteClient ( ActionData action_data )
24 {
25 ClearInventoryReservationEx(action_data);
26 }
27
28 override void OnExecuteServer ( ActionData action_data )
29 {
30 if ( !GetGame().IsMultiplayer() )
31 ClearInventoryReservationEx(action_data);
32
33 ItemBase old_item = action_data.m_MainItem;
34 if (old_item.ConfigIsExisting("ChangeIntoOnAttach"))
35 {
36 string slot_name = InventorySlots.GetSlotName(m_SlotID);
37 string str = old_item.ChangeIntoOnAttach(slot_name);
38 if (str != "")
39 {
40 FoldBandanaToSlotLambda lambda = new FoldBandanaToSlotLambda(action_data.m_MainItem, str, action_data.m_Player, m_SlotID);
41 action_data.m_Player.ServerReplaceItemInHandsWithNewElsewhere(lambda);
42 }
43 }
44 }
45};
46
48{
49 void FoldBandanaToSlotLambda (EntityAI old_item, string new_item_type, PlayerBase player, int slot)
50 {
52 targetAtt.SetAttachment(player, NULL, slot);
53 OverrideNewLocation(targetAtt);
54 }
55};
ActionBase ActionData
Определения ActionBase.c:30
class ActionTargets ActionTarget
ref CCIBase m_ConditionItem
Определения ActionBase.c:64
void ClearInventoryReservationEx(ActionData action_data)
Определения ActionBase.c:1025
ref CCTBase m_ConditionTarget
Определения ActionBase.c:65
override bool HasTarget()
Определения ActionFoldEntityToSlot.c:11
override bool ActionConditionContinue(ActionData action_data)
Определения ActionFoldEntityToSlot.c:21
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Определения ActionFoldEntityToSlot.c:13
override void OnExecuteClient(ActionData action_data)
Определения ActionFoldEntityToSlot.c:23
override void CreateConditionComponents()
Определения ActionFoldEntityToSlot.c:5
override void OnExecuteServer(ActionData action_data)
Определения ActionFoldEntityToSlot.c:28
void ActionSingleUseBase()
Определения ActionSingleUseBase.c:31
Определения CCINonRuined.c:2
Определения CCTNone.c:2
Определения Building.c:6
void FoldBandanaToSlotLambda(EntityAI old_item, string new_item_type, PlayerBase player, int slot)
Определения ActionFoldEntityToSlot.c:49
proto native void SetAttachment(notnull EntityAI parent, EntityAI e, int slotId)
sets current inventory location type to Attachment with slot id set to <slotId>
InventoryLocation.
Определения InventoryLocation.c:29
const int INVALID
Invalid slot (-1)
Определения InventorySlots.c:17
static proto native owned string GetSlotName(int id)
converts slot_id to string
provides access to slot configuration
Определения InventorySlots.c:6
Определения InventoryItem.c:731
Определения PlayerBaseClient.c:2
proto native CGame GetGame()