Beispiel #1
0
    public FocusStrategy CreateStrategy(Strategy strat, ShootingTurret turret)
    {
        switch (strat)
        {
        case Strategy.Nearest:
            return(new FocusVisibleNearest(turret));

        case Strategy.Biggest:
            return(new FocusBiggest(turret));

        case Strategy.Smallest:
            return(new FocusSmallest(turret));

        case Strategy.Fastest:
            return(new FocusFastest(turret));

        case Strategy.Slowest:
            return(new FocusSlowest(turret));

        case Strategy.HighestLife:
            return(new FocusHighestLife(turret));

        case Strategy.LowestLife:
            return(new FocusLowestLife(turret));

        case Strategy.Strongest:
            return(new FocusStrongest(turret));

        case Strategy.Weakest:
            return(new FocusWeakest(turret));

        default:
            throw new System.Exception("Unsupprted Strategy");
        }
    }
Beispiel #2
0
    public void SetTarget(Wall target)
    {
        this.target = target;

        CanvasUIGO.SetActive(true);

        sellAmountText.text = target.Turret.GetSellAmount().ToString();
        turretImg.sprite    = target.Turret.GetImg();
        rangeText.text      = target.Turret.stats.range.ToString();

        if (target.Turret is SlowDamageSpeedTurret)
        {
            SupportTurretCanvas.gameObject.SetActive(false);
            ShootingTurretCanvas.gameObject.SetActive(true);

            SlowDamageSpeedTurret t = (SlowDamageSpeedTurret)target.Turret;
            fireRateText.text     = t.GetSpeed().ToString();
            fireRateUpText.text   = t.GetSpeedUp().ToString();
            damageText.text       = t.GetDamage().ToString();
            damageUpText.text     = t.GetDamageUp().ToString();
            slowAmountText.text   = ((int)t.GetSlow()).ToString() + "%";
            slowAmountUpText.text = ((int)t.GetSlowUp()).ToString() + "%";

            if (target.Turret is ShootingTurret)
            {
                ShootingTurret st = (ShootingTurret)target.Turret;
                ChangeDropdownStrategy((int)st.Strat);

                focusStrategyDropdown.gameObject.SetActive(true);
            }
            else
            {
                focusStrategyDropdown.gameObject.SetActive(false);
            }
        }
        else // support
        {
            SupportTurretCanvas.gameObject.SetActive(true);
            ShootingTurretCanvas.gameObject.SetActive(false);

            BoostTurret bt = (BoostTurret)target.Turret;
            boostAmountText.text   = bt.GetBoost().ToString();
            boostAmountUpText.text = bt.GetBoostUp().ToString();
        }

        rangeUpText.text = target.Turret.stats.rangeUp.ToString();

        if (target.Turret.HasAnUpgrade)
        {
            upgradeCostText.text = target.Turret.stats.upgradeCost.ToString();
            btnUpgradeTurret.ActiveButton();
        }
        else
        {
            upgradeCostText.text = "";
            btnUpgradeTurret.DesactiveButton();
        }

        TurretRangeDisplayer.Instance.DisplayRange(target.Turret);
    }
Beispiel #3
0
    protected override void InitUpStats()
    {
        base.InitUpStats();

        ShootingTurret st = (ShootingTurret)turretUp;

        damageUp = st.damage;
        slowUp   = st.slowPercent;
    }
Beispiel #4
0
 public FocusWeakest(ShootingTurret turret) : base(turret)
 {
 }
Beispiel #5
0
 public FocusSmallest(ShootingTurret turret) : base(turret)
 {
 }
 public FocusSlowest(ShootingTurret turret) : base(turret)
 {
 }
Beispiel #7
0
 public FocusFastest(ShootingTurret turret) : base(turret)
 {
 }
Beispiel #8
0
 public FocusVisibleNearest(ShootingTurret turret) : base(turret)
 {
 }
 public FocusStrongest(ShootingTurret turret) : base(turret)
 {
 }
 public FocusBiggest(ShootingTurret turret) : base(turret)
 {
 }
Beispiel #11
0
 public FocusHighestLife(ShootingTurret turret) : base(turret)
 {
 }
Beispiel #12
0
 public FocusStrategy(ShootingTurret turret)
 {
     this.turret = turret;
 }
 public FocusLowestLife(ShootingTurret turret) : base(turret)
 {
 }
Beispiel #14
0
    public void DropdownChanged()
    {
        ShootingTurret st = (ShootingTurret)target.Turret;

        st.ChangeStrategy(FocusStrategyFactory.Instance.CreateStrategy((Strategy)focusStrategyDropdown.value, st));
    }