7714{
 7716    {
 7717        return true;
 7718    }
 7719};
 7720 
 7721
 7722 
 7724{   
 7728    
 7730    
 7733    
 7734    
 7735    
 7736    
 7737    
 7746    
 7752    
 7757    
 7762    
 7783    protected bool m_IsResultOfSplit 
 7784    
 7786    
 7791    
 7792    
 7793    
 7795    
 7799    
 7800    
 7801    
 7803
 7806    
 7807    
 7808    
 7814    
 7815    
 7823    
 7826    
 7827    
 7829    
 7830    
 7832 
 7833    
 7838    
 7839    
 7844    
 7845    
 7847    
 7848    
 7850    {
 7855        
 7856        if (!
GetGame().IsDedicatedServer())
 
 7857        {
 7859            {
 7861                
 7863                {
 7865                }
 7866            }
 7867            
 7870        }
 7871        
 7872        m_OldLocation = null;
 7873        
 7875        {
 7877        }
 7878        
 7879        if (ConfigIsExisting("headSelectionsToHide"))
 7880        {
 7883        }
 7884        
 7886        if (ConfigIsExisting("hideSelectionsByinventorySlot"))
 7887        {
 7889        }
 7890        
 7892 
 7893        m_IsResultOfSplit = false;
 7894        
 7896    }
 7897    
 7899    {
 7900        super.InitItemVariables();
 7901        
 7907        m_Count = ConfigGetInt(
"count");
 
 7908        
 7911        
 7916        
 7919        
 7924        
 7936        
 7940        
 7941        
 7944        if (ConfigIsExisting("canBeSplit"))
 7945        {
 7948        }
 7949        
 7951        if (ConfigIsExisting("itemBehaviour"))
 7953        
 7954        
 7957        RegisterNetSyncVariableInt("m_VarLiquidType");
 7958        RegisterNetSyncVariableInt("m_Cleanness",0,1);
 7959        
 7960        RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
 7961        RegisterNetSyncVariableFloat("m_ImpactSpeed");
 7962        RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
 7963        
 7964        RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
 7965        RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
 7966        RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
 7967        RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
 7968        
 7969        RegisterNetSyncVariableBool("m_IsBeingPlaced");
 7970        RegisterNetSyncVariableBool("m_IsTakeable");
 7971        RegisterNetSyncVariableBool("m_IsHologram");
 7972        
 7975        {
 7978        }
 7979        
 7981        
 7983        if (ConfigIsExisting("temperaturePerQuantityWeight"))
 7985            
 7986    }
 7987    
 7989    {
 7991    }
 7992 
 7994    {
 7997        {
 8002        }
 8003    }
 8004    
 8005    override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
 
 8006    {
 8008        {
 8011        }
 8012        
 8014    }
 8015    
 8017    {
 8023    }
 8024    
 8026    
 8028    {
 8030 
 8031        if (!action)
 8032        {
 8033            Debug.LogError(
"Action " + actionName + 
" dosn't exist!");
 
 8034            return;
 8035        }       
 8036        
 8038        if (!ai)
 8039        {
 8041            return;
 8042        }
 8043        
 8045        if (!action_array)
 8046        {
 8047            action_array = new array<ActionBase_Basic>;
 8049        }
 8050        if (LogManager.IsActionLogEnable())
 8051        {
 8052            Debug.ActionLog(action.ToString() + 
" -> " + ai, 
this.ToString() , 
"n/a", 
"Add action");
 
 8053        }
 8054        
 8055        if (action_array.Find(action) != -1)
 8056        {
 8057            Debug.Log(
"Action " + action.Type() + 
" already added to " + 
this + 
", skipping!");
 
 8058        }
 8059        else
 8060        {
 8061            action_array.Insert(action);
 8062        }
 8063    }
 8064    
 8066    {
 8068        ActionBase action = player.GetActionManager().GetAction(actionName);
 8071        
 8072        if (action_array)
 8073        {
 8074            action_array.RemoveItem(action);
 8075        }
 8076    }
 8077    
 8078    
 8079    
 8081    {
 8082        ActionOverrideData overrideData = new ActionOverrideData();
 8086        
 8088        if (!actionMap) 
 8089        {
 8092        }
 8093        
 8094        actionMap.Insert(this.
Type(), overrideData); 
 
 8095        
 8096    }
 8097    
 8099    
 8101    
 8102    
 8104    {
 8107        
 8110        
 8111        string config_to_search = "CfgVehicles";
 8112        string muzzle_owner_config;
 8113        
 8115        {
 8116            if (IsInherited(Weapon))
 8117                config_to_search = "CfgWeapons";    
 8118            
 8119            muzzle_owner_config = config_to_search + 
" " + 
GetType() + 
" ";
 
 8120            
 8121            string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
 8122            
 8124            
 8125            if (config_OnFire_subclass_count > 0)
 8126            {
 8127                array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
 8128                
 8129                for (int i = 0; i < config_OnFire_subclass_count; i++)
 8130                {
 8131                    string particle_class = "";
 8133                    string config_OnFire_entry = config_OnFire_class + particle_class;
 8134                    WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
 8135                    WPOF_array.Insert(WPOF);
 8136                }
 8137                
 8138                
 8140            }
 8141        }
 8142        
 8144        {
 8145            config_to_search = "CfgWeapons"; 
 8146            muzzle_owner_config = config_to_search + 
" " + 
GetType() + 
" ";
 
 8147            
 8148            string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
 8149            
 8151            
 8152            if (config_OnBulletCasingEject_count > 0  &&  IsInherited(Weapon))
 8153            {
 8154                array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
 8155                
 8156                for (i = 0; i < config_OnBulletCasingEject_count; i++)
 8157                {
 8158                    string particle_class2 = "";
 8160                    string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
 8161                    WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
 8162                    WPOBE_array.Insert(WPOBE);
 8163                }
 8164                
 8165                
 8167            }
 8168        }
 8169    }
 8170    
 8171    
 8173    {
 8176        
 8178        {
 8179            string config_to_search = "CfgVehicles";
 8180            
 8181            if (IsInherited(Weapon))
 8182                config_to_search = "CfgWeapons";
 8183            
 8184            string muzzle_owner_config = config_to_search + 
" " + 
GetType() + 
" ";
 
 8185            string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
 8186            
 8187            if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
 
 8188            {
 8189                
 8191                
 8193                {
 8195                    string error = 
"Error reading config " + 
GetType() + 
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
 
 8197                    return;
 8198                }
 8199                
 8202                
 8203                
 8204                
 8206                array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
 8207                
 8208                for (int i = 0; i < config_OnOverheating_subclass_count; i++)
 8209                {
 8210                    string particle_class = "";
 8212                    string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
 8214                    
 8215                    if (entry_type == CT_CLASS)
 8216                    {
 8217                        WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
 8218                        WPOOH_array.Insert(WPOF);
 8219                    }
 8220                }
 8221                
 8222                
 8224            }
 8225        }
 8226    }
 8227    
 8229    {
 8231    }
 8232    
 8234    {
 8236        {
 8238            
 8241            
 8244            
 8245            CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
 
 8246        }
 8247    }
 8248    
 8250    {
 8252            UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
 
 8253        
 8255            StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
 
 8256        
 8258            StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
 
 8259        
 8261        {
 8263        }
 8264    }
 8265    
 8267    {
 8269    }
 8270    
 8272    {
 8275        else
 8277        
 8279        {
 8282        }
 8283        else
 8284        {
 8287            
 8290        }
 8291        
 8293    }
 8294 
 8296    {
 8298        ItemBase.PlayOverheatingParticles(
this, ammoType, 
this, suppressor, 
"CfgWeapons");
 
 8299    }
 8300    
 8302    {
 8304        ItemBase.UpdateOverheatingParticles(
this, ammoType, 
this, suppressor, 
"CfgWeapons");
 
 8306    }
 8307    
 8309    {
 8311        ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
 
 8312    }
 8313    
 8315    {
 8318        
 8319        OverheatingParticle OP = new OverheatingParticle();
 8324        
 8326    }
 8327    
 8329    {
 8332        
 8333        return -1;
 8334    }
 8335    
 8337    {
 8339        {
 8342            
 8343            for (int i = count; i > 0; --i)
 8344            {
 8345                int id = i - 1;
 8348                
 8351                
 8352                if (overheat_coef < overheat_min  &&  overheat_coef >= overheat_max)
 8353                {
 8354                    if (p)
 8355                    {
 8358                    }
 8359                }
 8360            }
 8361        }
 8362    }
 8363    
 8365    {
 8367        {
 8369            {
 8370                int id = i - 1;
 8372                
 8373                if (OP)
 8374                {
 8376                    
 8377                    if (p)
 8378                    {
 8380                    }
 8381                    
 8382                    delete OP;
 8383                }
 8384            }
 8385            
 8388        }
 8389    }
 8390    
 8393    {
 8394        return 0.0;
 8395    }
 8396    
 8397    
 8399    {
 8400        return 250;
 8401    }
 8402    
 8404    {
 8405        return 0;
 8406    }
 8407    
 8410    {
 8412            return true;
 8413        
 8414        return false;
 8415    }
 8416    
 8419    {
 8422        
 8424        {
 8426        }
 8427        else 
 8428        {
 8429            
 8431        }
 8432        
 8434    }
 8435    
 8442    {
 8443        return -1;
 8444    }
 8445    
 8446    
 8447    
 8448    
 8450    {
 8452        {
 8454            int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
 8455 
 8456            if (r_index >= 0)
 8457            {
 8458                    InventoryLocation r_il = new InventoryLocation;
 8459                    player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
 8460 
 8461                    player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
 8464                    {
 8465                        r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
 
 8466                    }
 8468                    {
 8469                        r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
 
 8470                    }
 8471            
 8472            }
 8473            
 8474            player.GetHumanInventory().ClearUserReservedLocation(this);
 8475        }
 8476        
 8479    }
 8480 
 8481    
 8482    
 8483    
 8485    {
 8486        return ItemBase.m_DebugActionsMask; 
 
 8487    }
 8488    
 8490    {
 8491        return ItemBase.m_DebugActionsMask & mask;  
 
 8492    }
 8493    
 8495    {
 8496        ItemBase.m_DebugActionsMask = mask;
 
 8497    }
 8498    
 8500    {
 8501        ItemBase.m_DebugActionsMask |= mask;
 
 8502    }
 8503    
 8505    {
 8506        ItemBase.m_DebugActionsMask &= ~mask;
 
 8507    }
 8508    
 8510    {
 8512        {
 8514        }
 8515        else
 8516        {
 8518        }
 8519    }
 8520    
 8521    
 8523    {
 8524        if (GetEconomyProfile())
 8525        {
 8526            float q_max = GetEconomyProfile().GetQuantityMax();
 8527            if (q_max > 0)
 8528            {
 8529                float q_min = GetEconomyProfile().GetQuantityMin();
 8530                float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
 8531                
 8533                {
 8534                    ComponentEnergyManager comp = GetCompEM();
 8536                    {
 8538                    }
 8539                }
 8541                {
 8543                    
 8544                }
 8545                
 8546            }
 8547        }
 8548    }
 8549    
 8552    {
 8553        EntityAI parent = GetHierarchyParent();
 
 8554        
 8555        if (parent)
 8556        {
 8557            InventoryLocation inventory_location_to_lock = new InventoryLocation;
 8558            GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
 8559            parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(), 
true);
 
 8560        }
 8561    }
 8562    
 8565    {
 8566        EntityAI parent = GetHierarchyParent();
 
 8567        
 8568        if (parent)
 8569        {
 8570            InventoryLocation inventory_location_to_unlock = new InventoryLocation;
 8571            GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
 8572            parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(), 
false);
 
 8573        }
 8574    }
 8575    
 8577    {
 8578        
 8579
 8580
 8581
 8583        
 8585        {
 8586            if (ScriptInputUserData.CanStoreInputUserData())
 8587            {
 8588                ScriptInputUserData ctx = new ScriptInputUserData;
 8594                ctx.
Write(use_stack_max);
 
 8597                
 8599                {
 8600                    GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
 
 8601                }
 8602            }
 8603        }
 8604        else if (!
GetGame().IsMultiplayer())
 
 8605        {
 8607        }
 8608    }
 8609    
 8611    {
 8613    }
 8614    
 8616    {
 8618    }
 8619    
 8621    {
 8623    }
 8624    
 8626    {
 8627        
 8628        return false;
 8629    }
 8630    
 8632    {
 8633        return false;
 8634    }
 8635    
 8639    {
 8640        return false;
 8641    }
 8642    
 8644    {
 8645        return "";
 8646    }
 8647    
 8649    
 8651    {
 8652        return false;
 8653    }
 8654    
 8656    {
 8657        return true;
 8658    }
 8659    
 8660    
 8661    
 8663    {
 8664        return true;
 8665    }
 8666    
 8668    {
 8669        return true;
 8670    }
 8671    
 8673    {
 8674        PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
 
 8676    }
 8677    
 8679    {
 8681    }
 8682    
 8684    {
 8686        if (!is_being_placed)
 8688        SetSynchDirty();
 8689    }
 8690    
 8691    
 8693    
 8695    {
 8697    }
 8698    
 8700    {
 8702    }
 8703    
 8705    {
 8706        return 1;
 8707    }
 8708    
 8710    {
 8711        return false;
 8712    }
 8713    
 8715    {
 8717        SetSynchDirty();
 8718    }
 8719    
 8720
 8721
 8722
 8723
 8724
 8725
 8726
 8727
 8728
 8729
 8730
 8731
 8732
 8733
 8734
 8735
 8736
 8737
 8738
 8739
 8740
 8741
 8742
 8743
 8744
 8745
 8746
 8747
 8748 
 8749
 8750
 8751    
 8752    
 8753    
 8755    {
 8756        super.OnMovedInsideCargo(container);
 8757        
 8758        MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
 8759    }
 8760    
 8761    override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
 
 8762    {
 8763        super.EEItemLocationChanged(oldLoc,newLoc);
 8764        
 8765        PlayerBase new_player = null;
 8766        PlayerBase old_player = null;
 8767        
 8768        if (newLoc.GetParent())
 8769            new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
 8770        
 8771        if (oldLoc.GetParent())
 8772            old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
 8773        
 8775        {
 8776            int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
 8777 
 8778            if (r_index >= 0)
 8779            {
 8780                    InventoryLocation r_il = new InventoryLocation;
 8781                    old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
 8782 
 8783                    old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
 8786                    {
 8787                        r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
 
 8788                    }
 8790                    {
 8791                        r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
 
 8792                    }
 8793            
 8794            }
 8795        }
 8796        
 8798        {
 8799            if (new_player)
 8800                new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
 8801            
 8802            if (new_player == old_player)
 8803            {
 8804                
 8805                if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
 8806                {
 8808                    {
 8809                        if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
 8810                        {
 8811                            new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
 8812                        }
 8813                    }
 8814                    else
 8815                    {
 8816                        new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
 8817                    }
 8818                }
 8819                
 8820                if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
 8821                {
 8822                    int type = oldLoc.GetType();
 8824                    {
 8825                        oldLoc.GetParent().GetOnSetLock().Invoke(this);
 8826                    }
 8828                    {
 8829                        oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
 8830                    }
 8831                }
 8832                if (!m_OldLocation)
 8833                {
 8834                    m_OldLocation = new InventoryLocation;
 8835                }
 8836                m_OldLocation.Copy(oldLoc);
 8837            }
 8838            else
 8839            {
 8840                if (m_OldLocation)
 8841                {
 8842                    m_OldLocation.Reset();
 8843                }
 8844            }
 8845            
 8847        }
 8848        else
 8849        {
 8850            if (new_player)
 8851            {
 8852                int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
 8853                if (res_index >= 0)
 8854                {
 8855                    InventoryLocation il = new InventoryLocation;
 8856                    new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
 8858                    new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
 8861                    {
 8862                        il.
GetParent().GetOnReleaseLock().Invoke(it);
 
 8863                    }
 8865                    {
 8867                    }
 8868                    
 8869                }
 8870            }
 8872            {
 8873                
 8875            }
 8876        
 8877            if (m_OldLocation)
 8878            {
 8879                m_OldLocation.Reset();
 8880            }
 8881        }
 8882    }
 8883    
 8884    override void EOnContact(IEntity other, Contact extra)
 
 8885    {
 8887        {
 8888            int liquidType = -1;
 8890            if (impactSpeed > 0.0)
 8891            {
 8893                #ifndef SERVER
 8895                #else
 8897                SetSynchDirty();
 8898                #endif
 8900            }
 8901        }
 8902        
 8903        #ifdef SERVER
 8904        if (GetCompEM() && GetCompEM().IsPlugged())
 8905        {
 8906            if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
 
 8907                GetCompEM().UnplugThis();
 8908        }
 8909        #endif
 8910    }
 8911    
 8913    
 8915    {
 8917    }
 8918    
 8920    {
 8921        
 8922    }
 8923    
 8925    {
 8926        super.OnItemLocationChanged(old_owner, new_owner);
 8927                
 8928        PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
 8929        PlayerBase playerNew = PlayerBase.Cast(new_owner);
 8930        
 8931        if (!relatedPlayer && playerNew)
 8932            relatedPlayer = playerNew;
 8933        
 8934        if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
 8935        {
 8937            if (actionMgr)
 8938            {
 8939                ActionBase currentAction = actionMgr.GetRunningAction();
 8940                if (currentAction)
 8942            }
 8943        }
 8944        
 8945        Man ownerPlayerOld = null;
 8946        Man ownerPlayerNew = null;
 8947            
 8948        if (old_owner)   
 8949        {
 8950            if (old_owner.
IsMan())
 
 8951            {
 8952                ownerPlayerOld = Man.Cast(old_owner);
 8953            }
 8954            else
 8955            {
 8956                ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
 8957            }
 8958        }
 8959        else 
 8960        {
 8962            {
 8964                
 8965                if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
 
 8966                {
 8967                    GetCompEM().UnplugThis();
 8968                }
 8969            }
 8970        }
 8971        
 8972        if (new_owner)
 8973        {
 8974            if (new_owner.
IsMan())
 
 8975            {
 8976                ownerPlayerNew = Man.Cast(new_owner);
 8977            }
 8978            else
 8979            {
 8980                ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
 8981            }
 8982        }
 8983        
 8984        if (ownerPlayerOld != ownerPlayerNew)
 8985        {
 8986            if (ownerPlayerOld)
 8987            {
 8988                array<EntityAI> subItemsExit = new array<EntityAI>;
 8990                for (int i = 0; i < subItemsExit.Count(); i++)
 8991                {
 8994                }
 8995            }
 8996 
 8997            if (ownerPlayerNew)
 8998            {
 8999                array<EntityAI> subItemsEnter = new array<EntityAI>;
 9001                for (int j = 0; j < subItemsEnter.Count(); j++)
 9002                {
 9005                }
 9006            }
 9007        }
 9008        else if (ownerPlayerNew != null)
 9009        {
 9010            PlayerBase nplayer;
 9011            if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
 9012            {
 9013                array<EntityAI> subItemsUpdate = new array<EntityAI>;
 9015                for (int k = 0; k < subItemsUpdate.Count(); k++)
 9016                {
 9018                    itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
 9019                }
 9020            }
 9021        }
 9022        
 9023        if (old_owner)
 9024            old_owner.OnChildItemRemoved(this);
 9025        if (new_owner)
 9026            new_owner.OnChildItemReceived(this);
 9027    }
 9028 
 9029    
 9031    {
 9032        super.EEDelete(parent);
 9033        PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
 9034        if (player)
 9035        {
 9037            
 9038            if (player.IsAlive())
 9039            {
 9040                int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
 9041                if (r_index >= 0)
 9042                {           
 9043                    InventoryLocation r_il = new InventoryLocation;
 9044                    player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
 9045    
 9046                    player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
 9049                    {
 9050                        r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
 
 9051                    }
 9053                    {
 9054                        r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
 
 9055                    }
 9056                
 9057                }
 9058                
 9059                player.RemoveQuickBarEntityShortcut(this);
 9060            }
 9061        }
 9062    }
 9063    
 9065    {
 9066        super.EEKilled(killer);
 9067
 9070        {
 9071            if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
 
 9072            {
 9073                if (IsMagazine())
 9074                {
 9075                    if (Magazine.Cast(this).GetAmmoCount() > 0)
 9076                    {
 9078                    }
 9079                }
 9080                else
 9081                {
 9083                }
 9084            }
 9085        }
 9086    }
 9087    
 9089    {
 9090        MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
 9091        
 9092        super.OnWasAttached(parent, slot_id);
 9093        
 9096        
 9098    }
 9099    
 9101    {
 9102        super.OnWasDetached(parent, slot_id);
 9103        
 9106    }
 9107    
 9109    {
 9110        int idx;
 9113        
 9114        ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
 9115        if (inventory_slots.Count() < 1) 
 9116        {
 9117            inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
 9118            attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
 9119        }
 9120        else 
 9121        {
 9122            ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
 9123        }
 9124        
 9125        idx = inventory_slots.Find(slot);
 9126        if (idx < 0)
 9127            return "";
 9128        
 9129        return attach_types.Get(idx);
 9130    }
 9131    
 9133    {
 9134        int idx = -1;
 9135        string slot;
 9136        
 9139        
 9140        this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
 9141        if (inventory_slots.Count() < 1) 
 9142        {
 9143            inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
 9144            detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
 9145        }
 9146        else 
 9147        {
 9148            this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
 9149            if (detach_types.Count() < 1)
 9150                detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
 9151        }
 9152        
 9153        for (int i = 0; i < inventory_slots.Count(); i++)
 9154        {
 9155            slot = inventory_slots.Get(i);
 9156        }
 9157        
 9158        if (slot != "")
 9159        {
 9160            if (detach_types.Count() == 1)
 9161                idx = 0;
 9162            else
 9163                idx = inventory_slots.Find(slot);
 9164        }
 9165        if (idx < 0)
 9166            return "";
 9167    
 9168        return detach_types.Get(idx);
 9169    }
 9170    
 9172    {
 9173        
 9175        
 9176        
 9177        float min_time = 1;
 9178        float max_time = 3;
 9179        float delay = Math.RandomFloat(min_time, max_time);
 9180        
 9181        explode_timer.Run(delay, this, "DoAmmoExplosion");
 9182    }
 9183    
 9185    {
 9186        Magazine magazine = Magazine.Cast(this);
 9187        int pop_sounds_count = 6;
 9188        string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
 9189        
 9190        
 9191        int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
 9192        string sound_name = pop_sounds[ sound_idx ];
 9194        
 9195        
 9196        magazine.ServerAddAmmoCount(-1);
 9197        
 9198        
 9199        float min_temp_to_explode   = 100;      
 9200                
 9201        if (magazine.GetAmmoCount() > 0 && 
GetTemperature() >= min_temp_to_explode)   
 
 9202        {
 9204        }
 9205    }
 9206    
 9207    
 9208    override void EEHitBy(TotalDamageResult damageResult, 
int damageType, 
EntityAI source, 
int component, 
string dmgZone, 
string ammo, vector modelPos, 
float speedCoef)
 
 9209    {
 9210        super.EEHitBy(damageResult, damageType, source, 
component, dmgZone, ammo, modelPos, speedCoef);
 
 9211        
 9212        const int CHANCE_DAMAGE_CARGO = 4;
 9213        const int CHANCE_DAMAGE_ATTACHMENT = 1;
 9214        const int CHANCE_DAMAGE_NOTHING = 2;
 9215        
 9217        {
 9218            float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
 
 9219            int chances;
 9220            int rnd;
 9221            
 9222            if (GetInventory().GetCargo())
 9223            {
 9224                chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
 9225                rnd = Math.RandomInt(0,chances);
 9226                
 9227                if (rnd < CHANCE_DAMAGE_CARGO)
 9228                {
 9230                }
 9231                else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
 9232                {
 9234                }
 9235            }
 9236            else
 9237            {
 9238                chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
 9239                rnd = Math.RandomInt(0,chances);
 9240                
 9241                if (rnd < CHANCE_DAMAGE_ATTACHMENT)
 9242                {
 9244                }
 9245            }
 9246        }
 9247    }
 9248    
 9250    {
 9251        if (GetInventory().GetCargo())
 9252        {
 9253            int item_count = GetInventory().GetCargo().GetItemCount();
 9254            if (item_count > 0)
 9255            {
 9256                int random_pick = Math.RandomInt(0, item_count);
 9258                if (!item.IsExplosive())
 9259                {
 9260                    item.AddHealth("","",damage);
 9261                    return true;
 9262                }
 9263            }
 9264        }
 9265        return false;
 9266    }
 9267    
 9269    {
 9270        int attachment_count = GetInventory().AttachmentCount();
 9271        if (attachment_count > 0)
 9272        {
 9273            int random_pick = Math.RandomInt(0, attachment_count);
 9274            ItemBase attachment = 
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
 
 9275            if (!attachment.IsExplosive())
 9276            {
 9277                attachment.AddHealth("","",damage);
 9278                return true;
 9279            }
 9280        }
 9281        return false;
 9282    }
 9283    
 9285    {
 9287    }
 9288    
 9290    {
 9292            return GetInventory().CanRemoveEntity();
 9293        
 9294        return false;
 9295    }
 9296 
 9298    {
 9299        
 9301            return false;
 9302 
 9303        
 9305            return false;
 9306 
 9307        
 9308        
 9310        if (delta == 0)
 9311            return false;
 9312 
 9313        
 9314        return true;
 9315    }
 9316    
 9318    {       
 9320        {
 9321            if (ScriptInputUserData.CanStoreInputUserData())
 9322            {
 9323                ScriptInputUserData ctx = new ScriptInputUserData;
 9328                ctx.
Write(destination_entity);
 
 9332            }
 9333        }
 9334        else if (!
GetGame().IsMultiplayer())
 
 9335        {
 9337        }
 9338    }
 9339 
 9341    {       
 9342        float split_quantity_new;
 9346        InventoryLocation loc = new InventoryLocation;
 9347        
 9348        if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
 9349        {
 9351                split_quantity_new = stack_max;
 9352            else
 9354 
 9356            {
 9357                new_item = 
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
 
 9358                if (new_item)
 9359                {
 9360                    new_item.SetResultOfSplit(true);
 9361                    MiscGameplayFunctions.TransferItemProperties(this, new_item);
 9363                    new_item.
SetQuantity(split_quantity_new, 
false, 
true);
 
 9364                }
 9365            }
 9366        }
 9367        else if (destination_entity && slot_id == -1)
 9368        {
 9369            if (quantity > stack_max)
 9370                split_quantity_new = stack_max;
 9371            else
 9372                split_quantity_new = quantity;
 9373            
 9375            {
 9377                {
 9380                }
 9381 
 9382                if (new_item)
 9383                {
 9384                    new_item.SetResultOfSplit(true);        
 9385                    MiscGameplayFunctions.TransferItemProperties(this, new_item);
 9387                    new_item.
SetQuantity(split_quantity_new, 
false, 
true);
 
 9388                }
 9389            }
 9390        }
 9391        else
 9392        {
 9393            if (stack_max != 0)
 9394            {
 9396                {
 9398                }
 9399                
 9400                if (split_quantity_new == 0)
 9401                {
 9402                    if (!
GetGame().IsMultiplayer())
 
 9403                        player.PhysicalPredictiveDropItem(this);
 9404                    else
 9405                        player.ServerDropEntity(this);
 9406                    return;
 9407                }
 9408                
 9410                {
 9412                    
 9413                    if (new_item)
 9414                    {
 9415                        new_item.SetResultOfSplit(true);
 9416                        MiscGameplayFunctions.TransferItemProperties(this, new_item);
 9419                        new_item.PlaceOnSurface();
 9420                    }
 9421                }
 9422            }
 9423        }
 9424    }
 9425    
 9427    {       
 9428        float split_quantity_new;
 9432        InventoryLocation loc = new InventoryLocation;
 9433        
 9434        if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
 9435        {
 9437                split_quantity_new = stack_max;
 9438            else
 9440 
 9442            {
 9443                new_item = 
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
 
 9444                if (new_item)
 9445                {
 9446                    new_item.SetResultOfSplit(true);
 9447                    MiscGameplayFunctions.TransferItemProperties(this, new_item);
 9449                    new_item.
SetQuantity(split_quantity_new, 
false, 
true);
 
 9450                }
 9451            }
 9452        }
 9453        else if (destination_entity && slot_id == -1)
 9454        {
 9455            if (quantity > stack_max)
 9456                split_quantity_new = stack_max;
 9457            else
 9458                split_quantity_new = quantity;
 9459            
 9461            {
 9463                {
 9466                }
 9467 
 9468                if (new_item)
 9469                {
 9470                    new_item.SetResultOfSplit(true);        
 9471                    MiscGameplayFunctions.TransferItemProperties(this, new_item);
 9473                    new_item.
SetQuantity(split_quantity_new, 
false, 
true);
 
 9474                }
 9475            }
 9476        }
 9477        else
 9478        {
 9479            if (stack_max != 0)
 9480            {
 9482                {
 9484                }
 9485                
 9487                {
 9489                    
 9490                    if (new_item)
 9491                    {
 9492                        new_item.SetResultOfSplit(true);
 9493                        MiscGameplayFunctions.TransferItemProperties(this, new_item);
 9496                        new_item.PlaceOnSurface();
 9497                    }
 9498                }
 9499            }
 9500        }
 9501    }
 9502    
 9504    {
 9506        {
 9507            if (ScriptInputUserData.CanStoreInputUserData())
 9508            {
 9509                ScriptInputUserData ctx = new ScriptInputUserData;
 9514                dst.WriteToContext(ctx);
 9516            }
 9517        }
 9518        else if (!
GetGame().IsMultiplayer())
 
 9519        {
 9521        }
 9522    }
 9523    
 9525    {
 9527        {
 9528            if (ScriptInputUserData.CanStoreInputUserData())
 9529            {
 9530                ScriptInputUserData ctx = new ScriptInputUserData;
 9535                ctx.
Write(destination_entity);
 
 9541            }
 9542        }
 9543        else if (!
GetGame().IsMultiplayer())
 
 9544        {
 9546        }
 9547    }
 9548 
 9550    {
 9552    }
 9553    
 9555    {       
 9557        float split_quantity_new;
 9559        if (dst.IsValid())
 9560        {
 9561            int slot_id = dst.GetSlot();
 9563            
 9564            if (quantity > stack_max)
 9565                split_quantity_new = stack_max;
 9566            else
 9567                split_quantity_new = quantity;
 9568 
 9570            {
 9572                
 9573                if (new_item)
 9574                {
 9575                    new_item.SetResultOfSplit(true);
 9576                    MiscGameplayFunctions.TransferItemProperties(this,new_item);
 9578                    new_item.
SetQuantity(split_quantity_new, 
false, 
true);
 
 9579                }
 9580                
 9581                return new_item;
 9582            }
 9583        }
 9584        
 9585        return null;
 9586    }
 9587    
 9589    {       
 9591        float split_quantity_new;
 9593        if (destination_entity)
 9594        {
 9596            if (quantity > stackable)
 9597                split_quantity_new = stackable;
 9598            else
 9599                split_quantity_new = quantity;
 9600            
 9602            {
 9603                new_item = 
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col, 
false));
 
 9604                if (new_item)
 9605                {
 9606                    new_item.SetResultOfSplit(true);    
 9607                    MiscGameplayFunctions.TransferItemProperties(this,new_item);
 9609                    new_item.
SetQuantity(split_quantity_new, 
false, 
true);
 
 9610                }
 9611            }
 9612        }
 9613    }
 9614    
 9616    {
 9618        {
 9619            if (ScriptInputUserData.CanStoreInputUserData())
 9620            {
 9621                ScriptInputUserData ctx = new ScriptInputUserData;
 9626                ItemBase destination_entity = 
this;
 
 9627                ctx.
Write(destination_entity);
 
 9631            }
 9632        }
 9633        else if (!
GetGame().IsMultiplayer())
 
 9634        {
 9636        }
 9637    }
 9638 
 9640    {       
 9642        float split_quantity_new;
 9644        if (player)
 9645        {
 9647            if (quantity > stackable)
 9648                split_quantity_new = stackable;
 9649            else
 9650                split_quantity_new = quantity;
 9651            
 9653            {
 9654                EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
 
 9655                new_item = 
ItemBase.Cast(in_hands);
 
 9656                if (new_item)
 9657                {       
 9658                    new_item.SetResultOfSplit(true);
 9659                    MiscGameplayFunctions.TransferItemProperties(this,new_item);
 9661                    new_item.SetQuantity(split_quantity_new, false, true);
 9662                }
 9663            }
 9664        }
 9665    }
 9666    
 9668    {       
 9670        float split_quantity_new = Math.Floor(quantity * 0.5);
 9671        
 9673            return;
 9674 
 9676 
 9677        if (new_item)
 9678        {
 9679            if (new_item.GetQuantityMax() < split_quantity_new)
 9680            {
 9681                split_quantity_new = new_item.GetQuantityMax();
 9682            }
 9683            
 9684            new_item.SetResultOfSplit(true);
 9685            MiscGameplayFunctions.TransferItemProperties(this, new_item);
 9686            
 9688            {
 9691            }
 9692            else
 9693            {
 9695                new_item.
SetQuantity(split_quantity_new, 
false, 
true);               
 
 9696            }
 9697        }   
 9698    }
 9699    
 9701    {
 9703        float split_quantity_new = Math.Floor(quantity / 2);
 9704        
 9706            return;
 9707        
 9708        InventoryLocation invloc = new InventoryLocation;
 9710        
 9712        new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
 9713        
 9714        if (new_item)
 9715        {
 9716            if (new_item.GetQuantityMax() < split_quantity_new)
 9717            {
 9718                split_quantity_new = new_item.GetQuantityMax();
 9719            }
 9721            {
 9724            }
 9725            else if (split_quantity_new > 1)
 9726            {
 9728                new_item.
SetQuantity(split_quantity_new, 
false, 
true);
 
 9729            }
 9730        }
 9731    }
 9732    
 9735    {
 9736        SetWeightDirty();
 9738        
 9739        if (parent)
 9740            parent.OnAttachmentQuantityChangedEx(this, delta);
 9741        
 9743        {
 9745            {
 9747            }
 9749            {
 9750                ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
 
 9752            }
 9753        }
 9754            
 9755    }
 9756    
 9759    {
 9760        
 9761    }
 9762    
 9765    {
 9767    }
 9768 
 9770    {
 9771        super.EEHealthLevelChanged(oldLevel,newLevel,zone);
 9772        
 9774        {
 9775            if (newLevel == GameConstants.STATE_RUINED)
 9776            {
 9778                EntityAI parent = GetHierarchyParent();
 
 9779                if (parent && parent.IsFireplace())
 9780                {
 9781                    CargoBase cargo = GetInventory().GetCargo();
 9782                    if (cargo)
 9783                    {
 9785                        {
 9787                        }
 9788                    }
 9789                }
 9790            }
 9791            
 9793            {
 9794                
 9796                return;
 9797            }
 9798 
 9799            if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
 
 9800            {
 9802            }
 9803        }
 9804    }
 9805        
 9806    
 9808    {
 9809        super.OnRightClick();
 9810        
 9812        {
 9814            {
 9815                if (ScriptInputUserData.CanStoreInputUserData())
 9816                {
 9817                    EntityAI root = GetHierarchyRoot();
 
 9818                    Man playerOwner = GetHierarchyRootPlayer();
 9819                    InventoryLocation dst = new InventoryLocation;
 9820                    
 9821                    
 9822                    if (!playerOwner && root && root == this)
 9823                    {
 9825                    }
 9826                    else
 9827                    {
 9828                        
 9829                        GetInventory().GetCurrentInventoryLocation(dst);
 9831                        {
 9834                            {
 9836                            }
 9837                            else
 9838                            {
 9840                                
 9841
 9842                                if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
 
 9843                                {
 9845                                }
 9846                                else
 9847                                {
 9848                                    GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
 
 9849                                }
 9850                            }
 9851                        }
 9852                    }
 9853                    
 9854                    ScriptInputUserData ctx = new ScriptInputUserData;
 9862                }
 9863            }
 9864            else if (!
GetGame().IsMultiplayer())
 
 9865            {
 9867            }
 9868        }
 9869    }
 9870        
 9872    {
 9873        if (root)
 9874        {
 9875            vector m4[4];
 9876            root.GetTransform(m4);
 9877            dst.SetGround(this, m4);
 9878        }
 9879        else
 9880        {
 9881            GetInventory().GetCurrentInventoryLocation(dst);
 9882        }
 9883    }
 9884    
 9885    override bool CanBeCombined(
EntityAI other_item, 
bool reservation_check = 
true, 
bool stack_max_limit = 
false)
 
 9886    {
 9887        
 9888        if (!other_item || 
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item == 
this)
 
 9889            return false;
 9890 
 9891        if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)    
 9892            return false;
 9893        
 9894        
 9896            return false;
 9897 
 9898        
 9899        Magazine mag = Magazine.Cast(this);
 9900        if (mag)
 9901        {
 9902            if (mag.GetAmmoCount() >= mag.GetAmmoMax())
 9903                return false;
 9904            
 9905            if (stack_max_limit)
 9906            {
 9907                Magazine other_mag = Magazine.Cast(other_item);
 9908                if (other_item)
 9909                {
 9910                    if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
 9911                        return false;
 9912                }
 9913            
 9914            }
 9915        }
 9916        else
 9917        {
 9918            
 9920                return false;
 9921            
 9923                return false;
 9924        }
 9925 
 9926        PlayerBase player = null;
 9927        if (CastTo(player, GetHierarchyRootPlayer())) 
 9928        {
 9929            if (player.GetInventory().HasAttachment(this))
 9930                return false;
 9931            
 9932            if (player.IsItemsToDelete())
 9933                return false;
 9934        }
 9935 
 9936        if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
 9937            return false;
 9938        
 9939        int slotID;
 9941        if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
 
 9942            return false;
 9943 
 9944        return true;
 9945    }
 9946    
 9948    {
 9950    }
 9951    
 9953    {
 9954        return m_IsResultOfSplit;
 9955    }
 9956    
 9958    {
 9959        m_IsResultOfSplit = value;
 9960    }
 9961    
 9963    {
 9965    }
 9966    
 9968    {
 9969        float other_item_quantity = other_item.GetQuantity();
 9970        float this_free_space;
 9971            
 9973        
 9975            
 9976        if (other_item_quantity > this_free_space)
 9977        {
 9978            return this_free_space;
 9979        }
 9980        else
 9981        {
 9982            return other_item_quantity;
 9983        }
 9984    }
 9985    
 9987    {
 9989    }
 9990    
 9992    {
 9994            return;
 9995        
 9996        if (!IsMagazine() && other_item)
 9997        {
 9999            if (quantity_used != 0)
10000            {
10001                float hp1 = GetHealth01("","");
10002                float hp2 = other_item.GetHealth01("","");
10003                float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
 
10004                hpResult = hpResult / (
GetQuantity() + quantity_used);
 
10005 
10006                hpResult *= GetMaxHealth();
10007                Math.Round(hpResult);
10008                SetHealth("", "Health", hpResult);
10009 
10011                other_item.AddQuantity(-quantity_used);
10012            }
10013        }
10015    }
10016 
10018    {
10019        #ifdef SERVER
10020        if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10021            GetHierarchyParent().IncreaseLifetimeUp();
10022        #endif
10023    };
10024 
10026    {
10027        PlayerBase p = PlayerBase.Cast(player);
10028            
10029        array<int> recipesIds = p.m_Recipes;
10030        PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
 
10031        if (moduleRecipesManager)
10032        {
10033            EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
 
10034            moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this), 
ItemBase.Cast(itemInHands), recipesIds, p);
 
10035        }
10036 
10037        for (int i = 0;i < recipesIds.Count(); i++)
10038        {
10039            int key = recipesIds.Get(i);
10040            string recipeName = moduleRecipesManager.GetRecipeName(key);
10042        }
10043    }
10044    
10045    
10046    override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
 
10047    {
10048        super.GetDebugActions(outputList);
10049            
10050        
10056        
10057        
10062        
10067        
10068        
10072 
10073        
10075        {
10079        }
10080        
10083 
10084        
10088        
10090 
10091        InventoryLocation loc = new InventoryLocation();
10092        GetInventory().GetCurrentInventoryLocation(loc);
10094        {
10095            if (Gizmo_IsSupported())
10098        }
10099 
10101    }
10102    
10103    
10104    
10105    
10107    {
10108        super.OnAction(action_id, player, ctx);
10109 
10111        {
10112            switch (action_id)
10113            {
10116                    return true;
10119                    return true;
10120            }
10121        }
10122 
10124        {
10125            switch (action_id)
10126            {
10128                    Delete();
10129                    return true;
10130            }
10131        }
10132 
10133        if (action_id >= 
EActions.RECIPES_RANGE_START && action_id < 
EActions.RECIPES_RANGE_END)
 
10134        {
10135            PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
 
10136            int idWithoutOffset = action_id - 
EActions.RECIPES_RANGE_START;
 
10137            PlayerBase p = PlayerBase.Cast(player);
10138            if (
EActions.RECIPES_RANGE_START  < 1000)
 
10139            {
10140                float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10141                float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10142            }
10143        }
10144        #ifndef SERVER
10145        else if (action_id == 
EActions.WATCH_PLAYER)
 
10146        {
10147            PluginDeveloper.SetDeveloperItemClientEx(player);
10148        }
10149        #endif
10151        {
10152            if (action_id >= 
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id < 
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
 
10153            {
10154                int id = action_id - 
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
 
10155                OnDebugButtonPressServer(id + 1);
10156            }
10157            
10158            else if (action_id >= 
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id < 
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
 
10159            {
10160                int agent_id = action_id - 
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
 
10162            }
10163    
10164            else if (action_id >= 
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id < 
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
 
10165            {
10166                int agent_id2 = action_id - 
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
 
10168            }
10169            
10170            else if (action_id == 
EActions.ADD_QUANTITY)
 
10171            {
10172                if (IsMagazine())
10173                {
10174                    Magazine mag = Magazine.Cast(this);
10175                    mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10176                }
10177                else
10178                {
10180                }
10181                
10182                if (m_EM)
10183                {
10184                    m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10185                }
10186                
10187            }
10188                        
10189            else if (action_id == 
EActions.REMOVE_QUANTITY) 
 
10190            {
10191                if (IsMagazine())
10192                {
10193                    Magazine mag2 = Magazine.Cast(this);
10194                    mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10195                }
10196                else
10197                {
10199                }
10200                if (m_EM)
10201                {
10202                    m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10203                }
10204                
10205            }
10206            
10207            else if (action_id == 
EActions.SET_QUANTITY_0) 
 
10208            {
10210                
10211                if (m_EM)
10212                {
10213                    m_EM.SetEnergy(0);
10214                }
10215            }
10216            
10217            else if (action_id == 
EActions.SET_MAX_QUANTITY) 
 
10218            {
10220                
10221                if (m_EM)
10222                {
10223                    m_EM.SetEnergy(m_EM.GetEnergyMax());
10224                }
10225            }
10226    
10227            else if (action_id == 
EActions.ADD_HEALTH) 
 
10228            {
10229                AddHealth("","",GetMaxHealth("","Health")/5);
10230            }
10231            else if (action_id == 
EActions.REMOVE_HEALTH) 
 
10232            {
10233                AddHealth("","",-GetMaxHealth("","Health")/5);
10234            }
10235            else if (action_id == 
EActions.DESTROY_HEALTH) 
 
10236            {
10237                SetHealth01("","",0);
10238            }
10239            else if (action_id == 
EActions.WATCH_ITEM)
 
10240            {
10242                mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
 
10243                #ifdef DEVELOPER
10244                SetDebugDeveloper_item(this);
10245                #endif
10246            }
10247            
10248            else if (action_id == 
EActions.ADD_TEMPERATURE)
 
10249            {
10250                AddTemperature(20);
10251                
10252            }
10253            
10254            else if (action_id == 
EActions.REMOVE_TEMPERATURE)
 
10255            {
10256                AddTemperature(-20);
10257                
10258            }
10259            
10260            else if (action_id == 
EActions.FLIP_FROZEN)
 
10261            {
10262                SetFrozen(!GetIsFrozen());
10263                
10264            }
10265            
10266            else if (action_id == 
EActions.ADD_WETNESS)
 
10267            {
10269                
10270            }
10271            
10272            else if (action_id == 
EActions.REMOVE_WETNESS)
 
10273            {
10275                
10276            }
10277    
10278            else if (action_id == 
EActions.LIQUIDTYPE_UP)
 
10279            {
10282                
10283                
10284            }
10285            
10286            else if (action_id == 
EActions.LIQUIDTYPE_DOWN)
 
10287            {
10290            }
10291 
10292            else if (action_id == 
EActions.MAKE_SPECIAL)
 
10293            {
10294                auto debugParams = DebugSpawnParams.WithPlayer(player);
10295                OnDebugSpawnEx(debugParams);
10296            }
10297            
10298        }
10299 
10300        
10301        return false;
10302    }
10303 
10304    
10305    
10306    
10310    
10313 
10314    
10315    
10317    {
10318        return false;
10319    }
10320    
10321    
10323    {
10324        return true;
10325    }
10326    
10327    
10329    {
10330        return true;
10331    }
10332    
10333    
10334    
10336    {
10337        string config_path = 
string.Format(
"CfgVehicles %1 Food FoodStages", 
GetType());
 
10339    }
10340    
10343    {
10344        return null;
10345    }
10346    
10348    {
10349        return false;
10350    }
10351    
10353    {
10354        return false;
10355    }       
10356    
10360    
10361    
10363    {
10364        PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
 
10365        return module_repairing.CanRepair(this, item_repair_kit);
10366    }
10367 
10368    
10369    bool Repair(PlayerBase player, 
ItemBase item_repair_kit, 
float specialty_weight)
 
10370    {
10371        PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
 
10372        return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10373    }
10374 
10375    
10377    {
10378        
10379
10380
10381
10382
10383
10384
10385        
10386        return 1;
10387    }
10388    
10389    
10390    
10392    {
10394    }
10395    
10396    
10397    
10399    {
10401    }
10402    
10403    
10412    {
10413        PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10414        
10415        if (player)
10416        {
10417            player.MessageStatus(text);
10418        }
10419    }
10420 
10421    
10430    {
10431        PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10432        
10433        if (player)
10434        {
10435            player.MessageAction(text);
10436        }
10437    }
10438 
10439    
10448    {
10449        PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10450        
10451        if (player)
10452        {
10453            player.MessageFriendly(text);
10454        }
10455    }
10456 
10457    
10466    {
10467        PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10468        
10469        if (player)
10470        {
10471            player.MessageImportant(text);
10472        }
10473    }
10474 
10476    {
10477        return true;
10478    }
10479 
10480    
10481    override bool KindOf(
string tag)
 
10482    {
10483        bool found = false;
10484        string item_name = this.
GetType();
 
10487        
10488        int array_size = item_tag_array.Count();
10489        for (int i = 0; i < array_size; i++)
10490        {
10491            if (item_tag_array.Get(i) == tag)
10492            {
10493                found = true;
10494                break;
10495            }
10496        }
10497        return found;
10498    }
10499 
10500    
10502    {
10503        
10504        super.OnRPC(sender, rpc_type,ctx);
10505            
10506        
10507        switch (rpc_type)
10508        {
10509            #ifndef SERVER
10510            case ERPCs.RPC_SOUND_LOCK_ATTACH:
 
10511                Param2<bool, string> p = new Param2<bool, string>(false, "");
10512                    
10514                    return;
10515            
10516                bool play = p.param1;
10517                string soundSet = p.param2;
10518                
10519                if (play)
10520                {
10522                    {
10524                        {
10526                        }
10527                    }
10528                    else
10529                    {
10531                    }
10532                }
10533                else
10534                {
10536                }
10537            
10538            break;
10539            #endif
10540        
10541        }
10542        
10544        {
10546        }
10547    }
10548 
10549    
10550    
10551    
10553    {
10554        PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
 
10555        return plugin.GetID(
name);
 
10556    }
10557 
10559    {
10560        PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
 
10561        return plugin.GetName(id);
10562    }
10563
10566    {
10567        
10568        
10569        int varFlags;
10570        if (!ctx.
Read(varFlags))
 
10571            return;
10572        
10573        if (varFlags & ItemVariableFlags.FLOAT)
10574        {
10576        }
10577    }
10578    
10580    {
10581        
10582        super.SerializeNumericalVars(floats_out);
10583        
10584        
10585        
10587        {
10589        }
10590        
10592        {
10594        }
10595        
10597        {
10599        }
10600        
10602        {
10607        }
10608        
10610        {
10612        }
10613    }
10614    
10616    {
10617        
10618        super.DeSerializeNumericalVars(floats);
10619        
10620        
10621        int index = 0;
10622        int mask = Math.Round(floats.Get(index));
10623        
10624        index++;
10625        
10627        {
10629            {
10631            }
10632            else
10633            {
10634                float quantity = floats.Get(index);
10635                SetQuantity(quantity, 
true, 
false, 
false, 
false);
 
10636            }
10637            index++;
10638        }
10639        
10641        {
10642            float wet = floats.Get(index);
10644            index++;
10645        }
10646        
10648        {
10649            int liquidtype = Math.Round(floats.Get(index));
10651            index++;
10652        }
10653        
10655        {
10657            index++;
10659            index++;
10661            index++;
10663            index++;
10664        }
10665        
10667        {
10668            int cleanness = Math.Round(floats.Get(index));
10670            index++;
10671        }
10672    }
10673    
10675    {
10676        super.WriteVarsToCTX(ctx);
10677 
10678        
10680        {
10682        }
10683        
10685        {
10687        }
10688        
10690        {
10692        }
10693        
10695        {
10696            int r,g,b,a;
10702        }
10703        
10705        {
10707        }
10708    }
10709    
10711    {
10712        if (!super.ReadVarsFromCTX(ctx,version))
10713            return false;
10714        
10715        int intValue;
10716        float value;
10717        
10718        if (version < 140)
10719        {
10720            if (!ctx.
Read(intValue))
 
10721                return false;
10722            
10723            m_VariablesMask = intValue;
10724        }
10725        
10727        {
10728            if (!ctx.
Read(value))
 
10729                return false;
10730            
10732            {
10734            }
10735            else
10736            {
10738            }
10739        }
10740        
10741        if (version < 140)
10742        {
10744            {
10745                if (!ctx.
Read(value))
 
10746                    return false;
10747                SetTemperatureDirect(value);
10748            }
10749        }
10750        
10752        {
10753            if (!ctx.
Read(value))
 
10754                return false;
10756        }
10757        
10759        {
10760            if (!ctx.
Read(intValue))
 
10761                return false;
10763        }
10764        
10766        {
10767            int r,g,b,a;
10769                return false;
10771                return false;
10773                return false;
10775                return false;
10776            
10778        }
10779        
10781        {
10782            if (!ctx.
Read(intValue))
 
10783                return false;
10785        }
10786        
10787        if (version >= 138 && version < 140)
10788        {
10790            {
10791                if (!ctx.
Read(intValue))
 
10792                    return false;
10793                SetFrozen(intValue);
10794            }
10795        }
10796        
10797        return true;
10798    }
10799 
10800    
10802    {
10805        {
10807        }
10808        
10809        if (!super.OnStoreLoad(ctx, version))
10810        {
10812            return false;
10813        }
10814        
10815        if (version >= 114)
10816        {
10817            bool hasQuickBarIndexSaved;
10818            
10819            if (!ctx.
Read(hasQuickBarIndexSaved))
 
10820            {
10822                return false;
10823            }
10824            
10825            if (hasQuickBarIndexSaved)
10826            {
10827                int itmQBIndex;
10828                
10829                
10830                if (!ctx.
Read(itmQBIndex))
 
10831                {
10833                    return false;
10834                }
10835                
10836                PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());                
10837                if (itmQBIndex != -1 && parentPlayer)
10838                    parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10839            }
10840        }
10841        else
10842        {
10843            
10844            PlayerBase player;
10845            int itemQBIndex;
10846            if (version == 
int.
MAX)
 
10847            {
10848                if (!ctx.
Read(itemQBIndex))
 
10849                {
10851                    return false;
10852                }
10853            }
10854            else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10855            {
10856                
10857                if (!ctx.
Read(itemQBIndex))
 
10858                {
10860                    return false;
10861                }
10862                if (itemQBIndex != -1 && player)
10863                    player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10864            }
10865        }
10866        
10867        if (version < 140)
10868        {
10869            
10870            if (!LoadVariables(ctx, version))
10871            {
10873                return false;
10874            }
10875        }
10876        
10877        
10879        {
10881            return false;
10882        }
10883        if (version >= 132)
10884        {
10886            if (raib)
10887            {
10889                {
10891                    return false;
10892                }
10893            }
10894        }
10895 
10897        return true;
10898    }
10899 
10900    
10901 
10903    {
10904        super.OnStoreSave(ctx);
10905        
10906        PlayerBase player;
10907        if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10908        {
10910            
10911            int itemQBIndex = -1;
10912            itemQBIndex = player.FindQuickBarEntityIndex(this);
10913            ctx.
Write(itemQBIndex);    
 
10914        }
10915        else
10916        {
10918        }
10919        
10921        
10923        if (raib)
10924        {
10926        }
10927    }
10928    
10929 
10931    {   
10932        super.AfterStoreLoad();
10933        
10935        {
10937        }
10938 
10940        {
10943        }
10944    }
10945    
10947    {
10948        super.EEOnAfterLoad();
10949        
10951        {
10953        }
10954        
10957    }
10958    
10960    {
10961        return false;
10962    }
10963    
10964    
10965    
10967    {
10969        {   
10970            #ifdef PLATFORM_CONSOLE
10971            
10973            {
10975                if (menu)
10976                {
10978                }
10979            }
10980            #endif
10981        }
10982                
10984        {
10987        }
10988        
10990        {
10991            SetWeightDirty();
10993        }
10995        {
10998        }
10999        
11001        {
11004        }
11006        {
11009        }
11010            
11011        super.OnVariablesSynchronized();
11012    }
11013 
11014    
11015    
11017    override bool SetQuantity(
float value, 
bool destroy_config = 
true, 
bool destroy_forced = 
false, 
bool allow_client = 
false, 
bool clamp_to_stack_max = 
true)
 
11018    {
11019        if (!IsServerCheck(allow_client))
11020            return false;
11021        
11023            return false;
11024        
11027        
11028        if (value <= (min + 0.001))
11029            value = min;
11030        
11031        if (value == min)
11032        {
11033            if (destroy_config)
11034            {
11035                bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11036                if (dstr)
11037                {
11039                    this.Delete();
11040                    return true;
11041                }
11042            }
11043            else if (destroy_forced)
11044            {
11046                this.Delete();
11047                return true;
11048            }
11049            
11051        }
11052        
11055        
11057        {
11059            
11060            if (delta)
11062        }
11063        
11065        
11066        return false;
11067    }
11068 
11069    
11071    bool AddQuantity(
float value, 
bool destroy_config = 
true, 
bool destroy_forced = 
false)
 
11072    {   
11074    }
11075    
11077    {
11080    }
11081    
11083    {
11086    }
11087    
11089    override void SetQuantityNormalized(
float value, 
bool destroy_config = 
true, 
bool destroy_forced = 
false)
 
11090    {
11091        float value_clamped = Math.Clamp(value, 0, 1);
11093        SetQuantity(result, destroy_config, destroy_forced);
 
11094    }
11095    
11096    
11099    {
11101    }
11102    
11104    {
11106    }
11107 
11108    
11109
11110
11111
11112
11113
11114
11115
11116    
11118    {
11119        int slot = -1;
11120        if (GetInventory())
11121        {
11122            InventoryLocation il = new InventoryLocation;
11123            GetInventory().GetCurrentInventoryLocation(il);
11125        }
11126        
11128    }
11129    
11131    {
11132        float quantity_max = 0;
11133        
11135        {
11136            if (attSlotID != -1)
11137                quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11138            
11139            if (quantity_max <= 0)
11141        }
11142        
11143        if (quantity_max <= 0)
11145 
11146        return quantity_max;
11147    }
11148    
11150    {
11152    }
11153    
11155    {
11157    }
11158    
11159    
11161    {
11163    }
11164 
11166    {
11168    }
11169    
11171    {
11173    }
11174    
11175    
11177    {
11178        
11179        float weightEx = GetWeightEx();
11180        float special = GetInventoryAndCargoWeight();
11181        return weightEx - special;
11182    }
11183 
11184    
11186    {
11188    }
11189    
11191    {
11193        {
11194            #ifdef DEVELOPER
11195            if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11196            {
11197                WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11199            }
11200            #endif
11201            
11202            return GetQuantity() * GetConfigWeightModified();
 
11203        }
11204        else if (HasEnergyManager())
11205        {
11206            #ifdef DEVELOPER
11207            if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11208            {
11209                WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11210                data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
 
11211            }
11212            #endif
11213            return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11214        }
11215        else
11216        {
11217            #ifdef DEVELOPER
11218            if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11219            {
11220                WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11221                data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + 
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
 
11222            }
11223            #endif
11224            return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
 
11225        }
11226    }
11227
11230    {
11231        int item_count = 0;
11233        
11234        if (GetInventory().GetCargo() != NULL)
11235        {
11236            item_count = GetInventory().GetCargo().GetItemCount();
11237        }
11238        
11239        for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11240        {
11241            Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11242            if (item)
11243                item_count += item.GetNumberOfItems();
11244        }
11245        return item_count;
11246    }
11247    
11250    {
11251        float weight = 0;
11252        float wetness = 1;
11253        if (include_wetness)
11256        {
11257            weight = wetness * m_ConfigWeight;
11258        }
11260        {
11261            weight = 1;
11262        }
11263        return weight;
11264    }
11265    
11266    
11267    
11269    {
11270        if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
 
11271        {
11272            GameInventory inv = GetInventory();
11273            array<EntityAI> items = new array<EntityAI>;
11275            for (int i = 0; i < items.Count(); i++)
11276            {
11278                if (item)
11279                {
11281                }
11282            }
11283        }
11284    }
11285    
11286    
11287 
11288    
11290    {
11291        float energy = 0;
11292        if (HasEnergyManager())
11293        {
11294            energy = GetCompEM().GetEnergy();
11295        }
11296        return energy;
11297    }
11298    
11299    
11301    {
11302        super.OnEnergyConsumed();
11303        
11305    }
11306 
11308    {
11309        super.OnEnergyAdded();
11310        
11312    }
11313    
11314    
11316    {
11317        if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
 
11318        {
11320            {
11321                float energy_0to1 = GetCompEM().GetEnergy0To1();
11323            }
11324        }
11325    }
11326 
11327    
11329    {
11330        return ConfigGetFloat("heatIsolation");
11331    }
11332 
11334    {
11336    }
11337 
11339    {
11340        string paramPath = 
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2", 
GetType(), pIncrementName);
 
11341        if (
GetGame().ConfigIsExisting(paramPath))
 
11343        
11344        return 0.0;
11345    }
11346    
11348    {
11349        string paramPath = 
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2", 
GetType(), pIncrementName);
 
11350        if (
GetGame().ConfigIsExisting(paramPath))
 
11352        
11353        return 0.0;
11354    }
11355    
11356    override void SetWet(
float value, 
bool allow_client = 
false)
 
11357    {
11358        if (!IsServerCheck(allow_client))
11359            return;
11360        
11363        
11365        
11366        m_VarWet = Math.Clamp(value, min, max);
 
11367        
11369        {
11372        }
11373    }
11374    
11375    override void AddWet(
float value)
 
11376    {
11378    }
11379    
11381    {
11383    }
11384    
11386    {
11388    }
11389    
11391    {
11393    }
11394    
11396    {
11398    }
11399    
11401    {
11403    }
11404    
11405    override void OnWetChanged(
float newVal, 
float oldVal)
 
11406    {
11409        if (newLevel != oldLevel)
11410        {
11412        }
11413    }
11414    
11416    {
11417        SetWeightDirty();
11418    }
11419    
11421    {
11422        return GetWetLevelInternal(
m_VarWet);
 
11423    }
11424 
11425    
11426    
11428    {
11430    }
11431    
11433    {
11435    }
11436    
11438    {
11440    }
11441    
11443    {
11445    }
11446    
11447    
11448    
11450    {
11451        if (ConfigIsExisting("itemModelLength"))
11452        {
11453            return ConfigGetFloat("itemModelLength");
11454        }
11455        return 0;
11456    }
11457    
11459    {
11460        if (ConfigIsExisting("itemAttachOffset"))
11461        {
11462            return ConfigGetFloat("itemAttachOffset");
11463        }
11464        return 0;
11465    }
11466    
11467    override void SetCleanness(
int value, 
bool allow_client = 
false)
 
11468    {
11469        if (!IsServerCheck(allow_client)) 
11470            return;
11471        
11473        
11475        
11478    }
11479    
11481    {
11483    }
11484    
11486    {
11487        return true;
11488    }
11489    
11490    
11491    
11492    
11494    {
11496    }
11497    
11499    {
11501    }
11502 
11503    
11504    
11505    
11506    override void SetColor(
int r, 
int g, 
int b, 
int a)
 
11507    {
11513    }
11515    override void GetColor(out 
int r,out 
int g,out 
int b,out 
int a)
 
11516    {
11521    }
11522    
11524    {
11526    }
11527    
11530    {
11531        int r,g,b,a;
11533        r = r/255;
11534        g = g/255;
11535        b = b/255;
11536        a = a/255;
11537        return MiscGameplayFunctions.GetColorString(r, g, b, a);
11538    }
11539    
11540    
11541 
11542    override void SetLiquidType(
int value, 
bool allow_client = 
false)
 
11543    {
11544        if (!IsServerCheck(allow_client))
11545            return;
11546        
11551    }
11552    
11554    {
11555        return ConfigGetInt("varLiquidTypeInit");
11556    }
11557    
11559    {
11561    }
11562    
11564    {
11566            SetFrozen(false);
11567    }
11568
11571    {
11572        player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11573    }
11574    
11575    
11578    {
11579        PlayerBase nplayer;
11580        if (PlayerBase.CastTo(nplayer, player))
11581        {
11583            
11584            nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible()); 
11585        }
11586    }
11587    
11588    
11591    {
11592        PlayerBase nplayer;
11593        if (PlayerBase.CastTo(nplayer,player))
11594        {       
11595            
11596            nplayer.SetEnableQuickBarEntityShortcut(this,false);
11597 
11598        }
11599        
11600        
11601        player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11602        
11603        
11604        if (HasEnergyManager())
11605        {
11606            GetCompEM().UpdatePlugState(); 
11607        }
11608    }
11609 
11610    
11612    {
11613        super.OnPlacementStarted(player);
11614        
11616    }
11617    
11618    override void OnPlacementComplete(Man player, vector position = 
"0 0 0", vector orientation = 
"0 0 0")
 
11619    {
11621        {
11622            m_AdminLog.OnPlacementComplete(player, 
this);
 
11623        }
11624        
11625        super.OnPlacementComplete(player, position, orientation);
11626    }
11627        
11628    
11629    
11630    
11631    
11633    {
11635        {
11636            return true;
11637        }
11638        else
11639        {
11640            return false;
11641        }
11642    }
11643 
11644    
11646    {
11648        {
11650        }
11651    }
11652 
11653    
11655    {
11657    }
11658    
11660    {
11662    }
11663    
11664    override void InsertAgent(
int agent, 
float count = 1)
 
11665    {
11666        if (count < 1)
11667            return;
11668        
11670    }
11671    
11674    {
11676    }
11677    
11678    
11680    {
11682    }
11683    
11684    
11685    
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723    
11724    
11726    {
11728            return false;
11729        return true;
11730    }
11731    
11733    {
11734        
11736    }
11737    
11738    
11741    {
11742        super.CheckForRoofLimited(timeTresholdMS);
11743        
11745        if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11746        {
11747            m_PreviousRoofTestTime = time;
11748            SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11749        }
11750    }
11751    
11752    
11754    {
11756        {
11757            return 0;
11758        }
11759        
11760        if (GetInventory().GetAttachmentSlotsCount() != 0)
11761        {
11762            ItemBase filter = 
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
 
11763            if (filter)
11764                return filter.GetProtectionLevel(type, false, system);
11765            else
11766                return 0;
11767        }
11768 
11769        string subclassPath, entryName;
11770 
11771        switch (type)
11772        {
11774                entryName = "biological";
11775                break;
11777                entryName = "chemical";
11778                break;  
11779            default:
11780                entryName = "biological";
11781                break;
11782        }
11783        
11784        subclassPath = 
"CfgVehicles " + this.
GetType() + 
" Protection ";
 
11785        
11787    }
11788    
11789    
11790    
11793    {
11794        if (!IsMagazine())
11796 
11798    }
11799    
11800    
11801    
11802    
11803    
11808    {
11809        return true;
11810    }
11811 
11813    {
11815    }
11816    
11817    
11818    
11819    
11820    
11822    {
11823        if (parent)
11824        {
11825            if (parent.IsInherited(DayZInfected))
11826                return true;
11827 
11828            if (!parent.IsRuined())
11829                return true;
11830        }
11831        
11832        return true;
11833    }   
11834    
11836    {
11837        if (!super.CanPutAsAttachment(parent))
11838        {
11839            return false;
11840        }
11841        
11842        if (!IsRuined() && !parent.IsRuined())
11843        {
11844            return true;
11845        }
11846 
11847        return false;
11848    }
11849 
11851    {
11852        
11853        
11854        
11855        
11856        return super.CanReceiveItemIntoCargo(item);
11857    }
11858 
11860    {
11861        
11862        
11863        
11864        
11865        GameInventory attachmentInv = attachment.GetInventory();
11867        {
11868            if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11869                return false;
11870        }
11871        
11872        InventoryLocation loc = new InventoryLocation();
11873        attachment.GetInventory().GetCurrentInventoryLocation(loc);
11874        if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
 
11875            return false;
11876        
11877        return super.CanReceiveAttachment(attachment, slotId);
11878    }
11879    
11881    {
11882        if (!super.CanReleaseAttachment(attachment))
11883            return false;
11884        
11885        return GetInventory().AreChildrenAccessible();
11886    }
11887    
11888    
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906    
11907    
11909    {
11910        int id = muzzle_owner.GetMuzzleID();
11911        array<ref WeaponParticlesOnFire> WPOF_array = 
m_OnFireEffect.Get(
id);
 
11912        
11913        if (WPOF_array)
11914        {
11915            for (int i = 0; i < WPOF_array.Count(); i++)
11916            {
11917                WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11918                
11919                if (WPOF)
11920                {
11921                    WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11922                }
11923            }
11924        }
11925    }
11926    
11927    
11929    {
11930        int id = muzzle_owner.GetMuzzleID();
11932        
11933        if (WPOBE_array)
11934        {
11935            for (int i = 0; i < WPOBE_array.Count(); i++)
11936            {
11937                WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11938                
11939                if (WPOBE)
11940                {
11941                    WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11942                }
11943            }
11944        }
11945    }
11946    
11947    
11949    {
11950        int id = muzzle_owner.GetMuzzleID();
11951        array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11952        
11953        if (WPOOH_array)
11954        {
11955            for (int i = 0; i < WPOOH_array.Count(); i++)
11956            {
11957                WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11958                
11959                if (WPOOH)
11960                {
11961                    WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11962                }
11963            }
11964        }
11965    }
11966    
11967    
11969    {
11970        int id = muzzle_owner.GetMuzzleID();
11971        array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11972        
11973        if (WPOOH_array)
11974        {
11975            for (int i = 0; i < WPOOH_array.Count(); i++)
11976            {
11977                WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11978                
11979                if (WPOOH)
11980                {
11981                    WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11982                }
11983            }
11984        }
11985    }
11986    
11987    
11989    {
11990        int id = muzzle_owner.GetMuzzleID();
11991        array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11992        
11993        if (WPOOH_array)
11994        {
11995            for (int i = 0; i < WPOOH_array.Count(); i++)
11996            {
11997                WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11998                
11999                if (WPOOH)
12000                {
12001                    WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12002                }
12003            }
12004        }
12005    }
12006    
12007    
12008    
12010    {
12012        {   
12013            return true;
12014        }
12015        
12016        return false;
12017    }
12018    
12020    {
12022        {
12023            return true;    
12024        }
12025        
12026        return false;
12027    }
12028    
12030    {
12032        {
12033            return true;
12034        }
12035            
12036        return false;
12037    }
12038    
12040    {
12041        return false;
12042    }
12043    
12046    {
12047        return UATimeSpent.DEFAULT_DEPLOY;
12048    }
12049    
12050 
12051    
12052    
12054    {
12056        SetSynchDirty();
12057    }
12058 
12060    {
12062    }
12063    
12064    
12066    {
12067        return false;
12068    }
12069
12072    {
12073        string att_type = "None";
12074 
12075        if (ConfigIsExisting("soundAttType"))
12076        {
12077            att_type = ConfigGetString("soundAttType");
12078        }
12079        
12081    }
12082    
12084    {   
12086    }
12087    
12088    
12089    
12090    
12091    
12097            
12099    {
12102        
12104    }
12105    
12106    
12108    {
12110            return;
12111 
12113 
12116        
12119        
12120        SoundParameters params = new SoundParameters();
12124    }
12125    
12126    
12128    {
12130            return;
12131        
12133        SetSynchDirty();
12134        
12137    }
12138    
12139    
12141    {
12143            return;
12144        
12146        SetSynchDirty();
12147        
12150    }
12151    
12153    {
12155    }
12156    
12158    {
12160    }
12161                
12164    {
12165        if (!
GetGame().IsDedicatedServer())
 
12166        {
12167            if (ConfigIsExisting("attachSoundSet"))
12168            {
12169                string cfg_path = "";
12170                string soundset = "";
12171                string type_name = 
GetType();
 
12172                
12175                ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12176                ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12177                
12178                if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12179                {
12180                    for (int i = 0; i < cfg_soundset_array.Count(); i++)
12181                    {
12182                        if (cfg_slot_array[i] == slot_type)
12183                        {
12184                            soundset = cfg_soundset_array[i];
12185                            break;
12186                        }
12187                    }
12188                }
12189                
12190                if (soundset != "")
12191                {
12192                    EffectSound sound = SEffectManager.PlaySound(soundset, 
GetPosition());
 
12194                }
12195            }
12196        }
12197    }
12198    
12200    {
12201        
12202    }
12203    
12204    void OnApply(PlayerBase player);
 
12205    
12207    {
12208        return 1.0;
12209    };
12210    
12212    {
12214    }
12215    
12217    {
12219    }
12220    
12222    
12224    {
12225        SetDynamicPhysicsLifeTime(0.01);
12227    }
12228    
12230    {
12231        array<string> zone_names = new array<string>;
12232        GetDamageZones(zone_names);
12233        for (int i = 0; i < zone_names.Count(); i++)
12234        {
12235            SetHealthMax(zone_names.Get(i),"Health");
12236        }
12237        SetHealthMax("","Health");
12238    }
12239    
12242    {
12243        float global_health = GetHealth01("","Health");
12244        array<string> zones = new array<string>;
12245        GetDamageZones(zones);
12246        
12247        for (int i = 0; i < zones.Count(); i++)
12248        {
12249            SetHealth01(zones.Get(i),"Health",global_health);
12250        }
12251    }
12252    
12255    {
12256        return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12257    }
12258    
12260    {
12261        if (!hasRootAsPlayer)
12262        {
12263            if (refParentIB)
12264            {
12265                
12266                if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet < 
m_VarWetMax))
 
12267                    AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
 
12268                
12269                else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet < 
m_VarWetMax))
 
12270                    AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
 
12271                
12274            }
12275            else
12276            {
12277                
12280            }
12281        }
12282    }
12283    
12285    {
12287        {
12288            float target = 
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
 
12289            if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
 
12290            {
12291                float heatPermCoef = 1.0;
12293                while (ent)
12294                {
12295                    heatPermCoef *= ent.GetHeatPermeabilityCoef();
12296                    ent = ent.GetHierarchyParent();
12297                }
12298                
12299                SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
 
12300            }
12301        }
12302    }
12303    
12305    {
12306        
12307        EntityAI parent = GetHierarchyParent();
 
12308        if (!parent)
12309        {
12310            hasParent = false;
12311            hasRootAsPlayer = false;
12312        }
12313        else
12314        {
12315            hasParent = true;
12316            hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12317            refParentIB = 
ItemBase.Cast(parent);
 
12318        }
12319    }
12320    
12321    protected void ProcessDecay(
float delta, 
bool hasRootAsPlayer)
 
12322    {
12323        
12324    }
12325    
12327    {
12328        
12329        return false;
12330    }
12331    
12333    {
12334        
12335        
12336        return false;
12337    }
12338    
12340    {
12341        
12342        return false;
12343    }
12344    
12347    {
12348        return !GetIsFrozen() && 
IsOpen();
 
12349    }
12350    
12352    {
12353        bool hasParent = false, hasRootAsPlayer = false;
12355        
12356        bool wwtu = 
g_Game.IsWorldWetTempUpdateEnabled();
 
12357        bool foodDecay = 
g_Game.IsFoodDecayEnabled();
 
12358        
12359        if (wwtu || foodDecay)
12360        {
12364            
12365            if (processWetness || processTemperature || processDecay)
12366            {
12368            
12369                if (processWetness)
12370                    ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);                    
 
12371                
12372                if (processTemperature)
12374            
12375                if (processDecay)
12376                    ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
 
12377            }
12378        }
12379    }
12380    
12383    {
12385    }
12386    
12388    {
12391        
12392        return super.GetTemperatureFreezeThreshold();
12393    }
12394    
12396    {
12399        
12400        return super.GetTemperatureThawThreshold();
12401    }
12402    
12404    {
12407        
12408        return super.GetItemOverheatThreshold();
12409    }
12410    
12412    {
12414            return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
 
12415        
12416        return super.GetTemperatureFreezeTime();
12417    }
12418    
12420    {
12422            return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
 
12423        
12424        return super.GetTemperatureThawTime();
12425    }
12426    
12431    
12433    {
12434        return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12435    }
12436    
12438    {
12439        MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12440    }
12441    
12444    {
12446    }
12447    
12449    {
12451    }
12452    
12454    {
12456    }
12457    
12460    {
12461        return null;
12462    }
12463    
12466    {
12467        return false;
12468    }
12469    
12471    {
12473        {
12476            if (!trg)
12477            {
12479                explosive = this;
12480            }
12481            
12482            explosive.PairRemote(trg);
12484            
12485            int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12486            trg.SetPersistentPairID(persistentID);
12487            explosive.SetPersistentPairID(persistentID);
12488            
12489            return true;
12490        }
12491        return false;
12492    }
12493    
12496    {
12497        float ret = 1.0;
12500        ret *= GetHealth01();
12501        
12502        return ret;
12503    }
12504 
12505    #ifdef DEVELOPER
12506    override void SetDebugItem()
12507    {
12508        super.SetDebugItem();
12509        _itemBase = this;
12510    }
12511    
12513    {
12514        string text = super.GetDebugText();
12515        
12517        text += 
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
 
12518 
12519        return text;
12520    }
12521    #endif
12522    
12524    {
12525        return true;
12526    }
12527    
12529    
12531    
12533    {
12536    }
12537    
12538    
12546    
12562}
12563 
12565{
12567    if (entity)
12568    {
12569        bool is_item = entity.IsInherited(
ItemBase);
 
12570        if (is_item && full_quantity)
12571        {
12574        }
12575    }
12576    else
12577    {
12579        return NULL;
12580    }
12581    return entity;
12582}
12583 
12585{
12586    if (item)
12587    {
12588        if (health > 0)
12589            item.SetHealth("", "", health);
12590        
12591        if (item.CanHaveTemperature())
12592        {
12594            if (item.CanFreeze())
12595                item.SetFrozen(false);
12596        }
12597        
12598        if (item.HasEnergyManager())
12599        {
12600            if (quantity >= 0)
12601            {       
12602                item.GetCompEM().SetEnergy0To1(quantity);
12603            }
12604            else
12605            {
12607            }
12608        }
12609        else if (item.IsMagazine())
12610        {
12611            Magazine mag = Magazine.Cast(item);
12612            if (quantity >= 0)
12613            {       
12614                mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12615            }
12616            else
12617            {       
12619            }
12620            
12621        }
12622        else
12623        {
12624            if (quantity >= 0)
12625            {       
12626                item.SetQuantityNormalized(quantity, false);
12627            }
12628            else
12629            {
12631            }
12632            
12633        }
12634    }
12635}
12636 
12637#ifdef DEVELOPER
12639#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.