DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ ActionCondition()

override bool ActionPackGift::ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate

См. определение в файле ActionPackGift.c строка 32

33 {
34 ItemBase item_to_pack = ItemBase.Cast(target.GetObject());
35 if (!item_to_pack)
36 return false;
37
38 if ( !item_to_pack.IsTakeable() ) return false;
39 if ( item_to_pack.IsBeingPlaced() ) return false;
40 if ( BaseBuildingBase.Cast(item_to_pack) ) return false;
41 if ( !item_to_pack.CanPutInCargo(null) ) return false;
42
43 EntityAI tgt_parent = EntityAI.Cast( target.GetParent() );
44
45 if ( tgt_parent )
46 {
47 if ( item_to_pack.GetInventory().IsAttachment() )
48 {
49 if ( !item_to_pack.CanDetachAttachment(tgt_parent) || !tgt_parent.CanReleaseAttachment(item_to_pack) )
50 return false;
51 }
52 else
53 {
54 if ( !item_to_pack.CanRemoveFromCargo(tgt_parent) || !tgt_parent.CanReleaseCargo(item_to_pack) )
55 return false;
56 }
57 }
58
59 if ( item_to_pack.GetInventory().GetCargo() && item_to_pack.GetInventory().GetCargo().GetItemCount() > 0)
60 return false;
61
62 if ( !item_to_pack.IsWeapon() && item_to_pack.GetInventory().AttachmentCount() > 0)
63 return false;
64
65
66 int x,y;
67 GetGame().GetInventoryItemSize( item_to_pack, x, y );
68
69 if( x > 5 || y > 5 )
70 return false;
71
72 return true;
73 }
class LogManager EntityAI
void BaseBuildingBase()
Определения BaseBuildingBase.c:1328
class GP5GasMask extends MaskBase ItemBase
Icon x
Icon y
proto void GetInventoryItemSize(InventoryItem item, out int width, out int height)
override bool CanDetachAttachment(EntityAI parent)
Определения GardenLime.c:42
override bool CanRemoveFromCargo(EntityAI parent)
Определения BaseBuildingBase.c:999
override bool CanPutInCargo(EntityAI parent)
Определения GardenBase.c:269
override bool IsTakeable()
Определения BaseBuildingBase.c:988
proto native CGame GetGame()

Перекрестные ссылки ActionTarget, ItemBase::CanDetachAttachment(), ItemBase::CanPutInCargo(), ItemBase::CanRemoveFromCargo(), GetGame(), CGame::GetInventoryItemSize(), ItemBase::IsTakeable(), x и y.