예제 #1
0
        public override void PreUpdate()
        {
            ArmorFrameCounter++;
            if (Main.myPlayer == player.whoAmI)
            {
                //QwertyMethods.ServerClientCheck(Main.myPlayer);
                QwertysRandomContent.LocalCursor[Main.myPlayer] = Main.MouseWorld;

                if (Main.netMode == 1)
                {
                    ModPacket packet = mod.GetPacket();
                    packet.Write((byte)ModMessageType.UpdateLocalCursor); // Message type, you would need to create an enum for this
                    packet.Write((byte)Main.myPlayer);
                    packet.WriteVector2(QwertysRandomContent.LocalCursor[Main.myPlayer]);
                    packet.Send();
                }
            }
            mythrilPrismRotation += (float)Math.PI / 90f;
            if (grappleBoost)
            {
                //Main.NewText("double??");
            }
            //WorldGen.PlaceTile((int)player.Center.X/16, (int)player.Center.Y/16 - 4, TileID.Dirt);
            if (hyperRune)
            {
                if (hyperRuneTimer == 120)
                {
                    signalRune          = Main.projectile[Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, mod.ProjectileType("SignalRune"), 0, 0, player.whoAmI)];
                    signalRune.timeLeft = 2;
                    //CombatText.NewText(player.getRect(), new Color(39, 219, 219), "Recharged!", true, false);
                }
                if (hyperRuneTimer > 120)
                {
                    signalRune.timeLeft = 2;
                }
            }


            if (gemRegen)
            {
                regenTimer++;
                if (regenTimer == 300)
                {
                    for (int i = 0; i < 200; i++)
                    {
                        float theta = Main.rand.NextFloat(-(float)Math.PI, (float)Math.PI);

                        Dust dust = Dust.NewDustPerfect(player.Center + QwertyMethods.PolarVector(200, theta), mod.DustType("AncientGlow"), QwertyMethods.PolarVector(-200 / 10, theta));
                        dust.noGravity = true;
                    }
                    //CombatText.NewText(player.getRect(), Color.Green, "Reconstructed", true, false);
                    player.statLife += 999;
                }
            }

            if (usingVulcan)
            {
                player.accRunSpeed   = 0f;
                player.moveSpeed     = 0f;
                player.rangedDamage += 10;
            }

            if (Main.mouseRight)
            {
                while (RhuthiniumCharge > 0)
                {
                    float angle = (Main.MouseWorld - player.Center).ToRotation() + MathHelper.ToRadians(Main.rand.Next(-100, 101) * .05f);


                    Projectile.NewProjectile(player.Center.X, player.Center.Y, (float)Math.Cos(angle) * 12f, (float)Math.Sin(angle) * 12f, mod.ProjectileType("RhuthiniumCharge"), 20, 2f, player.whoAmI);
                    RhuthiniumCharge--;
                }
            }


            if (iceScroll)
            {
                if (iceScrollCounter >= (int)(2 * Math.PI * 10))
                {
                    float startDistance = 100;
                    Projectile.NewProjectile(player.Center.X + (float)Math.Cos(0) * startDistance, player.Center.Y + (float)Math.Sin(0) * startDistance, 0, 0, mod.ProjectileType("IceRuneFreindly"), (int)(300 * player.meleeDamage), 3f, Main.myPlayer);
                    Projectile.NewProjectile(player.Center.X + (float)Math.Cos(Math.PI) * startDistance, player.Center.Y + (float)Math.Sin(Math.PI) * startDistance, 0, 0, mod.ProjectileType("IceRuneFreindly"), (int)(300 * player.meleeDamage), 3f, Main.myPlayer);
                    iceScrollCounter = 0;
                }
                iceScrollCounter++;
            }

            if (heldItemOld != player.inventory[player.selectedItem])
            {
                if (Metronome && killCount != 0)
                {
                    CombatText.NewText(player.getRect(), Color.DarkRed, "Reset!", true, false);
                }
                killCount = 0;
            }
            heldItemOld = player.inventory[player.selectedItem];
        }