public override void activeSkill(Object data) { AttackBuff atkbuff = new AttackBuff (); atkbuff.duration = 3600; atkbuff.affectValue = (float)(parentController.getAttack () * 0.05); gameCtrl.attachBuffToEntityController (atkbuff, parentController); }
private void TriggerSpecialAbility() { //Hero has specail ability that allows him to raise his attack by 2 for duration of 3 turns. //This ability can be triggered once a game. if (!_abilityUsed) { _abilityUsed = true; var buff = new AttackBuff(3, 2); buff.Apply(this); Buffs.Add(buff); _specialAbilityButton.gameObject.SetActive(false); } }
//Applies buff, returns if successful public bool AddBuff(AttackBuff buff, float potency, float chance) { //If the chance roll fails, return false if (Random.Range(0f, 1f) > chance) { return(false); } //Apply buff if (ActiveBuffs.ContainsKey(buff)) { ActiveBuffs[buff] += potency; } else { ActiveBuffs[buff] = potency; } //Buff successful return(true); }