Пример #1
0
        public override double GetBonusBaseDamageMultiplier(IPlayer player, ISpell spell, decimal rageBeforeCast)
        {
            double bonusBaseDamageMultiplier = 0;

            if (LetLooseBonus)
            {
                // if using "Rampage" causes you to become Enraged increase base damage,

                if (spell.GetType() == typeof(Demolish) || spell.GetType() == typeof(DemolishRage))
                {
                    // Demolish: 30 %
                    bonusBaseDamageMultiplier += 0.3;
                    LetLooseBonus              = false; // Buff consumed
                }
                else if (_hasAnnihilate &&
                         (spell.GetType() == typeof(Eruption) || spell.GetType() == typeof(EruptionRage)))
                {
                    // Eruption with Annihilate Passive: 20%
                    bonusBaseDamageMultiplier += 0.2;
                    LetLooseBonus              = false; // Buff consumed
                }
            }

            if (FastAndFuriousBonus)
            {
                bonusBaseDamageMultiplier += _fastAndFurious.BaseDamageModifier;
            }

            return(bonusBaseDamageMultiplier);
        }
        public bool SpellAllowed(ISpell s)
        {
            Type stype = s.GetType();

            foreach (Type type in m_BeneficialTypes)
                if (type == stype)
                {
                    m_Spell = s.GetType();
                    return true;
                }

            if (s.GetType() == m_Spell)
                m_CastCount++;

            else
            {
                m_Spell = s.GetType();
                m_CastCount = 1;
            }

            if (m_CastCount > 3)
            {
                m_Part.SendMessage("You have already tried to cast that spell three times in a row!");
                return false;
            }

            return true;
        }
Пример #3
0
        private void PneumaticMaul(IPlayer player, RoundResult rr, ISpell spell)
        {
            // On critical hit with a Hammer ability
            // gain the benefits of the Enrage bonus effects on your abilities without spending any Rage and without being Enraged.
            // This effect can only occur once every 9 seconds.

            var pneumaticBuffActive = _pneumaticStamp >= player.CurrentTimeSec;

            // Buff is up but used
            if (pneumaticBuffActive && !PneumaticAvailable)
            {
                return;
            }

            // Buff is up and not used
            if (pneumaticBuffActive && PneumaticAvailable)
            {
                if (spell.GetType() == typeof(DemolishRage) || spell.GetType() == typeof(EruptionRage))
                {
                    // Buff consumed
                    PneumaticAvailable = false;
                    return;
                }
            }

            // Buff is not up and not on cooldown
            var attack = rr.Attacks.FirstOrDefault(a => a.Spell == spell);

            if (attack != null && attack.IsCrit)
            {
                // Activate buff and set to available
                PneumaticAvailable = true;
                _pneumaticStamp    = player.CurrentTimeSec + 9;
            }
        }
Пример #4
0
        public virtual bool CheckSpellCast(Mobile caster, ISpell spell)
        {
            if (caster == null || caster.Deleted || spell == null)
            {
                return(false);
            }

            if (!DebugMode && caster.AccessLevel >= AccessLevel.Counselor)
            {
                return(true);
            }

            if (!(spell is Spell))
            {
                return(true);
            }

            if (!Options.Rules.CanFly)
            {
                var t = spell.GetType();

                if (t.Name.ContainsAny("FlySpell", "FlightSpell"))
                {
                    return(false);
                }
            }

            return(!Options.Restrictions.Spells.IsRestricted((Spell)spell));
        }
Пример #5
0
        protected void ValidateAttack(ISpell spellToCast)
        {
            if (this.Unit.EnergyPoints < spellToCast.EnergyCost)
                throw new NotEnoughEnergyException(string.Format("{0} does not have enough energy to cast {1}", unit.Name, spellToCast.GetType().Name));

            unit.EnergyPoints -= spellToCast.EnergyCost;
        }
 public void ValidateEnergyPoints(IUnit unit, ISpell spell)
 {
     if (unit.EnergyPoints < spell.EnergyCost)
     {
         throw new NotEnoughEnergyException(
             string.Format("{0} does not have enough energy to cast {1}", unit.Name, spell.GetType().Name));
     }
 }
Пример #7
0
 public void ValidateEnergy(ISpell attack)
 {
     if (this.Unit.EnergyPoints - attack.EnergyCost < 0)
        {
        throw new NotEnoughEnergyException(String.Format(GlobalMessages.NotEnoughEnergy, this.Unit.Name,
            attack.GetType().Name));
        }
 }
 public void ValidateEnergyPoints(IUnit unit, ISpell spell)
 {
     if (unit.EnergyPoints < spell.EnergyCost)
     {
         throw new NotEnoughEnergyException(
                   string.Format(GlobalMessages.NotEnoughEnergy, unit.Name, spell.GetType().Name));
     }
 }
Пример #9
0
        internal bool HasIgnore(ISpell ispellEntity, string wordToCheck)
        {
            if (!_ignoreWords.ContainsKey(ispellEntity.GetId()))
            {
                _ignoreWords.Add(ispellEntity.GetId(), AryaTools.Instance.InstanceData.Dc.IgnoreWords.Where(iv => iv.EntityType == ispellEntity.GetType().ToString() && iv.EntityID == ispellEntity.GetId()).ToList());
            }

            return(_ignoreWords[ispellEntity.GetId()].Any(iw => iw.EntityType == ispellEntity.GetType().ToString() && iw.Value == wordToCheck));
        }
Пример #10
0
        public static bool HasEnoughEnergy(IUnit unit, ISpell spell)
        {
            if (unit.EnergyPoints - spell.EnergyCost < 0)
            {
                var message = string.Format(GlobalMessages.NotEnoughEnergy, unit.Name, spell.GetType().Name);
                throw new NotEnoughEnergyException(message);
            }

            return true;
        }
Пример #11
0
        public override void AfterAttack(IPlayer player, ISpell spell, RoundResult rr)
        {
            var roll = Rnd.Next(1, 6);

            if (player.Settings.PrimaryWeaponProc == WeaponProc.IfritanDespoiler)
            {
                if (spell.GetType() == typeof(DragonBreath))
                {
                    _ifritanDespoilerCounter += 2;
                }
                if (spell.GetType() == typeof(DepletedUranium))
                {
                    _ifritanDespoilerCounter++;
                }
                if (_ifritanDespoilerCounter >= 12)
                {
                    player.AddBonusAttack(rr, new IfritanDespoiler(player, ""));
                    _ifritanDespoilerCounter = 0;
                }
            }

            if (player.Settings.PrimaryWeaponProc == WeaponProc.Spesc221 && GimmickResource < _shellstamp && roll == 5)
            {
                player.AddBonusAttack(rr, new SpesC221());
            }

            // Not all spells should procc gimmick
            if (spell.GetType() == typeof(Reload) || spell.GetType() == typeof(ShellSalvage))
            {
                return;
            }

            if (Rnd.Next(1, 3) == 1)
            {
                // TODO: Check & FIX DOT duration/stacks and assume perfect play by default
                // in weapon-model so APL does not have to worry about it at all.
                player.AddBonusAttack(rr, new DragonBreath());
            }
            else
            {
                player.AddBonusAttack(rr, new DepletedUranium());
            }
        }
 protected void IsThereEnoughEnergy(ISpell attack)
 {
     if (this.Unit.EnergyPoints < attack.EnergyCost)
     {
         throw new NotEnoughEnergyException(string.Format(
             GlobalMessages.NotEnoughEnergy,
             this.Unit.Name,
             attack.GetType().Name));
     }
 }
Пример #13
0
 public void CastSpell(Player player, ISpell spell)
 {
     player.CastSpell(spell);
     if (spell.GetType() == typeof(Shield))
     {
         player.IsShielded = true;
     }
     if (!spell.Target.IsShielded)
     {
         spell.Target.Health -= spell.Damage;
     }
 }
Пример #14
0
 public void CastSpell(Player player, ISpell spell)
 {
     player.CastSpell(spell);
     if (spell.GetType() == typeof (Shield))
     {
         player.IsShielded = true;
     }
     if (!spell.Target.IsShielded)
     {
         spell.Target.Health -= spell.Damage;
     }
     
 }
Пример #15
0
        public int GetRegistryNumber(ISpell s)
        {
            Type[] t = SpellRegistry.Types;

            for (int i = 0; i < t.Length; i++)
            {
                if (s.GetType() == t[i])
                {
                    return(i);
                }
            }

            return(-1);
        }
Пример #16
0
        protected override void OnSpellCastDeny(Mobile caster, ISpell spell)
        {
            if (Crystal != null && !Crystal.Deleted && Crystal.Carrier == caster && spell != null)
            {
                Type st = spell.GetType();

                if (_NoCarrySpellCasts.Contains(st))
                {
                    string name = spell is Spell ? ((Spell)spell).Name : st.Name.Replace("Spell", String.Empty).SpaceWords();

                    caster.SendMessage(33, "You cannot cast {0} while holding the Crystal of Power!", name);
                    return;
                }
            }

            base.OnSpellCastDeny(caster, spell);
        }
Пример #17
0
        internal void AddToIgnore(string wordToIgnore, ISpell ispellEntity)
        {
            if (HasIgnore(ispellEntity, wordToIgnore))
            {
                return;
            }

            Arya.Data.IgnoreWord currntIgnoredWord = new Arya.Data.IgnoreWord
            {
                EntityID   = ispellEntity.GetId(),
                EntityType = ispellEntity.GetType().ToString(),
                Value      = wordToIgnore
            };

            if (!_ignoreWords.ContainsKey(ispellEntity.GetId()))
            {
                _ignoreWords.Add(ispellEntity.GetId(), new List <Data.IgnoreWord>());
            }
            _ignoreWords[ispellEntity.GetId()].Add(currntIgnoredWord);

            AryaTools.Instance.InstanceData.Dc.IgnoreWords.InsertOnSubmit(currntIgnoredWord);
            AryaTools.Instance.SaveChangesIfNecessary(false, false);
        }
Пример #18
0
        public override void OnHit(IPlayer player, ISpell spell, decimal rageBeforeCast)
        {
            // TODO: Save enrage states between rounds instead

            if (_hasLetLoose && spell.GetType() == typeof(Rampage))
            {
                // Enraged status before attack
                var enraged50ba  = rageBeforeCast >= 50 && rageBeforeCast < 100;
                var enraged100ba = rageBeforeCast >= 100 && rageBeforeCast > 50;

                // Enraged status after attack
                var enraged50aa  = GimmickResource >= 50 && GimmickResource < 100;
                var enraged100aa = GimmickResource >= 100;

                var rampageMadeUsEnraged = false;

                // Has any enraged treshold passed since since last time
                if (!enraged50ba && enraged50aa)
                {
                    // Passed 50 treshold
                    rampageMadeUsEnraged = true;
                }
                else if (!enraged100ba && enraged50ba && enraged100aa)
                {
                    // Reached 100 treshold
                    rampageMadeUsEnraged = true;
                }

                // If Rampage attack made us enraged
                if (rampageMadeUsEnraged)
                {
                    // Consumable buff to Hammer that are used on next Demolish or Eruption
                    LetLooseBonus = true;
                }
            }
        }
Пример #19
0
 public static int GetRegistryNumber(ISpell s)
 {
     return(GetRegistryNumber(s.GetType()));
 }
Пример #20
0
		public static int GetRegistryNumber( ISpell s ) {
			Type[] t = SpellRegistry.Types;

			for( int i = 0; i < t.Length; i++ ) {
				if( s.GetType() == t[i] )
					return i;
			}

			return -1;
		}
Пример #21
0
        public override bool CheckSpellCast(Mobile caster, ISpell spell)
        {
            if (!base.CheckSpellCast(caster, spell))
            {
                return(false);
            }

            if (Crystal != null && !Crystal.Deleted && Crystal.Carrier == caster && spell != null && _NoCarrySpellCasts.Contains(spell.GetType()))
            {
                return(false);
            }

            return(true);
        }
Пример #22
0
        // Using a pistol ability triggers Chamber Roulette if it hits
        // Matching Chambers lasts for 3 seconds
        public override void AfterAttack(IPlayer player, ISpell spell, RoundResult rr)
        {
            var timeSinceLocked = player.CurrentTimeSec - ChamberLockTimeStamp;

            LastPistolSpellTimeStamp = player.CurrentTimeSec + spell.CastTime;

            if (_focusedFire != null && LeftChamber != RightChamber && spell.GetType() == typeof(KillBlind))
            {
                LeftChamber  = Chamber.White;
                RightChamber = Chamber.White;
            }

            if (timeSinceLocked > 3)
            {
                if (_holdout != null && LeftChamber == RightChamber)
                {
                    if (Rnd.Next(1, 4) < 3 && spell.GetType() == typeof(Unload))
                    {
                        ChamberRoulette(player);
                    }
                }
                else
                {
                    ChamberRoulette(player);
                }
            }

            if (LeftChamber == RightChamber)
            {
                if (_jackpot != null)
                {
                    _jackpotBonus = timeSinceLocked <= 3;
                }

                if (_winStreak != null)
                {
                    player.AddBonusAttack(rr, new WinStreak(GetRandomNumber(0.06, 0.335)));
                }

                if (_flechetteRounds != null)
                {
                    player.AddBonusAttack(rr, new FlechetteRounds());
                }

                switch (LeftChamber)
                {
                case Chamber.White:
                    if (_annihilators)
                    {
                        player.AddBonusAttack(rr, new Cb3Annihilators(player));
                    }
                    if (_harmonisers)
                    {
                        if (Rnd.Next(1, 5) == 4)
                        {
                            LeftChamber  = Chamber.Blue;
                            RightChamber = Chamber.Blue;
                            player.AddBonusAttack(rr, new BlueChambers(player));
                        }
                        else
                        {
                            player.AddBonusAttack(rr, new WhiteChambers(player));
                        }
                    }
                    else
                    {
                        player.AddBonusAttack(rr, new WhiteChambers(player));
                    }
                    break;

                case Chamber.Blue:
                    if (_annihilators)
                    {
                        player.AddBonusAttack(rr, new Cb3Annihilators(player));
                    }
                    if (_harmonisers)
                    {
                        if (Rnd.Next(1, 101) <= 15)
                        {
                            LeftChamber  = Chamber.Red;
                            RightChamber = Chamber.Red;
                            player.AddBonusAttack(rr, new RedChambers(player));
                        }
                        else
                        {
                            player.AddBonusAttack(rr, new BlueChambers(player));
                        }
                    }
                    else
                    {
                        player.AddBonusAttack(rr, new BlueChambers(player));
                    }
                    break;

                case Chamber.Red:
                    if (_annihilators)
                    {
                        player.AddBonusAttack(rr, new Cb3Annihilators(player));
                    }
                    player.AddBonusAttack(rr, new RedChambers(player));
                    break;
                }
            }
            else
            {
                _jackpotBonus = false;
            }
        }
Пример #23
0
 public static int GetCircle(ISpell s)
 {
     return(s != null?GetCircle(s.GetType()) : 0);
 }
Пример #24
0
		public static int GetRegistryNumber( ISpell s )
		{
			return GetRegistryNumber( s.GetType() );
		}
Пример #25
0
		public override bool CheckSpellCast(Mobile caster, ISpell spell)
		{
			if (!base.CheckSpellCast(caster, spell))
			{
				return false;
			}

			if (Crystal != null && !Crystal.Deleted && Crystal.Carrier == caster && spell != null && _NoCarrySpellCasts.Contains(spell.GetType()))
			{
				return false;
			}

			return true;
		}
Пример #26
0
		public static SpellInfo GetSpellInfo(ISpell s)
		{
			return s != null ? GetSpellInfo(s.GetType()) : null;
		}
Пример #27
0
 public static int GetItemIcon(ISpell s)
 {
     return(s != null?GetItemIcon(s.GetType()) : 0);
 }
Пример #28
0
 public static int GetRegistryNumber(ISpell s)
 {
     return(s != null?GetRegistryNumber(s.GetType()) : -1);
 }
Пример #29
0
 public void ValidateEnergyPoints(IUnit unit, ISpell spell)
 {
     if (unit.EnergyPoints < spell.EnergyCost)
     {
         throw new NotEnoughEnergyException(
                   string.Format("{0} does not have enough energy to cast {1}", unit.Name, spell.GetType().Name));
     }
 }
Пример #30
0
		protected override void OnSpellCastDeny(Mobile caster, ISpell spell)
		{
			if (Crystal != null && !Crystal.Deleted && Crystal.Carrier == caster && spell != null)
			{
				Type st = spell.GetType();

				if (_NoCarrySpellCasts.Contains(st))
				{
					string name = spell is Spell ? ((Spell)spell).Name : st.Name.Replace("Spell", String.Empty).SpaceWords();

					caster.SendMessage(33, "You cannot cast {0} while holding the Crystal of Power!", name);
					return;
				}
			}

			base.OnSpellCastDeny(caster, spell);
		}
Пример #31
0
        public static bool HasEnoughEnergy(IUnit unit, ISpell spell)
        {
            if (unit.EnergyPoints - spell.EnergyCost < 0)
            {
                var message = string.Format(GlobalMessages.NotEnoughEnergy, unit.Name, spell.GetType().Name);
                throw new NotEnoughEnergyException(message);
            }

            return(true);
        }
Пример #32
0
 public static int GetRegistryNumber(ISpell s) => GetRegistryNumber(s.GetType());
Пример #33
0
		public virtual bool CheckSpellCast(Mobile caster, ISpell spell)
		{
			if (caster == null || caster.Deleted || spell == null)
			{
				return false;
			}

			if (!DebugMode && caster.AccessLevel >= AccessLevel.Counselor)
			{
				return true;
			}

			if (!(spell is Spell))
			{
				return true;
			}

			if (!Options.Rules.CanFly)
			{
				var t = spell.GetType();

				if (t.Name.ContainsAny("FlySpell", "FlightSpell"))
				{
					return false;
				}
			}

			return !Options.Restrictions.Spells.IsRestricted((Spell)spell);
		}
Пример #34
0
 public static string GetCircleName(ISpell s)
 {
     return(s != null?GetCircleName(s.GetType()) : String.Empty);
 }
Пример #35
0
 public static SpellInfo GetSpellInfo(ISpell s)
 {
     return(s != null?GetSpellInfo(s.GetType()) : null);
 }
Пример #36
0
		public static int GetRegistryNumber(ISpell s)
		{
			return s != null ? GetRegistryNumber(s.GetType()) : -1;
		}