Пример #1
0
 public void RefreshCounter()
 {
     if (UnitCounter != null)
     {
         UnitCounter.RefreshUnitCounter();
     }
 }
Пример #2
0
    public bool EndOfTurn(bool isActive)
    {
        if (CheckEtherealEndOfTurn())
        {
            return(true);
        }

        if (isActive)
        {
            RemoveEnchantmentsOfStatus(new List <UnitEnchantment.EnchantmentStatus>()
            {
                UnitEnchantment.EnchantmentStatus.EndOfOwnersTurn, UnitEnchantment.EnchantmentStatus.AfterAttack
            });
        }
        else
        {
            RemoveEnchantmentsOfStatus(new List <UnitEnchantment.EnchantmentStatus>()
            {
                UnitEnchantment.EnchantmentStatus.EndOfOpponentTurn, UnitEnchantment.EnchantmentStatus.AfterAttack
            });
        }

        UnitCounter.RefreshUnitCounter();

        if (IsHero && ((Hero)this).ActiveMagisFury.HasValue && !((Hero)this).ActiveMagisFury.Value)
        {
            RemoveUnit(true);
        }

        return(false);
    }
Пример #3
0
    public bool CheckWarden()
    {
        if (CurrentStatusEffects.Contains(StatusEffects.Warded))
        {
            CurrentStatusEffects.Remove(StatusEffects.Warded);
            UnitCounter.RefreshUnitCounter();
        }

        if (!HasKeyword(Keywords.Stalker) && !UnitCounter.Cell.IsSurveyed(Owner.Id))
        {
            foreach (var adjCell in UnitCounter.Cell.adjCell)
            {
                if (adjCell.occupantCounter != null)
                {
                    var adjUnit = adjCell.occupantCounter.Unit;
                    if (adjUnit.Owner.Id != Owner.Id)
                    {
                        if (adjUnit.HasKeyword(Keywords.Warden))
                        {
                            if (!adjUnit.HasStatusEffect(StatusEffects.Stunned))
                            {
                                if (CheckWardenMatchingKeywords(adjUnit, Keywords.Ethereal) && CheckWardenMatchingKeywords(adjUnit, Keywords.Flying))
                                {
                                    CurrentStatusEffects.Add(StatusEffects.Warded);
                                    RefreshCounter();
                                    return(true);
                                }
                            }
                        }
                    }
                }
            }
        }

        return(false);
    }