Exemple #1
0
 public override void GetWeaponCrit(Item item, Player player, ref int crit)
 {
     if (DetectPositives(item))
     {
         crit = crit + ECPlayer.ModPlayer(player).tkCrit;
     }
 }
Exemple #2
0
 public override void ModifyWeaponDamage(Item item, Player player, ref float add, ref float mult, ref float flat)
 {
     if (DetectPositives(item))
     {
         mult *= ECPlayer.ModPlayer(player).tkDamage;
     }
 }
Exemple #3
0
 public override void GetWeaponKnockback(Item item, Player player, ref float knockback)
 {
     if (DetectPositives(item))
     {
         knockback += ECPlayer.ModPlayer(player).tkKnockback;
     }
     base.GetWeaponKnockback(item, player, ref knockback);
 }
Exemple #4
0
        public override void clientClone(ModPlayer clientClone)
        {
            ECPlayer clone = clientClone as ECPlayer;

            clone.psychosis        = psychosis;
            clone.psychosisDelay   = psychosisDelay;
            clone.psychosisDelay2  = psychosisDelay2;
            clone.maxPsychosis     = maxPsychosis;
            clone.psychosisWarning = psychosisWarning;
        }
Exemple #5
0
 public override void HoldStyle(Item item, Player player)
 {
     if (DetectPositives(item))
     {
         ECPlayer.ModPlayer(player).overPsychosis = false;
         if (player.channel)
         {
             ECPlayer.ModPlayer(player).PsychosisDrain(1f);
             if (player.HasBuff(mod.BuffType("PsychedOut")))
             {
                 ECPlayer.ModPlayer(player).overPsychosis = true;
             }
         }
     }
 }
Exemple #6
0
 public override void HoldItem(Player player)
 {
     ECPlayer.ModPlayer(player).overPsychosis = false;
     if (player.channel && player.ownedProjectileCounts[item.shoot] > 0)
     {
         float amount = 1f;
         if (!onlyOne)
         {
             amount = 3f;
         }
         ECPlayer.ModPlayer(player).PsychosisDrain(amount);
         if (player.HasBuff(mod.BuffType("PsychedOut")))
         {
             ECPlayer.ModPlayer(player).overPsychosis = true;
         }
     }
 }
Exemple #7
0
        //Based on jopojelly's Boss Checklist mod
        public override object Call(params object[] args)
        {
            Player player = Main.player[Main.myPlayer];

            try
            {
                string message = args[0] as string;
                if (message == "IncreaseTelekinesisDamage")
                {
                    float damageAmount = Convert.ToSingle(args[1]);
                    return(ECPlayer.ModPlayer(player).tkDamage += damageAmount);
                }
                else if (message == "IncreaseTelekinesisCrit")
                {
                    float critAmount = Convert.ToSingle(args[1]);
                    return(ECPlayer.ModPlayer(player).tkCrit += (int)critAmount);
                }
                else if (message == "IncreaseTelekinesisVelocity")
                {
                    float velAmount = Convert.ToSingle(args[1]);
                    return(ECPlayer.ModPlayer(player).tkVel += velAmount);
                }
                else if (message == "UseTelekinesisVelocity")
                {
                    return(Convert.ToSingle(ECPlayer.ModPlayer(player).tkVel));
                }
                else if (message == "AddTKItem")
                {
                    float IsTKItem = Convert.ToSingle(args[1]);
                    TKItem.Add((int)IsTKItem);
                    return("Success");
                }
                else if (message == "AddTKProjectile")
                {
                    float IsTKProjectile = Convert.ToSingle(args[1]);
                    TKProjectile.Add((int)IsTKProjectile);
                    return("Success");
                }
            }
            catch (Exception e)
            {
                ErrorLogger.Log("Esper Class Call Error: " + e.StackTrace + e.Message);
            }
            return("Failure");
        }
        /*public override void Kill(int timeLeft)
         * {
         *      if (held)
         *              Main.player[projectile.owner].channel = false;
         * }*/

        public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
        {
            if (held && !canReturn)
            {
                Main.player[projectile.owner].channel = false;
                held = false;
            }
            ECPlayer modPlayer = Main.player[projectile.owner].GetModPlayer <ECPlayer>();

            if (!projectile.noEnchantments)
            {
                if (Main.rand.Next(4) == 0 && modPlayer.fireVial)
                {
                    target.AddBuff(BuffID.OnFire, 180, false);
                }
                if (Main.rand.Next(4) == 0 && modPlayer.frostburnVial)
                {
                    target.AddBuff(BuffID.Frostburn, 180, false);
                }
                if (Main.rand.Next(4) == 0 && modPlayer.poisonVial)
                {
                    target.AddBuff(BuffID.Poisoned, 180, false);
                }
                if (Main.rand.Next(4) == 0 && modPlayer.midasVial)
                {
                    target.AddBuff(BuffID.Midas, 600, false);
                }
                if (Main.rand.Next(4) == 0 && modPlayer.cursedFlamesVial)
                {
                    target.AddBuff(BuffID.CursedInferno, 180, false);
                }
                if (Main.rand.Next(4) == 0 && modPlayer.ichorVial)
                {
                    target.AddBuff(BuffID.Ichor, 300, false);
                }
                if (Main.rand.Next(4) == 0 && modPlayer.shadowflameVial)                 //Umbrakinesis
                {
                    target.AddBuff(BuffID.ShadowFlame, 180, false);
                }
                if (Main.rand.Next(4) == 0 && modPlayer.venomVial)
                {
                    target.AddBuff(BuffID.Venom, 180, false);
                }
            }
        }
Exemple #9
0
        public override void HandlePacket(BinaryReader reader, int whoAmI)
        {
            EsperClassMessageType msgType = (EsperClassMessageType)reader.ReadByte();

            switch (msgType)
            {
            case EsperClassMessageType.ECPlayerSyncPlayer:
            {
                byte     playernumber = reader.ReadByte();
                ECPlayer ecplayer     = Main.player[playernumber].GetModPlayer <ECPlayer>();
                float    psychosis    = reader.ReadSingle();
                ecplayer.psychosis = psychosis;

                /*int psychosisDelay = reader.ReadInt32();
                 * ecplayer.psychosisDelay = psychosisDelay;
                 * int psychosisDelay2 = reader.ReadInt32();
                 * ecplayer.psychosisDelay2 = psychosisDelay2;
                 * int maxPsychosis = reader.ReadInt32();
                 * ecplayer.maxPsychosis = maxPsychosis;
                 * bool psychosisWarning = reader.ReadInt32();
                 * ecplayer.psychosisWarning = psychosisWarning;
                 * ecplayer.nonStopParty = reader.ReadBoolean();*/
                // SyncPlayer will be called automatically, so there is no need to forward this data to other clients.
                break;
            }

            case EsperClassMessageType.psychosis:
            {
                byte     playernumber = reader.ReadByte();
                ECPlayer ecPlayer     = Main.player[playernumber].GetModPlayer <ECPlayer>();
                float    psychosis    = reader.ReadSingle();
                ecPlayer.psychosis = psychosis;
                break;
            }

            default:
            {
                Logger.WarnFormat("EsperClass: Unknown Message type: {0}", msgType);
                break;
            }
            }
        }
Exemple #10
0
        public override void SendClientChanges(ModPlayer clientPlayer)
        {
            ECPlayer clone = clientPlayer as ECPlayer;

            if (clone.psychosis != psychosis)
            {
                var packet = mod.GetPacket();
                packet.Write((byte)EsperClassMessageType.psychosis);
                packet.Write((byte)player.whoAmI);
                packet.Write(psychosis);
                packet.Send();
            }

            /*if (clone.maxPsychosis != maxPsychosis)
             * {
             *      var packet = mod.GetPacket();
             *      packet.Write((byte)player.whoAmI);
             *      packet.Write(maxPsychosis);
             *      packet.Send();
             * }
             * if (clone.psychosisDelay != psychosisDelay)
             * {
             *      var packet = mod.GetPacket();
             *      packet.Write((byte)player.whoAmI);
             *      packet.Write(psychosisDelay);
             *      packet.Send();
             * }
             * if (clone.psychosisDelay2 != psychosisDelay2)
             * {
             *      var packet = mod.GetPacket();
             *      packet.Write((byte)player.whoAmI);
             *      packet.Write(psychosisDelay2);
             *      packet.Send();
             * }
             * if (clone.psychosisWarning != psychosisWarning)
             * {
             *      var packet = mod.GetPacket();
             *      packet.Write((byte)player.whoAmI);
             *      packet.Write(psychosisWarning);
             *      packet.Send();
             * }*/
        }
Exemple #11
0
 public override void HoldStyle(Player player)
 {
     ECPlayer.ModPlayer(player).overPsychosis = false;
     if (player.channel)
     {
         //if (ECPlayer.ModPlayer(player).psychosis > 0f)
         //{
         float amount = 1f;
         if (!onlyOne)
         {
             amount = 3f;
         }
         ECPlayer.ModPlayer(player).PsychosisDrain(amount);
         //}
         if (player.HasBuff(mod.BuffType("PsychedOut")))
         {
             //player.channel = false;
             ECPlayer.ModPlayer(player).overPsychosis = true;
         }
     }
 }
Exemple #12
0
 public override void ModifyWeaponDamage(Player player, ref float add, ref float mult, ref float flat)
 {
     //damage = (int)(damage * ECPlayer.ModPlayer(player).tkDamage + 5E-06f);
     mult *= ECPlayer.ModPlayer(player).tkDamage;
 }
        public override void NPCLoot(NPC npc)
        {
            //Drop psychosis refills
            if (npc.type != NPCID.MotherSlime && npc.type != NPCID.CorruptSlime && npc.type != NPCID.Slimer && npc.lifeMax > 1 && npc.damage > 0)
            {
                int      nearestPlayer = (int)Player.FindClosest(npc.position, npc.width, npc.height);
                ECPlayer modPlayer     = Main.player[nearestPlayer].GetModPlayer <ECPlayer>();
                if (Main.rand.Next(5) == 0 && !modPlayer.PsychosisFull())
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PsychicEye"), 1, false, 0, false, false);
                }
            }

            if (npc.type == NPCID.KingSlime && !Main.expertMode)
            {
                if (Main.rand.Next(3) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SlimyCanister"));
                }
            }
            if (npc.type == NPCID.EyeofCthulhu && !Main.expertMode)
            {
                if (Main.rand.Next(3) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EyeJar"));
                }
            }
            if (npc.type == NPCID.GoblinPeon || npc.type == NPCID.GoblinThief || npc.type == NPCID.GoblinWarrior || npc.type == NPCID.GoblinSorcerer || npc.type == NPCID.GoblinArcher)
            {
                int chance = 100;
                if (Main.expertMode)
                {
                    chance = 50;
                }
                if (Main.rand.Next(chance) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SpikyBallLobber"));
                }
            }
            if (npc.type == NPCID.WallofFlesh && !Main.expertMode)
            {
                if (Main.rand.Next(4) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EsperEmblem"));
                }
                if (Main.rand.Next(4) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GiantGear"));
                }
            }

            /*if (npc.type == NPCID.LunarTowerSolar || npc.type == NPCID.LunarTowerVortex || npc.type == NPCID.LunarTowerNebula || npc.type == NPCID.LunarTowerStardust)
             * {
             *      int amount;
             *      if (Main.expertMode)
             *              amount = Main.rand.Next(12, 23);
             *      else
             *              amount = Main.rand.Next(8, 15);
             *      for (int i = 0; i < amount; 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("GravityFragment"), Main.rand.Next(1, 4), false, 0, false, false);
             *      }
             * }*/
        }
Exemple #14
0
 public override void GetWeaponCrit(Player player, ref int crit)
 {
     crit = crit + ECPlayer.ModPlayer(player).tkCrit;
 }
Exemple #15
0
 public override void GetWeaponKnockback(Player player, ref float knockback)
 {
     knockback += ECPlayer.ModPlayer(player).tkKnockback;
 }
Exemple #16
0
 public override void ModifyWeaponDamage(Player player, ref float add, ref float mult, ref float flat)
 {
     mult *= ECPlayer.ModPlayer(player).tkDamage;
 }
Exemple #17
0
        public override void NPCLoot(NPC npc)
        {
            //Drop psychosis refills
            if (npc.type != NPCID.MotherSlime && npc.type != NPCID.CorruptSlime && npc.type != NPCID.Slimer && npc.lifeMax > 1 && npc.damage > 0)
            {
                int      nearestPlayer = (int)Player.FindClosest(npc.position, npc.width, npc.height);
                ECPlayer modPlayer     = Main.player[nearestPlayer].GetModPlayer <ECPlayer>();
                if (Main.rand.Next(5) == 0 && !modPlayer.PsychosisFull())
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PsychicEye"), 1, false, 0, false, false);
                }
            }

            if (npc.type == NPCID.KingSlime && !Main.expertMode)
            {
                if (Main.rand.Next(3) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SlimyCanister"));
                }
            }
            if (npc.type == NPCID.EyeofCthulhu && !Main.expertMode)
            {
                if (Main.rand.Next(3) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EyeJar"));
                }
            }
            if (npc.type == NPCID.GoblinPeon || npc.type == NPCID.GoblinThief || npc.type == NPCID.GoblinWarrior || npc.type == NPCID.GoblinSorcerer || npc.type == NPCID.GoblinArcher)
            {
                int chance = 100;
                if (Main.expertMode)
                {
                    chance = 50;
                }
                if (Main.rand.Next(chance) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SpikyBallLobber"));
                }
            }
            if (npc.type == NPCID.WallofFlesh && !Main.expertMode)
            {
                if (Main.rand.Next(4) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EsperEmblem"));
                }
                if (Main.rand.Next(4) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GiantGear"));
                }
            }
            if (npc.type == NPCID.Pixie)
            {
                int chance = 40;
                if (Main.expertMode)
                {
                    chance = 20;
                }
                if (Main.rand.Next(chance) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PixieJar"));
                }
            }
            if (npc.type == NPCID.WyvernHead)
            {
                Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("WyvernScale"));
            }
            if (npc.type == NPCID.GoblinSummoner)
            {
                int chance = 6;
                if (Main.expertMode)
                {
                    chance = 3;
                }
                if (Main.rand.Next(chance) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ShadowflameRift"));
                }
                if (Main.rand.Next(chance) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ShadowflameVialNecklace"));
                }
            }
            if (npc.type == NPCID.MisterStabby || npc.type == NPCID.SnowmanGangsta || npc.type == NPCID.SnowBalla)
            {
                int chance = 100;
                if (Main.expertMode)
                {
                    chance = 50;
                }
                if (Main.rand.Next(chance) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SnowmanBoulder"));
                }
            }
            if (npc.type == NPCID.PirateShip)
            {
                int chance = 6;
                if (Main.expertMode)
                {
                    chance = 3;
                }
                if (Main.rand.Next(chance) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MidasVialNecklace"));
                }
                if (Main.rand.Next(chance) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TKCannonball"));
                }
            }
            if (npc.type == NPCID.Mimic && npc.ai[3] == 4f && npc.value > 0)
            {
                if (Main.rand.Next(2) == 0 || Main.expertMode)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BlizzardTwirler"));
                }
            }
            if (npc.type == NPCID.BigMimicCorruption)
            {
                int chance = 4;
                if (Main.expertMode)
                {
                    chance = 2;
                }
                if (Main.rand.Next(chance) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CursedFlameOrbit"));
                }
            }
            if (npc.type == NPCID.BigMimicCrimson)
            {
                int chance = 4;
                if (Main.expertMode)
                {
                    chance = 2;
                }
                if (Main.rand.Next(chance) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IchorBomber"));
                }
            }
            if (npc.type == NPCID.BigMimicHallow)
            {
                int chance = 4;
                if (Main.expertMode)
                {
                    chance = 2;
                }
                if (Main.rand.Next(chance) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CrystalFlail"));
                }
                if (Main.rand.Next(chance) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CrystalGrenade"));
                }
            }
            if (npc.type == NPCID.ThePossessed)
            {
                int chance = 20;
                if (Main.expertMode)
                {
                    chance = 10;
                }
                if (Main.rand.Next(chance) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DeadDoll"));
                }
            }
            if (npc.type == NPCID.Mothron)
            {
                int chance = 3;
                if (Main.expertMode)
                {
                    chance = 2;
                }
                if (Main.rand.Next(chance) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrokenHeroPsychicParts"));
                }
            }
            if (npc.type == NPCID.Plantera && !Main.expertMode)
            {
                if (Main.rand.Next(3) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("WaspJar"));
                }
                if (Main.rand.Next(3) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TKThornBall"));
                }
            }
            if (npc.type >= NPCID.BlueArmoredBones && npc.type <= NPCID.BlueArmoredBonesSword)
            {
                int chance = 100;
                if (Main.expertMode)
                {
                    chance = 50;
                }
                if (Main.rand.Next(chance) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PsiSpikeBall"));
                }
            }
            if (npc.type >= NPCID.RustyArmoredBonesAxe && npc.type <= NPCID.RustyArmoredBonesSwordNoArmor)
            {
                int chance = 100;
                if (Main.expertMode)
                {
                    chance = 50;
                }
                if (Main.rand.Next(chance) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SpectreRift"));
                }
            }
            if (npc.type >= NPCID.HellArmoredBones && npc.type <= NPCID.HellArmoredBonesSword)
            {
                int chance = 100;
                if (Main.expertMode)
                {
                    chance = 50;
                }
                if (Main.rand.Next(chance) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ImpiousBrooch"));
                }
            }
            if (Main.pumpkinMoon)
            {
                int wave     = NPC.waveNumber;
                int dropRate = (int)((double)(17 - wave) / 1.25);
                if (Main.expertMode)
                {
                    wave += 6;
                }
                if (dropRate < 1)
                {
                    dropRate = 1;
                }
                if (Main.rand.Next(dropRate) == 0)
                {
                    if (npc.type == NPCID.MourningWood)
                    {
                        Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MourningTwirler"));
                    }
                    if (npc.type == NPCID.Pumpking)
                    {
                        Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PsiPumpKing"));
                    }
                }
            }
            if (Main.snowMoon)
            {
                int wave     = NPC.waveNumber;
                int dropRate = (int)((double)(30 - wave) / 2.5);
                if (Main.expertMode)
                {
                    wave     += 7;
                    dropRate -= 2;
                }
                if (dropRate < 1)
                {
                    dropRate = 1;
                }
                if (Main.rand.Next(dropRate) == 0)
                {
                    if (npc.type == NPCID.Everscream)
                    {
                        Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OrnamentsOrbit"));
                    }
                    if (npc.type == NPCID.SantaNK1)
                    {
                        Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PsiExplodingPresent"));
                    }
                    if (npc.type == NPCID.IceQueen)
                    {
                        Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IcicleSpitter"));
                    }
                }
            }
            if (npc.type == NPCID.Golem && !Main.expertMode)
            {
                if (Main.rand.Next(3) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GolemHeadRift"));
                }
            }
            if (npc.type == NPCID.DukeFishron && !Main.expertMode)
            {
                if (Main.rand.Next(3) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SharknadoRift"));
                }
                //if (Main.rand.Next(3) == 0)
                //	Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BubbleTurret"));
            }
            if (npc.type == NPCID.MartianSaucerCore)
            {
                if (Main.rand.Next(3) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MartianPsi"));
                }
            }
            if (npc.type == NPCID.DD2Betsy && !Main.expertMode)
            {
                if (Main.rand.Next(2) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BetsyPsi"));
                }
            }

            /*if (npc.type == NPCID.LunarTowerSolar || npc.type == NPCID.LunarTowerVortex || npc.type == NPCID.LunarTowerNebula || npc.type == NPCID.LunarTowerStardust)
             * {
             *      int amount;
             *      if (Main.expertMode)
             *              amount = Main.rand.Next(12, 23);
             *      else
             *              amount = Main.rand.Next(8, 15);
             *      for (int i = 0; i < amount; 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("GravityFragment"), Main.rand.Next(1, 4), false, 0, false, false);
             *      }
             * }*/
            if (npc.type == NPCID.LunarTowerVortex)
            {
                int amount = Main.rand.Next(25, 41) / 2;
                if (Main.expertMode)
                {
                    amount = (int)((float)amount * 1.5f);
                }
                for (int i = 0; i < amount; 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("GravityFragment"), Main.rand.Next(1, 4));
                }
            }
            if (npc.type == NPCID.MoonLordCore && !Main.expertMode)
            {
                if (Main.rand.Next(4) == 0)
                {
                    Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EldritchEyeJarProj"));
                }
            }

            /*if (Main.hardMode && npc.value > 0f)
             * {
             *      int dropChance = GetInstance<ECConfigServer>().easierOceanKey ? 1000 : 2500;
             *      if (Main.rand.Next(dropChance) == 0 && Main.player[Player.FindClosest(npc.position, npc.width, npc.height)].ZoneBeach)
             *      {
             *              Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OceanKey"));
             *      }
             * }*/
        }
Exemple #18
0
 public override void clientClone(ModPlayer clientClone)
 {
     ECPlayer clone = clientClone as ECPlayer;
 }
 public override void AI(Projectile projectile)
 {
     if (DetectPositives(projectile))
     {
         if (!projectile.noEnchantments)
         {
             ECPlayer modPlayer = Main.player[projectile.owner].GetModPlayer <ECPlayer>();
             if (modPlayer.fireVial && Main.rand.Next(2) == 0)
             {
                 int num5 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, projectile.velocity.X * 0.2f + (float)(projectile.direction * 3), projectile.velocity.Y * 0.2f, 100, default(Color), 2.5f);
                 Main.dust[num5].noGravity = true;
                 Main.dust[num5].velocity *= 0.7f;
                 Dust dust3 = Main.dust[num5];
                 dust3.velocity.Y = dust3.velocity.Y - 0.5f;
             }
             if (modPlayer.frostburnVial && Main.rand.Next(2 * (1 + projectile.extraUpdates)) == 0)
             {
                 int num = Dust.NewDust(projectile.position, projectile.width, projectile.height, 135, projectile.velocity.X * 0.2f + (float)(projectile.direction * 3), projectile.velocity.Y * 0.2f, 100, default(Color), 2f);
                 Main.dust[num].noGravity = true;
                 Main.dust[num].velocity *= 0.7f;
                 Dust dust = Main.dust[num];
                 dust.velocity.Y = dust.velocity.Y - 0.5f;
             }
             if (modPlayer.poisonVial && Main.rand.Next(4) == 0)
             {
                 int num13 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 46, 0f, 0f, 100, default(Color), 1f);
                 Main.dust[num13].noGravity = true;
                 Main.dust[num13].fadeIn    = 1.5f;
                 Main.dust[num13].velocity *= 0.25f;
             }
             if (modPlayer.cursedFlamesVial && Main.rand.Next(2) == 0)
             {
                 int num4 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 75, projectile.velocity.X * 0.2f + (float)(projectile.direction * 3), projectile.velocity.Y * 0.2f, 100, default(Color), 2.5f);
                 Main.dust[num4].noGravity = true;
                 Main.dust[num4].velocity *= 0.7f;
                 Dust dust2 = Main.dust[num4];
                 dust2.velocity.Y = dust2.velocity.Y - 0.5f;
             }
             if (modPlayer.ichorVial && Main.rand.Next(2) == 0)
             {
                 int  num7  = Dust.NewDust(projectile.position, projectile.width, projectile.height, 169, 0f, 0f, 100, default(Color), 1f);
                 Dust dust6 = Main.dust[num7];
                 dust6.velocity.X = dust6.velocity.X + (float)projectile.direction;
                 Dust dust7 = Main.dust[num7];
                 dust7.velocity.Y          = dust7.velocity.Y + 0.2f;
                 Main.dust[num7].noGravity = true;
             }
             if (modPlayer.midasVial && Main.rand.Next(2) == 0)
             {
                 int num6 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 57, projectile.velocity.X * 0.2f + (float)(projectile.direction * 3), projectile.velocity.Y * 0.2f, 100, default(Color), 1.1f);
                 Main.dust[num6].noGravity = true;
                 Dust dust4 = Main.dust[num6];
                 dust4.velocity.X = dust4.velocity.X / 2f;
                 Dust dust5 = Main.dust[num6];
                 dust5.velocity.Y = dust5.velocity.Y / 2f;
             }
             if (modPlayer.shadowflameVial && Main.rand.Next(2) == 0)
             {
                 int num15 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 27, projectile.velocity.X, projectile.velocity.Y, 100, default(Color), 1.2f);
                 Main.dust[num15].position  = (Main.dust[num15].position + projectile.Center) / 2f;
                 Main.dust[num15].noGravity = true;
                 Dust dust3 = Main.dust[num15];
                 dust3.velocity *= 0.3f;
                 dust3           = Main.dust[num15];
                 dust3.velocity -= projectile.velocity * 0.1f;
             }
             if (modPlayer.venomVial && Main.rand.Next(3) == 0)
             {
                 int num2 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 171, 0f, 0f, 100, default(Color), 1f);
                 Main.dust[num2].noGravity = true;
                 Main.dust[num2].fadeIn    = 1.5f;
                 Main.dust[num2].velocity *= 0.25f;
             }
         }
     }
 }