protected override void HandleMonsterBuffs(Character p_sorcerer, SpellEventArgs p_result, Monster p_target, Single p_magicFactor)
 {
     if (!p_target.AbilityHandler.HasAbility(EMonsterAbilityType.LARGE))
     {
         base.HandleMonsterBuffs(p_sorcerer, p_result, p_target, p_magicFactor);
     }
     else
     {
         MonsterAbilityBase        ability = p_target.AbilityHandler.GetAbility(EMonsterAbilityType.LARGE);
         AbilityTriggeredEventArgs p_args  = new AbilityTriggeredEventArgs(p_target, ability);
         p_target.AbilityHandler.AddEntry(ability.ExecutionPhase, p_args);
     }
 }
示例#2
0
        protected override void CheckAIEvents()
        {
            UpdateAbilityChances();
            MonsterAbilityBase ability = m_owner.AbilityHandler.GetAbility(EMonsterAbilityType.CURLING);

            ability.TriggerChance = m_currentTreshholdCurling;
            MonsterAbilityBase ability2 = m_owner.AbilityHandler.GetAbility(EMonsterAbilityType.PUSH);

            ability2.TriggerChance = m_currentTreshholdPush;
            for (Int32 i = 0; i < m_aiEvents.Count; i++)
            {
                m_aiEvents[i].Update();
            }
        }
        public void SetEntry(MonsterStaticData p_data, Int32 p_amountKilled)
        {
            m_stages        = p_data.BestiaryThresholds;
            m_currentAmount = p_amountKilled;
            if (p_data.Grade == EMonsterGrade.CHAMPION || p_data.Grade == EMonsterGrade.BOSS)
            {
                m_currentAmount = p_data.BestiaryThresholds[2];
            }
            m_progressBar.SetCurrentAmount(m_currentAmount, p_data.BestiaryThresholds[2]);
            Int32 num;

            if (LegacyLogic.Instance.WorldManager.Difficulty == EDifficulty.HARD)
            {
                switch (p_data.Grade)
                {
                case EMonsterGrade.CORE:
                    num = (Int32)(p_data.MaxHealthpoints * ConfigManager.Instance.Game.MonsterHealthCoreFactor);
                    break;

                case EMonsterGrade.ELITE:
                    num = (Int32)(p_data.MaxHealthpoints * ConfigManager.Instance.Game.MonsterHealthEliteFactor);
                    break;

                case EMonsterGrade.CHAMPION:
                    num = (Int32)(p_data.MaxHealthpoints * ConfigManager.Instance.Game.MonsterHealthChampionFactor);
                    break;

                default:
                    num = p_data.MaxHealthpoints;
                    break;
                }
            }
            else
            {
                num = p_data.MaxHealthpoints;
            }
            String p_text = String.Empty;

            if (p_data.MeleeAttackDamageMin == p_data.MeleeAttackDamageMax)
            {
                p_text = p_data.MeleeAttackDamageMin.ToString();
            }
            else
            {
                p_text = p_data.MeleeAttackDamageMin + "-" + p_data.MeleeAttackDamageMax;
            }
            m_maxHp.UpdateLabel(num.ToString(), LocaManager.GetText("BESTIARY_STAT_ATTRIBUTE_HEALTH_TT"));
            m_meleeDmg.UpdateLabel(p_text, LocaManager.GetText("BESTIARY_STAT_ATTACK_DAMAGE_TT"));
            m_meleeStrikes.UpdateLabel(p_data.MeleeAttackStrikesAmount.ToString(), LocaManager.GetText("BESTIARY_STAT_STRIKES_TT"));
            m_critMelee.UpdateLabel(p_data.CriticalDamageMelee.ToString(), LocaManager.GetText("BESTIARY_STAT_ATTACK_CRIT_DAMAGE_TT", p_data.CriticalDamageMelee * 100f));
            m_meleeAttackValue.UpdateLabel(p_data.MeleeAttackValue.ToString(), LocaManager.GetText("BESTIARY_STAT_ATTACK_VALUE_TT"));
            for (Int32 i = 0; i < m_spells.Count; i++)
            {
                m_spells[i].ShowEntry(true);
                if (p_data.Spells.Length > i)
                {
                    MonsterSpellStaticData staticData   = StaticDataHandler.GetStaticData <MonsterSpellStaticData>(EDataType.MONSTER_SPELLS, p_data.Spells[i].SpellID);
                    MonsterSpell           monsterSpell = SpellFactory.CreateMonsterSpell((EMonsterSpell)staticData.StaticID, staticData.EffectKey, p_data.Spells[i].SpellProbability);
                    m_spells[i].ShowEntry(true);
                    m_spells[i].UpdateEntry(staticData.Icon);
                    StringBuilder stringBuilder = new StringBuilder();
                    stringBuilder.Append(m_headLineColorHex);
                    stringBuilder.Append(LocaManager.GetText(monsterSpell.NameKey));
                    stringBuilder.Append("[-]");
                    stringBuilder.Append(Environment.NewLine);
                    stringBuilder.Append(m_textColorHex);
                    stringBuilder.Append(monsterSpell.GetDescriptionForCaster(p_data));
                    stringBuilder.Append("[-]");
                    m_spells[i].SetTooltip(stringBuilder.ToString());
                }
                else
                {
                    m_spells[i].ShowEntry(false);
                }
            }
            if (p_data.AttackRange > 1 && p_data.Spells.Length == 0)
            {
                m_rangeDmg.gameObject.SetActive(true);
                m_rangeStrikes.gameObject.SetActive(true);
                m_rangeAttackValue.gameObject.SetActive(true);
                m_rangeAttackRange.gameObject.SetActive(true);
                m_critRange.gameObject.SetActive(true);
                m_critMagic.gameObject.SetActive(false);
                String p_text2 = String.Empty;
                if (p_data.RangedAttackDamageMin == p_data.RangedAttackDamageMax)
                {
                    p_text2 = p_data.RangedAttackDamageMin.ToString();
                }
                else
                {
                    p_text2 = p_data.RangedAttackDamageMin + "-" + p_data.RangedAttackDamageMax;
                }
                m_rangeDmg.UpdateLabel(p_text2, LocaManager.GetText("BESTIARY_STAT_ATTACK_DAMAGE_TT", p_data.RangedAttackDamage.Value.ToString()));
                m_rangeStrikes.UpdateLabel(p_data.RangedAttackStrikesAmount.ToString(), LocaManager.GetText("BESTIARY_STAT_STRIKES_TT", p_data.RangedAttackStrikesAmount.ToString()));
                m_rangeAttackValue.UpdateLabel(p_data.RangedAttackValue.ToString(), LocaManager.GetText("BESTIARY_STAT_ATTACK_VALUE_TT", p_data.RangedAttackValue.ToString()));
                m_rangeAttackRange.UpdateLabel(p_data.AttackRange.ToString(), LocaManager.GetText("MONSTER_ATTACK_RANGE_TT", p_data.AttackRange.ToString()));
                m_critRange.UpdateLabel(p_data.CriticalDamageRanged.ToString(), LocaManager.GetText("BESTIARY_STAT_ATTACK_CRIT_DAMAGE_TT", p_data.CriticalDamageRanged * 100f));
                m_labelRangedMagic.text = LocaManager.GetText("GUI_CHARACTER_STATS_RANGED");
                for (Int32 j = 0; j < m_spells.Count; j++)
                {
                    m_spells[j].ShowEntry(false);
                }
            }
            else if (p_data.Spells.Length > 0)
            {
                m_rangeDmg.gameObject.SetActive(false);
                m_rangeStrikes.gameObject.SetActive(false);
                m_rangeAttackValue.gameObject.SetActive(false);
                m_rangeAttackRange.gameObject.SetActive(false);
                m_critRange.gameObject.SetActive(false);
                m_critMagic.gameObject.SetActive(true);
                m_labelRangedMagic.text = LocaManager.GetText("GUI_CHARACTER_STATS_MAGIC");
            }
            else
            {
                m_rangeDmg.gameObject.SetActive(true);
                m_rangeStrikes.gameObject.SetActive(true);
                m_rangeAttackValue.gameObject.SetActive(true);
                m_rangeAttackRange.gameObject.SetActive(true);
                m_critRange.gameObject.SetActive(true);
                m_critMagic.gameObject.SetActive(false);
                for (Int32 k = 0; k < m_spells.Count; k++)
                {
                    m_spells[k].ShowEntry(false);
                }
                m_labelRangedMagic.text = LocaManager.GetText("GUI_CHARACTER_STATS_RANGED");
                m_rangeDmg.UpdateLabel("-", LocaManager.GetText("BESTIARY_STAT_ATTACK_DAMAGE_TT", "-"));
                m_rangeStrikes.UpdateLabel("-", LocaManager.GetText("BESTIARY_STAT_STRIKES_TT", "-"));
                m_rangeAttackValue.UpdateLabel("-", LocaManager.GetText("BESTIARY_STAT_ATTACK_VALUE_TT", "-"));
                m_rangeAttackRange.UpdateLabel("-", LocaManager.GetText("MONSTER_ATTACK_RANGE_TT", "-"));
                m_critRange.UpdateLabel("-", LocaManager.GetText("BESTIARY_STAT_ATTACK_CRIT_DAMAGE_TT", "-"));
            }
            m_armor.UpdateLabel(p_data.ArmorValue.ToString(), LocaManager.GetText("BESTIARY_STAT_ARMOR_VALUE_TT", p_data.ArmorValue.ToString()));
            m_blockAttempts.UpdateLabel(p_data.GeneralBlockAttemptsPerTurn.ToString(), LocaManager.GetText("BESTIARY_STAT_BLOCK_ATTEMPTS_TT", p_data.GeneralBlockAttemptsPerTurn.ToString()));
            m_evade.UpdateLabel(p_data.EvadeValue.ToString(), LocaManager.GetText("BESTIARY_STAT_EVADE_VALUE_TT", p_data.EvadeValue.ToString()));
            if (p_data.CriticalDamageSpells > 0f)
            {
                m_critMagic.UpdateLabel(p_data.CriticalDamageSpells.ToString(), LocaManager.GetText("BESTIARY_STAT_MAGIC_CRIT_CHANCE_TT", p_data.CriticalDamageSpells * 100f));
            }
            else
            {
                m_critMagic.UpdateLabel("-", LocaManager.GetText("BESTIARY_STAT_MAGIC_CRIT_CHANCE_TT", "-"));
            }
            NGUITools.SetActive(m_abilityFrame, true);
            if (p_data.Abilities.Length == 0)
            {
                NGUITools.SetActive(m_abilityFrame, false);
            }
            for (Int32 l = 0; l < m_specials.Count; l++)
            {
                if (p_data.Abilities.Length > l)
                {
                    m_specials[l].ShowEntry(true);
                    MonsterAbilityBase monsterAbilityBase = AbilityFactory.CreateMonsterAbility(p_data.Abilities[l].AbilityType, p_data.MagicPower);
                    monsterAbilityBase.Level = p_data.Abilities[l].Level;
                    m_specials[l].UpdateEntry(monsterAbilityBase.StaticData.Icon);
                    StringBuilder stringBuilder2 = new StringBuilder();
                    stringBuilder2.Append(m_headLineColorHex);
                    stringBuilder2.Append(LocaManager.GetText(monsterAbilityBase.StaticData.NameKey));
                    stringBuilder2.Append("[-]");
                    stringBuilder2.Append(Environment.NewLine);
                    stringBuilder2.Append(m_textColorHex);
                    stringBuilder2.Append(monsterAbilityBase.GetDescription());
                    stringBuilder2.Append("[-]");
                    m_specials[l].SetTooltip(stringBuilder2.ToString());
                }
                else
                {
                    m_specials[l].ShowEntry(false);
                }
            }
            m_resiPrimordial.UpdateLabel("0", LocaManager.GetText("BESTIARY_STAT_RESISTANCE_PRIMORDIAL_TT", 0, 0));
            m_resiFire.UpdateLabel("0", LocaManager.GetText("BESTIARY_STAT_RESISTANCE_FIRE_TT", 0, 0));
            m_resiWater.UpdateLabel("0", LocaManager.GetText("BESTIARY_STAT_RESISTANCE_WATER_TT", 0, 0));
            m_resiEarth.UpdateLabel("0", LocaManager.GetText("BESTIARY_STAT_RESISTANCE_EARTH_TT", 0, 0));
            m_resiAir.UpdateLabel("0", LocaManager.GetText("BESTIARY_STAT_RESISTANCE_AIR_TT", 0, 0));
            m_resiLight.UpdateLabel("0", LocaManager.GetText("BESTIARY_STAT_RESISTANCE_LIGHT_TT", 0, 0));
            m_resiDark.UpdateLabel("0", LocaManager.GetText("BESTIARY_STAT_RESISTANCE_DARK_TT", 0, 0));
            foreach (Resistance resistance in p_data.MagicResistances)
            {
                switch (resistance.Type)
                {
                case EDamageType.AIR:
                    m_resiAir.UpdateLabel(resistance.Value.ToString(), LocaManager.GetText("BESTIARY_STAT_RESISTANCE_AIR_TT", resistance.Value * (p_data.EvadeValue / 100), resistance.Value));
                    break;

                case EDamageType.EARTH:
                    m_resiEarth.UpdateLabel(resistance.Value.ToString(), LocaManager.GetText("BESTIARY_STAT_RESISTANCE_EARTH_TT", resistance.Value * (p_data.EvadeValue / 100), resistance.Value));
                    break;

                case EDamageType.FIRE:
                    m_resiFire.UpdateLabel(resistance.Value.ToString(), LocaManager.GetText("BESTIARY_STAT_RESISTANCE_FIRE_TT", resistance.Value * (p_data.EvadeValue / 100), resistance.Value));
                    break;

                case EDamageType.WATER:
                    m_resiWater.UpdateLabel(resistance.Value.ToString(), LocaManager.GetText("BESTIARY_STAT_RESISTANCE_WATER_TT", resistance.Value * (p_data.EvadeValue / 100), resistance.Value));
                    break;

                case EDamageType.DARK:
                    m_resiDark.UpdateLabel(resistance.Value.ToString(), LocaManager.GetText("BESTIARY_STAT_RESISTANCE_DARK_TT", resistance.Value * (p_data.EvadeValue / 100), resistance.Value));
                    break;

                case EDamageType.LIGHT:
                    m_resiLight.UpdateLabel(resistance.Value.ToString(), LocaManager.GetText("BESTIARY_STAT_RESISTANCE_LIGHT_TT", resistance.Value * (p_data.EvadeValue / 100), resistance.Value));
                    break;

                case EDamageType.PRIMORDIAL:
                    m_resiPrimordial.UpdateLabel(resistance.Value.ToString(), LocaManager.GetText("BESTIARY_STAT_RESISTANCE_PRIMORDIAL_TT", resistance.Value * (p_data.EvadeValue / 100), resistance.Value));
                    break;
                }
            }
            HideLockedEntries();
        }
        protected virtual void PushBack(Monster p_monster, SpellEventArgs p_result)
        {
            if (p_monster.CurrentHealth <= 0)
            {
                return;
            }
            if (p_monster.AbilityHandler.HasAbility(EMonsterAbilityType.LARGE) || p_monster.AbilityHandler.HasAbility(EMonsterAbilityType.BOSS) || p_monster.AbilityHandler.HasAbility(EMonsterAbilityType.STATIC_OBJECT) || p_monster.AbilityHandler.HasAbility(EMonsterAbilityType.SPIRIT_BOUND))
            {
                p_result.SpellTargets.Add(new PushedTarget(p_monster, p_monster.Position, false));
                if (p_monster.AbilityHandler.HasAbility(EMonsterAbilityType.LARGE))
                {
                    MonsterAbilityBase        ability = p_monster.AbilityHandler.GetAbility(EMonsterAbilityType.LARGE);
                    AbilityTriggeredEventArgs p_args  = new AbilityTriggeredEventArgs(p_monster, ability);
                    p_monster.AbilityHandler.AddEntry(ability.ExecutionPhase, p_args);
                }
                else if (p_monster.AbilityHandler.HasAbility(EMonsterAbilityType.BOSS))
                {
                    MonsterAbilityBase        ability2 = p_monster.AbilityHandler.GetAbility(EMonsterAbilityType.BOSS);
                    AbilityTriggeredEventArgs p_args2  = new AbilityTriggeredEventArgs(p_monster, ability2);
                    p_monster.AbilityHandler.AddEntry(ability2.ExecutionPhase, p_args2);
                }
                else if (p_monster.AbilityHandler.HasAbility(EMonsterAbilityType.STATIC_OBJECT))
                {
                    MonsterAbilityBase        ability3 = p_monster.AbilityHandler.GetAbility(EMonsterAbilityType.STATIC_OBJECT);
                    AbilityTriggeredEventArgs p_args3  = new AbilityTriggeredEventArgs(p_monster, ability3);
                    p_monster.AbilityHandler.AddEntry(ability3.ExecutionPhase, p_args3);
                }
                else if (p_monster.AbilityHandler.HasAbility(EMonsterAbilityType.SPIRIT_BOUND))
                {
                    MonsterAbilityBase        ability4 = p_monster.AbilityHandler.GetAbility(EMonsterAbilityType.SPIRIT_BOUND);
                    AbilityTriggeredEventArgs p_args4  = new AbilityTriggeredEventArgs(p_monster, ability4);
                    p_monster.AbilityHandler.AddEntry(ability4.ExecutionPhase, p_args4);
                }
                return;
            }
            Position   position  = p_monster.Position;
            Party      party     = LegacyLogic.Instance.WorldManager.Party;
            Grid       grid      = LegacyLogic.Instance.MapLoader.Grid;
            EDirection direction = EDirectionFunctions.GetDirection(party.Position, p_monster.Position);

            for (Int32 i = 0; i < m_PushCount; i++)
            {
                if (!grid.CanMoveEntity(p_monster, direction))
                {
                    break;
                }
                Position p_pos = p_monster.Position + direction;
                GridSlot slot  = grid.GetSlot(p_monster.Position);
                if (grid.GetSlot(p_pos).AddEntity(p_monster))
                {
                    if (party.SelectedMonster == p_monster)
                    {
                        party.SelectedMonster = null;
                    }
                    slot.RemoveEntity(p_monster);
                }
            }
            if (position != p_monster.Position)
            {
                p_result.SpellTargets.Add(new PushedTarget(p_monster, p_monster.Position, true));
            }
        }
示例#5
0
 public AbilityEventArgs(Monster p_monster, MonsterAbilityBase p_ability)
 {
     m_monster = p_monster;
     m_ability = p_ability;
 }