Exemplo n.º 1
0
 private void Respawn()
 {
     transformSender.TriggerTeleport(playerInfo.Data.initialSpawnPosition.ToVector3());
     health.Send(new Health.Update().SetCurrentHealth(SimulationSettings.PlayerMaxHealth).SetCanBeChanged(true));
     flammableInterface.SelfSetCanBeIgnited(flammable, true);
     spells.Send(new Spells.Update().SetCanCastSpells(true));
     inventory.Send(new Inventory.Update().SetResources(0));
     playerInfo.Send(new PlayerInfo.Update().SetIsAlive(true));
 }
Exemplo n.º 2
0
 private void UpdateHQFlammablility(int healthValue)
 {
     if (healthValue <= 0)
     {
         flammableBehaviour.SelfExtinguish(health, false);
     }
     else
     {
         var canBeIgnited = healthValue > 0;
         flammableBehaviour.SelfSetCanBeIgnited(health, canBeIgnited);
     }
 }
        public void EvaluateAndSetFlammability(Health.Update update)
        {
            if (barracksInfo == null)
            {
                Debug.LogError("barracksInfo is null in BarracksStateMachine.");
                return;
            }

            if (flammableBehaviour == null)
            {
                Debug.LogError("flammableBehaviour is null in BarracksStateMachine.");
                return;
            }

            if (update.currentHealth.Value <= 0)
            {
                flammableBehaviour.SelfExtinguish(health, false);
            }
            else
            {
                var canBeIgnited = update.currentHealth.Value > 0;
                flammableBehaviour.SelfSetCanBeIgnited(barracksInfo, canBeIgnited);
            }
        }