示例#1
0
        public static MonsterBuff CreateMonsterBuff(EMonsterBuffType p_type, Single p_castersMagicFactor, Int32 p_level)
        {
            MonsterBuff monsterBuff = CreateMonsterBuff(p_type, p_castersMagicFactor);

            monsterBuff.Level = p_level;
            monsterBuff.ResetDuration();
            return(monsterBuff);
        }
示例#2
0
        private void AfflictDebuffOnTargetTile(Monster p_target, EMonsterBuffType p_buff, SuffixStaticData p_suffix, Boolean p_buffEndDelayed)
        {
            List <Monster> allMonstersOnTargetTile = LegacyLogic.Instance.WorldManager.Party.GetAllMonstersOnTargetTile(p_target);

            foreach (Monster p_target2 in allMonstersOnTargetTile)
            {
                AfflictDebuff(p_target2, p_buff, p_suffix, p_buffEndDelayed);
            }
        }
示例#3
0
 private void InitBuffValues(EMonsterBuffType p_buffType)
 {
     for (Int32 i = 0; i < 10; i++)
     {
         MonsterBuff monsterBuff = BuffFactory.CreateMonsterBuff(p_buffType, GetValueForLevel(i + 1, false));
         for (Int32 j = 0; j < 3; j++)
         {
             m_buffValues[i, j] = monsterBuff.GetBuffValueForTooltip(j);
         }
     }
 }
 public MonsterBuff GetBuff(EMonsterBuffType p_buffType)
 {
     foreach (MonsterBuff monsterBuff in m_buffList)
     {
         if (monsterBuff.Type == p_buffType)
         {
             return(monsterBuff);
         }
     }
     return(null);
 }
 public Boolean HasBuff(EMonsterBuffType p_buffType)
 {
     foreach (MonsterBuff monsterBuff in m_buffList)
     {
         if (monsterBuff.Type == p_buffType)
         {
             return(true);
         }
     }
     return(false);
 }
        internal Boolean CanAddBuff(EMonsterBuffType p_buffType)
        {
            MonsterBuff monsterBuff = BuffFactory.CreateMonsterBuff(p_buffType, 1f);

            foreach (MonsterAbilityBase monsterAbilityBase in m_abilities)
            {
                if (monsterAbilityBase.IsForbiddenBuff(monsterBuff.StaticID, m_owner, true))
                {
                    return(false);
                }
            }
            return(true);
        }
示例#7
0
 public void AddMonsterBuff(Monster p_target, EMonsterBuffType p_monsterBuff, Single p_magicFactor)
 {
     if (p_target != null)
     {
         Character   selectedCharacter = LegacyLogic.Instance.WorldManager.Party.SelectedCharacter;
         MonsterBuff monsterBuff       = BuffFactory.CreateMonsterBuff(p_monsterBuff, p_magicFactor);
         monsterBuff.Causer = selectedCharacter;
         p_target.AddBuff(monsterBuff);
         if (SINGLE_TARGET_BUFFS.Contains(p_monsterBuff))
         {
             SingleTargetBuff(monsterBuff, p_target);
         }
     }
 }
示例#8
0
        private void AfflictDebuff(Monster p_target, EMonsterBuffType p_buff, SuffixStaticData p_suffix, Boolean p_buffEndDelayed)
        {
            if (p_suffix.MagicSchool != EDamageType.NONE && p_target.CombatHandler.TestEvadeSpell(p_suffix.MagicSchool, 0))
            {
                return;
            }
            MonsterBuff monsterBuff = BuffFactory.CreateMonsterBuff(p_buff, p_suffix.GetValueForLevel(m_equipment.SuffixLevel, m_equipment.ItemSlot == EItemSlot.ITEM_SLOT_2_HAND));

            monsterBuff.Causer = m_character;
            monsterBuff.DontTriggerOnFirstDamage = true;
            if (p_buffEndDelayed)
            {
                monsterBuff.Duration++;
            }
            p_target.AddBuff(monsterBuff);
            LegacyLogic.Instance.EventManager.InvokeEvent(this, EEventType.ITEM_SUFFIX_APPLY_BUFF, new ItemSuffixApplyBuffEventArgs(p_target, p_suffix.Description, p_buff));
            MonsterBuffEntryEventArgs item = new MonsterBuffEntryEventArgs(p_target, monsterBuff, p_target.BuffHandler.HasBuff(monsterBuff));

            m_logEntries.Add(item);
        }
 public ItemSuffixApplyBuffEventArgs(Monster p_targetMonster, String p_suffixKey, EMonsterBuffType p_buff)
 {
     TargetMonster = p_targetMonster;
     SuffixKey     = p_suffixKey;
     Buff          = p_buff;
 }
示例#10
0
 public MonsterBuffTarget(Object p_Target, EMonsterBuffType p_Buff, Boolean p_Successful, Boolean p_IsImmune) : base(p_Target)
 {
     Buff       = p_Buff;
     Successful = p_Successful;
     IsImmune   = p_IsImmune;
 }
示例#11
0
        public static MonsterBuff CreateMonsterBuff(EMonsterBuffType p_type, Single p_castersMagicFactor)
        {
            switch (p_type)
            {
            case EMonsterBuffType.CHILLED:
                return(new MonsterBuffChilled(p_castersMagicFactor));

            case EMonsterBuffType.FROSTBITE:
                return(new MonsterBuffFrostBite(p_castersMagicFactor));

            case EMonsterBuffType.MANASURGE:
                return(new MonsterBuffManaSurge(p_castersMagicFactor));

            case EMonsterBuffType.MEMORYGAP:
                return(new MonsterBuffMemoryGap(p_castersMagicFactor));

            case EMonsterBuffType.IMMOBILISED:
                return(new MonsterBuffImmobilised(p_castersMagicFactor));

            case EMonsterBuffType.POISONED:
                return(new MonsterBuffPoisoned(p_castersMagicFactor));

            case EMonsterBuffType.SLEEPING:
                return(new MonsterBuffSleeping(p_castersMagicFactor));

            case EMonsterBuffType.ACIDSPLASH:
                return(new MonsterBuffAcidSplash(p_castersMagicFactor));

            case EMonsterBuffType.WEAKNESS:
                return(new MonsterBuffWeakness(p_castersMagicFactor));

            case EMonsterBuffType.AGONY:
                return(new MonsterBuffAgony(p_castersMagicFactor));

            case EMonsterBuffType.TERROR:
                return(new MonsterBuffTerror(p_castersMagicFactor));

            case EMonsterBuffType.SUNDERING:
                return(new MonsterBuffSundering(p_castersMagicFactor));

            case EMonsterBuffType.BATTLESPIRIT:
                return(new MonsterBuffBattleSpirit(p_castersMagicFactor));

            case EMonsterBuffType.LIQUIDMEMBRANE:
                return(new MonsterBuffLiquidMembrane(p_castersMagicFactor));

            case EMonsterBuffType.STONESKIN:
                return(new MonsterBuffStoneSkin(p_castersMagicFactor));

            case EMonsterBuffType.MACE_STUN:
                return(new MonsterBuffMaceStun(p_castersMagicFactor));

            case EMonsterBuffType.GASH:
                return(new MonsterBuffGash(p_castersMagicFactor));

            case EMonsterBuffType.PROVOKE:
                return(new MonsterBuffProvoke(p_castersMagicFactor));

            case EMonsterBuffType.IMPRISONED:
                return(new MonsterBuffImprisoned(p_castersMagicFactor));

            case EMonsterBuffType.REGROWTH:
                return(new MonsterBuffRegrowth(p_castersMagicFactor));

            case EMonsterBuffType.HARMONY:
                return(new MonsterBuffHarmony(p_castersMagicFactor));

            case EMonsterBuffType.TIME_STOP:
                return(new MonsterBuffTimeStop(p_castersMagicFactor));

            case EMonsterBuffType.SHADOW_CLOAK:
                return(new MonsterBuffShadowCloak(p_castersMagicFactor));

            case EMonsterBuffType.CRYSTAL_SHELL:
                return(new MonsterBuffCrystalShell(p_castersMagicFactor));

            case EMonsterBuffType.OSCILLATION:
                return(new MonsterBuffOscillation(p_castersMagicFactor));

            case EMonsterBuffType.CRIPPLING_TRAP:
                return(new MonsterBuffCripplingTrap(p_castersMagicFactor));

            case EMonsterBuffType.CELESTIAL_ARMOUR:
                return(new MonsterBuffCelestialArmour(p_castersMagicFactor));

            case EMonsterBuffType.HOUR_OF_JUSTICE:
                return(new MonsterBuffHourOfJustice(p_castersMagicFactor));

            case EMonsterBuffType.FLICKERING_LIGHT:
                return(new MonsterBuffFlickeringLight(p_castersMagicFactor));

            default:
                throw new NotSupportedException("the given Type is not Supported");
            }
        }