public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
        {
            Player      player  = Main.player[projectile.owner];
            HamonPlayer hPlayer = player.GetModPlayer <HamonPlayer>();

            if (hPlayer.amountOfHamon >= 4 && Main.rand.Next(0, 4 + 1) == 0)
            {
                hPlayer.amountOfHamon -= 4;
                target.AddBuff(mod.BuffType("Sunburn"), 4 * 60);
            }
        }
        public override void AI()
        {
            Player      player  = Main.player[projectile.owner];
            HamonPlayer hPlayer = player.GetModPlayer <HamonPlayer>();

            if (player.dead)
            {
                projectile.Kill();
                return;
            }

            Vector2 rota = player.Center - projectile.Center;

            projectile.rotation = (-rota).ToRotation();

            if (Main.mouseLeft)
            {
                projectile.timeLeft = 2;

                rotation += 24f * player.direction;
                if (rotation >= 360f)
                {
                    rotation = rotation - 360f;
                }
                if (rotation <= 0)
                {
                    rotation = rotation + 360f;
                }

                hamonConsumptionTimer++;
                if (hamonConsumptionTimer > 120)
                {
                    hPlayer.amountOfHamon -= 2;
                    hamonConsumptionTimer  = 0;
                }

                projectile.Center    = player.Center + (MathHelper.ToRadians(rotation).ToRotationVector2() * 32f);
                projectile.velocity  = Vector2.Zero;
                player.itemTime      = 2;
                player.itemAnimation = 2;
            }
            else
            {
                Projectile.NewProjectile(player.Center, Vector2.Zero, mod.ProjectileType("MetallicNunchucksProjectile"), projectile.damage, projectile.knockBack, projectile.owner);
                projectile.Kill();
            }

            int dustIndex = Dust.NewDust(projectile.position, projectile.width, projectile.height, 169);

            Main.dust[dustIndex].noGravity = true;
        }
Exemplo n.º 3
0
        public override void AI()
        {
            Player      player  = Main.player[projectile.owner];
            HamonPlayer hPlayer = player.GetModPlayer <HamonPlayer>();

            if (player.dead)
            {
                projectile.Kill();
                return;
            }


            if (Main.mouseLeft)
            {
                player.itemTime      = 2;
                player.itemAnimation = 2;
                projectile.timeLeft  = 2;
                projectile.Center    = player.Center;

                projectile.frameCounter++;
                if (projectile.frameCounter % 2 == 0)
                {
                    if (projectile.alpha == 0)
                    {
                        projectile.alpha = 255;
                    }
                    else
                    {
                        projectile.alpha     = 0;
                        projectile.rotation += 0.8f;
                    }
                }
                int dustIndex = Dust.NewDust(projectile.position, projectile.width, projectile.height, 169);
                Main.dust[dustIndex].noGravity = true;

                hamonConsumptionTimer++;
                if (hamonConsumptionTimer > 120)
                {
                    hPlayer.amountOfHamon -= 2;
                    hamonConsumptionTimer  = 0;
                }
            }
            else
            {
                Vector2 velocity = Main.MouseWorld - player.Center;
                velocity.Normalize();
                velocity *= 14f;
                Projectile.NewProjectile(player.Center, velocity, mod.ProjectileType("ChainedKunaiProjectile"), projectile.damage, 3f, projectile.owner);
                projectile.Kill();
            }
        }
Exemplo n.º 4
0
        public override void Update(Player player, ref int buffIndex)
        {
            HamonPlayer hPlayer = player.GetModPlayer <HamonPlayer>();

            hPlayer.hamonDamageBoosts += 0.07f;
            player.moveSpeed          += 0.07f;
            player.jumpSpeedBoost     += 0.07f;
            player.allDamage          += 0.07f;
            player.meleeSpeed         += 0.07f;
            player.pickSpeed          += 0.07f;

            if (Main.rand.Next(0, 4 + 1) == 0)
            {
                int dustIndex = Dust.NewDust(player.position, player.width, player.height, 169, Scale: Main.rand.NextFloat(1f, 2f + 1f));
                Main.dust[dustIndex].noGravity = true;
            }
        }
Exemplo n.º 5
0
        public override void AI()
        {
            Player      player      = Main.player[projectile.owner];
            HamonPlayer hamonPlayer = player.GetModPlayer <HamonPlayer>();

            if (projectile.timeLeft <= 592)
            {
                projectile.velocity = Vector2.Zero;
            }
            if (hamonPlayer.amountOfHamon >= 1)
            {
                int dustIndex = Dust.NewDust(projectile.position, projectile.width, projectile.height, 169, projectile.velocity.X * -0.5f, projectile.velocity.Y * -0.5f);
                Main.dust[dustIndex].noGravity = true;;
            }
            else
            {
                projectile.timeLeft /= 2;
            }
        }
Exemplo n.º 6
0
        public override void HoldItem(Player player)
        {
            HamonPlayer hPlayer = player.GetModPlayer <HamonPlayer>();

            if (clickTimer > 0)
            {
                clickTimer--;
            }
            if (player.whoAmI == item.owner)
            {
                if (Main.mouseRight && item.stack > 20 && clickTimer <= 0)
                {
                    hPlayer.skillPointsAvailable += 1;
                    item.stack -= 20;
                    clickTimer  = 60;
                    Main.PlaySound(2, Style: 25, pitchOffset: -0.8f);
                }
            }
        }
Exemplo n.º 7
0
        public override void UpdateAccessory(Player player, bool hideVisual)
        {
            HamonPlayer hamonPlayer = player.GetModPlayer <HamonPlayer>();

            hamonPlayer.hamonDamageBoosts    += 0.5f;
            hamonPlayer.hamonKnockbackBoosts += 0.5f;
            if (Main.dayTime == true)
            {
                player.meleeDamage += 0.23f;
                player.meleeSpeed  += 0.18f;
                player.magicDamage *= 2;
                player.manaRegen   *= 3;
                player.lifeRegen   += 2;
                player.waterWalk    = true;
                player.waterWalk2   = true;
            }
            player.lifeRegen += 1;
            player.waterWalk  = true;
            player.waterWalk2 = true;
            Lighting.AddLight(player.Center, 1f, 0f, 0f);
        }
Exemplo n.º 8
0
        public override void UpdateEffects(Player player)
        {
            HamonPlayer hPlayer = player.GetModPlayer <HamonPlayer>();

            hPlayer.passiveRegen = false;
            if (player.whoAmI == Main.myPlayer && hPlayer.amountOfHamon > 5)
            {
                usageTimer++;
                if (usageTimer > 90)
                {
                    hPlayer.amountOfHamon -= 1;
                    usageTimer             = 0;
                }
            }
            player.velocity.Y = 0.1f;
            player.fallStart  = (int)player.position.Y;
            if (!player.controlUp || WorldGen.SolidTile((int)(player.Center.X / 16f), (int)(player.Center.Y / 16f) + 2) || hPlayer.amountOfHamon <= 5)
            {
                player.mount.Dismount(player);
            }
        }
Exemplo n.º 9
0
        public override void HoldItem(Item item, Player player)
        {
            MyPlayer    mPlayer = player.GetModPlayer <MyPlayer>();
            HamonPlayer hPlayer = player.GetModPlayer <HamonPlayer>();

            if (item.melee && !mPlayer.StandOut)
            {
                if (doublePressTimer > 0)
                {
                    doublePressTimer--;
                }

                bool specialJustPressed = false;
                if (!Main.dedServ)
                {
                    specialJustPressed = JoJoStands.SpecialHotKey.JustPressed;
                }

                if (specialJustPressed)
                {
                    if (doublePressTimer <= 0)
                    {
                        doublePressTimer = 30;
                    }
                    else
                    {
                        if (hPlayer.learnedHamonSkills.ContainsKey(HamonPlayer.WeaponsHamonImbueSkill) && hPlayer.learnedHamonSkills[HamonPlayer.WeaponsHamonImbueSkill] && hPlayer.amountOfHamon >= hPlayer.hamonAmountRequirements[HamonPlayer.WeaponsHamonImbueSkill])
                        {
                            player.AddBuff(mod.BuffType("HamonWeaponImbueBuff"), 240 * 60);
                            hPlayer.amountOfHamon -= hPlayer.hamonAmountRequirements[HamonPlayer.WeaponsHamonImbueSkill];
                        }
                        doublePressTimer = 0;
                    }
                }
            }
        }
Exemplo n.º 10
0
        public override void AI()
        {
            Player      player  = Main.player[projectile.owner];
            HamonPlayer hPlayer = player.GetModPlayer <HamonPlayer>();

            if (Main.player[projectile.owner].dead)
            {
                projectile.Kill();
                return;
            }

            float direction = player.Center.X - projectile.Center.X;

            if (direction > 0)
            {
                projectile.direction = -1;
                player.direction     = -1;
            }
            if (direction < 0)
            {
                projectile.direction = 1;
                player.direction     = 1;
            }
            Vector2 rota = player.Center - projectile.Center;

            projectile.rotation = (-rota).ToRotation();
            float distance = Vector2.Distance(player.Center, projectile.Center);

            if (grabbedNPC != null)
            {
                if (!grabbedNPC.active || distance > 18f * 16f || !Main.mouseLeft)
                {
                    living     = false;
                    grabbedNPC = null;
                    return;
                }

                projectile.timeLeft = 300;
                projectile.position = grabbedNPC.Center - new Vector2(projectile.width / 2f, projectile.height / 2f);

                heldNPCTimer++;
                if (hPlayer.amountOfHamon >= 5 && heldNPCTimer >= 80)
                {
                    grabbedNPC.StrikeNPC(projectile.damage, 0f, projectile.direction);
                    grabbedNPC.AddBuff(mod.BuffType("Sunburn"), 5 * 60);
                    hPlayer.amountOfHamon -= 5;
                    heldNPCTimer           = 0;
                }
            }

            if (living)
            {
                if (distance > 18f * 16f)
                {
                    living = false;
                }
                projectile.ai[1] += 1f;
                if (projectile.ai[1] > 5f)
                {
                    projectile.alpha = 0;
                }
                if (projectile.ai[1] >= 10f)
                {
                    projectile.ai[1] = 15f;
                }
            }
            else if (!living)
            {
                projectile.tileCollide = false;
                Vector2 returnVel = player.Center - projectile.Center;
                returnVel.Normalize();
                returnVel          *= 9f;
                projectile.velocity = returnVel;

                if (distance < 50f)
                {
                    projectile.Kill();
                }
            }

            player.itemTime      = 2;
            player.itemAnimation = 2;
            if (hPlayer.amountOfHamon >= 5)
            {
                int dustIndex = Dust.NewDust(projectile.position, projectile.width, projectile.height, 169);
                Main.dust[dustIndex].noGravity = true;
            }
        }
Exemplo n.º 11
0
        public override void ProcessTriggers(TriggersSet triggersSet)
        {
            Player      player  = Main.player[Main.myPlayer];
            MyPlayer    mPlayer = player.GetModPlayer <MyPlayer>();
            HamonPlayer hPlayer = player.GetModPlayer <HamonPlayer>();

            if (JoJoStands.JoJoStands.StandOut.JustPressed && !mPlayer.StandOut && standKeyPressTimer <= 0)
            {
                SpawnFanStand();
                standKeyPressTimer += 30;
            }
            if (JoJoStands.JoJoStands.StandOut.JustPressed && mPlayer.StandOut && standKeyPressTimer <= 0)
            {
                standKeyPressTimer += 30;
                if (anyBrianEno)
                {
                    BrianEnoAct1 = false;
                    BrianEnoAct2 = false;
                    BrianEnoAct3 = false;
                    anyBrianEno  = false;
                    player.ClearBuff(BuffType <BrianEnoActiveBuff>());
                }
            }
            if (JoJoStands.JoJoStands.SpecialHotKey.JustPressed)
            {
                if (player.mount.Type != Mount.None)
                {
                    SpinBoost = true;
                }
                else
                {
                    if (BrianEnoAct1 && !player.wet)
                    {
                        player.mount.SetMount(MountType <BrianEnoMount>(), player);
                    }
                    if (BrianEnoAct2)
                    {
                        if (player.wet)
                        {
                            player.mount.SetMount(MountType <BathysphereMount>(), player);
                        }
                        else
                        {
                            player.mount.SetMount(MountType <BrianEnoMount>(), player);
                        }
                    }
                    if (BrianEnoAct3)
                    {
                        if (player.wet)
                        {
                            player.mount.SetMount(MountType <BathysphereMount>(), player);
                        }
                        else
                        {
                            player.mount.SetMount(MountType <SkySawMount>(), player);
                        }
                    }
                }
            }
            if (anyBrianEno && JoJoStands.JoJoStands.SpecialHotKey.Current && !player.wet && hPlayer.amountOfHamon > 0)
            {
                hPlayer.amountOfHamon -= 1;
                SpinBoost              = true;
            }
        }