//ability calculations private static Ability GetAttackStats(Ability a, GroupCombatStats gcs, int attackDesignation) { using (var db = new MinionWarsEntities()) { AbilityStats ast = db.AbilityStats.Find(attackDesignation); a.name = ast.name; a.power = ast.power; a.cooldown = 0; // ast.cooldown; a.remainingCooldown = 0; // ast.cooldown; int powerModifier = 0; if (attackDesignation == 1) { powerModifier = gcs.strength; } else { powerModifier = gcs.dexterity; } a.power += powerModifier; return(a); } }
public static Ability GenerateAbility(int line, GroupCombatStats gcs, Minion m) { Ability ability = new Ability(); int abilityDesignation = 0; if (line == 1) { abilityDesignation = m.melee_ability; } else { abilityDesignation = m.ranged_ability; } GetAbilityStats(ability, gcs, abilityDesignation); switch (abilityDesignation) { case 1: ability.effect = new Heal(); break; default: ability = null; break; } return(ability); }
public static Ability GenerateAttack(int line, GroupCombatStats gcs, Minion m) { Ability ability = new Ability(); int attackDesignation = 0; if (line == 1) { attackDesignation = 1; ability.effect = new MeleeAttack(); ability = GetAttackStats(ability, gcs, attackDesignation); } else if (line == 2) { attackDesignation = 2; ability.effect = new RangedAttack(); ability = GetAttackStats(ability, gcs, attackDesignation); } else { //GetAbilityStats(ability, gcs, m.melee_ability); attackDesignation = 1; ability.effect = new MeleeAttack(); ability = GetAttackStats(ability, gcs, attackDesignation); } return(ability); }
public void CalculateGroupStats(Battlegroup bg, int line) { GroupCombatStats stats = new GroupCombatStats(); stats.strength += Convert.ToInt32(this.minionData.strength + (this.minionData.strength * bg.str_mod)); stats.dexterity += Convert.ToInt32(this.minionData.dexterity + (this.minionData.dexterity * bg.dex_mod)); stats.vitality += Convert.ToInt32(this.minionData.vitality + (this.minionData.vitality * bg.vit_mod)); stats.health = stats.vitality * 5 * this.initialCount; stats.healthPerMinion = stats.vitality * 5; stats.power += Convert.ToInt32(this.minionData.power + (this.minionData.power * bg.pow_mod)); stats.cooldown += Convert.ToInt32(this.minionData.cooldown); stats.duration += Convert.ToInt32(this.minionData.duration); this.stats = stats; }
private static Ability GetAbilityStats(Ability a, GroupCombatStats gcs, int attackDesignation) { using (var db = new MinionWarsEntities()) { AbilityStats ast = db.AbilityStats.Find(attackDesignation); a.name = ast.name; a.power = ast.power; a.cooldown = ast.cooldown; a.duration = ast.duration; a.power += gcs.power; a.cooldown += gcs.cooldown; a.duration += gcs.duration; a.remainingCooldown = a.cooldown; return(a); } }