Exemplo n.º 1
0
 private bool HasKiForZanzoken(Player player)
 {
     return(MyPlayer.ModPlayer(player).HasKi(GetZanzokenKiCost(player)));
 }
Exemplo n.º 2
0
 private void DeductKiForZanzoken(Player player)
 {
     MyPlayer.ModPlayer(player).AddKi(-GetZanzokenKiCost(player), false, false);
 }
Exemplo n.º 3
0
        public void Update(TriggersSet triggersSet, Player player, Mod mod)
        {
            HandleZanzokenAndComboRecovery();

            if (FlurryActiveTimer > 0)
            {
                if (FlurryActiveTimer % 2 == 0)
                {
                    // spawn flurry attack
                    Projectile.NewProjectile(GetProjectilePosition(player), GetProjectileVelocity(player), BasicFistProjSelect(mod), FlurryPunchDamage, 3);
                }
                FlurryActiveTimer--;

                // process no other triggers.
                return;
            }

            // returns a list of actions to be performed based on trigger states.
            var actionsToPerform = ControlHelper.ProcessInputs(triggersSet);

            #region Mouse Clicks
            if (actionsToPerform.BlockPhase1)//both click, for blocking
            {
                MyPlayer.ModPlayer(player).BlockState = 1;
            }
            else if (actionsToPerform.BlockPhase2)
            {
                MyPlayer.ModPlayer(player).BlockState = 2;
            }
            else if (actionsToPerform.BlockPhase3)
            {
                MyPlayer.ModPlayer(player).BlockState = 3;
            }
            else
            {
                MyPlayer.ModPlayer(player).BlockState = 0;
                if (actionsToPerform.Flurry && CanPerformFlurry(player))
                {
                    ShootSpeed          = 2;
                    FlurryActiveTimer   = GetFlurryDuration(player);
                    FlurryCooldownTimer = GetFlurryCooldownDuration(player);
                }
                else if (actionsToPerform.LightAttack && CanPerformLightAttack(player))
                {
                    PerformLightAttack(mod, player);
                }
                else if (actionsToPerform.HeavyAttack)
                {
                    if (!player.HasBuff(mod.BuffType("HeavyPunchCooldown")) && MyPlayer.ModPlayer(player).CanUseHeavyHit)
                    {
                        if (CanUseZanzokenHeavy(player))
                        {
                            // do zanzoken heavy attack combo
                        }
                        else
                        {
                            Projectile.NewProjectile(player.position, GetProjectileVelocity(player), mod.ProjectileType("KiFistProjHeavy"), HeavyPunchDamage, 50);
                        }
                    }
                }
            }
            #endregion

            #region Dash Checks
            if (actionsToPerform.DashUp)
            {
                MyPlayer.ModPlayer(player).IsDashing = true;
                PerformZanzoken(mod, player, Controls.Up);
            }
            if (actionsToPerform.DashDown)
            {
                MyPlayer.ModPlayer(player).IsDashing = true;
                PerformZanzoken(mod, player, Controls.Down);
            }
            if (actionsToPerform.DashLeft)
            {
                MyPlayer.ModPlayer(player).IsDashing = true;
                PerformZanzoken(mod, player, Controls.Left);
            }
            if (actionsToPerform.DashRight)
            {
                MyPlayer.ModPlayer(player).IsDashing = true;
                PerformZanzoken(mod, player, Controls.Right);
            }
            if (actionsToPerform.DashUpLeft)
            {
                MyPlayer.ModPlayer(player).IsDashing = true;
                PerformZanzoken(mod, player, Controls.Up, Controls.Left);
            }
            if (actionsToPerform.DashUpRight)
            {
                MyPlayer.ModPlayer(player).IsDashing = true;
                PerformZanzoken(mod, player, Controls.Up, Controls.Right);
            }
            if (actionsToPerform.DashDownLeft)
            {
                MyPlayer.ModPlayer(player).IsDashing = true;
                PerformZanzoken(mod, player, Controls.Down, Controls.Left);
            }
            if (actionsToPerform.DashDownRight)
            {
                MyPlayer.ModPlayer(player).IsDashing = true;
                PerformZanzoken(mod, player, Controls.Down, Controls.Right);
            }
            #endregion

            #region boss downed bools
            if (NPC.downedBoss1)
            {
                EyeDowned = true;
            }
            if (NPC.downedQueenBee)
            {
                BeeDowned = true;
            }
            if (Main.hardMode)
            {
                WallDowned = true;
            }
            if (NPC.downedPlantBoss)
            {
                PlantDowned = true;
            }
            if (NPC.downedFishron)
            {
                DukeDowned = true;
            }
            if (NPC.downedMoonlord)
            {
                MoonlordDowned = true;
            }
            #endregion

            #region Stat Checks
            BasicPunchDamage  = 8;
            HeavyPunchDamage  = BasicPunchDamage * 3;
            FlurryPunchDamage = BasicPunchDamage / 2;
            if (EyeDowned)
            {
                BasicPunchDamage += 6;
            }
            if (BeeDowned)
            {
                BasicPunchDamage += 8;
            }
            if (WallDowned)
            {
                BasicPunchDamage += 26;
            }
            if (PlantDowned)
            {
                BasicPunchDamage += 32;
            }
            if (DukeDowned)
            {
                BasicPunchDamage += 28;
            }
            if (MoonlordDowned)
            {
                BasicPunchDamage += 124;
            }

            #endregion
        }
Exemplo n.º 4
0
        private bool CanZanzoken(Player player)
        {
            bool isImmobilized = MyPlayer.ModPlayer(player).IsPlayerImmobilized();

            return(!isImmobilized && HasKiForZanzoken(player) && !IsZanzokenOnCooldown(player));
        }
Exemplo n.º 5
0
        public override void NPCLoot(NPC npc)
        {
            // now loops over all connected players and plays the message for anyone who doesn't have it.
            bool isDisplayingJungleMessage   = false;
            bool isDisplayingHellMessage     = false;
            bool isDisplayingEvilMessage     = false;
            bool isDisplayingMushroomMessage = false;

            if (Main.netMode == NetmodeID.SinglePlayer)
            {
                MyPlayer modPlayer = Main.LocalPlayer.GetModPlayer <MyPlayer>();

                if (modPlayer == null)
                {
                    return;
                }

                if (npc.type == NPCID.EaterofWorldsHead && npc.boss)
                {
                    if (!modPlayer.jungleMessage)
                    {
                        modPlayer.jungleMessage   = true;
                        isDisplayingJungleMessage = true;
                    }
                }

                if (npc.type == NPCID.BrainofCthulhu)
                {
                    if (!modPlayer.jungleMessage)
                    {
                        modPlayer.jungleMessage   = true;
                        isDisplayingJungleMessage = true;
                    }
                }

                if (npc.type == NPCID.SkeletronHead)
                {
                    if (!modPlayer.hellMessage)
                    {
                        modPlayer.hellMessage   = true;
                        isDisplayingHellMessage = true;
                    }
                }

                if (npc.type == NPCID.WallofFlesh)
                {
                    if (!modPlayer.evilMessage)
                    {
                        modPlayer.evilMessage   = true;
                        isDisplayingEvilMessage = true;
                    }
                }

                if (npc.type == NPCID.Plantera)
                {
                    if (!modPlayer.mushroomMessage)
                    {
                        modPlayer.mushroomMessage   = true;
                        isDisplayingMushroomMessage = true;
                    }
                }
            }
            else if (Main.netMode == NetmodeID.Server)
            {
                if (!Main.dedServ)
                {
                    return;
                }
                for (int i = 0; i < Main.player.Length; i++)
                {
                    // i wish I could tell you why this is a thing.
                    Player player = Main.player[i];
                    // this. wtf is this terraria. why?
                    if (player.whoAmI != i)
                    {
                        continue;
                    }

                    MyPlayer modPlayer = player.GetModPlayer <MyPlayer>();

                    if (modPlayer == null)
                    {
                        return;
                    }

                    if (npc.type == NPCID.EaterofWorldsHead && npc.boss)
                    {
                        if (!modPlayer.jungleMessage)
                        {
                            modPlayer.jungleMessage   = true;
                            isDisplayingJungleMessage = true;
                        }
                    }

                    if (npc.type == NPCID.BrainofCthulhu)
                    {
                        if (!modPlayer.jungleMessage)
                        {
                            modPlayer.jungleMessage   = true;
                            isDisplayingJungleMessage = true;
                        }
                    }

                    if (npc.type == NPCID.SkeletronHead)
                    {
                        if (!modPlayer.hellMessage)
                        {
                            modPlayer.hellMessage   = true;
                            isDisplayingHellMessage = true;
                        }
                    }

                    if (npc.type == NPCID.WallofFlesh)
                    {
                        if (!modPlayer.evilMessage)
                        {
                            modPlayer.evilMessage   = true;
                            isDisplayingEvilMessage = true;
                        }
                    }

                    if (npc.type == NPCID.Plantera)
                    {
                        if (!modPlayer.mushroomMessage)
                        {
                            modPlayer.mushroomMessage   = true;
                            isDisplayingMushroomMessage = true;
                        }
                    }
                }
            }
            else
            {
                return;
            }

            if (isDisplayingJungleMessage)
            {
                if (Main.netMode != 2)
                {
                    Main.NewText("You feel a calm radiance of ki from the jungle.", 13, 201, 10);
                }
                else
                {
                    NetworkText text2 = NetworkText.FromKey("You feel a calm radiance of ki from the jungle.");
                    NetMessage.BroadcastChatMessage(text2, new Color(13, 201, 10));
                }
            }

            if (isDisplayingHellMessage)
            {
                if (Main.netMode != 2)
                {
                    Main.NewText("The underworld's flames shimmer with energy.", 201, 10, 10);
                }
                else
                {
                    NetworkText text2 = NetworkText.FromKey("The underworld's flames shimmer with energy.");
                    NetMessage.BroadcastChatMessage(text2, new Color(201, 10, 10));
                }
            }

            if (isDisplayingEvilMessage)
            {
                if (Main.netMode != 2)
                {
                    Main.NewText("The world's evil erupts with destructive energy.", 152, 36, 173);
                }
                else
                {
                    NetworkText text2 = NetworkText.FromKey("The world's evil erupts with destructive energy.");
                    NetMessage.BroadcastChatMessage(text2, new Color(152, 36, 173));
                }
            }

            if (isDisplayingMushroomMessage)
            {
                if (Main.netMode != 2)
                {
                    Main.NewText("The glowing mushrooms of the caverns explode with radiance.", 232, 242, 50);
                }
                else
                {
                    NetworkText text2 = NetworkText.FromKey("The glowing mushrooms of the caverns explode with radiance.");
                    NetMessage.BroadcastChatMessage(text2, new Color(232, 242, 50));
                }
            }

            if (npc.damage > 1 && npc.lifeMax > 10 && !npc.friendly)
            {
                if (!Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].ZoneBeach && !Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].ZoneCorrupt && !Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].ZoneCrimson && !Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].ZoneDungeon && !Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].ZoneGlowshroom && !Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].ZoneHoly && !Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].ZoneJungle && !Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].ZoneMeteor && !Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].ZoneOldOneArmy && !Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].ZoneSandstorm && !Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].ZoneTowerNebula && !Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].ZoneTowerSolar && !Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].ZoneTowerStardust && !Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].ZoneTowerVortex && !Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].ZoneUndergroundDesert && !Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].ZoneUnderworldHeight && !Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].ZoneRockLayerHeight && !Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].ZoneDirtLayerHeight)
                {
                    if (Main.rand.Next(2) == 0)
                    {
                        Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StableKiCrystal"), Main.rand.Next(1, 2));
                    }
                }

                if (NPC.downedBoss2)
                {
                    if (Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].ZoneJungle)
                    {
                        if (Main.rand.Next(2) == 0)
                        {
                            Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CalmKiCrystal"), Main.rand.Next(1, 3));
                        }
                    }
                }

                if (NPC.downedBoss3)
                {
                    if (Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].ZoneUnderworldHeight)
                    {
                        if (Main.rand.Next(2) == 0)
                        {
                            Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PridefulKiCrystal"), Main.rand.Next(1, 3));
                        }
                    }
                }
                if (Main.hardMode)
                {
                    if (Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].ZoneCrimson)
                    {
                        if (Main.rand.Next(2) == 0)
                        {
                            Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AngerKiCrystal"), Main.rand.Next(1, 3));
                        }
                    }
                }

                if (Main.hardMode)
                {
                    if (Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].ZoneCorrupt)
                    {
                        if (Main.rand.Next(2) == 0)
                        {
                            Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AngerKiCrystal"), Main.rand.Next(1, 3));
                        }
                    }
                }

                if (Main.hardMode && NPC.downedPlantBoss)
                {
                    if (Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].ZoneGlowshroom)
                    {
                        if (Main.rand.Next(2) == 0)
                        {
                            Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PureKiCrystal"), Main.rand.Next(1, 5));
                        }
                    }
                }
            }

            if (npc.boss)
            {
                if (Main.rand.Next(4) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SenzuBean"), Main.rand.Next(1, 3));
                }
            }

            if (!Main.expertMode)
            {
                if (npc.type == NPCID.EyeofCthulhu)
                {
                    if (Main.rand.Next(4) == 0)
                    {
                        Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("KiFragment1"), 1);
                    }
                }

                if (npc.type == NPCID.SkeletronHead)
                {
                    if (Main.rand.Next(4) == 0)
                    {
                        Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("KiFragment2"), 1);
                    }
                }

                if (npc.type == NPCID.SkeletronPrime)
                {
                    if (Main.rand.Next(4) == 0)
                    {
                        Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("KiFragment3"), 1);
                    }
                }

                if (npc.type == NPCID.Plantera)
                {
                    if (Main.rand.Next(4) == 0)
                    {
                        Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("KiFragment4"), 1);
                    }
                }

                if (npc.type == NPCID.CultistBoss)
                {
                    if (Main.rand.Next(4) == 0)
                    {
                        Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("KiFragment5"), 1);
                    }
                }

                if (npc.type == NPCID.WallofFlesh)
                {
                    if (Main.rand.Next(4) == 0)
                    {
                        Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SpiritualEmblem"), 1);
                    }

                    if (Main.rand.Next(4) < 3)
                    {
                        Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TransmissionVanish"), 1);
                    }
                }
            }

            if (!Main.expertMode)
            {
                if (npc.type == NPCID.EyeofCthulhu)
                {
                    if (Main.rand.Next(4) == 0)
                    {
                        Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("KaioFragmentFirst"), 1);
                    }
                }
            }

            if (!Main.expertMode)
            {
                if ((npc.type == NPCID.EaterofWorldsHead && npc.boss) || npc.type == NPCID.BrainofCthulhu)
                {
                    if (Main.rand.Next(4) == 0)
                    {
                        Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("KaioFragment1"), 1);
                    }
                }
            }

            if (!Main.expertMode)
            {
                if (npc.type == NPCID.QueenBee)
                {
                    if (Main.rand.Next(4) == 0)
                    {
                        Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("KaioFragment2"), 1);
                    }
                }
            }

            if (!Main.expertMode)
            {
                if (npc.type == NPCID.SkeletronHead)
                {
                    if (Main.rand.Next(4) == 0)
                    {
                        Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("KaioFragment3"), 1);
                    }
                }
            }

            if (!Main.expertMode)
            {
                if (npc.type == NPCID.WallofFlesh)
                {
                    if (Main.rand.Next(4) == 0)
                    {
                        Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("KaioFragment4"), 1);
                    }
                }
            }

            if (NPC.downedQueenBee)
            {
                if (npc.type == NPCID.Harpy)
                {
                    if (Main.rand.Next(3) == 0)
                    {
                        Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AstralEssentia"), Main.rand.Next(1, 3));
                    }
                }
            }

            if (NPC.downedBoss3)
            {
                if (npc.type == NPCID.AngryBones || npc.type == NPCID.AngryBonesBig || npc.type == NPCID.AngryBonesBigHelmet || npc.type == NPCID.AngryBonesBigMuscle || npc.type == NPCID.DarkCaster)
                {
                    if (Main.rand.Next(5) == 0)
                    {
                        Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SkeletalEssence"), Main.rand.Next(1, 3));
                    }
                }
            }

            if (NPC.downedMechBoss1 && NPC.downedMechBoss2 && NPC.downedMechBoss3)
            {
                if (npc.type == NPCID.CrimsonAxe || npc.type == NPCID.PossessedArmor || npc.type == NPCID.EnchantedSword || npc.type == NPCID.CursedHammer)
                {
                    if (Main.rand.Next(3) == 0)
                    {
                        Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SoulofEntity"), Main.rand.Next(1, 6));
                    }
                }
            }

            if (NPC.downedGolemBoss)
            {
                if (npc.type == NPCID.RedDevil || npc.type == NPCID.Demon || npc.type == NPCID.VoodooDemon)
                {
                    if (Main.rand.Next(2) == 0)
                    {
                        Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DemonicSoul"), Main.rand.Next(1, 3));
                    }
                }
            }

            if (!NPC.downedBoss1)
            {
                if (npc.type == NPCID.EyeofCthulhu)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StableKiCrystal"), Main.rand.Next(6, 18));
                }
            }

            if (!NPC.downedBoss2)
            {
                if (npc.type == NPCID.BrainofCthulhu || (npc.type == NPCID.EaterofWorldsHead && npc.boss))
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StableKiCrystal"), Main.rand.Next(6, 18));
                }
            }

            if (!NPC.downedBoss3)
            {
                if (npc.type == NPCID.SkeletronHead)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CalmKiCrystal"), Main.rand.Next(6, 18));
                }
            }

            if (!NPC.downedQueenBee)
            {
                if (npc.type == NPCID.QueenBee)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CalmKiCrystal"), Main.rand.Next(6, 18));
                }
            }

            if (!Main.hardMode)
            {
                if (npc.type == NPCID.WallofFlesh)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PridefulKiCrystal"), Main.rand.Next(6, 18));
                }
            }

            if (!NPC.downedMechBossAny)
            {
                if (npc.type == NPCID.SkeletronPrime || npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer || npc.type == NPCID.TheDestroyer)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AngerKiCrystal"), Main.rand.Next(6, 18));
                }
            }

            if (!NPC.downedPlantBoss)
            {
                if (npc.type == NPCID.Plantera)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AngerKiCrystal"), Main.rand.Next(6, 18));
                }
            }

            if (!NPC.downedGolemBoss)
            {
                if (npc.type == NPCID.Golem)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PureKiCrystal"), Main.rand.Next(6, 18));
                }
            }

            if (!NPC.downedFishron)
            {
                if (npc.type == NPCID.DukeFishron)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PureKiCrystal"), Main.rand.Next(6, 18));
                }
            }

            if (!NPC.downedAncientCultist)
            {
                if (npc.type == NPCID.CultistBoss)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PureKiCrystal"), Main.rand.Next(6, 18));
                }
            }

            if (!Main.expertMode)
            {
                if (npc.type == NPCID.DukeFishron)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("KatchinScale"), Main.rand.Next(12, 36));
                }
            }

            if (NPC.downedBoss2)
            {
                if (Main.rand.Next(7) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EarthenShard"), Main.rand.Next(1, 3));
                }
            }

            if (npc.type == NPCID.LunarTowerSolar || npc.type == NPCID.LunarTowerNebula || npc.type == NPCID.LunarTowerVortex || npc.type == NPCID.LunarTowerStardust)
            {
                int stacks = Main.rand.Next(6, 12) / 2;
                if (Main.expertMode)
                {
                    stacks = (int)(stacks * 1.5f);
                }

                for (int i = 0; i < stacks; i++)
                {
                    Item.NewItem((int)npc.position.X + Main.rand.Next(npc.width), (int)npc.position.Y + Main.rand.Next(npc.height), 2, 2, mod.ItemType("RadiantFragment"), Main.rand.Next(1, 4));
                }
            }

            if (npc.type == NPCID.LunarTowerSolar || npc.type == NPCID.LunarTowerNebula || npc.type == NPCID.LunarTowerVortex || npc.type == NPCID.LunarTowerStardust)
            {
                if (Main.rand.Next(10) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SSJGUnlockItem"));
                }
            }
            if (NPC.downedBoss3)
            {
                if (npc.type == NPCID.GraniteGolem)
                {
                    if (Main.rand.Next(5) == 0)
                    {
                        Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BaldurEssentia"));
                    }
                }
            }
            if (NPC.downedBoss2)
            {
                if (Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].ZoneMeteor)
                {
                    if (Main.rand.Next(30) == 0)
                    {
                        Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BurningEnergyAmulet"));
                    }
                }
            }
            if (NPC.downedBoss2)
            {
                if (npc.type == NPCID.IceBat || npc.type == NPCID.IceSlime || npc.type == NPCID.SpikedIceSlime)
                {
                    if (Main.rand.Next(20) == 0)
                    {
                        Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceTalisman"));
                    }
                }
            }

            if (npc.type == NPCID.Herpling || npc.type == NPCID.Crimslime || npc.type == NPCID.BloodJelly ||
                npc.type == NPCID.BloodFeeder || npc.type == NPCID.Corruptor || npc.type == NPCID.Slimer)
            {
                if (Main.rand.Next(10) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BloodstainedBandana"));
                }
            }
            if (npc.type == NPCID.GoblinArcher || npc.type == NPCID.GoblinPeon || npc.type == NPCID.GoblinScout || npc.type == NPCID.GoblinSorcerer || npc.type == NPCID.GoblinWarrior || npc.type == NPCID.GoblinThief)
            {
                if (Main.rand.Next(50) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GoblinKiEnhancer"));
                }
            }
            if (npc.type == NPCID.GoblinSummoner)
            {
                if (Main.rand.Next(4) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GoblinKiEnhancer"));
                }
            }
            if (Main.expertMode)
            {
                if (npc.type == NPCID.CultistBoss)
                {
                    if (Main.rand.Next(10) == 0)
                    {
                        Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MetamoranSash"));
                    }
                }
            }
        }
Exemplo n.º 6
0
 public bool CanPerformFlurry(Player player)
 {
     // Is the flurry on cooldown?
     return(FlurryCooldownTimer == 0 && MyPlayer.ModPlayer(player).CanUseFlurry);
 }
Exemplo n.º 7
0
 public override float UseTimeMultiplier(Player player)
 {
     return(MyPlayer.ModPlayer(player).KiSpeedAddition);
 }
Exemplo n.º 8
0
 public int RealKiDrain(Player player)
 {
     return((int)(KiDrain * MyPlayer.ModPlayer(player).KiDrainMulti));
 }
Exemplo n.º 9
0
 public override void GetWeaponCrit(Player player, ref int crit)
 {
     crit = crit + MyPlayer.ModPlayer(player).KiCrit;
 }
Exemplo n.º 10
0
 public override void GetWeaponDamage(Player player, ref int damage)
 {
     damage = (int)Math.Ceiling(damage * MyPlayer.ModPlayer(player).KiDamage);
 }
Exemplo n.º 11
0
 public override void GetWeaponKnockback(Player player, ref float knockback)
 {
     knockback = knockback + MyPlayer.ModPlayer(player).KiKbAddition;
 }
Exemplo n.º 12
0
 public override void Update(Player player, ref int buffIndex)
 {
     KiDrainAdd(player);
     if (IsKaioken)
     {
         MyPlayer.ModPlayer(player).hasKaioken = true;
         Lighting.AddLight(player.Center, KaioLightValue, 0f, 0f);
     }
     if (player.lifeRegen > 0)
     {
         player.lifeRegen = 0;
     }
     player.lifeRegenTime = 0;
     player.lifeRegen    -= HealthDrainRate;
     if (IsSSJ)
     {
         MyPlayer.ModPlayer(player).IsTransformed = true;
         KiDrainTimer++;
         if (KiDrainTimer > 1)
         {
             MyPlayer.ModPlayer(player).KiCurrent -= KiDrainRate;
             KiDrainTimer = 0;
         }
         Lighting.AddLight(player.Center, 1f, 1f, 0f);
     }
     if (MyPlayer.ModPlayer(player).speedToggled)
     {
         player.moveSpeed       += SpeedMulti - 1f;
         player.maxRunSpeed     += SpeedMulti - 1f;
         player.runAcceleration += SpeedMulti - 1f;
     }
     else if (!MyPlayer.ModPlayer(player).speedToggled)
     {
         player.moveSpeed       += 2f;
         player.maxRunSpeed     += 2f;
         player.runAcceleration += 2f;
     }
     player.meleeDamage  += DamageMulti - 1;
     player.rangedDamage += DamageMulti - 1;
     player.magicDamage  += DamageMulti - 1;
     player.minionDamage += DamageMulti - 1;
     player.thrownDamage += DamageMulti - 1;
     MyPlayer.ModPlayer(player).KiDamage += DamageMulti - 1;
     if (DBZMOD.instance.thoriumLoaded)
     {
         ThoriumEffects(player);
     }
     if (DBZMOD.instance.tremorLoaded)
     {
         TremorEffects(player);
     }
     if (DBZMOD.instance.enigmaLoaded)
     {
         EnigmaEffects(player);
     }
     if (DBZMOD.instance.battlerodsLoaded)
     {
         BattleRodEffects(player);
     }
     if (IsSSJ)
     {
         if (MyPlayer.ModPlayer(player).KiCurrent <= 0)
         {
             MyPlayer.ModPlayer(player).IsTransformed = false;
             player.ClearBuff(mod.BuffType("SSJ1Buff"));
             player.ClearBuff(mod.BuffType("ASSJBuff"));
             player.ClearBuff(mod.BuffType("USSJBuff"));
             player.ClearBuff(mod.BuffType("SSJ1KaiokenBuff"));
             player.ClearBuff(mod.BuffType("SSJ2Buff"));
             player.ClearBuff(mod.BuffType("SSJ3Buff"));
             player.ClearBuff(mod.BuffType("LSSJBuff"));
             Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/PowerDown").WithVolume(.3f));
             MyPlayer.ModPlayer(player).IsTransformed = false;
         }
     }
 }
Exemplo n.º 13
0
 private void KiDrainAdd(Player player)
 {
     MyPlayer.ModPlayer(player).KiDrainMulti = KiDrainBuffMulti;
 }