示例#1
0
 public override void ApplyPrimaryEffect(Squadron squadron)
 {
     squadron.SabPowers.SabotagePower.DecreaseEnemyDivergeDamage =
         IsActive()
         &&
         MathConts.ProcessChance(ChanceValue, squadron.Inspiration, GetName()) ? EffectValue + ComboEffectValue : ZERO;
 }
示例#2
0
 private void ProcessSabPower() => SabotageOffensivePower =
     MathConts.RoundNumber(
         (SabFullAttack > 0 ?
          SabFullAttack
             :
          (((SabotageOffensivePower - SabotageDecrease) / 2) + Squad.SabPowers.AttackPower.Total)) + SabOnTurnBonusAttack
         );
示例#3
0
 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);
 }
示例#4
0
 public override void ApplyPrimaryEffect(Squadron squadron)
 {
     squadron.AtkPowers.AttackPower.CriticalHit =
         IsActive()
         &&
         MathConts.ProcessChance(ChanceValue, squadron.Inspiration, GetName()) ? EffectValue + ComboEffectValue : ZERO;
 }
示例#5
0
 public override void ApplyPrimaryEffect(Squadron squadron)
 {
     squadron.AtkPowers.AttackPower.DoubleStrike =
         IsActive()
         &&
         MathConts.ProcessChance(ChanceValue + ComboEffectValue, squadron.Inspiration, GetName());
 }
示例#6
0
 public override void ApplyPrimaryEffect(Squadron squadron)
 {
     squadron.SabPowers.SabotagePower.FullDefense =
         IsActive()
         &&
         MathConts.ProcessChance(ChanceValue + ComboEffectValue, squadron.Inspiration, GetName()) ? squadron.SabPowers.SabotagePower.Total : ZERO;
 }
示例#7
0
 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);
 }
示例#8
0
 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();
 }
示例#9
0
 public override void ApplyPrimaryEffect(Squadron squadron)
 {
     if (IsActive() && !EffectApplied)
     {
         squadron.SabPowers.SabotagePower.Bonus += MathConts.GetPercentageOf(squadron.SabPowers.SabotagePower.Base, (EffectValue + ComboEffectValue));
         EffectApplied = true;
     }
 }
示例#10
0
 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));
     }
 }
示例#11
0
 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);
 }
示例#12
0
    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);
    }
示例#13
0
    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);
    }
示例#14
0
 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);
     }
 }
示例#15
0
 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;
     }
 }
示例#16
0
 public override void ApplyPrimaryEffect(Squadron squadron)
 {
     if (IsActive() && !EffectApplied)
     {
         squadron.AtkPowers.HealthPower.BonusHp =
             MathConts.GetPercentageOf(squadron.AtkPowers.HealthPower.MaxHp, EffectValue + ComboEffectValue);
         EffectApplied = true;
     }
 }
示例#17
0
 public override void ApplyPrimaryEffect(Squadron squad)
 {
     squad.DefPowers.DefensePower.StopPassiveDamage =
         IsActive()
         &&
         MathConts.ProcessChance(ChanceValue, squad.Inspiration, GetName())
             ?
         (EffectValue + ComboEffectValue)
             :
         ZERO;
 }
示例#18
0
    private void PlayTracks()
    {
        switch (MathConts.RandomInt(1, 4))
        {
        case 1: MusicTrackI.Play(); break;

        case 2: MusicTrackII.Play(); break;

        case 3: MusicTrackIII.Play(); break;
        }
    }
示例#19
0
    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;
    }
示例#20
0
 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;
     }
 }
示例#21
0
    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);
    }
示例#22
0
    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);
    }
示例#23
0
    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);
    }
示例#24
0
 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();
 }
示例#25
0
    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));
        }
    }
示例#26
0
    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);
    }
示例#27
0
    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);
    }
示例#28
0
 public static void AddRandomMenuBackground(Image background) => background.sprite        = GetSprite(BACKGROUNDS + MENU_BG + MathConts.RandomInt(1, 7));
示例#29
0
 public static void AddRandomDefinitionsBackground(Image background) => background.sprite = GetSprite(BACKGROUNDS + DEFINITIONS + MathConts.RandomInt(1, 4));
示例#30
0
 private void ProcessDefPower() => DefenseOffensivePower  = MathConts.RoundNumber(DefenseOffensivePower + DefOnTurnBonusAttack);