Пример #1
0
 void Start()
 {
     heroStats      = GetComponent <HeroStats>();
     animator       = GetComponent <Animator>();
     attackSpeed    = Utils.calculateAttackRate(heroStats.getUnitType(), heroStats.getAgility());
     nextAttackTime = 0.0f;
 }
Пример #2
0
 public void activateAbility()
 {
     //round up because we are good guy
     boostAmmount = (int)Math.Ceiling(heroStats.getAgility() * percentBoost);
     //add an effect
     heroBehaviorExecutor.addEffect(new BoostAgility(duration, boostAmmount, heroStats));
     currentStatus = AbilityStatus.Cooldown;
     cooldownEnd   = Time.time + cooldownTime;
 }
Пример #3
0
    void Start()
    {
        //initialize stats
        heroStats   = GetComponent <HeroStats>();
        attackSpeed = Utils.calculateAttackRate(heroStats.getUnitType(), heroStats.getAgility());
        animator    = GetComponent <Animator>();

        engagedEnemies = new List <GameObject>();
        nextAttackTime = 0.0f;
    }
Пример #4
0
 public void updateUI()
 {
     currentHp.text          = "" + selectedHeroHealthBar.getCurrentHealth() + " / " + selectedHeroHealthBar.getMaxHealth();
     currentAttackSpeed.text = "" + Utils.calculateAttackRate(selectedHeroStats.getUnitType(), selectedHeroStats.getAgility());
     unitType.text           = "" + Enum.GetName(typeof(Utils.UnitType), selectedHeroStats.getUnitType());
     currentExperience.text  = "" + selectedHeroStats.getExperience();
     Level.text            = "" + selectedHeroStats.getLevel();
     nextLevelXP.text      = "" + selectedHeroStats.getNextLevelExperience();
     Health.text           = "" + selectedHeroStats.getHealth();
     Attack.text           = "" + selectedHeroStats.getAttack();
     Magic.text            = "" + selectedHeroStats.getMagic();
     Defense.text          = "" + selectedHeroStats.getDefense();
     Resistance.text       = "" + selectedHeroStats.getResistance();
     Agility.text          = "" + selectedHeroStats.getAgility();
     Block.text            = "" + selectedHeroStats.getBlock();
     refundButtonText.text = "REFUND\n +" + (int)(selectedHeroStats.getCost() * .66f) + " REQ";
     updateAbilityButtonValidity();
 }
Пример #5
0
 private float calculateAttackSpeed()
 {
     return(Utils.calculateAttackRate(heroStats.getUnitType(), heroStats.getAgility()));
 }