コード例 #1
0
ファイル: MugenHelm.cs プロジェクト: Allmyfood/MagicalThings
        public override void UpdateArmorSet(Player player)
        {
            player.setBonus         = "Mugen Dev Armor Equiped";
            player.meleeDamage     *= 10.0f;
            player.thrownDamage    *= 10.0f;
            player.rangedDamage    *= 10.0f;
            player.magicDamage     *= 10.0f;
            player.minionDamage    *= 10.0f;
            player.nightVision      = true;
            player.magicCrit       *= 55;
            player.rangedCrit      *= 55;
            player.thrownCrit      *= 55;
            player.meleeCrit       *= 55;
            player.meleeSpeed      += 0.35f; //35%
            player.lifeRegen       += 15;
            player.manaRegen       += 4;
            player.statLifeMax2    += 200;
            player.statManaMax2    += 200;
            player.ammoCost75       = true;
            player.manaCost        -= .75f;
            player.shroomiteStealth = true;
            player.moveSpeed       += 0.15f;
            player.maxMinions++;
            MagicalPlayer mpm = player.GetModPlayer <MagicalPlayer>();

            mpm.MugenArmorEquiped = true;
        }
コード例 #2
0
        public override void CheckActive()
        {
            Player        player    = Main.player[projectile.owner];
            MagicalPlayer modPlayer = player.GetModPlayer <MagicalPlayer>();

            if (player.dead)
            {
                modPlayer.AzureSpinnerMinion = false;
            }
            if (modPlayer.AzureSpinnerMinion)
            {
                projectile.timeLeft = 2;
            }
        }
コード例 #3
0
        public override void AI()
        {
            Player        player    = Main.player[projectile.owner];
            MagicalPlayer modPlayer = player.GetModPlayer <MagicalPlayer>();

            if (player.dead)
            {
                modPlayer.WolfPet = false;
            }
            if (modPlayer.WolfPet)
            {
                projectile.timeLeft = 2;
            }
        }
コード例 #4
0
        public override void CheckActive()
        {
            //projectile.spriteDirection = projectile.direction;
            Player        player    = Main.player[projectile.owner];
            MagicalPlayer modPlayer = player.GetModPlayer <MagicalPlayer>();

            if (player.dead)
            {
                modPlayer.SpiritDragonMinion = false;
            }
            if (modPlayer.SpiritDragonMinion)
            {
                projectile.timeLeft = 2;
            }
        }
コード例 #5
0
        public override void AI()
        {
            Player        player    = Main.player[projectile.owner];
            MagicalPlayer modPlayer = player.GetModPlayer <MagicalPlayer>();

            if (player.dead)
            {
                modPlayer.IlluminationTriangle = false;
            }
            if (modPlayer.IlluminationTriangle)
            {
                projectile.timeLeft = 2;
            }
            Lighting.AddLight(projectile.position, 3.0f, 3.0f, 3.0f);
        }
コード例 #6
0
        public override void CheckActive()
        {
            Lighting.AddLight((int)(projectile.Center.X / 16f), (int)(projectile.Center.Y / 16f), 0.95f, 0.84f, 0.26f);
            Player        player    = Main.player[projectile.owner];
            MagicalPlayer modPlayer = player.GetModPlayer <MagicalPlayer>();

            projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt();
            projectile.rotation        = projectile.velocity.ToRotation() + (projectile.spriteDirection == 1 ? 0f : MathHelper.Pi);
            if (player.dead)
            {
                modPlayer.SwarmMinion = false;
            }
            if (modPlayer.SwarmMinion)
            {
                projectile.timeLeft = 2;
            }
        }
コード例 #7
0
        public override void Update(Player player, ref int buffIndex)
        {
            MagicalPlayer modPlayer = player.GetModPlayer <MagicalPlayer>();

            if (player.ownedProjectileCounts[ProjectileType <Projectiles.CompanionProj.Minions.ServantProj>()] > 0)
            {
                modPlayer.ServantMinion = true;
            }
            if (!modPlayer.ServantMinion)
            {
                player.DelBuff(buffIndex);
                buffIndex--;
            }
            else
            {
                player.buffTime[buffIndex] = 18000;
            }
        }
コード例 #8
0
        public override void Update(Player player, ref int buffIndex)
        {
            player.buffImmune[BuffID.Poisoned] = true;
            MagicalPlayer modPlayer = player.GetModPlayer <MagicalPlayer>();

            if (player.ownedProjectileCounts[ProjectileType <Projectiles.Minions.WaspProj>()] > 0)
            {
                modPlayer.WaspMinion = true;
            }
            if (!modPlayer.WaspMinion)
            {
                player.DelBuff(buffIndex);
                buffIndex--;
            }
            else
            {
                player.buffTime[buffIndex] = 18000;
            }
        }
コード例 #9
0
        //int Nurse = NPC.FindFirstNPC(NPCID.Nurse);

        public override void AI()
        {
            drawOffsetX = -2;
            Player        player    = Main.player[projectile.owner];
            MagicalPlayer modPlayer = player.GetModPlayer <MagicalPlayer>();

            if (player.dead)
            {
                modPlayer.Medic = false;
            }
            if (modPlayer.Medic)
            {
                projectile.timeLeft = 2;
            }

            if (Main.rand.Next(450) == 0)
            {
                Item.NewItem(projectile.getRect(), ItemID.Heart, Main.rand.Next(1, 8)); // 1-8 hearts
            }
        }
コード例 #10
0
        public override void AI()
        {
            drawOriginOffsetY = 1;
            Player        player    = Main.player[projectile.owner];
            MagicalPlayer modPlayer = player.GetModPlayer <MagicalPlayer>();

            if (player.dead)
            {
                modPlayer.MousePet = false;
            }
            if (modPlayer.MousePet)
            {
                projectile.timeLeft = 2;
            }

            if (Main.rand.Next(1000) == 0)
            {
                Main.PlaySound(SoundID.Zombie, (int)projectile.position.X, (int)projectile.position.Y, 15, .125f); //Chance for mousey to squeak
            }
        }
コード例 #11
0
        public override void CheckActive()
        {
            //projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt();
            //projectile.rotation = projectile.velocity.ToRotation() + (projectile.spriteDirection == 1 ? 0f : MathHelper.Pi);
            Player        player    = Main.player[projectile.owner];
            MagicalPlayer modPlayer = player.GetModPlayer <MagicalPlayer>();

            if (player.dead)
            {
                modPlayer.FlameSkeletonMinion = false;
            }
            if (modPlayer.FlameSkeletonMinion)
            {
                projectile.timeLeft = 2;
            }
            //Dusts
            if (projectile.ai[0] == 0f)
            {
                if (Main.rand.Next(55) == 0)
                {
                    int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height / 2, 174);
                    Main.dust[dust].velocity.Y -= 2.2f;
                }

                else
                {
                    if (Main.rand.Next(35) == 0)
                    {
                        Vector2 dustVel = projectile.velocity;
                        if (dustVel != Vector2.Zero)
                        {
                            dustVel.Normalize();
                        }
                        int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height / 2, 174);
                        Main.dust[dust].velocity -= 1.2f * dustVel;
                    }

                    Lighting.AddLight((int)(projectile.Center.X / 16f), (int)(projectile.Center.Y / 16f), 1.0f, 0.42f, 0.0f);
                }
            }
        }
コード例 #12
0
ファイル: SantaNK2.cs プロジェクト: Allmyfood/MagicalThings
        public override void UpdateEffects(Player player)
        {
            MagicalPlayer modPlayer = player.GetModPlayer <MagicalPlayer>();
            float         tilt      = player.fullRotation;

            player.blockRange                    += 5;
            player.resistCold                     = true;
            player.accDivingHelm                  = true;
            player.statDefense                   += 150;
            player.doubleJumpBlizzard             = true;
            player.noFallDmg                      = true;
            player.iceSkate                       = true;
            player.pickSpeed                     -= 0.25f;
            player.buffImmune[BuffID.Slow]        = true;
            player.buffImmune[BuffID.Frozen]      = true;
            player.buffImmune[BuffID.Webbed]      = true;
            player.buffImmune[BuffID.BrokenArmor] = true;
            player.buffImmune[BuffID.Poisoned]    = true;
            if (Main.rand.Next(30) == 0)
            {
                Rectangle rect = player.getRect();
                Dust.NewDust(new Vector2(rect.X, rect.Y), rect.Width, rect.Height, 135);
            }

            #region Santa Target and Fire
            //Scan for enemies and fire at them
            if (player.mount._abilityCooldown == 0)
            {
                //Don't change these values, unless you want to adjust the nozzle position.
                float   x      = 5f * player.direction;//20 and 12
                float   y      = 5f;
                float   sin    = (float)Math.Sin(tilt);
                float   cos    = (float)Math.Cos(tilt);
                Vector2 muzzle = new Vector2(x * cos - y * sin, x * sin + y * cos);
                muzzle = muzzle + player.fullRotationOrigin + player.position;

                //Readjust the scanning cone to the current position.
                float direction;
                if (player.direction == 1)
                {
                    direction = FOVHelper.POS_X_DIR + tilt;
                }
                else
                {
                    direction = FOVHelper.NEG_X_DIR - tilt;
                }
                helper.adjustCone(muzzle, fov, direction);

                //Look for the nearest, unobscured enemy inside the cone
                NPC   nearest     = null;
                float distNearest = rangeSquare;
                for (int i = 0; i < 200; i++)
                {
                    NPC     npc       = Main.npc[i];
                    Vector2 npcCenter = npc.Center;
                    if (npc.CanBeChasedBy() && helper.isInCone(npcCenter)) //first param of canBeChasedBy has no effect
                    {
                        float distCurrent = Vector2.DistanceSquared(muzzle, npcCenter);
                        if (distCurrent < distNearest && Collision.CanHitLine(muzzle, 0, 0, npc.position, npc.width, npc.height))
                        {
                            nearest     = npc;
                            distNearest = distCurrent;
                        }
                    }
                }
                //Shoot 'em dead
                if (nearest != null)
                {
                    if (player.whoAmI == Main.myPlayer)
                    {
                        Vector2 aim = nearest.Center - muzzle;
                        aim.Normalize();
                        aim *= velocity;
                        float vX = aim.X;
                        float vY = aim.Y;
                        //This precisely mimics the Gatligators spread
                        //Random rand = Main.rand; commenting this out because I changed the rand lines here and waiting on more experienced help- Jenosis
                        vX += Main.rand.Next(-20, 21) * 0.03f;
                        vY += Main.rand.Next(-20, 21) * 0.03f;
                        vX += Main.rand.Next(-10, 11) * 0.05f;
                        vY += Main.rand.Next(-10, 11) * 0.05f;
                        if (Main.rand.Next(3) == 0)
                        {
                            vX += Main.rand.Next(-15, 16) * 0.02f;
                            vY += Main.rand.Next(-15, 16) * 0.02f;
                        }
                        Main.PlaySound(SoundID.Item, (int)player.position.X, (int)player.position.Y, 41);
                        Projectile.NewProjectile(muzzle.X, muzzle.Y, vX, vY, ProjectileID.BulletHighVelocity, (int)(damage * player.minionDamage), knockback * player.minionKB, player.whoAmI); //CandyCopterBullet
                    }
                    Point point = player.Center.ToTileCoordinates();
                    Lighting.AddLight(point.X, point.Y, lightColor.X, lightColor.Y, lightColor.Z);
                    modPlayer.SantaFiring         = true;
                    modPlayer.SantaFireFrame      = 0;
                    player.mount._abilityCooldown = cooldown - 1;
                }
                else
                {
                    modPlayer.SantaFiring = false;
                }
                return;
            }
            else if (player.mount._abilityCooldown > cooldown)
            {
                player.mount._abilityCooldown = cooldown;
            }
            #endregion
        }