Ejemplo n.º 1
0
 public override void AI(NPC npc)
 {
     if (timedValueInstanceCollection.instances.TryGetValue(typeof(TimedValueInstanceCollection.InstanceType.Bleed), out var bleeds))
     {
         if (bleeds.totalValue > 0)
         {
             PoMEffectHelper.Bleed(npc.Center);
         }
     }
     if (timedValueInstanceCollection.instances.TryGetValue(typeof(TimedValueInstanceCollection.InstanceType.Poison), out var poisons))
     {
         if (poisons.totalValue > 0)
         {
             PoMEffectHelper.Poison(npc.position, npc.width, npc.height);
         }
     }
     if (timedValueInstanceCollection.instances.TryGetValue(typeof(TimedValueInstanceCollection.InstanceType.Ignite), out var ignites))
     {
         if (ignites.totalValue > 0)
         {
             PoMEffectHelper.Ignite(npc.position, npc.width, npc.height);
         }
     }
     if (timedValueInstanceCollection.instances.TryGetValue(typeof(TimedValueInstanceCollection.InstanceType.Shock), out var shocks))
     {
         if (shocks.totalValue > 0)
         {
             PoMEffectHelper.Shock(npc.position, npc.width, npc.height);
         }
     }
     if (timedValueInstanceCollection.instances.TryGetValue(typeof(TimedValueInstanceCollection.InstanceType.Chill), out var chills))
     {
         if (chills.totalValue > 0)
         {
             PoMEffectHelper.Chill(npc.position, npc.width, npc.height);
         }
     }
 }
Ejemplo n.º 2
0
        public override void PreUpdate()
        {
            if (timedValueInstanceCollection.instances.TryGetValue(typeof(TimedValueInstanceCollection.InstanceType.Bleed), out var bleeds))
            {
                if (bleeds.totalValue > 0)
                {
                    PoMEffectHelper.Bleed(player.Center);
                }
            }
            if (timedValueInstanceCollection.instances.TryGetValue(typeof(TimedValueInstanceCollection.InstanceType.Poison), out var poisons))
            {
                if (poisons.totalValue > 0)
                {
                    PoMEffectHelper.Poison(player.position, player.width, player.height);
                }
            }
            if (timedValueInstanceCollection.instances.TryGetValue(typeof(TimedValueInstanceCollection.InstanceType.Ignite), out var ignites))
            {
                if (ignites.totalValue > 0)
                {
                    PoMEffectHelper.Ignite(player.position, player.width, player.height);
                }
            }
            if (timedValueInstanceCollection.instances.TryGetValue(typeof(TimedValueInstanceCollection.InstanceType.Shock), out var shocks))
            {
                if (shocks.totalValue > 0)
                {
                    PoMEffectHelper.Shock(player.position, player.width, player.height);
                }
            }
            if (timedValueInstanceCollection.instances.TryGetValue(typeof(TimedValueInstanceCollection.InstanceType.Chill), out var chills))
            {
                if (chills.totalValue > 0)
                {
                    PoMEffectHelper.Chill(player.position, player.width, player.height);
                }
            }

            if (staticStrikeTimeLeft > 0)
            {
                staticStrikeCurrentInterval++;

                if (staticStrikeCurrentInterval >= staticStrikeIntervalTicks)
                {
                    if (player.whoAmI == Main.myPlayer)
                    {
                        Projectile.NewProjectile(
                            position: player.Center,
                            velocity: Vector2.Zero,
                            Type: ModContent.ProjectileType <StaticStrike>(),
                            Damage: staticStrikeDamage,
                            KnockBack: 0,
                            Owner: player.whoAmI);
                    }

                    staticStrikeCurrentInterval = 0;
                }

                staticStrikeTimeLeft--;
            }

            if (greavesMoveSpeedTimeLeft > 0)
            {
                if (greavesMoveSpeedValue > 0)
                {
                    PoMEffectHelper.MoveSpeed(player);
                }

                greavesMoveSpeedTimeLeft--;
            }

            if (weaponMoveSpeedTimeLeft > 0)
            {
                if (weaponMoveSpeedTimeLeft > 0)
                {
                    PoMEffectHelper.MoveSpeed(player);
                }

                weaponMoveSpeedTimeLeft--;
            }

            if (moltenShellTimeLeft > 0)
            {
                moltenShellTimeLeft--;

                if (moltenShellTimeLeft <= 0)
                {
                    PlayMoltenShellExplodeSound(player);

                    if (player.whoAmI == Main.myPlayer)
                    {
                        Projectile.NewProjectile(
                            player.Center,
                            Vector2.Zero,
                            ModContent.ProjectileType <MoltenShellExplosion>(),
                            moltenShellStoredDamage,
                            5,
                            player.whoAmI,
                            moltenShellStoredDamage / (float)player.statLifeMax2);
                        moltenShellStoredDamage = 0;
                    }
                }
            }

            if (noManaCostTimeLeft > 0)
            {
                noManaCostTimeLeft--;
            }
            if (knockbackImmunityTimeLeft > 0)
            {
                knockbackImmunityTimeLeft--;
            }
        }