private void TaskOnClick() { PartyActions.Sleep(); if (Tent.Status == TentStatus.Fireplace) { PartyActions.DamageAllPlayers(1); } if (InventionStorage.IsAvailable(Invention.Cellar)) { var food = FoodStorage.Food; FoodStorage.DecreaseFoodBy(food); FoodStorage.IncreasePermantFoodBy(food); } if (CampMoved) { Wall.HalfValue_Ceiling(); Roof.HalfValue_Ceiling(); } FoodStorage.DiscardFood(); Destroy(popUp); var phaseView = FindObjectOfType <PhaseView>(); phaseView.NextPhase(); RoundSystem.instance.increaseRound(); }
public static void DowngradeRoofBy(int value) { RoofState -= value; if (RoofState < 0) { int dmg = Math.Abs(RoofState); PartyActions.DamageAllPlayers(dmg); RoofState = 0; } RoofChanged?.Invoke(RoofState, new EventArgs()); }
public static void DowngradeWallBy(int value) { WallState -= value; if (WallState < 0) { int dmg = Math.Abs(WallState); PartyActions.DamageAllPlayers(dmg); WallState = 0; } WallStateChanged?.Invoke(WallState, new EventArgs()); }
public static void LowerWeaponPowerBy(int value) { currentWeaponPower -= value; if (currentWeaponPower < 0) { int dmg = Math.Abs(currentWeaponPower); PartyActions.DamageAllPlayers(dmg); currentWeaponPower = 0; } WeaponPowerChanged?.Invoke(currentWeaponPower, new EventArgs()); }
public static void DecreaseWoodBy(int value) { currentAmountOfWood -= value; if (currentAmountOfWood < minValue) { int dmg = Math.Abs(currentAmountOfWood); PartyActions.DamageAllPlayers(dmg); currentAmountOfWood = minValue; } AmountOfWoodChanged?.Invoke(currentAmountOfWood, new EventArgs()); }
public static void DecreaseBy(int amount) { currentAmountOfFur -= amount; if (currentAmountOfFur < 0) { int dmg = Math.Abs(currentAmountOfFur); PartyActions.DamageAllPlayers(dmg); currentAmountOfFur = 0; } AmountOFFurChanged?.Invoke(currentAmountOfFur, new EventArgs()); }
private void HandleRessourceCosts() { Debug.Log("Wood " + amountWoodGone); Debug.Log("Food " + amountFoodGone); if (amountWoodGone > 0) { Wood.DecreaseWoodBy(amountWoodGone); } if (amountFoodGone > 0) { if (FoodStorage.GetTotal() < amountFoodGone) { int difference = amountFoodGone - FoodStorage.GetTotal(); FoodStorage.Consume(FoodStorage.GetTotal()); PartyActions.DamageAllPlayers(difference); } else { FoodStorage.Consume(amountFoodGone); } } }