public override void ApplyPrimaryEffect(Squadron squadron) { squadron.SabPowers.SabotagePower.DecreaseEnemyDivergeDamage = IsActive() && MathConts.ProcessChance(ChanceValue, squadron.Inspiration, GetName()) ? EffectValue + ComboEffectValue : ZERO; }
private void ProcessSabPower() => SabotageOffensivePower = MathConts.RoundNumber( (SabFullAttack > 0 ? SabFullAttack : (((SabotageOffensivePower - SabotageDecrease) / 2) + Squad.SabPowers.AttackPower.Total)) + SabOnTurnBonusAttack );
public void CalculatePassiveDamage(float attackPercentage, float defensePercentage, float sabotagePercentage) { AllGivenDamage += BleedingPower; PassiveDamageToAttack = MathConts.GetPercentageOf(BleedingPower, attackPercentage); PassiveDamageToDefense = MathConts.GetPercentageOf(BleedingPower, defensePercentage); PassiveDamageToSabotage = MathConts.GetPercentageOf(BleedingPower, sabotagePercentage); }
public override void ApplyPrimaryEffect(Squadron squadron) { squadron.AtkPowers.AttackPower.CriticalHit = IsActive() && MathConts.ProcessChance(ChanceValue, squadron.Inspiration, GetName()) ? EffectValue + ComboEffectValue : ZERO; }
public override void ApplyPrimaryEffect(Squadron squadron) { squadron.AtkPowers.AttackPower.DoubleStrike = IsActive() && MathConts.ProcessChance(ChanceValue + ComboEffectValue, squadron.Inspiration, GetName()); }
public override void ApplyPrimaryEffect(Squadron squadron) { squadron.SabPowers.SabotagePower.FullDefense = IsActive() && MathConts.ProcessChance(ChanceValue + ComboEffectValue, squadron.Inspiration, GetName()) ? squadron.SabPowers.SabotagePower.Total : ZERO; }
public void CalculateCriticalDamage(float attackPercentage, float defensePercentage, float sabotagePercentage) { AllGivenDamage += CriticalHitPower; CriticalDamageToAttack = MathConts.GetPercentageOf(CriticalHitPower, attackPercentage); CriticalDamageToDefense = MathConts.GetPercentageOf(CriticalHitPower, defensePercentage); CriticalDamageToSabotage = MathConts.GetPercentageOf(CriticalHitPower, sabotagePercentage); }
public FightersManager(EnemySquadronGenerator enemySquad) { Player = new FightStages(GameManager.Instance.CurrentPlayer.Squadron, GameManager.Instance.AbilitiesContainer, true); Enemy = new FightStages(enemySquad.Squadron, enemySquad.AbilitiesContainer, false); Player.Squad.UpdateCurrentHealth(); Enemy.Squad.UpdateCurrentHealth(); IsPlayerAttacking = MathConts.HalfChance(); }
public override void ApplyPrimaryEffect(Squadron squadron) { if (IsActive() && !EffectApplied) { squadron.SabPowers.SabotagePower.Bonus += MathConts.GetPercentageOf(squadron.SabPowers.SabotagePower.Base, (EffectValue + ComboEffectValue)); EffectApplied = true; } }
public override void ApplyPrimaryEffect(Squadron squadron) { if (IsActive() && squadron.SabPowers.HealthPower.CurrentHp > 0) { squadron.SabPowers.HealthPower.RestoreLife( MathConts.GetPercentageOf(squadron.SabPowers.HealthPower.MaxHp, EffectValue + ComboEffectValue)); } }
public void CalculateBaseDamage(float TotalDamage, float attackPercentage, float defensePercentage, float sabotagePercentage) { NormalDamage = TotalDamage; AllGivenDamage += TotalDamage; NormalDamageToAttack = MathConts.GetPercentageOf(TotalDamage, attackPercentage); NormalDamageToDefense = MathConts.GetPercentageOf(TotalDamage, defensePercentage); NormalDamageToSabotage = MathConts.GetPercentageOf(TotalDamage, sabotagePercentage); }
private void InitiliazeDefense(FightStages attacker) { float ativ = attacker.Squad.DefPowers.AttackPower.Bonus; float atx = attacker.Attack.DefOnTurnBonusAttack; float baseAttack = MathConts.RoundNumber(attacker.Squad.DefPowers.AttackPower.Base); float totalAttack = attacker.Attack.DefenseOffensivePower; attackerDefense.Initialize(attacker.Squad.DefMonster.MonsterName, ativ, atx, baseAttack, totalAttack); }
private void InitiliazeAttack(FightStages defensor) { float dfx = defensor.Squad.AtkPowers.DefensePower.Bonus; float atvii = defensor.Defense.CripleStrikeToAttack; float baseDefense = MathConts.RoundNumber(defensor.Squad.AtkPowers.DefensePower.Base); float totalDefense = defensor.Defense.AttackDefensivePower; defensorAttack.Initialize(defensor.Squad.AtkMonster.MonsterName, dfx, atvii, baseDefense, totalDefense); }
public override void ApplyPrimaryEffect(Squadron squadron) { if (IsActive() && MathConts.ProcessChance(ChanceValue, squadron.Inspiration, GetName())) { squadron.AtkPowers.AttackPower.OnTurnBonusAttack = MathConts.GetPercentageOf(squadron.AtkPowers.AttackPower.Total, EffectValue + ComboEffectValue); squadron.DefPowers.AttackPower.OnTurnBonusAttack = MathConts.GetPercentageOf(squadron.DefPowers.AttackPower.Total, EffectValue + ComboEffectValue); squadron.SabPowers.AttackPower.OnTurnBonusAttack = MathConts.GetPercentageOf(squadron.SabPowers.SabotagePower.Total / 2, EffectValue + ComboEffectValue); } }
public override void ApplyPrimaryEffect(Squadron squadron) { if (IsActive() && !EffectApplied && MathConts.ProcessChance(ChanceValue, squadron.Inspiration, GetName())) { squadron.AtkPowers.AttackPower.PassiveDamage = MathConts.GetPercentageOf(squadron.AtkPowers.AttackPower.Total, EffectValue + ComboEffectValue); EffectApplied = true; } }
public override void ApplyPrimaryEffect(Squadron squadron) { if (IsActive() && !EffectApplied) { squadron.AtkPowers.HealthPower.BonusHp = MathConts.GetPercentageOf(squadron.AtkPowers.HealthPower.MaxHp, EffectValue + ComboEffectValue); EffectApplied = true; } }
public override void ApplyPrimaryEffect(Squadron squad) { squad.DefPowers.DefensePower.StopPassiveDamage = IsActive() && MathConts.ProcessChance(ChanceValue, squad.Inspiration, GetName()) ? (EffectValue + ComboEffectValue) : ZERO; }
private void PlayTracks() { switch (MathConts.RandomInt(1, 4)) { case 1: MusicTrackI.Play(); break; case 2: MusicTrackII.Play(); break; case 3: MusicTrackIII.Play(); break; } }
private void FillPotionsValues(bool captured) { string add = "+"; int min = 0, max = captured ? 6 : 4; int hp = MathConts.RandomInt(min, max), insp = MathConts.RandomInt(min, max); HPValue.text = add + hp.ToString(); InspValue.text = add + insp.ToString(); GameManager.Instance.CurrentPlayer.HpPotions += hp; GameManager.Instance.CurrentPlayer.InspPotions += insp; }
public override void ApplyPrimaryEffect(Squadron squadron) { if (IsActive() && !EffectApplied && squadron.SabPowers.HealthPower.CurrentHp == 0) { if (MathConts.ProcessChance(ChanceValue, squadron.Inspiration, GetName())) { squadron.SabPowers.HealthPower.Revive(MathConts.GetPercentageOf(squadron.SabPowers.HealthPower.MaxHp, (EffectValue + ComboEffectValue))); } EffectApplied = true; } }
private void InitiliazeDefense(FightStages defensor) { float dfi = defensor.Squad.DefPowers.DefensePower.Bonus; float dfiii = defensor.Squad.DefPowers.DefensePower.DivergeDamageToDefense; float dfv = defensor.Squad.DefPowers.DefensePower.CriticalHitResistance; float dfix = defensor.Defense.StopBleedingPower; float sabiii = defensor.Defense.DefenseDecrease; float sabix = defensor.Defense.CriticalResistanteDecrease; float atvii = defensor.Defense.CripleStrikeToDefense; float baseDefense = MathConts.RoundNumber(defensor.Squad.DefPowers.DefensePower.Base); float totalDefense = defensor.Defense.DefenseDefensivePower; defensorDefense.Initialize(defensor.Squad.DefMonster.MonsterName, dfi, dfiii, dfv, dfix, sabiii, sabix, atvii, baseDefense, totalDefense); }
private void InitiliazeAttack(FightStages attacker) { float ati = attacker.Squad.AtkPowers.AttackPower.Bonus; float atiii = attacker.Attack.CriticalHitPower; float atv = attacker.Attack.BleedingPower; float atviii = attacker.Attack.DoubleStrikePower; float atix = attacker.Attack.AdrenalineRushPower; float atx = attacker.Attack.AtkOnTurnBonusAttack; float sabiv = attacker.Attack.AttackDecrease; float baseAttack = MathConts.RoundNumber(attacker.Squad.AtkPowers.AttackPower.Base); float totalAttack = attacker.Attack.AttackOffensivePower; attackerAttack.Initialize(attacker.Squad.AtkMonster.MonsterName, ati, atiii, atv, atviii, atix, atx, sabiv, baseAttack, totalAttack); }
private void CriplingStrike(Attack attack) { if (attack.CripleStrikePower > 0) { switch (attack.GetCripleStrikeTarget()) { case AbilityType.ATTACK: CripleStrikeToAttack = MathConts.GetPercentageOf(AttackDefensivePower, attack.CripleStrikePower); break; case AbilityType.DEFENSE: CripleStrikeToDefense = MathConts.GetPercentageOf(DefenseDefensivePower, attack.CripleStrikePower); break; case AbilityType.SABOTAGE: CripleStrikeToSabotage -= MathConts.GetPercentageOf(SabotageDefensivePower, attack.CripleStrikePower); break; } } AttackDefensivePower = MathConts.RoundNumber(AttackDefensivePower - CripleStrikeToAttack); DefenseDefensivePower = MathConts.RoundNumber(DefenseDefensivePower - CripleStrikeToDefense); SabotageDefensivePower = MathConts.RoundNumber(SabotageDefensivePower - CripleStrikeToSabotage); }
public void ProcessPowers(Defense defense) { ResetAttack(); CriticalHitPower = MathConts.ProcessPercentage( CriticalHit - GetCriticalResistanceDecrease(defense.CriticalHitResistance) , AttackOffensivePower ); BleedingPower = PassiveDamage - defense.GetPassiveDamageDecrease(PassiveDamage); ProcessAtkBasePower(); DoubleStrikePower = ApplyDoubleStrike(AttackBasePower); AdrenalineRushPower = ApplyAdrenalineRush(Squad.AtkPowers.HealthPower.CurrentHp, AttackBasePower + DoubleStrikePower); AttackDecrease = defense.GetAttackDecrease(AttackOffensivePower); SabotageDecrease = defense.GetSabotageDecrease(SabotageOffensivePower); ProcessAtkPower(); ProcessDefPower(); ProcessSabPower(); }
public void CalculatePercentagesOfDamage() { float maxPercentage = 100.0f; float totalPercentage = maxPercentage - DivergeDamageToDefense - DivergeDamageToAttack - DivergeDamageToSabotage; int numberOfMonstersAlive = HowManyAlive(); float percentageToMonsters = MathConts.RoundNumber(totalPercentage / numberOfMonstersAlive); PercentageDamageDefense = !DefenseMonsterFainted ? percentageToMonsters + DivergeDamageToDefense : 0; PercentageDamageAttack = !AttackMonsterFainted ? percentageToMonsters + DivergeDamageToAttack : 0; PercentageDamageSabotage = !SabotageMonsterFainted ? percentageToMonsters + DivergeDamageToSabotage : 0; float percentages = PercentageDamageDefense + PercentageDamageAttack + PercentageDamageSabotage; if (percentages > maxPercentage) { PercentageDamageDefense = MathConts.RoundNumber(PercentageDamageDefense - (percentages - maxPercentage)); } else { PercentageDamageDefense = MathConts.RoundNumber(PercentageDamageDefense + (maxPercentage - percentages)); } }
private void InitiliazeSabotage(FightStages defensor) { float sabi = defensor.Squad.SabPowers.SabotagePower.Bonus; float dfx_sabviii = 0.0f; if (defensor.Attack.SabFullDefense > 0) { dfx_sabviii = defensor.Defense.SabFullDefense; ImagesFillers.GetAbilityIcon(Icon_dfx_sabviii, AbilityIndex.DEFENSE10.ToString()); } else { dfx_sabviii = defensor.Squad.DefPowers.DefensePower.Bonus; ImagesFillers.GetAbilityIcon(Icon_dfx_sabviii, AbilityIndex.SABOTAGE8.ToString()); } float atvii = defensor.Defense.CripleStrikeToSabotage; float sabv = defensor.Defense.SabotageDecrease; float baseDefense = MathConts.RoundNumber(defensor.Squad.SabPowers.DefensePower.Base); float totalDefense = defensor.Defense.SabotageDefensivePower; defensorSabotage.Initialize(defensor.Squad.SabMonster.MonsterName, sabi, dfx_sabviii, atvii, sabv, baseDefense, totalDefense); }
private void InitiliazeSabotage(FightStages attacker) { float sabi = attacker.Squad.SabPowers.SabotagePower.Bonus; float ativ_sabvii = 0.0f; if (attacker.Attack.SabFullAttack > 0) { ativ_sabvii = attacker.Attack.SabFullAttack; ImagesFillers.GetAbilityIcon(Icon_ativ_sabvii, AbilityIndex.ATTACK4.ToString()); } else { ativ_sabvii = attacker.Squad.SabPowers.AttackPower.Bonus; ImagesFillers.GetAbilityIcon(Icon_ativ_sabvii, AbilityIndex.SABOTAGE7.ToString()); } float atx = attacker.Attack.SabOnTurnBonusAttack; float sabv = attacker.Attack.SabotageDecrease; float baseAttack = MathConts.RoundNumber(attacker.Squad.SabPowers.AttackPower.Base); float totalAttack = attacker.Attack.SabotageOffensivePower; attackerSabotage.Initialize(attacker.Squad.SabMonster.MonsterName, sabi, ativ_sabvii, atx, sabv, baseAttack, totalAttack); }
public static void AddRandomMenuBackground(Image background) => background.sprite = GetSprite(BACKGROUNDS + MENU_BG + MathConts.RandomInt(1, 7));
public static void AddRandomDefinitionsBackground(Image background) => background.sprite = GetSprite(BACKGROUNDS + DEFINITIONS + MathConts.RandomInt(1, 4));
private void ProcessDefPower() => DefenseOffensivePower = MathConts.RoundNumber(DefenseOffensivePower + DefOnTurnBonusAttack);