コード例 #1
0
ファイル: Pets.cs プロジェクト: wilddip/oxideplugins
            void Awake()
            {
                RustAI = GetComponent <NPCAI>();
                RustAI.ServerDestroy();
                RustMetabolism = GetComponent <NPCMetabolism>();
                Base           = GetComponent <BaseNPC>();

                lastTick    = Time.time;
                targetpoint = Vector3.zero;
                action      = Act.None;

                hungerLose  = RustMetabolism.calories.max * 2 / 12000;
                thristyLose = RustMetabolism.hydration.max * 3 / 12000;
                sleepLose   = RustMetabolism.sleep.max / 12000;

                inventory = new ItemContainer();
                inventory.ServerInitialize(null, 6);

                Base.enableSaving = false;
                BaseEntity.saveList.Remove(Base);
                Base.InitializeHealth(Base.health * HealthModificator, Base.MaxHealth() * HealthModificator);
                Base.locomotion.gallopSpeed  *= SpeedModificator;
                Base.locomotion.trotSpeed    *= SpeedModificator;
                Base.locomotion.acceleration *= SpeedModificator;
            }
コード例 #2
0
ファイル: Pets.cs プロジェクト: gragonvlad/RustPluginManual
 void OnDestroy()
 {
     Base.InitializeHealth(Base.health / HealthModificator, Base.MaxHealth() / HealthModificator);
     Base.locomotion.gallopSpeed  /= SpeedModificator;
     Base.locomotion.trotSpeed    /= SpeedModificator;
     Base.locomotion.acceleration /= SpeedModificator;
     DropUtil.DropItems(inventory, transform.position);
     SaveNpcList.Remove(owner.owner.userID.ToString());
     RustAI.ServerInit();
 }
コード例 #3
0
ファイル: Pets.cs プロジェクト: wilddip/oxideplugins
            void OnDestroy()
            {
                DropUtil.DropItems(inventory, transform.position);
                SaveNpcList.Remove(owner.owner.userID);
                RustAI.ServerInit();

                if (Base.health <= 0)
                {
                    return;
                }

                Base.enableSaving = true;
                BaseEntity.saveList.Add(Base);

                Base.InitializeHealth(Base.health / HealthModificator, Base.MaxHealth() / HealthModificator);
                Base.locomotion.gallopSpeed  /= SpeedModificator;
                Base.locomotion.trotSpeed    /= SpeedModificator;
                Base.locomotion.acceleration /= SpeedModificator;
            }