Send message to owner player in green color. 
 7582{
 7584    {
 7585        return true;
 7586    }
 7587};
 7588 
 7589
 7590 
 7592{   
 7596    
 7598    
 7601    
 7602    
 7603    
 7604    
 7605    
 7614    
 7620    
 7625    
 7630    
 7651    protected bool m_IsResultOfSplit 
 7652    
 7654    
 7659    
 7660    
 7661    
 7663    
 7667    
 7668    
 7669    
 7671
 7674    
 7675    
 7676    
 7682    
 7683    
 7691    
 7694    
 7695    
 7697    
 7698    
 7700 
 7701    
 7706    
 7707    
 7712    
 7713    
 7715    
 7716    
 7718    {
 7723        
 7724        if (!
GetGame().IsDedicatedServer())
 
 7725        {
 7727            {
 7729                
 7731                {
 7733                }
 7734            }
 7735            
 7738        }
 7739        
 7740        m_OldLocation = null;
 7741        
 7743        {
 7745        }
 7746        
 7747        if (ConfigIsExisting("headSelectionsToHide"))
 7748        {
 7751        }
 7752        
 7754        if (ConfigIsExisting("hideSelectionsByinventorySlot"))
 7755        {
 7757        }
 7758        
 7760 
 7761        m_IsResultOfSplit = false;
 7762        
 7764    }
 7765    
 7767    {
 7768        super.InitItemVariables();
 7769        
 7775        m_Count = ConfigGetInt(
"count");
 
 7776        
 7779        
 7784        
 7787        
 7792        
 7804        
 7808        
 7809        
 7812        if (ConfigIsExisting("canBeSplit"))
 7813        {
 7816        }
 7817        
 7819        if (ConfigIsExisting("itemBehaviour"))
 7821        
 7822        
 7825        RegisterNetSyncVariableInt("m_VarLiquidType");
 7826        RegisterNetSyncVariableInt("m_Cleanness",0,1);
 7827        
 7828        RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
 7829        RegisterNetSyncVariableFloat("m_ImpactSpeed");
 7830        RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
 7831        
 7832        RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
 7833        RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
 7834        RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
 7835        RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
 7836        
 7837        RegisterNetSyncVariableBool("m_IsBeingPlaced");
 7838        RegisterNetSyncVariableBool("m_IsTakeable");
 7839        RegisterNetSyncVariableBool("m_IsHologram");
 7840        
 7843        {
 7846        }
 7847        
 7849        
 7851        if (ConfigIsExisting("temperaturePerQuantityWeight"))
 7853            
 7854    }
 7855    
 7857    {
 7859    }
 7860 
 7862    {
 7865        {
 7870        }
 7871    }
 7872    
 7873    override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
 
 7874    {
 7876        {
 7879        }
 7880        
 7882    }
 7883    
 7885    {
 7891    }
 7892    
 7894    
 7896    {
 7898 
 7899        if (!action)
 7900        {
 7901            Debug.LogError(
"Action " + actionName + 
" dosn't exist!");
 
 7902            return;
 7903        }       
 7904        
 7906        if (!ai)
 7907        {
 7909            return;
 7910        }
 7911        
 7913        if (!action_array)
 7914        {
 7915            action_array = new array<ActionBase_Basic>;
 7917        }
 7918        if (LogManager.IsActionLogEnable())
 7919        {
 7920            Debug.ActionLog(action.ToString() + 
" -> " + ai, 
this.ToString() , 
"n/a", 
"Add action");
 
 7921        }
 7922        
 7923        if (action_array.Find(action) != -1)
 7924        {
 7925            Debug.Log(
"Action " + action.Type() + 
" already added to " + 
this + 
", skipping!");
 
 7926        }
 7927        else
 7928        {
 7929            action_array.Insert(action);
 7930        }
 7931    }
 7932    
 7934    {
 7936        ActionBase action = player.GetActionManager().GetAction(actionName);
 7939        
 7940        if (action_array)
 7941        {
 7942            action_array.RemoveItem(action);
 7943        }
 7944    }
 7945    
 7946    
 7947    
 7949    {
 7950        ActionOverrideData overrideData = new ActionOverrideData();
 7954        
 7956        if (!actionMap) 
 7957        {
 7960        }
 7961        
 7962        actionMap.Insert(this.
Type(), overrideData); 
 
 7963        
 7964    }
 7965    
 7967    
 7969    
 7970    
 7972    {
 7975        
 7978        
 7979        string config_to_search = "CfgVehicles";
 7980        string muzzle_owner_config;
 7981        
 7983        {
 7984            if (IsInherited(Weapon))
 7985                config_to_search = "CfgWeapons";    
 7986            
 7987            muzzle_owner_config = config_to_search + 
" " + 
GetType() + 
" ";
 
 7988            
 7989            string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
 7990            
 7992            
 7993            if (config_OnFire_subclass_count > 0)
 7994            {
 7995                array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
 7996                
 7997                for (int i = 0; i < config_OnFire_subclass_count; i++)
 7998                {
 7999                    string particle_class = "";
 8001                    string config_OnFire_entry = config_OnFire_class + particle_class;
 8002                    WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
 8003                    WPOF_array.Insert(WPOF);
 8004                }
 8005                
 8006                
 8008            }
 8009        }
 8010        
 8012        {
 8013            config_to_search = "CfgWeapons"; 
 8014            muzzle_owner_config = config_to_search + 
" " + 
GetType() + 
" ";
 
 8015            
 8016            string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
 8017            
 8019            
 8020            if (config_OnBulletCasingEject_count > 0  &&  IsInherited(Weapon))
 8021            {
 8022                array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
 8023                
 8024                for (i = 0; i < config_OnBulletCasingEject_count; i++)
 8025                {
 8026                    string particle_class2 = "";
 8028                    string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
 8029                    WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
 8030                    WPOBE_array.Insert(WPOBE);
 8031                }
 8032                
 8033                
 8035            }
 8036        }
 8037    }
 8038    
 8039    
 8041    {
 8044        
 8046        {
 8047            string config_to_search = "CfgVehicles";
 8048            
 8049            if (IsInherited(Weapon))
 8050                config_to_search = "CfgWeapons";
 8051            
 8052            string muzzle_owner_config = config_to_search + 
" " + 
GetType() + 
" ";
 
 8053            string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
 8054            
 8055            if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
 
 8056            {
 8057                
 8059                
 8061                {
 8063                    string error = 
"Error reading config " + 
GetType() + 
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
 
 8065                    return;
 8066                }
 8067                
 8070                
 8071                
 8072                
 8074                array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
 8075                
 8076                for (int i = 0; i < config_OnOverheating_subclass_count; i++)
 8077                {
 8078                    string particle_class = "";
 8080                    string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
 8082                    
 8083                    if (entry_type == CT_CLASS)
 8084                    {
 8085                        WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
 8086                        WPOOH_array.Insert(WPOF);
 8087                    }
 8088                }
 8089                
 8090                
 8092            }
 8093        }
 8094    }
 8095    
 8097    {
 8099    }
 8100    
 8102    {
 8104        {
 8106            
 8109            
 8112            
 8113            CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
 
 8114        }
 8115    }
 8116    
 8118    {
 8120            UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
 
 8121        
 8123            StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
 
 8124        
 8126            StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
 
 8127        
 8129        {
 8131        }
 8132    }
 8133    
 8135    {
 8137    }
 8138    
 8140    {
 8143        else
 8145        
 8147        {
 8150        }
 8151        else
 8152        {
 8155            
 8158        }
 8159        
 8161    }
 8162 
 8164    {
 8166        ItemBase.PlayOverheatingParticles(
this, ammoType, 
this, suppressor, 
"CfgWeapons");
 
 8167    }
 8168    
 8170    {
 8172        ItemBase.UpdateOverheatingParticles(
this, ammoType, 
this, suppressor, 
"CfgWeapons");
 
 8174    }
 8175    
 8177    {
 8179        ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
 
 8180    }
 8181    
 8183    {
 8186        
 8187        OverheatingParticle OP = new OverheatingParticle();
 8192        
 8194    }
 8195    
 8197    {
 8200        
 8201        return -1;
 8202    }
 8203    
 8205    {
 8207        {
 8210            
 8211            for (int i = count; i > 0; --i)
 8212            {
 8213                int id = i - 1;
 8216                
 8219                
 8220                if (overheat_coef < overheat_min  &&  overheat_coef >= overheat_max)
 8221                {
 8222                    if (p)
 8223                    {
 8226                    }
 8227                }
 8228            }
 8229        }
 8230    }
 8231    
 8233    {
 8235        {
 8237            {
 8238                int id = i - 1;
 8240                
 8241                if (OP)
 8242                {
 8244                    
 8245                    if (p)
 8246                    {
 8248                    }
 8249                    
 8250                    delete OP;
 8251                }
 8252            }
 8253            
 8256        }
 8257    }
 8258    
 8261    {
 8262        return 0.0;
 8263    }
 8264    
 8265    
 8267    {
 8268        return 250;
 8269    }
 8270    
 8272    {
 8273        return 0;
 8274    }
 8275    
 8278    {
 8280            return true;
 8281        
 8282        return false;
 8283    }
 8284    
 8287    {
 8290        
 8292        {
 8294        }
 8295        else 
 8296        {
 8297            
 8299        }
 8300        
 8302    }
 8303    
 8310    {
 8311        return -1;
 8312    }
 8313    
 8314    
 8315    
 8316    
 8318    {
 8320        {
 8322            int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
 8323 
 8324            if (r_index >= 0)
 8325            {
 8326                    InventoryLocation r_il = new InventoryLocation;
 8327                    player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
 8328 
 8329                    player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
 8332                    {
 8333                        r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
 
 8334                    }
 8336                    {
 8337                        r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
 
 8338                    }
 8339            
 8340            }
 8341            
 8342            player.GetHumanInventory().ClearUserReservedLocation(this);
 8343        }
 8344        
 8347    }
 8348 
 8349    
 8350    
 8351    
 8353    {
 8354        return ItemBase.m_DebugActionsMask; 
 
 8355    }
 8356    
 8358    {
 8359        return ItemBase.m_DebugActionsMask & mask;  
 
 8360    }
 8361    
 8363    {
 8364        ItemBase.m_DebugActionsMask = mask;
 
 8365    }
 8366    
 8368    {
 8369        ItemBase.m_DebugActionsMask |= mask;
 
 8370    }
 8371    
 8373    {
 8374        ItemBase.m_DebugActionsMask &= ~mask;
 
 8375    }
 8376    
 8378    {
 8380        {
 8382        }
 8383        else
 8384        {
 8386        }
 8387    }
 8388    
 8389    
 8391    {
 8392        if (GetEconomyProfile())
 8393        {
 8394            float q_max = GetEconomyProfile().GetQuantityMax();
 8395            if (q_max > 0)
 8396            {
 8397                float q_min = GetEconomyProfile().GetQuantityMin();
 8398                float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
 8399                
 8401                {
 8402                    ComponentEnergyManager comp = GetCompEM();
 8404                    {
 8406                    }
 8407                }
 8409                {
 8411                    
 8412                }
 8413                
 8414            }
 8415        }
 8416    }
 8417    
 8420    {
 8421        EntityAI parent = GetHierarchyParent();
 
 8422        
 8423        if (parent)
 8424        {
 8425            InventoryLocation inventory_location_to_lock = new InventoryLocation;
 8426            GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
 8427            parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(), 
true);
 
 8428        }
 8429    }
 8430    
 8433    {
 8434        EntityAI parent = GetHierarchyParent();
 
 8435        
 8436        if (parent)
 8437        {
 8438            InventoryLocation inventory_location_to_unlock = new InventoryLocation;
 8439            GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
 8440            parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(), 
false);
 
 8441        }
 8442    }
 8443    
 8445    {
 8446        
 8447
 8448
 8449
 8451        
 8453        {
 8454            if (ScriptInputUserData.CanStoreInputUserData())
 8455            {
 8456                ScriptInputUserData ctx = new ScriptInputUserData;
 8462                ctx.
Write(use_stack_max);
 
 8465                
 8467                {
 8468                    GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
 
 8469                }
 8470            }
 8471        }
 8472        else if (!
GetGame().IsMultiplayer())
 
 8473        {
 8475        }
 8476    }
 8477    
 8479    {
 8481    }
 8482    
 8484    {
 8486    }
 8487    
 8489    {
 8491    }
 8492    
 8494    {
 8495        
 8496        return false;
 8497    }
 8498    
 8500    {
 8501        return false;
 8502    }
 8503    
 8507    {
 8508        return false;
 8509    }
 8510    
 8512    {
 8513        return "";
 8514    }
 8515    
 8517    
 8519    {
 8520        return false;
 8521    }
 8522    
 8524    {
 8525        return true;
 8526    }
 8527    
 8528    
 8529    
 8531    {
 8532        return true;
 8533    }
 8534    
 8536    {
 8537        return true;
 8538    }
 8539    
 8541    {
 8542        PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
 
 8544    }
 8545    
 8547    {
 8549    }
 8550    
 8552    {
 8554        if (!is_being_placed)
 8556        SetSynchDirty();
 8557    }
 8558    
 8559    
 8561    
 8563    {
 8565    }
 8566    
 8568    {
 8570    }
 8571    
 8573    {
 8574        return 1;
 8575    }
 8576    
 8578    {
 8579        return false;
 8580    }
 8581    
 8583    {
 8585        SetSynchDirty();
 8586    }
 8587    
 8588
 8589
 8590
 8591
 8592
 8593
 8594
 8595
 8596
 8597
 8598
 8599
 8600
 8601
 8602
 8603
 8604
 8605
 8606
 8607
 8608
 8609
 8610
 8611
 8612
 8613
 8614
 8615
 8616 
 8617
 8618
 8619    
 8620    
 8621    
 8623    {
 8624        super.OnMovedInsideCargo(container);
 8625        
 8626        MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
 8627    }
 8628    
 8629    override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
 
 8630    {
 8631        super.EEItemLocationChanged(oldLoc,newLoc);
 8632        
 8633        PlayerBase new_player = null;
 8634        PlayerBase old_player = null;
 8635        
 8636        if (newLoc.GetParent())
 8637            new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
 8638        
 8639        if (oldLoc.GetParent())
 8640            old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
 8641        
 8643        {
 8644            int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
 8645 
 8646            if (r_index >= 0)
 8647            {
 8648                    InventoryLocation r_il = new InventoryLocation;
 8649                    old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
 8650 
 8651                    old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
 8654                    {
 8655                        r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
 
 8656                    }
 8658                    {
 8659                        r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
 
 8660                    }
 8661            
 8662            }
 8663        }
 8664        
 8666        {
 8667            if (new_player)
 8668                new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
 8669            
 8670            if (new_player == old_player)
 8671            {
 8672                
 8673                if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
 8674                {
 8676                    {
 8677                        if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
 8678                        {
 8679                            new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
 8680                        }
 8681                    }
 8682                    else
 8683                    {
 8684                        new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
 8685                    }
 8686                }
 8687                
 8688                if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
 8689                {
 8690                    int type = oldLoc.GetType();
 8692                    {
 8693                        oldLoc.GetParent().GetOnSetLock().Invoke(this);
 8694                    }
 8696                    {
 8697                        oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
 8698                    }
 8699                }
 8700                if (!m_OldLocation)
 8701                {
 8702                    m_OldLocation = new InventoryLocation;
 8703                }
 8704                m_OldLocation.Copy(oldLoc);
 8705            }
 8706            else
 8707            {
 8708                if (m_OldLocation)
 8709                {
 8710                    m_OldLocation.Reset();
 8711                }
 8712            }
 8713            
 8715        }
 8716        else
 8717        {
 8718            if (new_player)
 8719            {
 8720                int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
 8721                if (res_index >= 0)
 8722                {
 8723                    InventoryLocation il = new InventoryLocation;
 8724                    new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
 8726                    new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
 8729                    {
 8730                        il.
GetParent().GetOnReleaseLock().Invoke(it);
 
 8731                    }
 8733                    {
 8735                    }
 8736                    
 8737                }
 8738            }
 8740            {
 8741                
 8743            }
 8744        
 8745            if (m_OldLocation)
 8746            {
 8747                m_OldLocation.Reset();
 8748            }
 8749        }
 8750    }
 8751    
 8752    override void EOnContact(IEntity other, Contact extra)
 
 8753    {
 8755        {
 8756            int liquidType = -1;
 8758            if (impactSpeed > 0.0)
 8759            {
 8761                #ifndef SERVER
 8763                #else
 8765                SetSynchDirty();
 8766                #endif
 8768            }
 8769        }
 8770        
 8771        #ifdef SERVER
 8772        if (GetCompEM() && GetCompEM().IsPlugged())
 8773        {
 8774            if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
 
 8775                GetCompEM().UnplugThis();
 8776        }
 8777        #endif
 8778    }
 8779    
 8781    
 8783    {
 8785    }
 8786    
 8788    {
 8789        
 8790    }
 8791    
 8793    {
 8794        super.OnItemLocationChanged(old_owner, new_owner);
 8795                
 8796        PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
 8797        PlayerBase playerNew = PlayerBase.Cast(new_owner);
 8798        
 8799        if (!relatedPlayer && playerNew)
 8800            relatedPlayer = playerNew;
 8801        
 8802        if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
 8803        {
 8805            if (actionMgr)
 8806            {
 8807                ActionBase currentAction = actionMgr.GetRunningAction();
 8808                if (currentAction)
 8810            }
 8811        }
 8812        
 8813        Man ownerPlayerOld = null;
 8814        Man ownerPlayerNew = null;
 8815            
 8816        if (old_owner)   
 8817        {
 8818            if (old_owner.
IsMan())
 
 8819            {
 8820                ownerPlayerOld = Man.Cast(old_owner);
 8821            }
 8822            else
 8823            {
 8824                ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
 8825            }
 8826        }
 8827        else 
 8828        {
 8830            {
 8832                
 8833                if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
 
 8834                {
 8835                    GetCompEM().UnplugThis();
 8836                }
 8837            }
 8838        }
 8839        
 8840        if (new_owner)
 8841        {
 8842            if (new_owner.
IsMan())
 
 8843            {
 8844                ownerPlayerNew = Man.Cast(new_owner);
 8845            }
 8846            else
 8847            {
 8848                ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
 8849            }
 8850        }
 8851        
 8852        if (ownerPlayerOld != ownerPlayerNew)
 8853        {
 8854            if (ownerPlayerOld)
 8855            {
 8856                array<EntityAI> subItemsExit = new array<EntityAI>;
 8858                for (int i = 0; i < subItemsExit.Count(); i++)
 8859                {
 8862                }
 8863            }
 8864 
 8865            if (ownerPlayerNew)
 8866            {
 8867                array<EntityAI> subItemsEnter = new array<EntityAI>;
 8869                for (int j = 0; j < subItemsEnter.Count(); j++)
 8870                {
 8873                }
 8874            }
 8875        }
 8876        else if (ownerPlayerNew != null)
 8877        {
 8878            PlayerBase nplayer;
 8879            if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
 8880            {
 8881                array<EntityAI> subItemsUpdate = new array<EntityAI>;
 8883                for (int k = 0; k < subItemsUpdate.Count(); k++)
 8884                {
 8886                    itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
 8887                }
 8888            }
 8889        }
 8890        
 8891        if (old_owner)
 8892            old_owner.OnChildItemRemoved(this);
 8893        if (new_owner)
 8894            new_owner.OnChildItemReceived(this);
 8895    }
 8896 
 8897    
 8899    {
 8900        super.EEDelete(parent);
 8901        PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
 8902        if (player)
 8903        {
 8905            
 8906            if (player.IsAlive())
 8907            {
 8908                int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
 8909                if (r_index >= 0)
 8910                {           
 8911                    InventoryLocation r_il = new InventoryLocation;
 8912                    player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
 8913    
 8914                    player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
 8917                    {
 8918                        r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
 
 8919                    }
 8921                    {
 8922                        r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
 
 8923                    }
 8924                
 8925                }
 8926                
 8927                player.RemoveQuickBarEntityShortcut(this);
 8928            }
 8929        }
 8930    }
 8931    
 8933    {
 8934        super.EEKilled(killer);
 8935
 8938        {
 8939            if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
 
 8940            {
 8941                if (IsMagazine())
 8942                {
 8943                    if (Magazine.Cast(this).GetAmmoCount() > 0)
 8944                    {
 8946                    }
 8947                }
 8948                else
 8949                {
 8951                }
 8952            }
 8953        }
 8954    }
 8955    
 8957    {
 8958        MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
 8959        
 8960        super.OnWasAttached(parent, slot_id);
 8961        
 8964        
 8966    }
 8967    
 8969    {
 8970        super.OnWasDetached(parent, slot_id);
 8971        
 8974    }
 8975    
 8977    {
 8978        int idx;
 8981        
 8982        ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
 8983        if (inventory_slots.Count() < 1) 
 8984        {
 8985            inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
 8986            attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
 8987        }
 8988        else 
 8989        {
 8990            ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
 8991        }
 8992        
 8993        idx = inventory_slots.Find(slot);
 8994        if (idx < 0)
 8995            return "";
 8996        
 8997        return attach_types.Get(idx);
 8998    }
 8999    
 9001    {
 9002        int idx = -1;
 9003        string slot;
 9004        
 9007        
 9008        this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
 9009        if (inventory_slots.Count() < 1) 
 9010        {
 9011            inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
 9012            detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
 9013        }
 9014        else 
 9015        {
 9016            this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
 9017            if (detach_types.Count() < 1)
 9018                detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
 9019        }
 9020        
 9021        for (int i = 0; i < inventory_slots.Count(); i++)
 9022        {
 9023            slot = inventory_slots.Get(i);
 9024        }
 9025        
 9026        if (slot != "")
 9027        {
 9028            if (detach_types.Count() == 1)
 9029                idx = 0;
 9030            else
 9031                idx = inventory_slots.Find(slot);
 9032        }
 9033        if (idx < 0)
 9034            return "";
 9035    
 9036        return detach_types.Get(idx);
 9037    }
 9038    
 9040    {
 9041        
 9043        
 9044        
 9045        float min_time = 1;
 9046        float max_time = 3;
 9047        float delay = Math.RandomFloat(min_time, max_time);
 9048        
 9049        explode_timer.Run(delay, this, "DoAmmoExplosion");
 9050    }
 9051    
 9053    {
 9054        Magazine magazine = Magazine.Cast(this);
 9055        int pop_sounds_count = 6;
 9056        string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
 9057        
 9058        
 9059        int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
 9060        string sound_name = pop_sounds[ sound_idx ];
 9062        
 9063        
 9064        magazine.ServerAddAmmoCount(-1);
 9065        
 9066        
 9067        float min_temp_to_explode   = 100;      
 9068                
 9069        if (magazine.GetAmmoCount() > 0 && 
GetTemperature() >= min_temp_to_explode)   
 
 9070        {
 9072        }
 9073    }
 9074    
 9075    
 9076    override void EEHitBy(TotalDamageResult damageResult, 
int damageType, 
EntityAI source, 
int component, 
string dmgZone, 
string ammo, vector modelPos, 
float speedCoef)
 
 9077    {
 9078        super.EEHitBy(damageResult, damageType, source, 
component, dmgZone, ammo, modelPos, speedCoef);
 
 9079        
 9080        const int CHANCE_DAMAGE_CARGO = 4;
 9081        const int CHANCE_DAMAGE_ATTACHMENT = 1;
 9082        const int CHANCE_DAMAGE_NOTHING = 2;
 9083        
 9085        {
 9086            float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
 
 9087            int chances;
 9088            int rnd;
 9089            
 9090            if (GetInventory().GetCargo())
 9091            {
 9092                chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
 9093                rnd = Math.RandomInt(0,chances);
 9094                
 9095                if (rnd < CHANCE_DAMAGE_CARGO)
 9096                {
 9098                }
 9099                else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
 9100                {
 9102                }
 9103            }
 9104            else
 9105            {
 9106                chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
 9107                rnd = Math.RandomInt(0,chances);
 9108                
 9109                if (rnd < CHANCE_DAMAGE_ATTACHMENT)
 9110                {
 9112                }
 9113            }
 9114        }
 9115    }
 9116    
 9118    {
 9119        if (GetInventory().GetCargo())
 9120        {
 9121            int item_count = GetInventory().GetCargo().GetItemCount();
 9122            if (item_count > 0)
 9123            {
 9124                int random_pick = Math.RandomInt(0, item_count);
 9126                if (!item.IsExplosive())
 9127                {
 9128                    item.AddHealth("","",damage);
 9129                    return true;
 9130                }
 9131            }
 9132        }
 9133        return false;
 9134    }
 9135    
 9137    {
 9138        int attachment_count = GetInventory().AttachmentCount();
 9139        if (attachment_count > 0)
 9140        {
 9141            int random_pick = Math.RandomInt(0, attachment_count);
 9142            ItemBase attachment = 
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
 
 9143            if (!attachment.IsExplosive())
 9144            {
 9145                attachment.AddHealth("","",damage);
 9146                return true;
 9147            }
 9148        }
 9149        return false;
 9150    }
 9151    
 9153    {
 9155    }
 9156    
 9158    {
 9160            return GetInventory().CanRemoveEntity();
 9161        
 9162        return false;
 9163    }
 9164 
 9166    {
 9167        
 9169            return false;
 9170 
 9171        
 9173            return false;
 9174 
 9175        
 9176        
 9178        if (delta == 0)
 9179            return false;
 9180 
 9181        
 9182        return true;
 9183    }
 9184    
 9186    {       
 9188        {
 9189            if (ScriptInputUserData.CanStoreInputUserData())
 9190            {
 9191                ScriptInputUserData ctx = new ScriptInputUserData;
 9196                ctx.
Write(destination_entity);
 
 9200            }
 9201        }
 9202        else if (!
GetGame().IsMultiplayer())
 
 9203        {
 9205        }
 9206    }
 9207 
 9209    {       
 9210        float split_quantity_new;
 9214        InventoryLocation loc = new InventoryLocation;
 9215        
 9216        if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
 9217        {
 9219                split_quantity_new = stack_max;
 9220            else
 9222 
 9224            {
 9225                new_item = 
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
 
 9226                if (new_item)
 9227                {
 9228                    new_item.SetResultOfSplit(true);
 9229                    MiscGameplayFunctions.TransferItemProperties(this, new_item);
 9231                    new_item.
SetQuantity(split_quantity_new, 
false, 
true);
 
 9232                }
 9233            }
 9234        }
 9235        else if (destination_entity && slot_id == -1)
 9236        {
 9237            if (quantity > stack_max)
 9238                split_quantity_new = stack_max;
 9239            else
 9240                split_quantity_new = quantity;
 9241            
 9243            {
 9245                {
 9248                }
 9249 
 9250                if (new_item)
 9251                {
 9252                    new_item.SetResultOfSplit(true);        
 9253                    MiscGameplayFunctions.TransferItemProperties(this, new_item);
 9255                    new_item.
SetQuantity(split_quantity_new, 
false, 
true);
 
 9256                }
 9257            }
 9258        }
 9259        else
 9260        {
 9261            if (stack_max != 0)
 9262            {
 9264                {
 9266                }
 9267                
 9268                if (split_quantity_new == 0)
 9269                {
 9270                    if (!
GetGame().IsMultiplayer())
 
 9271                        player.PhysicalPredictiveDropItem(this);
 9272                    else
 9273                        player.ServerDropEntity(this);
 9274                    return;
 9275                }
 9276                
 9278                {
 9280                    
 9281                    if (new_item)
 9282                    {
 9283                        new_item.SetResultOfSplit(true);
 9284                        MiscGameplayFunctions.TransferItemProperties(this, new_item);
 9287                        new_item.PlaceOnSurface();
 9288                    }
 9289                }
 9290            }
 9291        }
 9292    }
 9293    
 9295    {       
 9296        float split_quantity_new;
 9300        InventoryLocation loc = new InventoryLocation;
 9301        
 9302        if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
 9303        {
 9305                split_quantity_new = stack_max;
 9306            else
 9308 
 9310            {
 9311                new_item = 
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
 
 9312                if (new_item)
 9313                {
 9314                    new_item.SetResultOfSplit(true);
 9315                    MiscGameplayFunctions.TransferItemProperties(this, new_item);
 9317                    new_item.
SetQuantity(split_quantity_new, 
false, 
true);
 
 9318                }
 9319            }
 9320        }
 9321        else if (destination_entity && slot_id == -1)
 9322        {
 9323            if (quantity > stack_max)
 9324                split_quantity_new = stack_max;
 9325            else
 9326                split_quantity_new = quantity;
 9327            
 9329            {
 9331                {
 9334                }
 9335 
 9336                if (new_item)
 9337                {
 9338                    new_item.SetResultOfSplit(true);        
 9339                    MiscGameplayFunctions.TransferItemProperties(this, new_item);
 9341                    new_item.
SetQuantity(split_quantity_new, 
false, 
true);
 
 9342                }
 9343            }
 9344        }
 9345        else
 9346        {
 9347            if (stack_max != 0)
 9348            {
 9350                {
 9352                }
 9353                
 9355                {
 9357                    
 9358                    if (new_item)
 9359                    {
 9360                        new_item.SetResultOfSplit(true);
 9361                        MiscGameplayFunctions.TransferItemProperties(this, new_item);
 9364                        new_item.PlaceOnSurface();
 9365                    }
 9366                }
 9367            }
 9368        }
 9369    }
 9370    
 9372    {
 9374        {
 9375            if (ScriptInputUserData.CanStoreInputUserData())
 9376            {
 9377                ScriptInputUserData ctx = new ScriptInputUserData;
 9382                dst.WriteToContext(ctx);
 9384            }
 9385        }
 9386        else if (!
GetGame().IsMultiplayer())
 
 9387        {
 9389        }
 9390    }
 9391    
 9393    {
 9395        {
 9396            if (ScriptInputUserData.CanStoreInputUserData())
 9397            {
 9398                ScriptInputUserData ctx = new ScriptInputUserData;
 9403                ctx.
Write(destination_entity);
 
 9409            }
 9410        }
 9411        else if (!
GetGame().IsMultiplayer())
 
 9412        {
 9414        }
 9415    }
 9416 
 9418    {
 9420    }
 9421    
 9423    {       
 9425        float split_quantity_new;
 9427        if (dst.IsValid())
 9428        {
 9429            int slot_id = dst.GetSlot();
 9431            
 9432            if (quantity > stack_max)
 9433                split_quantity_new = stack_max;
 9434            else
 9435                split_quantity_new = quantity;
 9436 
 9438            {
 9440                
 9441                if (new_item)
 9442                {
 9443                    new_item.SetResultOfSplit(true);
 9444                    MiscGameplayFunctions.TransferItemProperties(this,new_item);
 9446                    new_item.
SetQuantity(split_quantity_new, 
false, 
true);
 
 9447                }
 9448                
 9449                return new_item;
 9450            }
 9451        }
 9452        
 9453        return null;
 9454    }
 9455    
 9457    {       
 9459        float split_quantity_new;
 9461        if (destination_entity)
 9462        {
 9464            if (quantity > stackable)
 9465                split_quantity_new = stackable;
 9466            else
 9467                split_quantity_new = quantity;
 9468            
 9470            {
 9471                new_item = 
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col, 
false));
 
 9472                if (new_item)
 9473                {
 9474                    new_item.SetResultOfSplit(true);    
 9475                    MiscGameplayFunctions.TransferItemProperties(this,new_item);
 9477                    new_item.
SetQuantity(split_quantity_new, 
false, 
true);
 
 9478                }
 9479            }
 9480        }
 9481    }
 9482    
 9484    {
 9486        {
 9487            if (ScriptInputUserData.CanStoreInputUserData())
 9488            {
 9489                ScriptInputUserData ctx = new ScriptInputUserData;
 9494                ItemBase destination_entity = 
this;
 
 9495                ctx.
Write(destination_entity);
 
 9499            }
 9500        }
 9501        else if (!
GetGame().IsMultiplayer())
 
 9502        {
 9504        }
 9505    }
 9506 
 9508    {       
 9510        float split_quantity_new;
 9512        if (player)
 9513        {
 9515            if (quantity > stackable)
 9516                split_quantity_new = stackable;
 9517            else
 9518                split_quantity_new = quantity;
 9519            
 9521            {
 9522                EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
 
 9523                new_item = 
ItemBase.Cast(in_hands);
 
 9524                if (new_item)
 9525                {       
 9526                    new_item.SetResultOfSplit(true);
 9527                    MiscGameplayFunctions.TransferItemProperties(this,new_item);
 9529                    new_item.SetQuantity(split_quantity_new, false, true);
 9530                }
 9531            }
 9532        }
 9533    }
 9534    
 9536    {       
 9538        float split_quantity_new = Math.Floor(quantity * 0.5);
 9539        
 9541            return;
 9542 
 9544 
 9545        if (new_item)
 9546        {
 9547            if (new_item.GetQuantityMax() < split_quantity_new)
 9548            {
 9549                split_quantity_new = new_item.GetQuantityMax();
 9550            }
 9551            
 9552            new_item.SetResultOfSplit(true);
 9553            MiscGameplayFunctions.TransferItemProperties(this, new_item);
 9554            
 9556            {
 9559            }
 9560            else
 9561            {
 9563                new_item.
SetQuantity(split_quantity_new, 
false, 
true);               
 
 9564            }
 9565        }   
 9566    }
 9567    
 9569    {
 9571        float split_quantity_new = Math.Floor(quantity / 2);
 9572        
 9574            return;
 9575        
 9576        InventoryLocation invloc = new InventoryLocation;
 9578        
 9580        new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
 9581        
 9582        if (new_item)
 9583        {
 9584            if (new_item.GetQuantityMax() < split_quantity_new)
 9585            {
 9586                split_quantity_new = new_item.GetQuantityMax();
 9587            }
 9589            {
 9592            }
 9593            else if (split_quantity_new > 1)
 9594            {
 9596                new_item.
SetQuantity(split_quantity_new, 
false, 
true);
 
 9597            }
 9598        }
 9599    }
 9600    
 9603    {
 9604        SetWeightDirty();
 9606        
 9607        if (parent)
 9608            parent.OnAttachmentQuantityChangedEx(this, delta);
 9609        
 9611        {
 9613            {
 9615            }
 9617            {
 9618                ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
 
 9620            }
 9621        }
 9622            
 9623    }
 9624    
 9627    {
 9628        
 9629    }
 9630    
 9633    {
 9635    }
 9636 
 9638    {
 9639        super.EEHealthLevelChanged(oldLevel,newLevel,zone);
 9640        
 9642        {
 9643            if (newLevel == GameConstants.STATE_RUINED)
 9644            {
 9646                EntityAI parent = GetHierarchyParent();
 
 9647                if (parent && parent.IsFireplace())
 9648                {
 9649                    CargoBase cargo = GetInventory().GetCargo();
 9650                    if (cargo)
 9651                    {
 9653                        {
 9655                        }
 9656                    }
 9657                }
 9658            }
 9659            
 9661            {
 9662                
 9664                return;
 9665            }
 9666 
 9667            if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
 
 9668            {
 9670            }
 9671        }
 9672    }
 9673        
 9674    
 9676    {
 9677        super.OnRightClick();
 9678        
 9680        {
 9682            {
 9683                if (ScriptInputUserData.CanStoreInputUserData())
 9684                {
 9685                    EntityAI root = GetHierarchyRoot();
 
 9686                    Man playerOwner = GetHierarchyRootPlayer();
 9687                    InventoryLocation dst = new InventoryLocation;
 9688                    
 9689                    
 9690                    if (!playerOwner && root && root == this)
 9691                    {
 9693                    }
 9694                    else
 9695                    {
 9696                        
 9697                        GetInventory().GetCurrentInventoryLocation(dst);
 9699                        {
 9702                            {
 9704                            }
 9705                            else
 9706                            {
 9708                                
 9709
 9710                                if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
 
 9711                                {
 9713                                }
 9714                                else
 9715                                {
 9716                                    GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
 
 9717                                }
 9718                            }
 9719                        }
 9720                    }
 9721                    
 9722                    ScriptInputUserData ctx = new ScriptInputUserData;
 9730                }
 9731            }
 9732            else if (!
GetGame().IsMultiplayer())
 
 9733            {
 9735            }
 9736        }
 9737    }
 9738        
 9740    {
 9741        if (root)
 9742        {
 9743            vector m4[4];
 9744            root.GetTransform(m4);
 9745            dst.SetGround(this, m4);
 9746        }
 9747        else
 9748        {
 9749            GetInventory().GetCurrentInventoryLocation(dst);
 9750        }
 9751    }
 9752    
 9753    override bool CanBeCombined(
EntityAI other_item, 
bool reservation_check = 
true, 
bool stack_max_limit = 
false)
 
 9754    {
 9755        
 9756        if (!other_item || 
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item == 
this)
 
 9757            return false;
 9758 
 9759        if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)    
 9760            return false;
 9761        
 9762        
 9764            return false;
 9765 
 9766        
 9767        Magazine mag = Magazine.Cast(this);
 9768        if (mag)
 9769        {
 9770            if (mag.GetAmmoCount() >= mag.GetAmmoMax())
 9771                return false;
 9772            
 9773            if (stack_max_limit)
 9774            {
 9775                Magazine other_mag = Magazine.Cast(other_item);
 9776                if (other_item)
 9777                {
 9778                    if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
 9779                        return false;
 9780                }
 9781            
 9782            }
 9783        }
 9784        else
 9785        {
 9786            
 9788                return false;
 9789            
 9791                return false;
 9792        }
 9793 
 9794        PlayerBase player = null;
 9795        if (CastTo(player, GetHierarchyRootPlayer())) 
 9796        {
 9797            if (player.GetInventory().HasAttachment(this))
 9798                return false;
 9799            
 9800            if (player.IsItemsToDelete())
 9801                return false;
 9802        }
 9803 
 9804        if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
 9805            return false;
 9806        
 9807        int slotID;
 9809        if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
 
 9810            return false;
 9811 
 9812        return true;
 9813    }
 9814    
 9816    {
 9818    }
 9819    
 9821    {
 9822        return m_IsResultOfSplit;
 9823    }
 9824    
 9826    {
 9827        m_IsResultOfSplit = value;
 9828    }
 9829    
 9831    {
 9833    }
 9834    
 9836    {
 9837        float other_item_quantity = other_item.GetQuantity();
 9838        float this_free_space;
 9839            
 9841        
 9843            
 9844        if (other_item_quantity > this_free_space)
 9845        {
 9846            return this_free_space;
 9847        }
 9848        else
 9849        {
 9850            return other_item_quantity;
 9851        }
 9852    }
 9853    
 9855    {
 9857    }
 9858    
 9860    {
 9862            return;
 9863        
 9864        if (!IsMagazine() && other_item)
 9865        {
 9867            if (quantity_used != 0)
 9868            {
 9869                float hp1 = GetHealth01("","");
 9870                float hp2 = other_item.GetHealth01("","");
 9871                float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
 
 9872                hpResult = hpResult / (
GetQuantity() + quantity_used);
 
 9873 
 9874                hpResult *= GetMaxHealth();
 9875                Math.Round(hpResult);
 9876                SetHealth("", "Health", hpResult);
 9877 
 9879                other_item.AddQuantity(-quantity_used);
 9880            }
 9881        }
 9883    }
 9884 
 9886    {
 9887        #ifdef SERVER
 9888        if (!GetHierarchyRootPlayer() && GetHierarchyParent())
 9889            GetHierarchyParent().IncreaseLifetimeUp();
 9890        #endif
 9891    };
 9892 
 9894    {
 9895        PlayerBase p = PlayerBase.Cast(player);
 9896            
 9897        array<int> recipesIds = p.m_Recipes;
 9898        PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
 
 9899        if (moduleRecipesManager)
 9900        {
 9901            EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
 
 9902            moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this), 
ItemBase.Cast(itemInHands), recipesIds, p);
 
 9903        }
 9904 
 9905        for (int i = 0;i < recipesIds.Count(); i++)
 9906        {
 9907            int key = recipesIds.Get(i);
 9908            string recipeName = moduleRecipesManager.GetRecipeName(key);
 9910        }
 9911    }
 9912    
 9913    
 9914    override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
 
 9915    {
 9916        super.GetDebugActions(outputList);
 9917            
 9918        
 9924        
 9925        
 9930        
 9935        
 9936        
 9940 
 9941        
 9943        {
 9947        }
 9948        
 9951 
 9952        
 9956        
 9958 
 9959        InventoryLocation loc = new InventoryLocation();
 9960        GetInventory().GetCurrentInventoryLocation(loc);
 9962        {
 9963            if (Gizmo_IsSupported())
 9966        }
 9967 
 9969    }
 9970    
 9971    
 9972    
 9973    
 9975    {
 9976        super.OnAction(action_id, player, ctx);
 9977 
 9979        {
 9980            switch (action_id)
 9981            {
 9984                    return true;
 9987                    return true;
 9988            }
 9989        }
 9990 
 9992        {
 9993            switch (action_id)
 9994            {
 9996                    Delete();
 9997                    return true;
 9998            }
 9999        }
10000 
10001        if (action_id >= 
EActions.RECIPES_RANGE_START && action_id < 
EActions.RECIPES_RANGE_END)
 
10002        {
10003            PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
 
10004            int idWithoutOffset = action_id - 
EActions.RECIPES_RANGE_START;
 
10005            PlayerBase p = PlayerBase.Cast(player);
10006            if (
EActions.RECIPES_RANGE_START  < 1000)
 
10007            {
10008                float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10009                float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10010            }
10011        }
10012        #ifndef SERVER
10013        else if (action_id == 
EActions.WATCH_PLAYER)
 
10014        {
10015            PluginDeveloper.SetDeveloperItemClientEx(player);
10016        }
10017        #endif
10019        {
10020            if (action_id >= 
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id < 
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
 
10021            {
10022                int id = action_id - 
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
 
10023                OnDebugButtonPressServer(id + 1);
10024            }
10025            
10026            else if (action_id >= 
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id < 
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
 
10027            {
10028                int agent_id = action_id - 
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
 
10030            }
10031    
10032            else if (action_id >= 
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id < 
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
 
10033            {
10034                int agent_id2 = action_id - 
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
 
10036            }
10037            
10038            else if (action_id == 
EActions.ADD_QUANTITY)
 
10039            {
10040                if (IsMagazine())
10041                {
10042                    Magazine mag = Magazine.Cast(this);
10043                    mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10044                }
10045                else
10046                {
10048                }
10049                
10050                if (m_EM)
10051                {
10052                    m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10053                }
10054                
10055            }
10056                        
10057            else if (action_id == 
EActions.REMOVE_QUANTITY) 
 
10058            {
10059                if (IsMagazine())
10060                {
10061                    Magazine mag2 = Magazine.Cast(this);
10062                    mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10063                }
10064                else
10065                {
10067                }
10068                if (m_EM)
10069                {
10070                    m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10071                }
10072                
10073            }
10074            
10075            else if (action_id == 
EActions.SET_QUANTITY_0) 
 
10076            {
10078                
10079                if (m_EM)
10080                {
10081                    m_EM.SetEnergy(0);
10082                }
10083            }
10084            
10085            else if (action_id == 
EActions.SET_MAX_QUANTITY) 
 
10086            {
10088                
10089                if (m_EM)
10090                {
10091                    m_EM.SetEnergy(m_EM.GetEnergyMax());
10092                }
10093            }
10094    
10095            else if (action_id == 
EActions.ADD_HEALTH) 
 
10096            {
10097                AddHealth("","",GetMaxHealth("","Health")/5);
10098            }
10099            else if (action_id == 
EActions.REMOVE_HEALTH) 
 
10100            {
10101                AddHealth("","",-GetMaxHealth("","Health")/5);
10102            }
10103            else if (action_id == 
EActions.DESTROY_HEALTH) 
 
10104            {
10105                SetHealth01("","",0);
10106            }
10107            else if (action_id == 
EActions.WATCH_ITEM)
 
10108            {
10110                mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
 
10111                #ifdef DEVELOPER
10112                SetDebugDeveloper_item(this);
10113                #endif
10114            }
10115            
10116            else if (action_id == 
EActions.ADD_TEMPERATURE)
 
10117            {
10118                AddTemperature(20);
10119                
10120            }
10121            
10122            else if (action_id == 
EActions.REMOVE_TEMPERATURE)
 
10123            {
10124                AddTemperature(-20);
10125                
10126            }
10127            
10128            else if (action_id == 
EActions.FLIP_FROZEN)
 
10129            {
10130                SetFrozen(!GetIsFrozen());
10131                
10132            }
10133            
10134            else if (action_id == 
EActions.ADD_WETNESS)
 
10135            {
10137                
10138            }
10139            
10140            else if (action_id == 
EActions.REMOVE_WETNESS)
 
10141            {
10143                
10144            }
10145    
10146            else if (action_id == 
EActions.LIQUIDTYPE_UP)
 
10147            {
10150                
10151                
10152            }
10153            
10154            else if (action_id == 
EActions.LIQUIDTYPE_DOWN)
 
10155            {
10158            }
10159 
10160            else if (action_id == 
EActions.MAKE_SPECIAL)
 
10161            {
10162                auto debugParams = DebugSpawnParams.WithPlayer(player);
10163                OnDebugSpawnEx(debugParams);
10164            }
10165            
10166        }
10167 
10168        
10169        return false;
10170    }
10171 
10172    
10173    
10174    
10178    
10181 
10182    
10183    
10185    {
10186        return false;
10187    }
10188    
10189    
10191    {
10192        return true;
10193    }
10194    
10195    
10197    {
10198        return true;
10199    }
10200    
10201    
10202    
10204    {
10205        string config_path = 
string.Format(
"CfgVehicles %1 Food FoodStages", 
GetType());
 
10207    }
10208    
10211    {
10212        return null;
10213    }
10214    
10216    {
10217        return false;
10218    }
10219    
10221    {
10222        return false;
10223    }       
10224    
10228    
10229    
10231    {
10232        PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
 
10233        return module_repairing.CanRepair(this, item_repair_kit);
10234    }
10235 
10236    
10237    bool Repair(PlayerBase player, 
ItemBase item_repair_kit, 
float specialty_weight)
 
10238    {
10239        PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
 
10240        return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
10241    }
10242 
10243    
10245    {
10246        
10247
10248
10249
10250
10251
10252
10253        
10254        return 1;
10255    }
10256    
10257    
10258    
10260    {
10262    }
10263    
10264    
10265    
10267    {
10269    }
10270    
10271    
10280    {
10281        PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10282        
10283        if (player)
10284        {
10285            player.MessageStatus(text);
10286        }
10287    }
10288 
10289    
10298    {
10299        PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10300        
10301        if (player)
10302        {
10303            player.MessageAction(text);
10304        }
10305    }
10306 
10307    
10316    {
10317        PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10318        
10319        if (player)
10320        {
10321            player.MessageFriendly(text);
10322        }
10323    }
10324 
10325    
10334    {
10335        PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10336        
10337        if (player)
10338        {
10339            player.MessageImportant(text);
10340        }
10341    }
10342 
10344    {
10345        return true;
10346    }
10347 
10348    
10349    override bool KindOf(
string tag)
 
10350    {
10351        bool found = false;
10352        string item_name = this.
GetType();
 
10355        
10356        int array_size = item_tag_array.Count();
10357        for (int i = 0; i < array_size; i++)
10358        {
10359            if (item_tag_array.Get(i) == tag)
10360            {
10361                found = true;
10362                break;
10363            }
10364        }
10365        return found;
10366    }
10367 
10368    
10370    {
10371        
10372        super.OnRPC(sender, rpc_type,ctx);
10373            
10374        
10375        switch (rpc_type)
10376        {
10377            #ifndef SERVER
10378            case ERPCs.RPC_SOUND_LOCK_ATTACH:
 
10379                Param2<bool, string> p = new Param2<bool, string>(false, "");
10380                    
10382                    return;
10383            
10384                bool play = p.param1;
10385                string soundSet = p.param2;
10386                
10387                if (play)
10388                {
10390                    {
10392                        {
10394                        }
10395                    }
10396                    else
10397                    {
10399                    }
10400                }
10401                else
10402                {
10404                }
10405            
10406            break;
10407            #endif
10408        
10409        }
10410        
10412        {
10414        }
10415    }
10416 
10417    
10418    
10419    
10421    {
10422        PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
 
10423        return plugin.GetID(
name);
 
10424    }
10425 
10427    {
10428        PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
 
10429        return plugin.GetName(id);
10430    }
10431
10434    {
10435        
10436        
10437        int varFlags;
10438        if (!ctx.
Read(varFlags))
 
10439            return;
10440        
10441        if (varFlags & ItemVariableFlags.FLOAT)
10442        {
10444        }
10445    }
10446    
10448    {
10449        
10450        super.SerializeNumericalVars(floats_out);
10451        
10452        
10453        
10455        {
10457        }
10458        
10460        {
10462        }
10463        
10465        {
10467        }
10468        
10470        {
10475        }
10476        
10478        {
10480        }
10481    }
10482    
10484    {
10485        
10486        super.DeSerializeNumericalVars(floats);
10487        
10488        
10489        int index = 0;
10490        int mask = Math.Round(floats.Get(index));
10491        
10492        index++;
10493        
10495        {
10497            {
10499            }
10500            else
10501            {
10502                float quantity = floats.Get(index);
10503                SetQuantity(quantity, 
true, 
false, 
false, 
false);
 
10504            }
10505            index++;
10506        }
10507        
10509        {
10510            float wet = floats.Get(index);
10512            index++;
10513        }
10514        
10516        {
10517            int liquidtype = Math.Round(floats.Get(index));
10519            index++;
10520        }
10521        
10523        {
10525            index++;
10527            index++;
10529            index++;
10531            index++;
10532        }
10533        
10535        {
10536            int cleanness = Math.Round(floats.Get(index));
10538            index++;
10539        }
10540    }
10541    
10543    {
10544        super.WriteVarsToCTX(ctx);
10545 
10546        
10548        {
10550        }
10551        
10553        {
10555        }
10556        
10558        {
10560        }
10561        
10563        {
10564            int r,g,b,a;
10570        }
10571        
10573        {
10575        }
10576    }
10577    
10579    {
10580        if (!super.ReadVarsFromCTX(ctx,version))
10581            return false;
10582        
10583        int intValue;
10584        float value;
10585        
10586        if (version < 140)
10587        {
10588            if (!ctx.
Read(intValue))
 
10589                return false;
10590            
10591            m_VariablesMask = intValue;
10592        }
10593        
10595        {
10596            if (!ctx.
Read(value))
 
10597                return false;
10598            
10600            {
10602            }
10603            else
10604            {
10606            }
10607        }
10608        
10609        if (version < 140)
10610        {
10612            {
10613                if (!ctx.
Read(value))
 
10614                    return false;
10615                SetTemperatureDirect(value);
10616            }
10617        }
10618        
10620        {
10621            if (!ctx.
Read(value))
 
10622                return false;
10624        }
10625        
10627        {
10628            if (!ctx.
Read(intValue))
 
10629                return false;
10631        }
10632        
10634        {
10635            int r,g,b,a;
10637                return false;
10639                return false;
10641                return false;
10643                return false;
10644            
10646        }
10647        
10649        {
10650            if (!ctx.
Read(intValue))
 
10651                return false;
10653        }
10654        
10655        if (version >= 138 && version < 140)
10656        {
10658            {
10659                if (!ctx.
Read(intValue))
 
10660                    return false;
10661                SetFrozen(intValue);
10662            }
10663        }
10664        
10665        return true;
10666    }
10667 
10668    
10670    {
10673        {
10675        }
10676        
10677        if (!super.OnStoreLoad(ctx, version))
10678        {
10680            return false;
10681        }
10682        
10683        if (version >= 114)
10684        {
10685            bool hasQuickBarIndexSaved;
10686            
10687            if (!ctx.
Read(hasQuickBarIndexSaved))
 
10688            {
10690                return false;
10691            }
10692            
10693            if (hasQuickBarIndexSaved)
10694            {
10695                int itmQBIndex;
10696                
10697                
10698                if (!ctx.
Read(itmQBIndex))
 
10699                {
10701                    return false;
10702                }
10703                
10704                PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());                
10705                if (itmQBIndex != -1 && parentPlayer)
10706                    parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10707            }
10708        }
10709        else
10710        {
10711            
10712            PlayerBase player;
10713            int itemQBIndex;
10714            if (version == 
int.
MAX)
 
10715            {
10716                if (!ctx.
Read(itemQBIndex))
 
10717                {
10719                    return false;
10720                }
10721            }
10722            else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10723            {
10724                
10725                if (!ctx.
Read(itemQBIndex))
 
10726                {
10728                    return false;
10729                }
10730                if (itemQBIndex != -1 && player)
10731                    player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10732            }
10733        }
10734        
10735        if (version < 140)
10736        {
10737            
10738            if (!LoadVariables(ctx, version))
10739            {
10741                return false;
10742            }
10743        }
10744        
10745        
10747        {
10749            return false;
10750        }
10751        if (version >= 132)
10752        {
10754            if (raib)
10755            {
10757                {
10759                    return false;
10760                }
10761            }
10762        }
10763 
10765        return true;
10766    }
10767 
10768    
10769 
10771    {
10772        super.OnStoreSave(ctx);
10773        
10774        PlayerBase player;
10775        if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10776        {
10778            
10779            int itemQBIndex = -1;
10780            itemQBIndex = player.FindQuickBarEntityIndex(this);
10781            ctx.
Write(itemQBIndex);    
 
10782        }
10783        else
10784        {
10786        }
10787        
10789        
10791        if (raib)
10792        {
10794        }
10795    }
10796    
10797 
10799    {   
10800        super.AfterStoreLoad();
10801        
10803        {
10805        }
10806 
10808        {
10811        }
10812    }
10813    
10815    {
10816        super.EEOnAfterLoad();
10817        
10819        {
10821        }
10822        
10825    }
10826    
10828    {
10829        return false;
10830    }
10831    
10832    
10833    
10835    {
10837        {   
10838            #ifdef PLATFORM_CONSOLE
10839            
10841            {
10843                if (menu)
10844                {
10846                }
10847            }
10848            #endif
10849        }
10850                
10852        {
10855        }
10856        
10858        {
10859            SetWeightDirty();
10861        }
10863        {
10866        }
10867        
10869        {
10872        }
10874        {
10877        }
10878            
10879        super.OnVariablesSynchronized();
10880    }
10881 
10882    
10883    
10885    override bool SetQuantity(
float value, 
bool destroy_config = 
true, 
bool destroy_forced = 
false, 
bool allow_client = 
false, 
bool clamp_to_stack_max = 
true)
 
10886    {
10887        if (!IsServerCheck(allow_client))
10888            return false;
10889        
10891            return false;
10892        
10895        
10896        if (value <= (min + 0.001))
10897            value = min;
10898        
10899        if (value == min)
10900        {
10901            if (destroy_config)
10902            {
10903                bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10904                if (dstr)
10905                {
10907                    this.Delete();
10908                    return true;
10909                }
10910            }
10911            else if (destroy_forced)
10912            {
10914                this.Delete();
10915                return true;
10916            }
10917            
10919        }
10920        
10923        
10925        {
10927            
10928            if (delta)
10930        }
10931        
10933        
10934        return false;
10935    }
10936 
10937    
10939    bool AddQuantity(
float value, 
bool destroy_config = 
true, 
bool destroy_forced = 
false)
 
10940    {   
10942    }
10943    
10945    {
10948    }
10949    
10951    {
10954    }
10955    
10957    override void SetQuantityNormalized(
float value, 
bool destroy_config = 
true, 
bool destroy_forced = 
false)
 
10958    {
10959        float value_clamped = Math.Clamp(value, 0, 1);
10961        SetQuantity(result, destroy_config, destroy_forced);
 
10962    }
10963    
10964    
10967    {
10969    }
10970    
10972    {
10974    }
10975 
10976    
10977
10978
10979
10980
10981
10982
10983
10984    
10986    {
10987        int slot = -1;
10988        if (GetInventory())
10989        {
10990            InventoryLocation il = new InventoryLocation;
10991            GetInventory().GetCurrentInventoryLocation(il);
10993        }
10994        
10996    }
10997    
10999    {
11000        float quantity_max = 0;
11001        
11003        {
11004            if (attSlotID != -1)
11005                quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11006            
11007            if (quantity_max <= 0)
11009        }
11010        
11011        if (quantity_max <= 0)
11013 
11014        return quantity_max;
11015    }
11016    
11018    {
11020    }
11021    
11023    {
11025    }
11026    
11027    
11029    {
11031    }
11032 
11034    {
11036    }
11037    
11039    {
11041    }
11042    
11043    
11045    {
11046        
11047        float weightEx = GetWeightEx();
11048        float special = GetInventoryAndCargoWeight();
11049        return weightEx - special;
11050    }
11051 
11052    
11054    {
11056    }
11057    
11059    {
11061        {
11062            #ifdef DEVELOPER
11063            if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11064            {
11065                WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11067            }
11068            #endif
11069            
11070            return GetQuantity() * GetConfigWeightModified();
 
11071        }
11072        else if (HasEnergyManager())
11073        {
11074            #ifdef DEVELOPER
11075            if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11076            {
11077                WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11078                data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
 
11079            }
11080            #endif
11081            return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11082        }
11083        else
11084        {
11085            #ifdef DEVELOPER
11086            if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11087            {
11088                WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11089                data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + 
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
 
11090            }
11091            #endif
11092            return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
 
11093        }
11094    }
11095
11098    {
11099        int item_count = 0;
11101        
11102        if (GetInventory().GetCargo() != NULL)
11103        {
11104            item_count = GetInventory().GetCargo().GetItemCount();
11105        }
11106        
11107        for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11108        {
11109            Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11110            if (item)
11111                item_count += item.GetNumberOfItems();
11112        }
11113        return item_count;
11114    }
11115    
11118    {
11119        float weight = 0;
11120        float wetness = 1;
11121        if (include_wetness)
11124        {
11125            weight = wetness * m_ConfigWeight;
11126        }
11128        {
11129            weight = 1;
11130        }
11131        return weight;
11132    }
11133    
11134    
11135    
11137    {
11138        if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
 
11139        {
11140            GameInventory inv = GetInventory();
11141            array<EntityAI> items = new array<EntityAI>;
11143            for (int i = 0; i < items.Count(); i++)
11144            {
11146                if (item)
11147                {
11149                }
11150            }
11151        }
11152    }
11153    
11154    
11155 
11156    
11158    {
11159        float energy = 0;
11160        if (HasEnergyManager())
11161        {
11162            energy = GetCompEM().GetEnergy();
11163        }
11164        return energy;
11165    }
11166    
11167    
11169    {
11170        super.OnEnergyConsumed();
11171        
11173    }
11174 
11176    {
11177        super.OnEnergyAdded();
11178        
11180    }
11181    
11182    
11184    {
11185        if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
 
11186        {
11188            {
11189                float energy_0to1 = GetCompEM().GetEnergy0To1();
11191            }
11192        }
11193    }
11194 
11195    
11197    {
11198        return ConfigGetFloat("heatIsolation");
11199    }
11200 
11202    {
11204    }
11205 
11207    {
11208        string paramPath = 
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2", 
GetType(), pIncrementName);
 
11209        if (
GetGame().ConfigIsExisting(paramPath))
 
11211        
11212        return 0.0;
11213    }
11214    
11216    {
11217        string paramPath = 
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2", 
GetType(), pIncrementName);
 
11218        if (
GetGame().ConfigIsExisting(paramPath))
 
11220        
11221        return 0.0;
11222    }
11223    
11224    override void SetWet(
float value, 
bool allow_client = 
false)
 
11225    {
11226        if (!IsServerCheck(allow_client))
11227            return;
11228        
11231        
11233        
11234        m_VarWet = Math.Clamp(value, min, max);
 
11235        
11237        {
11240        }
11241    }
11242    
11243    override void AddWet(
float value)
 
11244    {
11246    }
11247    
11249    {
11251    }
11252    
11254    {
11256    }
11257    
11259    {
11261    }
11262    
11264    {
11266    }
11267    
11269    {
11271    }
11272    
11273    override void OnWetChanged(
float newVal, 
float oldVal)
 
11274    {
11277        if (newLevel != oldLevel)
11278        {
11280        }
11281    }
11282    
11284    {
11285        SetWeightDirty();
11286    }
11287    
11289    {
11290        return GetWetLevelInternal(
m_VarWet);
 
11291    }
11292 
11293    
11294    
11296    {
11298    }
11299    
11301    {
11303    }
11304    
11306    {
11308    }
11309    
11311    {
11313    }
11314    
11315    
11316    
11318    {
11319        if (ConfigIsExisting("itemModelLength"))
11320        {
11321            return ConfigGetFloat("itemModelLength");
11322        }
11323        return 0;
11324    }
11325    
11327    {
11328        if (ConfigIsExisting("itemAttachOffset"))
11329        {
11330            return ConfigGetFloat("itemAttachOffset");
11331        }
11332        return 0;
11333    }
11334    
11335    override void SetCleanness(
int value, 
bool allow_client = 
false)
 
11336    {
11337        if (!IsServerCheck(allow_client)) 
11338            return;
11339        
11341        
11343        
11346    }
11347    
11349    {
11351    }
11352    
11354    {
11355        return true;
11356    }
11357    
11358    
11359    
11360    
11362    {
11364    }
11365    
11367    {
11369    }
11370 
11371    
11372    
11373    
11374    override void SetColor(
int r, 
int g, 
int b, 
int a)
 
11375    {
11381    }
11383    override void GetColor(out 
int r,out 
int g,out 
int b,out 
int a)
 
11384    {
11389    }
11390    
11392    {
11394    }
11395    
11398    {
11399        int r,g,b,a;
11401        r = r/255;
11402        g = g/255;
11403        b = b/255;
11404        a = a/255;
11405        return MiscGameplayFunctions.GetColorString(r, g, b, a);
11406    }
11407    
11408    
11409 
11410    override void SetLiquidType(
int value, 
bool allow_client = 
false)
 
11411    {
11412        if (!IsServerCheck(allow_client))
11413            return;
11414        
11419    }
11420    
11422    {
11423        return ConfigGetInt("varLiquidTypeInit");
11424    }
11425    
11427    {
11429    }
11430    
11432    {
11434            SetFrozen(false);
11435    }
11436
11439    {
11440        player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11441    }
11442    
11443    
11446    {
11447        PlayerBase nplayer;
11448        if (PlayerBase.CastTo(nplayer, player))
11449        {
11451            
11452            nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible()); 
11453        }
11454    }
11455    
11456    
11459    {
11460        PlayerBase nplayer;
11461        if (PlayerBase.CastTo(nplayer,player))
11462        {       
11463            
11464            nplayer.SetEnableQuickBarEntityShortcut(this,false);
11465 
11466        }
11467        
11468        
11469        player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11470        
11471        
11472        if (HasEnergyManager())
11473        {
11474            GetCompEM().UpdatePlugState(); 
11475        }
11476    }
11477 
11478    
11480    {
11481        super.OnPlacementStarted(player);
11482        
11484    }
11485    
11486    override void OnPlacementComplete(Man player, vector position = 
"0 0 0", vector orientation = 
"0 0 0")
 
11487    {
11489        {
11490            m_AdminLog.OnPlacementComplete(player, 
this);
 
11491        }
11492        
11493        super.OnPlacementComplete(player, position, orientation);
11494    }
11495        
11496    
11497    
11498    
11499    
11501    {
11503        {
11504            return true;
11505        }
11506        else
11507        {
11508            return false;
11509        }
11510    }
11511 
11512    
11514    {
11516        {
11518        }
11519    }
11520 
11521    
11523    {
11525    }
11526    
11528    {
11530    }
11531    
11532    override void InsertAgent(
int agent, 
float count = 1)
 
11533    {
11534        if (count < 1)
11535            return;
11536        
11538    }
11539    
11542    {
11544    }
11545    
11546    
11548    {
11550    }
11551    
11552    
11553    
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591    
11592    
11594    {
11596            return false;
11597        return true;
11598    }
11599    
11601    {
11602        
11604    }
11605    
11606    
11609    {
11610        super.CheckForRoofLimited(timeTresholdMS);
11611        
11613        if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11614        {
11615            m_PreviousRoofTestTime = time;
11616            SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11617        }
11618    }
11619    
11620    
11622    {
11624        {
11625            return 0;
11626        }
11627        
11628        if (GetInventory().GetAttachmentSlotsCount() != 0)
11629        {
11630            ItemBase filter = 
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
 
11631            if (filter)
11632                return filter.GetProtectionLevel(type, false, system);
11633            else
11634                return 0;
11635        }
11636 
11637        string subclassPath, entryName;
11638 
11639        switch (type)
11640        {
11642                entryName = "biological";
11643                break;
11645                entryName = "chemical";
11646                break;  
11647            default:
11648                entryName = "biological";
11649                break;
11650        }
11651        
11652        subclassPath = 
"CfgVehicles " + this.
GetType() + 
" Protection ";
 
11653        
11655    }
11656    
11657    
11658    
11661    {
11662        if (!IsMagazine())
11664 
11666    }
11667    
11668    
11669    
11670    
11671    
11676    {
11677        return true;
11678    }
11679 
11681    {
11683    }
11684    
11685    
11686    
11687    
11688    
11690    {
11691        if (parent)
11692        {
11693            if (parent.IsInherited(DayZInfected))
11694                return true;
11695 
11696            if (!parent.IsRuined())
11697                return true;
11698        }
11699        
11700        return true;
11701    }   
11702    
11704    {
11705        if (!super.CanPutAsAttachment(parent))
11706        {
11707            return false;
11708        }
11709        
11710        if (!IsRuined() && !parent.IsRuined())
11711        {
11712            return true;
11713        }
11714 
11715        return false;
11716    }
11717 
11719    {
11720        
11721        
11722        
11723        
11724        return super.CanReceiveItemIntoCargo(item);
11725    }
11726 
11728    {
11729        
11730        
11731        
11732        
11733        GameInventory attachmentInv = attachment.GetInventory();
11735        {
11736            if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11737                return false;
11738        }
11739        
11740        InventoryLocation loc = new InventoryLocation();
11741        attachment.GetInventory().GetCurrentInventoryLocation(loc);
11742        if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
 
11743            return false;
11744        
11745        return super.CanReceiveAttachment(attachment, slotId);
11746    }
11747    
11749    {
11750        if (!super.CanReleaseAttachment(attachment))
11751            return false;
11752        
11753        return GetInventory().AreChildrenAccessible();
11754    }
11755    
11756    
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774    
11775    
11777    {
11778        int id = muzzle_owner.GetMuzzleID();
11779        array<ref WeaponParticlesOnFire> WPOF_array = 
m_OnFireEffect.Get(
id);
 
11780        
11781        if (WPOF_array)
11782        {
11783            for (int i = 0; i < WPOF_array.Count(); i++)
11784            {
11785                WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11786                
11787                if (WPOF)
11788                {
11789                    WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11790                }
11791            }
11792        }
11793    }
11794    
11795    
11797    {
11798        int id = muzzle_owner.GetMuzzleID();
11800        
11801        if (WPOBE_array)
11802        {
11803            for (int i = 0; i < WPOBE_array.Count(); i++)
11804            {
11805                WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11806                
11807                if (WPOBE)
11808                {
11809                    WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11810                }
11811            }
11812        }
11813    }
11814    
11815    
11817    {
11818        int id = muzzle_owner.GetMuzzleID();
11819        array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11820        
11821        if (WPOOH_array)
11822        {
11823            for (int i = 0; i < WPOOH_array.Count(); i++)
11824            {
11825                WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11826                
11827                if (WPOOH)
11828                {
11829                    WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11830                }
11831            }
11832        }
11833    }
11834    
11835    
11837    {
11838        int id = muzzle_owner.GetMuzzleID();
11839        array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11840        
11841        if (WPOOH_array)
11842        {
11843            for (int i = 0; i < WPOOH_array.Count(); i++)
11844            {
11845                WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11846                
11847                if (WPOOH)
11848                {
11849                    WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11850                }
11851            }
11852        }
11853    }
11854    
11855    
11857    {
11858        int id = muzzle_owner.GetMuzzleID();
11859        array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11860        
11861        if (WPOOH_array)
11862        {
11863            for (int i = 0; i < WPOOH_array.Count(); i++)
11864            {
11865                WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11866                
11867                if (WPOOH)
11868                {
11869                    WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11870                }
11871            }
11872        }
11873    }
11874    
11875    
11876    
11878    {
11880        {   
11881            return true;
11882        }
11883        
11884        return false;
11885    }
11886    
11888    {
11890        {
11891            return true;    
11892        }
11893        
11894        return false;
11895    }
11896    
11898    {
11900        {
11901            return true;
11902        }
11903            
11904        return false;
11905    }
11906    
11908    {
11909        return false;
11910    }
11911    
11914    {
11915        return UATimeSpent.DEFAULT_DEPLOY;
11916    }
11917    
11918 
11919    
11920    
11922    {
11924        SetSynchDirty();
11925    }
11926 
11928    {
11930    }
11931    
11932    
11934    {
11935        return false;
11936    }
11937
11940    {
11941        string att_type = "None";
11942 
11943        if (ConfigIsExisting("soundAttType"))
11944        {
11945            att_type = ConfigGetString("soundAttType");
11946        }
11947        
11949    }
11950    
11952    {   
11954    }
11955    
11956    
11957    
11958    
11959    
11965            
11967    {
11970        
11972    }
11973    
11974    
11976    {
11978            return;
11979 
11981 
11984        
11987        
11988        SoundParameters params = new SoundParameters();
11992    }
11993    
11994    
11996    {
11998            return;
11999        
12001        SetSynchDirty();
12002        
12005    }
12006    
12007    
12009    {
12011            return;
12012        
12014        SetSynchDirty();
12015        
12018    }
12019    
12021    {
12023    }
12024    
12026    {
12028    }
12029                
12032    {
12033        if (!
GetGame().IsDedicatedServer())
 
12034        {
12035            if (ConfigIsExisting("attachSoundSet"))
12036            {
12037                string cfg_path = "";
12038                string soundset = "";
12039                string type_name = 
GetType();
 
12040                
12043                ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12044                ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12045                
12046                if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12047                {
12048                    for (int i = 0; i < cfg_soundset_array.Count(); i++)
12049                    {
12050                        if (cfg_slot_array[i] == slot_type)
12051                        {
12052                            soundset = cfg_soundset_array[i];
12053                            break;
12054                        }
12055                    }
12056                }
12057                
12058                if (soundset != "")
12059                {
12060                    EffectSound sound = SEffectManager.PlaySound(soundset, 
GetPosition());
 
12062                }
12063            }
12064        }
12065    }
12066    
12068    {
12069        
12070    }
12071    
12072    void OnApply(PlayerBase player);
 
12073    
12075    {
12076        return 1.0;
12077    };
12078    
12080    {
12082    }
12083    
12085    {
12087    }
12088    
12090    
12092    {
12093        SetDynamicPhysicsLifeTime(0.01);
12095    }
12096    
12098    {
12099        array<string> zone_names = new array<string>;
12100        GetDamageZones(zone_names);
12101        for (int i = 0; i < zone_names.Count(); i++)
12102        {
12103            SetHealthMax(zone_names.Get(i),"Health");
12104        }
12105        SetHealthMax("","Health");
12106    }
12107    
12110    {
12111        float global_health = GetHealth01("","Health");
12112        array<string> zones = new array<string>;
12113        GetDamageZones(zones);
12114        
12115        for (int i = 0; i < zones.Count(); i++)
12116        {
12117            SetHealth01(zones.Get(i),"Health",global_health);
12118        }
12119    }
12120    
12123    {
12124        return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12125    }
12126    
12128    {
12129        if (!hasRootAsPlayer)
12130        {
12131            if (refParentIB)
12132            {
12133                
12134                if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet < 
m_VarWetMax))
 
12135                    AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
 
12136                
12137                else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet < 
m_VarWetMax))
 
12138                    AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
 
12139                
12142            }
12143            else
12144            {
12145                
12148            }
12149        }
12150    }
12151    
12153    {
12155        {
12156            float target = 
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
 
12157            if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
 
12158            {
12159                float heatPermCoef = 1.0;
12161                while (ent)
12162                {
12163                    heatPermCoef *= ent.GetHeatPermeabilityCoef();
12164                    ent = ent.GetHierarchyParent();
12165                }
12166                
12167                SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
 
12168            }
12169        }
12170    }
12171    
12173    {
12174        
12175        EntityAI parent = GetHierarchyParent();
 
12176        if (!parent)
12177        {
12178            hasParent = false;
12179            hasRootAsPlayer = false;
12180        }
12181        else
12182        {
12183            hasParent = true;
12184            hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12185            refParentIB = 
ItemBase.Cast(parent);
 
12186        }
12187    }
12188    
12189    protected void ProcessDecay(
float delta, 
bool hasRootAsPlayer)
 
12190    {
12191        
12192    }
12193    
12195    {
12196        
12197        return false;
12198    }
12199    
12201    {
12202        
12203        
12204        return false;
12205    }
12206    
12208    {
12209        
12210        return false;
12211    }
12212    
12215    {
12216        return !GetIsFrozen() && 
IsOpen();
 
12217    }
12218    
12220    {
12221        bool hasParent = false, hasRootAsPlayer = false;
12223        
12224        bool wwtu = 
g_Game.IsWorldWetTempUpdateEnabled();
 
12225        bool foodDecay = 
g_Game.IsFoodDecayEnabled();
 
12226        
12227        if (wwtu || foodDecay)
12228        {
12232            
12233            if (processWetness || processTemperature || processDecay)
12234            {
12236            
12237                if (processWetness)
12238                    ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);                    
 
12239                
12240                if (processTemperature)
12242            
12243                if (processDecay)
12244                    ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
 
12245            }
12246        }
12247    }
12248    
12251    {
12253    }
12254    
12256    {
12259        
12260        return super.GetTemperatureFreezeThreshold();
12261    }
12262    
12264    {
12267        
12268        return super.GetTemperatureThawThreshold();
12269    }
12270    
12272    {
12275        
12276        return super.GetItemOverheatThreshold();
12277    }
12278    
12280    {
12282            return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
 
12283        
12284        return super.GetTemperatureFreezeTime();
12285    }
12286    
12288    {
12290            return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
 
12291        
12292        return super.GetTemperatureThawTime();
12293    }
12294    
12299    
12301    {
12302        return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12303    }
12304    
12306    {
12307        MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12308    }
12309    
12312    {
12314    }
12315    
12317    {
12319    }
12320    
12322    {
12324    }
12325    
12328    {
12329        return null;
12330    }
12331    
12334    {
12335        return false;
12336    }
12337    
12339    {
12341        {
12344            if (!trg)
12345            {
12347                explosive = this;
12348            }
12349            
12350            explosive.PairRemote(trg);
12352            
12353            int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12354            trg.SetPersistentPairID(persistentID);
12355            explosive.SetPersistentPairID(persistentID);
12356            
12357            return true;
12358        }
12359        return false;
12360    }
12361    
12364    {
12365        float ret = 1.0;
12368        ret *= GetHealth01();
12369        
12370        return ret;
12371    }
12372 
12373    #ifdef DEVELOPER
12374    override void SetDebugItem()
12375    {
12376        super.SetDebugItem();
12377        _itemBase = this;
12378    }
12379    
12381    {
12382        string text = super.GetDebugText();
12383        
12385        text += 
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
 
12386 
12387        return text;
12388    }
12389    #endif
12390    
12392    {
12393        return true;
12394    }
12395    
12397    
12399    
12401    {
12404    }
12405    
12406    
12414    
12430}
12431 
12433{
12435    if (entity)
12436    {
12437        bool is_item = entity.IsInherited(
ItemBase);
 
12438        if (is_item && full_quantity)
12439        {
12442        }
12443    }
12444    else
12445    {
12447        return NULL;
12448    }
12449    return entity;
12450}
12451 
12453{
12454    if (item)
12455    {
12456        if (health > 0)
12457            item.SetHealth("", "", health);
12458        
12459        if (item.CanHaveTemperature())
12460        {
12462            if (item.CanFreeze())
12463                item.SetFrozen(false);
12464        }
12465        
12466        if (item.HasEnergyManager())
12467        {
12468            if (quantity >= 0)
12469            {       
12470                item.GetCompEM().SetEnergy0To1(quantity);
12471            }
12472            else
12473            {
12475            }
12476        }
12477        else if (item.IsMagazine())
12478        {
12479            Magazine mag = Magazine.Cast(item);
12480            if (quantity >= 0)
12481            {       
12482                mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12483            }
12484            else
12485            {       
12487            }
12488            
12489        }
12490        else
12491        {
12492            if (quantity >= 0)
12493            {       
12494                item.SetQuantityNormalized(quantity, false);
12495            }
12496            else
12497            {
12499            }
12500            
12501        }
12502    }
12503}
12504 
12505#ifdef DEVELOPER
12507#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.