public void ExecuteAttacks(Character p_character, List <Attack> p_attackList, Boolean p_isMagic, EExecutionPhase p_executionPhase)
 {
     for (Int32 i = 0; i < m_abilities.Count; i++)
     {
         MonsterAbilityBase monsterAbilityBase = m_abilities[i];
         if (monsterAbilityBase != null && (p_executionPhase & monsterAbilityBase.ExecutionPhase) == p_executionPhase && CheckTriggerChance(monsterAbilityBase))
         {
             monsterAbilityBase.CurrentExecutionPhase = p_executionPhase;
             monsterAbilityBase.HandleAttacks(p_attackList, m_owner, p_character, p_isMagic);
         }
     }
 }
 public void ExecuteAttackResults(Character p_character, List <AttackResult> p_attackResultList, Boolean p_isMagic, Boolean p_isRanged, EExecutionPhase p_executionPhase)
 {
     for (Int32 i = 0; i < m_abilities.Count; i++)
     {
         MonsterAbilityBase monsterAbilityBase = m_abilities[i];
         if (monsterAbilityBase != null && (p_executionPhase & monsterAbilityBase.ExecutionPhase) == p_executionPhase && CheckTriggerChance(monsterAbilityBase))
         {
             monsterAbilityBase.CurrentExecutionPhase = p_executionPhase;
             monsterAbilityBase.HandleAttackResults(p_attackResultList, m_owner, p_character, p_isMagic, p_isRanged);
         }
     }
     if (p_executionPhase == EExecutionPhase.AFTER_MONSTER_ATTACK_INSTANT)
     {
         FlushActionLog(p_executionPhase);
     }
 }
        public Int32 CalculateResistanceIgnoreValue(AttackResult p_result)
        {
            MonsterAbilityBase ability = GetAbility(EMonsterAbilityType.PIERCING_STRIKES);

            if (ability == null)
            {
                return(0);
            }
            if (p_result.Result == EResultType.CRITICAL_HIT)
            {
                return((Int32)ability.StaticData.GetValues(ability.Level)[1]);
            }
            if (p_result.Result == EResultType.HIT)
            {
                Single num = Random.Range(0f, 1f);
                if (num < ability.StaticData.GetValues(ability.Level)[0])
                {
                    return((Int32)ability.StaticData.GetValues(ability.Level)[1]);
                }
            }
            return(0);
        }
 public void Add(MonsterAbilityBase p_ability)
 {
     m_abilities.Add(p_ability);
 }
 private Boolean CheckTriggerChance(MonsterAbilityBase p_monsterAbility)
 {
     return(Random.Range(0f, 1f) <= p_monsterAbility.TriggerChance);
 }