コード例 #1
0
 public ActionBar(Game game, NetworkPlayerInterface interfaceRef, Point position)
 {
     Buttons               = new ActionBarButton[14];
     iconSize              = 48;
     buttonCount           = 14;
     NetPlayerInterfaceRef = interfaceRef;
     Position              = position;
     ButtonInterval        = 1;
     cooldownFont          = game.Content.Load <SpriteFont>(@"Fonts\CooldownFont");
 }
コード例 #2
0
 public override void Apply(ITargetable caster, ITargetable target, TimeSpan elapsedTime, SpellModificationInformation spellInfo, NetworkPlayerInterface playerUi)
 {
     target.Character.Entity.Buffs.RemoveAll(item => item.Auras.Find(aura => aura.ModifierType == AuraType.Root) != null);
 }
コード例 #3
0
 public override void Apply(ITargetable caster, ITargetable target, TimeSpan elapsedTime, SpellModificationInformation spellInfo, NetworkPlayerInterface playerUi)
 {
     target.Character.Entity.Buffs.RemoveAll(item => item.BuffType == BuffType.Debuff);
 }
コード例 #4
0
        public override void Apply(ITargetable caster, ITargetable target, TimeSpan elapsedTime, SpellModificationInformation spellInfo, NetworkPlayerInterface playerUi)
        {
            target.IsKnockedBack = true;
            target.IsFlying      = true;
            target.IsGrounded    = false;
            if (caster.Position.X < target.Position.X)
            {
                target.Velocity = new Vector2(horizontalValue, -verticalValue);
            }
            else
            {
                target.Velocity = new Vector2(-horizontalValue, -verticalValue);
            }

            if (target is NetworkPlayer)
            {
                NetworkPlayer player = target as NetworkPlayer;
                player.AlignStates();
            }
        }
コード例 #5
0
        public override void Apply(ITargetable caster, ITargetable target, TimeSpan elapsedTime, SpellModificationInformation spellInfo, NetworkPlayerInterface playerUi)
        {
            Vector2 prevVelocity = target.Velocity;

            target.IsGrounded = false;
            target.Velocity   = target.Character.IsDirectedRight ? new Vector2(horizontalValue, verticalValue) : new Vector2(-horizontalValue, verticalValue);
            for (int i = 0; i < target.GameMapRef.MapObjects.Length; i++)
            {
                target.GameMapRef.MapObjects[i].CheckCollision(target, Vector2.Zero);
            }

            target.Position += target.Velocity;
            target.Position  = Vector2.Clamp(target.Position, new Vector2(100, -800), new Vector2(target.GameMapRef.MapWidth - 100, target.GameMapRef.MapHeight + 800));

            if (target is NetworkPlayer)
            {
                NetworkPlayer player = target as NetworkPlayer;
                target.Velocity = prevVelocity;
                player.AlignStates();
            }
            else
            {
                target.Velocity = prevVelocity;
            }
        }
コード例 #6
0
 public abstract void Apply(ITargetable caster, ITargetable target, TimeSpan elapsedTime, SpellModificationInformation spellInfo, NetworkPlayerInterface playerUi);
コード例 #7
0
        public override void Apply(ITargetable caster, ITargetable target, TimeSpan elapsedTime, SpellModificationInformation spellInfo, NetworkPlayerInterface playerUi)
        {
            int amount = modifier;

            amount += Mechanics.Roll(minValue, maxValue);

            if (amount < 1)
            {
                amount = 1;
            }

            target.Character.Entity.Health.Increase((ushort)amount);
        }
コード例 #8
0
 public override void Apply(ITargetable caster, ITargetable target, TimeSpan elapsedTime, SpellModificationInformation spellInfo, NetworkPlayerInterface playerUi)
 {
     Effect.Apply(caster, target, elapsedTime, spellInfo, playerUi);
 }
コード例 #9
0
 public override void Apply(ITargetable caster, ITargetable target, TimeSpan elapsedTime, SpellModificationInformation spellInfo, NetworkPlayerInterface playerUi)
 {
     if (!target.Character.Entity.ReplacingModels.ContainsKey(newModelName))
     {
         AnimatedSprite newAnimationSprite = (AnimatedSprite)newModel.Clone();
         newAnimationSprite.CurrentAnimation      = target.Character.Sprite.CurrentAnimation;
         newAnimationSprite.CurrentAnimationFrame = target.Character.Sprite.CurrentAnimationFrame;
         newAnimationSprite.PerformAnimation      = target.Character.Sprite.PerformAnimation;
         target.Character.Entity.ReplacingModels.Add(newModelName, newAnimationSprite);
     }
 }
コード例 #10
0
        public override void Apply(ITargetable caster, ITargetable target, TimeSpan elapsedTime,
                                   SpellModificationInformation spellInfo, NetworkPlayerInterface playerUi)
        {
            int amount = modifier;

            amount += Mechanics.Roll(minValue, maxValue);

            if (amount < 1)
            {
                amount = 1;
            }

            if (spellInfo.DamageMultiplier != 0)
            {
                amount = (int)(amount * spellInfo.DamageMultiplier);
            }
            amount += (int)spellInfo.AdditionalDamage;
            if (spellInfo.IsCrit)
            {
                amount = (int)(amount * spellInfo.CriticalDamageMultiplierAddMod);
            }

            amount = (int)(amount * target.Character.Entity.IncomingDamageEfficiency);

            switch (damageType)
            {
            case DamageType.Physical:
                amount = (int)(amount * caster.Character.Entity.PhysicalDamageMulMod);
                break;

            case DamageType.Frost:
                amount = (int)(amount * caster.Character.Entity.FrostDamageMulMod);
                break;

            case DamageType.Fire:
                amount = (int)(amount * caster.Character.Entity.FireDamageMulMod);
                break;

            case DamageType.Arcane:
                amount = (int)(amount * caster.Character.Entity.ArcaneDamageMulMod);
                break;

            case DamageType.Nature:
                amount = (int)(amount * caster.Character.Entity.NatureDamageMulMod);
                break;

            case DamageType.Shadow:
                amount = (int)(amount * caster.Character.Entity.ShadowDamageMulMod);
                break;

            case DamageType.Holy:
                amount = (int)(amount * caster.Character.Entity.HolyDamageMulMod);
                break;
            }

            foreach (Buff buff in target.Character.Entity.Buffs)
            {
                if (buff.HasAbsorbAura)
                {
                    foreach (AuraBase auraAbsorb in buff.Auras)
                    {
                        amount = auraAbsorb.Absorb(damageType, amount, target.Character.Entity);
                        if (amount == 0)
                        {
                            if (caster.ID == playerUi.PlayerRef.ID)
                            {
                                playerUi.SkillDamageEvents.Add(new SkillDamageEvent(spellInfo.SpellName, "Absorb", 0, 0.7f, target, 50, false, spellInfo.IsCrit));
                            }
                            return;
                        }
                    }
                }
            }
            if (caster.ID == playerUi.PlayerRef.ID)
            {
                playerUi.SkillDamageEvents.Add(new SkillDamageEvent(spellInfo.SpellName, "", amount, 0.7f, target, 30, false, spellInfo.IsCrit));
            }
            target.Character.Entity.Health.Decrease((ushort)amount);
        }