5384{
 5386    {
 5387        return true;
 5388    }
 5389};
 5390 
 5391
 5392 
 5394{   
 5398    
 5400    
 5403    
 5404    
 5405    
 5406    
 5407    
 5416    
 5422    
 5427    
 5432    
 5453    protected bool m_IsResultOfSplit 
 5454    
 5456    
 5461    
 5462    
 5463    
 5465    
 5469    
 5470    
 5471    
 5473
 5476    
 5477    
 5478    
 5484    
 5485    
 5493    
 5496    
 5497    
 5499    
 5500    
 5502 
 5503    
 5508    
 5509    
 5514    
 5515    
 5517    
 5518    
 5520    {
 5525        
 5526        if (!
GetGame().IsDedicatedServer())
 
 5527        {
 5529            {
 5531                
 5533                {
 5535                }
 5536            }
 5537            
 5540        }
 5541        
 5542        m_OldLocation = null;
 5543        
 5545        {
 5547        }
 5548        
 5549        if (ConfigIsExisting("headSelectionsToHide"))
 5550        {
 5553        }
 5554        
 5556        if (ConfigIsExisting("hideSelectionsByinventorySlot"))
 5557        {
 5559        }
 5560        
 5562 
 5563        m_IsResultOfSplit = false;
 5564        
 5566    }
 5567    
 5569    {
 5570        super.InitItemVariables();
 5571        
 5577        m_Count = ConfigGetInt(
"count");
 
 5578        
 5581        
 5586        
 5589        
 5594        
 5606        
 5610        
 5611        
 5614        if (ConfigIsExisting("canBeSplit"))
 5615        {
 5618        }
 5619        
 5621        if (ConfigIsExisting("itemBehaviour"))
 5623        
 5624        
 5627        RegisterNetSyncVariableInt("m_VarLiquidType");
 5628        RegisterNetSyncVariableInt("m_Cleanness",0,1);
 5629        
 5630        RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
 5631        RegisterNetSyncVariableFloat("m_ImpactSpeed");
 5632        RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
 5633        
 5634        RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
 5635        RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
 5636        RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
 5637        RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
 5638        
 5639        RegisterNetSyncVariableBool("m_IsBeingPlaced");
 5640        RegisterNetSyncVariableBool("m_IsTakeable");
 5641        RegisterNetSyncVariableBool("m_IsHologram");
 5642        
 5645        {
 5648        }
 5649        
 5651        
 5653        if (ConfigIsExisting("temperaturePerQuantityWeight"))
 5655            
 5656    }
 5657    
 5659    {
 5661    }
 5662 
 5664    {
 5667        {
 5672        }
 5673    }
 5674    
 5675    override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
 
 5676    {
 5678        {
 5681        }
 5682        
 5684    }
 5685    
 5687    {
 5693    }
 5694    
 5696    
 5698    {
 5700 
 5701        if (!action)
 5702        {
 5703            Debug.LogError(
"Action " + actionName + 
" dosn't exist!");
 
 5704            return;
 5705        }       
 5706        
 5708        if (!ai)
 5709        {
 5711            return;
 5712        }
 5713        
 5715        if (!action_array)
 5716        {
 5717            action_array = new array<ActionBase_Basic>;
 5719        }
 5720        if (LogManager.IsActionLogEnable())
 5721        {
 5722            Debug.ActionLog(action.ToString() + 
" -> " + ai, 
this.ToString() , 
"n/a", 
"Add action");
 
 5723        }
 5724        
 5725        if (action_array.Find(action) != -1)
 5726        {
 5727            Debug.Log(
"Action " + action.Type() + 
" already added to " + 
this + 
", skipping!");
 
 5728        }
 5729        else
 5730        {
 5731            action_array.Insert(action);
 5732        }
 5733    }
 5734    
 5736    {
 5738        ActionBase action = player.GetActionManager().GetAction(actionName);
 5741        
 5742        if (action_array)
 5743        {
 5744            action_array.RemoveItem(action);
 5745        }
 5746    }
 5747    
 5748    
 5749    
 5751    {
 5752        ActionOverrideData overrideData = new ActionOverrideData();
 5756        
 5758        if (!actionMap) 
 5759        {
 5762        }
 5763        
 5764        actionMap.Insert(this.
Type(), overrideData); 
 
 5765        
 5766    }
 5767    
 5769    
 5771    
 5772    
 5774    {
 5777        
 5780        
 5781        string config_to_search = "CfgVehicles";
 5782        string muzzle_owner_config;
 5783        
 5785        {
 5786            if (IsInherited(Weapon))
 5787                config_to_search = "CfgWeapons";    
 5788            
 5789            muzzle_owner_config = config_to_search + 
" " + 
GetType() + 
" ";
 
 5790            
 5791            string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
 5792            
 5794            
 5795            if (config_OnFire_subclass_count > 0)
 5796            {
 5797                array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
 5798                
 5799                for (int i = 0; i < config_OnFire_subclass_count; i++)
 5800                {
 5801                    string particle_class = "";
 5803                    string config_OnFire_entry = config_OnFire_class + particle_class;
 5804                    WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
 5805                    WPOF_array.Insert(WPOF);
 5806                }
 5807                
 5808                
 5810            }
 5811        }
 5812        
 5814        {
 5815            config_to_search = "CfgWeapons"; 
 5816            muzzle_owner_config = config_to_search + 
" " + 
GetType() + 
" ";
 
 5817            
 5818            string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
 5819            
 5821            
 5822            if (config_OnBulletCasingEject_count > 0  &&  IsInherited(Weapon))
 5823            {
 5824                array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
 5825                
 5826                for (i = 0; i < config_OnBulletCasingEject_count; i++)
 5827                {
 5828                    string particle_class2 = "";
 5830                    string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
 5831                    WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
 5832                    WPOBE_array.Insert(WPOBE);
 5833                }
 5834                
 5835                
 5837            }
 5838        }
 5839    }
 5840    
 5841    
 5843    {
 5846        
 5848        {
 5849            string config_to_search = "CfgVehicles";
 5850            
 5851            if (IsInherited(Weapon))
 5852                config_to_search = "CfgWeapons";
 5853            
 5854            string muzzle_owner_config = config_to_search + 
" " + 
GetType() + 
" ";
 
 5855            string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
 5856            
 5857            if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
 
 5858            {
 5859                
 5861                
 5863                {
 5865                    string error = 
"Error reading config " + 
GetType() + 
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
 
 5867                    return;
 5868                }
 5869                
 5872                
 5873                
 5874                
 5876                array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
 5877                
 5878                for (int i = 0; i < config_OnOverheating_subclass_count; i++)
 5879                {
 5880                    string particle_class = "";
 5882                    string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
 5884                    
 5885                    if (entry_type == CT_CLASS)
 5886                    {
 5887                        WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
 5888                        WPOOH_array.Insert(WPOF);
 5889                    }
 5890                }
 5891                
 5892                
 5894            }
 5895        }
 5896    }
 5897    
 5899    {
 5901    }
 5902    
 5904    {
 5906        {
 5908            
 5911            
 5914            
 5915            CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
 
 5916        }
 5917    }
 5918    
 5920    {
 5922            UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
 
 5923        
 5925            StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
 
 5926        
 5928            StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
 
 5929        
 5931        {
 5933        }
 5934    }
 5935    
 5937    {
 5939    }
 5940    
 5942    {
 5945        else
 5947        
 5949        {
 5952        }
 5953        else
 5954        {
 5957            
 5960        }
 5961        
 5963    }
 5964 
 5966    {
 5968        ItemBase.PlayOverheatingParticles(
this, ammoType, 
this, suppressor, 
"CfgWeapons");
 
 5969    }
 5970    
 5972    {
 5974        ItemBase.UpdateOverheatingParticles(
this, ammoType, 
this, suppressor, 
"CfgWeapons");
 
 5976    }
 5977    
 5979    {
 5981        ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
 
 5982    }
 5983    
 5985    {
 5988        
 5989        OverheatingParticle OP = new OverheatingParticle();
 5994        
 5996    }
 5997    
 5999    {
 6002        
 6003        return -1;
 6004    }
 6005    
 6007    {
 6009        {
 6012            
 6013            for (int i = count; i > 0; --i)
 6014            {
 6015                int id = i - 1;
 6018                
 6021                
 6022                if (overheat_coef < overheat_min  &&  overheat_coef >= overheat_max)
 6023                {
 6024                    if (p)
 6025                    {
 6028                    }
 6029                }
 6030            }
 6031        }
 6032    }
 6033    
 6035    {
 6037        {
 6039            {
 6040                int id = i - 1;
 6042                
 6043                if (OP)
 6044                {
 6046                    
 6047                    if (p)
 6048                    {
 6050                    }
 6051                    
 6052                    delete OP;
 6053                }
 6054            }
 6055            
 6058        }
 6059    }
 6060    
 6063    {
 6064        return 0.0;
 6065    }
 6066    
 6067    
 6069    {
 6070        return 250;
 6071    }
 6072    
 6074    {
 6075        return 0;
 6076    }
 6077    
 6080    {
 6082            return true;
 6083        
 6084        return false;
 6085    }
 6086    
 6089    {
 6092        
 6094        {
 6096        }
 6097        else 
 6098        {
 6099            
 6101        }
 6102        
 6104    }
 6105    
 6112    {
 6113        return -1;
 6114    }
 6115    
 6116    
 6117    
 6118    
 6120    {
 6122        {
 6124            int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
 6125 
 6126            if (r_index >= 0)
 6127            {
 6128                    InventoryLocation r_il = new InventoryLocation;
 6129                    player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
 6130 
 6131                    player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
 6134                    {
 6135                        r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
 
 6136                    }
 6138                    {
 6139                        r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
 
 6140                    }
 6141            
 6142            }
 6143            
 6144            player.GetHumanInventory().ClearUserReservedLocation(this);
 6145        }
 6146        
 6149    }
 6150 
 6151    
 6152    
 6153    
 6155    {
 6156        return ItemBase.m_DebugActionsMask; 
 
 6157    }
 6158    
 6160    {
 6161        return ItemBase.m_DebugActionsMask & mask;  
 
 6162    }
 6163    
 6165    {
 6166        ItemBase.m_DebugActionsMask = mask;
 
 6167    }
 6168    
 6170    {
 6171        ItemBase.m_DebugActionsMask |= mask;
 
 6172    }
 6173    
 6175    {
 6176        ItemBase.m_DebugActionsMask &= ~mask;
 
 6177    }
 6178    
 6180    {
 6182        {
 6184        }
 6185        else
 6186        {
 6188        }
 6189    }
 6190    
 6191    
 6193    {
 6194        if (GetEconomyProfile())
 6195        {
 6196            float q_max = GetEconomyProfile().GetQuantityMax();
 6197            if (q_max > 0)
 6198            {
 6199                float q_min = GetEconomyProfile().GetQuantityMin();
 6200                float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
 6201                
 6203                {
 6204                    ComponentEnergyManager comp = GetCompEM();
 6206                    {
 6208                    }
 6209                }
 6211                {
 6213                    
 6214                }
 6215                
 6216            }
 6217        }
 6218    }
 6219    
 6222    {
 6223        EntityAI parent = GetHierarchyParent();
 
 6224        
 6225        if (parent)
 6226        {
 6227            InventoryLocation inventory_location_to_lock = new InventoryLocation;
 6228            GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
 6229            parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(), 
true);
 
 6230        }
 6231    }
 6232    
 6235    {
 6236        EntityAI parent = GetHierarchyParent();
 
 6237        
 6238        if (parent)
 6239        {
 6240            InventoryLocation inventory_location_to_unlock = new InventoryLocation;
 6241            GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
 6242            parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(), 
false);
 
 6243        }
 6244    }
 6245    
 6247    {
 6248        
 6249
 6250
 6251
 6253        
 6255        {
 6256            if (ScriptInputUserData.CanStoreInputUserData())
 6257            {
 6258                ScriptInputUserData ctx = new ScriptInputUserData;
 6264                ctx.
Write(use_stack_max);
 
 6267                
 6269                {
 6270                    GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
 
 6271                }
 6272            }
 6273        }
 6274        else if (!
GetGame().IsMultiplayer())
 
 6275        {
 6277        }
 6278    }
 6279    
 6281    {
 6283    }
 6284    
 6286    {
 6288    }
 6289    
 6291    {
 6293    }
 6294    
 6296    {
 6297        
 6298        return false;
 6299    }
 6300    
 6302    {
 6303        return false;
 6304    }
 6305    
 6309    {
 6310        return false;
 6311    }
 6312    
 6314    {
 6315        return "";
 6316    }
 6317    
 6319    
 6321    {
 6322        return false;
 6323    }
 6324    
 6326    {
 6327        return true;
 6328    }
 6329    
 6330    
 6331    
 6333    {
 6334        return true;
 6335    }
 6336    
 6338    {
 6339        return true;
 6340    }
 6341    
 6343    {
 6344        PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
 
 6346    }
 6347    
 6349    {
 6351    }
 6352    
 6354    {
 6356        if (!is_being_placed)
 6358        SetSynchDirty();
 6359    }
 6360    
 6361    
 6363    
 6365    {
 6367    }
 6368    
 6370    {
 6372    }
 6373    
 6375    {
 6376        return 1;
 6377    }
 6378    
 6380    {
 6381        return false;
 6382    }
 6383    
 6385    {
 6387        SetSynchDirty();
 6388    }
 6389    
 6390
 6391
 6392
 6393
 6394
 6395
 6396
 6397
 6398
 6399
 6400
 6401
 6402
 6403
 6404
 6405
 6406
 6407
 6408
 6409
 6410
 6411
 6412
 6413
 6414
 6415
 6416
 6417
 6418 
 6419
 6420
 6421    
 6422    
 6423    
 6425    {
 6426        super.OnMovedInsideCargo(container);
 6427        
 6428        MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
 6429    }
 6430    
 6431    override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
 
 6432    {
 6433        super.EEItemLocationChanged(oldLoc,newLoc);
 6434        
 6435        PlayerBase new_player = null;
 6436        PlayerBase old_player = null;
 6437        
 6438        if (newLoc.GetParent())
 6439            new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
 6440        
 6441        if (oldLoc.GetParent())
 6442            old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
 6443        
 6445        {
 6446            int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
 6447 
 6448            if (r_index >= 0)
 6449            {
 6450                    InventoryLocation r_il = new InventoryLocation;
 6451                    old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
 6452 
 6453                    old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
 6456                    {
 6457                        r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
 
 6458                    }
 6460                    {
 6461                        r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
 
 6462                    }
 6463            
 6464            }
 6465        }
 6466        
 6468        {
 6469            if (new_player)
 6470                new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
 6471            
 6472            if (new_player == old_player)
 6473            {
 6474                
 6475                if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
 6476                {
 6478                    {
 6479                        if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
 6480                        {
 6481                            new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
 6482                        }
 6483                    }
 6484                    else
 6485                    {
 6486                        new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
 6487                    }
 6488                }
 6489                
 6490                if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
 6491                {
 6492                    int type = oldLoc.GetType();
 6494                    {
 6495                        oldLoc.GetParent().GetOnSetLock().Invoke(this);
 6496                    }
 6498                    {
 6499                        oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
 6500                    }
 6501                }
 6502                if (!m_OldLocation)
 6503                {
 6504                    m_OldLocation = new InventoryLocation;
 6505                }
 6506                m_OldLocation.Copy(oldLoc);
 6507            }
 6508            else
 6509            {
 6510                if (m_OldLocation)
 6511                {
 6512                    m_OldLocation.Reset();
 6513                }
 6514            }
 6515            
 6517        }
 6518        else
 6519        {
 6520            if (new_player)
 6521            {
 6522                int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
 6523                if (res_index >= 0)
 6524                {
 6525                    InventoryLocation il = new InventoryLocation;
 6526                    new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
 6528                    new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
 6531                    {
 6532                        il.
GetParent().GetOnReleaseLock().Invoke(it);
 
 6533                    }
 6535                    {
 6537                    }
 6538                    
 6539                }
 6540            }
 6542            {
 6543                
 6545            }
 6546        
 6547            if (m_OldLocation)
 6548            {
 6549                m_OldLocation.Reset();
 6550            }
 6551        }
 6552    }
 6553    
 6554    override void EOnContact(IEntity other, Contact extra)
 
 6555    {
 6557        {
 6558            int liquidType = -1;
 6560            if (impactSpeed > 0.0)
 6561            {
 6563                #ifndef SERVER
 6565                #else
 6567                SetSynchDirty();
 6568                #endif
 6570            }
 6571        }
 6572        
 6573        #ifdef SERVER
 6574        if (GetCompEM() && GetCompEM().IsPlugged())
 6575        {
 6576            if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
 
 6577                GetCompEM().UnplugThis();
 6578        }
 6579        #endif
 6580    }
 6581    
 6583    
 6585    {
 6587    }
 6588    
 6590    {
 6591        
 6592    }
 6593    
 6595    {
 6596        super.OnItemLocationChanged(old_owner, new_owner);
 6597                
 6598        PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
 6599        PlayerBase playerNew = PlayerBase.Cast(new_owner);
 6600        
 6601        if (!relatedPlayer && playerNew)
 6602            relatedPlayer = playerNew;
 6603        
 6604        if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
 6605        {
 6607            if (actionMgr)
 6608            {
 6609                ActionBase currentAction = actionMgr.GetRunningAction();
 6610                if (currentAction)
 6612            }
 6613        }
 6614        
 6615        Man ownerPlayerOld = null;
 6616        Man ownerPlayerNew = null;
 6617            
 6618        if (old_owner)   
 6619        {
 6620            if (old_owner.
IsMan())
 
 6621            {
 6622                ownerPlayerOld = Man.Cast(old_owner);
 6623            }
 6624            else
 6625            {
 6626                ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
 6627            }
 6628        }
 6629        else 
 6630        {
 6632            {
 6634                
 6635                if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
 
 6636                {
 6637                    GetCompEM().UnplugThis();
 6638                }
 6639            }
 6640        }
 6641        
 6642        if (new_owner)
 6643        {
 6644            if (new_owner.
IsMan())
 
 6645            {
 6646                ownerPlayerNew = Man.Cast(new_owner);
 6647            }
 6648            else
 6649            {
 6650                ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
 6651            }
 6652        }
 6653        
 6654        if (ownerPlayerOld != ownerPlayerNew)
 6655        {
 6656            if (ownerPlayerOld)
 6657            {
 6658                array<EntityAI> subItemsExit = new array<EntityAI>;
 6660                for (int i = 0; i < subItemsExit.Count(); i++)
 6661                {
 6664                }
 6665            }
 6666 
 6667            if (ownerPlayerNew)
 6668            {
 6669                array<EntityAI> subItemsEnter = new array<EntityAI>;
 6671                for (int j = 0; j < subItemsEnter.Count(); j++)
 6672                {
 6675                }
 6676            }
 6677        }
 6678        else if (ownerPlayerNew != null)
 6679        {
 6680            PlayerBase nplayer;
 6681            if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
 6682            {
 6683                array<EntityAI> subItemsUpdate = new array<EntityAI>;
 6685                for (int k = 0; k < subItemsUpdate.Count(); k++)
 6686                {
 6688                    itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
 6689                }
 6690            }
 6691        }
 6692        
 6693        if (old_owner)
 6694            old_owner.OnChildItemRemoved(this);
 6695        if (new_owner)
 6696            new_owner.OnChildItemReceived(this);
 6697    }
 6698 
 6699    
 6701    {
 6702        super.EEDelete(parent);
 6703        PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
 6704        if (player)
 6705        {
 6707            
 6708            if (player.IsAlive())
 6709            {
 6710                int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
 6711                if (r_index >= 0)
 6712                {           
 6713                    InventoryLocation r_il = new InventoryLocation;
 6714                    player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
 6715    
 6716                    player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
 6719                    {
 6720                        r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
 
 6721                    }
 6723                    {
 6724                        r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
 
 6725                    }
 6726                
 6727                }
 6728                
 6729                player.RemoveQuickBarEntityShortcut(this);
 6730            }
 6731        }
 6732    }
 6733    
 6735    {
 6736        super.EEKilled(killer);
 6737
 6740        {
 6741            if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
 
 6742            {
 6743                if (IsMagazine())
 6744                {
 6745                    if (Magazine.Cast(this).GetAmmoCount() > 0)
 6746                    {
 6748                    }
 6749                }
 6750                else
 6751                {
 6753                }
 6754            }
 6755        }
 6756    }
 6757    
 6759    {
 6760        MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
 6761        
 6762        super.OnWasAttached(parent, slot_id);
 6763        
 6766        
 6768    }
 6769    
 6771    {
 6772        super.OnWasDetached(parent, slot_id);
 6773        
 6776    }
 6777    
 6779    {
 6780        int idx;
 6783        
 6784        ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
 6785        if (inventory_slots.Count() < 1) 
 6786        {
 6787            inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
 6788            attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
 6789        }
 6790        else 
 6791        {
 6792            ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
 6793        }
 6794        
 6795        idx = inventory_slots.Find(slot);
 6796        if (idx < 0)
 6797            return "";
 6798        
 6799        return attach_types.Get(idx);
 6800    }
 6801    
 6803    {
 6804        int idx = -1;
 6805        string slot;
 6806        
 6809        
 6810        this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
 6811        if (inventory_slots.Count() < 1) 
 6812        {
 6813            inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
 6814            detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
 6815        }
 6816        else 
 6817        {
 6818            this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
 6819            if (detach_types.Count() < 1)
 6820                detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
 6821        }
 6822        
 6823        for (int i = 0; i < inventory_slots.Count(); i++)
 6824        {
 6825            slot = inventory_slots.Get(i);
 6826        }
 6827        
 6828        if (slot != "")
 6829        {
 6830            if (detach_types.Count() == 1)
 6831                idx = 0;
 6832            else
 6833                idx = inventory_slots.Find(slot);
 6834        }
 6835        if (idx < 0)
 6836            return "";
 6837    
 6838        return detach_types.Get(idx);
 6839    }
 6840    
 6842    {
 6843        
 6845        
 6846        
 6847        float min_time = 1;
 6848        float max_time = 3;
 6849        float delay = Math.RandomFloat(min_time, max_time);
 6850        
 6851        explode_timer.Run(delay, this, "DoAmmoExplosion");
 6852    }
 6853    
 6855    {
 6856        Magazine magazine = Magazine.Cast(this);
 6857        int pop_sounds_count = 6;
 6858        string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
 6859        
 6860        
 6861        int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
 6862        string sound_name = pop_sounds[ sound_idx ];
 6864        
 6865        
 6866        magazine.ServerAddAmmoCount(-1);
 6867        
 6868        
 6869        float min_temp_to_explode   = 100;      
 6870                
 6871        if (magazine.GetAmmoCount() > 0 && 
GetTemperature() >= min_temp_to_explode)   
 
 6872        {
 6874        }
 6875    }
 6876    
 6877    
 6878    override void EEHitBy(TotalDamageResult damageResult, 
int damageType, 
EntityAI source, 
int component, 
string dmgZone, 
string ammo, vector modelPos, 
float speedCoef)
 
 6879    {
 6880        super.EEHitBy(damageResult, damageType, source, 
component, dmgZone, ammo, modelPos, speedCoef);
 
 6881        
 6882        const int CHANCE_DAMAGE_CARGO = 4;
 6883        const int CHANCE_DAMAGE_ATTACHMENT = 1;
 6884        const int CHANCE_DAMAGE_NOTHING = 2;
 6885        
 6887        {
 6888            float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
 
 6889            int chances;
 6890            int rnd;
 6891            
 6892            if (GetInventory().GetCargo())
 6893            {
 6894                chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
 6895                rnd = Math.RandomInt(0,chances);
 6896                
 6897                if (rnd < CHANCE_DAMAGE_CARGO)
 6898                {
 6900                }
 6901                else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
 6902                {
 6904                }
 6905            }
 6906            else
 6907            {
 6908                chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
 6909                rnd = Math.RandomInt(0,chances);
 6910                
 6911                if (rnd < CHANCE_DAMAGE_ATTACHMENT)
 6912                {
 6914                }
 6915            }
 6916        }
 6917    }
 6918    
 6920    {
 6921        if (GetInventory().GetCargo())
 6922        {
 6923            int item_count = GetInventory().GetCargo().GetItemCount();
 6924            if (item_count > 0)
 6925            {
 6926                int random_pick = Math.RandomInt(0, item_count);
 6928                if (!item.IsExplosive())
 6929                {
 6930                    item.AddHealth("","",damage);
 6931                    return true;
 6932                }
 6933            }
 6934        }
 6935        return false;
 6936    }
 6937    
 6939    {
 6940        int attachment_count = GetInventory().AttachmentCount();
 6941        if (attachment_count > 0)
 6942        {
 6943            int random_pick = Math.RandomInt(0, attachment_count);
 6944            ItemBase attachment = 
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
 
 6945            if (!attachment.IsExplosive())
 6946            {
 6947                attachment.AddHealth("","",damage);
 6948                return true;
 6949            }
 6950        }
 6951        return false;
 6952    }
 6953    
 6955    {
 6957    }
 6958    
 6960    {
 6962            return GetInventory().CanRemoveEntity();
 6963        
 6964        return false;
 6965    }
 6966 
 6968    {
 6969        
 6971            return false;
 6972 
 6973        
 6975            return false;
 6976 
 6977        
 6978        
 6980        if (delta == 0)
 6981            return false;
 6982 
 6983        
 6984        return true;
 6985    }
 6986    
 6988    {       
 6990        {
 6991            if (ScriptInputUserData.CanStoreInputUserData())
 6992            {
 6993                ScriptInputUserData ctx = new ScriptInputUserData;
 6998                ctx.
Write(destination_entity);
 
 7002            }
 7003        }
 7004        else if (!
GetGame().IsMultiplayer())
 
 7005        {
 7007        }
 7008    }
 7009 
 7011    {       
 7012        float split_quantity_new;
 7016        InventoryLocation loc = new InventoryLocation;
 7017        
 7018        if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
 7019        {
 7021                split_quantity_new = stack_max;
 7022            else
 7024 
 7026            {
 7027                new_item = 
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
 
 7028                if (new_item)
 7029                {
 7030                    new_item.SetResultOfSplit(true);
 7031                    MiscGameplayFunctions.TransferItemProperties(this, new_item);
 7033                    new_item.
SetQuantity(split_quantity_new, 
false, 
true);
 
 7034                }
 7035            }
 7036        }
 7037        else if (destination_entity && slot_id == -1)
 7038        {
 7039            if (quantity > stack_max)
 7040                split_quantity_new = stack_max;
 7041            else
 7042                split_quantity_new = quantity;
 7043            
 7045            {
 7047                {
 7050                }
 7051 
 7052                if (new_item)
 7053                {
 7054                    new_item.SetResultOfSplit(true);        
 7055                    MiscGameplayFunctions.TransferItemProperties(this, new_item);
 7057                    new_item.
SetQuantity(split_quantity_new, 
false, 
true);
 
 7058                }
 7059            }
 7060        }
 7061        else
 7062        {
 7063            if (stack_max != 0)
 7064            {
 7066                {
 7068                }
 7069                
 7070                if (split_quantity_new == 0)
 7071                {
 7072                    if (!
GetGame().IsMultiplayer())
 
 7073                        player.PhysicalPredictiveDropItem(this);
 7074                    else
 7075                        player.ServerDropEntity(this);
 7076                    return;
 7077                }
 7078                
 7080                {
 7082                    
 7083                    if (new_item)
 7084                    {
 7085                        new_item.SetResultOfSplit(true);
 7086                        MiscGameplayFunctions.TransferItemProperties(this, new_item);
 7089                        new_item.PlaceOnSurface();
 7090                    }
 7091                }
 7092            }
 7093        }
 7094    }
 7095    
 7097    {       
 7098        float split_quantity_new;
 7102        InventoryLocation loc = new InventoryLocation;
 7103        
 7104        if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
 7105        {
 7107                split_quantity_new = stack_max;
 7108            else
 7110 
 7112            {
 7113                new_item = 
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
 
 7114                if (new_item)
 7115                {
 7116                    new_item.SetResultOfSplit(true);
 7117                    MiscGameplayFunctions.TransferItemProperties(this, new_item);
 7119                    new_item.
SetQuantity(split_quantity_new, 
false, 
true);
 
 7120                }
 7121            }
 7122        }
 7123        else if (destination_entity && slot_id == -1)
 7124        {
 7125            if (quantity > stack_max)
 7126                split_quantity_new = stack_max;
 7127            else
 7128                split_quantity_new = quantity;
 7129            
 7131            {
 7133                {
 7136                }
 7137 
 7138                if (new_item)
 7139                {
 7140                    new_item.SetResultOfSplit(true);        
 7141                    MiscGameplayFunctions.TransferItemProperties(this, new_item);
 7143                    new_item.
SetQuantity(split_quantity_new, 
false, 
true);
 
 7144                }
 7145            }
 7146        }
 7147        else
 7148        {
 7149            if (stack_max != 0)
 7150            {
 7152                {
 7154                }
 7155                
 7157                {
 7159                    
 7160                    if (new_item)
 7161                    {
 7162                        new_item.SetResultOfSplit(true);
 7163                        MiscGameplayFunctions.TransferItemProperties(this, new_item);
 7166                        new_item.PlaceOnSurface();
 7167                    }
 7168                }
 7169            }
 7170        }
 7171    }
 7172    
 7174    {
 7176        {
 7177            if (ScriptInputUserData.CanStoreInputUserData())
 7178            {
 7179                ScriptInputUserData ctx = new ScriptInputUserData;
 7184                dst.WriteToContext(ctx);
 7186            }
 7187        }
 7188        else if (!
GetGame().IsMultiplayer())
 
 7189        {
 7191        }
 7192    }
 7193    
 7195    {
 7197        {
 7198            if (ScriptInputUserData.CanStoreInputUserData())
 7199            {
 7200                ScriptInputUserData ctx = new ScriptInputUserData;
 7205                ctx.
Write(destination_entity);
 
 7211            }
 7212        }
 7213        else if (!
GetGame().IsMultiplayer())
 
 7214        {
 7216        }
 7217    }
 7218 
 7220    {
 7222    }
 7223    
 7225    {       
 7227        float split_quantity_new;
 7229        if (dst.IsValid())
 7230        {
 7231            int slot_id = dst.GetSlot();
 7233            
 7234            if (quantity > stack_max)
 7235                split_quantity_new = stack_max;
 7236            else
 7237                split_quantity_new = quantity;
 7238 
 7240            {
 7242                
 7243                if (new_item)
 7244                {
 7245                    new_item.SetResultOfSplit(true);
 7246                    MiscGameplayFunctions.TransferItemProperties(this,new_item);
 7248                    new_item.
SetQuantity(split_quantity_new, 
false, 
true);
 
 7249                }
 7250                
 7251                return new_item;
 7252            }
 7253        }
 7254        
 7255        return null;
 7256    }
 7257    
 7259    {       
 7261        float split_quantity_new;
 7263        if (destination_entity)
 7264        {
 7266            if (quantity > stackable)
 7267                split_quantity_new = stackable;
 7268            else
 7269                split_quantity_new = quantity;
 7270            
 7272            {
 7273                new_item = 
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col, 
false));
 
 7274                if (new_item)
 7275                {
 7276                    new_item.SetResultOfSplit(true);    
 7277                    MiscGameplayFunctions.TransferItemProperties(this,new_item);
 7279                    new_item.
SetQuantity(split_quantity_new, 
false, 
true);
 
 7280                }
 7281            }
 7282        }
 7283    }
 7284    
 7286    {
 7288        {
 7289            if (ScriptInputUserData.CanStoreInputUserData())
 7290            {
 7291                ScriptInputUserData ctx = new ScriptInputUserData;
 7296                ItemBase destination_entity = 
this;
 
 7297                ctx.
Write(destination_entity);
 
 7301            }
 7302        }
 7303        else if (!
GetGame().IsMultiplayer())
 
 7304        {
 7306        }
 7307    }
 7308 
 7310    {       
 7312        float split_quantity_new;
 7314        if (player)
 7315        {
 7317            if (quantity > stackable)
 7318                split_quantity_new = stackable;
 7319            else
 7320                split_quantity_new = quantity;
 7321            
 7323            {
 7324                EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
 
 7325                new_item = 
ItemBase.Cast(in_hands);
 
 7326                if (new_item)
 7327                {       
 7328                    new_item.SetResultOfSplit(true);
 7329                    MiscGameplayFunctions.TransferItemProperties(this,new_item);
 7331                    new_item.SetQuantity(split_quantity_new, false, true);
 7332                }
 7333            }
 7334        }
 7335    }
 7336    
 7338    {       
 7340        float split_quantity_new = Math.Floor(quantity * 0.5);
 7341        
 7343            return;
 7344 
 7346 
 7347        if (new_item)
 7348        {
 7349            if (new_item.GetQuantityMax() < split_quantity_new)
 7350            {
 7351                split_quantity_new = new_item.GetQuantityMax();
 7352            }
 7353            
 7354            new_item.SetResultOfSplit(true);
 7355            MiscGameplayFunctions.TransferItemProperties(this, new_item);
 7356            
 7358            {
 7361            }
 7362            else
 7363            {
 7365                new_item.
SetQuantity(split_quantity_new, 
false, 
true);               
 
 7366            }
 7367        }   
 7368    }
 7369    
 7371    {
 7373        float split_quantity_new = Math.Floor(quantity / 2);
 7374        
 7376            return;
 7377        
 7378        InventoryLocation invloc = new InventoryLocation;
 7380        
 7382        new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
 7383        
 7384        if (new_item)
 7385        {
 7386            if (new_item.GetQuantityMax() < split_quantity_new)
 7387            {
 7388                split_quantity_new = new_item.GetQuantityMax();
 7389            }
 7391            {
 7394            }
 7395            else if (split_quantity_new > 1)
 7396            {
 7398                new_item.
SetQuantity(split_quantity_new, 
false, 
true);
 
 7399            }
 7400        }
 7401    }
 7402    
 7405    {
 7406        SetWeightDirty();
 7408        
 7409        if (parent)
 7410            parent.OnAttachmentQuantityChangedEx(this, delta);
 7411        
 7413        {
 7415            {
 7417            }
 7419            {
 7420                ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
 
 7422            }
 7423        }
 7424            
 7425    }
 7426    
 7429    {
 7430        
 7431    }
 7432    
 7435    {
 7437    }
 7438 
 7440    {
 7441        super.EEHealthLevelChanged(oldLevel,newLevel,zone);
 7442        
 7444        {
 7445            if (newLevel == GameConstants.STATE_RUINED)
 7446            {
 7448                EntityAI parent = GetHierarchyParent();
 
 7449                if (parent && parent.IsFireplace())
 7450                {
 7451                    CargoBase cargo = GetInventory().GetCargo();
 7452                    if (cargo)
 7453                    {
 7455                        {
 7457                        }
 7458                    }
 7459                }
 7460            }
 7461            
 7463            {
 7464                
 7466                return;
 7467            }
 7468 
 7469            if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
 
 7470            {
 7472            }
 7473        }
 7474    }
 7475        
 7476    
 7478    {
 7479        super.OnRightClick();
 7480        
 7482        {
 7484            {
 7485                if (ScriptInputUserData.CanStoreInputUserData())
 7486                {
 7487                    EntityAI root = GetHierarchyRoot();
 
 7488                    Man playerOwner = GetHierarchyRootPlayer();
 7489                    InventoryLocation dst = new InventoryLocation;
 7490                    
 7491                    
 7492                    if (!playerOwner && root && root == this)
 7493                    {
 7495                    }
 7496                    else
 7497                    {
 7498                        
 7499                        GetInventory().GetCurrentInventoryLocation(dst);
 7501                        {
 7504                            {
 7506                            }
 7507                            else
 7508                            {
 7510                                
 7511
 7512                                if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
 
 7513                                {
 7515                                }
 7516                                else
 7517                                {
 7518                                    GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
 
 7519                                }
 7520                            }
 7521                        }
 7522                    }
 7523                    
 7524                    ScriptInputUserData ctx = new ScriptInputUserData;
 7532                }
 7533            }
 7534            else if (!
GetGame().IsMultiplayer())
 
 7535            {
 7537            }
 7538        }
 7539    }
 7540        
 7542    {
 7543        if (root)
 7544        {
 7545            vector m4[4];
 7546            root.GetTransform(m4);
 7547            dst.SetGround(this, m4);
 7548        }
 7549        else
 7550        {
 7551            GetInventory().GetCurrentInventoryLocation(dst);
 7552        }
 7553    }
 7554    
 7555    override bool CanBeCombined(
EntityAI other_item, 
bool reservation_check = 
true, 
bool stack_max_limit = 
false)
 
 7556    {
 7557        
 7558        if (!other_item || 
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item == 
this)
 
 7559            return false;
 7560 
 7561        if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)    
 7562            return false;
 7563        
 7564        
 7566            return false;
 7567 
 7568        
 7569        Magazine mag = Magazine.Cast(this);
 7570        if (mag)
 7571        {
 7572            if (mag.GetAmmoCount() >= mag.GetAmmoMax())
 7573                return false;
 7574            
 7575            if (stack_max_limit)
 7576            {
 7577                Magazine other_mag = Magazine.Cast(other_item);
 7578                if (other_item)
 7579                {
 7580                    if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
 7581                        return false;
 7582                }
 7583            
 7584            }
 7585        }
 7586        else
 7587        {
 7588            
 7590                return false;
 7591            
 7593                return false;
 7594        }
 7595 
 7596        PlayerBase player = null;
 7597        if (CastTo(player, GetHierarchyRootPlayer())) 
 7598        {
 7599            if (player.GetInventory().HasAttachment(this))
 7600                return false;
 7601            
 7602            if (player.IsItemsToDelete())
 7603                return false;
 7604        }
 7605 
 7606        if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
 7607            return false;
 7608        
 7609        int slotID;
 7611        if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
 
 7612            return false;
 7613 
 7614        return true;
 7615    }
 7616    
 7618    {
 7620    }
 7621    
 7623    {
 7624        return m_IsResultOfSplit;
 7625    }
 7626    
 7628    {
 7629        m_IsResultOfSplit = value;
 7630    }
 7631    
 7633    {
 7635    }
 7636    
 7638    {
 7639        float other_item_quantity = other_item.GetQuantity();
 7640        float this_free_space;
 7641            
 7643        
 7645            
 7646        if (other_item_quantity > this_free_space)
 7647        {
 7648            return this_free_space;
 7649        }
 7650        else
 7651        {
 7652            return other_item_quantity;
 7653        }
 7654    }
 7655    
 7657    {
 7659    }
 7660    
 7662    {
 7664            return;
 7665        
 7666        if (!IsMagazine() && other_item)
 7667        {
 7669            if (quantity_used != 0)
 7670            {
 7671                float hp1 = GetHealth01("","");
 7672                float hp2 = other_item.GetHealth01("","");
 7673                float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
 
 7674                hpResult = hpResult / (
GetQuantity() + quantity_used);
 
 7675 
 7676                hpResult *= GetMaxHealth();
 7677                Math.Round(hpResult);
 7678                SetHealth("", "Health", hpResult);
 7679 
 7681                other_item.AddQuantity(-quantity_used);
 7682            }
 7683        }
 7685    }
 7686 
 7688    {
 7689        #ifdef SERVER
 7690        if (!GetHierarchyRootPlayer() && GetHierarchyParent())
 7691            GetHierarchyParent().IncreaseLifetimeUp();
 7692        #endif
 7693    };
 7694 
 7696    {
 7697        PlayerBase p = PlayerBase.Cast(player);
 7698            
 7699        array<int> recipesIds = p.m_Recipes;
 7700        PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
 
 7701        if (moduleRecipesManager)
 7702        {
 7703            EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
 
 7704            moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this), 
ItemBase.Cast(itemInHands), recipesIds, p);
 
 7705        }
 7706 
 7707        for (int i = 0;i < recipesIds.Count(); i++)
 7708        {
 7709            int key = recipesIds.Get(i);
 7710            string recipeName = moduleRecipesManager.GetRecipeName(key);
 7712        }
 7713    }
 7714    
 7715    
 7716    override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
 
 7717    {
 7718        super.GetDebugActions(outputList);
 7719            
 7720        
 7726        
 7727        
 7732        
 7737        
 7738        
 7742 
 7743        
 7745        {
 7749        }
 7750        
 7753 
 7754        
 7758        
 7760 
 7761        InventoryLocation loc = new InventoryLocation();
 7762        GetInventory().GetCurrentInventoryLocation(loc);
 7764        {
 7765            if (Gizmo_IsSupported())
 7768        }
 7769 
 7771    }
 7772    
 7773    
 7774    
 7775    
 7777    {
 7778        super.OnAction(action_id, player, ctx);
 7779 
 7781        {
 7782            switch (action_id)
 7783            {
 7786                    return true;
 7789                    return true;
 7790            }
 7791        }
 7792 
 7794        {
 7795            switch (action_id)
 7796            {
 7798                    Delete();
 7799                    return true;
 7800            }
 7801        }
 7802 
 7803        if (action_id >= 
EActions.RECIPES_RANGE_START && action_id < 
EActions.RECIPES_RANGE_END)
 
 7804        {
 7805            PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
 
 7806            int idWithoutOffset = action_id - 
EActions.RECIPES_RANGE_START;
 
 7807            PlayerBase p = PlayerBase.Cast(player);
 7808            if (
EActions.RECIPES_RANGE_START  < 1000)
 
 7809            {
 7810                float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
 7811                float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
 7812            }
 7813        }
 7814        #ifndef SERVER
 7815        else if (action_id == 
EActions.WATCH_PLAYER)
 
 7816        {
 7817            PluginDeveloper.SetDeveloperItemClientEx(player);
 7818        }
 7819        #endif
 7821        {
 7822            if (action_id >= 
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id < 
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
 
 7823            {
 7824                int id = action_id - 
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
 
 7825                OnDebugButtonPressServer(id + 1);
 7826            }
 7827            
 7828            else if (action_id >= 
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id < 
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
 
 7829            {
 7830                int agent_id = action_id - 
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
 
 7832            }
 7833    
 7834            else if (action_id >= 
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id < 
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
 
 7835            {
 7836                int agent_id2 = action_id - 
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
 
 7838            }
 7839            
 7840            else if (action_id == 
EActions.ADD_QUANTITY)
 
 7841            {
 7842                if (IsMagazine())
 7843                {
 7844                    Magazine mag = Magazine.Cast(this);
 7845                    mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
 7846                }
 7847                else
 7848                {
 7850                }
 7851                
 7852                if (m_EM)
 7853                {
 7854                    m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
 7855                }
 7856                
 7857            }
 7858                        
 7859            else if (action_id == 
EActions.REMOVE_QUANTITY) 
 
 7860            {
 7861                if (IsMagazine())
 7862                {
 7863                    Magazine mag2 = Magazine.Cast(this);
 7864                    mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
 7865                }
 7866                else
 7867                {
 7869                }
 7870                if (m_EM)
 7871                {
 7872                    m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
 7873                }
 7874                
 7875            }
 7876            
 7877            else if (action_id == 
EActions.SET_QUANTITY_0) 
 
 7878            {
 7880                
 7881                if (m_EM)
 7882                {
 7883                    m_EM.SetEnergy(0);
 7884                }
 7885            }
 7886            
 7887            else if (action_id == 
EActions.SET_MAX_QUANTITY) 
 
 7888            {
 7890                
 7891                if (m_EM)
 7892                {
 7893                    m_EM.SetEnergy(m_EM.GetEnergyMax());
 7894                }
 7895            }
 7896    
 7897            else if (action_id == 
EActions.ADD_HEALTH) 
 
 7898            {
 7899                AddHealth("","",GetMaxHealth("","Health")/5);
 7900            }
 7901            else if (action_id == 
EActions.REMOVE_HEALTH) 
 
 7902            {
 7903                AddHealth("","",-GetMaxHealth("","Health")/5);
 7904            }
 7905            else if (action_id == 
EActions.DESTROY_HEALTH) 
 
 7906            {
 7907                SetHealth01("","",0);
 7908            }
 7909            else if (action_id == 
EActions.WATCH_ITEM)
 
 7910            {
 7912                mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
 
 7913                #ifdef DEVELOPER
 7914                SetDebugDeveloper_item(this);
 7915                #endif
 7916            }
 7917            
 7918            else if (action_id == 
EActions.ADD_TEMPERATURE)
 
 7919            {
 7920                AddTemperature(20);
 7921                
 7922            }
 7923            
 7924            else if (action_id == 
EActions.REMOVE_TEMPERATURE)
 
 7925            {
 7926                AddTemperature(-20);
 7927                
 7928            }
 7929            
 7930            else if (action_id == 
EActions.FLIP_FROZEN)
 
 7931            {
 7932                SetFrozen(!GetIsFrozen());
 7933                
 7934            }
 7935            
 7936            else if (action_id == 
EActions.ADD_WETNESS)
 
 7937            {
 7939                
 7940            }
 7941            
 7942            else if (action_id == 
EActions.REMOVE_WETNESS)
 
 7943            {
 7945                
 7946            }
 7947    
 7948            else if (action_id == 
EActions.LIQUIDTYPE_UP)
 
 7949            {
 7952                
 7953                
 7954            }
 7955            
 7956            else if (action_id == 
EActions.LIQUIDTYPE_DOWN)
 
 7957            {
 7960            }
 7961 
 7962            else if (action_id == 
EActions.MAKE_SPECIAL)
 
 7963            {
 7964                auto debugParams = DebugSpawnParams.WithPlayer(player);
 7965                OnDebugSpawnEx(debugParams);
 7966            }
 7967            
 7968        }
 7969 
 7970        
 7971        return false;
 7972    }
 7973 
 7974    
 7975    
 7976    
 7980    
 7983 
 7984    
 7985    
 7987    {
 7988        return false;
 7989    }
 7990    
 7991    
 7993    {
 7994        return true;
 7995    }
 7996    
 7997    
 7999    {
 8000        return true;
 8001    }
 8002    
 8003    
 8004    
 8006    {
 8007        string config_path = 
string.Format(
"CfgVehicles %1 Food FoodStages", 
GetType());
 
 8009    }
 8010    
 8013    {
 8014        return null;
 8015    }
 8016    
 8018    {
 8019        return false;
 8020    }
 8021    
 8023    {
 8024        return false;
 8025    }       
 8026    
 8030    
 8031    
 8033    {
 8034        PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
 
 8035        return module_repairing.CanRepair(this, item_repair_kit);
 8036    }
 8037 
 8038    
 8039    bool Repair(PlayerBase player, 
ItemBase item_repair_kit, 
float specialty_weight)
 
 8040    {
 8041        PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
 
 8042        return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
 8043    }
 8044 
 8045    
 8047    {
 8048        
 8049
 8050
 8051
 8052
 8053
 8054
 8055        
 8056        return 1;
 8057    }
 8058    
 8059    
 8060    
 8062    {
 8064    }
 8065    
 8066    
 8067    
 8069    {
 8071    }
 8072    
 8073    
 8082    {
 8083        PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
 8084        
 8085        if (player)
 8086        {
 8087            player.MessageStatus(text);
 8088        }
 8089    }
 8090 
 8091    
 8100    {
 8101        PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
 8102        
 8103        if (player)
 8104        {
 8105            player.MessageAction(text);
 8106        }
 8107    }
 8108 
 8109    
 8118    {
 8119        PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
 8120        
 8121        if (player)
 8122        {
 8123            player.MessageFriendly(text);
 8124        }
 8125    }
 8126 
 8127    
 8136    {
 8137        PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
 8138        
 8139        if (player)
 8140        {
 8141            player.MessageImportant(text);
 8142        }
 8143    }
 8144 
 8146    {
 8147        return true;
 8148    }
 8149 
 8150    
 8151    override bool KindOf(
string tag)
 
 8152    {
 8153        bool found = false;
 8154        string item_name = this.
GetType();
 
 8157        
 8158        int array_size = item_tag_array.Count();
 8159        for (int i = 0; i < array_size; i++)
 8160        {
 8161            if (item_tag_array.Get(i) == tag)
 8162            {
 8163                found = true;
 8164                break;
 8165            }
 8166        }
 8167        return found;
 8168    }
 8169 
 8170    
 8172    {
 8173        
 8174        super.OnRPC(sender, rpc_type,ctx);
 8175            
 8176        
 8177        switch (rpc_type)
 8178        {
 8179            #ifndef SERVER
 8180            case ERPCs.RPC_SOUND_LOCK_ATTACH:
 
 8181                Param2<bool, string> p = new Param2<bool, string>(false, "");
 8182                    
 8184                    return;
 8185            
 8186                bool play = p.param1;
 8187                string soundSet = p.param2;
 8188                
 8189                if (play)
 8190                {
 8192                    {
 8194                        {
 8196                        }
 8197                    }
 8198                    else
 8199                    {
 8201                    }
 8202                }
 8203                else
 8204                {
 8206                }
 8207            
 8208            break;
 8209            #endif
 8210        
 8211        }
 8212        
 8214        {
 8216        }
 8217    }
 8218 
 8219    
 8220    
 8221    
 8223    {
 8224        PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
 
 8225        return plugin.GetID(
name);
 
 8226    }
 8227 
 8229    {
 8230        PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
 
 8231        return plugin.GetName(id);
 8232    }
 8233
 8236    {
 8237        
 8238        
 8239        int varFlags;
 8240        if (!ctx.
Read(varFlags))
 
 8241            return;
 8242        
 8243        if (varFlags & ItemVariableFlags.FLOAT)
 8244        {
 8246        }
 8247    }
 8248    
 8250    {
 8251        
 8252        super.SerializeNumericalVars(floats_out);
 8253        
 8254        
 8255        
 8257        {
 8259        }
 8260        
 8262        {
 8264        }
 8265        
 8267        {
 8269        }
 8270        
 8272        {
 8277        }
 8278        
 8280        {
 8282        }
 8283    }
 8284    
 8286    {
 8287        
 8288        super.DeSerializeNumericalVars(floats);
 8289        
 8290        
 8291        int index = 0;
 8292        int mask = Math.Round(floats.Get(index));
 8293        
 8294        index++;
 8295        
 8297        {
 8299            {
 8301            }
 8302            else
 8303            {
 8304                float quantity = floats.Get(index);
 8306            }
 8307            index++;
 8308        }
 8309        
 8311        {
 8312            float wet = floats.Get(index);
 8314            index++;
 8315        }
 8316        
 8318        {
 8319            int liquidtype = Math.Round(floats.Get(index));
 8321            index++;
 8322        }
 8323        
 8325        {
 8327            index++;
 8329            index++;
 8331            index++;
 8333            index++;
 8334        }
 8335        
 8337        {
 8338            int cleanness = Math.Round(floats.Get(index));
 8340            index++;
 8341        }
 8342    }
 8343    
 8345    {
 8346        super.WriteVarsToCTX(ctx);
 8347 
 8348        
 8350        {
 8352        }
 8353        
 8355        {
 8357        }
 8358        
 8360        {
 8362        }
 8363        
 8365        {
 8366            int r,g,b,a;
 8372        }
 8373        
 8375        {
 8377        }
 8378    }
 8379    
 8381    {
 8382        if (!super.ReadVarsFromCTX(ctx,version))
 8383            return false;
 8384        
 8385        int intValue;
 8386        float value;
 8387        
 8388        if (version < 140)
 8389        {
 8390            if (!ctx.
Read(intValue))
 
 8391                return false;
 8392            
 8393            m_VariablesMask = intValue;
 8394        }
 8395        
 8397        {
 8398            if (!ctx.
Read(value))
 
 8399                return false;
 8400            
 8402            {
 8404            }
 8405            else
 8406            {
 8408            }
 8409        }
 8410        
 8411        if (version < 140)
 8412        {
 8414            {
 8415                if (!ctx.
Read(value))
 
 8416                    return false;
 8417                SetTemperatureDirect(value);
 8418            }
 8419        }
 8420        
 8422        {
 8423            if (!ctx.
Read(value))
 
 8424                return false;
 8426        }
 8427        
 8429        {
 8430            if (!ctx.
Read(intValue))
 
 8431                return false;
 8433        }
 8434        
 8436        {
 8437            int r,g,b,a;
 8439                return false;
 8441                return false;
 8443                return false;
 8445                return false;
 8446            
 8448        }
 8449        
 8451        {
 8452            if (!ctx.
Read(intValue))
 
 8453                return false;
 8455        }
 8456        
 8457        if (version >= 138 && version < 140)
 8458        {
 8460            {
 8461                if (!ctx.
Read(intValue))
 
 8462                    return false;
 8463                SetFrozen(intValue);
 8464            }
 8465        }
 8466        
 8467        return true;
 8468    }
 8469 
 8470    
 8472    {
 8475        {
 8477        }
 8478        
 8479        if (!super.OnStoreLoad(ctx, version))
 8480        {
 8482            return false;
 8483        }
 8484        
 8485        if (version >= 114)
 8486        {
 8487            bool hasQuickBarIndexSaved;
 8488            
 8489            if (!ctx.
Read(hasQuickBarIndexSaved))
 
 8490            {
 8492                return false;
 8493            }
 8494            
 8495            if (hasQuickBarIndexSaved)
 8496            {
 8497                int itmQBIndex;
 8498                
 8499                
 8500                if (!ctx.
Read(itmQBIndex))
 
 8501                {
 8503                    return false;
 8504                }
 8505                
 8506                PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());                
 8507                if (itmQBIndex != -1 && parentPlayer)
 8508                    parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
 8509            }
 8510        }
 8511        else
 8512        {
 8513            
 8514            PlayerBase player;
 8515            int itemQBIndex;
 8516            if (version == 
int.
MAX)
 
 8517            {
 8518                if (!ctx.
Read(itemQBIndex))
 
 8519                {
 8521                    return false;
 8522                }
 8523            }
 8524            else if (Class.CastTo(player, GetHierarchyRootPlayer()))
 8525            {
 8526                
 8527                if (!ctx.
Read(itemQBIndex))
 
 8528                {
 8530                    return false;
 8531                }
 8532                if (itemQBIndex != -1 && player)
 8533                    player.SetLoadedQuickBarItemBind(this,itemQBIndex);
 8534            }
 8535        }
 8536        
 8537        if (version < 140)
 8538        {
 8539            
 8540            if (!LoadVariables(ctx, version))
 8541            {
 8543                return false;
 8544            }
 8545        }
 8546        
 8547        
 8549        {
 8551            return false;
 8552        }
 8553        if (version >= 132)
 8554        {
 8556            if (raib)
 8557            {
 8559                {
 8561                    return false;
 8562                }
 8563            }
 8564        }
 8565 
 8567        return true;
 8568    }
 8569 
 8570    
 8571 
 8573    {
 8574        super.OnStoreSave(ctx);
 8575        
 8576        PlayerBase player;
 8577        if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
 8578        {
 8580            
 8581            int itemQBIndex = -1;
 8582            itemQBIndex = player.FindQuickBarEntityIndex(this);
 8583            ctx.
Write(itemQBIndex);    
 
 8584        }
 8585        else
 8586        {
 8588        }
 8589        
 8591        
 8593        if (raib)
 8594        {
 8596        }
 8597    }
 8598    
 8599 
 8601    {   
 8602        super.AfterStoreLoad();
 8603        
 8605        {
 8607        }
 8608 
 8610        {
 8613        }
 8614    }
 8615    
 8617    {
 8618        super.EEOnAfterLoad();
 8619        
 8621        {
 8623        }
 8624        
 8627    }
 8628    
 8630    {
 8631        return false;
 8632    }
 8633    
 8634    
 8635    
 8637    {
 8639        {   
 8640            #ifdef PLATFORM_CONSOLE
 8641            
 8643            {
 8645                if (menu)
 8646                {
 8648                }
 8649            }
 8650            #endif
 8651        }
 8652                
 8654        {
 8657        }
 8658        
 8660        {
 8661            SetWeightDirty();
 8663        }
 8665        {
 8668        }
 8669        
 8671        {
 8674        }
 8676        {
 8679        }
 8680            
 8681        super.OnVariablesSynchronized();
 8682    }
 8683 
 8684    
 8685    
 8687    override bool SetQuantity(
float value, 
bool destroy_config = 
true, 
bool destroy_forced = 
false, 
bool allow_client = 
false, 
bool clamp_to_stack_max = 
true)
 
 8688    {
 8689        if (!IsServerCheck(allow_client))
 8690            return false;
 8691        
 8693            return false;
 8694        
 8697        
 8698        if (value <= (min + 0.001))
 8699            value = min;
 8700        
 8701        if (value == min)
 8702        {
 8703            if (destroy_config)
 8704            {
 8705                bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
 8706                if (dstr)
 8707                {
 8709                    this.Delete();
 8710                    return true;
 8711                }
 8712            }
 8713            else if (destroy_forced)
 8714            {
 8716                this.Delete();
 8717                return true;
 8718            }
 8719            
 8721        }
 8722        
 8725        
 8727        {
 8729            
 8730            if (delta)
 8732        }
 8733        
 8735        
 8736        return false;
 8737    }
 8738 
 8739    
 8741    bool AddQuantity(
float value, 
bool destroy_config = 
true, 
bool destroy_forced = 
false)
 
 8742    {   
 8744    }
 8745    
 8747    {
 8750    }
 8751    
 8753    {
 8756    }
 8757    
 8759    override void SetQuantityNormalized(
float value, 
bool destroy_config = 
true, 
bool destroy_forced = 
false)
 
 8760    {
 8761        float value_clamped = Math.Clamp(value, 0, 1);
 8763        SetQuantity(result, destroy_config, destroy_forced);
 
 8764    }
 8765    
 8766    
 8769    {
 8771    }
 8772    
 8774    {
 8776    }
 8777 
 8778    
 8779
 8780
 8781
 8782
 8783
 8784
 8785
 8786    
 8788    {
 8789        int slot = -1;
 8790        if (GetInventory())
 8791        {
 8792            InventoryLocation il = new InventoryLocation;
 8793            GetInventory().GetCurrentInventoryLocation(il);
 8795        }
 8796        
 8798    }
 8799    
 8801    {
 8802        float quantity_max = 0;
 8803        
 8805        {
 8806            if (attSlotID != -1)
 8807                quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
 8808            
 8809            if (quantity_max <= 0)
 8811        }
 8812        
 8813        if (quantity_max <= 0)
 8815 
 8816        return quantity_max;
 8817    }
 8818    
 8820    {
 8822    }
 8823    
 8825    {
 8827    }
 8828    
 8829    
 8831    {
 8833    }
 8834 
 8836    {
 8838    }
 8839    
 8841    {
 8843    }
 8844    
 8845    
 8847    {
 8848        
 8849        float weightEx = GetWeightEx();
 8850        float special = GetInventoryAndCargoWeight();
 8851        return weightEx - special;
 8852    }
 8853 
 8854    
 8856    {
 8858    }
 8859    
 8861    {
 8863        {
 8864            #ifdef DEVELOPER
 8865            if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
 8866            {
 8867                WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
 8869            }
 8870            #endif
 8871            
 8873        }
 8874        else if (HasEnergyManager())
 8875        {
 8876            #ifdef DEVELOPER
 8877            if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
 8878            {
 8879                WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
 8880                data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
 
 8881            }
 8882            #endif
 8883            return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
 8884        }
 8885        else
 8886        {
 8887            #ifdef DEVELOPER
 8888            if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
 8889            {
 8890                WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
 8891                data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + 
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
 
 8892            }
 8893            #endif
 8894            return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
 
 8895        }
 8896    }
 8897
 8900    {
 8901        int item_count = 0;
 8903        
 8904        if (GetInventory().GetCargo() != NULL)
 8905        {
 8906            item_count = GetInventory().GetCargo().GetItemCount();
 8907        }
 8908        
 8909        for (int i = 0; i < GetInventory().AttachmentCount(); i++)
 8910        {
 8911            Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
 8912            if (item)
 8913                item_count += item.GetNumberOfItems();
 8914        }
 8915        return item_count;
 8916    }
 8917    
 8920    {
 8921        float weight = 0;
 8922        float wetness = 1;
 8923        if (include_wetness)
 8926        {
 8927            weight = wetness * m_ConfigWeight;
 8928        }
 8930        {
 8931            weight = 1;
 8932        }
 8933        return weight;
 8934    }
 8935    
 8936    
 8937    
 8939    {
 8940        if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
 
 8941        {
 8942            GameInventory inv = GetInventory();
 8943            array<EntityAI> items = new array<EntityAI>;
 8945            for (int i = 0; i < items.Count(); i++)
 8946            {
 8948                if (item)
 8949                {
 8951                }
 8952            }
 8953        }
 8954    }
 8955    
 8956    
 8957 
 8958    
 8960    {
 8961        float energy = 0;
 8962        if (HasEnergyManager())
 8963        {
 8964            energy = GetCompEM().GetEnergy();
 8965        }
 8966        return energy;
 8967    }
 8968    
 8969    
 8971    {
 8972        super.OnEnergyConsumed();
 8973        
 8975    }
 8976 
 8978    {
 8979        super.OnEnergyAdded();
 8980        
 8982    }
 8983    
 8984    
 8986    {
 8987        if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
 
 8988        {
 8990            {
 8991                float energy_0to1 = GetCompEM().GetEnergy0To1();
 8993            }
 8994        }
 8995    }
 8996 
 8997    
 8999    {
 9000        return ConfigGetFloat("heatIsolation");
 9001    }
 9002 
 9004    {
 9006    }
 9007 
 9009    {
 9010        string paramPath = 
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2", 
GetType(), pIncrementName);
 
 9011        if (
GetGame().ConfigIsExisting(paramPath))
 
 9013        
 9014        return 0.0;
 9015    }
 9016    
 9018    {
 9019        string paramPath = 
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2", 
GetType(), pIncrementName);
 
 9020        if (
GetGame().ConfigIsExisting(paramPath))
 
 9022        
 9023        return 0.0;
 9024    }
 9025    
 9026    override void SetWet(
float value, 
bool allow_client = 
false)
 
 9027    {
 9028        if (!IsServerCheck(allow_client))
 9029            return;
 9030        
 9033        
 9035        
 9036        m_VarWet = Math.Clamp(value, min, max);
 
 9037        
 9039        {
 9042        }
 9043    }
 9044    
 9045    override void AddWet(
float value)
 
 9046    {
 9048    }
 9049    
 9051    {
 9053    }
 9054    
 9056    {
 9058    }
 9059    
 9061    {
 9063    }
 9064    
 9066    {
 9068    }
 9069    
 9071    {
 9073    }
 9074    
 9076    {
 9079        if (newLevel != oldLevel)
 9080        {
 9082        }
 9083    }
 9084    
 9086    {
 9087        SetWeightDirty();
 9088    }
 9089    
 9091    {
 9092        return GetWetLevelInternal(
m_VarWet);
 
 9093    }
 9094 
 9095    
 9096    
 9098    {
 9100    }
 9101    
 9103    {
 9105    }
 9106    
 9108    {
 9110    }
 9111    
 9113    {
 9115    }
 9116    
 9117    
 9118    
 9120    {
 9121        if (ConfigIsExisting("itemModelLength"))
 9122        {
 9123            return ConfigGetFloat("itemModelLength");
 9124        }
 9125        return 0;
 9126    }
 9127    
 9129    {
 9130        if (ConfigIsExisting("itemAttachOffset"))
 9131        {
 9132            return ConfigGetFloat("itemAttachOffset");
 9133        }
 9134        return 0;
 9135    }
 9136    
 9137    override void SetCleanness(
int value, 
bool allow_client = 
false)
 
 9138    {
 9139        if (!IsServerCheck(allow_client)) 
 9140            return;
 9141        
 9143        
 9145        
 9148    }
 9149    
 9151    {
 9153    }
 9154    
 9156    {
 9157        return true;
 9158    }
 9159    
 9160    
 9161    
 9162    
 9164    {
 9166    }
 9167    
 9169    {
 9171    }
 9172 
 9173    
 9174    
 9175    
 9176    override void SetColor(
int r, 
int g, 
int b, 
int a)
 
 9177    {
 9183    }
 9185    override void GetColor(out 
int r,out 
int g,out 
int b,out 
int a)
 
 9186    {
 9191    }
 9192    
 9194    {
 9196    }
 9197    
 9200    {
 9201        int r,g,b,a;
 9203        r = r/255;
 9204        g = g/255;
 9205        b = b/255;
 9206        a = a/255;
 9207        return MiscGameplayFunctions.GetColorString(r, g, b, a);
 9208    }
 9209    
 9210    
 9211 
 9212    override void SetLiquidType(
int value, 
bool allow_client = 
false)
 
 9213    {
 9214        if (!IsServerCheck(allow_client))
 9215            return;
 9216        
 9221    }
 9222    
 9224    {
 9225        return ConfigGetInt("varLiquidTypeInit");
 9226    }
 9227    
 9229    {
 9231    }
 9232    
 9234    {
 9236            SetFrozen(false);
 9237    }
 9238
 9241    {
 9242        player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
 9243    }
 9244    
 9245    
 9248    {
 9249        PlayerBase nplayer;
 9250        if (PlayerBase.CastTo(nplayer, player))
 9251        {
 9253            
 9254            nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible()); 
 9255        }
 9256    }
 9257    
 9258    
 9261    {
 9262        PlayerBase nplayer;
 9263        if (PlayerBase.CastTo(nplayer,player))
 9264        {       
 9265            
 9266            nplayer.SetEnableQuickBarEntityShortcut(this,false);
 9267 
 9268        }
 9269        
 9270        
 9271        player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
 9272        
 9273        
 9274        if (HasEnergyManager())
 9275        {
 9276            GetCompEM().UpdatePlugState(); 
 9277        }
 9278    }
 9279 
 9280    
 9282    {
 9283        super.OnPlacementStarted(player);
 9284        
 9286    }
 9287    
 9288    override void OnPlacementComplete(Man player, vector position = 
"0 0 0", vector orientation = 
"0 0 0")
 
 9289    {
 9291        {
 9292            m_AdminLog.OnPlacementComplete(player, 
this);
 
 9293        }
 9294        
 9295        super.OnPlacementComplete(player, position, orientation);
 9296    }
 9297        
 9298    
 9299    
 9300    
 9301    
 9303    {
 9305        {
 9306            return true;
 9307        }
 9308        else
 9309        {
 9310            return false;
 9311        }
 9312    }
 9313 
 9314    
 9316    {
 9318        {
 9320        }
 9321    }
 9322 
 9323    
 9325    {
 9327    }
 9328    
 9330    {
 9332    }
 9333    
 9334    override void InsertAgent(
int agent, 
float count = 1)
 
 9335    {
 9336        if (count < 1)
 9337            return;
 9338        
 9340    }
 9341    
 9344    {
 9346    }
 9347    
 9348    
 9350    {
 9352    }
 9353    
 9354    
 9355    
 9356
 9357
 9358
 9359
 9360
 9361
 9362
 9363
 9364
 9365
 9366
 9367
 9368
 9369
 9370
 9371
 9372
 9373
 9374
 9375
 9376
 9377
 9378
 9379
 9380
 9381
 9382
 9383
 9384
 9385
 9386
 9387
 9388
 9389
 9390
 9391
 9392
 9393    
 9394    
 9396    {
 9398            return false;
 9399        return true;
 9400    }
 9401    
 9403    {
 9404        
 9406    }
 9407    
 9408    
 9411    {
 9412        super.CheckForRoofLimited(timeTresholdMS);
 9413        
 9415        if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
 9416        {
 9417            m_PreviousRoofTestTime = time;
 9418            SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
 9419        }
 9420    }
 9421    
 9422    
 9424    {
 9426        {
 9427            return 0;
 9428        }
 9429        
 9430        if (GetInventory().GetAttachmentSlotsCount() != 0)
 9431        {
 9432            ItemBase filter = 
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
 
 9433            if (filter)
 9434                return filter.GetProtectionLevel(type, false, system);
 9435            else
 9436                return 0;
 9437        }
 9438 
 9439        string subclassPath, entryName;
 9440 
 9441        switch (type)
 9442        {
 9444                entryName = "biological";
 9445                break;
 9447                entryName = "chemical";
 9448                break;  
 9449            default:
 9450                entryName = "biological";
 9451                break;
 9452        }
 9453        
 9454        subclassPath = 
"CfgVehicles " + this.
GetType() + 
" Protection ";
 
 9455        
 9457    }
 9458    
 9459    
 9460    
 9463    {
 9464        if (!IsMagazine())
 9466 
 9468    }
 9469    
 9470    
 9471    
 9472    
 9473    
 9478    {
 9479        return true;
 9480    }
 9481 
 9483    {
 9485    }
 9486    
 9487    
 9488    
 9489    
 9490    
 9492    {
 9493        if (parent)
 9494        {
 9495            if (parent.IsInherited(DayZInfected))
 9496                return true;
 9497 
 9498            if (!parent.IsRuined())
 9499                return true;
 9500        }
 9501        
 9502        return true;
 9503    }   
 9504    
 9506    {
 9507        if (!super.CanPutAsAttachment(parent))
 9508        {
 9509            return false;
 9510        }
 9511        
 9512        if (!IsRuined() && !parent.IsRuined())
 9513        {
 9514            return true;
 9515        }
 9516 
 9517        return false;
 9518    }
 9519 
 9521    {
 9522        
 9523        
 9524        
 9525        
 9526        return super.CanReceiveItemIntoCargo(item);
 9527    }
 9528 
 9530    {
 9531        
 9532        
 9533        
 9534        
 9535        GameInventory attachmentInv = attachment.GetInventory();
 9537        {
 9538            if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
 9539                return false;
 9540        }
 9541        
 9542        InventoryLocation loc = new InventoryLocation();
 9543        attachment.GetInventory().GetCurrentInventoryLocation(loc);
 9544        if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
 
 9545            return false;
 9546        
 9547        return super.CanReceiveAttachment(attachment, slotId);
 9548    }
 9549    
 9551    {
 9552        if (!super.CanReleaseAttachment(attachment))
 9553            return false;
 9554        
 9555        return GetInventory().AreChildrenAccessible();
 9556    }
 9557    
 9558    
 9559
 9560
 9561
 9562
 9563
 9564
 9565
 9566
 9567
 9568
 9569
 9570
 9571
 9572
 9573
 9574
 9575
 9576    
 9577    
 9579    {
 9580        int id = muzzle_owner.GetMuzzleID();
 9581        array<ref WeaponParticlesOnFire> WPOF_array = 
m_OnFireEffect.Get(
id);
 
 9582        
 9583        if (WPOF_array)
 9584        {
 9585            for (int i = 0; i < WPOF_array.Count(); i++)
 9586            {
 9587                WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
 9588                
 9589                if (WPOF)
 9590                {
 9591                    WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
 9592                }
 9593            }
 9594        }
 9595    }
 9596    
 9597    
 9599    {
 9600        int id = muzzle_owner.GetMuzzleID();
 9602        
 9603        if (WPOBE_array)
 9604        {
 9605            for (int i = 0; i < WPOBE_array.Count(); i++)
 9606            {
 9607                WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
 9608                
 9609                if (WPOBE)
 9610                {
 9611                    WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
 9612                }
 9613            }
 9614        }
 9615    }
 9616    
 9617    
 9619    {
 9620        int id = muzzle_owner.GetMuzzleID();
 9621        array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
 9622        
 9623        if (WPOOH_array)
 9624        {
 9625            for (int i = 0; i < WPOOH_array.Count(); i++)
 9626            {
 9627                WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
 9628                
 9629                if (WPOOH)
 9630                {
 9631                    WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
 9632                }
 9633            }
 9634        }
 9635    }
 9636    
 9637    
 9639    {
 9640        int id = muzzle_owner.GetMuzzleID();
 9641        array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
 9642        
 9643        if (WPOOH_array)
 9644        {
 9645            for (int i = 0; i < WPOOH_array.Count(); i++)
 9646            {
 9647                WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
 9648                
 9649                if (WPOOH)
 9650                {
 9651                    WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
 9652                }
 9653            }
 9654        }
 9655    }
 9656    
 9657    
 9659    {
 9660        int id = muzzle_owner.GetMuzzleID();
 9661        array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
 9662        
 9663        if (WPOOH_array)
 9664        {
 9665            for (int i = 0; i < WPOOH_array.Count(); i++)
 9666            {
 9667                WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
 9668                
 9669                if (WPOOH)
 9670                {
 9671                    WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
 9672                }
 9673            }
 9674        }
 9675    }
 9676    
 9677    
 9678    
 9680    {
 9682        {   
 9683            return true;
 9684        }
 9685        
 9686        return false;
 9687    }
 9688    
 9690    {
 9692        {
 9693            return true;    
 9694        }
 9695        
 9696        return false;
 9697    }
 9698    
 9700    {
 9702        {
 9703            return true;
 9704        }
 9705            
 9706        return false;
 9707    }
 9708    
 9710    {
 9711        return false;
 9712    }
 9713    
 9716    {
 9717        return UATimeSpent.DEFAULT_DEPLOY;
 9718    }
 9719    
 9720 
 9721    
 9722    
 9724    {
 9726        SetSynchDirty();
 9727    }
 9728 
 9730    {
 9732    }
 9733    
 9734    
 9736    {
 9737        return false;
 9738    }
 9739
 9742    {
 9743        string att_type = "None";
 9744 
 9745        if (ConfigIsExisting("soundAttType"))
 9746        {
 9747            att_type = ConfigGetString("soundAttType");
 9748        }
 9749        
 9751    }
 9752    
 9754    {   
 9756    }
 9757    
 9758    
 9759    
 9760    
 9761    
 9767            
 9769    {
 9772        
 9774    }
 9775    
 9776    
 9778    {
 9780            return;
 9781 
 9783 
 9786        
 9789        
 9790        SoundParameters params = new SoundParameters();
 9794    }
 9795    
 9796    
 9798    {
 9800            return;
 9801        
 9803        SetSynchDirty();
 9804        
 9807    }
 9808    
 9809    
 9811    {
 9813            return;
 9814        
 9816        SetSynchDirty();
 9817        
 9820    }
 9821    
 9823    {
 9825    }
 9826    
 9828    {
 9830    }
 9831                
 9834    {
 9835        if (!
GetGame().IsDedicatedServer())
 
 9836        {
 9837            if (ConfigIsExisting("attachSoundSet"))
 9838            {
 9839                string cfg_path = "";
 9840                string soundset = "";
 9842                
 9845                ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
 9846                ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
 9847                
 9848                if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
 9849                {
 9850                    for (int i = 0; i < cfg_soundset_array.Count(); i++)
 9851                    {
 9852                        if (cfg_slot_array[i] == slot_type)
 9853                        {
 9854                            soundset = cfg_soundset_array[i];
 9855                            break;
 9856                        }
 9857                    }
 9858                }
 9859                
 9860                if (soundset != "")
 9861                {
 9862                    EffectSound sound = SEffectManager.PlaySound(soundset, 
GetPosition());
 
 9864                }
 9865            }
 9866        }
 9867    }
 9868    
 9870    {
 9871        
 9872    }
 9873    
 9874    void OnApply(PlayerBase player);
 
 9875    
 9877    {
 9878        return 1.0;
 9879    };
 9880    
 9882    {
 9884    }
 9885    
 9887    {
 9889    }
 9890    
 9892    
 9894    {
 9895        SetDynamicPhysicsLifeTime(0.01);
 9897    }
 9898    
 9900    {
 9901        array<string> zone_names = new array<string>;
 9902        GetDamageZones(zone_names);
 9903        for (int i = 0; i < zone_names.Count(); i++)
 9904        {
 9905            SetHealthMax(zone_names.Get(i),"Health");
 9906        }
 9907        SetHealthMax("","Health");
 9908    }
 9909    
 9912    {
 9913        float global_health = GetHealth01("","Health");
 9914        array<string> zones = new array<string>;
 9915        GetDamageZones(zones);
 9916        
 9917        for (int i = 0; i < zones.Count(); i++)
 9918        {
 9919            SetHealth01(zones.Get(i),"Health",global_health);
 9920        }
 9921    }
 9922    
 9925    {
 9926        return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
 9927    }
 9928    
 9930    {
 9931        if (!hasRootAsPlayer)
 9932        {
 9933            if (refParentIB)
 9934            {
 9935                
 9936                if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet < 
m_VarWetMax))
 
 9937                    AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
 
 9938                
 9939                else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet < 
m_VarWetMax))
 
 9940                    AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
 
 9941                
 9944            }
 9945            else
 9946            {
 9947                
 9950            }
 9951        }
 9952    }
 9953    
 9955    {
 9957        {
 9958            float target = 
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
 
 9959            if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
 
 9960            {
 9961                float heatPermCoef = 1.0;
 9963                while (ent)
 9964                {
 9965                    heatPermCoef *= ent.GetHeatPermeabilityCoef();
 9966                    ent = ent.GetHierarchyParent();
 9967                }
 9968                
 9969                SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
 
 9970            }
 9971        }
 9972    }
 9973    
 9975    {
 9976        
 9977        EntityAI parent = GetHierarchyParent();
 
 9978        if (!parent)
 9979        {
 9980            hasParent = false;
 9981            hasRootAsPlayer = false;
 9982        }
 9983        else
 9984        {
 9985            hasParent = true;
 9986            hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
 9987            refParentIB = 
ItemBase.Cast(parent);
 
 9988        }
 9989    }
 9990    
 9991    protected void ProcessDecay(
float delta, 
bool hasRootAsPlayer)
 
 9992    {
 9993        
 9994    }
 9995    
 9997    {
 9998        
 9999        return false;
10000    }
10001    
10003    {
10004        
10005        
10006        return false;
10007    }
10008    
10010    {
10011        
10012        return false;
10013    }
10014    
10017    {
10018        return !GetIsFrozen() && 
IsOpen();
 
10019    }
10020    
10022    {
10023        bool hasParent = false, hasRootAsPlayer = false;
10025        
10026        bool wwtu = 
g_Game.IsWorldWetTempUpdateEnabled();
 
10027        bool foodDecay = 
g_Game.IsFoodDecayEnabled();
 
10028        
10029        if (wwtu || foodDecay)
10030        {
10034            
10035            if (processWetness || processTemperature || processDecay)
10036            {
10038            
10039                if (processWetness)
10040                    ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);                    
 
10041                
10042                if (processTemperature)
10044            
10045                if (processDecay)
10046                    ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
 
10047            }
10048        }
10049    }
10050    
10053    {
10055    }
10056    
10058    {
10061        
10062        return super.GetTemperatureFreezeThreshold();
10063    }
10064    
10066    {
10069        
10070        return super.GetTemperatureThawThreshold();
10071    }
10072    
10074    {
10077        
10078        return super.GetItemOverheatThreshold();
10079    }
10080    
10082    {
10084            return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
 
10085        
10086        return super.GetTemperatureFreezeTime();
10087    }
10088    
10090    {
10092            return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
 
10093        
10094        return super.GetTemperatureThawTime();
10095    }
10096    
10101    
10103    {
10104        return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
10105    }
10106    
10108    {
10109        MiscGameplayFunctions.TransferItemProperties(oldItem, this);
10110    }
10111    
10114    {
10116    }
10117    
10119    {
10121    }
10122    
10124    {
10126    }
10127    
10130    {
10131        return null;
10132    }
10133    
10136    {
10137        return false;
10138    }
10139    
10141    {
10143        {
10146            if (!trg)
10147            {
10149                explosive = this;
10150            }
10151            
10152            explosive.PairRemote(trg);
10154            
10155            int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
10156            trg.SetPersistentPairID(persistentID);
10157            explosive.SetPersistentPairID(persistentID);
10158            
10159            return true;
10160        }
10161        return false;
10162    }
10163    
10166    {
10167        float ret = 1.0;
10170        ret *= GetHealth01();
10171        
10172        return ret;
10173    }
10174 
10175    #ifdef DEVELOPER
10176    override void SetDebugItem()
10177    {
10178        super.SetDebugItem();
10179        _itemBase = this;
10180    }
10181    
10183    {
10184        string text = super.GetDebugText();
10185        
10187        text += 
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
 
10188 
10189        return text;
10190    }
10191    #endif
10192    
10194    {
10195        return true;
10196    }
10197    
10199    
10201    
10203    {
10206    }
10207    
10208    
10216    
10232}
10233 
10235{
10237    if (entity)
10238    {
10239        bool is_item = entity.IsInherited(
ItemBase);
 
10240        if (is_item && full_quantity)
10241        {
10244        }
10245    }
10246    else
10247    {
10249        return NULL;
10250    }
10251    return entity;
10252}
10253 
10255{
10256    if (item)
10257    {
10258        if (health > 0)
10259            item.SetHealth("", "", health);
10260        
10261        if (item.CanHaveTemperature())
10262        {
10264            if (item.CanFreeze())
10265                item.SetFrozen(false);
10266        }
10267        
10268        if (item.HasEnergyManager())
10269        {
10270            if (quantity >= 0)
10271            {       
10272                item.GetCompEM().SetEnergy0To1(quantity);
10273            }
10274            else
10275            {
10277            }
10278        }
10279        else if (item.IsMagazine())
10280        {
10281            Magazine mag = Magazine.Cast(item);
10282            if (quantity >= 0)
10283            {       
10284                mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
10285            }
10286            else
10287            {       
10289            }
10290            
10291        }
10292        else
10293        {
10294            if (quantity >= 0)
10295            {       
10296                item.SetQuantityNormalized(quantity, false);
10297            }
10298            else
10299            {
10301            }
10302            
10303        }
10304    }
10305}
10306 
10307#ifdef DEVELOPER
10309#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
 
Param3 TSelectableActionInfo
 
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
 
eBleedingSourceType GetType()
 
ItemSuppressor SuppressorBase
 
void ActionManagerBase(PlayerBase player)
 
map< typename, ref array< ActionBase_Basic > > TInputActionMap
 
void AddAction(typename actionName)
 
void RemoveAction(typename actionName)
 
TInputActionMap m_InputActionMap
 
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
 
const int ECE_PLACE_ON_SURFACE
 
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
 
const int ECE_IN_INVENTORY
 
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
 
PlayerSpawnPreset slotName
 
Open
Implementations only.
 
override void EEOnCECreate()
 
DamageType
exposed from C++ (do not change)
 
PluginAdminLog m_AdminLog
 
override bool IsExplosive()
 
override bool CanHaveTemperature()
 
class GP5GasMask extends MaskBase ItemBase
 
FindInventoryLocationType
flags for searching locations in inventory
 
InventoryLocationType
types of Inventory Location
 
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
 
bool DamageItemInCargo(float damage)
 
static bool HasDebugActionsMask(int mask)
 
bool HidesSelectionBySlot()
 
void SplitItem(PlayerBase player)
 
void CopyScriptPropertiesFrom(EntityAI oldItem)
 
override void InsertAgent(int agent, float count=1)
 
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
 
static void SetDebugActionsMask(int mask)
 
void SetIsDeploySound(bool is_deploy_sound)
 
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
 
override bool IsHeavyBehaviour()
 
override void SetWetMax()
 
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
 
void ClearStartItemSoundServer()
 
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
 
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
 
override void RemoveAllAgentsExcept(int agent_to_keep)
 
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
 
bool CanBeMovedOverride()
 
override void SetWet(float value, bool allow_client=false)
 
ref TIntArray m_SingleUseActions
 
override void ProcessVariables()
 
ref TStringArray m_HeadHidingSelections
 
float GetWeightSpecialized(bool forceRecalc=false)
 
bool LoadAgents(ParamsReadContext ctx, int version)
 
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
 
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
 
ref array< ref OverheatingParticle > m_OverheatingParticles
 
override float GetTemperatureFreezeThreshold()
 
bool m_IsSoundSynchRemote
 
void StopItemSoundServer(int id)
 
static void ToggleDebugActionsMask(int mask)
 
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
 
override float GetTemperatureFreezeTime()
 
ref array< int > m_CompatibleLocks
 
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
 
float m_TemperaturePerQuantityWeight
 
bool m_RecipesInitialized
 
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
 
override float GetTemperatureThawThreshold()
 
override void OnEnergyConsumed()
 
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
 
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
 
override EWetnessLevel GetWetLevel()
 
float GetSingleInventoryItemWeight()
 
ref TIntArray m_InteractActions
 
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
 
bool CanPlayDeployLoopSound()
 
override float GetWetMax()
 
bool CanBeUsedForSuicide()
 
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
 
void OnItemInHandsPlayerSwimStart(PlayerBase player)
 
void SetIsHologram(bool is_hologram)
 
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
 
void StartItemSoundServer(int id)
 
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
 
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
 
bool m_CanBeMovedOverride
 
override string ChangeIntoOnAttach(string slot)
 
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
 
ScriptedLightBase GetLight()
 
string GetPlaceSoundset()
 
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
 
override float GetQuantity()
 
int m_ShotsToStartOverheating
 
override void OnWetChanged(float newVal, float oldVal)
 
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
 
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
 
void OnOverheatingDecay()
 
float GetDryingIncrement(string pIncrementName)
 
void SoundSynchRemoteReset()
 
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
 
override bool CanReleaseAttachment(EntityAI attachment)
 
override void OnMovedInsideCargo(EntityAI container)
 
void SetCEBasedQuantity()
 
bool m_CanPlayImpactSound
 
override string GetAttachmentSoundType()
 
float GetOverheatingCoef()
 
array< string > GetHeadHidingSelection()
 
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
 
override bool IsStoreLoad()
 
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
 
void SetResultOfSplit(bool value)
 
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
 
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
 
void UpdateAllOverheatingParticles()
 
float GetSoakingIncrement(string pIncrementName)
 
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
 
override float GetStoreLoadedQuantity()
 
const int ITEM_SOUNDS_MAX
 
float GetItemModelLength()
 
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
 
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
 
void CombineItems(ItemBase other_item, bool use_stack_max=true)
 
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
 
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
 
void TransferAgents(int agents)
transfer agents from another item
 
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
 
float GetHeatIsolationInit()
 
void SetCanBeMovedOverride(bool setting)
 
override bool HasQuantity()
 
bool IsCargoException4x3(EntityAI item)
 
ref TIntArray m_ContinuousActions
 
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
 
void LoadParticleConfigOnFire(int id)
 
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
 
override float GetWetInit()
 
int m_ImpactSoundSurfaceHash
 
int m_MaxOverheatingValue
 
void SetupSpawnedItem(ItemBase item, float health, float quantity)
 
bool ShouldSplitQuantity(float quantity)
 
static ref map< string, int > m_WeaponTypeToID
 
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
 
array< int > GetValidFinishers()
returns an array of possible finishers
 
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
 
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
 
ItemSoundHandler GetItemSoundHandler()
 
override int GetQuantityMin()
 
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
 
override int GetQuickBarBonus()
 
override void SetTakeable(bool pState)
 
float m_OverheatingDecayInterval
 
void SetIsPlaceSound(bool is_place_sound)
 
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
 
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
 
void RemoveAudioVisualsOnClient()
 
static void AddDebugActionsMask(int mask)
 
void PlayDeployLoopSoundEx()
 
void RemoveLightSourceItem()
 
bool CanRepair(ItemBase item_repair_kit)
 
bool can_this_be_combined
 
EffectSound m_SoundDeploy
 
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
 
float GetDeployTime()
how long it takes to deploy this item in seconds
 
override bool IsSplitable()
 
bool DamageItemAttachments(float damage)
 
override void WriteVarsToCTX(ParamsWriteContext ctx)
 
void ConvertEnergyToQuantity()
 
override void RemoveAllAgents()
 
override void SetQuantityToMinimum()
 
bool m_WantPlayImpactSound
 
override float GetTemperatureThawTime()
 
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
 
float m_StoreLoadedQuantity
 
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
 
float GetFilterDamageRatio()
 
override void SetLiquidType(int value, bool allow_client=false)
 
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
 
void OnApply(PlayerBase player)
 
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
 
bool m_HideSelectionsBySlot
 
bool IsOverheatingEffectActive()
 
void SetIsBeingPlaced(bool is_being_placed)
 
int GetLiquidContainerMask()
 
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
 
ref Timer m_CheckOverheating
 
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
 
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
 
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
 
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
 
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
 
override bool IsOneHandedBehaviour()
 
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
 
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
 
override float GetSingleInventoryItemWeightEx()
 
void SaveAgents(ParamsWriteContext ctx)
 
override int GetTargetQuantityMax(int attSlotID=-1)
 
float GetDisinfectQuantity(int system=0, Param param1=null)
 
override bool IsHologram()
 
float GetItemAttachOffset()
 
static int GetDebugActionsMask()
 
void ProcessDecay(float delta, bool hasRootAsPlayer)
 
override bool IsItemBase()
 
override bool IsTwoHandedBehaviour()
 
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
 
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
 
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
 
override void OnEnergyAdded()
 
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
 
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
 
string GetExplosiveTriggerSlotName()
 
EffectSound m_DeployLoopSoundEx
 
override void DeSerializeNumericalVars(array< float > floats)
 
void StopItemDynamicPhysics()
 
override void SetStoreLoad(bool value)
 
float GetOverheatingValue()
 
bool ContainsAgent(int agent_id)
 
override void AddWet(float value)
 
override void EOnContact(IEntity other, Contact extra)
 
void SplitIntoStackMaxHands(PlayerBase player)
 
void SplitIntoStackMaxHandsClient(PlayerBase player)
 
ref Timer m_PhysDropTimer
 
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
 
override void SetStoreLoadedQuantity(float value)
 
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
 
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
 
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
 
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
 
void OnLiquidTypeChanged(int oldType, int newType)
 
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
 
void PlayDeployFinishSound()
 
bool AllowFoodConsumption()
 
bool m_IsOverheatingEffectActive
 
int m_LiquidContainerMask
 
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
 
override int GetCleanness()
 
bool PairWithDevice(notnull ItemBase otherDevice)
 
static void RemoveDebugActionsMask(int mask)
 
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
 
void PerformDamageSystemReinit()
 
override void ClearInventory()
 
static int m_LastRegisteredWeaponID
 
ItemBase GetLightSourceItem()
 
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
 
override float GetItemOverheatThreshold()
 
void StopDeployLoopSoundEx()
 
override void SerializeNumericalVars(array< float > floats_out)
 
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
 
static int m_DebugActionsMask
 
void KillAllOverheatingParticles()
 
bool CanBeCookedOnStick()
 
override int GetQuantityMax()
 
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
 
void OnActivatedByTripWire()
 
override void RemoveAgent(int agent_id)
 
bool m_ItemBeingDroppedPhys
 
override bool CanPutAsAttachment(EntityAI parent)
 
void PlayDetachSound(string slot_type)
 
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
 
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
 
override bool IsBeingPlaced()
 
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
 
bool m_FixDamageSystemInit
 
string GetDeployFinishSoundset()
 
ItemBase m_LightSourceItem
 
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
 
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
 
void LoadParticleConfigOnOverheating(int id)
 
bool IsSoundSynchRemote()
 
override void OnRightClick()
 
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
 
bool IsActionTargetVisible()
 
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
 
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
 
int NameToID(string name)
 
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
 
void ClearStopItemSoundServer()
 
override string ChangeIntoOnDetach()
 
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
 
EffectSound m_SoundDeployFinish
 
float GetQuantityNormalizedScripted()
 
override void SetCleanness(int value, bool allow_client=false)
 
override float GetWetMin()
 
ref ItemSoundHandler m_ItemSoundHandler
 
override bool KindOf(string tag)
 
void ItemSoundHandler(ItemBase parent)
 
EffectSound m_LockingSound
 
void PluginItemDiagnostic()
 
PluginBase GetPlugin(typename plugin_type)
 
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
 
void RemoteDetonatorTrigger()
 
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
 
override void Explode(int damageType, string ammoType="")
 
void OnItemLocationChanged(ItemBase item)
 
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
 
proto native UIManager GetUIManager()
 
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
 
proto native float ConfigGetFloat(string path)
Get float value from config on path.
 
override ScriptCallQueue GetCallQueue(int call_category)
 
proto native void GizmoSelectObject(Object object)
 
proto native bool ConfigIsExisting(string path)
 
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
 
proto native DayZPlayer GetPlayer()
 
proto native void GizmoSelectPhysics(Physics physics)
 
proto int GetTime()
returns mission time in milliseconds
 
proto native int ConfigGetType(string path)
Returns type of config value.
 
AnalyticsManagerClient GetAnalyticsClient()
 
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
 
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
 
proto native void ObjectDelete(Object obj)
 
proto native int GetItemCount()
 
proto native EntityAI GetItem(int index)
 
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
 
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
 
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
 
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
 
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
 
proto native CargoBase GetCargo()
cargo
 
proto native bool IsValid()
verify current set inventory location
 
proto native EntityAI GetParent()
returns parent of current inventory location
 
proto native int GetSlot()
returns slot id if current type is Attachment
 
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
 
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
 
bool WriteToContext(ParamsWriteContext ctx)
 
proto native int GetType()
returns type of InventoryLocation
 
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
 
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
 
proto native bool GetFlip()
returns flip status of cargo
 
proto native EntityAI GetItem()
returns item of current inventory location
 
override bool CanDisplayCargo()
 
override void OnInventoryEnter(Man player)
 
override string GetFoldSoundset()
 
override bool CanPutAsAttachment(EntityAI parent)
 
override bool CanReceiveItemIntoCargo(EntityAI item)
 
override bool OnStoreLoad(ParamsReadContext ctx, int version)
 
override void OnWasDetached(EntityAI parent, int slot_id)
 
override void EEOnAfterLoad()
 
override void EEDelete(EntityAI parent)
 
override bool CanBeRepairedByCrafting()
 
override void OnPlacementStarted(Man player)
 
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
 
override bool IsElectricAppliance()
 
override bool IsItemTent()
 
override void SetActions()
 
override string GetLoopFoldSoundset()
 
override bool CanMakeGardenplot()
 
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
 
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
 
override WrittenNoteData GetWrittenNoteData()
 
override int GetDamageSystemVersionChange()
 
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
 
override void InitItemVariables()
 
override void SetActionAnimOverrides()
 
override void OnCreatePhysics()
 
override string GetDeploySoundset()
 
override float GetBandagingEffectivity()
 
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
 
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
 
override void OnStoreSave(ParamsWriteContext ctx)
 
override void AfterStoreLoad()
 
override int GetOnDigWormsAmount()
 
override bool IsSelfAdjustingTemperature()
 
override bool IsPlayerInside(PlayerBase player, string selection)
 
override void OnVariablesSynchronized()
 
override void RefreshPhysics()
 
override bool CanObstruct()
 
override void OnWasAttached(EntityAI parent, int slot_id)
 
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
 
override bool CanPutInCargo(EntityAI parent)
 
override string GetLoopDeploySoundset()
 
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
 
override void OnInventoryExit(Man player)
 
override bool IsTakeable()
 
override bool IsIgnoredByConstruction()
 
override void InitItemSounds()
 
override void EEKilled(Object killer)
 
override void OnCombine(ItemBase other_item)
 
override bool CanExplodeInFire()
 
override bool IsFacingPlayer(PlayerBase player, string selection)
 
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
 
override bool IsBloodContainer()
 
override bool IsClothing()
 
override bool CanBeSplit()
 
override bool IsDeployable()
 
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
 
override bool CanBeDisinfected()
 
override float GetInfectionChance(int system=0, Param param=null)
 
override void OnEndPlacement()
 
float GetOverheatingLimitMax()
 
void SetOverheatingLimitMax(float max)
 
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
 
float GetOverheatingLimitMin()
 
void SetOverheatingLimitMin(float min)
 
void RegisterParticle(Particle p)
 
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
 
void SetControlledDevice(EntityAI pDevice)
 
bool OnStoreLoad(ParamsReadContext ctx, int version)
 
void OnStoreSave(ParamsWriteContext ctx)
 
proto void Remove(func fn)
remove specific call from queue
 
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
 
proto bool Write(void value_out)
 
proto bool Read(void value_in)
 
proto native float GetDamage(string zoneName, string healthType)
 
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
 
void SetCalcDetails(string details)
 
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
 
Serializer ParamsReadContext
 
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
 
proto native CGame GetGame()
 
Serializer ParamsWriteContext
 
const int COMP_TYPE_ENERGY_MANAGER
 
void Error(string err)
Messagebox with error message.
 
proto native void SetColor(int color)
 
array< string > TStringArray
 
EntityEvent
Entity events for event-mask, or throwing event from code.
 
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
 
const int VARIABLE_LIQUIDTYPE
 
const int VARIABLE_CLEANNESS
 
const int VARIABLE_TEMPERATURE
 
const int VARIABLE_QUANTITY
 
static proto float AbsFloat(float f)
Returns absolute value.
 
proto native bool dBodyIsDynamic(notnull IEntity ent)
 
const int SAT_DEBUG_ACTION
 
class JsonUndergroundAreaTriggerData GetPosition
 
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.