From bab571ff4981ffbf9ec0bd757967ef04d4fb6eb2 Mon Sep 17 00:00:00 2001 From: Tymon Date: Fri, 13 Sep 2019 14:57:59 +0200 Subject: [PATCH] Cleanup Finished GlobalNPC cleanup. Replaced netmode = x checks with NetmodeID.X checks. Replaced Next(X) == 0 with NextBool(X). --- CalPlayer/CalamityPlayer.cs | 344 +++--- CalPlayer/CalamityPlayerLifeRegen.cs | 14 +- CalamityMod.cs | 70 +- Items/AbyssItems/TorrentialTear.cs | 20 +- Items/Accessories/AmalgamatedBrain.cs | 2 +- Items/Accessories/BadgeofBravery.cs | 2 +- Items/Accessories/HeartoftheElements.cs | 14 +- Items/Accessories/PlagueHive.cs | 2 +- Items/Accessories/TheAmalgam.cs | 6 +- Items/Accessories/VoidofExtinction.cs | 2 +- Items/Accessories/Wings/AureateWings.cs | 2 +- Items/Accessories/Wings/CelestialTracers.cs | 4 +- Items/Accessories/Wings/DiscordianWings.cs | 4 +- Items/Accessories/Wings/DrewsWings.cs | 4 +- Items/Accessories/Wings/ElysianTracers.cs | 4 +- Items/Accessories/Wings/HadarianWings.cs | 4 +- Items/Accessories/Wings/InfinityBoots.cs | 4 +- Items/Accessories/Wings/MOAB.cs | 2 +- Items/Accessories/Wings/StarlightWings.cs | 4 +- Items/Accessories/Wings/TarragonWings.cs | 4 +- Items/Accessories/Wings/XerocWings.cs | 4 +- Items/Amidias/CoralCannon.cs | 2 +- Items/Armor/AuricTeslaSpaceHelmet.cs | 2 +- Items/Armor/GodSlayerHornedHelm.cs | 2 +- Items/Astrageldon/AstralChunk.cs | 2 +- Items/Calamitas/CalamityRing.cs | 2 +- .../EmpyreanKnivesThrown.cs | 10 +- .../RoyalKnives.cs | 10 +- Items/CalamityGlobalItem.cs | 18 +- Items/Crabulon/DecapoditaSprout.cs | 2 +- Items/DifficultyItems/Armageddon.cs | 4 +- Items/DifficultyItems/Death.cs | 8 +- Items/DifficultyItems/DefiledRune.cs | 8 +- Items/DifficultyItems/IronHeart.cs | 8 +- Items/DifficultyItems/Revenge.cs | 16 +- Items/HiveMind/RottenBrain.cs | 2 +- Items/HiveMind/Teratoma.cs | 2 +- Items/Leviathan/LeviathanAmbergris.cs | 2 +- Items/LoreItems/KnowledgeBrainofCthulhu.cs | 2 +- Items/Mounts/AngryDog.cs | 6 +- Items/Mounts/Crysthamyr.cs | 6 +- Items/Mounts/Fab.cs | 2 +- Items/Mounts/OnyxExcavator.cs | 6 +- Items/Mounts/PhuppersChair.cs | 2 +- Items/Mounts/SquishyBean.cs | 2 +- Items/Patreon/Ataraxia.cs | 4 +- Items/Patreon/LightGodsBrilliance.cs | 2 +- Items/Patreon/ResurrectionButterfly.cs | 4 +- Items/Patreon/Roxcalibur.cs | 6 +- Items/Patreon/TheLastMourning.cs | 4 +- Items/Permafrost/WintersFury.cs | 2 +- Items/PlaguebringerGoliath/BloomStone.cs | 16 +- Items/PlaguebringerGoliath/ToxicHeart.cs | 3 +- Items/Scavenger/AncientMedallion.cs | 2 +- Items/SummonsAndClimateChange/BossRush.cs | 6 +- .../SummonsAndClimateChange/EidolonTablet.cs | 2 +- Items/SupremeCalamitas/EyeofExtinction.cs | 2 +- Items/TheDevourerofGods/CosmicWorm.cs | 4 +- Items/TheDevourerofGods/NebulousCore.cs | 4 +- Items/Tools/AbyssalWarhammer.cs | 2 +- Items/Tools/AerialHamaxe.cs | 2 +- Items/Tools/AstralHamaxe.cs | 2 +- Items/Tools/AstralPickaxe.cs | 2 +- Items/Tools/BeastialPickaxe.cs | 2 +- Items/Tools/BerserkerWaraxe.cs | 2 +- Items/Tools/BlossomPickaxe.cs | 2 +- Items/Tools/ChaoswarpedSlashaxe.cs | 2 +- Items/Tools/CrystylCrusher.cs | 2 +- Items/Tools/FlamebeakHampick.cs | 2 +- Items/Tools/GallantPickaxe.cs | 2 +- Items/Tools/Gelpick.cs | 2 +- Items/Tools/ShardlightPickaxe.cs | 2 +- Items/Tools/SkyfringePickaxe.cs | 2 +- Items/Weapons/AbyssBlade.cs | 2 +- Items/Weapons/AegisBlade.cs | 2 +- Items/Weapons/Aftershock.cs | 2 +- Items/Weapons/Alluvion.cs | 8 +- Items/Weapons/AlphaRay.cs | 2 +- Items/Weapons/AnarchyBlade.cs | 4 +- Items/Weapons/AncientShiv.cs | 2 +- Items/Weapons/AquaticDissolution.cs | 2 +- .../AquaticScourge/SubmarineShocker.cs | 2 +- Items/Weapons/ArkoftheAncients.cs | 6 +- Items/Weapons/ArkoftheCosmos.cs | 2 +- Items/Weapons/ArkoftheElements.cs | 2 +- Items/Weapons/Astral/AstralBlade.cs | 2 +- Items/Weapons/Astral/AstralachneaStaff.cs | 6 +- Items/Weapons/AuguroftheElements.cs | 4 +- Items/Weapons/BiomeBlade.cs | 2 +- Items/Weapons/BladedgeGreatbow.cs | 2 +- Items/Weapons/BloodyEdge.cs | 4 +- Items/Weapons/Brimlash.cs | 2 +- Items/Weapons/BrimlashBuster.cs | 4 +- Items/Weapons/BrinyBaron.cs | 2 +- Items/Weapons/BurntSienna.cs | 2 +- Items/Weapons/Calamitas/BlightedEyeStaff.cs | 6 +- Items/Weapons/CatastropheClaymore.cs | 4 +- Items/Weapons/CausticEdge.cs | 2 +- Items/Weapons/CelestialClaymore.cs | 4 +- Items/Weapons/ClockworkBow.cs | 6 +- Items/Weapons/CometQuasher.cs | 2 +- Items/Weapons/CosmicBolter.cs | 2 +- Items/Weapons/CosmicRainbow.cs | 2 +- Items/Weapons/Crabulon/HyphaeRod.cs | 2 +- Items/Weapons/Crabulon/MycelialClaws.cs | 2 +- Items/Weapons/Cryogen/Avalanche.cs | 4 +- Items/Weapons/Cryogen/BittercoldStaff.cs | 6 +- Items/Weapons/Cryogen/GlacialCrusher.cs | 2 +- Items/Weapons/DarklightGreatsword.cs | 2 +- Items/Weapons/DepthBlade.cs | 2 +- .../Weapons/DesertScourge/AquaticDischarge.cs | 2 +- Items/Weapons/Devastation.cs | 2 +- Items/Weapons/DevilsDevastation.cs | 10 +- .../Weapons/DevourerofGods/DeathhailStaff.cs | 2 +- .../DevourerofGods/StaffoftheMechworm.cs | 2 +- Items/Weapons/DraconicDestruction.cs | 2 +- Items/Weapons/DraedonsExoblade.cs | 4 +- Items/Weapons/Dualpoon.cs | 2 +- Items/Weapons/Earth.cs | 2 +- Items/Weapons/ElementalShortsword.cs | 2 +- Items/Weapons/EmpyreanKnives.cs | 10 +- Items/Weapons/EssenceFlayer.cs | 2 +- Items/Weapons/ExcaliburShortsword.cs | 2 +- Items/Weapons/FeralthornClaymore.cs | 2 +- Items/Weapons/FlameburstShortsword.cs | 2 +- Items/Weapons/FlarefrostBlade.cs | 2 +- Items/Weapons/FlarewingBow.cs | 2 +- Items/Weapons/Floodtide.cs | 2 +- Items/Weapons/ForbiddenOathblade.cs | 10 +- Items/Weapons/ForsakenSaber.cs | 2 +- Items/Weapons/FourSeasonsGalaxia.cs | 2 +- Items/Weapons/GalacticaBlade.cs | 4 +- Items/Weapons/GrandGuardian.cs | 4 +- Items/Weapons/GreatbowofTurmoil.cs | 2 +- Items/Weapons/HeavenlyGale.cs | 2 +- Items/Weapons/HellfireFlamberge.cs | 2 +- Items/Weapons/Hellkite.cs | 10 +- Items/Weapons/HellwingStaff.cs | 6 +- Items/Weapons/HiveMind/LeechingDagger.cs | 2 +- Items/Weapons/HolidayHalberd.cs | 4 +- Items/Weapons/Impaler.cs | 2 +- Items/Weapons/InfernaCutter.cs | 2 +- Items/Weapons/Leviathan/Greentide.cs | 2 +- Items/Weapons/Leviathan/Leviatitan.cs | 2 +- Items/Weapons/LifefruitScythe.cs | 2 +- Items/Weapons/Lucrecia.cs | 2 +- Items/Weapons/LunarianBow.cs | 2 +- Items/Weapons/MajesticGuard.cs | 2 +- Items/Weapons/MantisClaws.cs | 2 +- Items/Weapons/Mariana.cs | 10 +- Items/Weapons/Megafleet.cs | 2 +- Items/Weapons/Monsoon.cs | 6 +- Items/Weapons/NeptunesBounty.cs | 2 +- Items/Weapons/NettlelineGreatbow.cs | 2 +- Items/Weapons/NightsStabber.cs | 2 +- Items/Weapons/OldLordOathsword.cs | 8 +- Items/Weapons/OmegaBiomeBlade.cs | 2 +- Items/Weapons/Omniblade.cs | 2 +- Items/Weapons/Perforators/BloodBath.cs | 4 +- Items/Weapons/Perforators/BloodyRupture.cs | 2 +- Items/Weapons/PhoenixBlade.cs | 2 +- Items/Weapons/Plaguebringer/PlagueStaff.cs | 6 +- .../Weapons/Polterghast/EtherealSubjugator.cs | 2 +- Items/Weapons/Polterghast/TerrorBlade.cs | 2 +- Items/Weapons/ProfanedSword.cs | 2 +- Items/Weapons/Providence/HolyCollider.cs | 8 +- Items/Weapons/PurityAxe.cs | 2 +- Items/Weapons/RareVariants/Carnage.cs | 10 +- Items/Weapons/RareVariants/EvilSmasher.cs | 2 +- Items/Weapons/RareVariants/Swordsplosion.cs | 2 +- Items/Weapons/RedSun.cs | 4 +- Items/Weapons/RoyalKnivesMelee.cs | 10 +- Items/Weapons/SDFMG.cs | 2 +- Items/Weapons/Seadragon.cs | 2 +- Items/Weapons/Shroomer.cs | 2 +- .../Weapons/SlimeGod/CorruptedCrusherBlade.cs | 2 +- Items/Weapons/SlimeGod/CrimsonCrusherBlade.cs | 2 +- Items/Weapons/SlimeGod/EldritchTome.cs | 4 +- Items/Weapons/SlimeGod/GeliticBlade.cs | 2 +- Items/Weapons/SlimeGod/Goobow.cs | 2 +- Items/Weapons/SolsticeClaymore.cs | 2 +- Items/Weapons/SoulHarvester.cs | 10 +- Items/Weapons/SporeKnife.cs | 2 +- Items/Weapons/StardustStaff.cs | 8 +- Items/Weapons/StellarStriker.cs | 2 +- Items/Weapons/StormRuler.cs | 4 +- Items/Weapons/StormSaber.cs | 4 +- Items/Weapons/SunkenSea/EutrophicShank.cs | 4 +- Items/Weapons/SunkenSea/Serpentine.cs | 2 +- Items/Weapons/TemporalFloeSword.cs | 4 +- Items/Weapons/TerraEdge.cs | 2 +- Items/Weapons/TerraShiv.cs | 2 +- Items/Weapons/Terracotta.cs | 2 +- Items/Weapons/Terratomere.cs | 4 +- Items/Weapons/TheEnforcer.cs | 2 +- Items/Weapons/TheMutilator.cs | 8 +- Items/Weapons/TheWand.cs | 2 +- Items/Weapons/TomeofFates.cs | 4 +- Items/Weapons/Trinity.cs | 2 +- Items/Weapons/Triploon.cs | 2 +- Items/Weapons/TrueArkoftheAncients.cs | 8 +- Items/Weapons/TrueBiomeBlade.cs | 2 +- Items/Weapons/TrueBloodyEdge.cs | 4 +- Items/Weapons/TrueCausticEdge.cs | 2 +- Items/Weapons/TrueExcaliburShortsword.cs | 2 +- Items/Weapons/TrueForbiddenOathblade.cs | 10 +- Items/Weapons/TrueNightsStabber.cs | 2 +- Items/Weapons/TrueTyrantYharimsUltisword.cs | 2 +- Items/Weapons/TyrantYharimsUltisword.cs | 2 +- Items/Weapons/Vortexpopper.cs | 4 +- Items/Weapons/WindBlade.cs | 2 +- Items/Weapons/XerocsGreatsword.cs | 2 +- Items/Weapons/Yharon/DragonRage.cs | 2 +- Items/Weapons/Yharon/PhoenixFlameBarrage.cs | 4 +- Items/Weapons/Yharon/TheBurningSky.cs | 2 +- Items/Yharon/YharimsGift.cs | 2 +- NPCs/AbyssNPCs/AquaticParasite.cs | 4 +- NPCs/AbyssNPCs/AquaticScourgeBody.cs | 6 +- NPCs/AbyssNPCs/AquaticScourgeBodyAlt.cs | 6 +- NPCs/AbyssNPCs/AquaticScourgeHead.cs | 14 +- NPCs/AbyssNPCs/AquaticScourgeTail.cs | 4 +- NPCs/AbyssNPCs/AquaticSeekerBody.cs | 4 +- NPCs/AbyssNPCs/AquaticSeekerHead.cs | 10 +- NPCs/AbyssNPCs/AquaticSeekerTail.cs | 4 +- NPCs/AbyssNPCs/AquaticUrchin.cs | 6 +- NPCs/AbyssNPCs/Bloatfish.cs | 10 +- NPCs/AbyssNPCs/BobbitWormHead.cs | 10 +- NPCs/AbyssNPCs/BobbitWormSegment.cs | 2 +- NPCs/AbyssNPCs/BoxJellyfish.cs | 4 +- NPCs/AbyssNPCs/Catfish.cs | 6 +- NPCs/AbyssNPCs/ChaoticPuffer.cs | 8 +- NPCs/AbyssNPCs/ColossalSquid.cs | 20 +- NPCs/AbyssNPCs/Cuttlefish.cs | 8 +- NPCs/AbyssNPCs/DevilFish.cs | 14 +- NPCs/AbyssNPCs/EidolonWyrmBody.cs | 4 +- NPCs/AbyssNPCs/EidolonWyrmBodyAlt.cs | 4 +- NPCs/AbyssNPCs/EidolonWyrmBodyAltHuge.cs | 4 +- NPCs/AbyssNPCs/EidolonWyrmBodyHuge.cs | 4 +- NPCs/AbyssNPCs/EidolonWyrmHead.cs | 30 +- NPCs/AbyssNPCs/EidolonWyrmHeadHuge.cs | 24 +- NPCs/AbyssNPCs/EidolonWyrmTail.cs | 4 +- NPCs/AbyssNPCs/EidolonWyrmTailHuge.cs | 4 +- NPCs/AbyssNPCs/Flounder.cs | 8 +- NPCs/AbyssNPCs/Frogfish.cs | 6 +- NPCs/AbyssNPCs/GiantSquid.cs | 12 +- NPCs/AbyssNPCs/Gnasher.cs | 6 +- NPCs/AbyssNPCs/GulperEelBody.cs | 4 +- NPCs/AbyssNPCs/GulperEelBodyAlt.cs | 4 +- NPCs/AbyssNPCs/GulperEelHead.cs | 20 +- NPCs/AbyssNPCs/GulperEelTail.cs | 4 +- NPCs/AbyssNPCs/Laserfish.cs | 10 +- NPCs/AbyssNPCs/LuminousCorvina.cs | 14 +- NPCs/AbyssNPCs/MantisShrimp.cs | 8 +- NPCs/AbyssNPCs/Mauler.cs | 26 +- NPCs/AbyssNPCs/MirageJelly.cs | 26 +- NPCs/AbyssNPCs/MorayEel.cs | 6 +- NPCs/AbyssNPCs/OarfishBody.cs | 4 +- NPCs/AbyssNPCs/OarfishHead.cs | 16 +- NPCs/AbyssNPCs/OarfishTail.cs | 4 +- NPCs/AbyssNPCs/Reaper.cs | 28 +- NPCs/AbyssNPCs/SeaUrchin.cs | 6 +- NPCs/AbyssNPCs/ToxicMinnow.cs | 12 +- NPCs/AbyssNPCs/Trasher.cs | 12 +- NPCs/AbyssNPCs/Viperfish.cs | 12 +- NPCs/Astrageldon/Astrageldon.cs | 14 +- NPCs/Astrageldon/AstrageldonSlime.cs | 18 +- NPCs/AstralBiomeNPCs/Aries.cs | 4 +- NPCs/AstralBiomeNPCs/AstralProbe.cs | 20 +- NPCs/AstralBiomeNPCs/AstralachneaGround.cs | 4 +- NPCs/AstralBiomeNPCs/AstralachneaWall.cs | 2 +- NPCs/AstralBiomeNPCs/Atlas.cs | 10 +- NPCs/AstralBiomeNPCs/BigSightseer.cs | 4 +- NPCs/AstralBiomeNPCs/Hadarian.cs | 6 +- NPCs/AstralBiomeNPCs/Hive.cs | 4 +- NPCs/AstralBiomeNPCs/Mantis.cs | 2 +- NPCs/AstralBiomeNPCs/Nova.cs | 14 +- NPCs/AstralBiomeNPCs/SmallSightseer.cs | 2 +- NPCs/AstralBiomeNPCs/StellarCulex.cs | 2 +- NPCs/AstrumDeus/AstrumDeusBody.cs | 16 +- NPCs/AstrumDeus/AstrumDeusBodySpectral.cs | 16 +- NPCs/AstrumDeus/AstrumDeusHead.cs | 22 +- NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs | 16 +- NPCs/AstrumDeus/AstrumDeusProbe.cs | 12 +- NPCs/AstrumDeus/AstrumDeusProbe2.cs | 12 +- NPCs/AstrumDeus/AstrumDeusProbe3.cs | 18 +- NPCs/AstrumDeus/AstrumDeusTail.cs | 10 +- NPCs/AstrumDeus/AstrumDeusTailSpectral.cs | 10 +- NPCs/BrimstoneWaifu/Brimling.cs | 10 +- NPCs/BrimstoneWaifu/BrimstoneElemental.cs | 32 +- NPCs/Bumblefuck/Bumblefuck.cs | 10 +- NPCs/Bumblefuck/Bumblefuck2.cs | 4 +- NPCs/Calamitas/Calamitas.cs | 20 +- NPCs/Calamitas/CalamitasRun.cs | 22 +- NPCs/Calamitas/CalamitasRun2.cs | 18 +- NPCs/Calamitas/CalamitasRun3.cs | 44 +- NPCs/Calamitas/LifeSeeker.cs | 4 +- NPCs/Calamitas/SoulSeeker.cs | 16 +- NPCs/CalamityAI.cs | 14 +- NPCs/CalamityBiomeNPCs/CultistAssassin.cs | 8 +- NPCs/CalamityBiomeNPCs/DespairStone.cs | 10 +- NPCs/CalamityBiomeNPCs/Scryllar.cs | 8 +- NPCs/CalamityBiomeNPCs/ScryllarRage.cs | 8 +- NPCs/CalamityBiomeNPCs/SoulSlurper.cs | 16 +- NPCs/CalamityGlobalAI.cs | 402 +++---- NPCs/CalamityGlobalNPC.cs | 1002 ++++++++--------- NPCs/CalamityGlobalNPCLoot.cs | 84 +- NPCs/CeaselessVoid/CeaselessVoid.cs | 18 +- NPCs/CeaselessVoid/DarkEnergy.cs | 4 +- NPCs/CeaselessVoid/DarkEnergy2.cs | 2 +- NPCs/CeaselessVoid/DarkEnergy3.cs | 2 +- NPCs/CosmicWraith/CosmicLantern.cs | 4 +- NPCs/CosmicWraith/CosmicWraith.cs | 56 +- NPCs/CosmicWraith/SignusBomb.cs | 8 +- NPCs/Crabulon/CrabShroom.cs | 4 +- NPCs/Crabulon/CrabulonIdle.cs | 24 +- NPCs/Cryogen/Cryocore.cs | 4 +- NPCs/Cryogen/Cryocore2.cs | 4 +- NPCs/Cryogen/Cryogen.cs | 78 +- NPCs/Cryogen/CryogenIce.cs | 10 +- NPCs/Cryogen/IceMass.cs | 4 +- NPCs/DesertScourge/DesertScourgeBody.cs | 12 +- NPCs/DesertScourge/DesertScourgeBodySmall.cs | 4 +- NPCs/DesertScourge/DesertScourgeHead.cs | 10 +- NPCs/DesertScourge/DesertScourgeHeadSmall.cs | 4 +- NPCs/DesertScourge/DesertScourgeTail.cs | 4 +- NPCs/DesertScourge/DesertScourgeTailSmall.cs | 4 +- NPCs/DesertScourge/DriedSeekerBody.cs | 4 +- NPCs/DesertScourge/DriedSeekerHead.cs | 4 +- NPCs/DesertScourge/DriedSeekerTail.cs | 4 +- NPCs/GreatSandShark/GreatSandShark.cs | 22 +- NPCs/HiveMind/DankCreeper.cs | 6 +- NPCs/HiveMind/DarkHeart.cs | 6 +- NPCs/HiveMind/HiveBlob.cs | 8 +- NPCs/HiveMind/HiveBlob2.cs | 8 +- NPCs/HiveMind/HiveCyst.cs | 6 +- NPCs/HiveMind/HiveMind.cs | 34 +- NPCs/HiveMind/HiveMindP2.cs | 38 +- NPCs/Leviathan/AquaticAberration.cs | 6 +- NPCs/Leviathan/Leviathan.cs | 20 +- NPCs/Leviathan/LeviathanStart.cs | 10 +- NPCs/Leviathan/Parasea.cs | 4 +- NPCs/Leviathan/Siren.cs | 18 +- NPCs/Leviathan/SirenClone.cs | 6 +- NPCs/Leviathan/SirenIce.cs | 4 +- NPCs/NormalNPCs/AeroSlime.cs | 4 +- NPCs/NormalNPCs/AngryDog.cs | 12 +- NPCs/NormalNPCs/ArmoredDiggerBody.cs | 6 +- NPCs/NormalNPCs/ArmoredDiggerHead.cs | 10 +- NPCs/NormalNPCs/ArmoredDiggerTail.cs | 4 +- NPCs/NormalNPCs/BlightedEye.cs | 6 +- NPCs/NormalNPCs/BloomSlime.cs | 4 +- NPCs/NormalNPCs/Bohldohr.cs | 4 +- NPCs/NormalNPCs/CalamityEye.cs | 8 +- NPCs/NormalNPCs/CharredSlime.cs | 4 +- NPCs/NormalNPCs/Cnidrion.cs | 10 +- NPCs/NormalNPCs/CosmicElemental.cs | 18 +- NPCs/NormalNPCs/CrawlerAmber.cs | 4 +- NPCs/NormalNPCs/CrawlerAmethyst.cs | 4 +- NPCs/NormalNPCs/CrawlerCrystal.cs | 6 +- NPCs/NormalNPCs/CrawlerDiamond.cs | 4 +- NPCs/NormalNPCs/CrawlerEmerald.cs | 4 +- NPCs/NormalNPCs/CrawlerRuby.cs | 4 +- NPCs/NormalNPCs/CrawlerSapphire.cs | 4 +- NPCs/NormalNPCs/CrawlerTopaz.cs | 4 +- NPCs/NormalNPCs/CrimulanBlightSlime.cs | 6 +- NPCs/NormalNPCs/CryoSlime.cs | 4 +- NPCs/NormalNPCs/Cryon.cs | 8 +- NPCs/NormalNPCs/EbonianBlightSlime.cs | 4 +- NPCs/NormalNPCs/Eidolist.cs | 14 +- NPCs/NormalNPCs/FearlessGoldfishWarrior.cs | 10 +- NPCs/NormalNPCs/HeatSpirit.cs | 6 +- NPCs/NormalNPCs/Horse.cs | 30 +- NPCs/NormalNPCs/IceClasper.cs | 12 +- NPCs/NormalNPCs/ImpiousImmolator.cs | 8 +- NPCs/NormalNPCs/IrradiatedSlime.cs | 6 +- NPCs/NormalNPCs/KingSlimeJewel.cs | 6 +- NPCs/NormalNPCs/OverloadedSoldier.cs | 4 +- NPCs/NormalNPCs/PerennialSlime.cs | 4 +- NPCs/NormalNPCs/PhantomDebris.cs | 4 +- NPCs/NormalNPCs/PhantomSpirit.cs | 6 +- NPCs/NormalNPCs/PhantomSpiritL.cs | 8 +- NPCs/NormalNPCs/PhantomSpiritM.cs | 6 +- NPCs/NormalNPCs/PhantomSpiritS.cs | 6 +- NPCs/NormalNPCs/Piggy.cs | 4 +- NPCs/NormalNPCs/Pitbull.cs | 4 +- NPCs/NormalNPCs/PlagueBee.cs | 4 +- NPCs/NormalNPCs/PlagueBeeLarge.cs | 4 +- NPCs/NormalNPCs/PlaguedDerpling.cs | 6 +- NPCs/NormalNPCs/PlaguedFlyingFox.cs | 4 +- NPCs/NormalNPCs/PlaguedJungleSlime.cs | 8 +- NPCs/NormalNPCs/PlaguedTortoise.cs | 4 +- NPCs/NormalNPCs/ProfanedEnergyBody.cs | 6 +- NPCs/NormalNPCs/ProfanedEnergyLantern.cs | 6 +- NPCs/NormalNPCs/SandTortoise.cs | 6 +- NPCs/NormalNPCs/ScornEater.cs | 6 +- NPCs/NormalNPCs/ShockstormShuttle.cs | 20 +- NPCs/NormalNPCs/StormlionCharger.cs | 6 +- NPCs/NormalNPCs/SunBat.cs | 6 +- NPCs/NormalNPCs/Sunskater.cs | 6 +- NPCs/NormalNPCs/ThiccWaifu.cs | 14 +- NPCs/NormalNPCs/WulfrumDrone.cs | 6 +- NPCs/NormalNPCs/WulfrumSlime.cs | 6 +- NPCs/Perforator/PerforatorBodyLarge.cs | 8 +- NPCs/Perforator/PerforatorBodyMedium.cs | 8 +- NPCs/Perforator/PerforatorBodySmall.cs | 8 +- NPCs/Perforator/PerforatorCyst.cs | 6 +- NPCs/Perforator/PerforatorHeadLarge.cs | 4 +- NPCs/Perforator/PerforatorHeadMedium.cs | 4 +- NPCs/Perforator/PerforatorHeadSmall.cs | 4 +- NPCs/Perforator/PerforatorHive.cs | 28 +- NPCs/Perforator/PerforatorTailLarge.cs | 4 +- NPCs/Perforator/PerforatorTailMedium.cs | 4 +- NPCs/Perforator/PerforatorTailSmall.cs | 4 +- NPCs/PlaguebringerGoliath/PlagueBeeG.cs | 4 +- NPCs/PlaguebringerGoliath/PlagueBeeLargeG.cs | 4 +- .../PlagueHomingMissile.cs | 28 +- NPCs/PlaguebringerGoliath/PlagueMine.cs | 8 +- .../PlaguebringerGoliath.cs | 30 +- NPCs/PlaguebringerShade/PlaguebringerShade.cs | 20 +- NPCs/Polterghast/PhantomFuckYou.cs | 4 +- NPCs/Polterghast/PolterPhantom.cs | 10 +- NPCs/Polterghast/Polterghast.cs | 50 +- NPCs/Polterghast/PolterghastHook.cs | 14 +- .../ProfanedGuardianBoss.cs | 12 +- .../ProfanedGuardianBoss2.cs | 10 +- .../ProfanedGuardianBoss3.cs | 10 +- NPCs/Providence/ProvSpawnDefense.cs | 6 +- NPCs/Providence/ProvSpawnHealer.cs | 8 +- NPCs/Providence/ProvSpawnOffense.cs | 8 +- NPCs/Providence/Providence.cs | 70 +- NPCs/Scavenger/FlamePillar.cs | 10 +- NPCs/Scavenger/RockPillar.cs | 8 +- NPCs/Scavenger/ScavengerBody.cs | 64 +- NPCs/Scavenger/ScavengerClawLeft.cs | 2 +- NPCs/Scavenger/ScavengerClawRight.cs | 2 +- NPCs/Scavenger/ScavengerHead.cs | 6 +- NPCs/Scavenger/ScavengerHead2.cs | 14 +- NPCs/Scavenger/ScavengerLegLeft.cs | 10 +- NPCs/Scavenger/ScavengerLegRight.cs | 10 +- NPCs/SlimeGod/SlimeGod.cs | 14 +- NPCs/SlimeGod/SlimeGodCore.cs | 14 +- NPCs/SlimeGod/SlimeGodRun.cs | 16 +- NPCs/SlimeGod/SlimeGodRunSplit.cs | 22 +- NPCs/SlimeGod/SlimeGodSplit.cs | 20 +- NPCs/SlimeGod/SlimeSpawnCorrupt.cs | 4 +- NPCs/SlimeGod/SlimeSpawnCorrupt2.cs | 4 +- NPCs/SlimeGod/SlimeSpawnCrimson.cs | 8 +- NPCs/SlimeGod/SlimeSpawnCrimson2.cs | 12 +- NPCs/StormWeaver/StasisProbe.cs | 18 +- NPCs/StormWeaver/StasisProbeNaked.cs | 18 +- NPCs/StormWeaver/StormWeaverBody.cs | 14 +- NPCs/StormWeaver/StormWeaverBodyNaked.cs | 14 +- NPCs/StormWeaver/StormWeaverHead.cs | 42 +- NPCs/StormWeaver/StormWeaverHeadNaked.cs | 42 +- NPCs/StormWeaver/StormWeaverTail.cs | 12 +- NPCs/StormWeaver/StormWeaverTailNaked.cs | 12 +- NPCs/SunkenSeaNPCs/BlindedAngler.cs | 6 +- NPCs/SunkenSeaNPCs/Clam.cs | 8 +- NPCs/SunkenSeaNPCs/EutrophicRay.cs | 6 +- NPCs/SunkenSeaNPCs/GhostBell.cs | 4 +- NPCs/SunkenSeaNPCs/GhostBellSmall.cs | 4 +- NPCs/SunkenSeaNPCs/GiantClam.cs | 20 +- NPCs/SunkenSeaNPCs/PrismTurtle.cs | 4 +- NPCs/SunkenSeaNPCs/SeaFloaty.cs | 4 +- NPCs/SunkenSeaNPCs/SeaMinnow.cs | 2 +- NPCs/SunkenSeaNPCs/SeaSerpent1.cs | 12 +- NPCs/SunkenSeaNPCs/SeaSerpent2.cs | 4 +- NPCs/SunkenSeaNPCs/SeaSerpent3.cs | 4 +- NPCs/SunkenSeaNPCs/SeaSerpent4.cs | 4 +- NPCs/SunkenSeaNPCs/SeaSerpent5.cs | 4 +- NPCs/SupremeCalamitas/SCalWormBody.cs | 8 +- NPCs/SupremeCalamitas/SCalWormBodyWeak.cs | 2 +- NPCs/SupremeCalamitas/SCalWormHead.cs | 12 +- NPCs/SupremeCalamitas/SCalWormTail.cs | 8 +- NPCs/SupremeCalamitas/SoulSeekerSupreme.cs | 12 +- NPCs/SupremeCalamitas/SupremeCalamitas.cs | 142 +-- NPCs/SupremeCalamitas/SupremeCataclysm.cs | 12 +- NPCs/SupremeCalamitas/SupremeCatastrophe.cs | 12 +- NPCs/TheDevourerofGods/DevourerofGodsBody.cs | 12 +- NPCs/TheDevourerofGods/DevourerofGodsBody2.cs | 10 +- NPCs/TheDevourerofGods/DevourerofGodsBodyS.cs | 8 +- NPCs/TheDevourerofGods/DevourerofGodsHead.cs | 34 +- NPCs/TheDevourerofGods/DevourerofGodsHead2.cs | 14 +- NPCs/TheDevourerofGods/DevourerofGodsHeadS.cs | 40 +- NPCs/TheDevourerofGods/DevourerofGodsTail.cs | 14 +- NPCs/TheDevourerofGods/DevourerofGodsTail2.cs | 10 +- NPCs/TheDevourerofGods/DevourerofGodsTailS.cs | 12 +- NPCs/TownNPCs/DILF.cs | 2 +- NPCs/TownNPCs/FAP.cs | 2 +- NPCs/TownNPCs/SEAHOE.cs | 2 +- NPCs/Yharon/DetonatingFlare.cs | 2 +- NPCs/Yharon/Yharon.cs | 140 +-- Projectiles/Amidias/HermitCrab.cs | 2 +- Projectiles/Amidias/WaywasherProj.cs | 2 +- Projectiles/Astral/AstralCannonProjectile.cs | 6 +- Projectiles/Astral/AstralachneaFang.cs | 2 +- Projectiles/Astral/HeavenfallenEnergy.cs | 4 +- Projectiles/Astral/HeavenfallenStardisk.cs | 8 +- Projectiles/Astral/RadiantExplosion.cs | 4 +- Projectiles/Boss/AbyssBallVolley.cs | 2 +- Projectiles/Boss/AbyssBallVolley2.cs | 2 +- Projectiles/Boss/AbyssMine.cs | 10 +- Projectiles/Boss/AbyssMine2.cs | 10 +- Projectiles/Boss/AstralFlame.cs | 8 +- Projectiles/Boss/BigFlare.cs | 8 +- Projectiles/Boss/BigFlare2.cs | 8 +- Projectiles/Boss/BloodClot.cs | 2 +- Projectiles/Boss/BloodGeyser.cs | 2 +- Projectiles/Boss/BrimstoneBall.cs | 2 +- Projectiles/Boss/BrimstoneBall2.cs | 2 +- Projectiles/Boss/BrimstoneFire.cs | 6 +- Projectiles/Boss/BrimstoneHellfireball.cs | 2 +- Projectiles/Boss/CosmicFlameBurst.cs | 10 +- Projectiles/Boss/DeusMine.cs | 8 +- Projectiles/Boss/DoGBeamPortal.cs | 8 +- Projectiles/Boss/DoGFire.cs | 6 +- Projectiles/Boss/EssenceDust.cs | 10 +- Projectiles/Boss/Flare.cs | 8 +- Projectiles/Boss/FlareBomb.cs | 16 +- Projectiles/Boss/FlareDust.cs | 16 +- Projectiles/Boss/FlareDust2.cs | 16 +- Projectiles/Boss/FlareExplosionHuge.cs | 2 +- Projectiles/Boss/FrostMist.cs | 10 +- Projectiles/Boss/GreatSandBlast.cs | 6 +- Projectiles/Boss/HealOrbProv.cs | 2 +- Projectiles/Boss/HellfireExplosion.cs | 2 +- Projectiles/Boss/HiveBombGoliath.cs | 30 +- Projectiles/Boss/HolyBlast.cs | 10 +- Projectiles/Boss/HolyBomb.cs | 6 +- Projectiles/Boss/HolyBurnOrb.cs | 8 +- Projectiles/Boss/HolyFire.cs | 8 +- Projectiles/Boss/HolyFire2.cs | 8 +- Projectiles/Boss/HolyFlare.cs | 8 +- Projectiles/Boss/HolyLight.cs | 8 +- Projectiles/Boss/IceBlast.cs | 4 +- Projectiles/Boss/IceRain.cs | 2 +- Projectiles/Boss/IchorShot.cs | 2 +- Projectiles/Boss/LeviathanBomb.cs | 8 +- Projectiles/Boss/MoltenBlast.cs | 16 +- Projectiles/Boss/MoltenBlob.cs | 8 +- Projectiles/Boss/MushBomb.cs | 8 +- Projectiles/Boss/MushBombFall.cs | 8 +- Projectiles/Boss/PhantomBlast.cs | 14 +- Projectiles/Boss/PhantomBlast2.cs | 14 +- Projectiles/Boss/PhantomGhostShot.cs | 2 +- Projectiles/Boss/PhantomHookShot.cs | 2 +- Projectiles/Boss/PhantomMine.cs | 8 +- Projectiles/Boss/PhoenixFire.cs | 2 +- Projectiles/Boss/PlagueExplosion.cs | 2 +- Projectiles/Boss/ProfanedSpear.cs | 6 +- Projectiles/Boss/ProvidenceCrystal.cs | 4 +- Projectiles/Boss/ProvidenceCrystalShard.cs | 14 +- Projectiles/Boss/ProvidenceHolyRay.cs | 8 +- Projectiles/Boss/RavagerFlame.cs | 2 +- Projectiles/Boss/RedLightningFeather.cs | 6 +- Projectiles/Boss/SandBlast.cs | 8 +- Projectiles/Boss/ScavengerLaser.cs | 10 +- Projectiles/Boss/ScavengerNuke.cs | 16 +- Projectiles/Boss/ShaderainHostile.cs | 2 +- Projectiles/Boss/Shadowflame.cs | 12 +- Projectiles/Boss/Shadowflamethrower.cs | 12 +- Projectiles/Boss/SignusScythe.cs | 10 +- Projectiles/Boss/SkyFlare.cs | 4 +- Projectiles/Boss/SkyFlareRevenge.cs | 4 +- Projectiles/Boss/VileClot.cs | 2 +- Projectiles/Boss/WaterSpear.cs | 4 +- Projectiles/Boss/YharonFireball.cs | 6 +- Projectiles/Boss/YharonFireball2.cs | 10 +- Projectiles/CalamityGlobalProjectile.cs | 96 +- Projectiles/Enemy/CrimsonSpike.cs | 2 +- Projectiles/Enemy/EarthRockBig.cs | 16 +- Projectiles/Enemy/EarthRockSmall.cs | 16 +- Projectiles/Enemy/FlameBurstHostile.cs | 10 +- Projectiles/Enemy/HorsWaterBlast.cs | 8 +- Projectiles/Enemy/InkBomb.cs | 8 +- Projectiles/Enemy/LavaChunk.cs | 4 +- Projectiles/Enemy/PufferExplosion.cs | 2 +- Projectiles/Enemy/StormMarkHostile.cs | 10 +- Projectiles/Enemy/SulphuricAcidCannon.cs | 2 +- Projectiles/Enemy/TornadoHostile.cs | 6 +- Projectiles/Enemy/ToxicMinnowCloud.cs | 6 +- Projectiles/Healing/AtaxiaHealOrb.cs | 2 +- Projectiles/Healing/BurntSienna.cs | 2 +- Projectiles/Healing/EarthHealOrb.cs | 2 +- Projectiles/Healing/EssenceFlame.cs | 8 +- Projectiles/Healing/FungalHeal.cs | 4 +- Projectiles/Healing/GodSlayerHealOrb.cs | 2 +- Projectiles/Healing/PhoenixHeal.cs | 2 +- Projectiles/Healing/RoyalHeal.cs | 4 +- Projectiles/Healing/Terracotta.cs | 6 +- Projectiles/Healing/TransfusionTrail.cs | 4 +- Projectiles/Healing/XerocHealOrb.cs | 2 +- Projectiles/Magic/AbyssBall.cs | 8 +- Projectiles/Magic/Ancient.cs | 8 +- Projectiles/Magic/Ancient2.cs | 8 +- Projectiles/Magic/ApothChloro.cs | 2 +- Projectiles/Magic/ApothJaws.cs | 2 +- Projectiles/Magic/ApothMark.cs | 2 +- Projectiles/Magic/Asteroid.cs | 24 +- Projectiles/Magic/AsteroidMolten.cs | 10 +- Projectiles/Magic/AstralCrystal.cs | 2 +- Projectiles/Magic/AstralStarMagic.cs | 24 +- Projectiles/Magic/AtlantisSpear.cs | 4 +- Projectiles/Magic/AtlantisSpear2.cs | 4 +- Projectiles/Magic/AuraRain.cs | 2 +- Projectiles/Magic/BigBeamofDeath.cs | 2 +- Projectiles/Magic/BigBeamofDeath2.cs | 2 +- Projectiles/Magic/BlackAnurian.cs | 2 +- Projectiles/Magic/BloodBeam.cs | 4 +- Projectiles/Magic/BloodBlast.cs | 6 +- Projectiles/Magic/BloodBolt.cs | 2 +- Projectiles/Magic/BloodRay.cs | 2 +- Projectiles/Magic/BlueBubble.cs | 2 +- Projectiles/Magic/BrimstoneBeam.cs | 2 +- Projectiles/Magic/BrimstoneBeam2.cs | 2 +- Projectiles/Magic/BrimstoneBeam3.cs | 2 +- Projectiles/Magic/BrimstoneBeam4.cs | 2 +- Projectiles/Magic/BrimstoneBeam5.cs | 2 +- Projectiles/Magic/BrimstoneFireball.cs | 2 +- .../Magic/BrimstoneHellfireballFriendly.cs | 2 +- .../Magic/BrimstoneHellfireballFriendly2.cs | 2 +- Projectiles/Magic/BrimstoneHomer.cs | 2 +- Projectiles/Magic/BrimstoneTentacle.cs | 2 +- Projectiles/Magic/ClimaxBeam.cs | 2 +- Projectiles/Magic/CosmicTentacle.cs | 2 +- Projectiles/Magic/CryoBlast.cs | 4 +- Projectiles/Magic/DemonicPitchfork.cs | 2 +- Projectiles/Magic/DustProjectile.cs | 8 +- Projectiles/Magic/EldritchTentacle.cs | 2 +- Projectiles/Magic/EvergladeSprayProjectile.cs | 6 +- Projectiles/Magic/FabBolt.cs | 2 +- Projectiles/Magic/FabRay.cs | 2 +- Projectiles/Magic/FatesReveal.cs | 14 +- Projectiles/Magic/FlameBeamTip.cs | 2 +- Projectiles/Magic/FlameBeamTip2.cs | 2 +- Projectiles/Magic/FlamePillar.cs | 6 +- Projectiles/Magic/FlamingPumpkin.cs | 2 +- Projectiles/Magic/FlareBoltProjectile.cs | 6 +- Projectiles/Magic/ForbiddenAxeBlade.cs | 2 +- Projectiles/Magic/ForbiddenSunProjectile.cs | 2 +- Projectiles/Magic/ForbiddenSunburst.cs | 2 +- .../Magic/FrigidflashBoltProjectile.cs | 12 +- Projectiles/Magic/FrostBoltProjectile.cs | 6 +- Projectiles/Magic/GammaLaser.cs | 2 +- Projectiles/Magic/GhastlyBlast.cs | 40 +- Projectiles/Magic/GhastlyExplosion.cs | 6 +- Projectiles/Magic/GhastlyExplosionShard.cs | 6 +- Projectiles/Magic/GhastlySubBlast.cs | 6 +- Projectiles/Magic/GraniteEnergy.cs | 2 +- Projectiles/Magic/GranitePulse.cs | 16 +- Projectiles/Magic/HeliumFlashBlast.cs | 2 +- .../Magic/HellfireExplosionFriendly.cs | 2 +- .../Magic/HellfireExplosionFriendly2.cs | 2 +- Projectiles/Magic/HolyFlame.cs | 8 +- Projectiles/Magic/HolyLaser.cs | 2 +- Projectiles/Magic/IceCluster.cs | 6 +- Projectiles/Magic/IceSpike.cs | 2 +- Projectiles/Magic/InfernadoFriendly.cs | 2 +- Projectiles/Magic/InfernadoMarkFriendly.cs | 8 +- Projectiles/Magic/InfernalBlade.cs | 8 +- Projectiles/Magic/InfernalBlade2.cs | 8 +- Projectiles/Magic/IonBlast.cs | 2 +- Projectiles/Magic/LiquidBlade.cs | 4 +- Projectiles/Magic/LiquidBlade2.cs | 4 +- Projectiles/Magic/MagicNebulaShot.cs | 2 +- Projectiles/Magic/MagnaBlast.cs | 2 +- Projectiles/Magic/MagneticBeam.cs | 2 +- Projectiles/Magic/MagnusBeam.cs | 46 +- Projectiles/Magic/NightBolt.cs | 2 +- Projectiles/Magic/NightRay.cs | 2 +- Projectiles/Magic/ParticleBeamofDoom.cs | 2 +- Projectiles/Magic/PhantasmalFury.cs | 4 +- Projectiles/Magic/Phantom.cs | 2 +- Projectiles/Magic/PlagueFang.cs | 4 +- Projectiles/Magic/PlasmaBolt.cs | 2 +- Projectiles/Magic/PlasmaRay.cs | 2 +- Projectiles/Magic/PlasmaRay2.cs | 2 +- Projectiles/Magic/PlasmaShot.cs | 2 +- Projectiles/Magic/Purge.cs | 6 +- Projectiles/Magic/PurgeLaser.cs | 2 +- Projectiles/Magic/RougeSlashLarge.cs | 6 +- Projectiles/Magic/RougeSlashMedium.cs | 6 +- Projectiles/Magic/RougeSlashSmall.cs | 6 +- Projectiles/Magic/SHPExplosion.cs | 2 +- Projectiles/Magic/SHPL.cs | 2 +- Projectiles/Magic/SanguineFlare.cs | 8 +- Projectiles/Magic/ShadecrystalProjectile.cs | 4 +- Projectiles/Magic/Shaderain.cs | 2 +- Projectiles/Magic/Shadowbolt.cs | 2 +- Projectiles/Magic/ShiftingSands.cs | 6 +- Projectiles/Magic/Snowflake.cs | 2 +- Projectiles/Magic/SolarBeam2.cs | 2 +- Projectiles/Magic/SoulPiercer.cs | 2 +- Projectiles/Magic/SoulPiercerBolt.cs | 2 +- Projectiles/Magic/SpiritFlameCurse.cs | 8 +- Projectiles/Magic/Starblast.cs | 8 +- Projectiles/Magic/StickyFeather.cs | 10 +- .../Magic/SupremeDustFlakProjectile.cs | 8 +- Projectiles/Magic/SupremeDustProjectile.cs | 8 +- Projectiles/Magic/T1000.cs | 4 +- Projectiles/Magic/TearsofHeavenProjectile.cs | 6 +- Projectiles/Magic/TerraBolt.cs | 2 +- Projectiles/Magic/TerraBolt2.cs | 2 +- Projectiles/Magic/TerraRay.cs | 2 +- Projectiles/Magic/ThunderstormShot.cs | 12 +- Projectiles/Magic/ThunderstormShotSplit.cs | 12 +- Projectiles/Magic/TradewindsProjectile.cs | 2 +- Projectiles/Magic/UberBubble.cs | 2 +- Projectiles/Magic/Vehemence.cs | 4 +- Projectiles/Magic/VenusianBolt.cs | 2 +- Projectiles/Magic/VenusianExplosion.cs | 2 +- Projectiles/Magic/VenusianFlame.cs | 6 +- Projectiles/Magic/Viscera.cs | 2 +- Projectiles/Magic/VividBolt.cs | 2 +- Projectiles/Magic/VividClarity.cs | 2 +- Projectiles/Magic/Vortex.cs | 6 +- Projectiles/Magic/WaterStream.cs | 2 +- Projectiles/Magic/WaterStream2.cs | 6 +- Projectiles/Magic/WhiteFlame.cs | 2 +- Projectiles/Magic/WhiteFlame2.cs | 2 +- Projectiles/Magic/WintersFury.cs | 2 +- Projectiles/Magic/WulfrumBolt.cs | 6 +- Projectiles/Magic/YharimsCrystal.cs | 2 +- Projectiles/Magic/YharimsCrystalBeam.cs | 14 +- Projectiles/Melee/AccretionDisk2Melee.cs | 2 +- Projectiles/Melee/AccretionDiskMelee.cs | 4 +- Projectiles/Melee/AegisFlame.cs | 2 +- .../Melee/BalefulHarvesterProjectile.cs | 12 +- Projectiles/Melee/BallOFugu.cs | 2 +- Projectiles/Melee/BansheeHookBoom.cs | 14 +- Projectiles/Melee/BiomeOrb.cs | 2 +- Projectiles/Melee/Blood.cs | 2 +- Projectiles/Melee/Blood2.cs | 2 +- Projectiles/Melee/BloodBall.cs | 6 +- Projectiles/Melee/BloodScythe.cs | 2 +- Projectiles/Melee/BlueAura.cs | 2 +- Projectiles/Melee/Brimblast.cs | 6 +- .../Melee/BrimlanceHellfireExplosion.cs | 2 +- Projectiles/Melee/BrimlanceStandingFire.cs | 6 +- Projectiles/Melee/Brimlash.cs | 2 +- Projectiles/Melee/Brimlash2.cs | 2 +- Projectiles/Melee/BrimstoneBoom.cs | 2 +- Projectiles/Melee/BrimstoneLaserFriendly.cs | 2 +- Projectiles/Melee/BrinySpout.cs | 2 +- Projectiles/Melee/BrinyTyphoonBubble.cs | 4 +- Projectiles/Melee/BurningMeteor.cs | 22 +- Projectiles/Melee/CalamityAura.cs | 14 +- Projectiles/Melee/CalamityAuraType2.cs | 14 +- Projectiles/Melee/CalamityAuraType3.cs | 14 +- Projectiles/Melee/ChaosFlameLarge.cs | 2 +- Projectiles/Melee/ChaosFlameMedium.cs | 2 +- Projectiles/Melee/ChaosFlameSmall.cs | 2 +- Projectiles/Melee/CosmicBolt.cs | 2 +- Projectiles/Melee/CosmicDischarge.cs | 6 +- Projectiles/Melee/CosmicIceBurst.cs | 4 +- Projectiles/Melee/CosmicOrb.cs | 2 +- Projectiles/Melee/CosmicSpiritBomb1.cs | 2 +- Projectiles/Melee/CosmicSpiritBomb2.cs | 2 +- Projectiles/Melee/CosmicSpiritBomb3.cs | 2 +- Projectiles/Melee/CrystalDust.cs | 7 +- Projectiles/Melee/DNA.cs | 4 +- Projectiles/Melee/DNA2.cs | 4 +- Projectiles/Melee/DarkBall.cs | 6 +- Projectiles/Melee/DemonBlast.cs | 8 +- Projectiles/Melee/DemonBlastType2.cs | 8 +- Projectiles/Melee/DemonBlastType3.cs | 8 +- Projectiles/Melee/DepthOrb.cs | 4 +- Projectiles/Melee/DepthOrb2.cs | 4 +- Projectiles/Melee/DragonRage.cs | 16 +- Projectiles/Melee/Earth.cs | 16 +- Projectiles/Melee/Earth2.cs | 16 +- Projectiles/Melee/Earth3.cs | 32 +- Projectiles/Melee/Earth4.cs | 16 +- .../Melee/EradicatorMeleeProjectile.cs | 2 +- Projectiles/Melee/EssenceBeam.cs | 2 +- Projectiles/Melee/EssenceBurst.cs | 2 +- Projectiles/Melee/EssenceFlame2.cs | 8 +- Projectiles/Melee/EssenceScythe.cs | 2 +- Projectiles/Melee/Excelsus.cs | 6 +- Projectiles/Melee/ExcelsusBlue.cs | 4 +- Projectiles/Melee/ExcelsusPink.cs | 4 +- Projectiles/Melee/Exobeam.cs | 4 +- Projectiles/Melee/Feather.cs | 2 +- .../Melee/FlameScytheProjectileMelee.cs | 2 +- Projectiles/Melee/Flarefrost.cs | 6 +- Projectiles/Melee/FossilSpike.cs | 2 +- Projectiles/Melee/GalacticaComet.cs | 28 +- Projectiles/Melee/Galaxia.cs | 12 +- Projectiles/Melee/Galaxia2.cs | 12 +- Projectiles/Melee/GalaxyBlast.cs | 8 +- Projectiles/Melee/GalaxyBlastType2.cs | 8 +- Projectiles/Melee/GalaxyBlastType3.cs | 8 +- Projectiles/Melee/GelWave.cs | 2 +- Projectiles/Melee/GhastlySoulLarge.cs | 6 +- Projectiles/Melee/GhastlySoulMedium.cs | 6 +- Projectiles/Melee/GhastlySoulSmall.cs | 6 +- Projectiles/Melee/GreenBall.cs | 2 +- Projectiles/Melee/GreenWater.cs | 4 +- Projectiles/Melee/HellionSpike.cs | 4 +- Projectiles/Melee/HolyColliderHolyFire.cs | 8 +- Projectiles/Melee/IceBombFriendly.cs | 2 +- Projectiles/Melee/Iceberg.cs | 2 +- Projectiles/Melee/Icebreaker.cs | 2 +- Projectiles/Melee/Judgement.cs | 2 +- Projectiles/Melee/Leech.cs | 2 +- .../Melee/MangroveChakramProjectileMelee.cs | 2 +- Projectiles/Melee/MarianaProjectile.cs | 6 +- Projectiles/Melee/Mourningstar.cs | 4 +- Projectiles/Melee/Murasama.cs | 4 +- Projectiles/Melee/Nebudust.cs | 2 +- Projectiles/Melee/Nebulash.cs | 4 +- Projectiles/Melee/NeptuneOrb.cs | 4 +- Projectiles/Melee/NightStabber.cs | 2 +- Projectiles/Melee/Oathblade.cs | 2 +- Projectiles/Melee/OceanBeam.cs | 4 +- Projectiles/Melee/OmegaBiomeOrb.cs | 2 +- Projectiles/Melee/PlagueBeeDust.cs | 4 +- Projectiles/Melee/PlagueDust.cs | 4 +- Projectiles/Melee/PlagueSeeker.cs | 2 +- Projectiles/Melee/PlasmaBall.cs | 6 +- Projectiles/Melee/ProfanedSword.cs | 2 +- Projectiles/Melee/RedBall.cs | 2 +- Projectiles/Melee/RoyalKnifeMelee.cs | 4 +- Projectiles/Melee/SandFire.cs | 2 +- Projectiles/Melee/ScourgeoftheCosmos.cs | 16 +- Projectiles/Melee/ScourgeoftheCosmosMini.cs | 4 +- Projectiles/Melee/ShortBeam.cs | 2 +- Projectiles/Melee/ShortNightBeam.cs | 2 +- Projectiles/Melee/ShortTerraBeam.cs | 6 +- Projectiles/Melee/SolarFlare.cs | 8 +- Projectiles/Melee/SolsticeBeam.cs | 6 +- Projectiles/Melee/SoulScythe.cs | 8 +- Projectiles/Melee/Spark.cs | 6 +- Projectiles/Melee/SpatialSpear.cs | 6 +- Projectiles/Melee/SpatialSpear2.cs | 6 +- Projectiles/Melee/SpatialSpear3.cs | 6 +- Projectiles/Melee/SpatialSpear4.cs | 6 +- Projectiles/Melee/Spears/AstralPike.cs | 4 +- Projectiles/Melee/Spears/BansheeHook.cs | 14 +- Projectiles/Melee/Spears/Brimlance.cs | 4 +- Projectiles/Melee/Spears/DiseasedPike.cs | 2 +- Projectiles/Melee/Spears/EarthenPike.cs | 2 +- .../Spears/ExsanguinationLanceProjectile.cs | 4 +- Projectiles/Melee/Spears/GildedProboscis.cs | 4 +- .../Melee/Spears/GoldplumeSpearProjectile.cs | 2 +- .../Melee/Spears/HeartRapierProjectile.cs | 2 +- .../Spears/HellionFlowerSpearProjectile.cs | 4 +- Projectiles/Melee/Spears/SausageMaker.cs | 2 +- .../Melee/Spears/SpatialLanceProjectile.cs | 2 +- .../Melee/Spears/StarnightLanceProjectile.cs | 2 +- Projectiles/Melee/Spears/StreamGouge.cs | 4 +- .../Melee/Spears/TerraLanceProjectile.cs | 2 +- Projectiles/Melee/StarnightBeam.cs | 4 +- Projectiles/Melee/StormMark.cs | 10 +- .../Melee/TemporalFloeSwordProjectile.cs | 8 +- Projectiles/Melee/TerraBall.cs | 2 +- Projectiles/Melee/TerraEdgeBeam.cs | 4 +- Projectiles/Melee/TerraSpear.cs | 6 +- Projectiles/Melee/TerracottaExplosion.cs | 2 +- Projectiles/Melee/TerratomereProjectile.cs | 4 +- Projectiles/Melee/TerrorBeam.cs | 6 +- Projectiles/Melee/TerrorBoom.cs | 6 +- Projectiles/Melee/TinyFlare.cs | 2 +- Projectiles/Melee/Tornado.cs | 4 +- Projectiles/Melee/TriactisOPHammerMelee.cs | 8 +- Projectiles/Melee/TrueBiomeOrb.cs | 2 +- .../Melee/TrueCausticEdgeProjectile.cs | 4 +- Projectiles/Melee/Tumbleweed.cs | 8 +- Projectiles/Melee/TumbleweedRolling.cs | 8 +- Projectiles/Melee/TyphonsGreedStaff.cs | 12 +- Projectiles/Melee/UltimusCleaverDust.cs | 2 +- Projectiles/Melee/Whirlpool.cs | 8 +- Projectiles/Melee/WhiteOrb.cs | 2 +- Projectiles/Melee/Whiterain.cs | 2 +- Projectiles/Melee/Yoyos/AzathothProjectile.cs | 2 +- Projectiles/Melee/Yoyos/ChaotrixProjectile.cs | 2 +- .../Melee/Yoyos/LaceratorProjectile.cs | 2 +- Projectiles/Melee/Yoyos/QuagmireProjectile.cs | 8 +- .../Melee/Yoyos/ShimmersparkProjectile.cs | 4 +- Projectiles/Melee/Yoyos/SolarFlareYoyo.cs | 2 +- Projectiles/Melee/Yoyos/VerdantProjectile.cs | 4 +- Projectiles/Melee/Yoyos/YinYo.cs | 2 +- Projectiles/Patreon/DarkSpark.cs | 2 +- Projectiles/Patreon/DarkSparkBeam.cs | 14 +- Projectiles/Patreon/DeepSeaDumbbellWeight.cs | 4 +- Projectiles/Patreon/DevilsSunrise.cs | 2 +- Projectiles/Patreon/DevilsSunriseCyclone.cs | 2 +- Projectiles/Patreon/DraconicSpark.cs | 2 +- Projectiles/Patreon/DragonPowFlail.cs | 2 +- Projectiles/Patreon/HandheldTankShell.cs | 20 +- Projectiles/Patreon/IlluminatedBullet.cs | 2 +- Projectiles/Patreon/KarasawaShot.cs | 26 +- Projectiles/Patreon/KelvinCatalyst.cs | 2 +- Projectiles/Patreon/KelvinCatalystStar.cs | 8 +- Projectiles/Patreon/LightBall.cs | 8 +- Projectiles/Patreon/LightBead.cs | 4 +- .../Patreon/MadAlchemistsCocktailAlt.cs | 10 +- .../Patreon/MadAlchemistsCocktailRed.cs | 12 +- .../Patreon/MadAlchemistsCocktailShrapnel.cs | 6 +- Projectiles/Patreon/MourningSkull.cs | 10 +- Projectiles/Patreon/NadirSpear.cs | 2 +- Projectiles/Patreon/OracleYoyo.cs | 6 +- Projectiles/Patreon/Orbacle.cs | 2 +- Projectiles/Patreon/PerforaMini.cs | 6 +- Projectiles/Patreon/PinkButterfly.cs | 4 +- Projectiles/Patreon/PlagueBee.cs | 2 +- Projectiles/Patreon/Plaguenade.cs | 16 +- Projectiles/Patreon/PurpleButterfly.cs | 4 +- Projectiles/Patreon/Rox1.cs | 6 +- Projectiles/Patreon/RoxSlam.cs | 2 +- Projectiles/Patreon/SakuraBullet.cs | 10 +- Projectiles/Patreon/ThePackMinissile.cs | 2 +- Projectiles/Patreon/ThePackMissile.cs | 8 +- Projectiles/Patreon/TimeBolt.cs | 14 +- Projectiles/Patreon/VoidEssence.cs | 2 +- Projectiles/Patreon/VoidTentacle.cs | 4 +- Projectiles/Patreon/YateveoBloom.cs | 2 +- Projectiles/Patreon/YateveoBloomSpear.cs | 2 +- Projectiles/Permafrost/ArcticBearPaw.cs | 2 +- Projectiles/Permafrost/DarkIce.cs | 4 +- Projectiles/Permafrost/DarkIceZero.cs | 4 +- Projectiles/Permafrost/IcicleArrow.cs | 4 +- Projectiles/Permafrost/IcyBullet.cs | 4 +- Projectiles/Pets/Brimling.cs | 2 +- Projectiles/Pets/ChibiiDoggo.cs | 8 +- Projectiles/Pets/ChibiiDoggoFly.cs | 2 +- Projectiles/Pets/DannyDevito.cs | 2 +- Projectiles/Pets/Kendra.cs | 2 +- Projectiles/Ranged/AccelerationBullet.cs | 2 +- Projectiles/Ranged/AcidBullet.cs | 2 +- Projectiles/Ranged/AquaBlast.cs | 4 +- Projectiles/Ranged/AquaBlastToxic.cs | 4 +- Projectiles/Ranged/Archerfish.cs | 22 +- Projectiles/Ranged/ArcticArrow.cs | 6 +- Projectiles/Ranged/AstralRound.cs | 2 +- Projectiles/Ranged/AstrealArrow.cs | 4 +- Projectiles/Ranged/AstrealFlame.cs | 8 +- Projectiles/Ranged/BeeRPG.cs | 32 +- Projectiles/Ranged/BigNuke.cs | 20 +- Projectiles/Ranged/BloodClotFriendly.cs | 2 +- Projectiles/Ranged/BloodfireArrow.cs | 12 +- Projectiles/Ranged/BloodfireBullet.cs | 2 +- Projectiles/Ranged/BloodflareSoul.cs | 6 +- Projectiles/Ranged/Bolt.cs | 6 +- Projectiles/Ranged/BoltArrow.cs | 8 +- Projectiles/Ranged/BrimstoneBallFriendly.cs | 2 +- Projectiles/Ranged/BrimstoneBolt.cs | 2 +- Projectiles/Ranged/BrimstoneFireFriendly.cs | 6 +- Projectiles/Ranged/ChargedBlast3.cs | 24 +- Projectiles/Ranged/Chicken.cs | 22 +- Projectiles/Ranged/ChickenExplosion.cs | 2 +- Projectiles/Ranged/Contagion.cs | 6 +- Projectiles/Ranged/ContagionBall.cs | 4 +- Projectiles/Ranged/CorossiveFlames.cs | 8 +- Projectiles/Ranged/CosmicFire.cs | 6 +- Projectiles/Ranged/DaemonsFlameArrow.cs | 14 +- Projectiles/Ranged/DragonBurst.cs | 6 +- Projectiles/Ranged/Drataliornus.cs | 6 +- Projectiles/Ranged/DrataliornusFlame.cs | 12 +- Projectiles/Ranged/ElysianArrow.cs | 16 +- Projectiles/Ranged/EnhancedNanoRound.cs | 4 +- Projectiles/Ranged/EssenceFire.cs | 6 +- Projectiles/Ranged/ExoFire.cs | 14 +- Projectiles/Ranged/ExoMark.cs | 10 +- Projectiles/Ranged/ExoTornado.cs | 4 +- Projectiles/Ranged/ExplodingStake.cs | 4 +- Projectiles/Ranged/ExplosiveShellBullet.cs | 6 +- Projectiles/Ranged/FeatherLarge.cs | 2 +- Projectiles/Ranged/FishronRPG.cs | 16 +- Projectiles/Ranged/FlamingStake.cs | 4 +- Projectiles/Ranged/FlareBat.cs | 2 +- Projectiles/Ranged/Flash.cs | 2 +- Projectiles/Ranged/FlashBullet.cs | 2 +- Projectiles/Ranged/FrostsparkBullet.cs | 4 +- Projectiles/Ranged/FungiOrb.cs | 2 +- Projectiles/Ranged/FungiOrb2.cs | 2 +- Projectiles/Ranged/GoliathRocket.cs | 32 +- Projectiles/Ranged/HiveBomb.cs | 32 +- Projectiles/Ranged/HiveMissile.cs | 32 +- Projectiles/Ranged/HolyFireBullet.cs | 6 +- Projectiles/Ranged/HyperiusBullet.cs | 4 +- Projectiles/Ranged/LunarBolt.cs | 2 +- Projectiles/Ranged/LunarBolt2.cs | 2 +- Projectiles/Ranged/MeowFire.cs | 12 +- Projectiles/Ranged/MeowFire2.cs | 12 +- Projectiles/Ranged/MiniRocket.cs | 20 +- Projectiles/Ranged/MistArrow.cs | 2 +- Projectiles/Ranged/MortarRound.cs | 29 +- Projectiles/Ranged/Nanomachine.cs | 2 +- Projectiles/Ranged/NapalmArrow.cs | 18 +- Projectiles/Ranged/NebulaShot.cs | 2 +- Projectiles/Ranged/Needler.cs | 4 +- Projectiles/Ranged/Norfleet.cs | 4 +- Projectiles/Ranged/NorfleetComet.cs | 24 +- Projectiles/Ranged/NorfleetExplosion.cs | 2 +- Projectiles/Ranged/Nuke.cs | 20 +- Projectiles/Ranged/NullShot.cs | 2 +- Projectiles/Ranged/NullShot2.cs | 2 +- Projectiles/Ranged/OMGWTH.cs | 2 +- Projectiles/Ranged/OnyxSharkBomb.cs | 4 +- Projectiles/Ranged/OrangeExoArrow.cs | 10 +- Projectiles/Ranged/PlagueArrow.cs | 2 +- Projectiles/Ranged/PlagueExplosionFriendly.cs | 2 +- Projectiles/Ranged/PlasmaBlast.cs | 20 +- Projectiles/Ranged/PlasmaExplosion.cs | 2 +- Projectiles/Ranged/ProBolt.cs | 2 +- Projectiles/Ranged/RealmRavagerBullet.cs | 6 +- Projectiles/Ranged/RubberMortarRound.cs | 53 +- Projectiles/Ranged/SandWater.cs | 4 +- Projectiles/Ranged/SandstormBullet.cs | 6 +- Projectiles/Ranged/SandyWaifuShark.cs | 2 +- Projectiles/Ranged/SeaDragonRocket.cs | 16 +- Projectiles/Ranged/ShadeFire.cs | 6 +- Projectiles/Ranged/Shockblast.cs | 2 +- Projectiles/Ranged/ShockblastRound.cs | 2 +- Projectiles/Ranged/Sickness.cs | 2 +- Projectiles/Ranged/SicknessRound.cs | 2 +- Projectiles/Ranged/SicknessRound2.cs | 2 +- Projectiles/Ranged/SlagRound.cs | 2 +- Projectiles/Ranged/SlimeBolt.cs | 2 +- Projectiles/Ranged/Spyker.cs | 4 +- Projectiles/Ranged/StarfleetMK2.cs | 4 +- Projectiles/Ranged/SulphuricAcidCannon2.cs | 2 +- Projectiles/Ranged/SuperballBullet.cs | 2 +- Projectiles/Ranged/TelluricGlare.cs | 10 +- Projectiles/Ranged/TerraArrow.cs | 4 +- Projectiles/Ranged/TerraArrow2.cs | 4 +- Projectiles/Ranged/TerraBallBow.cs | 10 +- Projectiles/Ranged/TerraBullet.cs | 2 +- Projectiles/Ranged/TerraBulletSplit.cs | 2 +- Projectiles/Ranged/TerraFireGreen.cs | 6 +- Projectiles/Ranged/TerraFireGreen2.cs | 4 +- Projectiles/Ranged/TitRail.cs | 2 +- Projectiles/Ranged/TyphoonBubble.cs | 8 +- Projectiles/Ranged/VeriumBullet.cs | 2 +- Projectiles/Ranged/Voidragon.cs | 20 +- Projectiles/Rogue/AccretionDisk.cs | 4 +- Projectiles/Rogue/AccretionDisk2.cs | 2 +- .../Rogue/AdamantiteThrowingAxeProjectile.cs | 2 +- Projectiles/Rogue/BallisticPoisonBomb.cs | 18 +- Projectiles/Rogue/BallisticPoisonBombSpike.cs | 4 +- Projectiles/Rogue/BrackishWater.cs | 2 +- Projectiles/Rogue/BrackishWaterBlast.cs | 2 +- Projectiles/Rogue/CobaltKunaiProjectile.cs | 2 +- Projectiles/Rogue/CraniumSmasher.cs | 4 +- Projectiles/Rogue/CraniumSmasherExplosive.cs | 8 +- Projectiles/Rogue/CrystalPiercerProjectile.cs | 4 +- Projectiles/Rogue/EmpyreanKnives.cs | 4 +- Projectiles/Rogue/EradicatorProjectile.cs | 2 +- Projectiles/Rogue/ExecutionersBlade.cs | 10 +- Projectiles/Rogue/FeatherKnifeProjectile.cs | 2 +- Projectiles/Rogue/FlameScytheProjectile.cs | 2 +- Projectiles/Rogue/GelDartProjectile.cs | 2 +- Projectiles/Rogue/IceStarProjectile.cs | 2 +- Projectiles/Rogue/IchorSpear.cs | 2 +- Projectiles/Rogue/IchorSpear2.cs | 2 +- Projectiles/Rogue/Malachite.cs | 2 +- Projectiles/Rogue/MalachiteBolt.cs | 4 +- .../Rogue/MangroveChakramProjectile.cs | 2 +- Projectiles/Rogue/MeteorFist.cs | 28 +- Projectiles/Rogue/MoltenBlobThrown.cs | 8 +- Projectiles/Rogue/Mycoroot.cs | 2 +- Projectiles/Rogue/MythrilKnifeProjectile.cs | 2 +- .../OrichalcumSpikedGemstoneProjectile.cs | 2 +- .../Rogue/PalladiumJavelinProjectile.cs | 2 +- Projectiles/Rogue/ProfanedTrident.cs | 8 +- Projectiles/Rogue/RotBallProjectile.cs | 2 +- Projectiles/Rogue/RoyalKnife.cs | 4 +- Projectiles/Rogue/ScarletBlast.cs | 2 +- Projectiles/Rogue/ShatteredExplosion.cs | 2 +- Projectiles/Rogue/ShatteredSun.cs | 2 +- Projectiles/Rogue/ShatteredSun2.cs | 2 +- Projectiles/Rogue/ShatteredSun3.cs | 2 +- Projectiles/Rogue/SpearofPaleolith.cs | 2 +- .../Rogue/TarragonThrowingDartProjectile.cs | 4 +- .../Rogue/TitaniumShurikenProjectile.cs | 2 +- Projectiles/Rogue/ToothBallProjectile.cs | 2 +- Projectiles/Rogue/TriactisOPHammer.cs | 8 +- Projectiles/Rogue/UrchinStinger.cs | 2 +- Projectiles/Rogue/Valediction.cs | 8 +- Projectiles/Rogue/Valediction2.cs | 8 +- Projectiles/Rogue/WulfrumKnife.cs | 2 +- Projectiles/Rogue/XerocPitchforkProjectile.cs | 4 +- Projectiles/Shrines/LuxorsGiftMagic.cs | 6 +- Projectiles/Shrines/LuxorsGiftMelee.cs | 12 +- Projectiles/Shrines/LuxorsGiftRanged.cs | 8 +- Projectiles/Shrines/LuxorsGiftRogue.cs | 6 +- Projectiles/Shrines/LuxorsGiftSummon.cs | 4 +- Projectiles/Shrines/UnstableSpark.cs | 6 +- Projectiles/Summon/AngryChicken.cs | 2 +- Projectiles/Summon/AquaticStar.cs | 4 +- Projectiles/Summon/BigBustyRose.cs | 2 +- Projectiles/Summon/BloodClotMinion.cs | 6 +- Projectiles/Summon/BrimstoneFireSummon.cs | 6 +- Projectiles/Summon/BrittleStar.cs | 4 +- Projectiles/Summon/Calamari.cs | 8 +- Projectiles/Summon/CalamariInk.cs | 8 +- Projectiles/Summon/Calamitamini.cs | 4 +- Projectiles/Summon/Cataclymini.cs | 4 +- Projectiles/Summon/Catastromini.cs | 4 +- Projectiles/Summon/ChaosFlame.cs | 2 +- Projectiles/Summon/ChaosSpirit.cs | 2 +- Projectiles/Summon/CloudyWaifu.cs | 2 +- Projectiles/Summon/Corroslime.cs | 4 +- Projectiles/Summon/CosmicBlast.cs | 4 +- Projectiles/Summon/CosmicBlastBig.cs | 12 +- Projectiles/Summon/Cosmilamp.cs | 6 +- Projectiles/Summon/Crimslime.cs | 4 +- Projectiles/Summon/DaedalusCrystal.cs | 2 +- Projectiles/Summon/DaedalusCrystalShot.cs | 10 +- Projectiles/Summon/DankCreeper.cs | 4 +- Projectiles/Summon/Dreadmine.cs | 16 +- Projectiles/Summon/DreadmineTurret.cs | 4 +- Projectiles/Summon/DrewsSandyWaifu.cs | 4 +- Projectiles/Summon/FlameBlast.cs | 10 +- Projectiles/Summon/FlameBurst.cs | 10 +- Projectiles/Summon/FrostMistFriendly.cs | 4 +- Projectiles/Summon/FungalClump.cs | 6 +- Projectiles/Summon/GhostFire.cs | 2 +- Projectiles/Summon/GhostlyMine.cs | 16 +- Projectiles/Summon/GigaFlareFriendly.cs | 16 +- Projectiles/Summon/Herring.cs | 4 +- Projectiles/Summon/IceClasper.cs | 4 +- Projectiles/Summon/MechwormBody.cs | 2 +- Projectiles/Summon/MechwormBody2.cs | 2 +- Projectiles/Summon/MechwormHead.cs | 2 +- Projectiles/Summon/MechwormTail.cs | 2 +- Projectiles/Summon/MiniSandShark.cs | 4 +- Projectiles/Summon/PhantomGuy.cs | 4 +- Projectiles/Summon/PhoenixFireFriendly.cs | 2 +- Projectiles/Summon/ProfanedEnergy.cs | 8 +- Projectiles/Summon/ReaverOrb.cs | 2 +- Projectiles/Summon/RedDevil.cs | 2 +- Projectiles/Summon/SandMark.cs | 10 +- Projectiles/Summon/SandTornado.cs | 4 +- Projectiles/Summon/Sandnado.cs | 8 +- Projectiles/Summon/SandyWaifu.cs | 2 +- Projectiles/Summon/SilvaCrystal.cs | 4 +- Projectiles/Summon/SilvaCrystalExplosion.cs | 14 +- Projectiles/Summon/SirenLure.cs | 6 +- Projectiles/Summon/SlimeGod.cs | 4 +- Projectiles/Summon/SlimeGodAlt.cs | 4 +- Projectiles/Summon/SolarBeam.cs | 2 +- Projectiles/Summon/SolarGod.cs | 2 +- Projectiles/Summon/SolarPixie.cs | 2 +- Projectiles/Summon/StormMarkSummon.cs | 10 +- Projectiles/Summon/Urchin.cs | 2 +- Projectiles/Summon/Valkyrie.cs | 2 +- Projectiles/Summon/WaterSpearFriendly.cs | 4 +- Projectiles/SunkenSea/AquamarineBolt.cs | 6 +- Projectiles/SunkenSea/ClamorRifleProj.cs | 2 +- Projectiles/SunkenSea/ClamorRifleProjSplit.cs | 2 +- Projectiles/SunkenSea/CoralBubble.cs | 2 +- Projectiles/SunkenSea/CoralBubbleSmall.cs | 2 +- .../SunkenSea/EutrophicScimitarProj.cs | 2 +- Projectiles/SunkenSea/EutrophicSpark.cs | 6 +- Projectiles/SunkenSea/PearlBurst.cs | 8 +- Projectiles/SunkenSea/PearlRain.cs | 2 +- Projectiles/SunkenSea/PendantProjectile1.cs | 2 +- Projectiles/SunkenSea/PendantProjectile2.cs | 2 +- Projectiles/SunkenSea/PendantProjectile3.cs | 2 +- Projectiles/SunkenSea/SeafoamBomb.cs | 6 +- Projectiles/SunkenSea/SeafoamBubble.cs | 2 +- Projectiles/SunkenSea/SeashineSwordProj.cs | 2 +- Projectiles/SunkenSea/SerpentineBody.cs | 4 +- Projectiles/SunkenSea/SerpentineHead.cs | 4 +- Projectiles/SunkenSea/SerpentineTail.cs | 4 +- Projectiles/SunkenSea/Shellfish.cs | 2 +- Projectiles/Typeless/AstralFallingSand.cs | 2 +- Projectiles/Typeless/AstralStar.cs | 24 +- Projectiles/Typeless/AtaxiaOrb.cs | 2 +- Projectiles/Typeless/BloodBomb.cs | 2 +- Projectiles/Typeless/BloodBombExplosion.cs | 2 +- Projectiles/Typeless/ChaosBlaze.cs | 2 +- Projectiles/Typeless/ChaosFlare.cs | 2 +- Projectiles/Typeless/ChaosFlare2.cs | 2 +- Projectiles/Typeless/ChaosGeyser.cs | 6 +- Projectiles/Typeless/DragonDust.cs | 2 +- Projectiles/Typeless/FabsolDust.cs | 2 +- Projectiles/Typeless/FlareExplosion.cs | 2 +- Projectiles/Typeless/GalaxySmasherHammer.cs | 2 +- Projectiles/Typeless/GhostlyBolt.cs | 4 +- Projectiles/Typeless/GodKiller.cs | 12 +- Projectiles/Typeless/GodSlayerBlaze.cs | 4 +- Projectiles/Typeless/GodSlayerOrb.cs | 2 +- Projectiles/Typeless/GodSlayerPhantom.cs | 6 +- Projectiles/Typeless/GodSlayerShrapnel.cs | 6 +- .../Typeless/GodSlayerShrapnelRound.cs | 2 +- Projectiles/Typeless/GoldenGun.cs | 22 +- Projectiles/Typeless/GrenadeRound.cs | 10 +- Projectiles/Typeless/HolyEruption.cs | 6 +- Projectiles/Typeless/HolyExplosion.cs | 8 +- Projectiles/Typeless/HolyExplosionSupreme.cs | 8 +- Projectiles/Typeless/HolyFlameBomb.cs | 8 +- Projectiles/Typeless/LunicBeam.cs | 46 +- Projectiles/Typeless/MarkRound.cs | 2 +- Projectiles/Typeless/NanoblackMain.cs | 4 +- Projectiles/Typeless/Nanotech.cs | 2 +- Projectiles/Typeless/PoisonousSeawater.cs | 2 +- Projectiles/Typeless/ReaverBlast.cs | 2 +- Projectiles/Typeless/SkyFlareFriendly.cs | 16 +- Projectiles/Typeless/StandingFire.cs | 6 +- Projectiles/Typeless/StickyFeatherAero.cs | 8 +- Projectiles/Typeless/TarraEnergy.cs | 2 +- .../Typeless/TheDeadlyMicrobeProjectile.cs | 4 +- Projectiles/Typeless/XerocBlast.cs | 2 +- Projectiles/Typeless/XerocBubble.cs | 2 +- Projectiles/Typeless/XerocFire.cs | 6 +- Projectiles/Typeless/XerocOrb.cs | 2 +- Projectiles/Typeless/XerocStar.cs | 2 +- Skies/AstralSky.cs | 2 +- Tiles/ArenaTile.cs | 3 +- Tiles/Astral/AstralChestLocked.cs | 4 +- Tiles/AstralBar.cs | 2 +- Tiles/AstralDesert/AstralSand.cs | 2 +- Tiles/CalamityGlobalTile.cs | 46 +- Tiles/ChaoticOre.cs | 4 +- Tiles/FurnitureAbyss/AbyssChest.cs | 2 +- Tiles/FurnitureAbyss/AbyssDresser.cs | 2 +- Tiles/FurnitureAncient/AncientDresser.cs | 2 +- Tiles/FurnitureAshen/AshenChest.cs | 2 +- Tiles/FurnitureAshen/AshenChestLocked.cs | 2 +- Tiles/FurnitureAshen/AshenDresser.cs | 2 +- Tiles/FurnitureBotanic/BotanicChest.cs | 2 +- Tiles/FurnitureBotanic/BotanicDresser.cs | 2 +- Tiles/FurnitureCosmilite/CosmiliteChest.cs | 2 +- Tiles/FurnitureCosmilite/CosmiliteDresser.cs | 2 +- Tiles/FurnitureEutrophic/EutrophicChest.cs | 2 +- Tiles/FurnitureEutrophic/EutrophicDresser.cs | 2 +- Tiles/FurnitureOccult/OccultChest.cs | 2 +- Tiles/FurnitureOccult/OccultDresser.cs | 2 +- .../PlaguedPlateChest.cs | 2 +- .../PlaguedPlateDresser.cs | 2 +- Tiles/FurnitureProfaned/ProfanedChest.cs | 2 +- Tiles/FurnitureProfaned/ProfanedDresser.cs | 2 +- Tiles/FurnitureSilva/SilvaChest.cs | 2 +- Tiles/FurnitureSilva/SilvaDresser.cs | 2 +- Tiles/FurnitureStatigel/StatigelChest.cs | 2 +- Tiles/FurnitureStatigel/StatigelDresser.cs | 2 +- Tiles/FurnitureStratus/StratusChest.cs | 2 +- Tiles/FurnitureStratus/StratusDresser.cs | 2 +- Tiles/FurnitureVoid/VoidChest.cs | 2 +- Tiles/FurnitureVoid/VoidDresser.cs | 2 +- Tiles/PlantyMush.cs | 2 +- Tiles/SulphurousSand.cs | 8 +- Tiles/SunkenSea/BrainCoral.cs | 4 +- Tiles/SunkenSea/Navystone.cs | 4 +- Tiles/SunkenSea/SeaPrism.cs | 4 +- Tiles/SunkenSea/SmallBrainCoral.cs | 4 +- Tiles/Tenebris.cs | 2 +- Tiles/ViperVines.cs | 4 +- Tiles/YellowCandle.cs | 2 +- UI/AstralArcanumUI.cs | 7 +- UI/BossHealthBarManager.cs | 4 +- World/CalamityWorld.cs | 54 +- World/SunkenSea.cs | 2 +- World/WorldGenerationMethods.cs | 57 +- 1257 files changed, 5190 insertions(+), 5215 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 24c2f7a4f2..1f1090aa77 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -1416,7 +1416,7 @@ namespace CalamityMod.CalPlayer CalamityWorld.bossRushActive = false; CalamityWorld.bossRushStage = 0; CalamityMod.UpdateServerBoolean(); - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { var netMessage = mod.GetPacket(); netMessage.Write((byte)CalamityModMessageType.BossRushStage); @@ -1666,7 +1666,7 @@ namespace CalamityMod.CalPlayer { player.statLife -= player.statLifeMax2 / 4; PlayerDeathReason damageSource = PlayerDeathReason.ByOther(13); - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { damageSource = PlayerDeathReason.ByOther(player.Male ? 14 : 15); } @@ -1786,7 +1786,7 @@ namespace CalamityMod.CalPlayer { player.AddBuff(mod.BuffType("Enraged"), 600, false); } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { for (int l = 0; l < 200; l++) { @@ -1807,12 +1807,12 @@ namespace CalamityMod.CalPlayer { if (celestialJewel) { - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { player.TeleportationPotion(); Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 6); } - else if (Main.netMode == 1 && player.whoAmI == Main.myPlayer) + else if (Main.netMode == NetmodeID.MultiplayerClient && player.whoAmI == Main.myPlayer) { NetMessage.SendData(73, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); } @@ -1881,7 +1881,7 @@ namespace CalamityMod.CalPlayer #region TeleportMethods public void HandleTeleport(int teleportType, bool forceHandle = false, int whoAmI = 0) { - bool syncData = forceHandle || Main.netMode == 0; + bool syncData = forceHandle || Main.netMode == NetmodeID.SinglePlayer; if (syncData) { TeleportPlayer(teleportType, forceHandle, whoAmI); @@ -2130,7 +2130,7 @@ namespace CalamityMod.CalPlayer Main.TeleportEffect(player.getRect(), 1); Main.TeleportEffect(player.getRect(), 3); Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 6); - if (Main.netMode != 2) + if (Main.netMode != NetmodeID.Server) { return; } @@ -2575,7 +2575,7 @@ namespace CalamityMod.CalPlayer } } } - if (player.whoAmI == Main.myPlayer && Main.netMode == 1) + if (player.whoAmI == Main.myPlayer && Main.netMode == NetmodeID.MultiplayerClient) { packetTimer++; if (packetTimer == 60) @@ -2654,7 +2654,7 @@ namespace CalamityMod.CalPlayer (eCore ? 50 : 0) + (cShard ? 50 : 0) + (starBeamRye ? 50 : 0); - if (Main.netMode != 2 && player.whoAmI == Main.myPlayer) + if (Main.netMode != NetmodeID.Server && player.whoAmI == Main.myPlayer) { Texture2D rain3 = mod.GetTexture("ExtraTextures/Rain3"); Texture2D rainOriginal = mod.GetTexture("ExtraTextures/RainOriginal"); @@ -3075,7 +3075,7 @@ namespace CalamityMod.CalPlayer Main.dust[num].noGravity = true; Main.dust[num].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; Main.dust[num].shader = GameShaders.Armor.GetSecondaryShader(player.cWaist, player); - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; } @@ -3103,7 +3103,7 @@ namespace CalamityMod.CalPlayer Main.dust[num].noGravity = true; Main.dust[num].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; Main.dust[num].shader = GameShaders.Armor.GetSecondaryShader(player.cWaist, player); - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; } @@ -3169,7 +3169,7 @@ namespace CalamityMod.CalPlayer Main.dust[num].noGravity = true; Main.dust[num].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; Main.dust[num].shader = GameShaders.Armor.GetSecondaryShader(player.cWaist, player); - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; } @@ -3343,7 +3343,7 @@ namespace CalamityMod.CalPlayer { int damage = 10; float knockBack = 1f; - if (Main.rand.Next(15) == 0) + if (Main.rand.NextBool(15)) { int num = 0; for (int i = 0; i < 1000; i++) @@ -3373,7 +3373,7 @@ namespace CalamityMod.CalPlayer int num6 = (int)center.X / 16; int num7 = (int)center.Y / 16; bool flag = false; - if (Main.rand.Next(3) == 0 && Main.tile[num6, num7] != null && Main.tile[num6, num7].wall > 0) + if (Main.rand.NextBool(3) && Main.tile[num6, num7] != null && Main.tile[num6, num7].wall > 0) { flag = true; } @@ -3527,7 +3527,7 @@ namespace CalamityMod.CalPlayer { for (int num69 = num67 - num65; num69 <= num67 + num65; num69++) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Vector2 vector = new Vector2((float)(num66 - num68), (float)(num67 - num69)); if (vector.Length() < (float)num65 && num68 > 0 && num68 < Main.maxTilesX - 1 && num69 > 0 && num69 < Main.maxTilesY - 1 && Main.tile[num68, num69] != null && Main.tile[num68, num69].active()) @@ -3595,7 +3595,7 @@ namespace CalamityMod.CalPlayer if ((double)aquaticBoost <= 0.0) { aquaticBoost = 0f; - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) NetMessage.SendData(84, -1, -1, null, player.whoAmI, 0f, 0f, 0f, 0, 0, 0); } } @@ -3628,7 +3628,7 @@ namespace CalamityMod.CalPlayer if ((double)modStealth <= 0.0) { modStealth = 0f; - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) NetMessage.SendData(84, -1, -1, null, player.whoAmI, 0f, 0f, 0f, 0, 0, 0); } } @@ -3663,7 +3663,7 @@ namespace CalamityMod.CalPlayer if ((double)modStealth <= 0.0) { modStealth = 0f; - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) NetMessage.SendData(84, -1, -1, null, player.whoAmI, 0f, 0f, 0f, 0, 0, 0); } } @@ -3703,7 +3703,7 @@ namespace CalamityMod.CalPlayer { flag14 = true; } - if (shieldInvinc == 0f && num29 != shieldInvinc && Main.netMode == 1) + if (shieldInvinc == 0f && num29 != shieldInvinc && Main.netMode == NetmodeID.MultiplayerClient) { NetMessage.SendData(84, -1, -1, null, player.whoAmI, 0f, 0f, 0f, 0, 0, 0); } @@ -3731,14 +3731,14 @@ namespace CalamityMod.CalPlayer { flag14 = true; } - if (shieldInvinc == 5f && num30 != shieldInvinc && Main.netMode == 1) + if (shieldInvinc == 5f && num30 != shieldInvinc && Main.netMode == NetmodeID.MultiplayerClient) { NetMessage.SendData(84, -1, -1, null, player.whoAmI, 0f, 0f, 0f, 0, 0, 0); } } if (flag14) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Vector2 vector = Vector2.UnitY.RotatedByRandom(6.2831854820251465); Dust dust = Main.dust[Dust.NewDust(player.Center - vector * 30f, 0, 0, 244, 0f, 0f, 0, default, 1f)]; @@ -3748,7 +3748,7 @@ namespace CalamityMod.CalPlayer dust.scale = 0.5f + Main.rand.NextFloat(); dust.fadeIn = 0.5f; } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Vector2 vector2 = Vector2.UnitY.RotatedByRandom(6.2831854820251465); Dust dust2 = Main.dust[Dust.NewDust(player.Center - vector2 * 30f, 0, 0, 246, 0f, 0f, 0, default, 1f)]; @@ -4059,7 +4059,7 @@ namespace CalamityMod.CalPlayer } if (giantPearl) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { for (int m = 0; m < 200; m++) { @@ -4434,7 +4434,7 @@ namespace CalamityMod.CalPlayer if (flag) { nPC.StrikeNPC(num3, 0f, 0, false, false, false); - if (Main.netMode != 0) + if (Main.netMode != NetmodeID.SinglePlayer) { NetMessage.SendData(28, -1, -1, null, l, (float)num3, 0f, 0f, 0, 0, 0); } @@ -4752,7 +4752,7 @@ namespace CalamityMod.CalPlayer } } } - if (nCore && Main.rand.Next(10) == 0) + if (nCore && Main.rand.NextBool(10)) { Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 67); for (int j = 0; j < 25; j++) @@ -4765,7 +4765,7 @@ namespace CalamityMod.CalPlayer Main.dust[num].velocity *= 0.9f; Main.dust[num].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; Main.dust[num].shader = GameShaders.Armor.GetSecondaryShader(player.cWaist, player); - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; } @@ -4791,7 +4791,7 @@ namespace CalamityMod.CalPlayer Main.dust[num].velocity *= 0.9f; Main.dust[num].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; Main.dust[num].shader = GameShaders.Armor.GetSecondaryShader(player.cWaist, player); - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; } @@ -4881,7 +4881,7 @@ namespace CalamityMod.CalPlayer } } deathCount++; - if (player.whoAmI == Main.myPlayer && Main.netMode == 1) + if (player.whoAmI == Main.myPlayer && Main.netMode == NetmodeID.MultiplayerClient) { DeathPacket(false); } @@ -5072,21 +5072,21 @@ namespace CalamityMod.CalPlayer } if (aWeapon) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int num280 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, mod.DustType("BrimstoneFlame"), player.velocity.X * 0.2f + (float)(player.direction * 3), player.velocity.Y * 0.2f, 100, default, 0.75f); } } if (aChicken) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int num280 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, 244, player.velocity.X * 0.2f + (float)(player.direction * 3), player.velocity.Y * 0.2f, 100, default, 0.75f); } } if (eGauntlet) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int num280 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, 66, player.velocity.X * 0.2f + (float)(player.direction * 3), player.velocity.Y * 0.2f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1.25f); Main.dust[num280].noGravity = true; @@ -5094,28 +5094,28 @@ namespace CalamityMod.CalPlayer } if (cryogenSoul) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int num280 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, 67, player.velocity.X * 0.2f + (float)(player.direction * 3), player.velocity.Y * 0.2f, 100, default, 0.75f); } } if (xerocSet) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int num280 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, 58, player.velocity.X * 0.2f + (float)(player.direction * 3), player.velocity.Y * 0.2f, 100, default, 1.25f); } } if (reaverBlast) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int num280 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, 74, player.velocity.X * 0.2f + (float)(player.direction * 3), player.velocity.Y * 0.2f, 100, default, 0.75f); } } if (dsSetBonus) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int num280 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, 27, player.velocity.X * 0.2f + (float)(player.direction * 3), player.velocity.Y * 0.2f, 100, default, 2.5f); } @@ -5136,7 +5136,7 @@ namespace CalamityMod.CalPlayer target.AddBuff(mod.BuffType("HolyLight"), 120, false); target.AddBuff(mod.BuffType("Plague"), 120, false); target.AddBuff(mod.BuffType("BrimstoneFlames"), 120, false); - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { target.AddBuff(mod.BuffType("GlacialState"), 120, false); } @@ -5150,11 +5150,11 @@ namespace CalamityMod.CalPlayer } if (aWeapon) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { target.AddBuff(mod.BuffType("AbyssalFlames"), 360, false); } - else if (Main.rand.Next(2) == 0) + else if (Main.rand.NextBool(2)) { target.AddBuff(mod.BuffType("AbyssalFlames"), 240, false); } @@ -5165,11 +5165,11 @@ namespace CalamityMod.CalPlayer } if (abyssalAmulet) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { target.AddBuff(mod.BuffType("CrushDepth"), 360, false); } - else if (Main.rand.Next(2) == 0) + else if (Main.rand.NextBool(2)) { target.AddBuff(mod.BuffType("CrushDepth"), 240, false); } @@ -5180,11 +5180,11 @@ namespace CalamityMod.CalPlayer } if (dsSetBonus) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { target.AddBuff(mod.BuffType("DemonFlames"), 360, false); } - else if (Main.rand.Next(2) == 0) + else if (Main.rand.NextBool(2)) { target.AddBuff(mod.BuffType("DemonFlames"), 240, false); } @@ -5195,11 +5195,11 @@ namespace CalamityMod.CalPlayer } if (cryogenSoul || frostFlare) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { target.AddBuff(44, 360, false); } - else if (Main.rand.Next(2) == 0) + else if (Main.rand.NextBool(2)) { target.AddBuff(44, 240, false); } @@ -5210,11 +5210,11 @@ namespace CalamityMod.CalPlayer } if (yInsignia) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { target.AddBuff(mod.BuffType("HolyLight"), 360, false); } - else if (Main.rand.Next(2) == 0) + else if (Main.rand.NextBool(2)) { target.AddBuff(mod.BuffType("HolyLight"), 240, false); } @@ -5225,11 +5225,11 @@ namespace CalamityMod.CalPlayer } if (ataxiaFire) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { target.AddBuff(BuffID.OnFire, 720, false); } - else if (Main.rand.Next(2) == 0) + else if (Main.rand.NextBool(2)) { target.AddBuff(BuffID.OnFire, 480, false); } @@ -5240,11 +5240,11 @@ namespace CalamityMod.CalPlayer } if (alchFlask) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { target.AddBuff(mod.BuffType("Plague"), 360, false); } - else if (Main.rand.Next(2) == 0) + else if (Main.rand.NextBool(2)) { target.AddBuff(mod.BuffType("Plague"), 240, false); } @@ -5257,11 +5257,11 @@ namespace CalamityMod.CalPlayer { if (item.melee || item.GetGlobalItem(mod).rogue) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { target.AddBuff(mod.BuffType("ArmorCrunch"), 360, false); } - else if (Main.rand.Next(2) == 0) + else if (Main.rand.NextBool(2)) { target.AddBuff(mod.BuffType("ArmorCrunch"), 240, false); } @@ -5284,16 +5284,16 @@ namespace CalamityMod.CalPlayer if (omegaBlueChestplate && proj.friendly && !target.friendly) target.AddBuff(mod.BuffType("CrushDepth"), 240); - if (proj.melee && silvaMelee && Main.rand.Next(4) == 0) + if (proj.melee && silvaMelee && Main.rand.NextBool(4)) target.AddBuff(mod.BuffType("SilvaStun"), 20); if (abyssalAmulet) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { target.AddBuff(mod.BuffType("CrushDepth"), 360, false); } - else if (Main.rand.Next(2) == 0) + else if (Main.rand.NextBool(2)) { target.AddBuff(mod.BuffType("CrushDepth"), 240, false); } @@ -5304,11 +5304,11 @@ namespace CalamityMod.CalPlayer } if (dsSetBonus) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { target.AddBuff(mod.BuffType("DemonFlames"), 360, false); } - else if (Main.rand.Next(2) == 0) + else if (Main.rand.NextBool(2)) { target.AddBuff(mod.BuffType("DemonFlames"), 240, false); } @@ -5323,11 +5323,11 @@ namespace CalamityMod.CalPlayer } else if (alchFlask) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { target.AddBuff(mod.BuffType("Plague"), 360, false); } - else if (Main.rand.Next(2) == 0) + else if (Main.rand.NextBool(2)) { target.AddBuff(mod.BuffType("Plague"), 240, false); } @@ -5344,7 +5344,7 @@ namespace CalamityMod.CalPlayer target.AddBuff(mod.BuffType("HolyLight"), 120, false); target.AddBuff(mod.BuffType("Plague"), 120, false); target.AddBuff(mod.BuffType("BrimstoneFlames"), 120, false); - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { target.AddBuff(mod.BuffType("GlacialState"), 120, false); } @@ -5358,11 +5358,11 @@ namespace CalamityMod.CalPlayer } if (aWeapon) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { target.AddBuff(mod.BuffType("AbyssalFlames"), 360, false); } - else if (Main.rand.Next(2) == 0) + else if (Main.rand.NextBool(2)) { target.AddBuff(mod.BuffType("AbyssalFlames"), 240, false); } @@ -5373,11 +5373,11 @@ namespace CalamityMod.CalPlayer } if (cryogenSoul || frostFlare) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { target.AddBuff(44, 360, false); } - else if (Main.rand.Next(2) == 0) + else if (Main.rand.NextBool(2)) { target.AddBuff(44, 240, false); } @@ -5388,11 +5388,11 @@ namespace CalamityMod.CalPlayer } if (yInsignia) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { target.AddBuff(mod.BuffType("HolyLight"), 360, false); } - else if (Main.rand.Next(2) == 0) + else if (Main.rand.NextBool(2)) { target.AddBuff(mod.BuffType("HolyLight"), 240, false); } @@ -5403,11 +5403,11 @@ namespace CalamityMod.CalPlayer } if (ataxiaFire) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { target.AddBuff(BuffID.OnFire, 720, false); } - else if (Main.rand.Next(2) == 0) + else if (Main.rand.NextBool(2)) { target.AddBuff(BuffID.OnFire, 480, false); } @@ -5421,11 +5421,11 @@ namespace CalamityMod.CalPlayer { if (proj.melee || proj.GetGlobalProjectile(mod).rogue) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { target.AddBuff(mod.BuffType("ArmorCrunch"), 360, false); } - else if (Main.rand.Next(2) == 0) + else if (Main.rand.NextBool(2)) { target.AddBuff(mod.BuffType("ArmorCrunch"), 240, false); } @@ -5500,7 +5500,7 @@ namespace CalamityMod.CalPlayer target.AddBuff(mod.BuffType("HolyLight"), 120, false); target.AddBuff(mod.BuffType("Plague"), 120, false); target.AddBuff(mod.BuffType("BrimstoneFlames"), 120, false); - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { target.AddBuff(mod.BuffType("GlacialState"), 120, false); } @@ -5514,11 +5514,11 @@ namespace CalamityMod.CalPlayer } if (aWeapon) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { target.AddBuff(mod.BuffType("AbyssalFlames"), 360, false); } - else if (Main.rand.Next(2) == 0) + else if (Main.rand.NextBool(2)) { target.AddBuff(mod.BuffType("AbyssalFlames"), 240, false); } @@ -5529,11 +5529,11 @@ namespace CalamityMod.CalPlayer } if (abyssalAmulet) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { target.AddBuff(mod.BuffType("CrushDepth"), 360, false); } - else if (Main.rand.Next(2) == 0) + else if (Main.rand.NextBool(2)) { target.AddBuff(mod.BuffType("CrushDepth"), 240, false); } @@ -5544,11 +5544,11 @@ namespace CalamityMod.CalPlayer } if (cryogenSoul || frostFlare) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { target.AddBuff(44, 360, false); } - else if (Main.rand.Next(2) == 0) + else if (Main.rand.NextBool(2)) { target.AddBuff(44, 240, false); } @@ -5559,11 +5559,11 @@ namespace CalamityMod.CalPlayer } if (yInsignia) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { target.AddBuff(mod.BuffType("HolyLight"), 360, false); } - else if (Main.rand.Next(2) == 0) + else if (Main.rand.NextBool(2)) { target.AddBuff(mod.BuffType("HolyLight"), 240, false); } @@ -5574,11 +5574,11 @@ namespace CalamityMod.CalPlayer } if (ataxiaFire) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { target.AddBuff(BuffID.OnFire, 720, false); } - else if (Main.rand.Next(2) == 0) + else if (Main.rand.NextBool(2)) { target.AddBuff(BuffID.OnFire, 480, false); } @@ -5589,11 +5589,11 @@ namespace CalamityMod.CalPlayer } if (alchFlask) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { target.AddBuff(mod.BuffType("Plague"), 360, false); } - else if (Main.rand.Next(2) == 0) + else if (Main.rand.NextBool(2)) { target.AddBuff(mod.BuffType("Plague"), 240, false); } @@ -5613,16 +5613,16 @@ namespace CalamityMod.CalPlayer if (omegaBlueChestplate) target.AddBuff(mod.BuffType("CrushDepth"), 240); - if (proj.melee && silvaMelee && Main.rand.Next(4) == 0) + if (proj.melee && silvaMelee && Main.rand.NextBool(4)) target.AddBuff(mod.BuffType("SilvaStun"), 20); if (abyssalAmulet) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { target.AddBuff(mod.BuffType("CrushDepth"), 360, false); } - else if (Main.rand.Next(2) == 0) + else if (Main.rand.NextBool(2)) { target.AddBuff(mod.BuffType("CrushDepth"), 240, false); } @@ -5637,11 +5637,11 @@ namespace CalamityMod.CalPlayer } else if (alchFlask) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { target.AddBuff(mod.BuffType("Plague"), 360, false); } - else if (Main.rand.Next(2) == 0) + else if (Main.rand.NextBool(2)) { target.AddBuff(mod.BuffType("Plague"), 240, false); } @@ -5658,7 +5658,7 @@ namespace CalamityMod.CalPlayer target.AddBuff(mod.BuffType("HolyLight"), 120, false); target.AddBuff(mod.BuffType("Plague"), 120, false); target.AddBuff(mod.BuffType("BrimstoneFlames"), 120, false); - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { target.AddBuff(mod.BuffType("GlacialState"), 120, false); } @@ -5672,11 +5672,11 @@ namespace CalamityMod.CalPlayer } if (aWeapon) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { target.AddBuff(mod.BuffType("AbyssalFlames"), 360, false); } - else if (Main.rand.Next(2) == 0) + else if (Main.rand.NextBool(2)) { target.AddBuff(mod.BuffType("AbyssalFlames"), 240, false); } @@ -5687,11 +5687,11 @@ namespace CalamityMod.CalPlayer } if (cryogenSoul || frostFlare) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { target.AddBuff(44, 360, false); } - else if (Main.rand.Next(2) == 0) + else if (Main.rand.NextBool(2)) { target.AddBuff(44, 240, false); } @@ -5702,11 +5702,11 @@ namespace CalamityMod.CalPlayer } if (yInsignia) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { target.AddBuff(mod.BuffType("HolyLight"), 360, false); } - else if (Main.rand.Next(2) == 0) + else if (Main.rand.NextBool(2)) { target.AddBuff(mod.BuffType("HolyLight"), 240, false); } @@ -5717,11 +5717,11 @@ namespace CalamityMod.CalPlayer } if (ataxiaFire) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { target.AddBuff(BuffID.OnFire, 720, false); } - else if (Main.rand.Next(2) == 0) + else if (Main.rand.NextBool(2)) { target.AddBuff(BuffID.OnFire, 480, false); } @@ -5735,11 +5735,11 @@ namespace CalamityMod.CalPlayer { if (proj.melee || proj.GetGlobalProjectile(mod).rogue) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { target.AddBuff(mod.BuffType("ArmorCrunch"), 360, false); } - else if (Main.rand.Next(2) == 0) + else if (Main.rand.NextBool(2)) { target.AddBuff(mod.BuffType("ArmorCrunch"), 240, false); } @@ -5807,7 +5807,7 @@ namespace CalamityMod.CalPlayer { #region MultiplierBoosts double damageMult = 1.0; - if (silvaMelee && Main.rand.Next(4) == 0 && item.melee) + if (silvaMelee && Main.rand.NextBool(4) && item.melee) { damageMult += 4.0; } @@ -5940,10 +5940,10 @@ namespace CalamityMod.CalPlayer gainLevelCooldown = 2400; //40 seconds } meleeLevel++; - if (fasterMeleeLevel && meleeLevel % 100 != 0 && Main.rand.Next(10) == 0) //add only to non-multiples of 100 + if (fasterMeleeLevel && meleeLevel % 100 != 0 && Main.rand.NextBool(10)) //add only to non-multiples of 100 meleeLevel++; shootFireworksLevelUpMelee = true; - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { LevelPacket(false, 0); } @@ -6018,7 +6018,7 @@ namespace CalamityMod.CalPlayer { damageMult += 0.05; } - if (silvaMelee && Main.rand.Next(4) == 0 && isTrueMelee) + if (silvaMelee && Main.rand.NextBool(4) && isTrueMelee) { damageMult += 4.0; } @@ -6246,7 +6246,7 @@ namespace CalamityMod.CalPlayer Main.projectile[FUCKYOU].netUpdate = true; } } - if (bloodflareThrowing && proj.GetGlobalProjectile(mod).rogue && crit && Main.rand.Next(2) == 0) + if (bloodflareThrowing && proj.GetGlobalProjectile(mod).rogue && crit && Main.rand.NextBool(2)) { if (target.canGhostHeal) { @@ -6316,10 +6316,10 @@ namespace CalamityMod.CalPlayer gainLevelCooldown = 2400; //40 seconds } meleeLevel++; - if (fasterMeleeLevel && meleeLevel % 100 != 0 && Main.rand.Next(10) == 0) //add only to non-multiples of 100 + if (fasterMeleeLevel && meleeLevel % 100 != 0 && Main.rand.NextBool(10)) //add only to non-multiples of 100 meleeLevel++; shootFireworksLevelUpMelee = true; - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { LevelPacket(false, 0); } @@ -6335,10 +6335,10 @@ namespace CalamityMod.CalPlayer gainLevelCooldown = 2400; //40 seconds } rangedLevel++; - if (fasterRangedLevel && rangedLevel % 100 != 0 && Main.rand.Next(10) == 0) //add only to non-multiples of 100 + if (fasterRangedLevel && rangedLevel % 100 != 0 && Main.rand.NextBool(10)) //add only to non-multiples of 100 rangedLevel++; shootFireworksLevelUpRanged = true; - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { LevelPacket(false, 1); } @@ -6354,10 +6354,10 @@ namespace CalamityMod.CalPlayer gainLevelCooldown = 2400; //40 seconds } magicLevel++; - if (fasterMagicLevel && magicLevel % 100 != 0 && Main.rand.Next(10) == 0) //add only to non-multiples of 100 + if (fasterMagicLevel && magicLevel % 100 != 0 && Main.rand.NextBool(10)) //add only to non-multiples of 100 magicLevel++; shootFireworksLevelUpMagic = true; - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { LevelPacket(false, 2); } @@ -6373,10 +6373,10 @@ namespace CalamityMod.CalPlayer gainLevelCooldown = 2400; //40 seconds } summonLevel++; - if (fasterSummonLevel && summonLevel % 100 != 0 && Main.rand.Next(10) == 0) //add only to non-multiples of 100 + if (fasterSummonLevel && summonLevel % 100 != 0 && Main.rand.NextBool(10)) //add only to non-multiples of 100 summonLevel++; shootFireworksLevelUpSummon = true; - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { LevelPacket(false, 3); } @@ -6392,10 +6392,10 @@ namespace CalamityMod.CalPlayer gainLevelCooldown = 2400; //40 seconds } rogueLevel++; - if (fasterRogueLevel && rogueLevel % 100 != 0 && Main.rand.Next(10) == 0) //add only to non-multiples of 100 + if (fasterRogueLevel && rogueLevel % 100 != 0 && Main.rand.NextBool(10)) //add only to non-multiples of 100 rogueLevel++; shootFireworksLevelUpRogue = true; - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { LevelPacket(false, 4); } @@ -6619,7 +6619,7 @@ namespace CalamityMod.CalPlayer player.AddBuff(BuffID.Electrified, 120); } } - if (projRef && proj.active && !proj.friendly && proj.hostile && damage > 0 && Main.rand.Next(20) == 0) + if (projRef && proj.active && !proj.friendly && proj.hostile && damage > 0 && Main.rand.NextBool(20)) { player.statLife += damage; player.HealEffect(damage); @@ -6628,7 +6628,7 @@ namespace CalamityMod.CalPlayer proj.velocity.X = -proj.velocity.X; proj.velocity.Y = -proj.velocity.Y; } - if (projRefRare && proj.active && !proj.friendly && proj.hostile && damage > 0 && Main.rand.Next(2) == 0) + if (projRefRare && proj.active && !proj.friendly && proj.hostile && damage > 0 && Main.rand.NextBool(2)) { proj.hostile = false; proj.friendly = true; @@ -6649,7 +6649,7 @@ namespace CalamityMod.CalPlayer proj.damage *= 8; } } - if (daedalusReflect && proj.active && !proj.friendly && proj.hostile && damage > 0 && Main.rand.Next(3) == 0) + if (daedalusReflect && proj.active && !proj.friendly && proj.hostile && damage > 0 && Main.rand.NextBool(3)) { int healAmt = damage / 5; player.statLife += healAmt; @@ -6691,7 +6691,7 @@ namespace CalamityMod.CalPlayer } /*if (abyssPosX && liquidType == 0 && (bait.type == ItemID.GoldWorm || bait.type == ItemID.GoldGrasshopper || bait.type == ItemID.GoldButterfly) && power > 150) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { CalamityGlobalNPC.OldDukeSpawn(player.whoAmI, mod.NPCType("OldDuke")); } @@ -6712,23 +6712,23 @@ namespace CalamityMod.CalPlayer { if (power >= 40) { - if (abyssPosX && liquidType == 0 && Main.rand.Next(15) == 0 && power < 80) + if (abyssPosX && liquidType == 0 && Main.rand.NextBool(15) && power < 80) { caughtType = mod.ItemType("PlantyMush"); } if (power >= 60) { - if (player.FindBuffIndex(BuffID.Gills) > -1 && NPC.downedPlantBoss && liquidType == 0 && Main.rand.Next(25) == 0 && power < 160) + if (player.FindBuffIndex(BuffID.Gills) > -1 && NPC.downedPlantBoss && liquidType == 0 && Main.rand.NextBool(25) && power < 160) { caughtType = mod.ItemType("Floodtide"); } - if (abyssPosX && liquidType == 0 && Main.rand.Next(25) == 0 && power < 160) + if (abyssPosX && liquidType == 0 && Main.rand.NextBool(25) && power < 160) { caughtType = mod.ItemType("AlluringBait"); } if (power >= 80) { - if (abyssPosX && Main.hardMode && liquidType == 0 && Main.rand.Next(15) == 0 && power < 210) + if (abyssPosX && Main.hardMode && liquidType == 0 && Main.rand.NextBool(15) && power < 210) { switch (Main.rand.Next(4)) { @@ -6740,7 +6740,7 @@ namespace CalamityMod.CalPlayer } if (power >= 110) { - if (abyssPosX && liquidType == 0 && Main.rand.Next(25) == 0 && power < 240) + if (abyssPosX && liquidType == 0 && Main.rand.NextBool(25) && power < 240) { caughtType = mod.ItemType("AbyssalAmulet"); } @@ -6846,11 +6846,11 @@ namespace CalamityMod.CalPlayer { string key = "Mods.CalamityMod.SupremeBossText2"; Color messageColor = Color.Orange; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -6863,7 +6863,7 @@ namespace CalamityMod.CalPlayer { return false; } - if (godSlayerReflect && Main.rand.Next(50) == 0) + if (godSlayerReflect && Main.rand.NextBool(50)) { return false; } @@ -6884,8 +6884,8 @@ namespace CalamityMod.CalPlayer (dArtifact ? 0.25 : 0.0) + ((player.beetleDefense && player.beetleOrbs > 0) ? (0.05 * (double)player.beetleOrbs) : 0.0) + (enraged ? 0.25 : 0.0) + - ((CalamityWorld.defiled && Main.rand.Next(4) == 0) ? 0.5 : 0.0) + - ((bloodPact && Main.rand.Next(4) == 0) ? 1.5 : 0.0); + ((CalamityWorld.defiled && Main.rand.NextBool(4)) ? 0.5 : 0.0) + + ((bloodPact && Main.rand.NextBool(4)) ? 1.5 : 0.0); if (CalamityWorld.revenge) { @@ -7078,7 +7078,7 @@ namespace CalamityMod.CalPlayer player.statLife += healAmt; player.HealEffect(healAmt); } - if (daedalusAbsorb && Main.rand.Next(10) == 0) + if (daedalusAbsorb && Main.rand.NextBool(10)) { int healAmt = damage / 2; player.statLife += healAmt; @@ -7131,7 +7131,7 @@ namespace CalamityMod.CalPlayer { int num622 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -7191,7 +7191,7 @@ namespace CalamityMod.CalPlayer { int num622 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 67, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -7208,7 +7208,7 @@ namespace CalamityMod.CalPlayer } if (tarraMelee) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { player.AddBuff(mod.BuffType("TarraLifeRegen"), 120); } @@ -7428,7 +7428,7 @@ namespace CalamityMod.CalPlayer { for (i = 0; i < 4; i++) { - float xPos = Main.rand.Next(2) == 0 ? player.Center.X + 100 : player.Center.X - 100; + float xPos = Main.rand.NextBool(2) ? player.Center.X + 100 : player.Center.X - 100; Vector2 vector2 = new Vector2(xPos, player.Center.Y + Main.rand.Next(-100, 101)); offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; int spore1 = Projectile.NewProjectile(vector2.X, vector2.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), 590, fDamage, 1.25f, player.whoAmI, 0f, 0f); @@ -7465,7 +7465,7 @@ namespace CalamityMod.CalPlayer } } } - if (ataxiaBlaze && Main.rand.Next(5) == 0) + if (ataxiaBlaze && Main.rand.NextBool(5)) { if (damage > 0) { @@ -7518,7 +7518,7 @@ namespace CalamityMod.CalPlayer { for (i = 0; i < 4; i++) { - float xPos = Main.rand.Next(2) == 0 ? player.Center.X + 100 : player.Center.X - 100; + float xPos = Main.rand.NextBool(2) ? player.Center.X + 100 : player.Center.X - 100; Vector2 vector2 = new Vector2(xPos, player.Center.Y + Main.rand.Next(-100, 101)); offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; Projectile.NewProjectile(vector2.X, vector2.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), 567, rDamage, 2f, player.whoAmI, 0f, 0f); @@ -7604,7 +7604,7 @@ namespace CalamityMod.CalPlayer public void KillPlayer() { deathCount++; - if (player.whoAmI == Main.myPlayer && Main.netMode == 1) + if (player.whoAmI == Main.myPlayer && Main.netMode == NetmodeID.MultiplayerClient) { DeathPacket(false); } @@ -7646,7 +7646,7 @@ namespace CalamityMod.CalPlayer Main.item[num].noGrabDelay = 100; Main.item[num].favorited = false; Main.item[num].newAndShiny = false; - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { NetMessage.SendData(21, -1, -1, null, num, 0f, 0f, 0f, 0, 0, 0); } @@ -7701,15 +7701,15 @@ namespace CalamityMod.CalPlayer player.crystalLeaf = false; PlayerDeathReason damageSource = PlayerDeathReason.ByOther(player.Male ? 14 : 15); NetworkText deathText = damageSource.GetDeathText(player.name); - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(deathText, new Color(225, 25, 25), -1); } - else if (Main.netMode == 0) + else if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(deathText.ToString(), 225, 25, 25, false); } - if (Main.netMode == 1 && player.whoAmI == Main.myPlayer) + if (Main.netMode == NetmodeID.MultiplayerClient && player.whoAmI == Main.myPlayer) { NetMessage.SendPlayerDeath(player.whoAmI, damageSource, (int)1000.0, 0, false, -1, -1); } @@ -8000,7 +8000,7 @@ namespace CalamityMod.CalPlayer Main.dust[num14].scale *= 1f + (float)Main.rand.Next(20) * 0.01f; Main.dust[num14].shader = GameShaders.Armor.GetSecondaryShader(player.ArmorSetDye(), player); Main.dust[num14].noGravity = true; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num14].fadeIn = 0.5f; } @@ -8015,7 +8015,7 @@ namespace CalamityMod.CalPlayer Main.dust[num14].scale *= 1f + (float)Main.rand.Next(20) * 0.01f; Main.dust[num14].shader = GameShaders.Armor.GetSecondaryShader(player.ArmorSetDye(), player); Main.dust[num14].noGravity = true; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num14].fadeIn = 0.5f; } @@ -8031,7 +8031,7 @@ namespace CalamityMod.CalPlayer Main.dust[num14].scale *= 1f + (float)Main.rand.Next(20) * 0.01f; Main.dust[num14].shader = GameShaders.Armor.GetSecondaryShader(player.ArmorSetDye(), player); Main.dust[num14].noGravity = true; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num14].fadeIn = 0.5f; } @@ -8047,7 +8047,7 @@ namespace CalamityMod.CalPlayer Main.dust[num14].scale *= 1f + (float)Main.rand.Next(20) * 0.01f; Main.dust[num14].shader = GameShaders.Armor.GetSecondaryShader(player.ArmorSetDye(), player); Main.dust[num14].noGravity = true; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num14].fadeIn = 0.5f; } @@ -8063,7 +8063,7 @@ namespace CalamityMod.CalPlayer Main.dust[num14].scale *= 1f + (float)Main.rand.Next(20) * 0.01f; Main.dust[num14].shader = GameShaders.Armor.GetSecondaryShader(player.ArmorSetDye(), player); Main.dust[num14].noGravity = true; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num14].fadeIn = 0.5f; } @@ -8504,7 +8504,7 @@ namespace CalamityMod.CalPlayer Main.dust[num].velocity *= 0.4f; Main.dust[num].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; Main.dust[num].shader = GameShaders.Armor.GetSecondaryShader(player.cWaist, player); - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; Main.dust[num].noGravity = true; @@ -8961,7 +8961,7 @@ namespace CalamityMod.CalPlayer } if (revivifyTimer > 0) { - if (Main.rand.Next(2) == 0 && drawInfo.shadow == 0f) + if (Main.rand.NextBool(2) && drawInfo.shadow == 0f) { int dust = Dust.NewDust(drawInfo.position - new Vector2(2f, 2f), player.width + 4, player.height + 4, 91, player.velocity.X * 0.2f, player.velocity.Y * 0.2f, 100, default, 1f); Main.dust[dust].noGravity = true; @@ -8971,7 +8971,7 @@ namespace CalamityMod.CalPlayer } if (tRegen) { - if (Main.rand.Next(10) == 0 && drawInfo.shadow == 0f) + if (Main.rand.NextBool(10) && drawInfo.shadow == 0f) { int dust = Dust.NewDust(drawInfo.position - new Vector2(2f, 2f), player.width + 4, player.height + 4, 107, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 1f); Main.dust[dust].noGravity = true; @@ -8991,7 +8991,7 @@ namespace CalamityMod.CalPlayer { if (((double)Math.Abs(player.velocity.X) > 0.05 || (double)Math.Abs(player.velocity.Y) > 0.05) && !player.mount.Active) { - if (Main.rand.Next(2) == 0 && drawInfo.shadow == 0f) + if (Main.rand.NextBool(2) && drawInfo.shadow == 0f) { int dust = Dust.NewDust(drawInfo.position - new Vector2(2f, 2f), player.width + 4, player.height + 4, 229, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 1f); Main.dust[dust].noGravity = true; @@ -9011,7 +9011,7 @@ namespace CalamityMod.CalPlayer { if (((double)Math.Abs(player.velocity.X) > 0.05 || (double)Math.Abs(player.velocity.Y) > 0.05) && !player.mount.Active) { - if (Main.rand.Next(2) == 0 && drawInfo.shadow == 0f) + if (Main.rand.NextBool(2) && drawInfo.shadow == 0f) { int dust = Dust.NewDust(drawInfo.position - new Vector2(2f, 2f), player.width + 4, player.height + 4, 246, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 1f); Main.dust[dust].noGravity = true; @@ -9031,7 +9031,7 @@ namespace CalamityMod.CalPlayer { if (((double)Math.Abs(player.velocity.X) > 0.05 || (double)Math.Abs(player.velocity.Y) > 0.05) && !player.mount.Active) { - if (Main.rand.Next(2) == 0 && drawInfo.shadow == 0f) + if (Main.rand.NextBool(2) && drawInfo.shadow == 0f) { int dust = Dust.NewDust(drawInfo.position - new Vector2(2f, 2f), player.width + 4, player.height + 4, 27, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 1.5f); Main.dust[dust].noGravity = true; @@ -9053,7 +9053,7 @@ namespace CalamityMod.CalPlayer { if (drawInfo.shadow == 0f) { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f, 2f), player.width + 4, player.height + 4, Main.rand.Next(2) == 0 ? 57 : 244, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 1.5f); + int dust = Dust.NewDust(drawInfo.position - new Vector2(2f, 2f), player.width + 4, player.height + 4, Main.rand.NextBool(2) ? 57 : 244, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 1.5f); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 0.5f; Main.playerDrawDust.Add(dust); @@ -9069,7 +9069,7 @@ namespace CalamityMod.CalPlayer } if (bFlames || aFlames || rageMode) { - if (Main.rand.Next(4) == 0 && drawInfo.shadow == 0f) + if (Main.rand.NextBool(4) && drawInfo.shadow == 0f) { int dust = Dust.NewDust(drawInfo.position - new Vector2(2f, 2f), player.width + 4, player.height + 4, mod.DustType("BrimstoneFlame"), player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 3f); Main.dust[dust].noGravity = true; @@ -9094,7 +9094,7 @@ namespace CalamityMod.CalPlayer Main.dust[dust].velocity *= 0.75f; Main.dust[dust].velocity.X = Main.dust[dust].velocity.X * 0.75f; Main.dust[dust].velocity.Y = Main.dust[dust].velocity.Y - 1f; - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Main.dust[dust].noGravity = false; Main.dust[dust].scale *= 0.5f; @@ -9103,7 +9103,7 @@ namespace CalamityMod.CalPlayer } if (adrenalineMode) { - if (Main.rand.Next(4) == 0 && drawInfo.shadow == 0f) + if (Main.rand.NextBool(4) && drawInfo.shadow == 0f) { int dust = Dust.NewDust(drawInfo.position - new Vector2(2f, 2f), player.width + 4, player.height + 4, 206, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 3f); Main.dust[dust].velocity *= 1.8f; @@ -9120,7 +9120,7 @@ namespace CalamityMod.CalPlayer } if (gsInferno) { - if (Main.rand.Next(4) == 0 && drawInfo.shadow == 0f) + if (Main.rand.NextBool(4) && drawInfo.shadow == 0f) { int dust = Dust.NewDust(drawInfo.position - new Vector2(2f, 2f), player.width + 4, player.height + 4, 173, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 3f); Main.dust[dust].noGravity = true; @@ -9138,9 +9138,9 @@ namespace CalamityMod.CalPlayer } if (astralInfection) { - if (Main.rand.Next(4) == 0 && drawInfo.shadow == 0f) + if (Main.rand.NextBool(4) && drawInfo.shadow == 0f) { - int dustType = (Main.rand.Next(2) == 0 ? mod.DustType("AstralOrange") : mod.DustType("AstralBlue")); + int dustType = (Main.rand.NextBool(2) ? mod.DustType("AstralOrange") : mod.DustType("AstralBlue")); int dust = Dust.NewDust(drawInfo.position - new Vector2(2f, 2f), player.width + 4, player.height + 4, dustType, player.velocity.X * 0.2f, player.velocity.Y * 0.2f, 100, default, 0.7f); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 1.2f; @@ -9151,7 +9151,7 @@ namespace CalamityMod.CalPlayer } if (hFlames || hInferno) { - if (Main.rand.Next(4) == 0 && drawInfo.shadow == 0f) + if (Main.rand.NextBool(4) && drawInfo.shadow == 0f) { int dust = Dust.NewDust(drawInfo.position - new Vector2(2f, 2f), player.width + 4, player.height + 4, mod.DustType("HolyFlame"), player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 3f); Main.dust[dust].noGravity = true; @@ -9169,7 +9169,7 @@ namespace CalamityMod.CalPlayer } else if (eGravity) { - if (Main.rand.Next(12) == 0 && drawInfo.shadow == 0f) + if (Main.rand.NextBool(12) && drawInfo.shadow == 0f) { int dust = Dust.NewDust(drawInfo.position - new Vector2(2f, 2f), player.width + 4, player.height + 4, 244, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 3f); Main.dust[dust].noGravity = true; @@ -9180,7 +9180,7 @@ namespace CalamityMod.CalPlayer } if (pFlames) { - if (Main.rand.Next(4) == 0 && drawInfo.shadow == 0f) + if (Main.rand.NextBool(4) && drawInfo.shadow == 0f) { int dust = Dust.NewDust(drawInfo.position - new Vector2(2f, 2f), player.width + 4, player.height + 4, 89, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 3f); Main.dust[dust].noGravity = true; @@ -9218,7 +9218,7 @@ namespace CalamityMod.CalPlayer } if (bBlood) { - if (Main.rand.Next(6) == 0 && drawInfo.shadow == 0f) + if (Main.rand.NextBool(6) && drawInfo.shadow == 0f) { int dust = Dust.NewDust(drawInfo.position - new Vector2(2f, 2f), player.width + 4, player.height + 4, 5, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 3f); Main.dust[dust].noGravity = true; @@ -9236,7 +9236,7 @@ namespace CalamityMod.CalPlayer } if (mushy) { - if (Main.rand.Next(6) == 0 && drawInfo.shadow == 0f) + if (Main.rand.NextBool(6) && drawInfo.shadow == 0f) { int dust = Dust.NewDust(drawInfo.position - new Vector2(2f, 2f), player.width + 4, player.height + 4, 56, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 2f); Main.dust[dust].noGravity = true; @@ -9630,7 +9630,7 @@ namespace CalamityMod.CalPlayer break; } - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) ExactLevelPacket(true, levelType); } @@ -9655,35 +9655,35 @@ namespace CalamityMod.CalPlayer break; } - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) LevelPacket(true, levelType); } internal void HandleStress(BinaryReader reader) { stress = reader.ReadInt32(); - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) StressPacket(true); } internal void HandleAdrenaline(BinaryReader reader) { adrenaline = reader.ReadInt32(); - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) AdrenalinePacket(true); } internal void HandleRadiation(BinaryReader reader) { radiation = reader.ReadDouble(); - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) RadiationPacket(true); } /*internal void HandleDistanceFromBoss(BinaryReader reader) { distanceFromBoss = reader.ReadInt32(); - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { DistanceFromBossPacket(true); } @@ -9692,13 +9692,13 @@ namespace CalamityMod.CalPlayer internal void HandleDeathCount(BinaryReader reader) { deathCount = reader.ReadInt32(); - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) DeathPacket(true); } public override void OnEnterWorld(Player player) { - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { ExactLevelPacket(false, 0); ExactLevelPacket(false, 1); @@ -10111,7 +10111,7 @@ namespace CalamityMod.CalPlayer } break; } - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { ExactLevelPacket(false, levelUpType); } diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 020c3fad0c..62ff2aaf86 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -454,9 +454,9 @@ namespace CalamityMod.CalPlayer if (player.lifeRegen > 0 && player.statLife < player.statLifeMax2) { player.lifeRegenCount++; - if ((Main.rand.Next(30000) < player.lifeRegenTime || Main.rand.Next(30) == 0)) + if ((Main.rand.Next(30000) < player.lifeRegenTime || Main.rand.NextBool(30))) { - int num5 = Dust.NewDust(player.position, player.width, player.height, 173, 0f, 0f, 200, default(Color), 1f); + int num5 = Dust.NewDust(player.position, player.width, player.height, 173, 0f, 0f, 200, default, 1f); Main.dust[num5].noGravity = true; Main.dust[num5].velocity *= 0.75f; Main.dust[num5].fadeIn = 1.3f; @@ -491,7 +491,7 @@ namespace CalamityMod.CalPlayer if (player.lifeRegen > 0 && player.statLife < player.statLifeMax2) { player.lifeRegenCount++; - if ((Main.rand.Next(30000) < player.lifeRegenTime || Main.rand.Next(30) == 0)) + if ((Main.rand.Next(30000) < player.lifeRegenTime || Main.rand.NextBool(30))) { int num5 = Dust.NewDust(player.position, player.width, player.height, 67, 0f, 0f, 200, new Color(150, Main.DiscoG, 255), 0.75f); Main.dust[num5].noGravity = true; @@ -528,9 +528,9 @@ namespace CalamityMod.CalPlayer if (player.lifeRegen > 0 && player.statLife < player.statLifeMax2) { player.lifeRegenCount++; - if ((Main.rand.Next(30000) < player.lifeRegenTime || Main.rand.Next(2) == 0)) + if ((Main.rand.Next(30000) < player.lifeRegenTime || Main.rand.NextBool(2))) { - int num5 = Dust.NewDust(player.position, player.width, player.height, 107, 0f, 0f, 200, default(Color), 1f); + int num5 = Dust.NewDust(player.position, player.width, player.height, 107, 0f, 0f, 200, default, 1f); Main.dust[num5].noGravity = true; Main.dust[num5].velocity *= 0.75f; Main.dust[num5].fadeIn = 1.3f; @@ -569,9 +569,9 @@ namespace CalamityMod.CalPlayer if (player.lifeRegen > 0 && player.statLife < player.statLifeMax2) { player.lifeRegenCount++; - if ((Main.rand.Next(30000) < player.lifeRegenTime || Main.rand.Next(2) == 0)) + if ((Main.rand.Next(30000) < player.lifeRegenTime || Main.rand.NextBool(2))) { - int num5 = Dust.NewDust(player.position, player.width, player.height, 244, 0f, 0f, 200, default(Color), 1f); + int num5 = Dust.NewDust(player.position, player.width, player.height, 244, 0f, 0f, 200, default, 1f); Main.dust[num5].noGravity = true; Main.dust[num5].velocity *= 0.75f; Main.dust[num5].fadeIn = 1.3f; diff --git a/CalamityMod.cs b/CalamityMod.cs index 1ec2c3fda4..7abc69bc03 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -1792,9 +1792,9 @@ namespace CalamityMod public static Color BuffEffects(Entity codable, Color lightColor, float shadow = 0f, bool effects = true, bool poisoned = false, bool onFire = false, bool onFire2 = false, bool hunter = false, bool noItems = false, bool blind = false, bool bleed = false, bool venom = false, bool midas = false, bool ichor = false, bool onFrostBurn = false, bool burned = false, bool honey = false, bool dripping = false, bool drippingSlime = false, bool loveStruck = false, bool stinky = false) { float cr = 1f; float cg = 1f; float cb = 1f; float ca = 1f; - if (effects && honey && Main.rand.Next(30) == 0) + if (effects && honey && Main.rand.NextBool(30)) { - int dustID = Dust.NewDust(codable.position, codable.width, codable.height, 152, 0f, 0f, 150, default(Color), 1f); + int dustID = Dust.NewDust(codable.position, codable.width, codable.height, 152, 0f, 0f, 150, default, 1f); Main.dust[dustID].velocity.Y = 0.3f; Main.dust[dustID].velocity.X *= 0.1f; Main.dust[dustID].scale += (float)Main.rand.Next(3, 4) * 0.1f; @@ -1808,9 +1808,9 @@ namespace CalamityMod } if (poisoned) { - if (effects && Main.rand.Next(30) == 0) + if (effects && Main.rand.NextBool(30)) { - int dustID = Dust.NewDust(codable.position, codable.width, codable.height, 46, 0f, 0f, 120, default(Color), 0.2f); + int dustID = Dust.NewDust(codable.position, codable.width, codable.height, 46, 0f, 0f, 120, default, 0.2f); Main.dust[dustID].noGravity = true; Main.dust[dustID].fadeIn = 1.9f; if (codable is Player) @@ -1823,9 +1823,9 @@ namespace CalamityMod } if (venom) { - if (effects && Main.rand.Next(10) == 0) + if (effects && Main.rand.NextBool(10)) { - int dustID = Dust.NewDust(codable.position, codable.width, codable.height, 171, 0f, 0f, 100, default(Color), 0.5f); + int dustID = Dust.NewDust(codable.position, codable.width, codable.height, 171, 0f, 0f, 100, default, 0.5f); Main.dust[dustID].noGravity = true; Main.dust[dustID].fadeIn = 1.5f; if (codable is Player) @@ -1856,7 +1856,7 @@ namespace CalamityMod { if (effects) { - int dustID = Dust.NewDust(new Vector2(codable.position.X - 2f, codable.position.Y - 2f), codable.width + 4, codable.height + 4, 6, codable.velocity.X * 0.4f, codable.velocity.Y * 0.4f, 100, default(Color), 2f); + int dustID = Dust.NewDust(new Vector2(codable.position.X - 2f, codable.position.Y - 2f), codable.width + 4, codable.height + 4, 6, codable.velocity.X * 0.4f, codable.velocity.Y * 0.4f, 100, default, 2f); Main.dust[dustID].noGravity = true; Main.dust[dustID].velocity *= 1.8f; Main.dust[dustID].velocity.Y -= 0.75f; @@ -1878,11 +1878,11 @@ namespace CalamityMod { if (Main.rand.Next(4) < 3) { - int dustID = Dust.NewDust(new Vector2(codable.position.X - 2f, codable.position.Y - 2f), codable.width + 4, codable.height + 4, 135, codable.velocity.X * 0.4f, codable.velocity.Y * 0.4f, 100, default(Color), 3.5f); + int dustID = Dust.NewDust(new Vector2(codable.position.X - 2f, codable.position.Y - 2f), codable.width + 4, codable.height + 4, 135, codable.velocity.X * 0.4f, codable.velocity.Y * 0.4f, 100, default, 3.5f); Main.dust[dustID].noGravity = true; Main.dust[dustID].velocity *= 1.8f; Main.dust[dustID].velocity.Y -= 0.5f; - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Main.dust[dustID].noGravity = false; Main.dust[dustID].scale *= 0.5f; @@ -1906,11 +1906,11 @@ namespace CalamityMod { if (Main.rand.Next(4) != 0) { - int dustID = Dust.NewDust(codable.position - new Vector2(2f, 2f), codable.width + 4, codable.height + 4, 6, codable.velocity.X * 0.4f, codable.velocity.Y * 0.4f, 100, default(Color), 3.5f); + int dustID = Dust.NewDust(codable.position - new Vector2(2f, 2f), codable.width + 4, codable.height + 4, 6, codable.velocity.X * 0.4f, codable.velocity.Y * 0.4f, 100, default, 3.5f); Main.dust[dustID].noGravity = true; Main.dust[dustID].velocity *= 1.8f; Main.dust[dustID].velocity.Y -= 0.5f; - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Main.dust[dustID].noGravity = false; Main.dust[dustID].scale *= 0.5f; @@ -1932,14 +1932,14 @@ namespace CalamityMod { Vector2 position = codable.position; position.X -= 2f; position.Y -= 2f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { - int dustID = Dust.NewDust(position, codable.width + 4, codable.height + 2, 211, 0f, 0f, 50, default(Color), 0.8f); - if (Main.rand.Next(2) == 0) + int dustID = Dust.NewDust(position, codable.width + 4, codable.height + 2, 211, 0f, 0f, 50, default, 0.8f); + if (Main.rand.NextBool(2)) { Main.dust[dustID].alpha += 25; } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[dustID].alpha += 25; } @@ -1954,12 +1954,12 @@ namespace CalamityMod } else { - int dustID = Dust.NewDust(position, codable.width + 8, codable.height + 8, 211, 0f, 0f, 50, default(Color), 1.1f); - if (Main.rand.Next(2) == 0) + int dustID = Dust.NewDust(position, codable.width + 8, codable.height + 8, 211, 0f, 0f, 50, default, 1.1f); + if (Main.rand.NextBool(2)) { Main.dust[dustID].alpha += 25; } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[dustID].alpha += 25; } @@ -1980,16 +1980,16 @@ namespace CalamityMod Color newColor = new Color(0, 80, 255, 100); if (Main.rand.Next(4) != 0) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Vector2 position2 = codable.position; position2.X -= 2f; position2.Y -= 2f; int dustID = Dust.NewDust(position2, codable.width + 4, codable.height + 2, 4, 0f, 0f, alpha, newColor, 1.4f); - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[dustID].alpha += 25; } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[dustID].alpha += 25; } @@ -2012,11 +2012,11 @@ namespace CalamityMod { if (Main.rand.Next(4) != 0) { - int dustID = Dust.NewDust(codable.position - new Vector2(2f, 2f), codable.width + 4, codable.height + 4, 75, codable.velocity.X * 0.4f, codable.velocity.Y * 0.4f, 100, default(Color), 3.5f); + int dustID = Dust.NewDust(codable.position - new Vector2(2f, 2f), codable.width + 4, codable.height + 4, 75, codable.velocity.X * 0.4f, codable.velocity.Y * 0.4f, 100, default, 3.5f); Main.dust[dustID].noGravity = true; Main.dust[dustID].velocity *= 1.8f; Main.dust[dustID].velocity.Y -= 0.5f; - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Main.dust[dustID].noGravity = false; Main.dust[dustID].scale *= 0.5f; @@ -2047,9 +2047,9 @@ namespace CalamityMod if (bleed) { bool dead = (codable is Player ? ((Player)codable).dead : codable is NPC ? ((NPC)codable).life <= 0 : false); - if (effects && !dead && Main.rand.Next(30) == 0) + if (effects && !dead && Main.rand.NextBool(30)) { - int dustID = Dust.NewDust(codable.position, codable.width, codable.height, 5, 0f, 0f, 0, default(Color), 1f); + int dustID = Dust.NewDust(codable.position, codable.width, codable.height, 5, 0f, 0f, 0, default, 1f); Main.dust[dustID].velocity.Y += 0.5f; Main.dust[dustID].velocity *= 0.25f; if (codable is Player) @@ -2060,7 +2060,7 @@ namespace CalamityMod cg *= 0.9f; cb *= 0.9f; } - if (loveStruck && effects && shadow == 0f && Main.instance.IsActive && !Main.gamePaused && Main.rand.Next(5) == 0) + if (loveStruck && effects && shadow == 0f && Main.instance.IsActive && !Main.gamePaused && Main.rand.NextBool(5)) { Vector2 value = new Vector2((float)Main.rand.Next(-10, 11), (float)Main.rand.Next(-10, 11)); value.Normalize(); @@ -2078,12 +2078,12 @@ namespace CalamityMod { cr *= 0.7f; cb *= 0.55f; - if (effects && Main.rand.Next(5) == 0 && Main.instance.IsActive && !Main.gamePaused) + if (effects && Main.rand.NextBool(5) && Main.instance.IsActive && !Main.gamePaused) { Vector2 value2 = new Vector2((float)Main.rand.Next(-10, 11), (float)Main.rand.Next(-10, 11)); value2.Normalize(); value2.X *= 0.66f; value2.Y = Math.Abs(value2.Y); Vector2 vector = value2 * (float)Main.rand.Next(3, 5) * 0.25f; - int dustID = Dust.NewDust(codable.position, codable.width, codable.height, 188, vector.X, vector.Y * 0.5f, 100, default(Color), 1.5f); + int dustID = Dust.NewDust(codable.position, codable.width, codable.height, 188, vector.X, vector.Y * 0.5f, 100, default, 1.5f); Main.dust[dustID].velocity *= 0.1f; Main.dust[dustID].velocity.Y -= 0.5f; if (codable is Player) @@ -2102,9 +2102,9 @@ namespace CalamityMod } if (hunter && (codable is NPC ? ((NPC)codable).lifeMax > 1 : true)) { - if (effects && !Main.gamePaused && Main.instance.IsActive && Main.rand.Next(50) == 0) + if (effects && !Main.gamePaused && Main.instance.IsActive && Main.rand.NextBool(50)) { - int dustID = Dust.NewDust(codable.position, codable.width, codable.height, 15, 0f, 0f, 150, default(Color), 0.8f); + int dustID = Dust.NewDust(codable.position, codable.width, codable.height, 15, 0f, 0f, 150, default, 0.8f); Main.dust[dustID].velocity *= 0.1f; Main.dust[dustID].noLight = true; if (codable is Player) @@ -2155,9 +2155,11 @@ namespace CalamityMod Color lightColor = overrideColor != null ? (Color)overrideColor : GetLightColor(position + new Vector2(width * 0.5f, height * 0.5f)); if (sb is List) { - DrawData dd = new DrawData(texture, GetDrawPosition(position, origin, width, height, texture.Width, texture.Height, framecount, scale, drawCentered), frame, lightColor, rotation, origin, scale, direction == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); - dd.shader = shader; - ((List)sb).Add(dd); + DrawData dd = new DrawData(texture, GetDrawPosition(position, origin, width, height, texture.Width, texture.Height, framecount, scale, drawCentered), frame, lightColor, rotation, origin, scale, direction == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0) + { + shader = shader + }; + ((List)sb).Add(dd); } else if (sb is SpriteBatch) { @@ -2322,7 +2324,7 @@ namespace CalamityMod #region Update Server Boolean public static void UpdateServerBoolean() { - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); } #endregion diff --git a/Items/AbyssItems/TorrentialTear.cs b/Items/AbyssItems/TorrentialTear.cs index 317dd01df4..5207c9ab31 100644 --- a/Items/AbyssItems/TorrentialTear.cs +++ b/Items/AbyssItems/TorrentialTear.cs @@ -38,44 +38,44 @@ namespace CalamityMod.Items.AbyssItems int num = 86400; int num2 = num / 24; Main.rainTime = Main.rand.Next(num2 * 8, num); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Main.rainTime += Main.rand.Next(0, num2); } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Main.rainTime += Main.rand.Next(0, num2 * 2); } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Main.rainTime += Main.rand.Next(0, num2 * 2); } - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) { Main.rainTime += Main.rand.Next(0, num2 * 3); } - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { Main.rainTime += Main.rand.Next(0, num2 * 4); } - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { Main.rainTime += Main.rand.Next(0, num2 * 5); } float num3 = 1f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { num3 += 0.05f; } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { num3 += 0.1f; } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { num3 += 0.15f; } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { num3 += 0.2f; } diff --git a/Items/Accessories/AmalgamatedBrain.cs b/Items/Accessories/AmalgamatedBrain.cs index b7ee953d74..9b79098e64 100644 --- a/Items/Accessories/AmalgamatedBrain.cs +++ b/Items/Accessories/AmalgamatedBrain.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Accessories modPlayer.aBrain = true; if (player.immune) { - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { if (player.whoAmI == Main.myPlayer) { diff --git a/Items/Accessories/BadgeofBravery.cs b/Items/Accessories/BadgeofBravery.cs index 84e9114cbf..6c148bf56d 100644 --- a/Items/Accessories/BadgeofBravery.cs +++ b/Items/Accessories/BadgeofBravery.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Items.Accessories public override void OnCraft(Recipe recipe) { - if (Main.rand.Next(40) == 0) + if (Main.rand.NextBool(40)) recipe.createItem.type = mod.ItemType("SamuraiBadge"); else recipe.createItem.type = item.type; diff --git a/Items/Accessories/HeartoftheElements.cs b/Items/Accessories/HeartoftheElements.cs index a52decf7d0..f735f65301 100644 --- a/Items/Accessories/HeartoftheElements.cs +++ b/Items/Accessories/HeartoftheElements.cs @@ -125,7 +125,7 @@ namespace CalamityMod.Items.Accessories Main.tile[num4, num5].halfBrick(false); if (Main.tile[num4, num5 + 1].type == 0) { - if (Main.rand.Next(1000) == 0) + if (Main.rand.NextBool(1000)) { Main.tile[num4, num5].active(true); Main.tile[num4, num5].type = 227; @@ -135,14 +135,14 @@ namespace CalamityMod.Items.Accessories Main.tile[num4, num5].frameX = (short)(34 * Main.rand.Next(1, 13)); } } - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { NetMessage.SendTileSquare(-1, num4, num5, 1, TileChangeType.None); } } if (Main.tile[num4, num5 + 1].type == 2) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.tile[num4, num5].active(true); Main.tile[num4, num5].type = 3; @@ -162,14 +162,14 @@ namespace CalamityMod.Items.Accessories Main.tile[num4, num5].frameX = (short)(18 * Main.rand.Next(6, 21)); } } - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { NetMessage.SendTileSquare(-1, num4, num5, 1, TileChangeType.None); } } else if (Main.tile[num4, num5 + 1].type == 109) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.tile[num4, num5].active(true); Main.tile[num4, num5].type = 110; @@ -189,7 +189,7 @@ namespace CalamityMod.Items.Accessories Main.tile[num4, num5].frameX = (short)(18 * Main.rand.Next(2, 8)); } } - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { NetMessage.SendTileSquare(-1, num4, num5, 1, TileChangeType.None); } @@ -199,7 +199,7 @@ namespace CalamityMod.Items.Accessories Main.tile[num4, num5].active(true); Main.tile[num4, num5].type = 74; Main.tile[num4, num5].frameX = (short)(18 * Main.rand.Next(9, 17)); - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { NetMessage.SendTileSquare(-1, num4, num5, 1, TileChangeType.None); } diff --git a/Items/Accessories/PlagueHive.cs b/Items/Accessories/PlagueHive.cs index 4a956d877a..e4bd22bf3c 100644 --- a/Items/Accessories/PlagueHive.cs +++ b/Items/Accessories/PlagueHive.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Items.Accessories if (flag) { nPC.StrikeNPC(num3, 0f, 0, false, false, false); - if (Main.netMode != 0) + if (Main.netMode != NetmodeID.SinglePlayer) { NetMessage.SendData(28, -1, -1, null, l, (float)num3, 0f, 0f, 0, 0, 0); } diff --git a/Items/Accessories/TheAmalgam.cs b/Items/Accessories/TheAmalgam.cs index 5b5d82844f..878a6cb227 100644 --- a/Items/Accessories/TheAmalgam.cs +++ b/Items/Accessories/TheAmalgam.cs @@ -89,7 +89,7 @@ namespace CalamityMod.Items.Accessories } if (player.immune) { - if (Main.rand.Next(20) == 0) + if (Main.rand.NextBool(20)) { if (player.whoAmI == Main.myPlayer) { @@ -106,7 +106,7 @@ namespace CalamityMod.Items.Accessories num18 = (float)num17 / num18; num15 *= num18; num16 *= num18; - int type = (Main.rand.Next(2) == 0 ? mod.ProjectileType("AuraRain") : mod.ProjectileType("StandingFire")); + int type = (Main.rand.NextBool(2) ? mod.ProjectileType("AuraRain") : mod.ProjectileType("StandingFire")); int num19 = Projectile.NewProjectile(x, y, num15, num16, type, 2000, 1f, player.whoAmI, 0f, 0f); Main.projectile[num19].tileCollide = false; } @@ -136,7 +136,7 @@ namespace CalamityMod.Items.Accessories if (flag) { nPC.StrikeNPC(num3, 0f, 0, false, false, false); - if (Main.netMode != 0) + if (Main.netMode != NetmodeID.SinglePlayer) { NetMessage.SendData(28, -1, -1, null, l, (float)num3, 0f, 0f, 0, 0, 0); } diff --git a/Items/Accessories/VoidofExtinction.cs b/Items/Accessories/VoidofExtinction.cs index 5600f99c26..e445e7ed2c 100644 --- a/Items/Accessories/VoidofExtinction.cs +++ b/Items/Accessories/VoidofExtinction.cs @@ -67,7 +67,7 @@ namespace CalamityMod.Items.Accessories } if (player.immune) { - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { if (player.whoAmI == Main.myPlayer) { diff --git a/Items/Accessories/Wings/AureateWings.cs b/Items/Accessories/Wings/AureateWings.cs index 9935aca1f5..3396cdb208 100644 --- a/Items/Accessories/Wings/AureateWings.cs +++ b/Items/Accessories/Wings/AureateWings.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Items.Accessories.Wings { num68 += player.velocity.Y; } - int num69 = Dust.NewDust(new Vector2(x, num68), 8, 8, type, 0f, 0f, alpha, default(Color), scale); + int num69 = Dust.NewDust(new Vector2(x, num68), 8, 8, type, 0f, 0f, alpha, default, scale); Dust expr_5A11_cp_0_cp_0 = Main.dust[num69]; expr_5A11_cp_0_cp_0.velocity.X = expr_5A11_cp_0_cp_0.velocity.X * 0.1f; Main.dust[num69].velocity.Y = Main.dust[num69].velocity.Y * 1f + 2f * player.gravDir - player.velocity.Y * 0.3f; diff --git a/Items/Accessories/Wings/CelestialTracers.cs b/Items/Accessories/Wings/CelestialTracers.cs index 39dcf1902a..cafbdcfbd1 100644 --- a/Items/Accessories/Wings/CelestialTracers.cs +++ b/Items/Accessories/Wings/CelestialTracers.cs @@ -42,10 +42,10 @@ namespace CalamityMod.Items.Accessories.Wings { num59 = -40; } - int num60 = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)num59, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, 91, 0f, 0f, 100, default(Color), 2.4f); + int num60 = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)num59, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, 91, 0f, 0f, 100, default, 2.4f); Main.dust[num60].noGravity = true; Main.dust[num60].velocity *= 0.3f; - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { Main.dust[num60].fadeIn = 2f; } diff --git a/Items/Accessories/Wings/DiscordianWings.cs b/Items/Accessories/Wings/DiscordianWings.cs index 8ffbbd0c27..0081b59f19 100644 --- a/Items/Accessories/Wings/DiscordianWings.cs +++ b/Items/Accessories/Wings/DiscordianWings.cs @@ -37,10 +37,10 @@ namespace CalamityMod.Items.Accessories.Wings { num59 = -40; } - int num60 = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)num59, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, 6, 0f, 0f, 100, default(Color), 2.4f); + int num60 = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)num59, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, 6, 0f, 0f, 100, default, 2.4f); Main.dust[num60].noGravity = true; Main.dust[num60].velocity *= 0.3f; - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { Main.dust[num60].fadeIn = 2f; } diff --git a/Items/Accessories/Wings/DrewsWings.cs b/Items/Accessories/Wings/DrewsWings.cs index 477f638e91..f34a7d6c1f 100644 --- a/Items/Accessories/Wings/DrewsWings.cs +++ b/Items/Accessories/Wings/DrewsWings.cs @@ -37,10 +37,10 @@ namespace CalamityMod.Items.Accessories.Wings { num59 = -40; } - int num60 = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)num59, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, 91, 0f, 0f, 100, default(Color), 2.4f); + int num60 = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)num59, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, 91, 0f, 0f, 100, default, 2.4f); Main.dust[num60].noGravity = true; Main.dust[num60].velocity *= 0.3f; - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { Main.dust[num60].fadeIn = 2f; } diff --git a/Items/Accessories/Wings/ElysianTracers.cs b/Items/Accessories/Wings/ElysianTracers.cs index ad7ecdb62e..7db692d9b3 100644 --- a/Items/Accessories/Wings/ElysianTracers.cs +++ b/Items/Accessories/Wings/ElysianTracers.cs @@ -42,10 +42,10 @@ namespace CalamityMod.Items.Accessories.Wings { num59 = -40; } - int num60 = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)num59, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, (Main.rand.Next(2) == 0 ? 206 : 173), 0f, 0f, 100, default(Color), 2.4f); + int num60 = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)num59, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, (Main.rand.NextBool(2) ? 206 : 173), 0f, 0f, 100, default, 2.4f); Main.dust[num60].noGravity = true; Main.dust[num60].velocity *= 0.3f; - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { Main.dust[num60].fadeIn = 2f; } diff --git a/Items/Accessories/Wings/HadarianWings.cs b/Items/Accessories/Wings/HadarianWings.cs index ef7ca30c2a..db89e9b919 100644 --- a/Items/Accessories/Wings/HadarianWings.cs +++ b/Items/Accessories/Wings/HadarianWings.cs @@ -49,10 +49,10 @@ namespace CalamityMod.Items.Accessories.Wings { num59 = -40; } - int num60 = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)num59, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 1.75f); + int num60 = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)num59, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 1.75f); Main.dust[num60].noGravity = true; Main.dust[num60].velocity *= 0.3f; - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { Main.dust[num60].fadeIn = 2f; } diff --git a/Items/Accessories/Wings/InfinityBoots.cs b/Items/Accessories/Wings/InfinityBoots.cs index 748f383c54..4a02fbcad0 100644 --- a/Items/Accessories/Wings/InfinityBoots.cs +++ b/Items/Accessories/Wings/InfinityBoots.cs @@ -42,10 +42,10 @@ namespace CalamityMod.Items.Accessories.Wings { num59 = -40; } - int num60 = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)num59, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, 107, 0f, 0f, 100, default(Color), 2.4f); + int num60 = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)num59, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, 107, 0f, 0f, 100, default, 2.4f); Main.dust[num60].noGravity = true; Main.dust[num60].velocity *= 0.3f; - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { Main.dust[num60].fadeIn = 2f; } diff --git a/Items/Accessories/Wings/MOAB.cs b/Items/Accessories/Wings/MOAB.cs index 46f806de5b..9416bf3703 100644 --- a/Items/Accessories/Wings/MOAB.cs +++ b/Items/Accessories/Wings/MOAB.cs @@ -72,7 +72,7 @@ namespace CalamityMod.Items.Accessories.Wings { num68 += player.velocity.Y; } - int num69 = Dust.NewDust(new Vector2(x, num68), 8, 8, type, 0f, 0f, alpha, default(Color), scale); + int num69 = Dust.NewDust(new Vector2(x, num68), 8, 8, type, 0f, 0f, alpha, default, scale); Dust expr_5A11_cp_0_cp_0 = Main.dust[num69]; expr_5A11_cp_0_cp_0.velocity.X = expr_5A11_cp_0_cp_0.velocity.X * 0.1f; Main.dust[num69].velocity.Y = Main.dust[num69].velocity.Y * 1f + 2f * player.gravDir - player.velocity.Y * 0.3f; diff --git a/Items/Accessories/Wings/StarlightWings.cs b/Items/Accessories/Wings/StarlightWings.cs index 764c4b0b0a..a69168f23c 100644 --- a/Items/Accessories/Wings/StarlightWings.cs +++ b/Items/Accessories/Wings/StarlightWings.cs @@ -37,10 +37,10 @@ namespace CalamityMod.Items.Accessories.Wings { num59 = -40; } - int num60 = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)num59, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, 173, 0f, 0f, 100, default(Color), 2.4f); + int num60 = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)num59, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, 173, 0f, 0f, 100, default, 2.4f); Main.dust[num60].noGravity = true; Main.dust[num60].velocity *= 0.3f; - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { Main.dust[num60].fadeIn = 2f; } diff --git a/Items/Accessories/Wings/TarragonWings.cs b/Items/Accessories/Wings/TarragonWings.cs index 055976f5fa..ad79051b41 100644 --- a/Items/Accessories/Wings/TarragonWings.cs +++ b/Items/Accessories/Wings/TarragonWings.cs @@ -48,10 +48,10 @@ namespace CalamityMod.Items.Accessories.Wings { num59 = -40; } - int num60 = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)num59, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, 75, 0f, 0f, 100, default(Color), 2.4f); + int num60 = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)num59, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, 75, 0f, 0f, 100, default, 2.4f); Main.dust[num60].noGravity = true; Main.dust[num60].velocity *= 0.3f; - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { Main.dust[num60].fadeIn = 2f; } diff --git a/Items/Accessories/Wings/XerocWings.cs b/Items/Accessories/Wings/XerocWings.cs index 2482757cfb..ea60d86f16 100644 --- a/Items/Accessories/Wings/XerocWings.cs +++ b/Items/Accessories/Wings/XerocWings.cs @@ -37,10 +37,10 @@ namespace CalamityMod.Items.Accessories.Wings { num59 = -40; } - int num60 = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)num59, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, 242, 0f, 0f, 100, default(Color), 2.4f); + int num60 = Dust.NewDust(new Vector2(player.position.X + (float)(player.width / 2) + (float)num59, player.position.Y + (float)(player.height / 2) - 15f), 30, 30, 242, 0f, 0f, 100, default, 2.4f); Main.dust[num60].noGravity = true; Main.dust[num60].velocity *= 0.3f; - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { Main.dust[num60].fadeIn = 2f; } diff --git a/Items/Amidias/CoralCannon.cs b/Items/Amidias/CoralCannon.cs index f2805f5f22..069b4d70c8 100644 --- a/Items/Amidias/CoralCannon.cs +++ b/Items/Amidias/CoralCannon.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Items.Amidias public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("BigCoral"), (int)((double)damage * 2.0), knockBack * 2f, player.whoAmI, 0.0f, 0.0f); } diff --git a/Items/Armor/AuricTeslaSpaceHelmet.cs b/Items/Armor/AuricTeslaSpaceHelmet.cs index 95d6873666..8bcd7c0427 100644 --- a/Items/Armor/AuricTeslaSpaceHelmet.cs +++ b/Items/Armor/AuricTeslaSpaceHelmet.cs @@ -100,7 +100,7 @@ namespace CalamityMod.Items.Armor } int damage = (int)(35 * ((player.minionDamage * 5 / 3) + ((player.minionDamage * 0.46f) * (maxMinionScale - 1)))); Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default(Vector2)); + Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default); Vector2 vector3 = Main.MouseWorld - vector2; float velX = (float)Main.mouseX + Main.screenPosition.X - vector2.X; float velY = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; diff --git a/Items/Armor/GodSlayerHornedHelm.cs b/Items/Armor/GodSlayerHornedHelm.cs index bca4600f9f..b9b082f669 100644 --- a/Items/Armor/GodSlayerHornedHelm.cs +++ b/Items/Armor/GodSlayerHornedHelm.cs @@ -70,7 +70,7 @@ namespace CalamityMod.Items.Armor } int damage = (int)(35 * ((player.minionDamage * 5 / 3) + ((player.minionDamage * 0.46f) * (maxMinionScale - 1)))); Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default(Vector2)); + Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default); Vector2 vector3 = Main.MouseWorld - vector2; float velX = (float)Main.mouseX + Main.screenPosition.X - vector2.X; float velY = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; diff --git a/Items/Astrageldon/AstralChunk.cs b/Items/Astrageldon/AstralChunk.cs index 3da892a0d2..31b6d0268e 100644 --- a/Items/Astrageldon/AstralChunk.cs +++ b/Items/Astrageldon/AstralChunk.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Astrageldon public override bool UseItem(Player player) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int num = NPC.NewNPC((int)(player.position.X + (float)(Main.rand.Next(-50, 50))), (int)(player.position.Y - 150f), mod.NPCType("Astrageldon"), 0, 0f, 0f, 0f, 0f, 255); Main.PlaySound(SoundID.Roar, player.position, 0); diff --git a/Items/Calamitas/CalamityRing.cs b/Items/Calamitas/CalamityRing.cs index 843e8e6160..a163bd1a6a 100644 --- a/Items/Calamitas/CalamityRing.cs +++ b/Items/Calamitas/CalamityRing.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Calamitas { if (player.immune) { - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { for (int l = 0; l < 1; l++) { diff --git a/Items/CalamityCustomThrowingDamage/EmpyreanKnivesThrown.cs b/Items/CalamityCustomThrowingDamage/EmpyreanKnivesThrown.cs index 318122802a..43dde3910d 100644 --- a/Items/CalamityCustomThrowingDamage/EmpyreanKnivesThrown.cs +++ b/Items/CalamityCustomThrowingDamage/EmpyreanKnivesThrown.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Items.CalamityCustomThrowingDamage { float num72 = item.shootSpeed; Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default(Vector2)); + Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default); Vector2 vector3 = Main.MouseWorld - vector2; float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; @@ -62,19 +62,19 @@ namespace CalamityMod.Items.CalamityCustomThrowingDamage num78 *= num80; num79 *= num80; int num146 = 4; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { num146++; } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { num146++; } - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { num146++; } - if (Main.rand.Next(16) == 0) + if (Main.rand.NextBool(16)) { num146++; } diff --git a/Items/CalamityCustomThrowingDamage/RoyalKnives.cs b/Items/CalamityCustomThrowingDamage/RoyalKnives.cs index 46a876fd8c..430cb1042a 100644 --- a/Items/CalamityCustomThrowingDamage/RoyalKnives.cs +++ b/Items/CalamityCustomThrowingDamage/RoyalKnives.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Items.CalamityCustomThrowingDamage { float num72 = item.shootSpeed; Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default(Vector2)); + Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default); Vector2 vector3 = Main.MouseWorld - vector2; float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; @@ -62,19 +62,19 @@ namespace CalamityMod.Items.CalamityCustomThrowingDamage num78 *= num80; num79 *= num80; int num146 = 4; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { num146++; } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { num146++; } - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { num146++; } - if (Main.rand.Next(16) == 0) + if (Main.rand.NextBool(16)) { num146++; } diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index a20baaafc8..c4fbc88813 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -193,7 +193,7 @@ namespace CalamityMod.Items } if (player.GetModPlayer(mod).ataxiaBolt) { - if (item.ranged && !rogue && Main.rand.Next(2) == 0) + if (item.ranged && !rogue && Main.rand.NextBool(2)) { if (player.whoAmI == Main.myPlayer) { @@ -213,7 +213,7 @@ namespace CalamityMod.Items } if (player.GetModPlayer(mod).ataxiaVolley) { - if (rogue && Main.rand.Next(10) == 0) + if (rogue && Main.rand.NextBool(10)) { if (player.whoAmI == Main.myPlayer) { @@ -246,7 +246,7 @@ namespace CalamityMod.Items if (player.GetModPlayer(mod).victideSet) { if ((item.ranged || item.melee || item.magic || - rogue || item.summon) && item.rare < 8 && Main.rand.Next(10) == 0) + rogue || item.summon) && item.rare < 8 && Main.rand.NextBool(10)) { if (player.whoAmI == Main.myPlayer) { @@ -1865,13 +1865,13 @@ namespace CalamityMod.Items int y = Main.rand.Next(100, 300); // Pick a random side: left or right - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) x -= Main.LogicCheckScreenWidth / 2 + x; else x += Main.LogicCheckScreenWidth / 2 - x; // Pick a random side: top or bottom - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) y -= Main.LogicCheckScreenHeight / 2 + y; else y += Main.LogicCheckScreenHeight / 2 - y; @@ -1950,13 +1950,13 @@ namespace CalamityMod.Items } } - if (player.ammoBox && Main.rand.Next(5) == 0) + if (player.ammoBox && Main.rand.NextBool(5)) dontConsumeAmmo = true; - if (player.ammoPotion && Main.rand.Next(5) == 0) + if (player.ammoPotion && Main.rand.NextBool(5)) dontConsumeAmmo = true; - if (player.ammoCost80 && Main.rand.Next(5) == 0) + if (player.ammoCost80 && Main.rand.NextBool(5)) dontConsumeAmmo = true; - if (player.ammoCost75 && Main.rand.Next(4) == 0) + if (player.ammoCost75 && Main.rand.NextBool(4)) dontConsumeAmmo = true; if (!dontConsumeAmmo && itemAmmo.consumable) diff --git a/Items/Crabulon/DecapoditaSprout.cs b/Items/Crabulon/DecapoditaSprout.cs index 424be2b222..08a38bcc8d 100644 --- a/Items/Crabulon/DecapoditaSprout.cs +++ b/Items/Crabulon/DecapoditaSprout.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Crabulon public override bool UseItem(Player player) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { NPC.NewNPC((int)(player.position.X + (float)(Main.rand.Next(-50, 51))), (int)(player.position.Y - 50f), mod.NPCType("CrabulonIdle"), 0, 0f, 0f, 0f, 0f, 255); Main.PlaySound(SoundID.Roar, player.position, 0); diff --git a/Items/DifficultyItems/Armageddon.cs b/Items/DifficultyItems/Armageddon.cs index 23fc9b770a..c2cad181bb 100644 --- a/Items/DifficultyItems/Armageddon.cs +++ b/Items/DifficultyItems/Armageddon.cs @@ -63,11 +63,11 @@ namespace CalamityMod.Items.DifficultyItems } string key = CalamityWorld.armageddon ? "Mods.CalamityMod.ArmageddonText" : "Mods.CalamityMod.ArmageddonText2"; Color messageColor = Color.Fuchsia; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } diff --git a/Items/DifficultyItems/Death.cs b/Items/DifficultyItems/Death.cs index 697d7e67f7..6d184ea179 100644 --- a/Items/DifficultyItems/Death.cs +++ b/Items/DifficultyItems/Death.cs @@ -57,11 +57,11 @@ namespace CalamityMod.Items.DifficultyItems CalamityWorld.death = true; string key = "Mods.CalamityMod.DeathText"; Color messageColor = Color.Crimson; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -71,11 +71,11 @@ namespace CalamityMod.Items.DifficultyItems CalamityWorld.death = false; string key = "Mods.CalamityMod.DeathText2"; Color messageColor = Color.Crimson; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } diff --git a/Items/DifficultyItems/DefiledRune.cs b/Items/DifficultyItems/DefiledRune.cs index 9265cc75bd..144677a958 100644 --- a/Items/DifficultyItems/DefiledRune.cs +++ b/Items/DifficultyItems/DefiledRune.cs @@ -58,11 +58,11 @@ namespace CalamityMod.Items.DifficultyItems CalamityWorld.defiled = true; string key = "Mods.CalamityMod.DefiledText"; Color messageColor = Color.DarkSeaGreen; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -72,11 +72,11 @@ namespace CalamityMod.Items.DifficultyItems CalamityWorld.defiled = false; string key = "Mods.CalamityMod.DefiledText2"; Color messageColor = Color.DarkSeaGreen; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } diff --git a/Items/DifficultyItems/IronHeart.cs b/Items/DifficultyItems/IronHeart.cs index 5b7827d4b2..f934fa98f5 100644 --- a/Items/DifficultyItems/IronHeart.cs +++ b/Items/DifficultyItems/IronHeart.cs @@ -56,11 +56,11 @@ namespace CalamityMod.Items.DifficultyItems CalamityWorld.ironHeart = true; string key = "Mods.CalamityMod.IronHeartText"; Color messageColor = Color.LightSkyBlue; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -70,11 +70,11 @@ namespace CalamityMod.Items.DifficultyItems CalamityWorld.ironHeart = false; string key = "Mods.CalamityMod.IronHeartText2"; Color messageColor = Color.LightSkyBlue; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } diff --git a/Items/DifficultyItems/Revenge.cs b/Items/DifficultyItems/Revenge.cs index 70a8382c12..922033f5e3 100644 --- a/Items/DifficultyItems/Revenge.cs +++ b/Items/DifficultyItems/Revenge.cs @@ -65,11 +65,11 @@ namespace CalamityMod.Items.DifficultyItems CalamityWorld.revenge = true; string key = "Mods.CalamityMod.RevengeText"; Color messageColor = Color.Crimson; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -81,11 +81,11 @@ namespace CalamityMod.Items.DifficultyItems CalamityWorld.revenge = false; string key = "Mods.CalamityMod.RevengeText2"; Color messageColor = Color.Crimson; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -95,11 +95,11 @@ namespace CalamityMod.Items.DifficultyItems CalamityWorld.death = false; key = "Mods.CalamityMod.DeathText2"; messageColor = Color.Crimson; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -109,11 +109,11 @@ namespace CalamityMod.Items.DifficultyItems CalamityWorld.defiled = false; key = "Mods.CalamityMod.DefiledText2"; messageColor = Color.DarkSeaGreen; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } diff --git a/Items/HiveMind/RottenBrain.cs b/Items/HiveMind/RottenBrain.cs index 518af3684c..83c3008a2e 100644 --- a/Items/HiveMind/RottenBrain.cs +++ b/Items/HiveMind/RottenBrain.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.HiveMind { if (player.immune) { - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { if (player.whoAmI == Main.myPlayer) { diff --git a/Items/HiveMind/Teratoma.cs b/Items/HiveMind/Teratoma.cs index bed2f33580..b5d2362a7b 100644 --- a/Items/HiveMind/Teratoma.cs +++ b/Items/HiveMind/Teratoma.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.HiveMind public override bool UseItem(Player player) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int num = NPC.NewNPC((int)(player.position.X + (float)(Main.rand.Next(-100, 100))), (int)(player.position.Y - 150f), mod.NPCType("HiveMind"), 0, 0f, 0f, 0f, 0f, 255); Main.PlaySound(SoundID.Roar, player.position, 0); diff --git a/Items/Leviathan/LeviathanAmbergris.cs b/Items/Leviathan/LeviathanAmbergris.cs index 950847ea02..b9fa064c34 100644 --- a/Items/Leviathan/LeviathanAmbergris.cs +++ b/Items/Leviathan/LeviathanAmbergris.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Items.Leviathan if (flag) { nPC.StrikeNPC(num3, 0f, 0, false, false, false); - if (Main.netMode != 0) + if (Main.netMode != NetmodeID.SinglePlayer) { NetMessage.SendData(28, -1, -1, null, l, (float)num3, 0f, 0f, 0, 0, 0); } diff --git a/Items/LoreItems/KnowledgeBrainofCthulhu.cs b/Items/LoreItems/KnowledgeBrainofCthulhu.cs index 329f6eb07b..07538f7459 100644 --- a/Items/LoreItems/KnowledgeBrainofCthulhu.cs +++ b/Items/LoreItems/KnowledgeBrainofCthulhu.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Items.LoreItems { player.statLife -= player.statLifeMax2 / 7; PlayerDeathReason damageSource = PlayerDeathReason.ByOther(13); - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { damageSource = PlayerDeathReason.ByOther(player.Male ? 14 : 15); } diff --git a/Items/Mounts/AngryDog.cs b/Items/Mounts/AngryDog.cs index 9a403e66a0..5c5d00c12e 100644 --- a/Items/Mounts/AngryDog.cs +++ b/Items/Mounts/AngryDog.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Items.Mounts mountData.swimFrameCount = mountData.inAirFrameCount; mountData.swimFrameDelay = mountData.inAirFrameDelay; mountData.swimFrameStart = mountData.inAirFrameStart; - if (Main.netMode != 2) + if (Main.netMode != NetmodeID.Server) { mountData.textureWidth = mountData.backTexture.Width; mountData.textureHeight = mountData.backTexture.Height; @@ -81,7 +81,7 @@ namespace CalamityMod.Items.Mounts { for (int i = 0; i < 2; i++) { - Dust expr_631 = Main.dust[Dust.NewDust(mountedPlayer.BottomLeft, mountedPlayer.width, 6, 192, 0f, 0f, 0, default(Color), 1f)]; + Dust expr_631 = Main.dust[Dust.NewDust(mountedPlayer.BottomLeft, mountedPlayer.width, 6, 192, 0f, 0f, 0, default, 1f)]; expr_631.velocity = new Vector2(velocity.X * 0.15f, Main.rand.NextFloat() * -2f); expr_631.noLight = true; expr_631.scale = 0.2f + Main.rand.NextFloat() * 0.8f; @@ -99,7 +99,7 @@ namespace CalamityMod.Items.Mounts { for (int j = 0; j < (int)(3f * mountedPlayer.basiliskCharge); j++) { - Dust dust = Main.dust[Dust.NewDust(mountedPlayer.BottomLeft, mountedPlayer.width, 6, 67, 0f, 0f, 0, default(Color), 1f)]; + Dust dust = Main.dust[Dust.NewDust(mountedPlayer.BottomLeft, mountedPlayer.width, 6, 67, 0f, 0f, 0, default, 1f)]; Vector2 value2 = mountedPlayer.Center + new Vector2(num10 * num12, num11); dust.position = mountedPlayer.Center + new Vector2(num10 * (num12 - 2f), num11 - 6f + Main.rand.NextFloat() * 12f); dust.velocity = (dust.position - value2).SafeNormalize(Vector2.Zero) * (3.5f + Main.rand.NextFloat() * 0.5f); diff --git a/Items/Mounts/Crysthamyr.cs b/Items/Mounts/Crysthamyr.cs index a381bd197a..0480075b2a 100644 --- a/Items/Mounts/Crysthamyr.cs +++ b/Items/Mounts/Crysthamyr.cs @@ -64,7 +64,7 @@ namespace CalamityMod.Items.Mounts mountData.swimFrameCount = mountData.inAirFrameCount; mountData.swimFrameDelay = mountData.runningFrameDelay; mountData.swimFrameStart = mountData.inAirFrameStart; - if (Main.netMode != 2) + if (Main.netMode != NetmodeID.Server) { mountData.frontTextureExtra = mod.GetTexture("Items/Mounts/CrysthamyrExtra"); mountData.textureWidth = mountData.backTexture.Width; @@ -96,11 +96,11 @@ namespace CalamityMod.Items.Mounts { for (int i = 0; i < 2; i++) { - int dust = Dust.NewDust(new Vector2(rect.X, rect.Y), rect.Width, rect.Height, rand, 0, 0, 0, default(Color)); + int dust = Dust.NewDust(new Vector2(rect.X, rect.Y), rect.Width, rect.Height, rand, 0, 0, 0, default); Main.dust[dust].noGravity = true; } } - int dust2 = Dust.NewDust(new Vector2(rect.X, rect.Y), rect.Width, rect.Height, rand, 0, 0, 0, default(Color)); + int dust2 = Dust.NewDust(new Vector2(rect.X, rect.Y), rect.Width, rect.Height, rand, 0, 0, 0, default); Main.dust[dust2].noGravity = true; } if (player.velocity.Y != 0f) diff --git a/Items/Mounts/Fab.cs b/Items/Mounts/Fab.cs index 0e3256733b..becba3d090 100644 --- a/Items/Mounts/Fab.cs +++ b/Items/Mounts/Fab.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Items.Mounts mountData.swimFrameCount = mountData.inAirFrameCount; mountData.swimFrameDelay = mountData.inAirFrameDelay; mountData.swimFrameStart = mountData.inAirFrameStart; - if (Main.netMode != 2) + if (Main.netMode != NetmodeID.Server) { mountData.frontTextureExtra = mod.GetTexture("Items/Mounts/FabExtra"); mountData.textureWidth = mountData.backTexture.Width; diff --git a/Items/Mounts/OnyxExcavator.cs b/Items/Mounts/OnyxExcavator.cs index 65578baa42..16fee988ce 100644 --- a/Items/Mounts/OnyxExcavator.cs +++ b/Items/Mounts/OnyxExcavator.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Items.Mounts mountData.swimFrameCount = mountData.inAirFrameCount; mountData.swimFrameDelay = mountData.inAirFrameDelay; mountData.swimFrameStart = mountData.inAirFrameStart; - if (Main.netMode != 2) + if (Main.netMode != NetmodeID.Server) { mountData.backTextureExtra = mod.GetTexture("Items/Mounts/OnyxExcavatorExtra"); mountData.frontTextureExtra = mod.GetTexture("Items/Mounts/OnyxExcavatorExtra2"); @@ -72,7 +72,7 @@ namespace CalamityMod.Items.Mounts { for (int i = 0; i < 2; i++) { - Dust expr_631 = Main.dust[Dust.NewDust(mountedPlayer.BottomLeft, mountedPlayer.width, 6, 192, 0f, 0f, 0, default(Color), 1f)]; + Dust expr_631 = Main.dust[Dust.NewDust(mountedPlayer.BottomLeft, mountedPlayer.width, 6, 192, 0f, 0f, 0, default, 1f)]; expr_631.velocity = new Vector2(velocity.X * 0.15f, Main.rand.NextFloat() * -2f); expr_631.noLight = true; expr_631.scale = 0.2f + Main.rand.NextFloat() * 0.8f; @@ -148,7 +148,7 @@ namespace CalamityMod.Items.Mounts !player.noBuilding && tile.type != TileID.ElderCrystalStand) { WorldGen.KillTile(num824, num825, false, false, false); - if (!Main.tile[num824, num825].active() && Main.netMode != 0) + if (!Main.tile[num824, num825].active() && Main.netMode != NetmodeID.SinglePlayer) { NetMessage.SendData(17, -1, -1, null, 0, (float)num824, (float)num825, 0f, 0, 0, 0); } diff --git a/Items/Mounts/PhuppersChair.cs b/Items/Mounts/PhuppersChair.cs index f885fcd990..db1758f2a0 100644 --- a/Items/Mounts/PhuppersChair.cs +++ b/Items/Mounts/PhuppersChair.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Items.Mounts mountData.swimFrameCount = 4; mountData.swimFrameDelay = 4; mountData.swimFrameStart = 0; - if (Main.netMode != 2) + if (Main.netMode != NetmodeID.Server) { mountData.textureWidth = mountData.backTexture.Width; mountData.textureHeight = mountData.backTexture.Height; diff --git a/Items/Mounts/SquishyBean.cs b/Items/Mounts/SquishyBean.cs index 5a27ba9f37..160183f394 100644 --- a/Items/Mounts/SquishyBean.cs +++ b/Items/Mounts/SquishyBean.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Items.Mounts mountData.swimFrameCount = mountData.inAirFrameCount; mountData.swimFrameDelay = mountData.inAirFrameDelay; mountData.swimFrameStart = mountData.inAirFrameStart; - if (Main.netMode != 2) + if (Main.netMode != NetmodeID.Server) { mountData.textureWidth = mountData.backTexture.Width; mountData.textureHeight = mountData.backTexture.Height; diff --git a/Items/Patreon/Ataraxia.cs b/Items/Patreon/Ataraxia.cs index 30fb524c1e..cbff686094 100644 --- a/Items/Patreon/Ataraxia.cs +++ b/Items/Patreon/Ataraxia.cs @@ -57,8 +57,8 @@ namespace CalamityMod.Items.Patreon speed.Normalize(); speed *= 22f; Vector2 rrp = player.RotatedRelativePoint(player.MountedCenter, true); - Vector2 leftOffset = speed.RotatedBy((double)(MathHelper.PiOver4), default(Vector2)); - Vector2 rightOffset = speed.RotatedBy((double)(-MathHelper.PiOver4), default(Vector2)); + Vector2 leftOffset = speed.RotatedBy((double)(MathHelper.PiOver4), default); + Vector2 rightOffset = speed.RotatedBy((double)(-MathHelper.PiOver4), default); leftOffset -= 1.4f * speed; rightOffset -= 1.4f * speed; Projectile.NewProjectile(rrp.X + leftOffset.X, rrp.Y + leftOffset.Y, speedX, speedY, sideID, sideDamage, knockBack, player.whoAmI, 0.0f, 0.0f); diff --git a/Items/Patreon/LightGodsBrilliance.cs b/Items/Patreon/LightGodsBrilliance.cs index 25ebdfbef9..5e08148372 100644 --- a/Items/Patreon/LightGodsBrilliance.cs +++ b/Items/Patreon/LightGodsBrilliance.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Patreon float SpeedY = speedY + (float) Main.rand.Next(-50, 51) * 0.05f; Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, (int)((double)damage), knockBack, player.whoAmI, 0.0f, 0.0f); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("LightBall"), (int)((double)damage * 2.0), knockBack, player.whoAmI, 0.0f, 0.0f); } diff --git a/Items/Patreon/ResurrectionButterfly.cs b/Items/Patreon/ResurrectionButterfly.cs index ed3bfc0336..e812ed031a 100644 --- a/Items/Patreon/ResurrectionButterfly.cs +++ b/Items/Patreon/ResurrectionButterfly.cs @@ -67,9 +67,9 @@ namespace CalamityMod.Items.Patreon vector2.X = (float)Main.mouseX + Main.screenPosition.X; vector2.Y = (float)Main.mouseY + Main.screenPosition.Y; Vector2 spinningpoint = new Vector2(num78, num79); - spinningpoint = spinningpoint.RotatedBy(1.5707963705062866, default(Vector2)); + spinningpoint = spinningpoint.RotatedBy(1.5707963705062866, default); Projectile.NewProjectile(vector2.X + spinningpoint.X, vector2.Y + spinningpoint.Y, spinningpoint.X, spinningpoint.Y, mod.ProjectileType("PinkButterfly"), damage, num74, i, 0f, 0f); - spinningpoint = spinningpoint.RotatedBy(-3.1415927410125732, default(Vector2)); + spinningpoint = spinningpoint.RotatedBy(-3.1415927410125732, default); Projectile.NewProjectile(vector2.X + spinningpoint.X, vector2.Y + spinningpoint.Y, spinningpoint.X, spinningpoint.Y, mod.ProjectileType("PurpleButterfly"), damage, num74, i, 0f, 0f); return false; } diff --git a/Items/Patreon/Roxcalibur.cs b/Items/Patreon/Roxcalibur.cs index d4533a9323..d218903490 100644 --- a/Items/Patreon/Roxcalibur.cs +++ b/Items/Patreon/Roxcalibur.cs @@ -72,7 +72,7 @@ namespace CalamityMod.Items.Patreon { for (int i = 0; i < 50; i++) { - int d = Dust.NewDust(player.Center, player.width, player.height, 191, Main.rand.Next(-8, 9), Main.rand.Next(-8, 9), 100, default(Color), 1); + int d = Dust.NewDust(player.Center, player.width, player.height, 191, Main.rand.Next(-8, 9), Main.rand.Next(-8, 9), 100, default, 1); Main.dust[d].noGravity = true; Main.dust[d].position = player.Center; } @@ -198,11 +198,11 @@ namespace CalamityMod.Items.Patreon player.itemRotation = player.direction * MathHelper.ToRadians(135f); //Dust trail int dusty = hitbox.Y + (hitbox.Height / 2); - Dust.NewDust(new Vector2(hitbox.X, dusty), hitbox.Width, hitbox.Height / 2, 191, player.velocity.X * 0.25f, player.velocity.Y * 0.25f, 160, default(Color), 0.7f); + Dust.NewDust(new Vector2(hitbox.X, dusty), hitbox.Width, hitbox.Height / 2, 191, player.velocity.X * 0.25f, player.velocity.Y * 0.25f, 160, default, 0.7f); } else { - Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 191, 0f, 0f, 160, default(Color), 0.7f); + Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 191, 0f, 0f, 160, default, 0.7f); } } diff --git a/Items/Patreon/TheLastMourning.cs b/Items/Patreon/TheLastMourning.cs index 222daec7b8..0d21f9f5ab 100644 --- a/Items/Patreon/TheLastMourning.cs +++ b/Items/Patreon/TheLastMourning.cs @@ -75,7 +75,7 @@ namespace CalamityMod.Items.Patreon public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dustType = 5; switch (Main.rand.Next(3)) @@ -92,7 +92,7 @@ namespace CalamityMod.Items.Patreon default: break; } - int dust = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, dustType, (float)(player.direction * 2), 0f, 150, default(Color), 1.3f); + int dust = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, dustType, (float)(player.direction * 2), 0f, 150, default, 1.3f); Main.dust[dust].velocity *= 0.2f; } } diff --git a/Items/Permafrost/WintersFury.cs b/Items/Permafrost/WintersFury.cs index 4084ea85ff..956ff8134c 100644 --- a/Items/Permafrost/WintersFury.cs +++ b/Items/Permafrost/WintersFury.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Items.Permafrost Main.projectile[p].minion = false; Main.projectile[p].magic = true; } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Main.PlaySound(SoundID.Item1, position); Projectile.NewProjectile(position.X, position.Y, speedX * 1.2f, speedY * 1.2f, mod.ProjectileType("Snowball"), damage, knockBack * 2f, player.whoAmI); diff --git a/Items/PlaguebringerGoliath/BloomStone.cs b/Items/PlaguebringerGoliath/BloomStone.cs index 75b0f11197..65d1db8e2f 100644 --- a/Items/PlaguebringerGoliath/BloomStone.cs +++ b/Items/PlaguebringerGoliath/BloomStone.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Items.PlaguebringerGoliath if (flag) { nPC.StrikeNPC(num3, 0f, 0, false, false, false); - if (Main.netMode != 0) + if (Main.netMode != NetmodeID.SinglePlayer) { NetMessage.SendData(28, -1, -1, null, l, (float)num3, 0f, 0f, 0, 0, 0); } @@ -84,7 +84,7 @@ namespace CalamityMod.Items.PlaguebringerGoliath Main.tile[num4, num5].halfBrick(false); if (Main.tile[num4, num5 + 1].type == 0) { - if (Main.rand.Next(1000) == 0) + if (Main.rand.NextBool(1000)) { Main.tile[num4, num5].active(true); Main.tile[num4, num5].type = 227; @@ -94,14 +94,14 @@ namespace CalamityMod.Items.PlaguebringerGoliath Main.tile[num4, num5].frameX = (short)(34 * Main.rand.Next(1, 13)); } } - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { NetMessage.SendTileSquare(-1, num4, num5, 1, TileChangeType.None); } } if (Main.tile[num4, num5 + 1].type == 2) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.tile[num4, num5].active(true); Main.tile[num4, num5].type = 3; @@ -121,14 +121,14 @@ namespace CalamityMod.Items.PlaguebringerGoliath Main.tile[num4, num5].frameX = (short)(18 * Main.rand.Next(6, 21)); } } - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { NetMessage.SendTileSquare(-1, num4, num5, 1, TileChangeType.None); } } else if (Main.tile[num4, num5 + 1].type == 109) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.tile[num4, num5].active(true); Main.tile[num4, num5].type = 110; @@ -148,7 +148,7 @@ namespace CalamityMod.Items.PlaguebringerGoliath Main.tile[num4, num5].frameX = (short)(18 * Main.rand.Next(2, 8)); } } - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { NetMessage.SendTileSquare(-1, num4, num5, 1, TileChangeType.None); } @@ -158,7 +158,7 @@ namespace CalamityMod.Items.PlaguebringerGoliath Main.tile[num4, num5].active(true); Main.tile[num4, num5].type = 74; Main.tile[num4, num5].frameX = (short)(18 * Main.rand.Next(9, 17)); - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { NetMessage.SendTileSquare(-1, num4, num5, 1, TileChangeType.None); } diff --git a/Items/PlaguebringerGoliath/ToxicHeart.cs b/Items/PlaguebringerGoliath/ToxicHeart.cs index edc9c59661..e5e4ba4dc4 100644 --- a/Items/PlaguebringerGoliath/ToxicHeart.cs +++ b/Items/PlaguebringerGoliath/ToxicHeart.cs @@ -1,5 +1,6 @@ using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.PlaguebringerGoliath @@ -47,7 +48,7 @@ namespace CalamityMod.Items.PlaguebringerGoliath if (flag) { nPC.StrikeNPC(num3, 0f, 0, false, false, false); - if (Main.netMode != 0) + if (Main.netMode != NetmodeID.SinglePlayer) { NetMessage.SendData(28, -1, -1, null, l, (float)num3, 0f, 0f, 0, 0, 0); } diff --git a/Items/Scavenger/AncientMedallion.cs b/Items/Scavenger/AncientMedallion.cs index eba52d6dd3..08b46e91ed 100644 --- a/Items/Scavenger/AncientMedallion.cs +++ b/Items/Scavenger/AncientMedallion.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Scavenger public override bool UseItem(Player player) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { NPC.NewNPC((int)(player.position.X + (float)(Main.rand.Next(-100, 101))), (int)(player.position.Y - 250f), mod.NPCType("ScavengerBody"), 0, 0f, 0f, 0f, 0f, 255); Main.PlaySound(SoundID.Roar, player.position, 0); diff --git a/Items/SummonsAndClimateChange/BossRush.cs b/Items/SummonsAndClimateChange/BossRush.cs index d959b982ee..c1eb0f8a92 100644 --- a/Items/SummonsAndClimateChange/BossRush.cs +++ b/Items/SummonsAndClimateChange/BossRush.cs @@ -45,11 +45,11 @@ namespace CalamityMod.Items.SummonsAndClimateChange CalamityWorld.bossRushActive = true; string key = "Mods.CalamityMod.BossRushStartText"; Color messageColor = Color.LightCoral; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -61,7 +61,7 @@ namespace CalamityMod.Items.SummonsAndClimateChange } CalamityMod.UpdateServerBoolean(); - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { var netMessage = mod.GetPacket(); netMessage.Write((byte)CalamityModMessageType.BossRushStage); diff --git a/Items/SummonsAndClimateChange/EidolonTablet.cs b/Items/SummonsAndClimateChange/EidolonTablet.cs index c6b5d1e1b4..8b2b0bd63c 100644 --- a/Items/SummonsAndClimateChange/EidolonTablet.cs +++ b/Items/SummonsAndClimateChange/EidolonTablet.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.SummonsAndClimateChange public override bool UseItem(Player player) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int num1302 = NPC.NewNPC((int)player.Center.X + 30, (int)player.Center.Y - 90, NPCID.CultistBoss, 0, 0f, 0f, 0f, 0f, 255); Main.npc[num1302].direction = (Main.npc[num1302].spriteDirection = Math.Sign(player.Center.X - (float)player.Center.X - 30f)); diff --git a/Items/SupremeCalamitas/EyeofExtinction.cs b/Items/SupremeCalamitas/EyeofExtinction.cs index 6b0c0af58c..b5b1f14913 100644 --- a/Items/SupremeCalamitas/EyeofExtinction.cs +++ b/Items/SupremeCalamitas/EyeofExtinction.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Items.SupremeCalamitas if (Main.tile[i, j].type == mod.TileType("ArenaTile")) { WorldGen.KillTile(i, j, false, false, false); - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { NetMessage.SendTileSquare(-1, i, j, 1, TileChangeType.None); } diff --git a/Items/TheDevourerofGods/CosmicWorm.cs b/Items/TheDevourerofGods/CosmicWorm.cs index 66d3bf8643..deacb77caf 100644 --- a/Items/TheDevourerofGods/CosmicWorm.cs +++ b/Items/TheDevourerofGods/CosmicWorm.cs @@ -36,11 +36,11 @@ namespace CalamityMod.Items.TheDevourerofGods { string key = "Mods.CalamityMod.EdgyBossText12"; Color messageColor = Color.Cyan; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } diff --git a/Items/TheDevourerofGods/NebulousCore.cs b/Items/TheDevourerofGods/NebulousCore.cs index bb327d643b..0a1861734f 100644 --- a/Items/TheDevourerofGods/NebulousCore.cs +++ b/Items/TheDevourerofGods/NebulousCore.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Items.TheDevourerofGods player.allDamage += 0.12f; int damage = 1500; float knockBack = 3f; - if (Main.rand.Next(15) == 0) + if (Main.rand.NextBool(15)) { int num = 0; for (int i = 0; i < 1000; i++) @@ -70,7 +70,7 @@ namespace CalamityMod.Items.TheDevourerofGods int num6 = (int)center.X / 16; int num7 = (int)center.Y / 16; bool flag = false; - if (Main.rand.Next(3) == 0 && Main.tile[num6, num7] != null && Main.tile[num6, num7].wall > 0) + if (Main.rand.NextBool(3) && Main.tile[num6, num7] != null && Main.tile[num6, num7].wall > 0) { flag = true; } diff --git a/Items/Tools/AbyssalWarhammer.cs b/Items/Tools/AbyssalWarhammer.cs index da5624d17b..2a5e66fca4 100644 --- a/Items/Tools/AbyssalWarhammer.cs +++ b/Items/Tools/AbyssalWarhammer.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Tools public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 29); } diff --git a/Items/Tools/AerialHamaxe.cs b/Items/Tools/AerialHamaxe.cs index 64b0125c96..a345eaf119 100644 --- a/Items/Tools/AerialHamaxe.cs +++ b/Items/Tools/AerialHamaxe.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Items.Tools public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 59); } diff --git a/Items/Tools/AstralHamaxe.cs b/Items/Tools/AstralHamaxe.cs index ba4fe4ffed..876252362e 100644 --- a/Items/Tools/AstralHamaxe.cs +++ b/Items/Tools/AstralHamaxe.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Tools public override void MeleeEffects(Player player, Rectangle hitbox) { - Dust d = CalamityGlobalItem.MeleeDustHelper(player, Main.rand.Next(2) == 0 ? mod.DustType("AstralOrange") : mod.DustType("AstralBlue"), 0.48f, 50, 78, -0.1f, 0.1f); + Dust d = CalamityGlobalItem.MeleeDustHelper(player, Main.rand.NextBool(2) ? mod.DustType("AstralOrange") : mod.DustType("AstralBlue"), 0.48f, 50, 78, -0.1f, 0.1f); if (d != null) { d.customData = 0.02f; diff --git a/Items/Tools/AstralPickaxe.cs b/Items/Tools/AstralPickaxe.cs index adca0ed790..8e3b10bd5d 100644 --- a/Items/Tools/AstralPickaxe.cs +++ b/Items/Tools/AstralPickaxe.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Items.Tools public override void MeleeEffects(Player player, Rectangle hitbox) { - Dust d = CalamityGlobalItem.MeleeDustHelper(player, Main.rand.Next(2) == 0 ? mod.DustType("AstralOrange") : mod.DustType("AstralBlue"), 0.56f, 40, 65, -0.13f, 0.13f); + Dust d = CalamityGlobalItem.MeleeDustHelper(player, Main.rand.NextBool(2) ? mod.DustType("AstralOrange") : mod.DustType("AstralBlue"), 0.56f, 40, 65, -0.13f, 0.13f); if (d != null) { d.customData = 0.02f; diff --git a/Items/Tools/BeastialPickaxe.cs b/Items/Tools/BeastialPickaxe.cs index 57345331ea..e6fd3456d1 100644 --- a/Items/Tools/BeastialPickaxe.cs +++ b/Items/Tools/BeastialPickaxe.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Tools public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 61); } diff --git a/Items/Tools/BerserkerWaraxe.cs b/Items/Tools/BerserkerWaraxe.cs index 4c0dd8a377..80fdb0a958 100644 --- a/Items/Tools/BerserkerWaraxe.cs +++ b/Items/Tools/BerserkerWaraxe.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Tools public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 61); } diff --git a/Items/Tools/BlossomPickaxe.cs b/Items/Tools/BlossomPickaxe.cs index 327792e98d..6068d52968 100644 --- a/Items/Tools/BlossomPickaxe.cs +++ b/Items/Tools/BlossomPickaxe.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Tools public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 75); } diff --git a/Items/Tools/ChaoswarpedSlashaxe.cs b/Items/Tools/ChaoswarpedSlashaxe.cs index fc4b846bed..ed68c4963e 100644 --- a/Items/Tools/ChaoswarpedSlashaxe.cs +++ b/Items/Tools/ChaoswarpedSlashaxe.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Tools public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 127); } diff --git a/Items/Tools/CrystylCrusher.cs b/Items/Tools/CrystylCrusher.cs index ed7b60fd57..8d139af935 100644 --- a/Items/Tools/CrystylCrusher.cs +++ b/Items/Tools/CrystylCrusher.cs @@ -81,7 +81,7 @@ namespace CalamityMod.Items.Tools public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int num307 = Main.rand.Next(3); if (num307 == 0) diff --git a/Items/Tools/FlamebeakHampick.cs b/Items/Tools/FlamebeakHampick.cs index fd453b3fe2..c0ba38388e 100644 --- a/Items/Tools/FlamebeakHampick.cs +++ b/Items/Tools/FlamebeakHampick.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Tools public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 127); } diff --git a/Items/Tools/GallantPickaxe.cs b/Items/Tools/GallantPickaxe.cs index 408ddf22ef..13c2c298c5 100644 --- a/Items/Tools/GallantPickaxe.cs +++ b/Items/Tools/GallantPickaxe.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Items.Tools public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 58); } diff --git a/Items/Tools/Gelpick.cs b/Items/Tools/Gelpick.cs index 3f8aff06b7..0a187ce1cd 100644 --- a/Items/Tools/Gelpick.cs +++ b/Items/Tools/Gelpick.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Tools public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 20); } diff --git a/Items/Tools/ShardlightPickaxe.cs b/Items/Tools/ShardlightPickaxe.cs index b8ae54ea9f..9b98d1b47e 100644 --- a/Items/Tools/ShardlightPickaxe.cs +++ b/Items/Tools/ShardlightPickaxe.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Tools public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 29); } diff --git a/Items/Tools/SkyfringePickaxe.cs b/Items/Tools/SkyfringePickaxe.cs index 807dbbbf63..e062a4939b 100644 --- a/Items/Tools/SkyfringePickaxe.cs +++ b/Items/Tools/SkyfringePickaxe.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Items.Tools public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 59); } diff --git a/Items/Weapons/AbyssBlade.cs b/Items/Weapons/AbyssBlade.cs index 5d4bb4a191..2c939ad121 100644 --- a/Items/Weapons/AbyssBlade.cs +++ b/Items/Weapons/AbyssBlade.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 33); } diff --git a/Items/Weapons/AegisBlade.cs b/Items/Weapons/AegisBlade.cs index 03c762a193..3ed03b690c 100644 --- a/Items/Weapons/AegisBlade.cs +++ b/Items/Weapons/AegisBlade.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 246, 0f, 0f, 0, new Color(255, Main.DiscoG, 53)); } diff --git a/Items/Weapons/Aftershock.cs b/Items/Weapons/Aftershock.cs index feb879d99b..8f02f10c65 100644 --- a/Items/Weapons/Aftershock.cs +++ b/Items/Weapons/Aftershock.cs @@ -81,7 +81,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 32); } diff --git a/Items/Weapons/Alluvion.cs b/Items/Weapons/Alluvion.cs index 77dec383af..029fdae546 100644 --- a/Items/Weapons/Alluvion.cs +++ b/Items/Weapons/Alluvion.cs @@ -49,22 +49,22 @@ namespace CalamityMod.Items.Weapons for (int num119 = 0; num119 < num118; num119++) { float num120 = (float)num119 - ((float)num118 - 1f) / 2f; - Vector2 value9 = vector7.RotatedBy((double)(num117 * num120), default(Vector2)); + Vector2 value9 = vector7.RotatedBy((double)(num117 * num120), default); if (!flag11) { value9 -= vector7; } if (type == ProjectileID.WoodenArrowFriendly) { - if (Main.rand.Next(12) == 0) + if (Main.rand.NextBool(12)) { type = mod.ProjectileType("TorrentialArrow"); } - if (Main.rand.Next(25) == 0) + if (Main.rand.NextBool(25)) { type = 408; } - if (Main.rand.Next(100) == 0) + if (Main.rand.NextBool(100)) { type = mod.ProjectileType("TyphoonArrow"); } diff --git a/Items/Weapons/AlphaRay.cs b/Items/Weapons/AlphaRay.cs index 07590fd36f..7eec6a8aca 100644 --- a/Items/Weapons/AlphaRay.cs +++ b/Items/Weapons/AlphaRay.cs @@ -65,7 +65,7 @@ namespace CalamityMod.Items.Weapons for (int num119 = 0; num119 < num118; num119++) { float num120 = (float)num119 - ((float)num118 - 1f) / 2f; - Vector2 value9 = vector7.RotatedBy((double)(num117 * num120), default(Vector2)); + Vector2 value9 = vector7.RotatedBy((double)(num117 * num120), default); if (!flag11) { value9 -= vector7; diff --git a/Items/Weapons/AnarchyBlade.cs b/Items/Weapons/AnarchyBlade.cs index c64f9c8bff..60dd7ff932 100644 --- a/Items/Weapons/AnarchyBlade.cs +++ b/Items/Weapons/AnarchyBlade.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 235); } @@ -67,7 +67,7 @@ namespace CalamityMod.Items.Weapons Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, mod.ProjectileType("BrimstoneBoom"), (int)((float)item.damage * player.meleeDamage), knockback, Main.myPlayer); target.AddBuff(mod.BuffType("BrimstoneFlames"), 300); - if (player.statLife < (player.statLifeMax2 * 0.5f) && Main.rand.Next(5) == 0) + if (player.statLife < (player.statLifeMax2 * 0.5f) && Main.rand.NextBool(5)) { if (!CalamityPlayer.areThereAnyDamnBosses && CalamityGlobalNPC.ShouldAffectNPC(target)) { diff --git a/Items/Weapons/AncientShiv.cs b/Items/Weapons/AncientShiv.cs index 6c444eec29..f9a72e8043 100644 --- a/Items/Weapons/AncientShiv.cs +++ b/Items/Weapons/AncientShiv.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 15); } diff --git a/Items/Weapons/AquaticDissolution.cs b/Items/Weapons/AquaticDissolution.cs index 71232995a0..f4aea1bdec 100644 --- a/Items/Weapons/AquaticDissolution.cs +++ b/Items/Weapons/AquaticDissolution.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int num250 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, 33, (float)(player.direction * 2), 0f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1.3f); Main.dust[num250].velocity *= 0.2f; diff --git a/Items/Weapons/AquaticScourge/SubmarineShocker.cs b/Items/Weapons/AquaticScourge/SubmarineShocker.cs index e7b01dec02..cfb8b4a039 100644 --- a/Items/Weapons/AquaticScourge/SubmarineShocker.cs +++ b/Items/Weapons/AquaticScourge/SubmarineShocker.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.AquaticScourge public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 226); } diff --git a/Items/Weapons/ArkoftheAncients.cs b/Items/Weapons/ArkoftheAncients.cs index 082affbaa9..1f78a93a3b 100644 --- a/Items/Weapons/ArkoftheAncients.cs +++ b/Items/Weapons/ArkoftheAncients.cs @@ -117,7 +117,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dustType = 15; switch (Main.rand.Next(3)) @@ -134,14 +134,14 @@ namespace CalamityMod.Items.Weapons default: break; } - int dust = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, dustType, (float)(player.direction * 2), 0f, 150, default(Color), 1.3f); + int dust = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, dustType, (float)(player.direction * 2), 0f, 150, default, 1.3f); Main.dust[dust].velocity *= 0.2f; } } public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { target.AddBuff(mod.BuffType("HolyLight"), 300); } diff --git a/Items/Weapons/ArkoftheCosmos.cs b/Items/Weapons/ArkoftheCosmos.cs index c3b3fb6cf5..8dc43b5228 100644 --- a/Items/Weapons/ArkoftheCosmos.cs +++ b/Items/Weapons/ArkoftheCosmos.cs @@ -108,7 +108,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int num250 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, 66, (float)(player.direction * 2), 0f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1.3f); Main.dust[num250].velocity *= 0.2f; diff --git a/Items/Weapons/ArkoftheElements.cs b/Items/Weapons/ArkoftheElements.cs index ae4bd9a66b..36fb4767fd 100644 --- a/Items/Weapons/ArkoftheElements.cs +++ b/Items/Weapons/ArkoftheElements.cs @@ -103,7 +103,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int num250 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, 66, (float)(player.direction * 2), 0f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1.3f); Main.dust[num250].velocity *= 0.2f; diff --git a/Items/Weapons/Astral/AstralBlade.cs b/Items/Weapons/Astral/AstralBlade.cs index 15c6850905..11acf59a21 100644 --- a/Items/Weapons/Astral/AstralBlade.cs +++ b/Items/Weapons/Astral/AstralBlade.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Items.Weapons.Astral { for (int i = 0; i < 3; i++) { - Dust d = CalamityGlobalItem.MeleeDustHelper(player, Main.rand.Next(2) == 0 ? mod.DustType("AstralOrange") : mod.DustType("AstralBlue"), 0.7f, 55, 110, -0.07f, 0.07f); + Dust d = CalamityGlobalItem.MeleeDustHelper(player, Main.rand.NextBool(2) ? mod.DustType("AstralOrange") : mod.DustType("AstralBlue"), 0.7f, 55, 110, -0.07f, 0.07f); if (d != null) { d.customData = 0.03f; diff --git a/Items/Weapons/Astral/AstralachneaStaff.cs b/Items/Weapons/Astral/AstralachneaStaff.cs index bd00fad419..c9fe021c8c 100644 --- a/Items/Weapons/Astral/AstralachneaStaff.cs +++ b/Items/Weapons/Astral/AstralachneaStaff.cs @@ -46,15 +46,15 @@ namespace CalamityMod.Items.Weapons.Astral float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); int spikeAmount = 4; - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { spikeAmount++; } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { spikeAmount++; } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { spikeAmount += 2; } diff --git a/Items/Weapons/AuguroftheElements.cs b/Items/Weapons/AuguroftheElements.cs index dc67eae968..dbc2019ef2 100644 --- a/Items/Weapons/AuguroftheElements.cs +++ b/Items/Weapons/AuguroftheElements.cs @@ -62,12 +62,12 @@ namespace CalamityMod.Items.Weapons value2.Normalize(); value2 *= item.shootSpeed; float num91 = (float)Main.rand.Next(10, 50) * 0.001f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { num91 *= -1f; } float num92 = (float)Main.rand.Next(10, 50) * 0.001f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { num92 *= -1f; } diff --git a/Items/Weapons/BiomeBlade.cs b/Items/Weapons/BiomeBlade.cs index e47e3f82f9..f8e6bb04ea 100644 --- a/Items/Weapons/BiomeBlade.cs +++ b/Items/Weapons/BiomeBlade.cs @@ -68,7 +68,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 0); } diff --git a/Items/Weapons/BladedgeGreatbow.cs b/Items/Weapons/BladedgeGreatbow.cs index aeb940bddd..9f809b5f0d 100644 --- a/Items/Weapons/BladedgeGreatbow.cs +++ b/Items/Weapons/BladedgeGreatbow.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Items.Weapons for (int num119 = 0; num119 < num118; num119++) { float num120 = (float)num119 - ((float)num118 - 1f) / 2f; - Vector2 value9 = vector7.RotatedBy((double)(num117 * num120), default(Vector2)); + Vector2 value9 = vector7.RotatedBy((double)(num117 * num120), default); if (!flag11) { value9 -= vector7; diff --git a/Items/Weapons/BloodyEdge.cs b/Items/Weapons/BloodyEdge.cs index a885260cc6..87b83582e7 100644 --- a/Items/Weapons/BloodyEdge.cs +++ b/Items/Weapons/BloodyEdge.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 5); } @@ -65,7 +65,7 @@ namespace CalamityMod.Items.Weapons return; } int healAmount = (Main.rand.Next(3) + 1); - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { player.statLife += healAmount; player.HealEffect(healAmount); diff --git a/Items/Weapons/Brimlash.cs b/Items/Weapons/Brimlash.cs index deafced406..f6842c6594 100644 --- a/Items/Weapons/Brimlash.cs +++ b/Items/Weapons/Brimlash.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 235); } diff --git a/Items/Weapons/BrimlashBuster.cs b/Items/Weapons/BrimlashBuster.cs index 837e23ce2f..927779c41d 100644 --- a/Items/Weapons/BrimlashBuster.cs +++ b/Items/Weapons/BrimlashBuster.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 235); } @@ -55,7 +55,7 @@ namespace CalamityMod.Items.Weapons public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { target.AddBuff(mod.BuffType("BrimstoneFlames"), 300); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { item.damage = 378; } diff --git a/Items/Weapons/BrinyBaron.cs b/Items/Weapons/BrinyBaron.cs index e179ca0d5c..0318b1dd7d 100644 --- a/Items/Weapons/BrinyBaron.cs +++ b/Items/Weapons/BrinyBaron.cs @@ -78,7 +78,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 187, 0f, 0f, 100, new Color(53, Main.DiscoG, 255)); } diff --git a/Items/Weapons/BurntSienna.cs b/Items/Weapons/BurntSienna.cs index b2e9b5ee99..56e90874a7 100644 --- a/Items/Weapons/BurntSienna.cs +++ b/Items/Weapons/BurntSienna.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 246); } diff --git a/Items/Weapons/Calamitas/BlightedEyeStaff.cs b/Items/Weapons/Calamitas/BlightedEyeStaff.cs index 79813b837c..e11cbf749d 100644 --- a/Items/Weapons/Calamitas/BlightedEyeStaff.cs +++ b/Items/Weapons/Calamitas/BlightedEyeStaff.cs @@ -65,11 +65,11 @@ namespace CalamityMod.Items.Weapons.Calamitas vector2.X = (float)Main.mouseX + Main.screenPosition.X; vector2.Y = (float)Main.mouseY + Main.screenPosition.Y; Vector2 spinningpoint = new Vector2(num78, num79); - spinningpoint = spinningpoint.RotatedBy(1.5707963705062866, default(Vector2)); + spinningpoint = spinningpoint.RotatedBy(1.5707963705062866, default); Projectile.NewProjectile(vector2.X + spinningpoint.X, vector2.Y + spinningpoint.Y, spinningpoint.X, spinningpoint.Y, mod.ProjectileType("Calamitamini"), damage, num74, i, 0f, 0f); - spinningpoint = spinningpoint.RotatedBy(-3.1415927410125732, default(Vector2)); + spinningpoint = spinningpoint.RotatedBy(-3.1415927410125732, default); Projectile.NewProjectile(vector2.X + spinningpoint.X, vector2.Y + spinningpoint.Y, spinningpoint.X, spinningpoint.Y, mod.ProjectileType("Catastromini"), damage, num74, i, 0f, 0f); - spinningpoint = spinningpoint.RotatedBy(-5.1415927410125732, default(Vector2)); + spinningpoint = spinningpoint.RotatedBy(-5.1415927410125732, default); Projectile.NewProjectile(vector2.X + spinningpoint.X, vector2.Y + spinningpoint.Y, spinningpoint.X, spinningpoint.Y, mod.ProjectileType("Cataclymini"), damage, num74, i, 0f, 0f); return false; } diff --git a/Items/Weapons/CatastropheClaymore.cs b/Items/Weapons/CatastropheClaymore.cs index faed65dda7..ba28a65dab 100644 --- a/Items/Weapons/CatastropheClaymore.cs +++ b/Items/Weapons/CatastropheClaymore.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 73); } @@ -81,7 +81,7 @@ namespace CalamityMod.Items.Weapons public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { target.AddBuff(BuffID.Ichor, 120); target.AddBuff(BuffID.OnFire, 300); diff --git a/Items/Weapons/CausticEdge.cs b/Items/Weapons/CausticEdge.cs index 4a8ed56508..aa8523bdb5 100644 --- a/Items/Weapons/CausticEdge.cs +++ b/Items/Weapons/CausticEdge.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 74); } diff --git a/Items/Weapons/CelestialClaymore.cs b/Items/Weapons/CelestialClaymore.cs index 8d2adc38b2..a5e6687dba 100644 --- a/Items/Weapons/CelestialClaymore.cs +++ b/Items/Weapons/CelestialClaymore.cs @@ -91,7 +91,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { int num249 = Main.rand.Next(2); if (num249 == 0) @@ -106,7 +106,7 @@ namespace CalamityMod.Items.Weapons { num249 = 244; } - int num250 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, num249, (float)(player.direction * 2), 0f, 150, default(Color), 1.3f); + int num250 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, num249, (float)(player.direction * 2), 0f, 150, default, 1.3f); Main.dust[num250].velocity *= 0.2f; } } diff --git a/Items/Weapons/ClockworkBow.cs b/Items/Weapons/ClockworkBow.cs index f2b8d260f2..a9b2392373 100644 --- a/Items/Weapons/ClockworkBow.cs +++ b/Items/Weapons/ClockworkBow.cs @@ -77,15 +77,15 @@ namespace CalamityMod.Items.Weapons num78 *= num80; num79 *= num80; int num130 = 15; - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { num130++; } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { num130++; } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { num130++; } diff --git a/Items/Weapons/CometQuasher.cs b/Items/Weapons/CometQuasher.cs index 43c70cccfb..c28bffb1a8 100644 --- a/Items/Weapons/CometQuasher.cs +++ b/Items/Weapons/CometQuasher.cs @@ -90,7 +90,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 6); } diff --git a/Items/Weapons/CosmicBolter.cs b/Items/Weapons/CosmicBolter.cs index 2e89d5be1a..5da814c5f9 100644 --- a/Items/Weapons/CosmicBolter.cs +++ b/Items/Weapons/CosmicBolter.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Items.Weapons for (int num119 = 0; num119 < num118; num119++) { float num120 = (float)num119 - ((float)num118 - 1f) / 2f; - Vector2 value9 = vector7.RotatedBy((double)(num117 * num120), default(Vector2)); + Vector2 value9 = vector7.RotatedBy((double)(num117 * num120), default); if (!flag11) { value9 -= vector7; diff --git a/Items/Weapons/CosmicRainbow.cs b/Items/Weapons/CosmicRainbow.cs index 32ca9f12f6..eb4df45629 100644 --- a/Items/Weapons/CosmicRainbow.cs +++ b/Items/Weapons/CosmicRainbow.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Items.Weapons for (int num119 = 0; num119 < num118; num119++) { float num120 = (float)num119 - ((float)num118 - 1f) / 2f; - Vector2 value9 = vector7.RotatedBy((double)(num117 * num120), default(Vector2)); + Vector2 value9 = vector7.RotatedBy((double)(num117 * num120), default); if (!flag11) { value9 -= vector7; diff --git a/Items/Weapons/Crabulon/HyphaeRod.cs b/Items/Weapons/Crabulon/HyphaeRod.cs index f293d16e94..b299237d17 100644 --- a/Items/Weapons/Crabulon/HyphaeRod.cs +++ b/Items/Weapons/Crabulon/HyphaeRod.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Crabulon int i = Main.myPlayer; float num72 = item.shootSpeed; Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default(Vector2)); + Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default); Vector2 vector3 = Main.MouseWorld + vector2; float num78 = (float)Main.mouseX + Main.screenPosition.X + vector2.X; float num79 = (float)Main.mouseY + Main.screenPosition.Y + vector2.Y; diff --git a/Items/Weapons/Crabulon/MycelialClaws.cs b/Items/Weapons/Crabulon/MycelialClaws.cs index d30392a4d9..fe59e5426a 100644 --- a/Items/Weapons/Crabulon/MycelialClaws.cs +++ b/Items/Weapons/Crabulon/MycelialClaws.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Crabulon public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 56); } diff --git a/Items/Weapons/Cryogen/Avalanche.cs b/Items/Weapons/Cryogen/Avalanche.cs index b1ef47c22a..d7e37e06af 100644 --- a/Items/Weapons/Cryogen/Avalanche.cs +++ b/Items/Weapons/Cryogen/Avalanche.cs @@ -93,9 +93,9 @@ namespace CalamityMod.Items.Weapons.Cryogen public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { - int num250 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, 67, (float)(player.direction * 2), 0f, 150, default(Color), 1.5f); + int num250 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, 67, (float)(player.direction * 2), 0f, 150, default, 1.5f); Main.dust[num250].velocity *= 0.2f; } } diff --git a/Items/Weapons/Cryogen/BittercoldStaff.cs b/Items/Weapons/Cryogen/BittercoldStaff.cs index 1f064cfa2f..2cfb0e4135 100644 --- a/Items/Weapons/Cryogen/BittercoldStaff.cs +++ b/Items/Weapons/Cryogen/BittercoldStaff.cs @@ -55,15 +55,15 @@ namespace CalamityMod.Items.Weapons.Cryogen float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); int num130 = 2; - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { num130++; } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { num130++; } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { num130++; } diff --git a/Items/Weapons/Cryogen/GlacialCrusher.cs b/Items/Weapons/Cryogen/GlacialCrusher.cs index f1dd506c81..9202fd1c2d 100644 --- a/Items/Weapons/Cryogen/GlacialCrusher.cs +++ b/Items/Weapons/Cryogen/GlacialCrusher.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Items.Weapons.Cryogen public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 67); } diff --git a/Items/Weapons/DarklightGreatsword.cs b/Items/Weapons/DarklightGreatsword.cs index 9ef5d94524..1fd01e552c 100644 --- a/Items/Weapons/DarklightGreatsword.cs +++ b/Items/Weapons/DarklightGreatsword.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 29); } diff --git a/Items/Weapons/DepthBlade.cs b/Items/Weapons/DepthBlade.cs index a567b664b9..1e486298e5 100644 --- a/Items/Weapons/DepthBlade.cs +++ b/Items/Weapons/DepthBlade.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 33); } diff --git a/Items/Weapons/DesertScourge/AquaticDischarge.cs b/Items/Weapons/DesertScourge/AquaticDischarge.cs index 9ed04ba9ea..4d5ef13614 100644 --- a/Items/Weapons/DesertScourge/AquaticDischarge.cs +++ b/Items/Weapons/DesertScourge/AquaticDischarge.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.DesertScourge public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 226); } diff --git a/Items/Weapons/Devastation.cs b/Items/Weapons/Devastation.cs index 1bfe3b29e0..0095ae5780 100644 --- a/Items/Weapons/Devastation.cs +++ b/Items/Weapons/Devastation.cs @@ -109,7 +109,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 73); } diff --git a/Items/Weapons/DevilsDevastation.cs b/Items/Weapons/DevilsDevastation.cs index dce3a9a0bc..f8e0d6bcba 100644 --- a/Items/Weapons/DevilsDevastation.cs +++ b/Items/Weapons/DevilsDevastation.cs @@ -110,7 +110,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 173); } @@ -134,7 +134,7 @@ namespace CalamityMod.Items.Weapons int num3; for (int num53 = 0; num53 < 40; num53 = num3 + 1) { - int num54 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 173, 0f, 0f, 200, default(Color), num50); + int num54 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 173, 0f, 0f, 200, default, num50); Main.dust[num54].position = target.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)target.width / 2f; Main.dust[num54].noGravity = true; Dust dust = Main.dust[num54]; @@ -142,7 +142,7 @@ namespace CalamityMod.Items.Weapons dust.velocity *= 3f; dust = Main.dust[num54]; dust.velocity += value4 * Main.rand.NextFloat(); - num54 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 173, 0f, 0f, 100, default(Color), num51); + num54 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 173, 0f, 0f, 100, default, num51); Main.dust[num54].position = target.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)target.width / 2f; dust = Main.dust[num54]; dust.velocity.Y -= 3f; @@ -156,8 +156,8 @@ namespace CalamityMod.Items.Weapons } for (int num55 = 0; num55 < 20; num55 = num3 + 1) { - int num56 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 173, 0f, 0f, 0, default(Color), num52); - Main.dust[num56].position = target.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)target.velocity.ToRotation(), default(Vector2)) * (float)target.width / 3f; + int num56 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 173, 0f, 0f, 0, default, num52); + Main.dust[num56].position = target.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)target.velocity.ToRotation(), default) * (float)target.width / 3f; Main.dust[num56].noGravity = true; Dust dust = Main.dust[num56]; dust.velocity.Y -= 1.5f; diff --git a/Items/Weapons/DevourerofGods/DeathhailStaff.cs b/Items/Weapons/DevourerofGods/DeathhailStaff.cs index 2ed09e3eac..5dbd09a08f 100644 --- a/Items/Weapons/DevourerofGods/DeathhailStaff.cs +++ b/Items/Weapons/DevourerofGods/DeathhailStaff.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Items.Weapons.DevourerofGods num74 = player.GetWeaponKnockback(item, num74); player.itemTime = item.useTime; Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default(Vector2)); + Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default); Vector2 vector3 = Main.MouseWorld - vector2; float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; diff --git a/Items/Weapons/DevourerofGods/StaffoftheMechworm.cs b/Items/Weapons/DevourerofGods/StaffoftheMechworm.cs index aa3698652e..f4c4079ba0 100644 --- a/Items/Weapons/DevourerofGods/StaffoftheMechworm.cs +++ b/Items/Weapons/DevourerofGods/StaffoftheMechworm.cs @@ -68,7 +68,7 @@ namespace CalamityMod.Items.Weapons.DevourerofGods float num72 = item.shootSpeed; player.itemTime = item.useTime; Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default(Vector2)); + Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default); Vector2 vector3 = Main.MouseWorld - vector2; float velX = (float)Main.mouseX + Main.screenPosition.X - vector2.X; float velY = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; diff --git a/Items/Weapons/DraconicDestruction.cs b/Items/Weapons/DraconicDestruction.cs index 5cc2c8d0e2..50c2d509f0 100644 --- a/Items/Weapons/DraconicDestruction.cs +++ b/Items/Weapons/DraconicDestruction.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 35); } diff --git a/Items/Weapons/DraedonsExoblade.cs b/Items/Weapons/DraedonsExoblade.cs index aa38a7ed18..5a855aa33b 100644 --- a/Items/Weapons/DraedonsExoblade.cs +++ b/Items/Weapons/DraedonsExoblade.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 107, 0f, 0f, 100, new Color(0, 255, 255)); } @@ -72,7 +72,7 @@ namespace CalamityMod.Items.Weapons target.AddBuff(BuffID.OnFire, 120); target.AddBuff(BuffID.Ichor, 120); Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 88); - float xPos = (Main.rand.Next(2) == 0) ? player.position.X + 800 : player.position.X - 800; + float xPos = (Main.rand.NextBool(2)) ? player.position.X + 800 : player.position.X - 800; Vector2 vector2 = new Vector2(xPos, player.position.Y + Main.rand.Next(-800, 801)); float num80 = xPos; float speedX = (float)target.position.X - vector2.X; diff --git a/Items/Weapons/Dualpoon.cs b/Items/Weapons/Dualpoon.cs index d200cdc45f..38756eae38 100644 --- a/Items/Weapons/Dualpoon.cs +++ b/Items/Weapons/Dualpoon.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Items.Weapons for (int num119 = 0; num119 < num118; num119++) { float num120 = (float)num119 - ((float)num118 - 1f) / 2f; - Vector2 value9 = vector7.RotatedBy((double)(num117 * num120), default(Vector2)); + Vector2 value9 = vector7.RotatedBy((double)(num117 * num120), default); if (!flag11) { value9 -= vector7; diff --git a/Items/Weapons/Earth.cs b/Items/Weapons/Earth.cs index 37436177cd..501daf4cc4 100644 --- a/Items/Weapons/Earth.cs +++ b/Items/Weapons/Earth.cs @@ -89,7 +89,7 @@ namespace CalamityMod.Items.Weapons { return; } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { target.defense -= 50; } diff --git a/Items/Weapons/ElementalShortsword.cs b/Items/Weapons/ElementalShortsword.cs index a91b24198d..b44e116ebf 100644 --- a/Items/Weapons/ElementalShortsword.cs +++ b/Items/Weapons/ElementalShortsword.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int num250 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, 66, (float)(player.direction * 2), 0f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1.3f); Main.dust[num250].velocity *= 0.2f; diff --git a/Items/Weapons/EmpyreanKnives.cs b/Items/Weapons/EmpyreanKnives.cs index 9897b37332..e44f981f98 100644 --- a/Items/Weapons/EmpyreanKnives.cs +++ b/Items/Weapons/EmpyreanKnives.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons { float num72 = item.shootSpeed; Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default(Vector2)); + Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default); Vector2 vector3 = Main.MouseWorld - vector2; float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; @@ -62,19 +62,19 @@ namespace CalamityMod.Items.Weapons num78 *= num80; num79 *= num80; int num146 = 4; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { num146++; } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { num146++; } - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { num146++; } - if (Main.rand.Next(16) == 0) + if (Main.rand.NextBool(16)) { num146++; } diff --git a/Items/Weapons/EssenceFlayer.cs b/Items/Weapons/EssenceFlayer.cs index 65b3a6475d..b3fc7ba946 100644 --- a/Items/Weapons/EssenceFlayer.cs +++ b/Items/Weapons/EssenceFlayer.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 173); } diff --git a/Items/Weapons/ExcaliburShortsword.cs b/Items/Weapons/ExcaliburShortsword.cs index 180ebe1fd9..54b851ba52 100644 --- a/Items/Weapons/ExcaliburShortsword.cs +++ b/Items/Weapons/ExcaliburShortsword.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 57); } diff --git a/Items/Weapons/FeralthornClaymore.cs b/Items/Weapons/FeralthornClaymore.cs index b62103f486..d6145a30de 100644 --- a/Items/Weapons/FeralthornClaymore.cs +++ b/Items/Weapons/FeralthornClaymore.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 44); } diff --git a/Items/Weapons/FlameburstShortsword.cs b/Items/Weapons/FlameburstShortsword.cs index 5ea9715d9a..cfbdb6bebc 100644 --- a/Items/Weapons/FlameburstShortsword.cs +++ b/Items/Weapons/FlameburstShortsword.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 6); } diff --git a/Items/Weapons/FlarefrostBlade.cs b/Items/Weapons/FlarefrostBlade.cs index bf49d5d237..81c67b830b 100644 --- a/Items/Weapons/FlarefrostBlade.cs +++ b/Items/Weapons/FlarefrostBlade.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Items.Weapons { dustChoice = 6; } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, dustChoice); } diff --git a/Items/Weapons/FlarewingBow.cs b/Items/Weapons/FlarewingBow.cs index 96fb0bd34c..a93b6465ea 100644 --- a/Items/Weapons/FlarewingBow.cs +++ b/Items/Weapons/FlarewingBow.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Items.Weapons for (int num119 = 0; num119 < num118; num119++) { float num120 = (float)num119 - ((float)num118 - 1f) / 2f; - Vector2 value9 = vector7.RotatedBy((double)(num117 * num120), default(Vector2)); + Vector2 value9 = vector7.RotatedBy((double)(num117 * num120), default); if (!flag11) { value9 -= vector7; diff --git a/Items/Weapons/Floodtide.cs b/Items/Weapons/Floodtide.cs index 256620a9b6..9e61e39dad 100644 --- a/Items/Weapons/Floodtide.cs +++ b/Items/Weapons/Floodtide.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 217); } diff --git a/Items/Weapons/ForbiddenOathblade.cs b/Items/Weapons/ForbiddenOathblade.cs index d3d615de44..3e54735592 100644 --- a/Items/Weapons/ForbiddenOathblade.cs +++ b/Items/Weapons/ForbiddenOathblade.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 173); } @@ -69,7 +69,7 @@ namespace CalamityMod.Items.Weapons int num3; for (int num53 = 0; num53 < 40; num53 = num3 + 1) { - int num54 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 173, 0f, 0f, 200, default(Color), num50); + int num54 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 173, 0f, 0f, 200, default, num50); Main.dust[num54].position = target.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)target.width / 2f; Main.dust[num54].noGravity = true; Dust dust = Main.dust[num54]; @@ -77,7 +77,7 @@ namespace CalamityMod.Items.Weapons dust.velocity *= 3f; dust = Main.dust[num54]; dust.velocity += value4 * Main.rand.NextFloat(); - num54 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 173, 0f, 0f, 100, default(Color), num51); + num54 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 173, 0f, 0f, 100, default, num51); Main.dust[num54].position = target.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)target.width / 2f; dust = Main.dust[num54]; dust.velocity.Y -= 3f; @@ -91,8 +91,8 @@ namespace CalamityMod.Items.Weapons } for (int num55 = 0; num55 < 20; num55 = num3 + 1) { - int num56 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 173, 0f, 0f, 0, default(Color), num52); - Main.dust[num56].position = target.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)target.velocity.ToRotation(), default(Vector2)) * (float)target.width / 3f; + int num56 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 173, 0f, 0f, 0, default, num52); + Main.dust[num56].position = target.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)target.velocity.ToRotation(), default) * (float)target.width / 3f; Main.dust[num56].noGravity = true; Dust dust = Main.dust[num56]; dust.velocity.Y -= 1.5f; diff --git a/Items/Weapons/ForsakenSaber.cs b/Items/Weapons/ForsakenSaber.cs index 5dd2afc05e..af0cbbbfe4 100644 --- a/Items/Weapons/ForsakenSaber.cs +++ b/Items/Weapons/ForsakenSaber.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 159); } diff --git a/Items/Weapons/FourSeasonsGalaxia.cs b/Items/Weapons/FourSeasonsGalaxia.cs index d293a24c2a..14c73d202a 100644 --- a/Items/Weapons/FourSeasonsGalaxia.cs +++ b/Items/Weapons/FourSeasonsGalaxia.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 0); } diff --git a/Items/Weapons/GalacticaBlade.cs b/Items/Weapons/GalacticaBlade.cs index e6015cd96c..57bbc61b10 100644 --- a/Items/Weapons/GalacticaBlade.cs +++ b/Items/Weapons/GalacticaBlade.cs @@ -103,9 +103,9 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, (Main.rand.Next(2) == 0 ? 164 : 229)); + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, (Main.rand.NextBool(2) ? 164 : 229)); } } diff --git a/Items/Weapons/GrandGuardian.cs b/Items/Weapons/GrandGuardian.cs index 2a9812164e..14a2650b64 100644 --- a/Items/Weapons/GrandGuardian.cs +++ b/Items/Weapons/GrandGuardian.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Weapons public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { target.defense -= 15; } @@ -67,7 +67,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 66, 0f, 0f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1f); Main.dust[dust].noGravity = true; diff --git a/Items/Weapons/GreatbowofTurmoil.cs b/Items/Weapons/GreatbowofTurmoil.cs index e5dde2bce2..39582f6e21 100644 --- a/Items/Weapons/GreatbowofTurmoil.cs +++ b/Items/Weapons/GreatbowofTurmoil.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Items.Weapons for (int num119 = 0; num119 < num118; num119++) { float num120 = (float)num119 - ((float)num118 - 1f) / 2f; - Vector2 value9 = vector7.RotatedBy((double)(num117 * num120), default(Vector2)); + Vector2 value9 = vector7.RotatedBy((double)(num117 * num120), default); if (!flag11) { value9 -= vector7; diff --git a/Items/Weapons/HeavenlyGale.cs b/Items/Weapons/HeavenlyGale.cs index 7a8671086d..7364d0ede3 100644 --- a/Items/Weapons/HeavenlyGale.cs +++ b/Items/Weapons/HeavenlyGale.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Items.Weapons for (int num119 = 0; num119 < num118; num119++) { float num120 = (float)num119 - ((float)num118 - 1f) / 2f; - Vector2 value9 = vector7.RotatedBy((double)(num117 * num120), default(Vector2)); + Vector2 value9 = vector7.RotatedBy((double)(num117 * num120), default); if (!flag11) { value9 -= vector7; diff --git a/Items/Weapons/HellfireFlamberge.cs b/Items/Weapons/HellfireFlamberge.cs index 6d4eed3f24..68dd124c3b 100644 --- a/Items/Weapons/HellfireFlamberge.cs +++ b/Items/Weapons/HellfireFlamberge.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 174); } diff --git a/Items/Weapons/Hellkite.cs b/Items/Weapons/Hellkite.cs index 8a05b9c871..4de842ffae 100644 --- a/Items/Weapons/Hellkite.cs +++ b/Items/Weapons/Hellkite.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 174); } @@ -62,7 +62,7 @@ namespace CalamityMod.Items.Weapons int num3; for (int num53 = 0; num53 < 40; num53 = num3 + 1) { - int num54 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 174, 0f, 0f, 200, default(Color), num50); + int num54 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 174, 0f, 0f, 200, default, num50); Main.dust[num54].position = target.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)target.width / 2f; Main.dust[num54].noGravity = true; Dust dust = Main.dust[num54]; @@ -70,7 +70,7 @@ namespace CalamityMod.Items.Weapons dust.velocity *= 3f; dust = Main.dust[num54]; dust.velocity += value4 * Main.rand.NextFloat(); - num54 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 174, 0f, 0f, 100, default(Color), num51); + num54 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 174, 0f, 0f, 100, default, num51); Main.dust[num54].position = target.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)target.width / 2f; dust = Main.dust[num54]; dust.velocity.Y -= 6f; @@ -84,8 +84,8 @@ namespace CalamityMod.Items.Weapons } for (int num55 = 0; num55 < 20; num55 = num3 + 1) { - int num56 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 174, 0f, 0f, 0, default(Color), num52); - Main.dust[num56].position = target.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)target.velocity.ToRotation(), default(Vector2)) * (float)target.width / 3f; + int num56 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 174, 0f, 0f, 0, default, num52); + Main.dust[num56].position = target.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)target.velocity.ToRotation(), default) * (float)target.width / 3f; Main.dust[num56].noGravity = true; Dust dust = Main.dust[num56]; dust.velocity.Y -= 6f; diff --git a/Items/Weapons/HellwingStaff.cs b/Items/Weapons/HellwingStaff.cs index 687985cec2..c7837e2907 100644 --- a/Items/Weapons/HellwingStaff.cs +++ b/Items/Weapons/HellwingStaff.cs @@ -70,15 +70,15 @@ namespace CalamityMod.Items.Weapons num78 *= num80; num79 *= num80; int num130 = 7; - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) { num130++; } - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { num130++; } - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { num130++; } diff --git a/Items/Weapons/HiveMind/LeechingDagger.cs b/Items/Weapons/HiveMind/LeechingDagger.cs index 52f2b9fc19..f7763e9b46 100644 --- a/Items/Weapons/HiveMind/LeechingDagger.cs +++ b/Items/Weapons/HiveMind/LeechingDagger.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Weapons.HiveMind public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 14); } diff --git a/Items/Weapons/HolidayHalberd.cs b/Items/Weapons/HolidayHalberd.cs index 668b7301a6..9f87a207a5 100644 --- a/Items/Weapons/HolidayHalberd.cs +++ b/Items/Weapons/HolidayHalberd.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Weapons case 1: dustType = 107; break; case 2: dustType = 90; break; } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, dustType); } @@ -50,7 +50,7 @@ namespace CalamityMod.Items.Weapons public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { type = mod.ProjectileType("GreenBall"); } diff --git a/Items/Weapons/Impaler.cs b/Items/Weapons/Impaler.cs index 9f1bbb7b09..909df1a264 100644 --- a/Items/Weapons/Impaler.cs +++ b/Items/Weapons/Impaler.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Weapons { float SpeedX = speedX + (float)Main.rand.Next(-2, 3) * 0.05f; float SpeedY = speedY + (float)Main.rand.Next(-2, 3) * 0.05f; - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, mod.ProjectileType("ExplodingStake"), damage, knockBack, player.whoAmI, 0f, 0f); } diff --git a/Items/Weapons/InfernaCutter.cs b/Items/Weapons/InfernaCutter.cs index 3b40abe08e..e9dbdd5502 100644 --- a/Items/Weapons/InfernaCutter.cs +++ b/Items/Weapons/InfernaCutter.cs @@ -111,7 +111,7 @@ namespace CalamityMod.Items.Weapons Projectile.NewProjectile((float)(hitbox.X + hitbox.Width / 2) + num342, (float)(hitbox.Y + hitbox.Height / 2) + num341, (float)player.direction * num340, num339 * player.gravDir, ProjectileID.Spark, (int)((float)item.damage * 0.1f * player.meleeDamage), 0f, player.whoAmI, 0f, 0f); } } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 6); } diff --git a/Items/Weapons/Leviathan/Greentide.cs b/Items/Weapons/Leviathan/Greentide.cs index 1c521bf73c..b38283acae 100644 --- a/Items/Weapons/Leviathan/Greentide.cs +++ b/Items/Weapons/Leviathan/Greentide.cs @@ -107,7 +107,7 @@ namespace CalamityMod.Items.Weapons.Leviathan { randomDust = 89; } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, randomDust); } diff --git a/Items/Weapons/Leviathan/Leviatitan.cs b/Items/Weapons/Leviathan/Leviatitan.cs index 3b4b4d2418..4454f6d0f9 100644 --- a/Items/Weapons/Leviathan/Leviatitan.cs +++ b/Items/Weapons/Leviathan/Leviatitan.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Items.Weapons.Leviathan { float SpeedX = speedX + (float)Main.rand.Next(-10, 11) * 0.05f; float SpeedY = speedY + (float)Main.rand.Next(-10, 11) * 0.05f; - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, mod.ProjectileType("AquaBlastToxic"), (int)((double)damage * 1.5), knockBack, player.whoAmI, 0f, 0f); } diff --git a/Items/Weapons/LifefruitScythe.cs b/Items/Weapons/LifefruitScythe.cs index 2ce11862ab..d7ecf7b1d6 100644 --- a/Items/Weapons/LifefruitScythe.cs +++ b/Items/Weapons/LifefruitScythe.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 75); } diff --git a/Items/Weapons/Lucrecia.cs b/Items/Weapons/Lucrecia.cs index e39cbeba86..cb452f9f3b 100644 --- a/Items/Weapons/Lucrecia.cs +++ b/Items/Weapons/Lucrecia.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 234); } diff --git a/Items/Weapons/LunarianBow.cs b/Items/Weapons/LunarianBow.cs index 9ca8e6dbf4..4bf2cff754 100644 --- a/Items/Weapons/LunarianBow.cs +++ b/Items/Weapons/LunarianBow.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Items.Weapons for (int num119 = 0; num119 < num118; num119++) { float num120 = (float)num119 - ((float)num118 - 1f) / 2f; - Vector2 value9 = vector7.RotatedBy((double)(num117 * num120), default(Vector2)); + Vector2 value9 = vector7.RotatedBy((double)(num117 * num120), default); if (!flag11) { value9 -= vector7; diff --git a/Items/Weapons/MajesticGuard.cs b/Items/Weapons/MajesticGuard.cs index 1c5fa4034d..23651823b5 100644 --- a/Items/Weapons/MajesticGuard.cs +++ b/Items/Weapons/MajesticGuard.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Weapons public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) target.defense -= 10; // Healing effect does not trigger versus dummies diff --git a/Items/Weapons/MantisClaws.cs b/Items/Weapons/MantisClaws.cs index 1f1e59a2a8..bc9aae75b0 100644 --- a/Items/Weapons/MantisClaws.cs +++ b/Items/Weapons/MantisClaws.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 33); } diff --git a/Items/Weapons/Mariana.cs b/Items/Weapons/Mariana.cs index 5e07106e33..9f1612240a 100644 --- a/Items/Weapons/Mariana.cs +++ b/Items/Weapons/Mariana.cs @@ -64,9 +64,9 @@ namespace CalamityMod.Items.Weapons } for (int num621 = 0; num621 < 30; num621++) { - int num622 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 59, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 59, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -74,10 +74,10 @@ namespace CalamityMod.Items.Weapons } for (int num623 = 0; num623 < 50; num623++) { - int num624 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 59, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 59, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 59, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 59, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } @@ -85,7 +85,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 59); } diff --git a/Items/Weapons/Megafleet.cs b/Items/Weapons/Megafleet.cs index ecf7986ae8..b44bd26e68 100644 --- a/Items/Weapons/Megafleet.cs +++ b/Items/Weapons/Megafleet.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Items.Weapons { float SpeedX = speedX + (float) Main.rand.Next(-5, 6) * 0.05f; float SpeedY = speedY + (float) Main.rand.Next(-5, 6) * 0.05f; - type = (Main.rand.Next(2) == 0 ? mod.ProjectileType("Voidragon") : type); + type = (Main.rand.NextBool(2) ? mod.ProjectileType("Voidragon") : type); Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f); return false; } diff --git a/Items/Weapons/Monsoon.cs b/Items/Weapons/Monsoon.cs index d599244152..25b3bce6b1 100644 --- a/Items/Weapons/Monsoon.cs +++ b/Items/Weapons/Monsoon.cs @@ -47,18 +47,18 @@ namespace CalamityMod.Items.Weapons for (int num119 = 0; num119 < num118; num119++) { float num120 = (float)num119 - ((float)num118 - 1f) / 2f; - Vector2 value9 = vector7.RotatedBy((double)(num117 * num120), default(Vector2)); + Vector2 value9 = vector7.RotatedBy((double)(num117 * num120), default); if (!flag11) { value9 -= vector7; } if (type == ProjectileID.WoodenArrowFriendly) { - if (Main.rand.Next(12) == 0) + if (Main.rand.NextBool(12)) { type = 408; } - if (Main.rand.Next(25) == 0) + if (Main.rand.NextBool(25)) { type = mod.ProjectileType("TyphoonArrow"); } diff --git a/Items/Weapons/NeptunesBounty.cs b/Items/Weapons/NeptunesBounty.cs index e5fbf7163a..09484454f2 100644 --- a/Items/Weapons/NeptunesBounty.cs +++ b/Items/Weapons/NeptunesBounty.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 33); } diff --git a/Items/Weapons/NettlelineGreatbow.cs b/Items/Weapons/NettlelineGreatbow.cs index 412151c587..d75dd78f82 100644 --- a/Items/Weapons/NettlelineGreatbow.cs +++ b/Items/Weapons/NettlelineGreatbow.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Items.Weapons for (int num119 = 0; num119 < num118; num119++) { float num120 = (float)num119 - ((float)num118 - 1f) / 2f; - Vector2 value9 = vector7.RotatedBy((double)(num117 * num120), default(Vector2)); + Vector2 value9 = vector7.RotatedBy((double)(num117 * num120), default); if (!flag11) { value9 -= vector7; diff --git a/Items/Weapons/NightsStabber.cs b/Items/Weapons/NightsStabber.cs index fea0264b38..f79c17af58 100644 --- a/Items/Weapons/NightsStabber.cs +++ b/Items/Weapons/NightsStabber.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 14); } diff --git a/Items/Weapons/OldLordOathsword.cs b/Items/Weapons/OldLordOathsword.cs index 214e871650..fde87a51dc 100644 --- a/Items/Weapons/OldLordOathsword.cs +++ b/Items/Weapons/OldLordOathsword.cs @@ -46,14 +46,14 @@ namespace CalamityMod.Items.Weapons int num3; for (int num53 = 0; num53 < 40; num53 = num3 + 1) { - int num54 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 127, 0f, 0f, 200, default(Color), num50); + int num54 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 127, 0f, 0f, 200, default, num50); Main.dust[num54].position = target.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)target.width / 2f; Main.dust[num54].noGravity = true; Dust dust = Main.dust[num54]; dust.velocity *= 3f; dust = Main.dust[num54]; dust.velocity += value4 * Main.rand.NextFloat(); - num54 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 127, 0f, 0f, 100, default(Color), num51); + num54 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 127, 0f, 0f, 100, default, num51); Main.dust[num54].position = target.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)target.width / 2f; dust = Main.dust[num54]; dust.velocity *= 2f; @@ -66,8 +66,8 @@ namespace CalamityMod.Items.Weapons } for (int num55 = 0; num55 < 20; num55 = num3 + 1) { - int num56 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 127, 0f, 0f, 0, default(Color), num52); - Main.dust[num56].position = target.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)target.velocity.ToRotation(), default(Vector2)) * (float)target.width / 3f; + int num56 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 127, 0f, 0f, 0, default, num52); + Main.dust[num56].position = target.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)target.velocity.ToRotation(), default) * (float)target.width / 3f; Main.dust[num56].noGravity = true; Dust dust = Main.dust[num56]; dust.velocity *= 0.5f; diff --git a/Items/Weapons/OmegaBiomeBlade.cs b/Items/Weapons/OmegaBiomeBlade.cs index c7948e8b6e..e1b28966fe 100644 --- a/Items/Weapons/OmegaBiomeBlade.cs +++ b/Items/Weapons/OmegaBiomeBlade.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 0); } diff --git a/Items/Weapons/Omniblade.cs b/Items/Weapons/Omniblade.cs index 14e96dbab6..155a2d5f17 100644 --- a/Items/Weapons/Omniblade.cs +++ b/Items/Weapons/Omniblade.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Weapons public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { target.AddBuff(mod.BuffType("WhisperingDeath"), 360); } diff --git a/Items/Weapons/Perforators/BloodBath.cs b/Items/Weapons/Perforators/BloodBath.cs index 79aadc15af..f50389ddb4 100644 --- a/Items/Weapons/Perforators/BloodBath.cs +++ b/Items/Weapons/Perforators/BloodBath.cs @@ -71,11 +71,11 @@ namespace CalamityMod.Items.Weapons.Perforators num78 *= num80; num79 *= num80; int num107 = 2; - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { num107++; } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { num107++; } diff --git a/Items/Weapons/Perforators/BloodyRupture.cs b/Items/Weapons/Perforators/BloodyRupture.cs index 74b1a299db..d67a44f8fb 100644 --- a/Items/Weapons/Perforators/BloodyRupture.cs +++ b/Items/Weapons/Perforators/BloodyRupture.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Weapons.Perforators public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 5); } diff --git a/Items/Weapons/PhoenixBlade.cs b/Items/Weapons/PhoenixBlade.cs index 2f0806d41a..d55fad47e2 100644 --- a/Items/Weapons/PhoenixBlade.cs +++ b/Items/Weapons/PhoenixBlade.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 244); } diff --git a/Items/Weapons/Plaguebringer/PlagueStaff.cs b/Items/Weapons/Plaguebringer/PlagueStaff.cs index d4d41a5104..f8ab54b579 100644 --- a/Items/Weapons/Plaguebringer/PlagueStaff.cs +++ b/Items/Weapons/Plaguebringer/PlagueStaff.cs @@ -43,15 +43,15 @@ namespace CalamityMod.Items.Weapons.Plaguebringer float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); int num130 = 6; - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { num130++; } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { num130++; } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { num130++; } diff --git a/Items/Weapons/Polterghast/EtherealSubjugator.cs b/Items/Weapons/Polterghast/EtherealSubjugator.cs index 2298f05816..0a8c1793c8 100644 --- a/Items/Weapons/Polterghast/EtherealSubjugator.cs +++ b/Items/Weapons/Polterghast/EtherealSubjugator.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Items.Weapons.Polterghast vector2.X = (float)Main.mouseX + Main.screenPosition.X; vector2.Y = (float)Main.mouseY + Main.screenPosition.Y; Vector2 spinningpoint = new Vector2(num78, num79); - spinningpoint = spinningpoint.RotatedBy(1.5707963705062866, default(Vector2)); + spinningpoint = spinningpoint.RotatedBy(1.5707963705062866, default); Projectile.NewProjectile(vector2.X + spinningpoint.X, vector2.Y + spinningpoint.Y, spinningpoint.X, spinningpoint.Y, type, damage, num74, i, 0f, 0f); return false; } diff --git a/Items/Weapons/Polterghast/TerrorBlade.cs b/Items/Weapons/Polterghast/TerrorBlade.cs index 76e351d015..a6139f6940 100644 --- a/Items/Weapons/Polterghast/TerrorBlade.cs +++ b/Items/Weapons/Polterghast/TerrorBlade.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Weapons.Polterghast public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 60); } diff --git a/Items/Weapons/ProfanedSword.cs b/Items/Weapons/ProfanedSword.cs index f86207f19e..c01467eb7d 100644 --- a/Items/Weapons/ProfanedSword.cs +++ b/Items/Weapons/ProfanedSword.cs @@ -70,7 +70,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 235); } diff --git a/Items/Weapons/Providence/HolyCollider.cs b/Items/Weapons/Providence/HolyCollider.cs index ec2b176803..655a802603 100644 --- a/Items/Weapons/Providence/HolyCollider.cs +++ b/Items/Weapons/Providence/HolyCollider.cs @@ -38,9 +38,9 @@ namespace CalamityMod.Items.Weapons.Providence Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 14); for (int num621 = 0; num621 < 30; num621++) { - int num622 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 244, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -48,10 +48,10 @@ namespace CalamityMod.Items.Weapons.Providence } for (int num623 = 0; num623 < 50; num623++) { - int num624 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 244, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 244, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 244, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } diff --git a/Items/Weapons/PurityAxe.cs b/Items/Weapons/PurityAxe.cs index 2282c5538a..a3ff3f40e9 100644 --- a/Items/Weapons/PurityAxe.cs +++ b/Items/Weapons/PurityAxe.cs @@ -67,7 +67,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 58); } diff --git a/Items/Weapons/RareVariants/Carnage.cs b/Items/Weapons/RareVariants/Carnage.cs index 30021db6a2..f490677fea 100644 --- a/Items/Weapons/RareVariants/Carnage.cs +++ b/Items/Weapons/RareVariants/Carnage.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.RareVariants public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 5); } @@ -50,9 +50,9 @@ namespace CalamityMod.Items.Weapons.RareVariants target.position.Y = target.position.Y - (float)(target.height / 2); for (int num621 = 0; num621 < 15; num621++) { - int num622 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 5, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 5, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -60,10 +60,10 @@ namespace CalamityMod.Items.Weapons.RareVariants } for (int num623 = 0; num623 < 25; num623++) { - int num624 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 5, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 5, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 5, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 5, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } int num251 = Main.rand.Next(4, 6); diff --git a/Items/Weapons/RareVariants/EvilSmasher.cs b/Items/Weapons/RareVariants/EvilSmasher.cs index 7822e9a6aa..fecd91dca7 100644 --- a/Items/Weapons/RareVariants/EvilSmasher.cs +++ b/Items/Weapons/RareVariants/EvilSmasher.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.RareVariants public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, mod.ProjectileType("FossilSpike"), (int)((float)item.damage * player.meleeDamage), knockback, Main.myPlayer); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { item.damage = 82; item.useAnimation = 15; diff --git a/Items/Weapons/RareVariants/Swordsplosion.cs b/Items/Weapons/RareVariants/Swordsplosion.cs index a184e99f55..1b320641bd 100644 --- a/Items/Weapons/RareVariants/Swordsplosion.cs +++ b/Items/Weapons/RareVariants/Swordsplosion.cs @@ -86,7 +86,7 @@ namespace CalamityMod.Items.Weapons.RareVariants public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int num250 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, 66, (float)(player.direction * 2), 0f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1.3f); Main.dust[num250].velocity *= 0.2f; diff --git a/Items/Weapons/RedSun.cs b/Items/Weapons/RedSun.cs index dca043ac05..2c6ad0b591 100644 --- a/Items/Weapons/RedSun.cs +++ b/Items/Weapons/RedSun.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Items.Weapons { float num72 = item.shootSpeed; Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default(Vector2)); + Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default); Vector2 vector3 = Main.MouseWorld - vector2; float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; @@ -103,7 +103,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 64); } diff --git a/Items/Weapons/RoyalKnivesMelee.cs b/Items/Weapons/RoyalKnivesMelee.cs index 13eaa4e5e2..4e74355e42 100644 --- a/Items/Weapons/RoyalKnivesMelee.cs +++ b/Items/Weapons/RoyalKnivesMelee.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons { float num72 = item.shootSpeed; Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default(Vector2)); + Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default); Vector2 vector3 = Main.MouseWorld - vector2; float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; @@ -62,19 +62,19 @@ namespace CalamityMod.Items.Weapons num78 *= num80; num79 *= num80; int num146 = 4; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { num146++; } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { num146++; } - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { num146++; } - if (Main.rand.Next(16) == 0) + if (Main.rand.NextBool(16)) { num146++; } diff --git a/Items/Weapons/SDFMG.cs b/Items/Weapons/SDFMG.cs index e1c127606a..e6c56dafe9 100644 --- a/Items/Weapons/SDFMG.cs +++ b/Items/Weapons/SDFMG.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons { float SpeedX = speedX + (float)Main.rand.Next(-5, 6) * 0.05f; float SpeedY = speedY + (float)Main.rand.Next(-5, 6) * 0.05f; - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, mod.ProjectileType("FishronRPG"), damage, knockBack, player.whoAmI, 0f, 0f); } diff --git a/Items/Weapons/Seadragon.cs b/Items/Weapons/Seadragon.cs index 6d0da7dfd4..808279b548 100644 --- a/Items/Weapons/Seadragon.cs +++ b/Items/Weapons/Seadragon.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Items.Weapons float SpeedX = speedX + (float) Main.rand.Next(-10, 11) * 0.05f; float SpeedY = speedY + (float) Main.rand.Next(-10, 11) * 0.05f; Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0f, 0f); - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, mod.ProjectileType("SeaDragonRocket"), damage * 2, knockBack, player.whoAmI, 0f, 0f); } diff --git a/Items/Weapons/Shroomer.cs b/Items/Weapons/Shroomer.cs index bd8abf9cd5..20945f851a 100644 --- a/Items/Weapons/Shroomer.cs +++ b/Items/Weapons/Shroomer.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Weapons public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f); - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("Shroom"), (int)((double)damage * 1.5), knockBack, player.whoAmI, 0f, 0f); } diff --git a/Items/Weapons/SlimeGod/CorruptedCrusherBlade.cs b/Items/Weapons/SlimeGod/CorruptedCrusherBlade.cs index 533ebb9bd4..5ade0eb892 100644 --- a/Items/Weapons/SlimeGod/CorruptedCrusherBlade.cs +++ b/Items/Weapons/SlimeGod/CorruptedCrusherBlade.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Weapons.SlimeGod public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 27); } diff --git a/Items/Weapons/SlimeGod/CrimsonCrusherBlade.cs b/Items/Weapons/SlimeGod/CrimsonCrusherBlade.cs index d75f2fc463..7be7f89ef7 100644 --- a/Items/Weapons/SlimeGod/CrimsonCrusherBlade.cs +++ b/Items/Weapons/SlimeGod/CrimsonCrusherBlade.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Weapons.SlimeGod public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 5); } diff --git a/Items/Weapons/SlimeGod/EldritchTome.cs b/Items/Weapons/SlimeGod/EldritchTome.cs index 239117f91a..b9b144d6b8 100644 --- a/Items/Weapons/SlimeGod/EldritchTome.cs +++ b/Items/Weapons/SlimeGod/EldritchTome.cs @@ -52,12 +52,12 @@ namespace CalamityMod.Items.Weapons.SlimeGod value2.Normalize(); value2 *= item.shootSpeed; float num91 = (float)Main.rand.Next(10, 80) * 0.001f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { num91 *= -1f; } float num92 = (float)Main.rand.Next(10, 80) * 0.001f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { num92 *= -1f; } diff --git a/Items/Weapons/SlimeGod/GeliticBlade.cs b/Items/Weapons/SlimeGod/GeliticBlade.cs index a9d883933b..a496707cfc 100644 --- a/Items/Weapons/SlimeGod/GeliticBlade.cs +++ b/Items/Weapons/SlimeGod/GeliticBlade.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Items.Weapons.SlimeGod public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 20); } diff --git a/Items/Weapons/SlimeGod/Goobow.cs b/Items/Weapons/SlimeGod/Goobow.cs index 39fd70f9c8..5b748fe364 100644 --- a/Items/Weapons/SlimeGod/Goobow.cs +++ b/Items/Weapons/SlimeGod/Goobow.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Items.Weapons.SlimeGod for (int num119 = 0; num119 < num118; num119++) { float num120 = (float)num119 - ((float)num118 - 1f) / 2f; - Vector2 value9 = vector7.RotatedBy((double)(num117 * num120), default(Vector2)); + Vector2 value9 = vector7.RotatedBy((double)(num117 * num120), default); if (!flag11) { value9 -= vector7; diff --git a/Items/Weapons/SolsticeClaymore.cs b/Items/Weapons/SolsticeClaymore.cs index 1325555659..58a72e8a62 100644 --- a/Items/Weapons/SolsticeClaymore.cs +++ b/Items/Weapons/SolsticeClaymore.cs @@ -64,7 +64,7 @@ namespace CalamityMod.Items.Weapons 27, 234 }); - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, dustType); Main.dust[dust].noGravity = true; diff --git a/Items/Weapons/SoulHarvester.cs b/Items/Weapons/SoulHarvester.cs index 0b35429037..dd32bc6466 100644 --- a/Items/Weapons/SoulHarvester.cs +++ b/Items/Weapons/SoulHarvester.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 75); } @@ -62,9 +62,9 @@ namespace CalamityMod.Items.Weapons Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, mod.ProjectileType("HiveBombExplosion"), (int)((float)item.damage * player.meleeDamage), knockback, Main.myPlayer); for (int num621 = 0; num621 < 30; num621++) { - int num622 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 89, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 89, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -72,10 +72,10 @@ namespace CalamityMod.Items.Weapons } for (int num623 = 0; num623 < 50; num623++) { - int num624 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 89, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 89, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 89, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 89, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/Items/Weapons/SporeKnife.cs b/Items/Weapons/SporeKnife.cs index 0ad8216290..f76dc5a52c 100644 --- a/Items/Weapons/SporeKnife.cs +++ b/Items/Weapons/SporeKnife.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 2); } diff --git a/Items/Weapons/StardustStaff.cs b/Items/Weapons/StardustStaff.cs index 469a68dd4f..bf7b925834 100644 --- a/Items/Weapons/StardustStaff.cs +++ b/Items/Weapons/StardustStaff.cs @@ -47,19 +47,19 @@ namespace CalamityMod.Items.Weapons float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); int num130 = 6; - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { num130++; } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { num130++; } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { num130++; } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { float num132 = num78; float num133 = num79; diff --git a/Items/Weapons/StellarStriker.cs b/Items/Weapons/StellarStriker.cs index 7601366e60..90c3729c72 100644 --- a/Items/Weapons/StellarStriker.cs +++ b/Items/Weapons/StellarStriker.cs @@ -93,7 +93,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 229); } diff --git a/Items/Weapons/StormRuler.cs b/Items/Weapons/StormRuler.cs index b924580ec1..13d7356511 100644 --- a/Items/Weapons/StormRuler.cs +++ b/Items/Weapons/StormRuler.cs @@ -48,9 +48,9 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { - int num250 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, 187, (float)(player.direction * 2), 0f, 150, default(Color), 1.3f); + int num250 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, 187, (float)(player.direction * 2), 0f, 150, default, 1.3f); Main.dust[num250].velocity *= 0.2f; } } diff --git a/Items/Weapons/StormSaber.cs b/Items/Weapons/StormSaber.cs index 412977f506..613e9d5d48 100644 --- a/Items/Weapons/StormSaber.cs +++ b/Items/Weapons/StormSaber.cs @@ -34,9 +34,9 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { - int num250 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, 187, (float)(player.direction * 2), 0f, 150, default(Color), 1.3f); + int num250 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, 187, (float)(player.direction * 2), 0f, 150, default, 1.3f); Main.dust[num250].velocity *= 0.2f; } } diff --git a/Items/Weapons/SunkenSea/EutrophicShank.cs b/Items/Weapons/SunkenSea/EutrophicShank.cs index fb1f1317dc..56c09471bf 100644 --- a/Items/Weapons/SunkenSea/EutrophicShank.cs +++ b/Items/Weapons/SunkenSea/EutrophicShank.cs @@ -35,9 +35,9 @@ namespace CalamityMod.Items.Weapons.SunkenSea public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 206, 0f, 0f, 100, default(Color), 1f); + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 206, 0f, 0f, 100, default, 1f); } } diff --git a/Items/Weapons/SunkenSea/Serpentine.cs b/Items/Weapons/SunkenSea/Serpentine.cs index 6fb4f92e67..a87adebf81 100644 --- a/Items/Weapons/SunkenSea/Serpentine.cs +++ b/Items/Weapons/SunkenSea/Serpentine.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Items.Weapons.SunkenSea float num72 = item.shootSpeed; player.itemTime = item.useTime; Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default(Vector2)); + Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default); Vector2 vector3 = Main.MouseWorld - vector2; float velX = (float)Main.mouseX + Main.screenPosition.X - vector2.X; float velY = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; diff --git a/Items/Weapons/TemporalFloeSword.cs b/Items/Weapons/TemporalFloeSword.cs index b785696dd6..451cc99bb2 100644 --- a/Items/Weapons/TemporalFloeSword.cs +++ b/Items/Weapons/TemporalFloeSword.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 34); } @@ -53,7 +53,7 @@ namespace CalamityMod.Items.Weapons public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { target.AddBuff(mod.BuffType("GlacialState"), 120); } diff --git a/Items/Weapons/TerraEdge.cs b/Items/Weapons/TerraEdge.cs index b9c0d15519..a0f0fd62a4 100644 --- a/Items/Weapons/TerraEdge.cs +++ b/Items/Weapons/TerraEdge.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 107); } diff --git a/Items/Weapons/TerraShiv.cs b/Items/Weapons/TerraShiv.cs index 3e06d06f92..31d58f9c4d 100644 --- a/Items/Weapons/TerraShiv.cs +++ b/Items/Weapons/TerraShiv.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 107); } diff --git a/Items/Weapons/Terracotta.cs b/Items/Weapons/Terracotta.cs index 004552b08b..24c79d2667 100644 --- a/Items/Weapons/Terracotta.cs +++ b/Items/Weapons/Terracotta.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 246); } diff --git a/Items/Weapons/Terratomere.cs b/Items/Weapons/Terratomere.cs index 1ac0b109c3..d91c0cefbb 100644 --- a/Items/Weapons/Terratomere.cs +++ b/Items/Weapons/Terratomere.cs @@ -74,7 +74,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 107); } @@ -82,7 +82,7 @@ namespace CalamityMod.Items.Weapons public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { target.AddBuff(mod.BuffType("GlacialState"), 300); } diff --git a/Items/Weapons/TheEnforcer.cs b/Items/Weapons/TheEnforcer.cs index 824bf02d12..c8385759b2 100644 --- a/Items/Weapons/TheEnforcer.cs +++ b/Items/Weapons/TheEnforcer.cs @@ -88,7 +88,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 173); } diff --git a/Items/Weapons/TheMutilator.cs b/Items/Weapons/TheMutilator.cs index e3af073fd5..b6b24c4472 100644 --- a/Items/Weapons/TheMutilator.cs +++ b/Items/Weapons/TheMutilator.cs @@ -49,9 +49,9 @@ namespace CalamityMod.Items.Weapons target.position.Y = target.position.Y - (float)(target.height / 2); for (int num621 = 0; num621 < 30; num621++) { - int num622 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 5, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 5, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -59,10 +59,10 @@ namespace CalamityMod.Items.Weapons } for (int num623 = 0; num623 < 50; num623++) { - int num624 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 5, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 5, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 5, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 5, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/Items/Weapons/TheWand.cs b/Items/Weapons/TheWand.cs index 38a3993342..8bdddf3532 100644 --- a/Items/Weapons/TheWand.cs +++ b/Items/Weapons/TheWand.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 6); } diff --git a/Items/Weapons/TomeofFates.cs b/Items/Weapons/TomeofFates.cs index 1be6f9bdf9..caee815020 100644 --- a/Items/Weapons/TomeofFates.cs +++ b/Items/Weapons/TomeofFates.cs @@ -64,12 +64,12 @@ namespace CalamityMod.Items.Weapons value2 *= item.shootSpeed; int projChoice = Main.rand.Next(7); float num91 = (float)Main.rand.Next(10, 160) * 0.001f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { num91 *= -1f; } float num92 = (float)Main.rand.Next(10, 160) * 0.001f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { num92 *= -1f; } diff --git a/Items/Weapons/Trinity.cs b/Items/Weapons/Trinity.cs index 594233c90e..8a5f88ced5 100644 --- a/Items/Weapons/Trinity.cs +++ b/Items/Weapons/Trinity.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 73); } diff --git a/Items/Weapons/Triploon.cs b/Items/Weapons/Triploon.cs index 759e4da4e0..f68cc270cc 100644 --- a/Items/Weapons/Triploon.cs +++ b/Items/Weapons/Triploon.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Items.Weapons for (int num119 = 0; num119 < num118; num119++) { float num120 = (float)num119 - ((float)num118 - 1f) / 2f; - Vector2 value9 = vector7.RotatedBy((double)(num117 * num120), default(Vector2)); + Vector2 value9 = vector7.RotatedBy((double)(num117 * num120), default); if (!flag11) { value9 -= vector7; diff --git a/Items/Weapons/TrueArkoftheAncients.cs b/Items/Weapons/TrueArkoftheAncients.cs index 18baa39630..3f0fd384b2 100644 --- a/Items/Weapons/TrueArkoftheAncients.cs +++ b/Items/Weapons/TrueArkoftheAncients.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Items.Weapons num74 = player.GetWeaponKnockback(item, num74); player.itemTime = item.useTime; Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default(Vector2)); + Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default); Vector2 vector3 = Main.MouseWorld - vector2; float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; @@ -113,7 +113,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int num249 = Main.rand.Next(3); if (num249 == 0) @@ -128,14 +128,14 @@ namespace CalamityMod.Items.Weapons { num249 = 58; } - int num250 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, num249, (float)(player.direction * 2), 0f, 150, default(Color), 1.3f); + int num250 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, num249, (float)(player.direction * 2), 0f, 150, default, 1.3f); Main.dust[num250].velocity *= 0.2f; } } public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { target.AddBuff(mod.BuffType("HolyLight"), 300); } diff --git a/Items/Weapons/TrueBiomeBlade.cs b/Items/Weapons/TrueBiomeBlade.cs index 1dd1d95305..fabd352b47 100644 --- a/Items/Weapons/TrueBiomeBlade.cs +++ b/Items/Weapons/TrueBiomeBlade.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 0); } diff --git a/Items/Weapons/TrueBloodyEdge.cs b/Items/Weapons/TrueBloodyEdge.cs index 3b1089b77a..1d453c2c4d 100644 --- a/Items/Weapons/TrueBloodyEdge.cs +++ b/Items/Weapons/TrueBloodyEdge.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 5); } @@ -57,7 +57,7 @@ namespace CalamityMod.Items.Weapons return; } int healAmount = (Main.rand.Next(6) + 1); - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { player.statLife += healAmount; player.HealEffect(healAmount); diff --git a/Items/Weapons/TrueCausticEdge.cs b/Items/Weapons/TrueCausticEdge.cs index cc3aaa47e7..de48045f56 100644 --- a/Items/Weapons/TrueCausticEdge.cs +++ b/Items/Weapons/TrueCausticEdge.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 74); } diff --git a/Items/Weapons/TrueExcaliburShortsword.cs b/Items/Weapons/TrueExcaliburShortsword.cs index 60d3f0c968..4216eb82e1 100644 --- a/Items/Weapons/TrueExcaliburShortsword.cs +++ b/Items/Weapons/TrueExcaliburShortsword.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 57); } diff --git a/Items/Weapons/TrueForbiddenOathblade.cs b/Items/Weapons/TrueForbiddenOathblade.cs index 88baf4d37e..30b6105121 100644 --- a/Items/Weapons/TrueForbiddenOathblade.cs +++ b/Items/Weapons/TrueForbiddenOathblade.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 173); } @@ -82,7 +82,7 @@ namespace CalamityMod.Items.Weapons int num3; for (int num53 = 0; num53 < 40; num53 = num3 + 1) { - int num54 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 173, 0f, 0f, 200, default(Color), num50); + int num54 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 173, 0f, 0f, 200, default, num50); Main.dust[num54].position = target.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)target.width / 2f; Main.dust[num54].noGravity = true; Dust dust = Main.dust[num54]; @@ -90,7 +90,7 @@ namespace CalamityMod.Items.Weapons dust.velocity *= 3f; dust = Main.dust[num54]; dust.velocity += value4 * Main.rand.NextFloat(); - num54 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 173, 0f, 0f, 100, default(Color), num51); + num54 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 173, 0f, 0f, 100, default, num51); Main.dust[num54].position = target.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)target.width / 2f; dust = Main.dust[num54]; dust.velocity.Y -= 3f; @@ -104,8 +104,8 @@ namespace CalamityMod.Items.Weapons } for (int num55 = 0; num55 < 20; num55 = num3 + 1) { - int num56 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 173, 0f, 0f, 0, default(Color), num52); - Main.dust[num56].position = target.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)target.velocity.ToRotation(), default(Vector2)) * (float)target.width / 3f; + int num56 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 173, 0f, 0f, 0, default, num52); + Main.dust[num56].position = target.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)target.velocity.ToRotation(), default) * (float)target.width / 3f; Main.dust[num56].noGravity = true; Dust dust = Main.dust[num56]; dust.velocity.Y -= 1.5f; diff --git a/Items/Weapons/TrueNightsStabber.cs b/Items/Weapons/TrueNightsStabber.cs index 1713e1762b..12b872a781 100644 --- a/Items/Weapons/TrueNightsStabber.cs +++ b/Items/Weapons/TrueNightsStabber.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 21); } diff --git a/Items/Weapons/TrueTyrantYharimsUltisword.cs b/Items/Weapons/TrueTyrantYharimsUltisword.cs index c42b9ba3d6..989f591012 100644 --- a/Items/Weapons/TrueTyrantYharimsUltisword.cs +++ b/Items/Weapons/TrueTyrantYharimsUltisword.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 106); } diff --git a/Items/Weapons/TyrantYharimsUltisword.cs b/Items/Weapons/TyrantYharimsUltisword.cs index c5fc30c9a0..8bf6b03e28 100644 --- a/Items/Weapons/TyrantYharimsUltisword.cs +++ b/Items/Weapons/TyrantYharimsUltisword.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 106); } diff --git a/Items/Weapons/Vortexpopper.cs b/Items/Weapons/Vortexpopper.cs index 1bfa2650cf..ac39097562 100644 --- a/Items/Weapons/Vortexpopper.cs +++ b/Items/Weapons/Vortexpopper.cs @@ -71,14 +71,14 @@ namespace CalamityMod.Items.Weapons float ai = new Vector2(num78, num79).ToRotation(); float num96 = 2.09439516f; int num97 = Main.rand.Next(6, 10); - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { num97++; } for (int num98 = 0; num98 < num97; num98++) { float scaleFactor2 = (float)Main.rand.NextDouble() * 0.2f + 0.05f; - Vector2 vector6 = new Vector2(num78, num79).RotatedBy((double)(num96 * (float)Main.rand.NextDouble() - num96 / 2f), default(Vector2)) * scaleFactor2; + Vector2 vector6 = new Vector2(num78, num79).RotatedBy((double)(num96 * (float)Main.rand.NextDouble() - num96 / 2f), default) * scaleFactor2; int num99 = Projectile.NewProjectile(position.X, position.Y, vector6.X, vector6.Y, 444, damage, knockBack, player.whoAmI, ai, 0f); Main.projectile[num99].localAI[0] = (float)type; Main.projectile[num99].localAI[1] = 12f; diff --git a/Items/Weapons/WindBlade.cs b/Items/Weapons/WindBlade.cs index 6503913224..55138c7bad 100644 --- a/Items/Weapons/WindBlade.cs +++ b/Items/Weapons/WindBlade.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 59); } diff --git a/Items/Weapons/XerocsGreatsword.cs b/Items/Weapons/XerocsGreatsword.cs index a428cbbe7b..7b3b013796 100644 --- a/Items/Weapons/XerocsGreatsword.cs +++ b/Items/Weapons/XerocsGreatsword.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Items.Weapons public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 27); } diff --git a/Items/Weapons/Yharon/DragonRage.cs b/Items/Weapons/Yharon/DragonRage.cs index 31665ab451..0cff2143ed 100644 --- a/Items/Weapons/Yharon/DragonRage.cs +++ b/Items/Weapons/Yharon/DragonRage.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Items.Weapons.Yharon public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 244); } diff --git a/Items/Weapons/Yharon/PhoenixFlameBarrage.cs b/Items/Weapons/Yharon/PhoenixFlameBarrage.cs index f524c9ad47..6b2ff553cf 100644 --- a/Items/Weapons/Yharon/PhoenixFlameBarrage.cs +++ b/Items/Weapons/Yharon/PhoenixFlameBarrage.cs @@ -63,11 +63,11 @@ namespace CalamityMod.Items.Weapons.Yharon num78 *= num80; num79 *= num80; int num107 = 30; - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { num107++; } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { num107++; } diff --git a/Items/Weapons/Yharon/TheBurningSky.cs b/Items/Weapons/Yharon/TheBurningSky.cs index c9a8d91b93..dc055ff19a 100644 --- a/Items/Weapons/Yharon/TheBurningSky.cs +++ b/Items/Weapons/Yharon/TheBurningSky.cs @@ -89,7 +89,7 @@ namespace CalamityMod.Items.Weapons.Yharon public override void MeleeEffects(Player player, Rectangle hitbox) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 244); } diff --git a/Items/Yharon/YharimsGift.cs b/Items/Yharon/YharimsGift.cs index 3459b8480b..e20b7d0c46 100644 --- a/Items/Yharon/YharimsGift.cs +++ b/Items/Yharon/YharimsGift.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Items.Yharon } if (player.immune) { - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { if (player.whoAmI == Main.myPlayer) { diff --git a/NPCs/AbyssNPCs/AquaticParasite.cs b/NPCs/AbyssNPCs/AquaticParasite.cs index bbd4859c50..5e7b507c5b 100644 --- a/NPCs/AbyssNPCs/AquaticParasite.cs +++ b/NPCs/AbyssNPCs/AquaticParasite.cs @@ -203,13 +203,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 15; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/AquaticParasite1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/AquaticParasite2"), 1f); diff --git a/NPCs/AbyssNPCs/AquaticScourgeBody.cs b/NPCs/AbyssNPCs/AquaticScourgeBody.cs index 61774cbc25..e07984914e 100644 --- a/NPCs/AbyssNPCs/AquaticScourgeBody.cs +++ b/NPCs/AbyssNPCs/AquaticScourgeBody.cs @@ -117,7 +117,7 @@ namespace CalamityMod.NPCs.AbyssNPCs { npc.active = false; } - if (Main.netMode != 1 && detectsPlayer) + if (Main.netMode != NetmodeID.MultiplayerClient && detectsPlayer) { int num = (Main.expertMode || CalamityWorld.bossRushActive) ? 4 : 3; npc.localAI[0] += (float)Main.rand.Next(num); @@ -235,13 +235,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/ASBody"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/ASBody2"), 1f); diff --git a/NPCs/AbyssNPCs/AquaticScourgeBodyAlt.cs b/NPCs/AbyssNPCs/AquaticScourgeBodyAlt.cs index 30ffa9773d..ab397a6eef 100644 --- a/NPCs/AbyssNPCs/AquaticScourgeBodyAlt.cs +++ b/NPCs/AbyssNPCs/AquaticScourgeBodyAlt.cs @@ -125,7 +125,7 @@ namespace CalamityMod.NPCs.AbyssNPCs { npc.active = false; } - if (Main.netMode != 1 && detectsPlayer) + if (Main.netMode != NetmodeID.MultiplayerClient && detectsPlayer) { npc.localAI[0] += (float)Main.rand.Next(4); if (npc.localAI[0] >= (float)Main.rand.Next(700, 10000)) @@ -241,13 +241,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/ASBodyAlt"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/ASBodyAlt2"), 1f); diff --git a/NPCs/AbyssNPCs/AquaticScourgeHead.cs b/NPCs/AbyssNPCs/AquaticScourgeHead.cs index 083d7683d8..e3cd2c0999 100644 --- a/NPCs/AbyssNPCs/AquaticScourgeHead.cs +++ b/NPCs/AbyssNPCs/AquaticScourgeHead.cs @@ -109,7 +109,7 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.TargetClosest(true); } npc.velocity.Length(); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (!TailSpawned && npc.ai[0] == 0f) { @@ -463,7 +463,7 @@ namespace CalamityMod.NPCs.AbyssNPCs public void BarfShitUp() { Main.PlaySound(4, (int)npc.position.X, (int)npc.position.Y, 13); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { Vector2 valueBoom = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); float spreadBoom = 15f * 0.0174f; @@ -474,7 +474,7 @@ namespace CalamityMod.NPCs.AbyssNPCs int damageBoom = (Main.expertMode || CalamityWorld.bossRushActive) ? 28 : 33; for (iBoom = 0; iBoom < 15; iBoom++) { - int projectileType = (Main.rand.Next(2) == 0 ? mod.ProjectileType("SandTooth") : mod.ProjectileType("SandBlast")); + int projectileType = (Main.rand.NextBool(2) ? mod.ProjectileType("SandTooth") : mod.ProjectileType("SandBlast")); if (projectileType == mod.ProjectileType("SandTooth")) { damageBoom = Main.expertMode ? 24 : 30; @@ -606,13 +606,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 15; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/ASHead"), 1f); } @@ -624,14 +624,14 @@ namespace CalamityMod.NPCs.AbyssNPCs { return false; } - if (npc.timeLeft <= 0 && Main.netMode != 1) + if (npc.timeLeft <= 0 && Main.netMode != NetmodeID.MultiplayerClient) { for (int k = (int)npc.ai[0]; k > 0; k = (int)Main.npc[k].ai[0]) { if (Main.npc[k].active) { Main.npc[k].active = false; - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { Main.npc[k].life = 0; Main.npc[k].netSkip = -1; diff --git a/NPCs/AbyssNPCs/AquaticScourgeTail.cs b/NPCs/AbyssNPCs/AquaticScourgeTail.cs index 79e5ee7371..02bb2e49dc 100644 --- a/NPCs/AbyssNPCs/AquaticScourgeTail.cs +++ b/NPCs/AbyssNPCs/AquaticScourgeTail.cs @@ -212,13 +212,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/ASTail"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/ASTail2"), 1f); diff --git a/NPCs/AbyssNPCs/AquaticSeekerBody.cs b/NPCs/AbyssNPCs/AquaticSeekerBody.cs index 81641080c7..c5fb011643 100644 --- a/NPCs/AbyssNPCs/AquaticSeekerBody.cs +++ b/NPCs/AbyssNPCs/AquaticSeekerBody.cs @@ -153,13 +153,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/AquaticSeekerBody"), 1f); } diff --git a/NPCs/AbyssNPCs/AquaticSeekerHead.cs b/NPCs/AbyssNPCs/AquaticSeekerHead.cs index 303ec7fd2d..076204779c 100644 --- a/NPCs/AbyssNPCs/AquaticSeekerHead.cs +++ b/NPCs/AbyssNPCs/AquaticSeekerHead.cs @@ -61,7 +61,7 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.TargetClosest(true); } npc.velocity.Length(); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (!TailSpawned && npc.ai[0] == 0f) { @@ -328,13 +328,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/AquaticSeekerHead"), 1f); } @@ -342,14 +342,14 @@ namespace CalamityMod.NPCs.AbyssNPCs public override bool CheckActive() { - if (npc.timeLeft <= 0 && Main.netMode != 1) + if (npc.timeLeft <= 0 && Main.netMode != NetmodeID.MultiplayerClient) { for (int k = (int)npc.ai[0]; k > 0; k = (int)Main.npc[k].ai[0]) { if (Main.npc[k].active) { Main.npc[k].active = false; - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { Main.npc[k].life = 0; Main.npc[k].netSkip = -1; diff --git a/NPCs/AbyssNPCs/AquaticSeekerTail.cs b/NPCs/AbyssNPCs/AquaticSeekerTail.cs index 67d932d937..e2d9664513 100644 --- a/NPCs/AbyssNPCs/AquaticSeekerTail.cs +++ b/NPCs/AbyssNPCs/AquaticSeekerTail.cs @@ -153,13 +153,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/AquaticSeekerTail"), 1f); } diff --git a/NPCs/AbyssNPCs/AquaticUrchin.cs b/NPCs/AbyssNPCs/AquaticUrchin.cs index fe000afad0..3f3d77cd6c 100644 --- a/NPCs/AbyssNPCs/AquaticUrchin.cs +++ b/NPCs/AbyssNPCs/AquaticUrchin.cs @@ -114,7 +114,7 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.velocity.Y = npc.velocity.Y - (npc.wet ? 12f : 4f); for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 33, 0f, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 33, 0f, -1f, 0, default, 1f); } } if (npc.ai[3] < (float)num) @@ -345,13 +345,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/AquaticUrchin"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/AquaticUrchin2"), 1f); diff --git a/NPCs/AbyssNPCs/Bloatfish.cs b/NPCs/AbyssNPCs/Bloatfish.cs index ea5b73e993..4bc2e02451 100644 --- a/NPCs/AbyssNPCs/Bloatfish.cs +++ b/NPCs/AbyssNPCs/Bloatfish.cs @@ -187,17 +187,17 @@ namespace CalamityMod.NPCs.AbyssNPCs public override void NPCLoot() { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Voidstone"), Main.rand.Next(10, 21)); - if (Main.rand.Next(1000000) == 0 && CalamityWorld.revenge) + if (Main.rand.NextBool(1000000) && CalamityWorld.revenge) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HalibutCannon")); } if (NPC.downedPlantBoss || CalamityWorld.downedCalamitas) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DepthCells"), Main.rand.Next(5, 8)); } - if (Main.expertMode && Main.rand.Next(2) == 0) + if (Main.expertMode && Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DepthCells"), Main.rand.Next(2, 4)); } @@ -208,13 +208,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 50; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } } if (npc.scale < 2f) diff --git a/NPCs/AbyssNPCs/BobbitWormHead.cs b/NPCs/AbyssNPCs/BobbitWormHead.cs index 25bff2dbef..3b29d3d6ad 100644 --- a/NPCs/AbyssNPCs/BobbitWormHead.cs +++ b/NPCs/AbyssNPCs/BobbitWormHead.cs @@ -235,17 +235,17 @@ namespace CalamityMod.NPCs.AbyssNPCs public override void NPCLoot() { - if (Main.rand.Next(1000000) == 0 && CalamityWorld.revenge) + if (Main.rand.NextBool(1000000) && CalamityWorld.revenge) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HalibutCannon")); } if (NPC.downedPlantBoss || CalamityWorld.downedCalamitas) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DepthCells"), Main.rand.Next(5, 8)); } - if (Main.expertMode && Main.rand.Next(2) == 0) + if (Main.expertMode && Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DepthCells"), Main.rand.Next(2, 4)); } @@ -256,13 +256,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BobbitWorm"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BobbitWorm2"), 1f); diff --git a/NPCs/AbyssNPCs/BobbitWormSegment.cs b/NPCs/AbyssNPCs/BobbitWormSegment.cs index 8cacb94899..0a0ddc566e 100644 --- a/NPCs/AbyssNPCs/BobbitWormSegment.cs +++ b/NPCs/AbyssNPCs/BobbitWormSegment.cs @@ -32,7 +32,7 @@ namespace CalamityMod.NPCs.AbyssNPCs public override void AI() { CalamityGlobalNPC.bobbitWormBottom = npc.whoAmI; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (npc.localAI[0] == 0f) { diff --git a/NPCs/AbyssNPCs/BoxJellyfish.cs b/NPCs/AbyssNPCs/BoxJellyfish.cs index 801b465ea9..bad480450e 100644 --- a/NPCs/AbyssNPCs/BoxJellyfish.cs +++ b/NPCs/AbyssNPCs/BoxJellyfish.cs @@ -198,13 +198,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 15; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/AbyssNPCs/Catfish.cs b/NPCs/AbyssNPCs/Catfish.cs index 327e68a9af..58d08c6c8e 100644 --- a/NPCs/AbyssNPCs/Catfish.cs +++ b/NPCs/AbyssNPCs/Catfish.cs @@ -252,7 +252,7 @@ namespace CalamityMod.NPCs.AbyssNPCs public override void NPCLoot() { - if (Main.rand.Next(25) == 0) + if (Main.rand.NextBool(25)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.DivingHelmet); } @@ -262,13 +262,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 25; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/AbyssNPCs/ChaoticPuffer.cs b/NPCs/AbyssNPCs/ChaoticPuffer.cs index 229a3e8f15..5133e72cc8 100644 --- a/NPCs/AbyssNPCs/ChaoticPuffer.cs +++ b/NPCs/AbyssNPCs/ChaoticPuffer.cs @@ -115,7 +115,7 @@ namespace CalamityMod.NPCs.AbyssNPCs public void Boom() { Main.PlaySound(4, (int)npc.position.X, (int)npc.position.Y, 14); - if (Main.netMode != 1 && puffedUp) + if (Main.netMode != NetmodeID.MultiplayerClient && puffedUp) { int damageBoom = 100; int projectileType = mod.ProjectileType("PufferExplosion"); @@ -211,7 +211,7 @@ namespace CalamityMod.NPCs.AbyssNPCs public override void NPCLoot() { - if (Main.rand.Next(1000000) == 0 && CalamityWorld.revenge) + if (Main.rand.NextBool(1000000) && CalamityWorld.revenge) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HalibutCannon")); } @@ -242,7 +242,7 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -250,7 +250,7 @@ namespace CalamityMod.NPCs.AbyssNPCs for (int k = 0; k < 15; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/AbyssNPCs/ColossalSquid.cs b/NPCs/AbyssNPCs/ColossalSquid.cs index ad483022a6..010a90c3a5 100644 --- a/NPCs/AbyssNPCs/ColossalSquid.cs +++ b/NPCs/AbyssNPCs/ColossalSquid.cs @@ -84,7 +84,7 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.ai[3] = 0f; npc.netUpdate = true; } - if (Main.rand.Next(300) == 0) + if (Main.rand.NextBool(300)) { Main.PlaySound(29, (int)npc.position.X, (int)npc.position.Y, 34); } @@ -331,7 +331,7 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.chaseable = hasBeenHit; if (hasBeenHit) { - if (Main.rand.Next(300) == 0) + if (Main.rand.NextBool(300)) { Main.PlaySound(29, (int)npc.position.X, (int)npc.position.Y, 34); } @@ -378,7 +378,7 @@ namespace CalamityMod.NPCs.AbyssNPCs } npc.localAI[2] = 1f; npc.localAI[0] += 1f; - if (Main.netMode != 1 && npc.localAI[0] >= 150f) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] >= 150f) { npc.localAI[0] = 0f; npc.netUpdate = true; @@ -411,7 +411,7 @@ namespace CalamityMod.NPCs.AbyssNPCs } else { - if (Main.rand.Next(300) == 0) + if (Main.rand.NextBool(300)) { Main.PlaySound(29, (int)npc.position.X, (int)npc.position.Y, 35); } @@ -553,24 +553,24 @@ namespace CalamityMod.NPCs.AbyssNPCs public override void NPCLoot() { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.BlackInk, Main.rand.Next(3, 6)); - if (Main.rand.Next(10000) == 0 && CalamityWorld.revenge) + if (Main.rand.NextBool(10000) && CalamityWorld.revenge) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HalibutCannon")); } if (CalamityWorld.downedPolterghast) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CalamarisLament")); } } if (NPC.downedPlantBoss || CalamityWorld.downedCalamitas) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DepthCells"), Main.rand.Next(26, 39)); } - if (Main.expertMode && Main.rand.Next(2) == 0) + if (Main.expertMode && Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DepthCells"), Main.rand.Next(5, 8)); } @@ -581,13 +581,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 30; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ColossalSquid"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ColossalSquid2"), 1f); diff --git a/NPCs/AbyssNPCs/Cuttlefish.cs b/NPCs/AbyssNPCs/Cuttlefish.cs index 1ed1e9005e..4277356629 100644 --- a/NPCs/AbyssNPCs/Cuttlefish.cs +++ b/NPCs/AbyssNPCs/Cuttlefish.cs @@ -312,11 +312,11 @@ namespace CalamityMod.NPCs.AbyssNPCs public override void NPCLoot() { - if (Main.rand.Next(1000000) == 0 && CalamityWorld.revenge) + if (Main.rand.NextBool(1000000) && CalamityWorld.revenge) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HalibutCannon")); } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CloakingGland")); } @@ -326,13 +326,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 15; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/AbyssNPCs/DevilFish.cs b/NPCs/AbyssNPCs/DevilFish.cs index 60bb396539..ab552a88b2 100644 --- a/NPCs/AbyssNPCs/DevilFish.cs +++ b/NPCs/AbyssNPCs/DevilFish.cs @@ -307,21 +307,21 @@ namespace CalamityMod.NPCs.AbyssNPCs public override void NPCLoot() { - if (Main.rand.Next(1000000) == 0 && CalamityWorld.revenge) + if (Main.rand.NextBool(1000000) && CalamityWorld.revenge) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HalibutCannon")); } if (NPC.downedPlantBoss || CalamityWorld.downedCalamitas) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Lumenite")); } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DepthCells"), Main.rand.Next(1, 3)); } - if (Main.expertMode && Main.rand.Next(2) == 0) + if (Main.expertMode && Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DepthCells")); } @@ -329,7 +329,7 @@ namespace CalamityMod.NPCs.AbyssNPCs if (NPC.downedGolemBoss) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ChaoticOre"), Main.rand.Next(3, 10)); - if (Main.rand.Next(200) == 0) + if (Main.rand.NextBool(200)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Hellborn")); } @@ -340,13 +340,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 25; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } } diff --git a/NPCs/AbyssNPCs/EidolonWyrmBody.cs b/NPCs/AbyssNPCs/EidolonWyrmBody.cs index 7188867c3f..8d83ac19be 100644 --- a/NPCs/AbyssNPCs/EidolonWyrmBody.cs +++ b/NPCs/AbyssNPCs/EidolonWyrmBody.cs @@ -167,13 +167,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Wyrm2"), 1f); } diff --git a/NPCs/AbyssNPCs/EidolonWyrmBodyAlt.cs b/NPCs/AbyssNPCs/EidolonWyrmBodyAlt.cs index ff7d568154..48dc68d3f7 100644 --- a/NPCs/AbyssNPCs/EidolonWyrmBodyAlt.cs +++ b/NPCs/AbyssNPCs/EidolonWyrmBodyAlt.cs @@ -167,13 +167,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Wyrm3"), 1f); } diff --git a/NPCs/AbyssNPCs/EidolonWyrmBodyAltHuge.cs b/NPCs/AbyssNPCs/EidolonWyrmBodyAltHuge.cs index dbf321e70c..3aab62a478 100644 --- a/NPCs/AbyssNPCs/EidolonWyrmBodyAltHuge.cs +++ b/NPCs/AbyssNPCs/EidolonWyrmBodyAltHuge.cs @@ -167,13 +167,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WyrmAdult3"), 1f); } diff --git a/NPCs/AbyssNPCs/EidolonWyrmBodyHuge.cs b/NPCs/AbyssNPCs/EidolonWyrmBodyHuge.cs index 0647fe380a..35bf4ee544 100644 --- a/NPCs/AbyssNPCs/EidolonWyrmBodyHuge.cs +++ b/NPCs/AbyssNPCs/EidolonWyrmBodyHuge.cs @@ -167,13 +167,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WyrmAdult2"), 1f); } diff --git a/NPCs/AbyssNPCs/EidolonWyrmHead.cs b/NPCs/AbyssNPCs/EidolonWyrmHead.cs index 2388e1b2a3..b8f03eea61 100644 --- a/NPCs/AbyssNPCs/EidolonWyrmHead.cs +++ b/NPCs/AbyssNPCs/EidolonWyrmHead.cs @@ -85,7 +85,7 @@ namespace CalamityMod.NPCs.AbyssNPCs } else { - if (Main.rand.Next(900) == 0) + if (Main.rand.NextBool(900)) { Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/WyrmScream"), (int)npc.position.X, (int)npc.position.Y); } @@ -99,7 +99,7 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.TargetClosest(true); } npc.velocity.Length(); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (!TailSpawned && npc.ai[0] == 0f) { @@ -144,7 +144,7 @@ namespace CalamityMod.NPCs.AbyssNPCs { damage = 60; } - float xPos = (Main.rand.Next(2) == 0 ? npc.position.X + 200f : npc.position.X - 200f); + float xPos = (Main.rand.NextBool(2) ? npc.position.X + 200f : npc.position.X - 200f); Vector2 vector2 = new Vector2(xPos, npc.position.Y + Main.rand.Next(-200, 201)); int random = Main.rand.Next(3); if (random == 0) @@ -173,9 +173,9 @@ namespace CalamityMod.NPCs.AbyssNPCs for (int num621 = 0; num621 < 20; num621++) { int num622 = Dust.NewDust(new Vector2(Main.player[npc.target].position.X, Main.player[npc.target].position.Y), - Main.player[npc.target].width, Main.player[npc.target].height, 185, 0f, 0f, 100, default(Color), 2f); + Main.player[npc.target].width, Main.player[npc.target].height, 185, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 0.6f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -184,10 +184,10 @@ namespace CalamityMod.NPCs.AbyssNPCs for (int num623 = 0; num623 < 30; num623++) { int num624 = Dust.NewDust(new Vector2(Main.player[npc.target].position.X, Main.player[npc.target].position.Y), - Main.player[npc.target].width, Main.player[npc.target].height, 185, 0f, 0f, 100, default(Color), 3f); + Main.player[npc.target].width, Main.player[npc.target].height, 185, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; num624 = Dust.NewDust(new Vector2(Main.player[npc.target].position.X, Main.player[npc.target].position.Y), - Main.player[npc.target].width, Main.player[npc.target].height, 185, 0f, 0f, 100, default(Color), 2f); + Main.player[npc.target].width, Main.player[npc.target].height, 185, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 0.2f; } if (Math.Abs(Main.player[npc.target].velocity.X) > 0.1f) @@ -481,17 +481,17 @@ namespace CalamityMod.NPCs.AbyssNPCs Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Voidstone"), Main.rand.Next(30, 41)); Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.BlueLunaticHood); Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.BlueLunaticRobe); - if (Main.rand.Next(10000) == 0 && CalamityWorld.revenge) + if (Main.rand.NextBool(10000) && CalamityWorld.revenge) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HalibutCannon")); } if (CalamityWorld.downedPolterghast) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SoulEdge")); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EidolicWail")); } @@ -500,7 +500,7 @@ namespace CalamityMod.NPCs.AbyssNPCs { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Ectoplasm, Main.rand.Next(8, 13)); Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Lumenite"), Main.rand.Next(6, 9)); - if (Main.expertMode && Main.rand.Next(2) == 0) + if (Main.expertMode && Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Lumenite"), Main.rand.Next(2, 4)); } @@ -511,13 +511,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 15; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Wyrm"), 1f); } @@ -529,14 +529,14 @@ namespace CalamityMod.NPCs.AbyssNPCs { return false; } - if (npc.timeLeft <= 0 && Main.netMode != 1) + if (npc.timeLeft <= 0 && Main.netMode != NetmodeID.MultiplayerClient) { for (int k = (int)npc.ai[0]; k > 0; k = (int)Main.npc[k].ai[0]) { if (Main.npc[k].active) { Main.npc[k].active = false; - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { Main.npc[k].life = 0; Main.npc[k].netSkip = -1; diff --git a/NPCs/AbyssNPCs/EidolonWyrmHeadHuge.cs b/NPCs/AbyssNPCs/EidolonWyrmHeadHuge.cs index 87538b1255..10d80c28b0 100644 --- a/NPCs/AbyssNPCs/EidolonWyrmHeadHuge.cs +++ b/NPCs/AbyssNPCs/EidolonWyrmHeadHuge.cs @@ -82,7 +82,7 @@ namespace CalamityMod.NPCs.AbyssNPCs } else { - if (Main.rand.Next(900) == 0) + if (Main.rand.NextBool(900)) { Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/EidolonWyrmRoarClose").WithVolume(2.5f), (int)npc.position.X, (int)npc.position.Y); } @@ -96,7 +96,7 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.TargetClosest(true); } npc.velocity.Length(); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (!TailSpawned && npc.ai[0] == 0f) { @@ -137,7 +137,7 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.TargetClosest(true); npc.netUpdate = true; int damage = Main.expertMode ? 300 : 400; - float xPos = (Main.rand.Next(2) == 0 ? npc.position.X + 200f : npc.position.X - 200f); + float xPos = (Main.rand.NextBool(2) ? npc.position.X + 200f : npc.position.X - 200f); Vector2 vector2 = new Vector2(xPos, npc.position.Y + Main.rand.Next(-200, 201)); int random = Main.rand.Next(3); if (random == 0) @@ -168,9 +168,9 @@ namespace CalamityMod.NPCs.AbyssNPCs for (int num621 = 0; num621 < 20; num621++) { int num622 = Dust.NewDust(new Vector2(Main.player[npc.target].position.X, Main.player[npc.target].position.Y), - Main.player[npc.target].width, Main.player[npc.target].height, 185, 0f, 0f, 100, default(Color), 2f); + Main.player[npc.target].width, Main.player[npc.target].height, 185, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 0.6f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -179,10 +179,10 @@ namespace CalamityMod.NPCs.AbyssNPCs for (int num623 = 0; num623 < 30; num623++) { int num624 = Dust.NewDust(new Vector2(Main.player[npc.target].position.X, Main.player[npc.target].position.Y), - Main.player[npc.target].width, Main.player[npc.target].height, 185, 0f, 0f, 100, default(Color), 3f); + Main.player[npc.target].width, Main.player[npc.target].height, 185, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; num624 = Dust.NewDust(new Vector2(Main.player[npc.target].position.X, Main.player[npc.target].position.Y), - Main.player[npc.target].width, Main.player[npc.target].height, 185, 0f, 0f, 100, default(Color), 2f); + Main.player[npc.target].width, Main.player[npc.target].height, 185, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 0.2f; } if (Math.Abs(Main.player[npc.target].velocity.X) > 0.1f) @@ -483,7 +483,7 @@ namespace CalamityMod.NPCs.AbyssNPCs { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HalibutCannon")); } - if (Main.expertMode && Main.rand.Next(2) == 0) + if (Main.expertMode && Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Lumenite"), Main.rand.Next(15, 28)); } @@ -493,13 +493,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 15; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WyrmAdult"), 1f); } @@ -511,14 +511,14 @@ namespace CalamityMod.NPCs.AbyssNPCs { return false; } - if (npc.timeLeft <= 0 && Main.netMode != 1) + if (npc.timeLeft <= 0 && Main.netMode != NetmodeID.MultiplayerClient) { for (int k = (int)npc.ai[0]; k > 0; k = (int)Main.npc[k].ai[0]) { if (Main.npc[k].active) { Main.npc[k].active = false; - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { Main.npc[k].life = 0; Main.npc[k].netSkip = -1; diff --git a/NPCs/AbyssNPCs/EidolonWyrmTail.cs b/NPCs/AbyssNPCs/EidolonWyrmTail.cs index 907df7dda0..d272e811f3 100644 --- a/NPCs/AbyssNPCs/EidolonWyrmTail.cs +++ b/NPCs/AbyssNPCs/EidolonWyrmTail.cs @@ -167,13 +167,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Wyrm4"), 1f); } diff --git a/NPCs/AbyssNPCs/EidolonWyrmTailHuge.cs b/NPCs/AbyssNPCs/EidolonWyrmTailHuge.cs index 8058a2b3d6..7732f85f1b 100644 --- a/NPCs/AbyssNPCs/EidolonWyrmTailHuge.cs +++ b/NPCs/AbyssNPCs/EidolonWyrmTailHuge.cs @@ -167,13 +167,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WyrmAdult4"), 1f); } diff --git a/NPCs/AbyssNPCs/Flounder.cs b/NPCs/AbyssNPCs/Flounder.cs index 790c2ab8ac..b058edbaaf 100644 --- a/NPCs/AbyssNPCs/Flounder.cs +++ b/NPCs/AbyssNPCs/Flounder.cs @@ -140,7 +140,7 @@ namespace CalamityMod.NPCs.AbyssNPCs if ((Main.player[npc.target].Center - npc.Center).Length() < 350f) { npc.localAI[0] += 1f; - if (Main.netMode != 1 && npc.localAI[0] >= 180f) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] >= 180f) { npc.localAI[0] = 0f; if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) @@ -280,7 +280,7 @@ namespace CalamityMod.NPCs.AbyssNPCs public override void NPCLoot() { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CloakingGland")); } @@ -290,13 +290,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 15; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/AbyssNPCs/Frogfish.cs b/NPCs/AbyssNPCs/Frogfish.cs index 0be0944855..8d6f476818 100644 --- a/NPCs/AbyssNPCs/Frogfish.cs +++ b/NPCs/AbyssNPCs/Frogfish.cs @@ -248,7 +248,7 @@ namespace CalamityMod.NPCs.AbyssNPCs public override void NPCLoot() { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CloakingGland")); } @@ -258,13 +258,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 25; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/AbyssNPCs/GiantSquid.cs b/NPCs/AbyssNPCs/GiantSquid.cs index 2a025f3c7d..7783cdf233 100644 --- a/NPCs/AbyssNPCs/GiantSquid.cs +++ b/NPCs/AbyssNPCs/GiantSquid.cs @@ -248,21 +248,21 @@ namespace CalamityMod.NPCs.AbyssNPCs public override void NPCLoot() { - if (Main.rand.Next(1000000) == 0 && CalamityWorld.revenge) + if (Main.rand.NextBool(1000000) && CalamityWorld.revenge) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HalibutCannon")); } if (NPC.downedPlantBoss || CalamityWorld.downedCalamitas) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Lumenite")); } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DepthCells"), Main.rand.Next(2, 5)); } - if (Main.expertMode && Main.rand.Next(2) == 0) + if (Main.expertMode && Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DepthCells"), Main.rand.Next(1, 3)); } @@ -273,13 +273,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 30; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GiantSquid"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GiantSquid2"), 1f); diff --git a/NPCs/AbyssNPCs/Gnasher.cs b/NPCs/AbyssNPCs/Gnasher.cs index d9491420f3..dd9b3d7f66 100644 --- a/NPCs/AbyssNPCs/Gnasher.cs +++ b/NPCs/AbyssNPCs/Gnasher.cs @@ -108,7 +108,7 @@ namespace CalamityMod.NPCs.AbyssNPCs public override void NPCLoot() { - if (Main.hardMode && Main.rand.Next(10) == 0) + if (Main.hardMode && Main.rand.NextBool(10)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.TurtleShell); } @@ -118,13 +118,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 15; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Gnasher"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Gnasher2"), 1f); diff --git a/NPCs/AbyssNPCs/GulperEelBody.cs b/NPCs/AbyssNPCs/GulperEelBody.cs index 9e6c41b78c..f0e47e93aa 100644 --- a/NPCs/AbyssNPCs/GulperEelBody.cs +++ b/NPCs/AbyssNPCs/GulperEelBody.cs @@ -167,13 +167,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GulperEel2"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GulperEel3"), 1f); diff --git a/NPCs/AbyssNPCs/GulperEelBodyAlt.cs b/NPCs/AbyssNPCs/GulperEelBodyAlt.cs index 57a121a56d..a35467243f 100644 --- a/NPCs/AbyssNPCs/GulperEelBodyAlt.cs +++ b/NPCs/AbyssNPCs/GulperEelBodyAlt.cs @@ -167,13 +167,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GulperEel2"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GulperEel3"), 1f); diff --git a/NPCs/AbyssNPCs/GulperEelHead.cs b/NPCs/AbyssNPCs/GulperEelHead.cs index c9044f196c..04852d3449 100644 --- a/NPCs/AbyssNPCs/GulperEelHead.cs +++ b/NPCs/AbyssNPCs/GulperEelHead.cs @@ -80,7 +80,7 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.TargetClosest(true); } npc.velocity.Length(); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (!TailSpawned && npc.ai[0] == 0f) { @@ -377,25 +377,25 @@ namespace CalamityMod.NPCs.AbyssNPCs public override void NPCLoot() { - if (Main.rand.Next(1000000) == 0 && CalamityWorld.revenge) + if (Main.rand.NextBool(1000000) && CalamityWorld.revenge) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HalibutCannon")); } if (NPC.downedPlantBoss || CalamityWorld.downedCalamitas) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Lumenite"), Main.rand.Next(2, 4)); } - if (Main.expertMode && Main.rand.Next(2) == 0) + if (Main.expertMode && Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Lumenite")); } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DepthCells"), Main.rand.Next(6, 9)); } - if (Main.expertMode && Main.rand.Next(2) == 0) + if (Main.expertMode && Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DepthCells"), Main.rand.Next(2, 4)); } @@ -406,13 +406,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 15; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GulperEel"), 1f); } @@ -420,14 +420,14 @@ namespace CalamityMod.NPCs.AbyssNPCs public override bool CheckActive() { - if (npc.timeLeft <= 0 && Main.netMode != 1) + if (npc.timeLeft <= 0 && Main.netMode != NetmodeID.MultiplayerClient) { for (int k = (int)npc.ai[0]; k > 0; k = (int)Main.npc[k].ai[0]) { if (Main.npc[k].active) { Main.npc[k].active = false; - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { Main.npc[k].life = 0; Main.npc[k].netSkip = -1; diff --git a/NPCs/AbyssNPCs/GulperEelTail.cs b/NPCs/AbyssNPCs/GulperEelTail.cs index 8106bbc0cf..dbc6c227cf 100644 --- a/NPCs/AbyssNPCs/GulperEelTail.cs +++ b/NPCs/AbyssNPCs/GulperEelTail.cs @@ -167,13 +167,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GulperEel4"), 1f); } diff --git a/NPCs/AbyssNPCs/Laserfish.cs b/NPCs/AbyssNPCs/Laserfish.cs index bf90f57f3c..0fd6355389 100644 --- a/NPCs/AbyssNPCs/Laserfish.cs +++ b/NPCs/AbyssNPCs/Laserfish.cs @@ -127,7 +127,7 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.velocity.Y = -4f; } npc.localAI[0] += 1f; - if (Main.netMode != 1 && npc.localAI[0] >= 120f) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] >= 120f) { npc.localAI[0] = 0f; if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) @@ -287,13 +287,13 @@ namespace CalamityMod.NPCs.AbyssNPCs public override void NPCLoot() { - if (Main.rand.Next(1000000) == 0 && CalamityWorld.revenge) + if (Main.rand.NextBool(1000000) && CalamityWorld.revenge) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HalibutCannon")); } if (NPC.downedPlantBoss || CalamityWorld.downedCalamitas) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Lumenite")); } @@ -304,13 +304,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 25; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Laserfish"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Laserfish2"), 1f); diff --git a/NPCs/AbyssNPCs/LuminousCorvina.cs b/NPCs/AbyssNPCs/LuminousCorvina.cs index 9bf3244189..f1b1e4a050 100644 --- a/NPCs/AbyssNPCs/LuminousCorvina.cs +++ b/NPCs/AbyssNPCs/LuminousCorvina.cs @@ -84,7 +84,7 @@ namespace CalamityMod.NPCs.AbyssNPCs if (screamTimer == 300) { Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/CorvinaScream"), (int)npc.position.X, (int)npc.position.Y); - if (Main.netMode != 2) + if (Main.netMode != NetmodeID.Server) { if (!Main.player[npc.target].dead && Main.player[npc.target].active) { @@ -282,21 +282,21 @@ namespace CalamityMod.NPCs.AbyssNPCs public override void NPCLoot() { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Voidstone"), Main.rand.Next(8, 16)); - if (Main.rand.Next(1000000) == 0 && CalamityWorld.revenge) + if (Main.rand.NextBool(1000000) && CalamityWorld.revenge) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HalibutCannon")); } if (NPC.downedPlantBoss || CalamityWorld.downedCalamitas) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Lumenite")); } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DepthCells"), Main.rand.Next(1, 3)); } - if (Main.expertMode && Main.rand.Next(2) == 0) + if (Main.expertMode && Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DepthCells")); } @@ -307,13 +307,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 139, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 139, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 25; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 139, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 139, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/AbyssNPCs/MantisShrimp.cs b/NPCs/AbyssNPCs/MantisShrimp.cs index ff4aa791f5..8e46bca620 100644 --- a/NPCs/AbyssNPCs/MantisShrimp.cs +++ b/NPCs/AbyssNPCs/MantisShrimp.cs @@ -77,7 +77,7 @@ namespace CalamityMod.NPCs.AbyssNPCs public override void OnHitPlayer(Player player, int damage, bool crit) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, 612, 0, 0f, Main.myPlayer); } @@ -102,7 +102,7 @@ namespace CalamityMod.NPCs.AbyssNPCs public override void NPCLoot() { - if (Main.rand.Next(5) == 0 && NPC.downedPlantBoss) + if (Main.rand.NextBool(5) && NPC.downedPlantBoss) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MantisClaws")); } @@ -112,13 +112,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 15; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/AbyssNPCs/Mauler.cs b/NPCs/AbyssNPCs/Mauler.cs index 45063b9c4e..903ec4c40c 100644 --- a/NPCs/AbyssNPCs/Mauler.cs +++ b/NPCs/AbyssNPCs/Mauler.cs @@ -198,7 +198,7 @@ namespace CalamityMod.NPCs.AbyssNPCs { npc.localAI[1] += 1f; npc.localAI[0] += 1f; - if (Main.netMode != 1 && npc.localAI[0] >= 30f) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] >= 30f) { npc.localAI[0] = 0f; if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) @@ -221,7 +221,7 @@ namespace CalamityMod.NPCs.AbyssNPCs } if (npc.velocity.Y == 0f) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.velocity.Y = (float)Main.rand.Next(-200, -150) * 0.1f; //50 20 npc.velocity.X = (float)Main.rand.Next(-20, 20) * 0.1f; //20 20 @@ -237,7 +237,7 @@ namespace CalamityMod.NPCs.AbyssNPCs } if (hasBeenHit) { - if (Main.rand.Next(300) == 0) + if (Main.rand.NextBool(300)) { Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/MaulerRoar"), (int)npc.position.X, (int)npc.position.Y); } @@ -252,7 +252,7 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < (int)((double)npc.localAI[1] * 0.05); k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 0f, 0f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 0f, 0f, 0, default, 1f); } } npc.rotation = npc.velocity.Y * (float)npc.direction * 0.1f; @@ -279,7 +279,7 @@ namespace CalamityMod.NPCs.AbyssNPCs public void BlowUp() { Main.PlaySound(4, (int)npc.position.X, (int)npc.position.Y, 60); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { Vector2 valueBoom = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); float spreadBoom = 15f * 0.0174f; @@ -290,7 +290,7 @@ namespace CalamityMod.NPCs.AbyssNPCs int damageBoom = (npc.localAI[1] >= 255f ? 200 : 50); for (iBoom = 0; iBoom < 25; iBoom++) { - int projectileType = (Main.rand.Next(2) == 0 ? mod.ProjectileType("SulphuricAcidMist") : mod.ProjectileType("SulphuricAcidCannon")); + int projectileType = (Main.rand.NextBool(2) ? mod.ProjectileType("SulphuricAcidMist") : mod.ProjectileType("SulphuricAcidCannon")); offsetAngleBoom = (startAngleBoom + deltaAngleBoom * (iBoom + iBoom * iBoom) / 2f) + 32f * iBoom; int boom1 = Projectile.NewProjectile(valueBoom.X, valueBoom.Y, (float)(Math.Sin(offsetAngleBoom) * 6f), (float)(Math.Cos(offsetAngleBoom) * 6f), projectileType, damageBoom, 0f, Main.myPlayer, 0f, 0f); int boom2 = Projectile.NewProjectile(valueBoom.X, valueBoom.Y, (float)(-Math.Sin(offsetAngleBoom) * 6f), (float)(-Math.Cos(offsetAngleBoom) * 6f), projectileType, damageBoom, 0f, Main.myPlayer, 0f, 0f); @@ -298,9 +298,9 @@ namespace CalamityMod.NPCs.AbyssNPCs } for (int num621 = 0; num621 < 25; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 31, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -309,10 +309,10 @@ namespace CalamityMod.NPCs.AbyssNPCs } for (int num623 = 0; num623 < 50; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; Main.dust[num624].noGravity = true; } @@ -347,7 +347,7 @@ namespace CalamityMod.NPCs.AbyssNPCs { if (CalamityWorld.downedPolterghast) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SulphuricAcidCannon")); } @@ -383,13 +383,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 30; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Mauler"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Mauler2"), 1f); diff --git a/NPCs/AbyssNPCs/MirageJelly.cs b/NPCs/AbyssNPCs/MirageJelly.cs index 742f6d93b1..adf91c45dc 100644 --- a/NPCs/AbyssNPCs/MirageJelly.cs +++ b/NPCs/AbyssNPCs/MirageJelly.cs @@ -70,7 +70,7 @@ namespace CalamityMod.NPCs.AbyssNPCs } if (npc.justHit) { - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { teleporting = true; } @@ -80,7 +80,7 @@ namespace CalamityMod.NPCs.AbyssNPCs { npc.chaseable = true; npc.dontTakeDamage = false; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (teleporting) { @@ -180,47 +180,47 @@ namespace CalamityMod.NPCs.AbyssNPCs public override void NPCLoot() { - if (Main.rand.Next(1000000) == 0 && CalamityWorld.revenge) + if (Main.rand.NextBool(1000000) && CalamityWorld.revenge) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HalibutCannon")); } if (NPC.downedPlantBoss || CalamityWorld.downedCalamitas) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DepthCells"), Main.rand.Next(5, 8)); } - if (Main.expertMode && Main.rand.Next(2) == 0) + if (Main.expertMode && Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DepthCells"), Main.rand.Next(5, 8)); } } if (Main.expertMode) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("VitalJelly")); } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LifeJelly")); } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ManaJelly")); } } else { - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("VitalJelly")); } - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LifeJelly")); } - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ManaJelly")); } @@ -237,13 +237,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 15; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/AbyssNPCs/MorayEel.cs b/NPCs/AbyssNPCs/MorayEel.cs index 836087e610..3c3a015df8 100644 --- a/NPCs/AbyssNPCs/MorayEel.cs +++ b/NPCs/AbyssNPCs/MorayEel.cs @@ -264,7 +264,7 @@ namespace CalamityMod.NPCs.AbyssNPCs public override void NPCLoot() { - if (Main.rand.Next(25) == 0) + if (Main.rand.NextBool(25)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Flipper); } @@ -274,13 +274,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 25; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/AbyssNPCs/OarfishBody.cs b/NPCs/AbyssNPCs/OarfishBody.cs index 66f7cb7115..a461949851 100644 --- a/NPCs/AbyssNPCs/OarfishBody.cs +++ b/NPCs/AbyssNPCs/OarfishBody.cs @@ -149,13 +149,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/AbyssNPCs/OarfishHead.cs b/NPCs/AbyssNPCs/OarfishHead.cs index 07f9dc66f7..1e061c0857 100644 --- a/NPCs/AbyssNPCs/OarfishHead.cs +++ b/NPCs/AbyssNPCs/OarfishHead.cs @@ -57,7 +57,7 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.TargetClosest(true); } npc.velocity.Length(); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (!TailSpawned && npc.ai[0] == 0f) { @@ -325,17 +325,17 @@ namespace CalamityMod.NPCs.AbyssNPCs public override void NPCLoot() { - if (Main.rand.Next(1000000) == 0 && CalamityWorld.revenge) + if (Main.rand.NextBool(1000000) && CalamityWorld.revenge) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HalibutCannon")); } if (NPC.downedPlantBoss || CalamityWorld.downedCalamitas) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DepthCells"), Main.rand.Next(3, 6)); } - if (Main.expertMode && Main.rand.Next(2) == 0) + if (Main.expertMode && Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DepthCells"), Main.rand.Next(1, 3)); } @@ -346,27 +346,27 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } } } public override bool CheckActive() { - if (npc.timeLeft <= 0 && Main.netMode != 1) + if (npc.timeLeft <= 0 && Main.netMode != NetmodeID.MultiplayerClient) { for (int k = (int)npc.ai[0]; k > 0; k = (int)Main.npc[k].ai[0]) { if (Main.npc[k].active) { Main.npc[k].active = false; - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { Main.npc[k].life = 0; Main.npc[k].netSkip = -1; diff --git a/NPCs/AbyssNPCs/OarfishTail.cs b/NPCs/AbyssNPCs/OarfishTail.cs index 338576876e..924a26dea2 100644 --- a/NPCs/AbyssNPCs/OarfishTail.cs +++ b/NPCs/AbyssNPCs/OarfishTail.cs @@ -149,13 +149,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/AbyssNPCs/Reaper.cs b/NPCs/AbyssNPCs/Reaper.cs index 915b65b5f6..baf20690be 100644 --- a/NPCs/AbyssNPCs/Reaper.cs +++ b/NPCs/AbyssNPCs/Reaper.cs @@ -298,7 +298,7 @@ namespace CalamityMod.NPCs.AbyssNPCs { if (npc.velocity.Y == 0f) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.velocity.Y = (float)Main.rand.Next(-250, -180) * 0.1f; //50 20 npc.velocity.X = (float)Main.rand.Next(-50, 50) * 0.1f; //20 20 @@ -369,7 +369,7 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.localAI[0] = 1f; npc.alpha = 255; npc.rotation = 0f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.ai[0] = -1f; npc.netUpdate = true; @@ -487,9 +487,9 @@ namespace CalamityMod.NPCs.AbyssNPCs int num20 = 36; for (int i = 0; i < num20; i++) { - Vector2 expr_80F = (Vector2.Normalize(npc.velocity) * new Vector2((float)npc.width / 2f, (float)npc.height) * 0.75f * 0.5f).RotatedBy((double)((float)(i - (num20 / 2 - 1)) * 6.28318548f / (float)num20), default(Vector2)) + npc.Center; + Vector2 expr_80F = (Vector2.Normalize(npc.velocity) * new Vector2((float)npc.width / 2f, (float)npc.height) * 0.75f * 0.5f).RotatedBy((double)((float)(i - (num20 / 2 - 1)) * 6.28318548f / (float)num20), default) + npc.Center; Vector2 vector2 = expr_80F - npc.Center; - int num21 = Dust.NewDust(expr_80F + vector2, 0, 0, 172, vector2.X * 2f, vector2.Y * 2f, 100, default(Color), 1.4f); + int num21 = Dust.NewDust(expr_80F + vector2, 0, 0, 172, vector2.X * 2f, vector2.Y * 2f, 100, default, 1.4f); Main.dust[num21].noGravity = true; Main.dust[num21].noLight = true; Main.dust[num21].velocity = Vector2.Normalize(vector2) * 3f; @@ -587,9 +587,9 @@ namespace CalamityMod.NPCs.AbyssNPCs int num24 = 7; for (int j = 0; j < num24; j++) { - Vector2 arg_E1C_0 = (Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f).RotatedBy((double)(j - (num24 / 2 - 1)) * 3.1415926535897931 / (double)((float)num24), default(Vector2)) + vector; + Vector2 arg_E1C_0 = (Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f).RotatedBy((double)(j - (num24 / 2 - 1)) * 3.1415926535897931 / (double)((float)num24), default) + vector; Vector2 vector4 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); - int num25 = Dust.NewDust(arg_E1C_0 + vector4, 0, 0, 172, vector4.X * 2f, vector4.Y * 2f, 100, default(Color), 1.4f); + int num25 = Dust.NewDust(arg_E1C_0 + vector4, 0, 0, 172, vector4.X * 2f, vector4.Y * 2f, 100, default, 1.4f); Main.dust[num25].noGravity = true; Main.dust[num25].noLight = true; Main.dust[num25].velocity /= 4f; @@ -660,20 +660,20 @@ namespace CalamityMod.NPCs.AbyssNPCs { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Voidstone"), Main.rand.Next(40, 51)); Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CloakingGland"), Main.rand.Next(2, 4)); - if (Main.rand.Next(10000) == 0 && CalamityWorld.revenge) + if (Main.rand.NextBool(10000) && CalamityWorld.revenge) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HalibutCannon")); } if (CalamityWorld.downedPolterghast) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReaperTooth"), Main.rand.Next(3, 5)); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DeepSeaDumbbell")); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { - if (Main.rand.Next(33) == 0) + if (Main.rand.NextBool(33)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TheReaper")); } @@ -685,11 +685,11 @@ namespace CalamityMod.NPCs.AbyssNPCs } if (NPC.downedPlantBoss || CalamityWorld.downedCalamitas) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DepthCells"), Main.rand.Next(10, 18)); } - if (Main.expertMode && Main.rand.Next(2) == 0) + if (Main.expertMode && Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DepthCells"), Main.rand.Next(4, 6)); } @@ -700,13 +700,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 40; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/AbyssNPCs/SeaUrchin.cs b/NPCs/AbyssNPCs/SeaUrchin.cs index f65c31f536..445a26df5d 100644 --- a/NPCs/AbyssNPCs/SeaUrchin.cs +++ b/NPCs/AbyssNPCs/SeaUrchin.cs @@ -105,7 +105,7 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.velocity.Y = npc.velocity.Y - (npc.wet ? 9f : 3f); for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 33, 0f, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 33, 0f, -1f, 0, default, 1f); } } if (npc.ai[3] < (float)num) @@ -332,13 +332,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/AbyssNPCs/ToxicMinnow.cs b/NPCs/AbyssNPCs/ToxicMinnow.cs index 140a96c385..c01bdaf5df 100644 --- a/NPCs/AbyssNPCs/ToxicMinnow.cs +++ b/NPCs/AbyssNPCs/ToxicMinnow.cs @@ -184,7 +184,7 @@ namespace CalamityMod.NPCs.AbyssNPCs npc.width = (npc.height = 40); npc.position.X = npc.position.X - (float)(npc.width / 2); npc.position.Y = npc.position.Y - (float)(npc.height / 2); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { Vector2 valueBoom = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); float spreadBoom = 15f * 0.0174f; @@ -259,17 +259,17 @@ namespace CalamityMod.NPCs.AbyssNPCs public override void NPCLoot() { - if (Main.rand.Next(1000000) == 0 && CalamityWorld.revenge) + if (Main.rand.NextBool(1000000) && CalamityWorld.revenge) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HalibutCannon")); } if (NPC.downedPlantBoss || CalamityWorld.downedCalamitas) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DepthCells"), Main.rand.Next(2, 4)); } - if (Main.expertMode && Main.rand.Next(2) == 0) + if (Main.expertMode && Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DepthCells"), Main.rand.Next(2, 4)); } @@ -280,13 +280,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 40, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 40, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 50; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 40, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 40, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/AbyssNPCs/Trasher.cs b/NPCs/AbyssNPCs/Trasher.cs index 09b69aff1d..319357b53b 100644 --- a/NPCs/AbyssNPCs/Trasher.cs +++ b/NPCs/AbyssNPCs/Trasher.cs @@ -346,20 +346,20 @@ namespace CalamityMod.NPCs.AbyssNPCs public override void NPCLoot() { - if (!NPC.savedAngler && !NPC.AnyNPCs(NPCID.Angler) && !NPC.AnyNPCs(NPCID.SleepingAngler) && Main.netMode != 1) + if (!NPC.savedAngler && !NPC.AnyNPCs(NPCID.Angler) && !NPC.AnyNPCs(NPCID.SleepingAngler) && Main.netMode != NetmodeID.MultiplayerClient) { NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, NPCID.Angler, 0, 0f, 0f, 0f, 0f, 255); NPC.savedAngler = true; } - if (Main.rand.Next(25) == 0) + if (Main.rand.NextBool(25)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.DivingHelmet); } - if (Main.rand.Next(20) == 0) + if (Main.rand.NextBool(20)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TrashmanTrashcan")); } - if (Main.rand.Next(10) == 0 && Main.hardMode) + if (Main.rand.NextBool(10) && Main.hardMode) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Gatligator); } @@ -369,13 +369,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 25; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Trasher"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Trasher2"), 1f); diff --git a/NPCs/AbyssNPCs/Viperfish.cs b/NPCs/AbyssNPCs/Viperfish.cs index 9e0dfea384..3716a6a695 100644 --- a/NPCs/AbyssNPCs/Viperfish.cs +++ b/NPCs/AbyssNPCs/Viperfish.cs @@ -275,21 +275,21 @@ namespace CalamityMod.NPCs.AbyssNPCs public override void NPCLoot() { - if (Main.rand.Next(1000000) == 0 && CalamityWorld.revenge) + if (Main.rand.NextBool(1000000) && CalamityWorld.revenge) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HalibutCannon")); } if (NPC.downedPlantBoss || CalamityWorld.downedCalamitas) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Lumenite")); } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DepthCells"), Main.rand.Next(1, 3)); } - if (Main.expertMode && Main.rand.Next(2) == 0) + if (Main.expertMode && Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DepthCells")); } @@ -300,13 +300,13 @@ namespace CalamityMod.NPCs.AbyssNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 25; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ViperFish"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ViperFish2"), 1f); diff --git a/NPCs/Astrageldon/Astrageldon.cs b/NPCs/Astrageldon/Astrageldon.cs index 59c1682e7d..c4805256ad 100644 --- a/NPCs/Astrageldon/Astrageldon.cs +++ b/NPCs/Astrageldon/Astrageldon.cs @@ -339,12 +339,12 @@ namespace CalamityMod.NPCs.Astrageldon string key2 = "Mods.CalamityMod.AureusBossText2"; Color messageColor = Color.Gold; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); Main.NewText(Language.GetTextValue(key2), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); NetMessage.BroadcastChatMessage(NetworkText.FromKey(key2), messageColor); @@ -366,7 +366,7 @@ namespace CalamityMod.NPCs.Astrageldon for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 173, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 173, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -378,9 +378,9 @@ namespace CalamityMod.NPCs.Astrageldon npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 50; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -388,10 +388,10 @@ namespace CalamityMod.NPCs.Astrageldon } for (int num623 = 0; num623 < 100; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/Astrageldon/AstrageldonSlime.cs b/NPCs/Astrageldon/AstrageldonSlime.cs index 2636474cdc..2736ba82ea 100644 --- a/NPCs/Astrageldon/AstrageldonSlime.cs +++ b/NPCs/Astrageldon/AstrageldonSlime.cs @@ -67,7 +67,7 @@ namespace CalamityMod.NPCs.Astrageldon int num; for (int num245 = 0; num245 < 10; num245 = num + 1) { - int dust = Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("AstralOrange"), npc.velocity.X, npc.velocity.Y, 255, default(Color), 0.8f); + int dust = Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("AstralOrange"), npc.velocity.X, npc.velocity.Y, 255, default, 0.8f); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 0.5f; num = num245; @@ -106,7 +106,7 @@ namespace CalamityMod.NPCs.Astrageldon if (npc.localAI[1] == 1f) { npc.localAI[1] = 0f; - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { npc.ai[0] = (float)num1447; } @@ -161,7 +161,7 @@ namespace CalamityMod.NPCs.Astrageldon int var_9_48E3C_cp_1 = 0; num244 = var_9_48E3C_cp_0[var_9_48E3C_cp_1]; var_9_48E3C_cp_0[var_9_48E3C_cp_1] = num244 + 1f; - if (npc.ai[0] >= (float)num1447 && Main.netMode != 1) + if (npc.ai[0] >= (float)num1447 && Main.netMode != NetmodeID.MultiplayerClient) { npc.ai[0] = 0f; Point point12 = npc.Center.ToTileCoordinates(); @@ -227,13 +227,13 @@ namespace CalamityMod.NPCs.Astrageldon { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 173, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 173, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 173, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 173, hitDirection, -1f, 0, default, 1f); } } } @@ -254,9 +254,9 @@ namespace CalamityMod.NPCs.Astrageldon npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 15; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 1f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -265,10 +265,10 @@ namespace CalamityMod.NPCs.Astrageldon } for (int num623 = 0; num623 < 30; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 1f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; Main.dust[num624].noGravity = true; } diff --git a/NPCs/AstralBiomeNPCs/Aries.cs b/NPCs/AstralBiomeNPCs/Aries.cs index 8bfa18e2b2..7ea17ccc36 100644 --- a/NPCs/AstralBiomeNPCs/Aries.cs +++ b/NPCs/AstralBiomeNPCs/Aries.cs @@ -112,7 +112,7 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs public override void NPCLoot() { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Stardust"), Main.rand.Next(1, 3)); } @@ -120,7 +120,7 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Stardust")); } - if (CalamityWorld.downedAstrageldon && Main.rand.Next(7) == 0) + if (CalamityWorld.downedAstrageldon && Main.rand.NextBool(7)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StellarKnife")); } diff --git a/NPCs/AstralBiomeNPCs/AstralProbe.cs b/NPCs/AstralBiomeNPCs/AstralProbe.cs index 2d1688b992..380e9c1a60 100644 --- a/NPCs/AstralBiomeNPCs/AstralProbe.cs +++ b/NPCs/AstralBiomeNPCs/AstralProbe.cs @@ -125,7 +125,7 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs { npc.localAI[0] = 0f; } - if (Main.netMode != 1 && npc.localAI[0] >= 200f) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] >= 200f) { npc.localAI[0] = 0f; if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) @@ -232,9 +232,9 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -242,10 +242,10 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } for (int num625 = 0; num625 < 3; num625++) @@ -259,25 +259,25 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs { scaleFactor10 = 1f; } - int num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + int num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13AB6_cp_0 = Main.gore[num626]; expr_13AB6_cp_0.velocity.X = expr_13AB6_cp_0.velocity.X + 1f; Gore expr_13AD6_cp_0 = Main.gore[num626]; expr_13AD6_cp_0.velocity.Y = expr_13AD6_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13B79_cp_0 = Main.gore[num626]; expr_13B79_cp_0.velocity.X = expr_13B79_cp_0.velocity.X - 1f; Gore expr_13B99_cp_0 = Main.gore[num626]; expr_13B99_cp_0.velocity.Y = expr_13B99_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13C3C_cp_0 = Main.gore[num626]; expr_13C3C_cp_0.velocity.X = expr_13C3C_cp_0.velocity.X + 1f; Gore expr_13C5C_cp_0 = Main.gore[num626]; expr_13C5C_cp_0.velocity.Y = expr_13C5C_cp_0.velocity.Y - 1f; - num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13CFF_cp_0 = Main.gore[num626]; expr_13CFF_cp_0.velocity.X = expr_13CFF_cp_0.velocity.X - 1f; @@ -289,7 +289,7 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs public override void NPCLoot() { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Stardust"), Main.rand.Next(1, 3)); } diff --git a/NPCs/AstralBiomeNPCs/AstralachneaGround.cs b/NPCs/AstralBiomeNPCs/AstralachneaGround.cs index ef49fed6cd..5388ed493f 100644 --- a/NPCs/AstralBiomeNPCs/AstralachneaGround.cs +++ b/NPCs/AstralBiomeNPCs/AstralachneaGround.cs @@ -54,7 +54,7 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs public override void AI() { npc.TargetClosest(); - if (Main.netMode != 1 && npc.velocity.Y == 0f) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.velocity.Y == 0f) { int x = (int)npc.Center.X / 16; int y = (int)npc.Center.Y / 16; @@ -161,7 +161,7 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Stardust")); } - if (CalamityWorld.downedAstrageldon && Main.rand.Next(7) == 0) + if (CalamityWorld.downedAstrageldon && Main.rand.NextBool(7)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AstralachneaStaff")); } diff --git a/NPCs/AstralBiomeNPCs/AstralachneaWall.cs b/NPCs/AstralBiomeNPCs/AstralachneaWall.cs index 49a0154e60..477d26ae07 100644 --- a/NPCs/AstralBiomeNPCs/AstralachneaWall.cs +++ b/NPCs/AstralBiomeNPCs/AstralachneaWall.cs @@ -138,7 +138,7 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Stardust")); } - if (CalamityWorld.downedAstrageldon && Main.rand.Next(7) == 0) + if (CalamityWorld.downedAstrageldon && Main.rand.NextBool(7)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AstralachneaStaff")); } diff --git a/NPCs/AstralBiomeNPCs/Atlas.cs b/NPCs/AstralBiomeNPCs/Atlas.cs index 399382b116..b7b7a22897 100644 --- a/NPCs/AstralBiomeNPCs/Atlas.cs +++ b/NPCs/AstralBiomeNPCs/Atlas.cs @@ -239,7 +239,7 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs swingYeet = false; - if (Main.rand.Next(1000) == 0) //Launch the player very fast very rarely + if (Main.rand.NextBool(1000)) //Launch the player very fast very rarely { horMult = 12f; verMult = 2.3f; @@ -293,7 +293,7 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs } else { - idle_impulseWalk = idle_counter > 100 && Main.rand.Next(400) == 0; //try to impulse + idle_impulseWalk = idle_counter > 100 && Main.rand.NextBool(400); //try to impulse if (idle_impulseWalk) //if we've just decided to stroll { idle_counter = 0; @@ -548,13 +548,13 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs //draw actual sprite spriteBatch.Draw(Main.npcTexture[npc.type], position, npc.frame, - drawColor, 0f, default(Vector2), 1f, //color, rotation, origin, scale + drawColor, 0f, default, 1f, //color, rotation, origin, scale effect, 0f); //effect, drawlayer //draw glowmask spriteBatch.Draw( glowmask, position, npc.frame, - Color.White * 0.65f, 0f, default(Vector2), 1f, //color, rotation, origin, scale + Color.White * 0.65f, 0f, default, 1f, //color, rotation, origin, scale effect, 0f); //effect, drawlayer return false; @@ -619,7 +619,7 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Stardust")); } - if (CalamityWorld.downedAstrageldon && Main.rand.Next(7) == 0) + if (CalamityWorld.downedAstrageldon && Main.rand.NextBool(7)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TitanArm")); } diff --git a/NPCs/AstralBiomeNPCs/BigSightseer.cs b/NPCs/AstralBiomeNPCs/BigSightseer.cs index 69d6605ac2..4df8877244 100644 --- a/NPCs/AstralBiomeNPCs/BigSightseer.cs +++ b/NPCs/AstralBiomeNPCs/BigSightseer.cs @@ -98,7 +98,7 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs } else if (npc.ai[1] >= 140f) //oozin dust at the "mouth" { - int dustType = Main.rand.Next(2) == 0 ? mod.DustType("AstralOrange") : mod.DustType("AstralBlue"); + int dustType = Main.rand.NextBool(2) ? mod.DustType("AstralOrange") : mod.DustType("AstralBlue"); int d = Dust.NewDust(spawnPoint - new Vector2(5), 10, 10, dustType); Main.dust[d].velocity = npc.velocity * 0.3f; Main.dust[d].customData = true; @@ -255,7 +255,7 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs for (int i = 0; i < numDust; i++) { Vector2 vel = (angle + Main.rand.NextFloat(-0.04f, 0.04f)).ToRotationVector2(); - int dustType = Main.rand.Next(2) == 0 ? mod.DustType("AstralOrange") : mod.DustType("AstralBlue"); + int dustType = Main.rand.NextBool(2) ? mod.DustType("AstralOrange") : mod.DustType("AstralBlue"); Dust d = Dust.NewDustPerfect(npc.Center, dustType, vel * Main.rand.NextFloat(1.8f, 2.2f)); d.customData = npc; diff --git a/NPCs/AstralBiomeNPCs/Hadarian.cs b/NPCs/AstralBiomeNPCs/Hadarian.cs index 9c8ce0b81d..9038a2b654 100644 --- a/NPCs/AstralBiomeNPCs/Hadarian.cs +++ b/NPCs/AstralBiomeNPCs/Hadarian.cs @@ -127,9 +127,9 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs Vector2 position = npc.Bottom - new Vector2(19f, 42f); //20 34 38 42 Rectangle src = new Rectangle(20, 34, 38, 42); - spriteBatch.Draw(Main.npcTexture[npc.type], position - Main.screenPosition, src, drawColor, npc.rotation, default(Vector2), 1f, npc.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); + spriteBatch.Draw(Main.npcTexture[npc.type], position - Main.screenPosition, src, drawColor, npc.rotation, default, 1f, npc.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); //draw glowmask - spriteBatch.Draw(glowmask, position - Main.screenPosition, src, Color.White * 0.6f, npc.rotation, default(Vector2), 1f, npc.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); + spriteBatch.Draw(glowmask, position - Main.screenPosition, src, Color.White * 0.6f, npc.rotation, default, 1f, npc.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); return false; } return true; @@ -199,7 +199,7 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Stardust")); } - if (CalamityWorld.downedAstrageldon && Main.rand.Next(2) == 0) + if (CalamityWorld.downedAstrageldon && Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HadarianMembrane"), Main.rand.Next(1, 3)); } diff --git a/NPCs/AstralBiomeNPCs/Hive.cs b/NPCs/AstralBiomeNPCs/Hive.cs index 45d3ce1564..c8f60641e4 100644 --- a/NPCs/AstralBiomeNPCs/Hive.cs +++ b/NPCs/AstralBiomeNPCs/Hive.cs @@ -49,7 +49,7 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs npc.ai[0]++; if (npc.ai[0] > 180) { - if (Main.rand.Next(100) == 0) + if (Main.rand.NextBool(100)) { npc.ai[0] = 0; @@ -142,7 +142,7 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Stardust")); } - if (CalamityWorld.downedAstrageldon && Main.rand.Next(7) == 0) + if (CalamityWorld.downedAstrageldon && Main.rand.NextBool(7)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HivePod")); } diff --git a/NPCs/AstralBiomeNPCs/Mantis.cs b/NPCs/AstralBiomeNPCs/Mantis.cs index 726e548a31..155099d07e 100644 --- a/NPCs/AstralBiomeNPCs/Mantis.cs +++ b/NPCs/AstralBiomeNPCs/Mantis.cs @@ -242,7 +242,7 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Stardust")); } - if (CalamityWorld.downedAstrageldon && Main.rand.Next(7) == 0) + if (CalamityWorld.downedAstrageldon && Main.rand.NextBool(7)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AstralScythe")); } diff --git a/NPCs/AstralBiomeNPCs/Nova.cs b/NPCs/AstralBiomeNPCs/Nova.cs index 9c5aeab409..9cc302b65a 100644 --- a/NPCs/AstralBiomeNPCs/Nova.cs +++ b/NPCs/AstralBiomeNPCs/Nova.cs @@ -110,7 +110,7 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs Vector2 between = target.Center - npc.Center; //after locking target for x amount of time and being far enough away - if (between.Length() > 150 && npc.ai[3] >= targetTime && Main.rand.Next(180) == 0) + if (between.Length() > 150 && npc.ai[3] >= targetTime && Main.rand.NextBool(180)) { //set ai mode to target and travel npc.ai[3] = -1f; @@ -169,7 +169,7 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs Rectangle myRect = npc.getRect(); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { for (int i = 0; i < 200; i++) { @@ -192,20 +192,20 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs for (int i = 0; i < 45; i++) { - int dust = Dust.NewDust(npc.Center - off, size, size, mod.DustType("AstralEnemy"), Main.rand.NextFloat(-3f, 3f), Main.rand.NextFloat(-3f, 3f), 0, default(Color), Main.rand.NextFloat(1f, 2f)); + int dust = Dust.NewDust(npc.Center - off, size, size, mod.DustType("AstralEnemy"), Main.rand.NextFloat(-3f, 3f), Main.rand.NextFloat(-3f, 3f), 0, default, Main.rand.NextFloat(1f, 2f)); Main.dust[dust].velocity *= 1.4f; } for (int i = 0; i < 15; i++) { - int dust = Dust.NewDust(npc.Center - off, size, size, 31, 0f, 0f, 100, default(Color), 1.7f); + int dust = Dust.NewDust(npc.Center - off, size, size, 31, 0f, 0f, 100, default, 1.7f); Main.dust[dust].velocity *= 1.4f; } for (int i = 0; i < 27; i++) { - int dust = Dust.NewDust(npc.Center - off, size, size, 6, 0f, 0f, 100, default(Color), 2.4f); + int dust = Dust.NewDust(npc.Center - off, size, size, 6, 0f, 0f, 100, default, 2.4f); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 5f; - dust = Dust.NewDust(npc.Center - off, size, size, 6, 0f, 0f, 100, default(Color), 1.6f); + dust = Dust.NewDust(npc.Center - off, size, size, 6, 0f, 0f, 100, default, 1.6f); Main.dust[dust].velocity *= 3f; } } @@ -272,7 +272,7 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Stardust")); } - if (CalamityWorld.downedAstrageldon && Main.rand.Next(7) == 0) + if (CalamityWorld.downedAstrageldon && Main.rand.NextBool(7)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StellarCannon")); } diff --git a/NPCs/AstralBiomeNPCs/SmallSightseer.cs b/NPCs/AstralBiomeNPCs/SmallSightseer.cs index 61551c7b68..94edd2e28d 100644 --- a/NPCs/AstralBiomeNPCs/SmallSightseer.cs +++ b/NPCs/AstralBiomeNPCs/SmallSightseer.cs @@ -127,7 +127,7 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs public override void NPCLoot() { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Stardust"), Main.rand.Next(1, 3)); } diff --git a/NPCs/AstralBiomeNPCs/StellarCulex.cs b/NPCs/AstralBiomeNPCs/StellarCulex.cs index 5ae7f7f94a..094b20812c 100644 --- a/NPCs/AstralBiomeNPCs/StellarCulex.cs +++ b/NPCs/AstralBiomeNPCs/StellarCulex.cs @@ -113,7 +113,7 @@ namespace CalamityMod.NPCs.AstralBiomeNPCs public override void NPCLoot() { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Stardust"), Main.rand.Next(1, 3)); } diff --git a/NPCs/AstrumDeus/AstrumDeusBody.cs b/NPCs/AstrumDeus/AstrumDeusBody.cs index e91b20d353..d7b24f3a3e 100644 --- a/NPCs/AstrumDeus/AstrumDeusBody.cs +++ b/NPCs/AstrumDeus/AstrumDeusBody.cs @@ -97,7 +97,7 @@ namespace CalamityMod.NPCs.AstrumDeus { for (int num934 = 0; num934 < 2; num934++) { - int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default(Color), 2f); + int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default, 2f); Main.dust[num935].noGravity = true; Main.dust[num935].noLight = true; } @@ -108,7 +108,7 @@ namespace CalamityMod.NPCs.AstrumDeus npc.alpha = 0; } } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int shootTime = 4; if ((double)npc.life <= (double)npc.lifeMax * 0.3 || CalamityWorld.bossRushActive) @@ -206,11 +206,11 @@ namespace CalamityMod.NPCs.AstrumDeus { if (NPC.CountNPCS(mod.NPCType("AstrumDeusProbe3")) < 3 && CalamityWorld.revenge) { - if (npc.life > 0 && Main.netMode != 1 && spawn == 0 && Main.rand.Next(25) == 0) + if (npc.life > 0 && Main.netMode != NetmodeID.MultiplayerClient && spawn == 0 && Main.rand.NextBool(25)) { spawn = 1; int num660 = NPC.NewNPC((int)(npc.position.X + (float)(npc.width / 2)), (int)(npc.position.Y + (float)npc.height), mod.NPCType("AstrumDeusProbe3"), 0, 0f, 0f, 0f, 0f, 255); - if (Main.netMode == 2 && num660 < 200) + if (Main.netMode == NetmodeID.Server && num660 < 200) { NetMessage.SendData(23, -1, -1, null, num660, 0f, 0f, 0f, 0, 0, 0); } @@ -227,9 +227,9 @@ namespace CalamityMod.NPCs.AstrumDeus npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -237,10 +237,10 @@ namespace CalamityMod.NPCs.AstrumDeus } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/AstrumDeus/AstrumDeusBodySpectral.cs b/NPCs/AstrumDeus/AstrumDeusBodySpectral.cs index bf9970d1ac..39e16f99f6 100644 --- a/NPCs/AstrumDeus/AstrumDeusBodySpectral.cs +++ b/NPCs/AstrumDeus/AstrumDeusBodySpectral.cs @@ -134,7 +134,7 @@ namespace CalamityMod.NPCs.AstrumDeus { for (int num934 = 0; num934 < 2; num934++) { - int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default(Color), 2f); + int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default, 2f); Main.dust[num935].noGravity = true; Main.dust[num935].noLight = true; } @@ -145,7 +145,7 @@ namespace CalamityMod.NPCs.AstrumDeus npc.alpha = 0; } } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int shootTime = 4; if ((double)npc.life <= (double)npc.lifeMax * 0.65 || Main.player[npc.target].gravDir == -1f) @@ -328,11 +328,11 @@ namespace CalamityMod.NPCs.AstrumDeus { if (NPC.CountNPCS(mod.NPCType("AstrumDeusProbe3")) < 6 && CalamityWorld.revenge) { - if (npc.life > 0 && Main.netMode != 1 && spawn == 0 && Main.rand.Next(25) == 0) + if (npc.life > 0 && Main.netMode != NetmodeID.MultiplayerClient && spawn == 0 && Main.rand.NextBool(25)) { spawn = 1; int num660 = NPC.NewNPC((int)(npc.position.X + (float)(npc.width / 2)), (int)(npc.position.Y + (float)npc.height), mod.NPCType("AstrumDeusProbe3"), 0, 0f, 0f, 0f, 0f, 255); - if (Main.netMode == 2 && num660 < 200) + if (Main.netMode == NetmodeID.Server && num660 < 200) { NetMessage.SendData(23, -1, -1, null, num660, 0f, 0f, 0f, 0, 0, 0); } @@ -349,9 +349,9 @@ namespace CalamityMod.NPCs.AstrumDeus npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -359,10 +359,10 @@ namespace CalamityMod.NPCs.AstrumDeus } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/AstrumDeus/AstrumDeusHead.cs b/NPCs/AstrumDeus/AstrumDeusHead.cs index f0a42ebc99..35c5654cf2 100644 --- a/NPCs/AstrumDeus/AstrumDeusHead.cs +++ b/NPCs/AstrumDeus/AstrumDeusHead.cs @@ -107,7 +107,7 @@ namespace CalamityMod.NPCs.AstrumDeus { if ((npc.life <= npc.lifeMax * 0.9f)) { - if (secondStage == false && Main.netMode != 1) + if (secondStage == false && Main.netMode != NetmodeID.MultiplayerClient) { Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 74); for (int I = 0; I < 3; I++) @@ -122,7 +122,7 @@ namespace CalamityMod.NPCs.AstrumDeus } if ((npc.life <= npc.lifeMax * 0.8f)) { - if (thirdStage == false && Main.netMode != 1) + if (thirdStage == false && Main.netMode != NetmodeID.MultiplayerClient) { Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 74); for (int I = 0; I < 5; I++) @@ -140,7 +140,7 @@ namespace CalamityMod.NPCs.AstrumDeus { if ((npc.life <= npc.lifeMax * 0.65f)) { - if (secondStage == false && Main.netMode != 1) + if (secondStage == false && Main.netMode != NetmodeID.MultiplayerClient) { Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 74); for (int I = 0; I < 3; I++) @@ -155,7 +155,7 @@ namespace CalamityMod.NPCs.AstrumDeus } if ((npc.life <= npc.lifeMax * 0.3f)) { - if (thirdStage == false && Main.netMode != 1) + if (thirdStage == false && Main.netMode != NetmodeID.MultiplayerClient) { Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 74); for (int I = 0; I < 5; I++) @@ -191,7 +191,7 @@ namespace CalamityMod.NPCs.AstrumDeus { for (int num934 = 0; num934 < 2; num934++) { - int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default(Color), 2f); + int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default, 2f); Main.dust[num935].noGravity = true; Main.dust[num935].noLight = true; } @@ -201,7 +201,7 @@ namespace CalamityMod.NPCs.AstrumDeus { npc.alpha = 0; } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (!tailSpawned && npc.ai[0] == 0f) { @@ -229,7 +229,7 @@ namespace CalamityMod.NPCs.AstrumDeus } tailSpawned = true; } - if (!npc.active && Main.netMode == 2) + if (!npc.active && Main.netMode == NetmodeID.Server) { NetMessage.SendData(28, -1, -1, null, npc.whoAmI, -1f, 0f, 0f, 0, 0, 0); } @@ -602,9 +602,9 @@ namespace CalamityMod.NPCs.AstrumDeus npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -612,10 +612,10 @@ namespace CalamityMod.NPCs.AstrumDeus } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs b/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs index 84914c24f4..7b612a2a9b 100644 --- a/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs +++ b/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs @@ -158,7 +158,7 @@ namespace CalamityMod.NPCs.AstrumDeus { for (int num934 = 0; num934 < 2; num934++) { - int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default(Color), 2f); + int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default, 2f); Main.dust[num935].noGravity = true; Main.dust[num935].noLight = true; } @@ -168,7 +168,7 @@ namespace CalamityMod.NPCs.AstrumDeus { npc.alpha = 0; } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (!tailSpawned && npc.ai[0] == 0f) { @@ -492,9 +492,9 @@ namespace CalamityMod.NPCs.AstrumDeus npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -502,10 +502,10 @@ namespace CalamityMod.NPCs.AstrumDeus } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } @@ -565,9 +565,9 @@ namespace CalamityMod.NPCs.AstrumDeus { string key = "Mods.CalamityMod.AstralBossText"; Color messageColor = Color.Gold; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) Main.NewText(Language.GetTextValue(key), messageColor); - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } diff --git a/NPCs/AstrumDeus/AstrumDeusProbe.cs b/NPCs/AstrumDeus/AstrumDeusProbe.cs index d0e6f1c784..870a384e84 100644 --- a/NPCs/AstrumDeus/AstrumDeusProbe.cs +++ b/NPCs/AstrumDeus/AstrumDeusProbe.cs @@ -45,7 +45,7 @@ namespace CalamityMod.NPCs.AstrumDeus { for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default, 2f); } npc.ai[1] = npc.ai[0]; start = false; @@ -56,7 +56,7 @@ namespace CalamityMod.NPCs.AstrumDeus direction *= 9f; npc.rotation = direction.ToRotation(); npc.localAI[0] += 1f; - if (Main.netMode != 1 && npc.localAI[0] >= 720f) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] >= 720f) { npc.localAI[0] = 0f; int num8 = expertMode ? 42 : 55; @@ -93,9 +93,9 @@ namespace CalamityMod.NPCs.AstrumDeus npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -103,10 +103,10 @@ namespace CalamityMod.NPCs.AstrumDeus } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/AstrumDeus/AstrumDeusProbe2.cs b/NPCs/AstrumDeus/AstrumDeusProbe2.cs index 077dc1f401..e41f8db5d4 100644 --- a/NPCs/AstrumDeus/AstrumDeusProbe2.cs +++ b/NPCs/AstrumDeus/AstrumDeusProbe2.cs @@ -46,7 +46,7 @@ namespace CalamityMod.NPCs.AstrumDeus { for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default, 2f); } npc.ai[1] = npc.ai[0]; start = false; @@ -57,7 +57,7 @@ namespace CalamityMod.NPCs.AstrumDeus direction *= 9f; npc.rotation = direction.ToRotation(); npc.localAI[0] += 1f; - if (Main.netMode != 1 && npc.localAI[0] >= 360f) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] >= 360f) { npc.localAI[0] = 0f; int num8 = expertMode ? 42 : 55; @@ -94,9 +94,9 @@ namespace CalamityMod.NPCs.AstrumDeus npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -104,10 +104,10 @@ namespace CalamityMod.NPCs.AstrumDeus } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/AstrumDeus/AstrumDeusProbe3.cs b/NPCs/AstrumDeus/AstrumDeusProbe3.cs index 74e0c546f3..c041414375 100644 --- a/NPCs/AstrumDeus/AstrumDeusProbe3.cs +++ b/NPCs/AstrumDeus/AstrumDeusProbe3.cs @@ -129,7 +129,7 @@ namespace CalamityMod.NPCs.AstrumDeus npc.velocity.Y = npc.velocity.Y - num2; } npc.localAI[0] += 1f; - if (Main.netMode != 1 && npc.localAI[0] >= 180f) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] >= 180f) { npc.localAI[0] = 0f; if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) @@ -237,9 +237,9 @@ namespace CalamityMod.NPCs.AstrumDeus npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -247,10 +247,10 @@ namespace CalamityMod.NPCs.AstrumDeus } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } for (int num625 = 0; num625 < 3; num625++) @@ -264,25 +264,25 @@ namespace CalamityMod.NPCs.AstrumDeus { scaleFactor10 = 1f; } - int num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + int num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13AB6_cp_0 = Main.gore[num626]; expr_13AB6_cp_0.velocity.X = expr_13AB6_cp_0.velocity.X + 1f; Gore expr_13AD6_cp_0 = Main.gore[num626]; expr_13AD6_cp_0.velocity.Y = expr_13AD6_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13B79_cp_0 = Main.gore[num626]; expr_13B79_cp_0.velocity.X = expr_13B79_cp_0.velocity.X - 1f; Gore expr_13B99_cp_0 = Main.gore[num626]; expr_13B99_cp_0.velocity.Y = expr_13B99_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13C3C_cp_0 = Main.gore[num626]; expr_13C3C_cp_0.velocity.X = expr_13C3C_cp_0.velocity.X + 1f; Gore expr_13C5C_cp_0 = Main.gore[num626]; expr_13C5C_cp_0.velocity.Y = expr_13C5C_cp_0.velocity.Y - 1f; - num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13CFF_cp_0 = Main.gore[num626]; expr_13CFF_cp_0.velocity.X = expr_13CFF_cp_0.velocity.X - 1f; diff --git a/NPCs/AstrumDeus/AstrumDeusTail.cs b/NPCs/AstrumDeus/AstrumDeusTail.cs index 8b2b6cff35..cca45c19a9 100644 --- a/NPCs/AstrumDeus/AstrumDeusTail.cs +++ b/NPCs/AstrumDeus/AstrumDeusTail.cs @@ -95,7 +95,7 @@ namespace CalamityMod.NPCs.AstrumDeus { for (int num934 = 0; num934 < 2; num934++) { - int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default(Color), 2f); + int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default, 2f); Main.dust[num935].noGravity = true; Main.dust[num935].noLight = true; } @@ -164,9 +164,9 @@ namespace CalamityMod.NPCs.AstrumDeus npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -174,10 +174,10 @@ namespace CalamityMod.NPCs.AstrumDeus } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/AstrumDeus/AstrumDeusTailSpectral.cs b/NPCs/AstrumDeus/AstrumDeusTailSpectral.cs index 6c0994c79c..6189001a1a 100644 --- a/NPCs/AstrumDeus/AstrumDeusTailSpectral.cs +++ b/NPCs/AstrumDeus/AstrumDeusTailSpectral.cs @@ -127,7 +127,7 @@ namespace CalamityMod.NPCs.AstrumDeus { for (int num934 = 0; num934 < 2; num934++) { - int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default(Color), 2f); + int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default, 2f); Main.dust[num935].noGravity = true; Main.dust[num935].noLight = true; } @@ -275,9 +275,9 @@ namespace CalamityMod.NPCs.AstrumDeus npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -285,10 +285,10 @@ namespace CalamityMod.NPCs.AstrumDeus } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/BrimstoneWaifu/Brimling.cs b/NPCs/BrimstoneWaifu/Brimling.cs index 23f3848137..36a30f2865 100644 --- a/NPCs/BrimstoneWaifu/Brimling.cs +++ b/NPCs/BrimstoneWaifu/Brimling.cs @@ -104,7 +104,7 @@ namespace CalamityMod.NPCs.BrimstoneWaifu if (npc.localAI[1] == 1f) { npc.localAI[1] = 0f; - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { npc.ai[0] = (float)num1447; } @@ -116,7 +116,7 @@ namespace CalamityMod.NPCs.BrimstoneWaifu Vector2 vector251 = Main.player[npc.target].Center - value53; bool flag104 = Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].Center, 1, 1); npc.localAI[0] += 1f; - if (Main.netMode != 1 && npc.localAI[0] >= 300f && Main.npc[CalamityGlobalNPC.brimstoneElemental].ai[0] != 4f) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] >= 300f && Main.npc[CalamityGlobalNPC.brimstoneElemental].ai[0] != 4f) { npc.localAI[0] = 0f; if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) @@ -184,7 +184,7 @@ namespace CalamityMod.NPCs.BrimstoneWaifu int var_9_48E3C_cp_1 = 0; num244 = var_9_48E3C_cp_0[var_9_48E3C_cp_1]; var_9_48E3C_cp_0[var_9_48E3C_cp_1] = num244 + 1f; - if (npc.ai[0] >= (float)num1447 && Main.netMode != 1) + if (npc.ai[0] >= (float)num1447 && Main.netMode != NetmodeID.MultiplayerClient) { if (npc.localAI[0] > 260f) { @@ -279,13 +279,13 @@ namespace CalamityMod.NPCs.BrimstoneWaifu { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/BrimstoneWaifu/BrimstoneElemental.cs b/NPCs/BrimstoneWaifu/BrimstoneElemental.cs index 78c103a06d..96044ce97e 100644 --- a/NPCs/BrimstoneWaifu/BrimstoneElemental.cs +++ b/NPCs/BrimstoneWaifu/BrimstoneElemental.cs @@ -120,7 +120,7 @@ namespace CalamityMod.NPCs.BrimstoneWaifu { if (Main.rand.Next(3) < dustAmt) { - int dust = Dust.NewDust(npc.Center - new Vector2((float)size), size * 2, size * 2, 235, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default(Color), 1.5f); + int dust = Dust.NewDust(npc.Center - new Vector2((float)size), size * 2, size * 2, 235, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default, 1.5f); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 0.2f; Main.dust[dust].fadeIn = 1f; @@ -163,7 +163,7 @@ namespace CalamityMod.NPCs.BrimstoneWaifu { npc.defense = provy ? 120 : 20; npc.chaseable = true; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[1] += 1f; if (npc.justHit) @@ -186,12 +186,12 @@ namespace CalamityMod.NPCs.BrimstoneWaifu int min = 12; int max = 15; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) playerPosX += Main.rand.Next(min, max); else playerPosX -= Main.rand.Next(min, max); - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) playerPosY += Main.rand.Next(min, max); else playerPosY -= Main.rand.Next(min, max); @@ -221,7 +221,7 @@ namespace CalamityMod.NPCs.BrimstoneWaifu npc.alpha += 25; if (npc.alpha >= 255) { - if (Main.netMode != 1 && NPC.CountNPCS(mod.NPCType("Brimling")) < 2 && revenge) + if (Main.netMode != NetmodeID.MultiplayerClient && NPC.CountNPCS(mod.NPCType("Brimling")) < 2 && revenge) { NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("Brimling"), 0, 0f, 0f, 0f, 0f, 255); } @@ -301,7 +301,7 @@ namespace CalamityMod.NPCs.BrimstoneWaifu } if (shootProjectile && Collision.CanHit(shootFromVectorX, 1, 1, player.position, player.width, player.height)) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { float projectileSpeed = 6f; //changed from 10 if (npc.GetGlobalNPC(mod).enraged || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive)) @@ -398,7 +398,7 @@ namespace CalamityMod.NPCs.BrimstoneWaifu npc.defense = 99999; npc.dontTakeDamage = false; npc.chaseable = false; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[0] += (float)Main.rand.Next(4); if (npc.GetGlobalNPC(mod).enraged || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive)) @@ -539,7 +539,7 @@ namespace CalamityMod.NPCs.BrimstoneWaifu public override void NPCLoot() { // redo the rest of this drop code later - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrimstoneElementalTrophy")); } @@ -560,7 +560,7 @@ namespace CalamityMod.NPCs.BrimstoneWaifu { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Bloodstone"), Main.rand.Next(20, 31)); } - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("RoseStone"), 1, true); } @@ -589,9 +589,9 @@ namespace CalamityMod.NPCs.BrimstoneWaifu Color messageColor = Color.Crimson; if (!NPC.downedMechBoss3 && !CalamityWorld.downedBrimstoneElemental) { - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) Main.NewText(Language.GetTextValue(key), messageColor); - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -610,7 +610,7 @@ namespace CalamityMod.NPCs.BrimstoneWaifu { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -622,9 +622,9 @@ namespace CalamityMod.NPCs.BrimstoneWaifu npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -632,10 +632,10 @@ namespace CalamityMod.NPCs.BrimstoneWaifu } for (int num623 = 0; num623 < 60; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } float randomSpread = (float)(Main.rand.Next(-200, 200) / 100); diff --git a/NPCs/Bumblefuck/Bumblefuck.cs b/NPCs/Bumblefuck/Bumblefuck.cs index b04faa7593..dc96405c93 100644 --- a/NPCs/Bumblefuck/Bumblefuck.cs +++ b/NPCs/Bumblefuck/Bumblefuck.cs @@ -165,7 +165,7 @@ namespace CalamityMod.NPCs.Bumblefuck // Phase switch npc.ai[1] += 1f; - if (npc.ai[1] >= 30f && Main.netMode != 1) + if (npc.ai[1] >= 30f && Main.netMode != NetmodeID.MultiplayerClient) { npc.ai[1] = 0f; npc.ai[2] = 0f; @@ -422,7 +422,7 @@ namespace CalamityMod.NPCs.Bumblefuck npc.TargetClosest(true); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.ai[1] = -1f; npc.ai[2] = -1f; @@ -512,7 +512,7 @@ namespace CalamityMod.NPCs.Bumblefuck float num1323 = 4f; //4 float num1324 = 2f; //2 - if (Main.netMode != 1 && vector208.Length() < 4f) + if (Main.netMode != NetmodeID.MultiplayerClient && vector208.Length() < 4f) { int num1325 = 10; if (Main.expertMode) @@ -624,13 +624,13 @@ namespace CalamityMod.NPCs.Bumblefuck { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 50; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); } float randomSpread = (float)(Main.rand.Next(-200, 200) / 100); Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/BumbleHead"), 1f); diff --git a/NPCs/Bumblefuck/Bumblefuck2.cs b/NPCs/Bumblefuck/Bumblefuck2.cs index 2c48afed58..4f5c602572 100644 --- a/NPCs/Bumblefuck/Bumblefuck2.cs +++ b/NPCs/Bumblefuck/Bumblefuck2.cs @@ -324,13 +324,13 @@ namespace CalamityMod.NPCs.Bumblefuck { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 50; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Calamitas/Calamitas.cs b/NPCs/Calamitas/Calamitas.cs index df07d1779e..f3b703ce5e 100644 --- a/NPCs/Calamitas/Calamitas.cs +++ b/NPCs/Calamitas/Calamitas.cs @@ -83,16 +83,16 @@ namespace CalamityMod.NPCs.Calamitas public override void AI() { - if ((double)npc.life <= (double)npc.lifeMax * 0.75 && Main.netMode != 1) + if ((double)npc.life <= (double)npc.lifeMax * 0.75 && Main.netMode != NetmodeID.MultiplayerClient) { NPC.NewNPC((int)npc.Center.X, (int)npc.position.Y + npc.height, mod.NPCType("CalamitasRun3"), npc.whoAmI, 0f, 0f, 0f, 0f, 255); string key = "Mods.CalamityMod.CalamitasBossText"; Color messageColor = Color.Orange; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -233,7 +233,7 @@ namespace CalamityMod.NPCs.Calamitas num825 = player.position.X + (float)(player.width / 2) - vector82.X; num826 = player.position.Y + (float)(player.height / 2) - vector82.Y; npc.rotation = (float)Math.Atan2((double)num826, (double)num825) - 1.57f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[1] += 1f; if (revenge) @@ -316,7 +316,7 @@ namespace CalamityMod.NPCs.Calamitas num834 = player.position.X + (float)(player.width / 2) - vector83.X; num835 = player.position.Y + (float)(player.height / 2) - vector83.Y; npc.rotation = (float)Math.Atan2((double)num835, (double)num834) - 1.57f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[1] += 1f; if (revenge) @@ -414,7 +414,7 @@ namespace CalamityMod.NPCs.Calamitas { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default, 1f); } } else @@ -427,9 +427,9 @@ namespace CalamityMod.NPCs.Calamitas npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -437,10 +437,10 @@ namespace CalamityMod.NPCs.Calamitas } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/Calamitas/CalamitasRun.cs b/NPCs/Calamitas/CalamitasRun.cs index d7672750e5..3ebb7e152f 100644 --- a/NPCs/Calamitas/CalamitasRun.cs +++ b/NPCs/Calamitas/CalamitasRun.cs @@ -270,7 +270,7 @@ namespace CalamityMod.NPCs.Calamitas npc.localAI[2] = 0f; Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 34); } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[1] += 1f; if (revenge) @@ -432,25 +432,25 @@ namespace CalamityMod.NPCs.Calamitas public override void NPCLoot() { - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CataclysmTrophy")); } if (Main.expertMode) { - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrimstoneFlamesprayer")); } - else if (Main.rand.Next(12) == 0) + else if (Main.rand.NextBool(12)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrimstoneFlamesprayer")); } if (Main.expertMode) { - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrimstoneFlameblaster")); } - else if (Main.rand.Next(12) == 0) + else if (Main.rand.NextBool(12)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrimstoneFlameblaster")); } @@ -460,7 +460,7 @@ namespace CalamityMod.NPCs.Calamitas { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -477,9 +477,9 @@ namespace CalamityMod.NPCs.Calamitas npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -487,10 +487,10 @@ namespace CalamityMod.NPCs.Calamitas } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/Calamitas/CalamitasRun2.cs b/NPCs/Calamitas/CalamitasRun2.cs index 09b50b6dd2..edc243628a 100644 --- a/NPCs/Calamitas/CalamitasRun2.cs +++ b/NPCs/Calamitas/CalamitasRun2.cs @@ -270,7 +270,7 @@ namespace CalamityMod.NPCs.Calamitas npc.localAI[2] = 0f; Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 34); } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[1] += 1f; if (revenge) @@ -432,16 +432,16 @@ namespace CalamityMod.NPCs.Calamitas public override void NPCLoot() { - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CatastropheTrophy")); } if (Main.expertMode) { - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CrushsawCrasher")); } - else if (Main.rand.Next(15) == 0) + else if (Main.rand.NextBool(15)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CrushsawCrasher")); } @@ -451,7 +451,7 @@ namespace CalamityMod.NPCs.Calamitas { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -468,9 +468,9 @@ namespace CalamityMod.NPCs.Calamitas npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -478,10 +478,10 @@ namespace CalamityMod.NPCs.Calamitas } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/Calamitas/CalamitasRun3.cs b/NPCs/Calamitas/CalamitasRun3.cs index c0068f2516..f953057c4c 100644 --- a/NPCs/Calamitas/CalamitasRun3.cs +++ b/NPCs/Calamitas/CalamitasRun3.cs @@ -118,7 +118,7 @@ namespace CalamityMod.NPCs.Calamitas Player player = Main.player[npc.target]; if (!halfLife && npc.life <= npc.lifeMax / 2) { - if (!secondStage && Main.netMode != 1) + if (!secondStage && Main.netMode != NetmodeID.MultiplayerClient) { Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 74); for (int I = 0; I < 5; I++) @@ -132,11 +132,11 @@ namespace CalamityMod.NPCs.Calamitas } string key = "Mods.CalamityMod.CalamitasBossText3"; Color messageColor = Color.Orange; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -148,7 +148,7 @@ namespace CalamityMod.NPCs.Calamitas } if (npc.life > 0) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int num660 = (int)((double)npc.lifeMax * 0.3); //70%, 40%, and 10% if ((float)(npc.life + num660) < bossLife) @@ -160,11 +160,11 @@ namespace CalamityMod.NPCs.Calamitas NPC.NewNPC((int)npc.Center.X, (int)npc.position.Y + npc.height, mod.NPCType("CalamitasRun2"), npc.whoAmI, 0f, 0f, 0f, 0f, 255); string key = "Mods.CalamityMod.CalamitasBossText2"; Color messageColor = Color.Orange; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -335,7 +335,7 @@ namespace CalamityMod.NPCs.Calamitas num825 = player.position.X + (float)(player.width / 2) - vector82.X; num826 = player.position.Y + (float)(player.height / 2) - vector82.Y; npc.rotation = (float)Math.Atan2((double)num826, (double)num825) - 1.57f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[1] += 1f; if (!flag100) @@ -429,7 +429,7 @@ namespace CalamityMod.NPCs.Calamitas num834 = player.position.X + (float)(player.width / 2) - vector83.X; num835 = player.position.Y + (float)(player.height / 2) - vector83.Y; npc.rotation = (float)Math.Atan2((double)num835, (double)num834) - 1.57f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[1] += 1f; if (!flag100) @@ -529,7 +529,7 @@ namespace CalamityMod.NPCs.Calamitas public override void NPCLoot() { - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CalamitasTrophy")); } @@ -553,27 +553,27 @@ namespace CalamityMod.NPCs.Calamitas { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Bloodstone"), Main.rand.Next(30, 41)); } - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { npc.DropItemInstanced(npc.position, npc.Size, mod.ItemType("ChaosStone"), 1, true); } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CalamitasInferno")); } - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CalamitasMask")); } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TheEyeofCalamitas")); } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BlightedEyeStaff")); } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Animosity")); } @@ -592,9 +592,9 @@ namespace CalamityMod.NPCs.Calamitas if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active) Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/WyrmScream"), (int)Main.player[Main.myPlayer].position.X, (int)Main.player[Main.myPlayer].position.Y); - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) Main.NewText(Language.GetTextValue(key), messageColor); - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -613,7 +613,7 @@ namespace CalamityMod.NPCs.Calamitas { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -631,9 +631,9 @@ namespace CalamityMod.NPCs.Calamitas npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -641,10 +641,10 @@ namespace CalamityMod.NPCs.Calamitas } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/Calamitas/LifeSeeker.cs b/NPCs/Calamitas/LifeSeeker.cs index 40658f6990..dacd5c6660 100644 --- a/NPCs/Calamitas/LifeSeeker.cs +++ b/NPCs/Calamitas/LifeSeeker.cs @@ -51,13 +51,13 @@ namespace CalamityMod.NPCs.Calamitas { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CalamitasGores/LifeSeeker"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CalamitasGores/LifeSeeker2"), 1f); diff --git a/NPCs/Calamitas/SoulSeeker.cs b/NPCs/Calamitas/SoulSeeker.cs index de69e73a44..b963311328 100644 --- a/NPCs/Calamitas/SoulSeeker.cs +++ b/NPCs/Calamitas/SoulSeeker.cs @@ -51,7 +51,7 @@ namespace CalamityMod.NPCs.Calamitas { for (int num621 = 0; num621 < 15; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); } npc.ai[1] = npc.ai[0]; start = false; @@ -64,7 +64,7 @@ namespace CalamityMod.NPCs.Calamitas timer++; if (timer > 60) { - if (Main.netMode != 1 && Main.rand.Next(10) == 0) + if (Main.netMode != NetmodeID.MultiplayerClient && Main.rand.NextBool(10)) { if (NPC.CountNPCS(mod.NPCType("LifeSeeker")) < 10) { @@ -75,7 +75,7 @@ namespace CalamityMod.NPCs.Calamitas } for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); } int damage = expertMode ? 22 : 30; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, direction.X, direction.Y, mod.ProjectileType("BrimstoneBarrage"), damage, 1f, npc.target); @@ -103,7 +103,7 @@ namespace CalamityMod.NPCs.Calamitas { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -119,9 +119,9 @@ namespace CalamityMod.NPCs.Calamitas npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -129,10 +129,10 @@ namespace CalamityMod.NPCs.Calamitas } for (int num623 = 0; num623 < 40; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index 308ee3f6d6..5ee7771d9f 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -59,7 +59,7 @@ namespace CalamityMod.NPCs if (npc.ai[0] == 2f || npc.ai[0] >= 5f || (npc.ai[0] == 4f && npc.velocity.Y > 0f) || npc.GetGlobalNPC(mod).enraged || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive)) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[0] += ((npc.ai[0] == 2f || (npc.ai[0] == 4f && npc.velocity.Y > 0f && expertMode)) ? 4f : shootTimer); if (npc.localAI[0] >= 180f) @@ -294,7 +294,7 @@ namespace CalamityMod.NPCs { for (int num623 = 0; num623 < 4; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X - 20f, npc.position.Y + (float)npc.height), npc.width + 20, 4, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 1.5f); + int num624 = Dust.NewDust(new Vector2(npc.position.X - 20f, npc.position.Y + (float)npc.height), npc.width + 20, 4, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 1.5f); Main.dust[num624].velocity *= 0.2f; } } @@ -344,7 +344,7 @@ namespace CalamityMod.NPCs npc.velocity.Y *= 0.95f; // Spawn slimes and start teleport - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[1] += 1f; if (!Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) @@ -356,7 +356,7 @@ namespace CalamityMod.NPCs bool spawnFlag = revenge; if (NPC.CountNPCS(mod.NPCType("AstrageldonSlime")) > 1) spawnFlag = false; - if (spawnFlag && Main.netMode != 1) + if (spawnFlag && Main.netMode != NetmodeID.MultiplayerClient) NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y - 25, mod.NPCType("AstrageldonSlime"), 0, 0f, 0f, 0f, 0f, 255); // Reset localAI and find a teleport destination @@ -423,7 +423,7 @@ namespace CalamityMod.NPCs int num; for (int num245 = 0; num245 < 10; num245 = num + 1) { - int num244 = Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("AstralOrange"), npc.velocity.X, npc.velocity.Y, 255, default(Color), 2f); + int num244 = Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("AstralOrange"), npc.velocity.X, npc.velocity.Y, 255, default, 2f); Main.dust[num244].noGravity = true; Main.dust[num244].velocity *= 0.5f; num = num245; @@ -441,7 +441,7 @@ namespace CalamityMod.NPCs bool spawnFlag = revenge; if (NPC.CountNPCS(mod.NPCType("AstrageldonSlime")) > 1) spawnFlag = false; - if (spawnFlag && Main.netMode != 1) + if (spawnFlag && Main.netMode != NetmodeID.MultiplayerClient) NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y - 25, mod.NPCType("AstrageldonSlime"), 0, 0f, 0f, 0f, 0f, 255); // Become vulnerable @@ -466,7 +466,7 @@ namespace CalamityMod.NPCs int num; for (int num245 = 0; num245 < 10; num245 = num + 1) { - int num244 = Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("AstralOrange"), npc.velocity.X, npc.velocity.Y, 255, default(Color), 2f); + int num244 = Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("AstralOrange"), npc.velocity.X, npc.velocity.Y, 255, default, 2f); Main.dust[num244].noGravity = true; Main.dust[num244].velocity *= 0.5f; num = num245; diff --git a/NPCs/CalamityBiomeNPCs/CultistAssassin.cs b/NPCs/CalamityBiomeNPCs/CultistAssassin.cs index 2544a4d9bb..f2097b0731 100644 --- a/NPCs/CalamityBiomeNPCs/CultistAssassin.cs +++ b/NPCs/CalamityBiomeNPCs/CultistAssassin.cs @@ -50,13 +50,13 @@ namespace CalamityMod.NPCs.CalamityBiomeNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } } } @@ -71,11 +71,11 @@ namespace CalamityMod.NPCs.CalamityBiomeNPCs public override void NPCLoot() { - if (CalamityWorld.downedProvidence && Main.rand.Next(2) == 0) + if (CalamityWorld.downedProvidence && Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Bloodstone")); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofChaos")); } diff --git a/NPCs/CalamityBiomeNPCs/DespairStone.cs b/NPCs/CalamityBiomeNPCs/DespairStone.cs index f43b5c013f..05fae6c286 100644 --- a/NPCs/CalamityBiomeNPCs/DespairStone.cs +++ b/NPCs/CalamityBiomeNPCs/DespairStone.cs @@ -116,7 +116,7 @@ namespace CalamityMod.NPCs.CalamityBiomeNPCs Main.PlaySound(2, npc.Center, 14); for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 235, 0f, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 235, 0f, -1f, 0, default, 1f); } } if (npc.ai[3] < (float)num) @@ -343,11 +343,11 @@ namespace CalamityMod.NPCs.CalamityBiomeNPCs public override void NPCLoot() { - if (CalamityWorld.downedProvidence && Main.rand.Next(2) == 0) + if (CalamityWorld.downedProvidence && Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Bloodstone")); } - if (Main.hardMode && Main.rand.Next(3) == 0) + if (Main.hardMode && Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofChaos")); } @@ -357,13 +357,13 @@ namespace CalamityMod.NPCs.CalamityBiomeNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 40; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/CalamityBiomeNPCs/Scryllar.cs b/NPCs/CalamityBiomeNPCs/Scryllar.cs index 5e210457cb..a8c2cb367a 100644 --- a/NPCs/CalamityBiomeNPCs/Scryllar.cs +++ b/NPCs/CalamityBiomeNPCs/Scryllar.cs @@ -260,11 +260,11 @@ namespace CalamityMod.NPCs.CalamityBiomeNPCs public override void NPCLoot() { - if (CalamityWorld.downedProvidence && Main.rand.Next(2) == 0) + if (CalamityWorld.downedProvidence && Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Bloodstone")); } - if (Main.hardMode && Main.rand.Next(3) == 0) + if (Main.hardMode && Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofChaos")); } @@ -274,13 +274,13 @@ namespace CalamityMod.NPCs.CalamityBiomeNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 40; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/CalamityBiomeNPCs/ScryllarRage.cs b/NPCs/CalamityBiomeNPCs/ScryllarRage.cs index 789546c522..f830561e3a 100644 --- a/NPCs/CalamityBiomeNPCs/ScryllarRage.cs +++ b/NPCs/CalamityBiomeNPCs/ScryllarRage.cs @@ -260,11 +260,11 @@ namespace CalamityMod.NPCs.CalamityBiomeNPCs public override void NPCLoot() { - if (CalamityWorld.downedProvidence && Main.rand.Next(2) == 0) + if (CalamityWorld.downedProvidence && Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Bloodstone")); } - if (Main.hardMode && Main.rand.Next(3) == 0) + if (Main.hardMode && Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofChaos")); } @@ -274,13 +274,13 @@ namespace CalamityMod.NPCs.CalamityBiomeNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 40; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/CalamityBiomeNPCs/SoulSlurper.cs b/NPCs/CalamityBiomeNPCs/SoulSlurper.cs index fbfe906448..52c09ada73 100644 --- a/NPCs/CalamityBiomeNPCs/SoulSlurper.cs +++ b/NPCs/CalamityBiomeNPCs/SoulSlurper.cs @@ -133,7 +133,7 @@ namespace CalamityMod.NPCs.CalamityBiomeNPCs { npc.localAI[0] = 0f; } - if (Main.netMode != 1 && npc.localAI[0] >= 120f) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] >= 120f) { npc.localAI[0] = 0f; if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) @@ -222,11 +222,11 @@ namespace CalamityMod.NPCs.CalamityBiomeNPCs public override void NPCLoot() { - if (CalamityWorld.downedProvidence && Main.rand.Next(2) == 0) + if (CalamityWorld.downedProvidence && Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Bloodstone")); } - if (Main.hardMode && Main.rand.Next(3) == 0) + if (Main.hardMode && Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofChaos")); } @@ -236,7 +236,7 @@ namespace CalamityMod.NPCs.CalamityBiomeNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -252,9 +252,9 @@ namespace CalamityMod.NPCs.CalamityBiomeNPCs npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -262,10 +262,10 @@ namespace CalamityMod.NPCs.CalamityBiomeNPCs } for (int num623 = 0; num623 < 20; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/CalamityGlobalAI.cs b/NPCs/CalamityGlobalAI.cs index 32387946c5..c0f912e841 100644 --- a/NPCs/CalamityGlobalAI.cs +++ b/NPCs/CalamityGlobalAI.cs @@ -116,7 +116,7 @@ namespace CalamityMod.NPCs if (npc.ai[3] == 0f && npc.life > 0) npc.ai[3] = (float)npc.lifeMax; - if (npc.localAI[3] == 0f && Main.netMode != 1) + if (npc.localAI[3] == 0f && Main.netMode != NetmodeID.MultiplayerClient) { npc.ai[0] = -100f; npc.localAI[3] = 1f; @@ -144,7 +144,7 @@ namespace CalamityMod.NPCs npc.ai[0] = 0f; npc.ai[1] = 5f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.TargetClosest(false); Vector2 vector30 = Main.player[npc.target].Center - npc.Center; @@ -250,7 +250,7 @@ namespace CalamityMod.NPCs if (npc.ai[0] == 60f) Gore.NewGore(npc.Center + new Vector2(-40f, (float)(-(float)npc.height / 2)), npc.velocity, 734, 1f); - if (npc.ai[0] >= 60f && Main.netMode != 1) + if (npc.ai[0] >= 60f && Main.netMode != NetmodeID.MultiplayerClient) { npc.Bottom = new Vector2(npc.localAI[1], npc.localAI[2]); npc.ai[1] = 6f; @@ -258,7 +258,7 @@ namespace CalamityMod.NPCs npc.netUpdate = true; } - if (Main.netMode == 1 && npc.ai[0] >= 120f) + if (Main.netMode == NetmodeID.MultiplayerClient && npc.ai[0] >= 120f) { npc.ai[1] = 6f; npc.ai[0] = 0f; @@ -272,7 +272,7 @@ namespace CalamityMod.NPCs num234 = MathHelper.Clamp(npc.ai[0] / 30f, 0f, 1f); num234 = 0.5f + num234 * 0.5f; - if (npc.ai[0] >= 30f && Main.netMode != 1) + if (npc.ai[0] >= 30f && Main.netMode != NetmodeID.MultiplayerClient) { npc.ai[1] = 0f; npc.ai[0] = 0f; @@ -280,7 +280,7 @@ namespace CalamityMod.NPCs npc.TargetClosest(true); } - if (Main.netMode == 1 && npc.ai[0] >= 60f) + if (Main.netMode == NetmodeID.MultiplayerClient && npc.ai[0] >= 60f) { npc.ai[1] = 0f; npc.ai[0] = 0f; @@ -381,7 +381,7 @@ namespace CalamityMod.NPCs npc.position.Y = npc.position.Y - (float)npc.height; } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int num251 = (int)((double)npc.lifeMax * 0.05); if ((float)(npc.life + num251) < npc.ai[3]) @@ -395,7 +395,7 @@ namespace CalamityMod.NPCs int y = (int)(npc.position.Y + (float)Main.rand.Next(npc.height - 32)); int num254 = 1; - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) num254 = 535; int num255 = NPC.NewNPC(x, y, num254, 0, 0f, 0f, 0f, 0f, 255); @@ -405,7 +405,7 @@ namespace CalamityMod.NPCs Main.npc[num255].ai[0] = (float)(-1000 * Main.rand.Next(3)); Main.npc[num255].ai[1] = 0f; - if (Main.netMode == 2 && num255 < 200) + if (Main.netMode == NetmodeID.Server && num255 < 200) NetMessage.SendData(23, -1, -1, null, num255, 0f, 0f, 0f, 0, 0, 0); num = num253; @@ -424,7 +424,7 @@ namespace CalamityMod.NPCs NPC.crimsonBoss = npc.whoAmI; npc.dontTakeDamage = false; - if (Main.netMode != 1 && npc.localAI[0] == 0f) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] == 0f) { npc.localAI[0] = 1f; int num; @@ -456,7 +456,7 @@ namespace CalamityMod.NPCs int num; for (int num794 = 0; num794 < 20; num794 = num + 1) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default, 1f); num = num794; } @@ -467,7 +467,7 @@ namespace CalamityMod.NPCs if (calamityGlobalNPC.newAI[0] >= 60f) { calamityGlobalNPC.newAI[0] = 0f; - if (Main.netMode != 1 && NPC.CountNPCS(NPCID.Creeper) < 15) + if (Main.netMode != NetmodeID.MultiplayerClient && NPC.CountNPCS(NPCID.Creeper) < 15) { int creeper = NPC.NewNPC((int)(npc.position.X + (float)(npc.width / 2) + npc.velocity.X), (int)(npc.position.Y + (float)(npc.height / 2) + npc.velocity.Y), 267, 0, 0f, 0f, 0f, 0f, 255); Main.npc[creeper].netUpdate = true; @@ -493,14 +493,14 @@ namespace CalamityMod.NPCs if (npc.ai[0] == -1f) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[1] += 1f; if (npc.justHit) npc.localAI[1] -= (float)Main.rand.Next(5); int num799 = 60 + Main.rand.Next(120); - if (Main.netMode != 0) + if (Main.netMode != NetmodeID.SinglePlayer) num799 += Main.rand.Next(30, 90); if (npc.localAI[1] >= (float)num799) @@ -518,12 +518,12 @@ namespace CalamityMod.NPCs num801 = (int)Main.player[npc.target].Center.X / 16; num802 = (int)Main.player[npc.target].Center.Y / 16; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) num801 += Main.rand.Next(7, 13); else num801 -= Main.rand.Next(7, 13); - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) num802 += Main.rand.Next(7, 13); else num802 -= Main.rand.Next(7, 13); @@ -549,7 +549,7 @@ namespace CalamityMod.NPCs { npc.velocity *= 0.9f; - if (Main.netMode != 0) + if (Main.netMode != NetmodeID.SinglePlayer) npc.ai[3] += 15f; else npc.ai[3] += 25f; @@ -570,7 +570,7 @@ namespace CalamityMod.NPCs } else if (npc.ai[0] == -3f) { - if (Main.netMode != 0) + if (Main.netMode != NetmodeID.SinglePlayer) npc.ai[3] -= 15f; else npc.ai[3] -= 25f; @@ -609,7 +609,7 @@ namespace CalamityMod.NPCs if (npc.ai[0] == 0f) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int num807 = 0; int num; @@ -724,7 +724,7 @@ namespace CalamityMod.NPCs num349 *= num351; num350 *= num351; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { float num418 = ((enraged || Config.BossRushXerocCurse) ? 18f : 12f); int num419 = 12; @@ -780,7 +780,7 @@ namespace CalamityMod.NPCs } else if (npc.ai[0] == -1f) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { float num595 = npc.ai[1]; int num596; @@ -975,7 +975,7 @@ namespace CalamityMod.NPCs if (Collision.CanHit(vector76, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height) && flag38) { Main.PlaySound(3, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int num615 = Main.rand.Next(210, 212); int num616 = NPC.NewNPC((int)vector76.X, (int)vector76.Y, num615, 0, 0f, 0f, 0f, 0f, 255); @@ -1053,7 +1053,7 @@ namespace CalamityMod.NPCs if (flag39 && npc.position.Y + (float)npc.height < Main.player[npc.target].position.Y && Collision.CanHit(vector78, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { Main.PlaySound(SoundID.Item17, npc.position); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { float num624 = ((enraged || Config.BossRushXerocCurse) ? 24f : 16f); float num625 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector78.X + (float)Main.rand.Next(-80, 81); @@ -1175,7 +1175,7 @@ namespace CalamityMod.NPCs { calamityGlobalNPC.newAI[0] = 0f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) Projectile.NewProjectile(vector.X, vector.Y, 0f, 0f, 385, 0, 0f, Main.myPlayer, 1f, (float)(npc.target + 1)); npc.netUpdate = true; @@ -1274,7 +1274,7 @@ namespace CalamityMod.NPCs npc.localAI[0] = 1f; npc.alpha = 255; npc.rotation = 0f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.ai[0] = -1f; npc.netUpdate = true; @@ -1375,9 +1375,9 @@ namespace CalamityMod.NPCs int num20 = 36; for (int i = 0; i < num20; i++) { - Vector2 expr_80F = (Vector2.Normalize(npc.velocity) * new Vector2((float)npc.width / 2f, (float)npc.height) * 0.75f * 0.5f).RotatedBy((double)((float)(i - (num20 / 2 - 1)) * 6.28318548f / (float)num20), default(Vector2)) + npc.Center; + Vector2 expr_80F = (Vector2.Normalize(npc.velocity) * new Vector2((float)npc.width / 2f, (float)npc.height) * 0.75f * 0.5f).RotatedBy((double)((float)(i - (num20 / 2 - 1)) * 6.28318548f / (float)num20), default) + npc.Center; Vector2 vector2 = expr_80F - npc.Center; - int num21 = Dust.NewDust(expr_80F + vector2, 0, 0, 172, vector2.X * 2f, vector2.Y * 2f, 100, default(Color), 1.4f); + int num21 = Dust.NewDust(expr_80F + vector2, 0, 0, 172, vector2.X * 2f, vector2.Y * 2f, 100, default, 1.4f); Main.dust[num21].noGravity = true; Main.dust[num21].noLight = true; Main.dust[num21].velocity = Vector2.Normalize(vector2) * 3f; @@ -1514,9 +1514,9 @@ namespace CalamityMod.NPCs int num24 = 7; for (int j = 0; j < num24; j++) { - Vector2 arg_E1C_0 = (Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f).RotatedBy((double)(j - (num24 / 2 - 1)) * 3.1415926535897931 / (double)((float)num24), default(Vector2)) + vector; + Vector2 arg_E1C_0 = (Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f).RotatedBy((double)(j - (num24 / 2 - 1)) * 3.1415926535897931 / (double)((float)num24), default) + vector; Vector2 vector4 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); - int num25 = Dust.NewDust(arg_E1C_0 + vector4, 0, 0, 172, vector4.X * 2f, vector4.Y * 2f, 100, default(Color), 1.4f); + int num25 = Dust.NewDust(arg_E1C_0 + vector4, 0, 0, 172, vector4.X * 2f, vector4.Y * 2f, 100, default, 1.4f); Main.dust[num25].noGravity = true; Main.dust[num25].noLight = true; Main.dust[num25].velocity /= 4f; @@ -1570,7 +1570,7 @@ namespace CalamityMod.NPCs if (npc.ai[2] % (float)num7 == 0f) { Main.PlaySound(4, (int)npc.Center.X, (int)npc.Center.Y, 19, 1f, 0f); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { Vector2 vector6 = Vector2.Normalize(player.Center - vector) * (float)(npc.width + 20) / 2f + vector; NPC.NewNPC((int)vector6.X, (int)vector6.Y + 45, 371, 0, 0f, 0f, 0f, 0f, 255); @@ -1605,7 +1605,7 @@ namespace CalamityMod.NPCs if (npc.ai[2] == (float)(num9 - 30)) Main.PlaySound(29, (int)vector.X, (int)vector.Y, 9, 1f, 0f); - if (Main.netMode != 1 && npc.ai[2] == (float)(num9 - 30)) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == (float)(num9 - 30)) { Vector2 vector7 = npc.rotation.ToRotationVector2() * (Vector2.UnitX * (float)npc.direction) * (float)(npc.width + 20) / 2f + vector; Projectile.NewProjectile(vector7.X, vector7.Y, (float)(npc.direction * 2), 8f, 385, 0, 0f, Main.myPlayer, 0f, 0f); @@ -1768,9 +1768,9 @@ namespace CalamityMod.NPCs int num29 = 7; for (int k = 0; k < num29; k++) { - Vector2 arg_1A97_0 = (Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f).RotatedBy((double)(k - (num29 / 2 - 1)) * 3.1415926535897931 / (double)((float)num29), default(Vector2)) + vector; + Vector2 arg_1A97_0 = (Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f).RotatedBy((double)(k - (num29 / 2 - 1)) * 3.1415926535897931 / (double)((float)num29), default) + vector; Vector2 vector9 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); - int num30 = Dust.NewDust(arg_1A97_0 + vector9, 0, 0, 172, vector9.X * 2f, vector9.Y * 2f, 100, default(Color), 1.4f); + int num30 = Dust.NewDust(arg_1A97_0 + vector9, 0, 0, 172, vector9.X * 2f, vector9.Y * 2f, 100, default, 1.4f); Main.dust[num30].noGravity = true; Main.dust[num30].noLight = true; Main.dust[num30].velocity /= 4f; @@ -1795,18 +1795,18 @@ namespace CalamityMod.NPCs if (npc.ai[2] % (float)num14 == 0f) { Main.PlaySound(4, (int)npc.Center.X, (int)npc.Center.Y, 19, 1f, 0f); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { Vector2 vector10 = Vector2.Normalize(npc.velocity) * (float)(npc.width + 20) / 2f + vector; int num31 = NPC.NewNPC((int)vector10.X, (int)vector10.Y + 45, 371, 0, 0f, 0f, 0f, 0f, 255); Main.npc[num31].target = npc.target; - Main.npc[num31].velocity = Vector2.Normalize(npc.velocity).RotatedBy((double)(1.57079637f * (float)npc.direction), default(Vector2)) * scaleFactor3; + Main.npc[num31].velocity = Vector2.Normalize(npc.velocity).RotatedBy((double)(1.57079637f * (float)npc.direction), default) * scaleFactor3; Main.npc[num31].netUpdate = true; Main.npc[num31].ai[3] = (float)Main.rand.Next(80, 121) / 100f; } } - npc.velocity = npc.velocity.RotatedBy((double)(-(double)num15 * (float)npc.direction), default(Vector2)); + npc.velocity = npc.velocity.RotatedBy((double)(-(double)num15 * (float)npc.direction), default); npc.rotation -= num15 * (float)npc.direction; npc.ai[2] += 1f; @@ -1826,7 +1826,7 @@ namespace CalamityMod.NPCs if (npc.ai[2] == (float)(num9 - 30)) Main.PlaySound(29, (int)vector.X, (int)vector.Y, 20, 1f, 0f); - if (Main.netMode != 1 && npc.ai[2] == (float)(num9 - 30)) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == (float)(num9 - 30)) Projectile.NewProjectile(vector.X, vector.Y, 0f, 0f, 385, 0, 0f, Main.myPlayer, 1f, (float)(npc.target + 1)); npc.ai[2] += 1f; @@ -1977,9 +1977,9 @@ namespace CalamityMod.NPCs int num34 = 7; for (int m = 0; m < num34; m++) { - Vector2 arg_2444_0 = (Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f).RotatedBy((double)(m - (num34 / 2 - 1)) * 3.1415926535897931 / (double)((float)num34), default(Vector2)) + vector; + Vector2 arg_2444_0 = (Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f).RotatedBy((double)(m - (num34 / 2 - 1)) * 3.1415926535897931 / (double)((float)num34), default) + vector; Vector2 vector11 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); - int num35 = Dust.NewDust(arg_2444_0 + vector11, 0, 0, 172, vector11.X * 2f, vector11.Y * 2f, 100, default(Color), 1.4f); + int num35 = Dust.NewDust(arg_2444_0 + vector11, 0, 0, 172, vector11.X * 2f, vector11.Y * 2f, 100, default, 1.4f); Main.dust[num35].noGravity = true; Main.dust[num35].noLight = true; Main.dust[num35].velocity /= 4f; @@ -2014,7 +2014,7 @@ namespace CalamityMod.NPCs if (npc.ai[2] == (float)(num12 / 2)) Main.PlaySound(29, (int)vector.X, (int)vector.Y, 20, 1f, 0f); - if (Main.netMode != 1 && npc.ai[2] == (float)(num12 / 2)) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == (float)(num12 / 2)) { if (npc.ai[1] == 0f) npc.ai[1] = (float)(300 * Math.Sign((vector - player.Center).X)); @@ -2061,7 +2061,7 @@ namespace CalamityMod.NPCs if (npc.ai[2] == 0f) Main.PlaySound(29, (int)vector.X, (int)vector.Y, 20, 1f, 0f); - npc.velocity = npc.velocity.RotatedBy((double)(-(double)num15 * (float)npc.direction), default(Vector2)); + npc.velocity = npc.velocity.RotatedBy((double)(-(double)num15 * (float)npc.direction), default); npc.rotation -= num15 * (float)npc.direction; npc.ai[2] += 1f; @@ -2098,10 +2098,10 @@ namespace CalamityMod.NPCs Vector2 vector = npc.Center + new Vector2(-40f, (float)(-(float)npc.height / 2)); for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(vector, npc.width, npc.height, 90, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(vector, npc.width, npc.height, 90, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 2f; Main.dust[num622].noGravity = true; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -2116,7 +2116,7 @@ namespace CalamityMod.NPCs npc.ai[3] = (float)npc.lifeMax; // Spawn with attack delay - if (npc.localAI[3] == 0f && Main.netMode != 1) + if (npc.localAI[3] == 0f && Main.netMode != NetmodeID.MultiplayerClient) { npc.ai[0] = -100f; npc.localAI[3] = 1f; @@ -2145,7 +2145,7 @@ namespace CalamityMod.NPCs npc.ai[0] = 0f; npc.ai[1] = 5f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.TargetClosest(false); Point point3 = npc.Center.ToTileCoordinates(); @@ -2246,7 +2246,7 @@ namespace CalamityMod.NPCs if (npc.ai[0] == 60f) Gore.NewGore(npc.Center + new Vector2(-40f, (float)(-(float)npc.height / 2)), npc.velocity, 734, 1f); - if (npc.ai[0] >= 60f && Main.netMode != 1) + if (npc.ai[0] >= 60f && Main.netMode != NetmodeID.MultiplayerClient) { npc.Bottom = new Vector2(npc.localAI[1], npc.localAI[2]); npc.ai[1] = 6f; @@ -2254,7 +2254,7 @@ namespace CalamityMod.NPCs npc.netUpdate = true; } - if (Main.netMode == 1 && npc.ai[0] >= 120f) + if (Main.netMode == NetmodeID.MultiplayerClient && npc.ai[0] >= 120f) { npc.ai[1] = 6f; npc.ai[0] = 0f; @@ -2283,7 +2283,7 @@ namespace CalamityMod.NPCs num234 = MathHelper.Clamp(npc.ai[0] / 30f, 0f, 1f); num234 = 0.5f + num234 * 0.5f; - if (npc.ai[0] >= 30f && Main.netMode != 1) + if (npc.ai[0] >= 30f && Main.netMode != NetmodeID.MultiplayerClient) { npc.ai[1] = 0f; npc.ai[0] = 0f; @@ -2291,7 +2291,7 @@ namespace CalamityMod.NPCs npc.TargetClosest(true); } - if (Main.netMode == 1 && npc.ai[0] >= 60f) + if (Main.netMode == NetmodeID.MultiplayerClient && npc.ai[0] >= 60f) { npc.ai[1] = 0f; npc.ai[0] = 0f; @@ -2406,7 +2406,7 @@ namespace CalamityMod.NPCs } // Slime spawning - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int num251 = (int)((double)npc.lifeMax * 0.05); if ((float)(npc.life + num251) < npc.ai[3]) @@ -2451,15 +2451,15 @@ namespace CalamityMod.NPCs break; } - if (Main.raining && Main.rand.Next(10) == 0) + if (Main.raining && Main.rand.NextBool(10)) { npcType = NPCID.UmbrellaSlime; - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) npcType = NPCID.RainbowSlime; } - if (Main.rand.Next(250) == 0) + if (Main.rand.NextBool(250)) npcType = NPCID.Pinky; int num255 = NPC.NewNPC(x, y, npcType, 0, 0f, 0f, 0f, 0f, 255); @@ -2469,7 +2469,7 @@ namespace CalamityMod.NPCs Main.npc[num255].ai[0] = (float)(-1000 * Main.rand.Next(3)); Main.npc[num255].ai[1] = 0f; - if (Main.netMode == 2 && num255 < 200) + if (Main.netMode == NetmodeID.Server && num255 < 200) NetMessage.SendData(23, -1, -1, null, num255, 0f, 0f, 0f, 0, 0, 0); num = num253; @@ -2552,9 +2552,9 @@ namespace CalamityMod.NPCs if (npc.rotation > num8 - num9 && npc.rotation < num8 + num9) npc.rotation = num8; - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { - int num10 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y + (float)npc.height * 0.25f), npc.width, (int)((float)npc.height * 0.5f), 5, npc.velocity.X, 2f, 0, default(Color), 1f); + int num10 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y + (float)npc.height * 0.25f), npc.width, (int)((float)npc.height * 0.5f), 5, npc.velocity.X, 2f, 0, default, 1f); Dust var_9_825_cp_0_cp_0 = Main.dust[num10]; var_9_825_cp_0_cp_0.velocity.X = var_9_825_cp_0_cp_0.velocity.X * 0.5f; Dust var_9_845_cp_0_cp_0 = Main.dust[num10]; @@ -2644,13 +2644,13 @@ namespace CalamityMod.NPCs vector2.X += vector3.X * 10f; vector2.Y += vector3.Y * 10f; - if (Main.netMode != 1 && NPC.CountNPCS(NPCID.ServantofCthulhu) < 12) + if (Main.netMode != NetmodeID.MultiplayerClient && NPC.CountNPCS(NPCID.ServantofCthulhu) < 12) { int num23 = NPC.NewNPC((int)vector2.X, (int)vector2.Y, NPCID.ServantofCthulhu, 0, 0f, 0f, 0f, 0f, 255); Main.npc[num23].velocity.X = vector3.X; Main.npc[num23].velocity.Y = vector3.Y; - if (Main.netMode == 2 && num23 < 200) + if (Main.netMode == NetmodeID.Server && num23 < 200) NetMessage.SendData(23, -1, -1, null, num23, 0f, 0f, 0f, 0, 0, 0); } @@ -2659,7 +2659,7 @@ namespace CalamityMod.NPCs int num; for (int m = 0; m < 10; m = num + 1) { - Dust.NewDust(vector2, 20, 20, 5, vector3.X * 0.4f, vector3.Y * 0.4f, 0, default(Color), 1f); + Dust.NewDust(vector2, 20, 20, 5, vector3.X * 0.4f, vector3.Y * 0.4f, 0, default, 1f); num = m; } } @@ -2762,20 +2762,20 @@ namespace CalamityMod.NPCs vector6.X += vector7.X * 10f; vector6.Y += vector7.Y * 10f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int num34 = NPC.NewNPC((int)vector6.X, (int)vector6.Y, NPCID.ServantofCthulhu, 0, 0f, 0f, 0f, 0f, 255); Main.npc[num34].velocity.X = vector7.X; Main.npc[num34].velocity.Y = vector7.Y; - if (Main.netMode == 2 && num34 < 200) + if (Main.netMode == NetmodeID.Server && num34 < 200) NetMessage.SendData(23, -1, -1, null, num34, 0f, 0f, 0f, 0, 0, 0); } int num; for (int n = 0; n < 10; n = num + 1) { - Dust.NewDust(vector6, 20, 20, 5, vector7.X * 0.4f, vector7.Y * 0.4f, 0, default(Color), 1f); + Dust.NewDust(vector6, 20, 20, 5, vector7.X * 0.4f, vector7.Y * 0.4f, 0, default, 1f); num = n; } } @@ -2802,14 +2802,14 @@ namespace CalamityMod.NPCs for (int num36 = 0; num36 < 20; num36 = num + 1) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default, 1f); num = num36; } Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); } } - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default, 1f); npc.velocity.X = npc.velocity.X * 0.98f; npc.velocity.Y = npc.velocity.Y * 0.98f; @@ -2951,7 +2951,7 @@ namespace CalamityMod.NPCs { npc.ai[1] = 0f; npc.ai[3] = 0f; - if (Main.netMode != 1 && phase3) + if (Main.netMode != NetmodeID.MultiplayerClient && phase3) { npc.ai[1] = 3f; npc.ai[3] += (float)Main.rand.Next(1, 4); @@ -2979,7 +2979,7 @@ namespace CalamityMod.NPCs if (npc.netSpam > 10) npc.netSpam = 10; } - else if (Main.netMode != 1) + else if (Main.netMode != NetmodeID.MultiplayerClient) { npc.TargetClosest(true); float num48 = ((enraged || configBossRushBoost) ? 26f : 18f) + (CalamityWorld.death ? 5f : 3.5f) * (0.7f - lifeRatio); @@ -3164,13 +3164,13 @@ namespace CalamityMod.NPCs vector2.X += vector3.X * 10f; vector2.Y += vector3.Y * 10f; - if (Main.netMode != 1 && NPC.CountNPCS(NPCID.ServantofCthulhu) < 4) + if (Main.netMode != NetmodeID.MultiplayerClient && NPC.CountNPCS(NPCID.ServantofCthulhu) < 4) { int num23 = NPC.NewNPC((int)vector2.X, (int)vector2.Y, NPCID.ServantofCthulhu, 0, 0f, 0f, 0f, 0f, 255); Main.npc[num23].velocity.X = vector3.X; Main.npc[num23].velocity.Y = vector3.Y; - if (Main.netMode == 2 && num23 < 200) + if (Main.netMode == NetmodeID.Server && num23 < 200) NetMessage.SendData(23, -1, -1, null, num23, 0f, 0f, 0f, 0, 0, 0); } @@ -3179,7 +3179,7 @@ namespace CalamityMod.NPCs int num; for (int m = 0; m < 10; m = num + 1) { - Dust.NewDust(vector2, 20, 20, 5, vector3.X * 0.4f, vector3.Y * 0.4f, 0, default(Color), 1f); + Dust.NewDust(vector2, 20, 20, 5, vector3.X * 0.4f, vector3.Y * 0.4f, 0, default, 1f); num = m; } } @@ -3221,7 +3221,7 @@ namespace CalamityMod.NPCs else if (npc.ai[1] == 6f) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.TargetClosest(true); float num48 = ((enraged || configBossRushBoost) ? 26f : 18f) + (CalamityWorld.death ? 6f : 4f) * (0.4f - lifeRatio); @@ -3308,12 +3308,12 @@ namespace CalamityMod.NPCs bool phase5 = lifeRatio < 0.2f; // 13 or less parts left // Fire projectiles - if (Main.netMode != 1 && !phase5) + if (Main.netMode != NetmodeID.MultiplayerClient && !phase5) { // Vile spit if (npc.type == NPCID.EaterofWorldsBody) { - if (Main.rand.Next(900) == 0 && phase2) + if (Main.rand.NextBool(900) && phase2) { npc.TargetClosest(true); if (Collision.CanHitLine(npc.Center, 1, 1, Main.player[npc.target].Center, 1, 1)) @@ -3375,7 +3375,7 @@ namespace CalamityMod.NPCs } // Spawn segments - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if ((npc.type == NPCID.EaterofWorldsHead || npc.type == NPCID.EaterofWorldsBody) && npc.ai[0] == 0f) { @@ -3456,7 +3456,7 @@ namespace CalamityMod.NPCs npc.whoAmI = whoAmI2; } - if (!npc.active && Main.netMode == 2) + if (!npc.active && Main.netMode == NetmodeID.Server) NetMessage.SendData(28, -1, -1, null, npc.whoAmI, -1f, 0f, 0f, 0, 0, 0); } @@ -3490,7 +3490,7 @@ namespace CalamityMod.NPCs if (npc.position.X + (float)npc.width > vector.X && npc.position.X < vector.X + 16f && npc.position.Y + (float)npc.height > vector.Y && npc.position.Y < vector.Y + 16f) { flag2 = true; - if (Main.rand.Next(100) == 0 && Main.tile[num33, num34].nactive()) + if (Main.rand.NextBool(100) && Main.tile[num33, num34].nactive()) { WorldGen.KillTile(num33, num34, true, true, false); } @@ -3646,7 +3646,7 @@ namespace CalamityMod.NPCs if (flag5) { - if (Main.netMode != 1 && (double)(npc.position.Y / 16f) > (Main.rockLayer + (double)Main.maxTilesY) / 2.0) + if (Main.netMode != NetmodeID.MultiplayerClient && (double)(npc.position.Y / 16f) > (Main.rockLayer + (double)Main.maxTilesY) / 2.0) { npc.active = false; int num59 = (int)npc.ai[0]; @@ -3657,13 +3657,13 @@ namespace CalamityMod.NPCs Main.npc[num59].active = false; npc.life = 0; - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) NetMessage.SendData(23, -1, -1, null, num59, 0f, 0f, 0f, 0, 0, 0); num59 = arg_2853_0; } - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) NetMessage.SendData(23, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); } num39 = 0f; @@ -3767,7 +3767,7 @@ namespace CalamityMod.NPCs NPC.crimsonBoss = npc.whoAmI; // Spawn Creepers - if (Main.netMode != 1 && npc.localAI[0] == 0f) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] == 0f) { npc.localAI[0] = 1f; for (int num789 = 0; num789 < 20; num789++) @@ -3784,7 +3784,7 @@ namespace CalamityMod.NPCs } // Despawn - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.TargetClosest(true); @@ -3793,7 +3793,7 @@ namespace CalamityMod.NPCs npc.active = false; npc.life = 0; - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) NetMessage.SendData(23, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); } } @@ -3814,7 +3814,7 @@ namespace CalamityMod.NPCs Gore.NewGore(npc.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 395, 1f); for (int num794 = 0; num794 < 20; num794++) - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default, 1f); Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); } @@ -3934,7 +3934,7 @@ namespace CalamityMod.NPCs // Velocity int var = 120; float velocity = 6.28318548f / ((float)var * 0.75f); - npc.velocity = npc.velocity.RotatedBy((double)(-(double)velocity * npc.ai[1]), default(Vector2)); + npc.velocity = npc.velocity.RotatedBy((double)(-(double)velocity * npc.ai[1]), default); npc.ai[2] += 1f; @@ -3961,9 +3961,9 @@ namespace CalamityMod.NPCs // Blood dust for (int num621 = 0; num621 < 6; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default(Color), 1f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.25f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -3971,10 +3971,10 @@ namespace CalamityMod.NPCs } for (int num623 = 0; num623 < 12; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default(Color), 1.5f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default, 1.5f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default(Color), 1f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } @@ -4029,7 +4029,7 @@ namespace CalamityMod.NPCs if (npc.ai[0] == -1f) npc.knockBackResist = 0.45f - (0.45f * (1f - lifeRatio)); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { // Go to phase 3 if (phase3 && npc.ai[0] == -1f) @@ -4072,12 +4072,12 @@ namespace CalamityMod.NPCs max = 20; } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) num801 += Main.rand.Next(min, max); else num801 -= Main.rand.Next(min, max); - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) num802 += Main.rand.Next(min, max); else num802 -= Main.rand.Next(min, max); @@ -4104,7 +4104,7 @@ namespace CalamityMod.NPCs { npc.velocity *= 0.9f; - if (Main.netMode != 0) + if (Main.netMode != NetmodeID.SinglePlayer) npc.ai[3] += 15f; else npc.ai[3] += 25f; @@ -4126,7 +4126,7 @@ namespace CalamityMod.NPCs // Become visible else if (npc.ai[0] == -3f || npc.ai[0] == -9f) { - if (Main.netMode != 0) + if (Main.netMode != NetmodeID.SinglePlayer) npc.ai[3] -= 15f; else npc.ai[3] -= 25f; @@ -4194,7 +4194,7 @@ namespace CalamityMod.NPCs // Pick a teleport location if (npc.ai[0] == 0f) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { // Go to phase 2 if (phase2) @@ -4223,12 +4223,12 @@ namespace CalamityMod.NPCs int min = 18; int max = 26; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) num810 += Main.rand.Next(min, max); else num810 -= Main.rand.Next(min, max); - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) num811 += Main.rand.Next(min, max); else num811 -= Main.rand.Next(min, max); @@ -4347,7 +4347,7 @@ namespace CalamityMod.NPCs // Charge at target int creeperScale = 21 - creeperCount; // 1 to 20 npc.ai[1] += 0.5f + ((float)creeperScale * 0.25f); - if (Main.netMode != 1 && npc.ai[1] >= 240f) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[1] >= 240f) { npc.ai[1] = 0f; npc.TargetClosest(true); @@ -4437,7 +4437,7 @@ namespace CalamityMod.NPCs // Pick a random phase else if (npc.ai[0] == -1f) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { float num595 = npc.ai[1]; int phase; @@ -4721,7 +4721,7 @@ namespace CalamityMod.NPCs if (Collision.CanHit(vector76, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height) && spawnBee) { Main.PlaySound(3, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int hornetAmt = CalamityMod.hornetList.Count; int spawnType = Main.rand.Next(210, 212); @@ -4821,7 +4821,7 @@ namespace CalamityMod.NPCs if (shoot && npc.position.Y + (float)npc.height < Main.player[npc.target].position.Y && Collision.CanHit(vector78, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { Main.PlaySound(SoundID.Item17, npc.position); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { float num624 = 12f; if ((double)npc.life < (double)npc.lifeMax * 0.33) @@ -4945,7 +4945,7 @@ namespace CalamityMod.NPCs npc.defense = npc.defDefense; // Spawn hands - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (npc.ai[0] == 0f) { @@ -5030,7 +5030,7 @@ namespace CalamityMod.NPCs Vector2 vector10 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); // Fire magic bolt after teleport - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { float num151 = 2f + (distance * 0.005f); if (num151 > 5f) @@ -5055,7 +5055,7 @@ namespace CalamityMod.NPCs // Teleport dust for (int m = 0; m < 60; m++) { - int num39 = Dust.NewDust(npc.position, npc.width, npc.height, 27, 0f, 0f, 200, default(Color), 3f); + int num39 = Dust.NewDust(npc.position, npc.width, npc.height, 27, 0f, 0f, 200, default, 3f); Main.dust[num39].noGravity = true; Main.dust[num39].velocity.X = Main.dust[num39].velocity.X * 2f; } @@ -5078,13 +5078,13 @@ namespace CalamityMod.NPCs } if (emitDust) { - int dust = Dust.NewDust(npc.position, npc.width, npc.height, 27, 0f, 0f, 200, default(Color), 1.5f); + int dust = Dust.NewDust(npc.position, npc.width, npc.height, 27, 0f, 0f, 200, default, 1.5f); Main.dust[dust].noGravity = true; Main.dust[dust].velocity.X = Main.dust[dust].velocity.X * 2f; } // Teleport - if (Main.netMode != 1 && npc.ai[3] >= 30f) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[3] >= 30f) { Vector2 value53 = npc.Center + new Vector2((float)(npc.direction * 20), 6f); Vector2 vector251 = Main.player[npc.target].Center - value53; @@ -5121,7 +5121,7 @@ namespace CalamityMod.NPCs // Teleport dust for (int m = 0; m < 60; m++) { - int num39 = Dust.NewDust(npc.position, npc.width, npc.height, 27, 0f, 0f, 200, default(Color), 3f); + int num39 = Dust.NewDust(npc.position, npc.width, npc.height, 27, 0f, 0f, 200, default, 3f); Main.dust[num39].noGravity = true; Main.dust[num39].velocity.X = Main.dust[num39].velocity.X * 2f; } @@ -5147,7 +5147,7 @@ namespace CalamityMod.NPCs if (handsDead) num158 /= 2f; - if (Main.netMode != 1 && calamityGlobalNPC.newAI[1] % num158 == 0f) + if (Main.netMode != NetmodeID.MultiplayerClient && calamityGlobalNPC.newAI[1] % num158 == 0f) { Vector2 vector18 = npc.Center; float num159 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector18.X; @@ -5324,14 +5324,14 @@ namespace CalamityMod.NPCs // Emit dust if (npc.ai[1] != 2f && npc.ai[1] != 3f && num156 != 0) { - int num180 = Dust.NewDust(new Vector2(npc.position.X + (float)(npc.width / 2) - 15f - npc.velocity.X * 5f, npc.position.Y + (float)npc.height - 2f), 30, 10, 5, -npc.velocity.X * 0.2f, 3f, 0, default(Color), 2f); + int num180 = Dust.NewDust(new Vector2(npc.position.X + (float)(npc.width / 2) - 15f - npc.velocity.X * 5f, npc.position.Y + (float)npc.height - 2f), 30, 10, 5, -npc.velocity.X * 0.2f, 3f, 0, default, 2f); Main.dust[num180].noGravity = true; Main.dust[num180].velocity.X = Main.dust[num180].velocity.X * 1.3f; Main.dust[num180].velocity.X = Main.dust[num180].velocity.X + npc.velocity.X * 0.4f; Main.dust[num180].velocity.Y = Main.dust[num180].velocity.Y + (2f + npc.velocity.Y); for (int num181 = 0; num181 < 2; num181++) { - num180 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y + 120f), npc.width, 60, 5, npc.velocity.X, npc.velocity.Y, 0, default(Color), 2f); + num180 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y + 120f), npc.width, 60, 5, npc.velocity.X, npc.velocity.Y, 0, default, 2f); Main.dust[num180].noGravity = true; Main.dust[num180].velocity -= npc.velocity; Main.dust[num180].velocity.Y = Main.dust[num180].velocity.Y + 5f; @@ -5350,7 +5350,7 @@ namespace CalamityMod.NPCs if (!Main.npc[(int)npc.ai[1]].active || Main.npc[(int)npc.ai[1]].aiStyle != 11) { npc.ai[2] += 10f; - if (npc.ai[2] > 50f || Main.netMode != 2) + if (npc.ai[2] > 50f || Main.netMode != NetmodeID.Server) { npc.life = -1; npc.HitEffect(0, 10.0); @@ -5610,7 +5610,7 @@ namespace CalamityMod.NPCs if (npc.ai[2] > (float)num330) npc.ai[2] = 0f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int num331 = NPC.NewNPC((int)(npc.position.X + (float)(npc.width / 2)), (int)(npc.position.Y + (float)(npc.height / 2) + 20f), NPCID.LeechHead, 1, 0f, 0f, 0f, 0f, 255); Main.npc[num331].velocity.X = (float)(npc.direction * 9); @@ -5830,7 +5830,7 @@ namespace CalamityMod.NPCs npc.rotation = 0f; // Expert hungry respawn over time - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { // Range of 1 to 11 int chance = (int)(1f + lifeRatio * 10f); @@ -5898,7 +5898,7 @@ namespace CalamityMod.NPCs } // Spawn eyes and hungries - if (npc.localAI[0] == 1f && Main.netMode != 1) + if (npc.localAI[0] == 1f && Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[0] = 2f; @@ -6005,7 +6005,7 @@ namespace CalamityMod.NPCs } // Fire lasers - if (Main.netMode != 1 && Main.npc[Main.wof].ai[3] == 0f) + if (Main.netMode != NetmodeID.MultiplayerClient && Main.npc[Main.wof].ai[3] == 0f) { // Percent life remaining float lifeRatio = (float)Main.npc[Main.wof].life / (float)Main.npc[Main.wof].lifeMax; @@ -6093,7 +6093,7 @@ namespace CalamityMod.NPCs { for (int i = 0; i < 2; i++) { - int num = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default(Color), 2f); + int num = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default, 2f); Main.dust[num].noGravity = true; Main.dust[num].noLight = true; } @@ -6144,7 +6144,7 @@ namespace CalamityMod.NPCs } } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { // Spawn segments from head if (npc.ai[0] == 0f && npc.type == NPCID.TheDestroyer) @@ -6208,7 +6208,7 @@ namespace CalamityMod.NPCs // Set projectile damage and type, set projectile to saucer scrap if probe has been launched int damage = 28; int projectileType = ProjectileID.DeathLaser; - if (npc.ai[2] == 0f || Main.rand.Next(2) == 0) + if (npc.ai[2] == 0f || Main.rand.NextBool(2)) { if (phase3 || calamityGlobalNPC.newAI[2] > 0f) { @@ -6594,16 +6594,16 @@ namespace CalamityMod.NPCs if (npc.rotation > num378 - num379 && npc.rotation < num378 + num379) npc.rotation = num378; - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { - int num380 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y + (float)npc.height * 0.25f), npc.width, (int)((float)npc.height * 0.5f), 5, npc.velocity.X, 2f, 0, default(Color), 1f); + int num380 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y + (float)npc.height * 0.25f), npc.width, (int)((float)npc.height * 0.5f), 5, npc.velocity.X, 2f, 0, default, 1f); Dust var_9_131D1_cp_0_cp_0 = Main.dust[num380]; var_9_131D1_cp_0_cp_0.velocity.X = var_9_131D1_cp_0_cp_0.velocity.X * 0.5f; Dust var_9_131F5_cp_0_cp_0 = Main.dust[num380]; var_9_131F5_cp_0_cp_0.velocity.Y = var_9_131F5_cp_0_cp_0.velocity.Y * 0.1f; } - if (Main.netMode != 1 && !Main.dayTime && !Main.player[npc.target].dead && npc.timeLeft < 10) + if (Main.netMode != NetmodeID.MultiplayerClient && !Main.dayTime && !Main.player[npc.target].dead && npc.timeLeft < 10) { int num; for (int num381 = 0; num381 < 200; num381 = num + 1) @@ -6693,7 +6693,7 @@ namespace CalamityMod.NPCs num385 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector40.X; num386 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector40.Y; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { float num389 = 10.5f; int num390 = 19; @@ -6811,7 +6811,7 @@ namespace CalamityMod.NPCs for (int num398 = 0; num398 < 20; num398 = num + 1) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default, 1f); num = num398; } @@ -6819,7 +6819,7 @@ namespace CalamityMod.NPCs } } - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default, 1f); npc.velocity.X = npc.velocity.X * 0.98f; npc.velocity.Y = npc.velocity.Y * 0.98f; @@ -6907,7 +6907,7 @@ namespace CalamityMod.NPCs num402 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector42.Y; npc.rotation = (float)Math.Atan2((double)num402, (double)num401) - 1.57f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[1] += 1f; if (npc.localAI[1] >= (spazAlive ? 72f : 24f)) @@ -6995,7 +6995,7 @@ namespace CalamityMod.NPCs npc.localAI[1] += 2f; } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[1] += 1f; if (npc.localAI[1] > (spazAlive ? 24f : 8f)) @@ -7095,7 +7095,7 @@ namespace CalamityMod.NPCs num349 *= num351; num350 *= num351; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { Main.PlaySound(SoundID.Item33, npc.position); @@ -7258,16 +7258,16 @@ namespace CalamityMod.NPCs npc.rotation = num420; // Dust - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { - int num422 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y + (float)npc.height * 0.25f), npc.width, (int)((float)npc.height * 0.5f), 5, npc.velocity.X, 2f, 0, default(Color), 1f); + int num422 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y + (float)npc.height * 0.25f), npc.width, (int)((float)npc.height * 0.5f), 5, npc.velocity.X, 2f, 0, default, 1f); Dust dust = Main.dust[num422]; dust.velocity.X = dust.velocity.X * 0.5f; dust.velocity.Y = dust.velocity.Y * 0.1f; } // Despawn Twins at the same time - if (Main.netMode != 1 && !Main.dayTime && !Main.player[npc.target].dead && npc.timeLeft < 10) + if (Main.netMode != NetmodeID.MultiplayerClient && !Main.dayTime && !Main.player[npc.target].dead && npc.timeLeft < 10) { int num; for (int num423 = 0; num423 < 200; num423 = num + 1) @@ -7364,7 +7364,7 @@ namespace CalamityMod.NPCs vector44 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); num427 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector44.X; num428 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector44.Y; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { float num430 = 15f; int num431 = 22; @@ -7493,7 +7493,7 @@ namespace CalamityMod.NPCs for (int num439 = 0; num439 < 20; num439 = num + 1) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default, 1f); num = num439; } @@ -7501,7 +7501,7 @@ namespace CalamityMod.NPCs } } - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default, 1f); npc.velocity.X = npc.velocity.X * 0.98f; npc.velocity.Y = npc.velocity.Y * 0.98f; @@ -7613,7 +7613,7 @@ namespace CalamityMod.NPCs Main.PlaySound(SoundID.Item34, npc.position); } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[1] += 1f; if (npc.localAI[1] > 2f) @@ -7740,7 +7740,7 @@ namespace CalamityMod.NPCs } // Set charging velocity - else if (Main.netMode != 1) + else if (Main.netMode != NetmodeID.MultiplayerClient) { // Get a target npc.TargetClosest(true); @@ -7884,7 +7884,7 @@ namespace CalamityMod.NPCs Vector2 vector44 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); float num427 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector44.X; float num428 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector44.Y; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { float num430 = 16f; int num431 = 26; @@ -7930,7 +7930,7 @@ namespace CalamityMod.NPCs bool targetFloatingUp = Main.player[npc.target].gravDir == -1f; // Spawn arms - if (npc.ai[0] == 0f && Main.netMode != 1) + if (npc.ai[0] == 0f && Main.netMode != NetmodeID.MultiplayerClient) { npc.TargetClosest(true); npc.ai[0] = 1f; @@ -8017,7 +8017,7 @@ namespace CalamityMod.NPCs if (Main.dayTime && npc.ai[1] != 3f && npc.ai[1] != 2f) { // Heal - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int healAmt = npc.life - 300; if (healAmt < 0) @@ -8059,7 +8059,7 @@ namespace CalamityMod.NPCs } } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { // Shoot homing skulls if (!allArmsDead) @@ -8323,7 +8323,7 @@ namespace CalamityMod.NPCs npc.velocity.X = num458 * num460; npc.velocity.Y = num459 * num460; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[0] += 1f; if (npc.localAI[0] >= (CalamityWorld.death ? 54f : 60f)) @@ -8408,7 +8408,7 @@ namespace CalamityMod.NPCs if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > 64f) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (NPC.CountNPCS(NPCID.Probe) < 6) NPC.NewNPC((int)npc.Center.X, (int)(npc.Center.Y + 4f), NPCID.Probe); @@ -8513,10 +8513,10 @@ namespace CalamityMod.NPCs { calamityGlobalNPC.newAI[1] += 1f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { Vector2 velocity = new Vector2(-1f * (float)Main.rand.NextDouble() * 3f, 1f); - velocity = velocity.RotatedBy((Main.rand.NextDouble() - 0.5) * 0.78539818525314331, default(Vector2)); + velocity = velocity.RotatedBy((Main.rand.NextDouble() - 0.5) * 0.78539818525314331, default); velocity *= 5f; int damage = Main.expertMode ? 27 : 35; float delayBeforeHoming = 45f; @@ -8554,7 +8554,7 @@ namespace CalamityMod.NPCs if (!Main.npc[(int)npc.ai[1]].active || Main.npc[(int)npc.ai[1]].aiStyle != 32) { npc.ai[2] += 10f; - if (npc.ai[2] > 50f || Main.netMode != 2) + if (npc.ai[2] > 50f || Main.netMode != NetmodeID.Server) { npc.life = -1; npc.HitEffect(0, 10.0); @@ -8657,7 +8657,7 @@ namespace CalamityMod.NPCs float num508 = (float)Math.Sqrt((double)(num506 * num506 + num507 * num507)); npc.rotation = (float)Math.Atan2((double)num507, (double)num506) - 1.57f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { // Fire laser every 1.5 seconds (change this as each arm dies to fire more aggressively) npc.localAI[0] += 1f; @@ -8747,7 +8747,7 @@ namespace CalamityMod.NPCs num515 = (float)Math.Sqrt((double)(num513 * num513 + num514 * num514)); npc.rotation = (float)Math.Atan2((double)num514, (double)num513) - 1.57f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { // Fire laser every 1.5 seconds (change this as each arm dies to fire more aggressively) npc.localAI[0] += 1f; @@ -8793,7 +8793,7 @@ namespace CalamityMod.NPCs if (!Main.npc[(int)npc.ai[1]].active || Main.npc[(int)npc.ai[1]].aiStyle != 32) { npc.ai[2] += 10f; - if (npc.ai[2] > 50f || Main.netMode != 2) + if (npc.ai[2] > 50f || Main.netMode != NetmodeID.Server) { npc.life = -1; npc.HitEffect(0, 10.0); @@ -8932,7 +8932,7 @@ namespace CalamityMod.NPCs float num494 = (float)Math.Sqrt((double)(num492 * num492 + num493 * num493)); npc.rotation = (float)Math.Atan2((double)num493, (double)num492) - 1.57f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { // Fire rocket every 2 seconds (change this as each arm dies to fire more aggressively) npc.localAI[0] += 1f; @@ -9002,7 +9002,7 @@ namespace CalamityMod.NPCs num501 = (float)Math.Sqrt((double)(num499 * num499 + num500 * num500)); npc.rotation = (float)Math.Atan2((double)num500, (double)num499) - 1.57f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { // Fire rockets every 2 seconds (change this as each arm dies to fire more aggressively) npc.localAI[0] += 1f; @@ -9063,7 +9063,7 @@ namespace CalamityMod.NPCs if (!Main.npc[(int)npc.ai[1]].active || Main.npc[(int)npc.ai[1]].aiStyle != 32) { npc.ai[2] += 10f; - if (npc.ai[2] > 50f || Main.netMode != 2) + if (npc.ai[2] > 50f || Main.netMode != NetmodeID.Server) { npc.life = -1; npc.HitEffect(0, 10.0); @@ -9371,7 +9371,7 @@ namespace CalamityMod.NPCs if (!Main.npc[(int)npc.ai[1]].active || Main.npc[(int)npc.ai[1]].aiStyle != 32) { npc.ai[2] += 10f; - if (npc.ai[2] > 50f || Main.netMode != 2) + if (npc.ai[2] > 50f || Main.netMode != NetmodeID.Server) { npc.life = -1; npc.HitEffect(0, 10.0); @@ -9668,20 +9668,20 @@ namespace CalamityMod.NPCs } // Despawn if too far from target - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > 6000f) { npc.active = false; npc.life = 0; - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) NetMessage.SendData(23, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); } } // Set whoAmI variable and spawn hooks NPC.plantBoss = npc.whoAmI; - if (npc.localAI[0] == 0f && Main.netMode != 1) + if (npc.localAI[0] == 0f && Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[0] = 1f; int num729 = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasHook, npc.whoAmI, 0f, 0f, 0f, 0f, 255); @@ -9898,7 +9898,7 @@ namespace CalamityMod.NPCs } // Fire projectiles - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[1] += 1f + (8f * (1f - lifeRatio)); @@ -9907,7 +9907,7 @@ namespace CalamityMod.NPCs npc.localAI[1] += 3f; // If hit, fire projectiles even if target is behind tiles - if (npc.justHit && Main.rand.Next(2) == 0) + if (npc.justHit && Main.rand.NextBool(2)) npc.localAI[3] = 1f; } @@ -9933,13 +9933,13 @@ namespace CalamityMod.NPCs int damage = 22; int projectileType = ProjectileID.SeedPlantera; - if (lifeRatio < 0.9f && Main.rand.Next(2) == 0) + if (lifeRatio < 0.9f && Main.rand.NextBool(2)) { damage = 27; npc.localAI[1] = -30f; projectileType = ProjectileID.PoisonSeedPlantera; } - else if (lifeRatio < 0.8f && Main.rand.Next(4) == 0) + else if (lifeRatio < 0.8f && Main.rand.NextBool(4)) { int thornBallCount = 0; for (int i = 0; i < 1000; i++) @@ -9984,7 +9984,7 @@ namespace CalamityMod.NPCs } // Spawn tentacles - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (npc.localAI[0] == 1f) { @@ -10070,7 +10070,7 @@ namespace CalamityMod.NPCs int spread = 2 + tentacleScale; // 3 to 10, wider spread is harder to avoid if (nearbyActiveTiles <= 400) - spread = (Main.rand.Next(2) == 0 ? 3 : 6) + (tentacleScale / 2); + spread = (Main.rand.NextBool(2) ? 3 : 6) + (tentacleScale / 2); float rotation = MathHelper.ToRadians(spread); for (int i = 0; i < numProj + 1; i++) @@ -10107,7 +10107,7 @@ namespace CalamityMod.NPCs int spread = 30; if (nearbyActiveTiles <= 400) - spread = (Main.rand.Next(2) == 0 ? 30 : 45); + spread = (Main.rand.NextBool(2) ? 30 : 45); float rotation = MathHelper.ToRadians(spread); float baseSpeed = (float)Math.Sqrt(num743 * num743 + num744 * num744); @@ -10132,9 +10132,9 @@ namespace CalamityMod.NPCs { if (Main.dayTime) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { - int dust = Dust.NewDust(npc.position, npc.width, npc.height, 55, 0f, 0f, 200, default(Color), 0.5f); + int dust = Dust.NewDust(npc.position, npc.width, npc.height, 55, 0f, 0f, 200, default, 0.5f); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 0.75f; Main.dust[dust].fadeIn = 1.3f; @@ -10152,7 +10152,7 @@ namespace CalamityMod.NPCs if (calamityGlobalNPC.newAI[1] >= 15f) { calamityGlobalNPC.newAI[1] = 0f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int healAmt = npc.lifeMax / (CalamityWorld.bossRushActive ? 400 : 100); if (healAmt > npc.lifeMax - npc.life) @@ -10210,7 +10210,7 @@ namespace CalamityMod.NPCs } // Set centers for movement - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { if (npc.ai[0] == 0f) npc.ai[0] = (float)((int)(npc.Center.X / 16f)); @@ -10219,7 +10219,7 @@ namespace CalamityMod.NPCs } // Find new spot to move to after set time has passed - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { // Move immediately if (npc.ai[0] == 0f || npc.ai[1] == 0f) @@ -10349,7 +10349,7 @@ namespace CalamityMod.NPCs num778 = (int)npc.ai[3] - 1; // Movement variables - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[0] -= 1f; if (npc.localAI[0] <= 0f) @@ -10562,7 +10562,7 @@ namespace CalamityMod.NPCs { calamityGlobalNPC.newAI[0] = 0f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) Projectile.NewProjectile(npc.Center.X, npc.Center.Y, 0f, 0f, ProjectileID.SharknadoBolt, 0, 0f, Main.myPlayer, 1f, (float)(npc.target + 1)); npc.netUpdate = true; @@ -10575,7 +10575,7 @@ namespace CalamityMod.NPCs npc.localAI[0] = 1f; npc.alpha = 255; npc.rotation = 0f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.ai[0] = -1f; npc.netUpdate = true; @@ -10683,9 +10683,9 @@ namespace CalamityMod.NPCs int num20 = 36; for (int i = 0; i < num20; i++) { - Vector2 expr_80F = (Vector2.Normalize(npc.velocity) * new Vector2((float)npc.width / 2f, (float)npc.height) * 0.75f * 0.5f).RotatedBy((double)((float)(i - (num20 / 2 - 1)) * 6.28318548f / (float)num20), default(Vector2)) + npc.Center; + Vector2 expr_80F = (Vector2.Normalize(npc.velocity) * new Vector2((float)npc.width / 2f, (float)npc.height) * 0.75f * 0.5f).RotatedBy((double)((float)(i - (num20 / 2 - 1)) * 6.28318548f / (float)num20), default) + npc.Center; Vector2 vector2 = expr_80F - npc.Center; - int num21 = Dust.NewDust(expr_80F + vector2, 0, 0, 172, vector2.X * 2f, vector2.Y * 2f, 100, default(Color), 1.4f); + int num21 = Dust.NewDust(expr_80F + vector2, 0, 0, 172, vector2.X * 2f, vector2.Y * 2f, 100, default, 1.4f); Main.dust[num21].noGravity = true; Main.dust[num21].noLight = true; Main.dust[num21].velocity = Vector2.Normalize(vector2) * 3f; @@ -10845,9 +10845,9 @@ namespace CalamityMod.NPCs int num24 = 7; for (int j = 0; j < num24; j++) { - Vector2 arg_E1C_0 = (Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f).RotatedBy((double)(j - (num24 / 2 - 1)) * 3.1415926535897931 / (double)((float)num24), default(Vector2)) + vector; + Vector2 arg_E1C_0 = (Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f).RotatedBy((double)(j - (num24 / 2 - 1)) * 3.1415926535897931 / (double)((float)num24), default) + vector; Vector2 vector4 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); - int num25 = Dust.NewDust(arg_E1C_0 + vector4, 0, 0, 172, vector4.X * 2f, vector4.Y * 2f, 100, default(Color), 1.4f); + int num25 = Dust.NewDust(arg_E1C_0 + vector4, 0, 0, 172, vector4.X * 2f, vector4.Y * 2f, 100, default, 1.4f); Main.dust[num25].noGravity = true; Main.dust[num25].noLight = true; Main.dust[num25].velocity /= 4f; @@ -10906,7 +10906,7 @@ namespace CalamityMod.NPCs { Main.PlaySound(4, (int)npc.Center.X, (int)npc.Center.Y, 19, 1f, 0f); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { Vector2 vector6 = Vector2.Normalize(player.Center - vector) * (float)(npc.width + 20) / 2f + vector; NPC.NewNPC((int)vector6.X, (int)vector6.Y + 45, NPCID.DetonatingBubble, 0, 0f, 0f, 0f, 0f, 255); @@ -10944,7 +10944,7 @@ namespace CalamityMod.NPCs if (npc.ai[2] == (float)(num9 - 30)) Main.PlaySound(29, (int)vector.X, (int)vector.Y, 9, 1f, 0f); - if (Main.netMode != 1 && npc.ai[2] == (float)(num9 - 30)) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == (float)(num9 - 30)) { Vector2 vector7 = npc.rotation.ToRotationVector2() * (Vector2.UnitX * (float)npc.direction) * (float)(npc.width + 20) / 2f + vector; bool normal = Main.rand.NextBool(); @@ -11143,9 +11143,9 @@ namespace CalamityMod.NPCs int num29 = 7; for (int k = 0; k < num29; k++) { - Vector2 arg_1A97_0 = (Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f).RotatedBy((double)(k - (num29 / 2 - 1)) * 3.1415926535897931 / (double)((float)num29), default(Vector2)) + vector; + Vector2 arg_1A97_0 = (Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f).RotatedBy((double)(k - (num29 / 2 - 1)) * 3.1415926535897931 / (double)((float)num29), default) + vector; Vector2 vector9 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); - int num30 = Dust.NewDust(arg_1A97_0 + vector9, 0, 0, 172, vector9.X * 2f, vector9.Y * 2f, 100, default(Color), 1.4f); + int num30 = Dust.NewDust(arg_1A97_0 + vector9, 0, 0, 172, vector9.X * 2f, vector9.Y * 2f, 100, default, 1.4f); Main.dust[num30].noGravity = true; Main.dust[num30].noLight = true; Main.dust[num30].velocity /= 4f; @@ -11174,12 +11174,12 @@ namespace CalamityMod.NPCs { Main.PlaySound(4, (int)npc.Center.X, (int)npc.Center.Y, 19, 1f, 0f); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { Vector2 vector10 = Vector2.Normalize(npc.velocity) * (float)(npc.width + 20) / 2f + vector; int num31 = NPC.NewNPC((int)vector10.X, (int)vector10.Y + 45, NPCID.DetonatingBubble, 0, 0f, 0f, 0f, 0f, 255); Main.npc[num31].target = npc.target; - Main.npc[num31].velocity = Vector2.Normalize(npc.velocity).RotatedBy((double)(1.57079637f * (float)npc.direction), default(Vector2)) * scaleFactor3; + Main.npc[num31].velocity = Vector2.Normalize(npc.velocity).RotatedBy((double)(1.57079637f * (float)npc.direction), default) * scaleFactor3; Main.npc[num31].netUpdate = true; Main.npc[num31].ai[3] = (float)Main.rand.Next(80, 121) / 100f; @@ -11192,7 +11192,7 @@ namespace CalamityMod.NPCs } // Velocity and rotation - npc.velocity = npc.velocity.RotatedBy((double)(-(double)num15 * (float)npc.direction), default(Vector2)); + npc.velocity = npc.velocity.RotatedBy((double)(-(double)num15 * (float)npc.direction), default); npc.rotation -= num15 * (float)npc.direction; npc.ai[2] += 1f; @@ -11216,7 +11216,7 @@ namespace CalamityMod.NPCs if (npc.ai[2] == (float)(num9 - 30)) Main.PlaySound(29, (int)vector.X, (int)vector.Y, 20, 1f, 0f); - if (Main.netMode != 1 && npc.ai[2] == (float)(num9 - 30)) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == (float)(num9 - 30)) Projectile.NewProjectile(vector.X, vector.Y, 0f, 0f, ProjectileID.SharknadoBolt, 0, 0f, Main.myPlayer, 1f, (float)(npc.target + 1)); npc.ai[2] += 1f; @@ -11386,9 +11386,9 @@ namespace CalamityMod.NPCs int num34 = 7; for (int m = 0; m < num34; m++) { - Vector2 arg_2444_0 = (Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f).RotatedBy((double)(m - (num34 / 2 - 1)) * 3.1415926535897931 / (double)((float)num34), default(Vector2)) + vector; + Vector2 arg_2444_0 = (Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f).RotatedBy((double)(m - (num34 / 2 - 1)) * 3.1415926535897931 / (double)((float)num34), default) + vector; Vector2 vector11 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); - int num35 = Dust.NewDust(arg_2444_0 + vector11, 0, 0, 172, vector11.X * 2f, vector11.Y * 2f, 100, default(Color), 1.4f); + int num35 = Dust.NewDust(arg_2444_0 + vector11, 0, 0, 172, vector11.X * 2f, vector11.Y * 2f, 100, default, 1.4f); Main.dust[num35].noGravity = true; Main.dust[num35].noLight = true; Main.dust[num35].velocity /= 4f; @@ -11428,7 +11428,7 @@ namespace CalamityMod.NPCs if (npc.ai[2] == (float)(num12 / 2)) Main.PlaySound(29, (int)vector.X, (int)vector.Y, 20, 1f, 0f); - if (Main.netMode != 1 && npc.ai[2] == (float)(num12 / 2)) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == (float)(num12 / 2)) { // Teleport location if (npc.ai[1] == 0f) @@ -11566,7 +11566,7 @@ namespace CalamityMod.NPCs npc.ai[1] += 1f; - if (npc.ai[1] >= 20f && Main.netMode != 1) + if (npc.ai[1] >= 20f && Main.netMode != NetmodeID.MultiplayerClient) { npc.ai[1] = 0f; npc.ai[2] = 0f; @@ -11789,7 +11789,7 @@ namespace CalamityMod.NPCs npc.ai[0] = 0f; npc.TargetClosest(true); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.ai[1] = -1f; npc.ai[2] = -1f; @@ -11871,7 +11871,7 @@ namespace CalamityMod.NPCs float num1371 = 4f; float num1372 = 2f; - if (Main.netMode != 1 && vector239.Length() < 4f) + if (Main.netMode != NetmodeID.MultiplayerClient && vector239.Length() < 4f) { int num1373 = 20; if (Main.expertMode) @@ -11922,7 +11922,7 @@ namespace CalamityMod.NPCs npc.localAI[1] = 0f; } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[2] += 1f; if (npc.localAI[2] > 300f) @@ -11952,7 +11952,7 @@ namespace CalamityMod.NPCs } } - if (npc.ai[0] == 0f && Main.netMode != 1) + if (npc.ai[0] == 0f && Main.netMode != NetmodeID.MultiplayerClient) { npc.TargetClosest(true); npc.ai[0] = 1f; @@ -12072,7 +12072,7 @@ namespace CalamityMod.NPCs if (!Main.npc[(int)npc.ai[1]].active || Main.npc[(int)npc.ai[1]].aiStyle != 58) { npc.ai[2] += 10f; - if (npc.ai[2] > 50f || Main.netMode != 2) + if (npc.ai[2] > 50f || Main.netMode != NetmodeID.Server) { npc.life = -1; npc.HitEffect(0, 10.0); @@ -12080,7 +12080,7 @@ namespace CalamityMod.NPCs } } - if (Main.netMode != 1 && Main.npc[(int)npc.ai[1]].ai[3] == 2f) + if (Main.netMode != NetmodeID.MultiplayerClient && Main.npc[(int)npc.ai[1]].ai[3] == 2f) { npc.localAI[1] += 1f; if (npc.localAI[1] > 30f) @@ -12329,7 +12329,7 @@ namespace CalamityMod.NPCs if (npc.ai[3] > (float)num892) npc.ai[3] = (float)(-(float)num892); - if (npc.ai[3] == 0f && Main.netMode != 1) + if (npc.ai[3] == 0f && Main.netMode != NetmodeID.MultiplayerClient) { Vector2 vector116 = new Vector2(npc.Center.X, npc.Center.Y); vector116.X += npc.velocity.X * 7f; @@ -12355,7 +12355,7 @@ namespace CalamityMod.NPCs else if (npc.ai[3] < 0f) npc.ai[3] += 1f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.ai[1] += (float)Main.rand.Next(1, 4); @@ -12415,7 +12415,7 @@ namespace CalamityMod.NPCs npc.rotation = npc.velocity.X * 0.01f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.ai[3] += 1f; int num901 = 10; @@ -12449,7 +12449,7 @@ namespace CalamityMod.NPCs } } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.ai[1] += (float)Main.rand.Next(1, 4); @@ -12492,7 +12492,7 @@ namespace CalamityMod.NPCs int num909 = Projectile.NewProjectile(vector118.X, vector118.Y, num904, num905, 349, 40, 0f, Main.myPlayer, 0f, 0f); } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.ai[1] += (float)Main.rand.Next(1, 4); @@ -12531,7 +12531,7 @@ namespace CalamityMod.NPCs public static void RevengeanceMoonLordCoreAI(NPC npc) { // Buffed teleport, teleports happen at a closer range - if (npc.ai[0] >= 0f && npc.ai[0] < 2f && Main.netMode != 1 && npc.Distance(Main.player[npc.target].Center) > 1800f) //2400 + if (npc.ai[0] >= 0f && npc.ai[0] < 2f && Main.netMode != NetmodeID.MultiplayerClient && npc.Distance(Main.player[npc.target].Center) > 1800f) //2400 { npc.ai[0] = -2f; npc.netUpdate = true; @@ -12592,7 +12592,7 @@ namespace CalamityMod.NPCs if ((int)calamityGlobalNPC.newAI[2] % 60 == 0) { npc.netUpdate = true; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int num = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, 400, 0, 0f, 0f, 0f, 0f, 255); Main.npc[num].ai[3] = npc.ai[3]; @@ -12611,7 +12611,7 @@ namespace CalamityMod.NPCs if ((int)calamityGlobalNPC.newAI[2] % 60 == 0) { npc.netUpdate = true; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int num = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, 400, 0, 0f, 0f, 0f, 0f, 255); Main.npc[num].ai[3] = npc.ai[3]; @@ -12646,7 +12646,7 @@ namespace CalamityMod.NPCs calamityGlobalNPC.newAI[0] = 0f; npc.netUpdate = true; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("Eidolist"), 0, 0f, 0f, 0f, 0f, 255); calamityGlobalNPC.newAI[0] = -360f; @@ -12670,7 +12670,7 @@ namespace CalamityMod.NPCs calamityGlobalNPC.CultCountdown--; if (calamityGlobalNPC.CultCountdown == 0) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { Player player2 = Main.player[npc.target]; int speed2 = 8; @@ -12814,7 +12814,7 @@ namespace CalamityMod.NPCs num179 = 12f / num179; npc.velocity.X = num177 * num179; npc.velocity.Y = num178 * num179; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[1] += 1f; if (npc.localAI[1] >= 60f) @@ -12851,7 +12851,7 @@ namespace CalamityMod.NPCs public static void RevengeanceLihzahrdAI(NPC npc) { // Transform into second state sooner - if (Main.netMode != 1 && (double)npc.life <= (double)npc.lifeMax * 0.9) + if (Main.netMode != NetmodeID.MultiplayerClient && (double)npc.life <= (double)npc.lifeMax * 0.9) npc.Transform(NPCID.LihzahrdCrawler); } diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 10d20fa330..48d58c75d1 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -343,9 +343,9 @@ namespace CalamityMod.NPCs npc.lifeRegen -= projectileCount * 350; - if (damage < projectileCount * 35) + if (damage < projectileCount * 70) { - damage = projectileCount * 35; + damage = projectileCount * 70; } } @@ -631,10 +631,6 @@ namespace CalamityMod.NPCs break; case NPCID.Retinazer: - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 3.0) : (int)(npc.lifeMax * 1.8); - npc.npcSlots = 10f; - break; - case NPCID.Spazmatism: npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 3.0) : (int)(npc.lifeMax * 1.8); npc.npcSlots = 10f; @@ -1378,7 +1374,7 @@ namespace CalamityMod.NPCs if (protection > 0f) { - double newDamage = damage + ((double)defense * 0.25); //defense damage boost 150 * .25 = 45 + 150 = 195 damage 180 defense + double newDamage = damage + (defense * 0.25); //defense damage boost 150 * .25 = 45 + 150 = 195 damage 180 defense if (marked) { @@ -1569,6 +1565,7 @@ namespace CalamityMod.NPCs break; } } + return true; } #endregion @@ -1587,63 +1584,82 @@ namespace CalamityMod.NPCs case 0: npc.GivenName = "Lapp"; break; + case 1: npc.GivenName = "Ben Shapiro"; break; + default: break; } + break; + case NPCID.Wizard: switch (Main.rand.Next(24)) // 23 wizard names { case 0: npc.GivenName = "Mage One-Trick"; break; + default: break; } + break; + case NPCID.Steampunker: switch (Main.rand.Next(22)) // 21 steampunker names { case 0: npc.GivenName = "Vorbis"; break; + default: break; } + break; + case NPCID.Stylist: switch (Main.rand.Next(21)) // 20 stylist names { case 0: npc.GivenName = "Amber"; break; + default: break; } + break; + case NPCID.WitchDoctor: switch (Main.rand.Next(11)) // 10 witch doctor names { case 0: npc.GivenName = "Sok'ar"; break; + default: break; } + break; + case NPCID.TaxCollector: switch (Main.rand.Next(21)) // 20 tax collector names { case 0: npc.GivenName = "Emmett"; break; + default: break; } + break; + default: break; } @@ -1662,28 +1678,36 @@ namespace CalamityMod.NPCs npc.active = false; npc.netUpdate = true; } + break; + case 1: if (npc.type != NPCID.BrainofCthulhu && npc.type != NPCID.Creeper) { npc.active = false; npc.netUpdate = true; } + break; + case 2: if (npc.type != NPCID.KingSlime && npc.type != NPCID.BlueSlime && npc.type != NPCID.SlimeSpiked) { npc.active = false; npc.netUpdate = true; } + break; + case 3: if (npc.type != NPCID.EyeofCthulhu && npc.type != NPCID.ServantofCthulhu) { npc.active = false; npc.netUpdate = true; } + break; + case 4: if (npc.type != NPCID.SkeletronPrime && npc.type != NPCID.PrimeSaw && npc.type != NPCID.PrimeVice && npc.type != NPCID.PrimeCannon && npc.type != NPCID.PrimeLaser) @@ -1691,7 +1715,9 @@ namespace CalamityMod.NPCs npc.active = false; npc.netUpdate = true; } + break; + case 5: if (npc.type != NPCID.Golem && npc.type != NPCID.GolemFistLeft && npc.type != NPCID.GolemFistRight && npc.type != NPCID.GolemHead && npc.type != NPCID.GolemHeadFree) @@ -1699,7 +1725,9 @@ namespace CalamityMod.NPCs npc.active = false; npc.netUpdate = true; } + break; + case 6: if (npc.type != mod.NPCType("ProfanedGuardianBoss") && npc.type != mod.NPCType("ProfanedGuardianBoss2") && npc.type != mod.NPCType("ProfanedGuardianBoss3")) @@ -1707,7 +1735,9 @@ namespace CalamityMod.NPCs npc.active = false; npc.netUpdate = true; } + break; + case 7: if (npc.type != NPCID.EaterofWorldsHead && npc.type != NPCID.EaterofWorldsBody && npc.type != NPCID.EaterofWorldsTail && npc.type != NPCID.VileSpit) @@ -1715,14 +1745,18 @@ namespace CalamityMod.NPCs npc.active = false; npc.netUpdate = true; } + break; + case 8: if (npc.type != mod.NPCType("Astrageldon") && npc.type != mod.NPCType("AstralSlime")) { npc.active = false; npc.netUpdate = true; } + break; + case 9: if (npc.type != NPCID.TheDestroyer && npc.type != NPCID.TheDestroyerBody && npc.type != NPCID.TheDestroyerTail && npc.type != NPCID.Probe) @@ -1730,14 +1764,18 @@ namespace CalamityMod.NPCs npc.active = false; npc.netUpdate = true; } + break; + case 10: if (npc.type != NPCID.Spazmatism && npc.type != NPCID.Retinazer) { npc.active = false; npc.netUpdate = true; } + break; + case 11: if (npc.type != mod.NPCType("Bumblefuck") && npc.type != mod.NPCType("Bumblefuck2") && npc.type != NPCID.Spazmatism && npc.type != NPCID.Retinazer) @@ -1745,7 +1783,9 @@ namespace CalamityMod.NPCs npc.active = false; npc.netUpdate = true; } + break; + case 12: if (npc.type != NPCID.WallofFlesh && npc.type != NPCID.WallofFleshEye && npc.type != NPCID.TheHungry && npc.type != NPCID.TheHungryII && npc.type != NPCID.LeechHead && npc.type != NPCID.LeechBody && @@ -1754,7 +1794,9 @@ namespace CalamityMod.NPCs npc.active = false; npc.netUpdate = true; } + break; + case 13: if (npc.type != mod.NPCType("HiveMind") && npc.type != mod.NPCType("HiveMindP2") && npc.type != mod.NPCType("DarkHeart") && npc.type != mod.NPCType("HiveBlob") && @@ -1763,14 +1805,18 @@ namespace CalamityMod.NPCs npc.active = false; npc.netUpdate = true; } + break; + case 14: if (npc.type != NPCID.SkeletronHead && npc.type != NPCID.SkeletronHand) { npc.active = false; npc.netUpdate = true; } + break; + case 15: if (npc.type != mod.NPCType("StormWeaverHead") && npc.type != mod.NPCType("StormWeaverBody") && npc.type != mod.NPCType("StormWeaverTail") && npc.type != mod.NPCType("StormWeaverHeadNaked") && @@ -1780,7 +1826,9 @@ namespace CalamityMod.NPCs npc.active = false; npc.netUpdate = true; } + break; + case 16: if (npc.type != mod.NPCType("AquaticScourgeHead") && npc.type != mod.NPCType("AquaticScourgeBody") && npc.type != mod.NPCType("AquaticScourgeBodyAlt") && npc.type != mod.NPCType("AquaticScourgeTail") && @@ -1791,7 +1839,9 @@ namespace CalamityMod.NPCs npc.active = false; npc.netUpdate = true; } + break; + case 17: if (npc.type != mod.NPCType("DesertScourgeHead") && npc.type != mod.NPCType("DesertScourgeBody") && npc.type != mod.NPCType("DesertScourgeTail") && npc.type != mod.NPCType("DesertScourgeHeadSmall") && @@ -1802,7 +1852,9 @@ namespace CalamityMod.NPCs npc.active = false; npc.netUpdate = true; } + break; + case 18: if (npc.type != NPCID.CultistBoss && npc.type != NPCID.CultistBossClone && npc.type != NPCID.CultistDragonHead && npc.type != NPCID.CultistDragonBody1 && npc.type != NPCID.CultistDragonBody2 && npc.type != NPCID.CultistDragonBody3 && @@ -1812,14 +1864,18 @@ namespace CalamityMod.NPCs npc.active = false; npc.netUpdate = true; } + break; + case 19: if (npc.type != mod.NPCType("CrabulonIdle") && npc.type != mod.NPCType("CrabShroom")) { npc.active = false; npc.netUpdate = true; } + break; + case 20: if (npc.type != NPCID.Plantera && npc.type != NPCID.PlanterasTentacle && npc.type != NPCID.PlanterasHook && npc.type != NPCID.Spore) @@ -1827,7 +1883,9 @@ namespace CalamityMod.NPCs npc.active = false; npc.netUpdate = true; } + break; + case 21: if (npc.type != mod.NPCType("CeaselessVoid") && npc.type != mod.NPCType("DarkEnergy") && npc.type != mod.NPCType("DarkEnergy2") && npc.type != mod.NPCType("DarkEnergy3")) @@ -1835,7 +1893,9 @@ namespace CalamityMod.NPCs npc.active = false; npc.netUpdate = true; } + break; + case 22: if (npc.type != mod.NPCType("PerforatorHive") && npc.type != mod.NPCType("PerforatorHeadLarge") && npc.type != mod.NPCType("PerforatorBodyLarge") && npc.type != mod.NPCType("PerforatorTailLarge") && @@ -1846,7 +1906,9 @@ namespace CalamityMod.NPCs npc.active = false; npc.netUpdate = true; } + break; + case 23: if (npc.type != mod.NPCType("Cryogen") && npc.type != mod.NPCType("CryogenIce") && npc.type != mod.NPCType("IceMass") && npc.type != mod.NPCType("Cryocore") && @@ -1855,14 +1917,18 @@ namespace CalamityMod.NPCs npc.active = false; npc.netUpdate = true; } + break; + case 24: if (npc.type != mod.NPCType("BrimstoneElemental") && npc.type != mod.NPCType("Brimling")) { npc.active = false; npc.netUpdate = true; } + break; + case 25: if (npc.type != mod.NPCType("CosmicWraith") && npc.type != mod.NPCType("SignusBomb") && npc.type != mod.NPCType("CosmicLantern")) @@ -1870,7 +1936,9 @@ namespace CalamityMod.NPCs npc.active = false; npc.netUpdate = true; } + break; + case 26: if (npc.type != mod.NPCType("ScavengerBody") && npc.type != mod.NPCType("ScavengerHead") && npc.type != mod.NPCType("ScavengerClawLeft") && npc.type != mod.NPCType("ScavengerClawRight") && @@ -1881,7 +1949,9 @@ namespace CalamityMod.NPCs npc.active = false; npc.netUpdate = true; } + break; + case 27: if (npc.type != NPCID.DukeFishron && npc.type != NPCID.DetonatingBubble && npc.type != NPCID.Sharkron && npc.type != NPCID.Sharkron2) @@ -1889,7 +1959,9 @@ namespace CalamityMod.NPCs npc.active = false; npc.netUpdate = true; } + break; + case 28: if (npc.type != NPCID.MoonLordCore && npc.type != NPCID.MoonLordHead && npc.type != NPCID.MoonLordHand && npc.type != NPCID.MoonLordFreeEye && npc.type != mod.NPCType("Eidolist")) @@ -1897,7 +1969,9 @@ namespace CalamityMod.NPCs npc.active = false; npc.netUpdate = true; } + break; + case 29: if (npc.type != mod.NPCType("AstrumDeusHead") && npc.type != mod.NPCType("AstrumDeusBody") && npc.type != mod.NPCType("AstrumDeusTail") && npc.type != mod.NPCType("AstrumDeusHeadSpectral") && @@ -1908,7 +1982,9 @@ namespace CalamityMod.NPCs npc.active = false; npc.netUpdate = true; } + break; + case 30: if (npc.type != mod.NPCType("Polterghast") && npc.type != mod.NPCType("PhantomFuckYou") && npc.type != mod.NPCType("PolterghastHook") && npc.type != mod.NPCType("PolterPhantom")) @@ -1916,7 +1992,9 @@ namespace CalamityMod.NPCs npc.active = false; npc.netUpdate = true; } + break; + case 31: if (npc.type != mod.NPCType("PlaguebringerGoliath") && npc.type != mod.NPCType("PlagueBeeG") && npc.type != mod.NPCType("PlagueBeeLargeG") && npc.type != mod.NPCType("PlagueHomingMissile") && @@ -1925,7 +2003,9 @@ namespace CalamityMod.NPCs npc.active = false; npc.netUpdate = true; } + break; + case 32: if (npc.type != mod.NPCType("Calamitas") && npc.type != mod.NPCType("CalamitasRun") && npc.type != mod.NPCType("CalamitasRun2") && npc.type != mod.NPCType("CalamitasRun3") && @@ -1934,7 +2014,9 @@ namespace CalamityMod.NPCs npc.active = false; npc.netUpdate = true; } + break; + case 33: if (npc.type != mod.NPCType("Siren") && npc.type != mod.NPCType("Leviathan") && npc.type != mod.NPCType("AquaticAberration") && npc.type != mod.NPCType("Parasea") && @@ -1943,7 +2025,9 @@ namespace CalamityMod.NPCs npc.active = false; npc.netUpdate = true; } + break; + case 34: if (npc.type != mod.NPCType("SlimeGod") && npc.type != mod.NPCType("SlimeGodRun") && npc.type != mod.NPCType("SlimeGodCore") && npc.type != mod.NPCType("SlimeGodSplit") && @@ -1954,7 +2038,9 @@ namespace CalamityMod.NPCs npc.active = false; npc.netUpdate = true; } + break; + case 35: if (npc.type != mod.NPCType("Providence") && npc.type != mod.NPCType("ProvSpawnDefense") && npc.type != mod.NPCType("ProvSpawnOffense") && npc.type != mod.NPCType("ProvSpawnHealer")) @@ -1962,7 +2048,9 @@ namespace CalamityMod.NPCs npc.active = false; npc.netUpdate = true; } + break; + case 36: if (npc.type != mod.NPCType("SupremeCalamitas") && npc.type != mod.NPCType("SCalWormBody") && npc.type != mod.NPCType("SCalWormBodyWeak") && npc.type != mod.NPCType("SCalWormHead") && @@ -1973,7 +2061,9 @@ namespace CalamityMod.NPCs npc.active = false; npc.netUpdate = true; } + break; + case 37: if (npc.type != mod.NPCType("Yharon") && npc.type != mod.NPCType("DetonatingFlare") && npc.type != mod.NPCType("DetonatingFlare2") && npc.type != mod.NPCType("DetonatingFlare3") && @@ -1982,7 +2072,9 @@ namespace CalamityMod.NPCs npc.active = false; npc.netUpdate = true; } + break; + case 38: if (npc.type != mod.NPCType("DevourerofGodsHeadS") && npc.type != mod.NPCType("DevourerofGodsBodyS") && npc.type != mod.NPCType("DevourerofGodsTailS")) @@ -1990,6 +2082,7 @@ namespace CalamityMod.NPCs npc.active = false; npc.netUpdate = true; } + break; } } @@ -2020,16 +2113,20 @@ namespace CalamityMod.NPCs case NPCID.MoonLordFreeEye: CalamityGlobalAI.RevengeanceMoonLordFreeEyeAI(npc); break; + case NPCID.MoonLordCore: CalamityGlobalAI.RevengeanceMoonLordCoreAI(npc); break; + case NPCID.MoonLordHand: case NPCID.MoonLordHead: CalamityGlobalAI.RevengeanceMoonLordHandAI(npc, mod); break; + case NPCID.CultistBoss: CalamityGlobalAI.RevengeanceCultistAI(npc, configBossRushBoost, mod, enraged); break; + case NPCID.GolemHeadFree: if (!CalamityWorld.bossRushActive) { @@ -2037,6 +2134,7 @@ namespace CalamityMod.NPCs } break; + case NPCID.GolemHead: if (!CalamityWorld.bossRushActive) { @@ -2044,15 +2142,19 @@ namespace CalamityMod.NPCs } break; + case NPCID.DungeonGuardian: CalamityGlobalAI.RevengeanceDungeonGuardianAI(npc, configBossRushBoost, enraged); break; + case NPCID.Lihzahrd: CalamityGlobalAI.RevengeanceLihzahrdAI(npc); break; + case NPCID.IceGolem: CalamityGlobalAI.RevengeanceIceGolemAI(npc); break; + default: break; } @@ -2068,6 +2170,7 @@ namespace CalamityMod.NPCs npc.velocity.X *= 0.95f; npc.velocity.Y *= 0.95f; } + if (!CalamityWorld.bossRushActive) { if (silvaStun) @@ -2141,358 +2244,181 @@ namespace CalamityMod.NPCs switch (npc.type) { case NPCID.DemonEye: - target.AddBuff(mod.BuffType("Horror"), 60); - break; - case NPCID.EyeofCthulhu: - target.AddBuff(mod.BuffType("Horror"), 180); - break; - case NPCID.ServantofCthulhu: - target.AddBuff(mod.BuffType("Horror"), 180); - break; case NPCID.EaterofSouls: - target.AddBuff(mod.BuffType("Horror"), 60); - break; - case NPCID.DevourerHead: - target.AddBuff(mod.BuffType("Horror"), 120); - break; - case NPCID.EaterofWorldsHead: - target.AddBuff(mod.BuffType("Horror"), 180); - target.AddBuff(mod.BuffType("MarkedforDeath"), 180); - break; - case NPCID.EaterofWorldsBody: - target.AddBuff(mod.BuffType("Horror"), 120); - break; case NPCID.EaterofWorldsTail: - target.AddBuff(mod.BuffType("Horror"), 60); - break; - case NPCID.BurningSphere: - target.AddBuff(mod.BuffType("MarkedforDeath"), 120); - break; case NPCID.ChaosBall: - target.AddBuff(mod.BuffType("Horror"), 60); - break; - case NPCID.CursedSkull: - target.AddBuff(mod.BuffType("Horror"), 120); - target.AddBuff(mod.BuffType("MarkedforDeath"), 120); - break; - case NPCID.SkeletronHead: - target.AddBuff(mod.BuffType("Horror"), 180); - break; - case NPCID.SkeletronHand: - target.AddBuff(mod.BuffType("Horror"), 120); - target.AddBuff(mod.BuffType("MarkedforDeath"), 120); - break; - case NPCID.ManEater: - target.AddBuff(mod.BuffType("MarkedforDeath"), 120); - break; - case NPCID.Snatcher: - target.AddBuff(mod.BuffType("MarkedforDeath"), 60); - break; - case NPCID.CorruptBunny: - target.AddBuff(mod.BuffType("Horror"), 120); - break; - case NPCID.CorruptGoldfish: - target.AddBuff(mod.BuffType("Horror"), 120); - break; - case NPCID.Demon: - target.AddBuff(mod.BuffType("Horror"), 180); - break; - case NPCID.VoodooDemon: - target.AddBuff(mod.BuffType("Horror"), 180); - break; - case NPCID.DungeonGuardian: - target.AddBuff(mod.BuffType("Horror"), 1200); - break; - case NPCID.Mummy: - target.AddBuff(mod.BuffType("MarkedforDeath"), 120); - break; - case NPCID.DarkMummy: - target.AddBuff(mod.BuffType("Horror"), 180); - target.AddBuff(mod.BuffType("MarkedforDeath"), 120); - break; - case NPCID.CorruptSlime: - target.AddBuff(mod.BuffType("Horror"), 120); - break; - case NPCID.Wraith: - target.AddBuff(mod.BuffType("Horror"), 240); - target.AddBuff(mod.BuffType("MarkedforDeath"), 180); - break; - case NPCID.EnchantedSword: - target.AddBuff(mod.BuffType("MarkedforDeath"), 120); - break; - case NPCID.Mimic: - target.AddBuff(mod.BuffType("MarkedforDeath"), 240); - break; - case NPCID.Werewolf: - target.AddBuff(mod.BuffType("MarkedforDeath"), 120); - break; - case NPCID.CursedHammer: - target.AddBuff(mod.BuffType("Horror"), 180); - break; - case NPCID.Corruptor: - target.AddBuff(mod.BuffType("Horror"), 120); - break; - case NPCID.SeekerHead: - target.AddBuff(mod.BuffType("Horror"), 180); - break; - case NPCID.Clinger: - target.AddBuff(mod.BuffType("Horror"), 120); - break; case NPCID.VileSpit: - target.AddBuff(mod.BuffType("Horror"), 60); - break; - case NPCID.WallofFlesh: - target.AddBuff(mod.BuffType("Horror"), 300); - break; - case NPCID.TheHungry: - target.AddBuff(mod.BuffType("Horror"), 120); - target.AddBuff(mod.BuffType("MarkedforDeath"), 120); - break; - case NPCID.TheHungryII: - target.AddBuff(mod.BuffType("Horror"), 120); - target.AddBuff(mod.BuffType("MarkedforDeath"), 120); - break; case NPCID.LeechHead: - target.AddBuff(mod.BuffType("Horror"), 60); - break; - case NPCID.Slimer: - target.AddBuff(mod.BuffType("Horror"), 120); - break; - case NPCID.WanderingEye: - target.AddBuff(mod.BuffType("Horror"), 120); - break; - case NPCID.Spazmatism: - target.AddBuff(mod.BuffType("MarkedforDeath"), 180); - break; - case NPCID.PrimeSaw: - target.AddBuff(mod.BuffType("MarkedforDeath"), 180); - break; - case NPCID.PrimeVice: - target.AddBuff(mod.BuffType("MarkedforDeath"), 180); - break; - case NPCID.Probe: - target.AddBuff(mod.BuffType("MarkedforDeath"), 180); - break; - case NPCID.RedDevil: - target.AddBuff(mod.BuffType("Horror"), 180); - break; - case NPCID.VampireBat: - target.AddBuff(mod.BuffType("Horror"), 240); - target.AddBuff(mod.BuffType("MarkedforDeath"), 180); - break; - case NPCID.Vampire: - target.AddBuff(mod.BuffType("Horror"), 240); - target.AddBuff(mod.BuffType("MarkedforDeath"), 180); - break; - case NPCID.Frankenstein: - target.AddBuff(mod.BuffType("Horror"), 120); - break; - case NPCID.BlackRecluse: - target.AddBuff(mod.BuffType("Horror"), 180); - break; - case NPCID.WallCreeper: - target.AddBuff(mod.BuffType("Horror"), 120); - break; - case NPCID.WallCreeperWall: - target.AddBuff(mod.BuffType("Horror"), 120); - break; - case NPCID.SwampThing: - target.AddBuff(mod.BuffType("Horror"), 120); - break; - case NPCID.AngryTrapper: - target.AddBuff(mod.BuffType("MarkedforDeath"), 240); - break; - case NPCID.CorruptPenguin: - target.AddBuff(mod.BuffType("Horror"), 120); - break; case NPCID.Crimera: - target.AddBuff(mod.BuffType("Horror"), 60); - break; - case NPCID.Herpling: - target.AddBuff(mod.BuffType("Horror"), 120); - break; - case NPCID.CrimsonAxe: - target.AddBuff(mod.BuffType("Horror"), 180); - break; case NPCID.FaceMonster: - target.AddBuff(mod.BuffType("Horror"), 60); - break; - case NPCID.FloatyGross: - target.AddBuff(mod.BuffType("Horror"), 120); - break; - case NPCID.Crimslime: - target.AddBuff(mod.BuffType("Horror"), 120); - break; - case NPCID.Nymph: - target.AddBuff(mod.BuffType("Horror"), 180); - break; - case NPCID.BlackRecluseWall: - target.AddBuff(mod.BuffType("Horror"), 180); - break; case NPCID.BloodCrawler: - target.AddBuff(mod.BuffType("Horror"), 60); - break; case NPCID.BloodCrawlerWall: target.AddBuff(mod.BuffType("Horror"), 60); break; + + case NPCID.DevourerHead: + case NPCID.EaterofWorldsBody: + case NPCID.CorruptBunny: + case NPCID.CorruptGoldfish: + case NPCID.CorruptSlime: + case NPCID.Corruptor: + case NPCID.Clinger: + case NPCID.Slimer: + case NPCID.WanderingEye: + case NPCID.Frankenstein: + case NPCID.WallCreeper: + case NPCID.WallCreeperWall: + case NPCID.SwampThing: + case NPCID.CorruptPenguin: + case NPCID.Herpling: + case NPCID.FloatyGross: + case NPCID.Crimslime: case NPCID.BloodFeeder: - target.AddBuff(mod.BuffType("Horror"), 120); - break; - case NPCID.QueenBee: - target.AddBuff(mod.BuffType("MarkedforDeath"), 180); - break; - case NPCID.GolemFistLeft: - target.AddBuff(mod.BuffType("MarkedforDeath"), 180); - break; - case NPCID.GolemFistRight: - target.AddBuff(mod.BuffType("MarkedforDeath"), 180); - break; case NPCID.BloodJelly: + case NPCID.IchorSticker: + case NPCID.Ghost: + case NPCID.CreatureFromTheDeep: + case NPCID.Fritz: + case NPCID.CrimsonBunny: + case NPCID.CrimsonGoldfish: + case NPCID.CrimsonPenguin: + case NPCID.Drippler: target.AddBuff(mod.BuffType("Horror"), 120); break; + + case NPCID.EyeofCthulhu: + case NPCID.ServantofCthulhu: + case NPCID.SkeletronHead: + case NPCID.Demon: + case NPCID.VoodooDemon: + case NPCID.CursedHammer: + case NPCID.SeekerHead: + case NPCID.RedDevil: + case NPCID.BlackRecluse: + case NPCID.CrimsonAxe: + case NPCID.Nymph: + case NPCID.BlackRecluseWall: case NPCID.Eyezor: - target.AddBuff(mod.BuffType("Horror"), 180); - break; - case NPCID.Reaper: - target.AddBuff(mod.BuffType("Horror"), 240); - target.AddBuff(mod.BuffType("MarkedforDeath"), 180); - break; case NPCID.BrainofCthulhu: + case NPCID.HeadlessHorseman: + case NPCID.Splinterling: + case NPCID.Hellhound: + case NPCID.Poltergeist: + case NPCID.Nailhead: + case NPCID.DrManFly: + case NPCID.ThePossessed: + case NPCID.Mothron: + case NPCID.Medusa: + case NPCID.SandsharkCorrupt: + case NPCID.SandsharkCrimson: target.AddBuff(mod.BuffType("Horror"), 180); break; + + case NPCID.MourningWood: + case NPCID.Pumpking: + target.AddBuff(mod.BuffType("Horror"), 240); + break; + + case NPCID.WallofFlesh: + case NPCID.Krampus: + target.AddBuff(mod.BuffType("Horror"), 300); + break; + + case NPCID.DungeonGuardian: + target.AddBuff(mod.BuffType("Horror"), 1200); + break; + case NPCID.Creeper: target.AddBuff(mod.BuffType("Horror"), 60); target.AddBuff(mod.BuffType("MarkedforDeath"), 120); break; - case NPCID.IchorSticker: - target.AddBuff(mod.BuffType("Horror"), 120); - break; - case NPCID.DungeonSpirit: - target.AddBuff(mod.BuffType("Horror"), 300); - target.AddBuff(mod.BuffType("MarkedforDeath"), 180); - break; - case NPCID.GiantCursedSkull: - target.AddBuff(mod.BuffType("Horror"), 180); - target.AddBuff(mod.BuffType("MarkedforDeath"), 180); - break; - case NPCID.Spore: - target.AddBuff(mod.BuffType("MarkedforDeath"), 180); - break; - case NPCID.BoneLee: - target.AddBuff(mod.BuffType("MarkedforDeath"), 180); - break; - case NPCID.HeadlessHorseman: - target.AddBuff(mod.BuffType("Horror"), 180); - break; - case NPCID.Ghost: - target.AddBuff(mod.BuffType("Horror"), 120); - break; - case NPCID.MourningWood: - target.AddBuff(mod.BuffType("Horror"), 240); - break; - case NPCID.Splinterling: - target.AddBuff(mod.BuffType("Horror"), 180); - break; - case NPCID.Pumpking: - target.AddBuff(mod.BuffType("Horror"), 240); - break; + + case NPCID.CursedSkull: + case NPCID.SkeletronHand: + case NPCID.TheHungry: + case NPCID.TheHungryII: case NPCID.PumpkingBlade: - target.AddBuff(mod.BuffType("Horror"), 120); - target.AddBuff(mod.BuffType("MarkedforDeath"), 120); - break; - case NPCID.Hellhound: - target.AddBuff(mod.BuffType("Horror"), 180); - break; - case NPCID.Poltergeist: - target.AddBuff(mod.BuffType("Horror"), 180); - break; - case NPCID.Krampus: - target.AddBuff(mod.BuffType("Horror"), 300); - break; - case NPCID.Flocko: - target.AddBuff(mod.BuffType("MarkedforDeath"), 180); - break; - case NPCID.DetonatingBubble: - target.AddBuff(mod.BuffType("MarkedforDeath"), 360); - break; - case NPCID.DukeFishron: - target.AddBuff(mod.BuffType("MarkedforDeath"), 180); - break; - case NPCID.Sharkron: - target.AddBuff(mod.BuffType("MarkedforDeath"), 180); - break; - case NPCID.Sharkron2: - target.AddBuff(mod.BuffType("MarkedforDeath"), 180); - break; - case NPCID.Butcher: - target.AddBuff(mod.BuffType("Horror"), 180); - target.AddBuff(mod.BuffType("MarkedforDeath"), 180); - break; - case NPCID.CreatureFromTheDeep: - target.AddBuff(mod.BuffType("Horror"), 120); - break; - case NPCID.Fritz: - target.AddBuff(mod.BuffType("Horror"), 120); - break; - case NPCID.Nailhead: - target.AddBuff(mod.BuffType("Horror"), 180); - break; - case NPCID.CrimsonBunny: - target.AddBuff(mod.BuffType("Horror"), 120); - break; - case NPCID.CrimsonGoldfish: - target.AddBuff(mod.BuffType("Horror"), 120); - break; - case NPCID.Psycho: - target.AddBuff(mod.BuffType("Horror"), 180); - target.AddBuff(mod.BuffType("MarkedforDeath"), 180); - break; - case NPCID.DrManFly: - target.AddBuff(mod.BuffType("Horror"), 180); - break; - case NPCID.ThePossessed: - target.AddBuff(mod.BuffType("Horror"), 180); - break; - case NPCID.CrimsonPenguin: - target.AddBuff(mod.BuffType("Horror"), 120); - break; - case NPCID.Mothron: - target.AddBuff(mod.BuffType("Horror"), 180); - break; - case NPCID.ShadowFlameApparition: - target.AddBuff(mod.BuffType("MarkedforDeath"), 180); - break; - case NPCID.MartianDrone: - target.AddBuff(mod.BuffType("MarkedforDeath"), 180); - break; - case NPCID.MoonLordFreeEye: - target.AddBuff(mod.BuffType("Horror"), 180); - target.AddBuff(mod.BuffType("MarkedforDeath"), 180); - break; - case NPCID.Medusa: - target.AddBuff(mod.BuffType("Horror"), 180); - break; case NPCID.BloodZombie: target.AddBuff(mod.BuffType("Horror"), 120); target.AddBuff(mod.BuffType("MarkedforDeath"), 120); break; - case NPCID.Drippler: - target.AddBuff(mod.BuffType("Horror"), 120); + + case NPCID.DarkMummy: + target.AddBuff(mod.BuffType("Horror"), 180); + target.AddBuff(mod.BuffType("MarkedforDeath"), 120); break; + + case NPCID.EaterofWorldsHead: + case NPCID.GiantCursedSkull: + case NPCID.Butcher: + case NPCID.Psycho: + case NPCID.MoonLordFreeEye: + target.AddBuff(mod.BuffType("Horror"), 180); + target.AddBuff(mod.BuffType("MarkedforDeath"), 180); + break; + + case NPCID.Wraith: + case NPCID.VampireBat: + case NPCID.Vampire: + case NPCID.Reaper: + target.AddBuff(mod.BuffType("Horror"), 240); + target.AddBuff(mod.BuffType("MarkedforDeath"), 180); + break; + case NPCID.AncientCultistSquidhead: target.AddBuff(mod.BuffType("Horror"), 240); target.AddBuff(mod.BuffType("MarkedforDeath"), 240); break; + + case NPCID.DungeonSpirit: + target.AddBuff(mod.BuffType("Horror"), 300); + target.AddBuff(mod.BuffType("MarkedforDeath"), 180); + break; + case NPCID.AncientDoom: target.AddBuff(mod.BuffType("Horror"), 300); target.AddBuff(mod.BuffType("MarkedforDeath"), 300); break; - case NPCID.SandsharkCorrupt: - target.AddBuff(mod.BuffType("Horror"), 180); + + case NPCID.Snatcher: + target.AddBuff(mod.BuffType("MarkedforDeath"), 60); break; - case NPCID.SandsharkCrimson: - target.AddBuff(mod.BuffType("Horror"), 180); + + case NPCID.BurningSphere: + case NPCID.ManEater: + case NPCID.Mummy: + case NPCID.EnchantedSword: + case NPCID.Werewolf: + target.AddBuff(mod.BuffType("MarkedforDeath"), 120); break; + + case NPCID.Spazmatism: + case NPCID.PrimeSaw: + case NPCID.PrimeVice: + case NPCID.Probe: + case NPCID.QueenBee: + case NPCID.GolemFistLeft: + case NPCID.GolemFistRight: + case NPCID.Spore: + case NPCID.BoneLee: + case NPCID.Flocko: + case NPCID.DukeFishron: + case NPCID.Sharkron: + case NPCID.Sharkron2: + case NPCID.ShadowFlameApparition: + case NPCID.MartianDrone: + target.AddBuff(mod.BuffType("MarkedforDeath"), 180); + break; + + case NPCID.Mimic: + case NPCID.AngryTrapper: + target.AddBuff(mod.BuffType("MarkedforDeath"), 240); + break; + + case NPCID.DetonatingBubble: + target.AddBuff(mod.BuffType("MarkedforDeath"), 360); + break; + default: break; } @@ -2522,9 +2448,9 @@ namespace CalamityMod.NPCs } } - if (Main.player[projectile.owner].GetModPlayer(mod).eGauntlet) + if (Main.player[projectile.owner].GetCalamityPlayer().eGauntlet) { - if (projectile.melee && ShouldAffectNPC(npc) && Main.rand.Next(15) == 0) + if (projectile.melee && ShouldAffectNPC(npc) && Main.rand.NextBool(15)) { if (!CalamityPlayer.areThereAnyDamnBosses) { @@ -2532,9 +2458,10 @@ namespace CalamityMod.NPCs } } } - if (Main.player[projectile.owner].GetModPlayer(mod).eTalisman) + + if (Main.player[projectile.owner].GetCalamityPlayer().eTalisman) { - if (projectile.magic && ShouldAffectNPC(npc) && Main.rand.Next(15) == 0) + if (projectile.magic && ShouldAffectNPC(npc) && Main.rand.NextBool(15)) { if (!CalamityPlayer.areThereAnyDamnBosses) { @@ -2542,9 +2469,10 @@ namespace CalamityMod.NPCs } } } - if (Main.player[projectile.owner].GetModPlayer(mod).nanotech) + + if (Main.player[projectile.owner].GetCalamityPlayer().nanotech) { - if (projectile.GetGlobalProjectile(mod).rogue && ShouldAffectNPC(npc) && Main.rand.Next(15) == 0) + if (projectile.GetGlobalProjectile(mod).rogue && ShouldAffectNPC(npc) && Main.rand.NextBool(15)) { if (!CalamityPlayer.areThereAnyDamnBosses) { @@ -2552,9 +2480,10 @@ namespace CalamityMod.NPCs } } } - if (Main.player[projectile.owner].GetModPlayer(mod).eQuiver) + + if (Main.player[projectile.owner].GetCalamityPlayer().eQuiver) { - if (projectile.ranged && ShouldAffectNPC(npc) && Main.rand.Next(15) == 0) + if (projectile.ranged && ShouldAffectNPC(npc) && Main.rand.NextBool(15)) { if (!CalamityPlayer.areThereAnyDamnBosses) { @@ -2562,9 +2491,10 @@ namespace CalamityMod.NPCs } } } - if (Main.player[projectile.owner].GetModPlayer(mod).statisBeltOfCurses) + + if (Main.player[projectile.owner].GetCalamityPlayer().statisBeltOfCurses) { - if ((projectile.minion || CalamityMod.projectileMinionList.Contains(projectile.type)) && ShouldAffectNPC(npc) && Main.rand.Next(15) == 0) + if ((projectile.minion || CalamityMod.projectileMinionList.Contains(projectile.type)) && ShouldAffectNPC(npc) && Main.rand.NextBool(15)) { if (!CalamityPlayer.areThereAnyDamnBosses) { @@ -2599,7 +2529,7 @@ namespace CalamityMod.NPCs #region On Hit By Projectile public override void OnHitByProjectile(NPC npc, Projectile projectile, int damage, float knockback, bool crit) { - if (Main.player[projectile.owner].GetModPlayer(mod).sGenerator) + if (Main.player[projectile.owner].GetCalamityPlayer().sGenerator) { if (projectile.minion && npc.damage > 0) { @@ -2623,18 +2553,18 @@ namespace CalamityMod.NPCs } } - if (Main.player[projectile.owner].GetModPlayer(mod).bloodflareSet) + if (Main.player[projectile.owner].GetCalamityPlayer().bloodflareSet) { if (!npc.SpawnedFromStatue && npc.damage > 0 && (npc.life < npc.lifeMax * 0.5) && - Main.player[projectile.owner].GetModPlayer(mod).bloodflareHeartTimer <= 0) + Main.player[projectile.owner].GetCalamityPlayer().bloodflareHeartTimer <= 0) { - Main.player[projectile.owner].GetModPlayer(mod).bloodflareHeartTimer = 180; + Main.player[projectile.owner].GetCalamityPlayer().bloodflareHeartTimer = 180; DropHelper.DropItem(npc, ItemID.Heart); } else if (!npc.SpawnedFromStatue && npc.damage > 0 && (npc.life > npc.lifeMax * 0.5) && - Main.player[projectile.owner].GetModPlayer(mod).bloodflareManaTimer <= 0) + Main.player[projectile.owner].GetCalamityPlayer().bloodflareManaTimer <= 0) { - Main.player[projectile.owner].GetModPlayer(mod).bloodflareManaTimer = 180; + Main.player[projectile.owner].GetCalamityPlayer().bloodflareManaTimer = 180; DropHelper.DropItem(npc, ItemID.Star); } } @@ -2655,7 +2585,7 @@ namespace CalamityMod.NPCs { int maxValue = Main.expertMode ? 4 : 6; - if (Main.rand.Next(maxValue) == 0 && Main.wallDungeon[(int)Main.tile[(int)npc.Center.X / 16, (int)npc.Center.Y / 16].wall]) + if (Main.rand.NextBool(maxValue) && Main.wallDungeon[Main.tile[(int)npc.Center.X / 16, (int)npc.Center.Y / 16].wall]) { int randomType = Main.rand.Next(4); switch (randomType) @@ -2663,21 +2593,27 @@ namespace CalamityMod.NPCs case 0: randomType = mod.NPCType("PhantomSpirit"); break; + case 1: randomType = mod.NPCType("PhantomSpiritS"); break; + case 2: randomType = mod.NPCType("PhantomSpiritM"); break; + case 3: randomType = mod.NPCType("PhantomSpiritL"); break; + default: break; } + NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, randomType, 0, 0f, 0f, 0f, 0f, 255); } } + return true; } #endregion @@ -2692,23 +2628,23 @@ namespace CalamityMod.NPCs case NPCID.MotherSlime: if (npc.life <= 0) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int num261 = Main.rand.Next(2) + 2; int num; for (int num262 = 0; num262 < num261; num262 = num + 1) { - int num263 = NPC.NewNPC((int)(npc.position.X + (float)(npc.width / 2)), (int)(npc.position.Y + (float)npc.height), 1, 0, 0f, 0f, 0f, 0f, 255); + int num263 = NPC.NewNPC((int)(npc.position.X + npc.width / 2), (int)(npc.position.Y + npc.height), 1, 0, 0f, 0f, 0f, 0f, 255); Main.npc[num263].SetDefaults(-5, -1f); Main.npc[num263].velocity.X = npc.velocity.X * 2f; Main.npc[num263].velocity.Y = npc.velocity.Y; NPC var_324_BB1A_cp_0_cp_0 = Main.npc[num263]; - var_324_BB1A_cp_0_cp_0.velocity.X = var_324_BB1A_cp_0_cp_0.velocity.X + ((float)Main.rand.Next(-20, 20) * 0.1f + (float)(num262 * npc.direction) * 0.3f); + var_324_BB1A_cp_0_cp_0.velocity.X = var_324_BB1A_cp_0_cp_0.velocity.X + (Main.rand.Next(-20, 20) * 0.1f + num262 * npc.direction * 0.3f); NPC var_324_BB6F_cp_0_cp_0 = Main.npc[num263]; - var_324_BB6F_cp_0_cp_0.velocity.Y = var_324_BB6F_cp_0_cp_0.velocity.Y - ((float)Main.rand.Next(0, 10) * 0.1f + (float)num262); - Main.npc[num263].ai[0] = (float)(-1000 * Main.rand.Next(3)); + var_324_BB6F_cp_0_cp_0.velocity.Y = var_324_BB6F_cp_0_cp_0.velocity.Y - (Main.rand.Next(0, 10) * 0.1f + num262); + Main.npc[num263].ai[0] = -1000 * Main.rand.Next(3); - if (Main.netMode == 2 && num263 < 200) + if (Main.netMode == NetmodeID.Server && num263 < 200) { NetMessage.SendData(23, -1, -1, null, num263, 0f, 0f, 0f, 0, 0, 0); } @@ -2727,7 +2663,7 @@ namespace CalamityMod.NPCs case NPCID.CursedHammer: case NPCID.EnchantedSword: case NPCID.CrimsonAxe: - if ((double)npc.life <= (double)npc.lifeMax * 0.5) + if (npc.life <= npc.lifeMax * 0.5) { npc.justHit = false; } @@ -2740,7 +2676,7 @@ namespace CalamityMod.NPCs case NPCID.IceTortoise: case NPCID.BlackRecluse: case NPCID.BlackRecluseWall: - if ((double)npc.life <= (double)npc.lifeMax * 0.25) + if (npc.life <= npc.lifeMax * 0.25) { npc.justHit = false; } @@ -2748,7 +2684,7 @@ namespace CalamityMod.NPCs break; case NPCID.Paladin: - if ((double)npc.life <= (double)npc.lifeMax * 0.15) + if (npc.life <= npc.lifeMax * 0.15) { npc.justHit = false; } @@ -2756,7 +2692,7 @@ namespace CalamityMod.NPCs break; case NPCID.Clown: - if (Main.netMode != 1 && !Main.player[npc.target].dead) + if (Main.netMode != NetmodeID.MultiplayerClient && !Main.player[npc.target].dead) { npc.ai[2] += 29f; } @@ -2766,7 +2702,7 @@ namespace CalamityMod.NPCs if (npc.type == mod.NPCType("SandTortoise") || npc.type == mod.NPCType("PlaguedTortoise")) { - if ((double)npc.life <= (double)npc.lifeMax * 0.25) + if (npc.life <= npc.lifeMax * 0.25) { npc.justHit = false; } @@ -2780,85 +2716,85 @@ namespace CalamityMod.NPCs { if (player.GetModPlayer(mod).ZoneSulphur) { - spawnRate = (int)((double)spawnRate * 1.1); - maxSpawns = (int)((float)maxSpawns * 0.8f); + spawnRate = (int)(spawnRate * 1.1); + maxSpawns = (int)(maxSpawns * 0.8f); if (Main.raining) { - spawnRate = (int)((double)spawnRate * 0.7); - maxSpawns = (int)((float)maxSpawns * 1.2f); + spawnRate = (int)(spawnRate * 0.7); + maxSpawns = (int)(maxSpawns * 1.2f); } } else if (player.GetModPlayer(mod).ZoneAbyss) { - spawnRate = (int)((double)spawnRate * 0.7); - maxSpawns = (int)((float)maxSpawns * 1.1f); + spawnRate = (int)(spawnRate * 0.7); + maxSpawns = (int)(maxSpawns * 1.1f); } else if (player.GetModPlayer(mod).ZoneCalamity) { - spawnRate = (int)((double)spawnRate * 0.9); - maxSpawns = (int)((float)maxSpawns * 1.1f); + spawnRate = (int)(spawnRate * 0.9); + maxSpawns = (int)(maxSpawns * 1.1f); } else if (player.GetModPlayer(mod).ZoneAstral) { - spawnRate = (int)((double)spawnRate * 0.6); - maxSpawns = (int)((float)maxSpawns * 1.2f); + spawnRate = (int)(spawnRate * 0.6); + maxSpawns = (int)(maxSpawns * 1.2f); } else if (player.GetModPlayer(mod).ZoneSunkenSea) { - spawnRate = (int)((double)spawnRate * 0.9); - maxSpawns = (int)((float)maxSpawns * 1.1f); + spawnRate = (int)(spawnRate * 0.9); + maxSpawns = (int)(maxSpawns * 1.1f); } if (player.GetModPlayer(mod).clamity) { - spawnRate = (int)((double)spawnRate * 0.02); - maxSpawns = (int)((float)maxSpawns * 1.5f); + spawnRate = (int)(spawnRate * 0.02); + maxSpawns = (int)(maxSpawns * 1.5f); } if (CalamityWorld.death) { - spawnRate = (int)((double)spawnRate * 0.75); + spawnRate = (int)(spawnRate * 0.75); } else if (CalamityWorld.revenge) { - spawnRate = (int)((double)spawnRate * 0.85); + spawnRate = (int)(spawnRate * 0.85); } if (CalamityWorld.demonMode) { - spawnRate = (int)((double)spawnRate * 0.75); + spawnRate = (int)(spawnRate * 0.75); } if (player.GetModPlayer(mod).zerg && player.GetModPlayer(mod).chaosCandle) { - spawnRate = (int)((double)spawnRate * 0.005); - maxSpawns = (int)((float)maxSpawns * 7.5f); + spawnRate = (int)(spawnRate * 0.005); + maxSpawns = (int)(maxSpawns * 7.5f); } else if (player.GetModPlayer(mod).zerg) { - spawnRate = (int)((double)spawnRate * 0.01); - maxSpawns = (int)((float)maxSpawns * 5f); + spawnRate = (int)(spawnRate * 0.01); + maxSpawns = (int)(maxSpawns * 5f); } else if (player.GetModPlayer(mod).chaosCandle) { - spawnRate = (int)((double)spawnRate * 0.02); - maxSpawns = (int)((float)maxSpawns * 2.5f); + spawnRate = (int)(spawnRate * 0.02); + maxSpawns = (int)(maxSpawns * 2.5f); } if (player.GetModPlayer(mod).zen && player.GetModPlayer(mod).tranquilityCandle) { - spawnRate = (int)((double)spawnRate * (player.GetModPlayer(mod).ZoneAbyss ? 1.75 : 75)); - maxSpawns = (int)((float)maxSpawns * (player.GetModPlayer(mod).ZoneAbyss ? 0.625f : 0.005f)); + spawnRate = (int)(spawnRate * (player.GetModPlayer(mod).ZoneAbyss ? 1.75 : 75)); + maxSpawns = (int)(maxSpawns * (player.GetModPlayer(mod).ZoneAbyss ? 0.625f : 0.005f)); } else if (CalamityPlayer.areThereAnyDamnBosses || player.GetModPlayer(mod).zen || (Config.DisableExpertEnemySpawnsNearHouse && player.townNPCs > 1f && Main.expertMode)) { - spawnRate = (int)((double)spawnRate * (player.GetModPlayer(mod).ZoneAbyss ? 1.5 : 50)); - maxSpawns = (int)((float)maxSpawns * (player.GetModPlayer(mod).ZoneAbyss ? 0.75f : 0.01f)); + spawnRate = (int)(spawnRate * (player.GetModPlayer(mod).ZoneAbyss ? 1.5 : 50)); + maxSpawns = (int)(maxSpawns * (player.GetModPlayer(mod).ZoneAbyss ? 0.75f : 0.01f)); } else if (player.GetModPlayer(mod).tranquilityCandle) { - spawnRate = (int)((double)spawnRate * (player.GetModPlayer(mod).ZoneAbyss ? 1.25 : 25)); - maxSpawns = (int)((float)maxSpawns * (player.GetModPlayer(mod).ZoneAbyss ? 0.875f : 0.02f)); + spawnRate = (int)(spawnRate * (player.GetModPlayer(mod).ZoneAbyss ? 1.25 : 25)); + maxSpawns = (int)(maxSpawns * (player.GetModPlayer(mod).ZoneAbyss ? 0.875f : 0.02f)); } } #endregion @@ -2868,8 +2804,8 @@ namespace CalamityMod.NPCs { if (player.GetModPlayer(mod).ZoneAbyss) { - spawnRangeX = (int)((double)(1920 / 16) * 0.5); //0.7 - safeRangeX = (int)((double)(1920 / 16) * 0.32); //0.52 + spawnRangeX = (int)(1920 / 16 * 0.5); //0.7 + safeRangeX = (int)(1920 / 16 * 0.32); //0.52 } } #endregion @@ -2910,7 +2846,7 @@ namespace CalamityMod.NPCs Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 1.8f; Main.dust[dust].velocity.Y -= 0.5f; - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Main.dust[dust].noGravity = false; Main.dust[dust].scale *= 0.5f; @@ -2926,7 +2862,7 @@ namespace CalamityMod.NPCs Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 1.8f; Main.dust[dust].velocity.Y -= 0.5f; - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Main.dust[dust].noGravity = false; Main.dust[dust].scale *= 0.5f; @@ -2942,7 +2878,7 @@ namespace CalamityMod.NPCs Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 1.8f; Main.dust[dust].velocity.Y -= 0.25f; - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Main.dust[dust].noGravity = false; Main.dust[dust].scale *= 0.35f; @@ -2958,7 +2894,7 @@ namespace CalamityMod.NPCs Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 1.1f; Main.dust[dust].velocity.Y += 0.25f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[dust].noGravity = false; Main.dust[dust].scale *= 0.5f; @@ -2973,7 +2909,7 @@ namespace CalamityMod.NPCs Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 1.8f; Main.dust[dust].velocity.Y -= 0.5f; - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Main.dust[dust].noGravity = false; Main.dust[dust].scale *= 0.5f; @@ -2989,7 +2925,7 @@ namespace CalamityMod.NPCs Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 1.2f; Main.dust[dust].velocity.Y -= 0.15f; - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Main.dust[dust].noGravity = false; Main.dust[dust].scale *= 0.5f; @@ -3005,7 +2941,7 @@ namespace CalamityMod.NPCs Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 1.2f; Main.dust[dust].velocity.Y -= 0.15f; - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Main.dust[dust].noGravity = false; Main.dust[dust].scale *= 0.5f; @@ -3017,13 +2953,13 @@ namespace CalamityMod.NPCs { if (Main.rand.Next(5) < 4) { - int dustType = (Main.rand.Next(2) == 0 ? mod.DustType("AstralOrange") : mod.DustType("AstralBlue")); + int dustType = (Main.rand.NextBool(2) ? mod.DustType("AstralOrange") : mod.DustType("AstralBlue")); int dust = Dust.NewDust(npc.position - new Vector2(2f, 2f), npc.width + 4, npc.height + 4, dustType, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, 1f); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 1.2f; Main.dust[dust].velocity.Y -= 0.15f; Main.dust[dust].color = new Color(255, 255, 255, 0); - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Main.dust[dust].noGravity = false; Main.dust[dust].scale *= 0.5f; @@ -3059,7 +2995,7 @@ namespace CalamityMod.NPCs Main.dust[dust].noGravity = false; Main.dust[dust].velocity *= 1.2f; Main.dust[dust].velocity.Y += 0.15f; - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Main.dust[dust].noGravity = false; Main.dust[dust].scale *= 0.5f; @@ -3074,7 +3010,7 @@ namespace CalamityMod.NPCs Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 1.2f; Main.dust[dust].velocity.Y -= 0.15f; - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Main.dust[dust].noGravity = false; Main.dust[dust].scale *= 0.5f; @@ -3138,14 +3074,14 @@ namespace CalamityMod.NPCs } float num66 = 0f; - Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); + Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2); Microsoft.Xna.Framework.Color color9 = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, 0); Microsoft.Xna.Framework.Color alpha15 = npc.GetAlpha(color9); float num212 = 0.99f; - alpha15.R = (byte)((float)alpha15.R * num212); - alpha15.G = (byte)((float)alpha15.G * num212); - alpha15.B = (byte)((float)alpha15.B * num212); - alpha15.A = (byte)((float)alpha15.A * num212); + alpha15.R = (byte)(alpha15.R * num212); + alpha15.G = (byte)(alpha15.G * num212); + alpha15.B = (byte)(alpha15.B * num212); + alpha15.A = (byte)(alpha15.A * num212); for (int num213 = 0; num213 < 4; num213++) { Vector2 position9 = npc.position; @@ -3161,7 +3097,7 @@ namespace CalamityMod.NPCs position9.X = Main.LocalPlayer.Center.X - num214; } - position9.X -= (float)(npc.width / 2); + position9.X -= npc.width / 2; if (num213 == 0 || num213 == 1) { @@ -3172,9 +3108,9 @@ namespace CalamityMod.NPCs position9.Y = Main.LocalPlayer.Center.Y - num215; } - position9.Y -= (float)(npc.height / 2); + position9.Y -= npc.height / 2; - Main.spriteBatch.Draw(Main.npcTexture[npc.type], new Vector2(position9.X - Main.screenPosition.X + (float)(npc.width / 2) - (float)Main.npcTexture[npc.type].Width * npc.scale / 2f + vector11.X * npc.scale, position9.Y - Main.screenPosition.Y + (float)npc.height - (float)Main.npcTexture[npc.type].Height * npc.scale / (float)Main.npcFrameCount[npc.type] + 4f + vector11.Y * npc.scale + num66 + npc.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(npc.frame), alpha15, npc.rotation, vector11, npc.scale, spriteEffects, 0f); + Main.spriteBatch.Draw(Main.npcTexture[npc.type], new Vector2(position9.X - Main.screenPosition.X + npc.width / 2 - Main.npcTexture[npc.type].Width * npc.scale / 2f + vector11.X * npc.scale, position9.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + vector11.Y * npc.scale + num66 + npc.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(npc.frame), alpha15, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } return true; @@ -3199,9 +3135,9 @@ namespace CalamityMod.NPCs if (newAI[2] >= 12f) { newAI[2] = 0f; - newAI[3] = newAI[3] + (float)frameHeight; + newAI[3] = newAI[3] + frameHeight; - if (newAI[3] / (float)frameHeight >= 2f) + if (newAI[3] / frameHeight >= 2f) { newAI[3] = 0f; } @@ -3212,14 +3148,14 @@ namespace CalamityMod.NPCs else if (npc.ai[1] == 5f || npc.ai[1] == 6f) { newAI[2] = 0f; - newAI[3] = (float)frameHeight; + newAI[3] = frameHeight; } // Spinning phase else { newAI[2] = 0f; - newAI[3] = (float)(frameHeight * 2); + newAI[3] = frameHeight * 2; } npc.frame.Y = (int)newAI[3]; @@ -3242,265 +3178,290 @@ namespace CalamityMod.NPCs #region Get Chat public override void GetChat(NPC npc, ref string chat) { + int fapsol = NPC.FindFirstNPC(mod.NPCType("FAP")); + int permadong = NPC.FindFirstNPC(mod.NPCType("DILF")); + switch (npc.type) { case NPCID.Guide: - if (Main.rand.Next(20) == 0 && Main.hardMode) + if (Main.hardMode) { - chat = "Could you be so kind as to, ah...check hell for me...? I left someone I kind of care about down there."; + if (Main.rand.NextBool(20)) + { + chat = "Could you be so kind as to, ah...check hell for me...? I left someone I kind of care about down there."; + } + + if (Main.rand.NextBool(20)) + { + chat = "I have this sudden shiver up my spine, like a meteor just fell and thousands of innocent creatures turned into monsters from the stars."; + } } - if (Main.rand.Next(20) == 0 && Main.hardMode) - { - chat = "I have this sudden shiver up my spine, like a meteor just fell and thousands of innocent creatures turned into monsters from the stars."; - } - - if (Main.rand.Next(20) == 0 && NPC.downedMoonlord) + if (Main.rand.NextBool(20) && NPC.downedMoonlord) { chat = "The dungeon seems even more restless than usual, watch out for the powerful abominations stirring up in there."; } - if (Main.rand.Next(20) == 0 && CalamityWorld.downedProvidence) + if (CalamityWorld.downedProvidence) { - chat = "Seems like extinguishing that butterfly caused its life to seep into the hallowed areas, try taking a peek there and see what you can find!"; - } + if (Main.rand.NextBool(20)) + { + chat = "Seems like extinguishing that butterfly caused its life to seep into the hallowed areas, try taking a peek there and see what you can find!"; + } - if (Main.rand.Next(20) == 0 && CalamityWorld.downedProvidence) - { - chat = "I've heard there is a portal of antimatter absorbing everything it can see in the dungeon, try using the Rune of Kos there!"; + if (Main.rand.NextBool(20)) + { + chat = "I've heard there is a portal of antimatter absorbing everything it can see in the dungeon, try using the Rune of Kos there!"; + } } break; + case NPCID.PartyGirl: - int fapsol = NPC.FindFirstNPC(mod.NPCType("FAP")); - if (Main.rand.Next(10) == 0 && fapsol != -1) + if (Main.rand.NextBool(10) && fapsol != -1) { chat = "I have a feeling we're going to have absolutely fantastic parties with " + Main.npc[fapsol].GivenName + " around!"; } - if (Main.rand.Next(5) == 0 && Main.eclipse) + if (Main.eclipse) { - chat = "I think my light display is turning into an accidental bug zapper. At least the monsters are enjoying it."; - } + if (Main.rand.NextBool(5)) + { + chat = "I think my light display is turning into an accidental bug zapper. At least the monsters are enjoying it."; + } - if (Main.rand.Next(5) == 0 && Main.eclipse) - { - chat = "Ooh! I love parties where everyone wears a scary costume!"; + if (Main.rand.NextBool(5)) + { + chat = "Ooh! I love parties where everyone wears a scary costume!"; + } } break; + case NPCID.Wizard: - int permadong = NPC.FindFirstNPC(mod.NPCType("DILF")); - if (Main.rand.Next(10) == 0 && permadong != -1) + if (Main.rand.NextBool(10) && permadong != -1) { chat = "I'd let " + Main.npc[permadong].GivenName + " coldheart MY icicle."; } - if (Main.rand.Next(10) == 0 && Main.hardMode) + if (Main.rand.NextBool(10) && Main.hardMode) { chat = "Space just got way too close for comfort."; } break; + case NPCID.Dryad: - if (Main.rand.Next(5) == 0 && CalamityWorld.buffedEclipse && Main.eclipse) + if (Main.rand.NextBool(5) && CalamityWorld.buffedEclipse && Main.eclipse) { chat = "There's a dark solar energy emanating from the moths that appear during this time. Ah, the moths as you progress further get more powerful...hmm...what power was Yharon holding back?"; } - if (Main.rand.Next(10) == 0 && Main.hardMode) + if (Main.rand.NextBool(10) && Main.hardMode) { chat = "That starborne illness sits upon this land like a blister. Do even more vile forces of corruption exist in worlds beyond?"; } break; + case NPCID.Stylist: - int fapsol2 = NPC.FindFirstNPC(mod.NPCType("FAP")); string worldEvil = WorldGen.crimson ? "Crimson" : "Corruption"; - if (Main.rand.Next(15) == 0 && fapsol2 != -1) - { - chat = "Sometimes I catch " + Main.npc[fapsol2].GivenName + " sneaking up from behind me."; - } - - if (Main.rand.Next(15) == 0 && fapsol2 != -1) - { - chat = Main.npc[fapsol2].GivenName + " is always trying to brighten my mood...even if, deep down, I know she's sad."; - } - - if (Main.rand.Next(15) == 0 && Main.hardMode) + if (Main.rand.NextBool(15) && Main.hardMode) { chat = "Please don't catch space lice. Or " + worldEvil + " lice. Or just lice in general."; } + if (fapsol != -1) + { + if (Main.rand.NextBool(15)) + { + chat = "Sometimes I catch " + Main.npc[fapsol].GivenName + " sneaking up from behind me."; + } + + if (Main.rand.NextBool(15)) + { + chat = Main.npc[fapsol].GivenName + " is always trying to brighten my mood...even if, deep down, I know she's sad."; + } + } + break; + case NPCID.GoblinTinkerer: - if (Main.rand.Next(10) == 0 && NPC.downedMoonlord) + if (Main.rand.NextBool(10) && NPC.downedMoonlord) { chat = "You know...we haven't had an invasion in a while..."; } break; + case NPCID.ArmsDealer: - if (Main.rand.Next(5) == 0 && Main.eclipse) + if (Main.rand.NextBool(5) && Main.eclipse) { chat = "That's the biggest moth I've ever seen for sure. You'd need one big gun to take one of those down."; } - if (Main.rand.Next(10) == 0 && CalamityWorld.downedDoG) + if (Main.rand.NextBool(10) && CalamityWorld.downedDoG) { chat = "Is it me or are your weapons getting bigger and bigger?"; } break; + case NPCID.Merchant: - if (Main.rand.Next(5) == 0 && NPC.downedMoonlord) + if (Main.rand.NextBool(5) && NPC.downedMoonlord) { chat = "Each night seems only more foreboding than the last. I feel unthinkable terrors are watching your every move."; } - if (Main.rand.Next(5) == 0 && Main.eclipse) + if (Main.rand.NextBool(5) && Main.eclipse) { chat = "Are you daft?! Turn off those lamps!"; } - if (Main.rand.Next(5) == 0 && Main.raining && CalamityWorld.sulphurTiles > 30) + if (Main.rand.NextBool(5) && Main.raining && CalamityWorld.sulphurTiles > 30) { chat = "If this acid rain keeps up, there'll be a shortage of Dirt Blocks soon enough!"; } break; + case NPCID.Mechanic: - int fapsol3 = NPC.FindFirstNPC(mod.NPCType("FAP")); - if (Main.rand.Next(5) == 0 && NPC.downedMoonlord) + if (Main.rand.NextBool(5) && NPC.downedMoonlord) { chat = "What do you mean your traps aren't making the cut? Don't look at me!"; } - if (Main.rand.Next(5) == 0 && Main.eclipse) + if (Main.rand.NextBool(5) && Main.eclipse) { chat = "Um...should my nightlight be on?"; } - if (Main.rand.Next(5) == 0 && fapsol3 != -1) + if (Main.rand.NextBool(5) && fapsol != -1) { - chat = "Well, I like " + Main.npc[fapsol3].GivenName + ", but I, ah...I have my eyes on someone else."; + chat = "Well, I like " + Main.npc[fapsol].GivenName + ", but I, ah...I have my eyes on someone else."; } break; + case NPCID.DD2Bartender: - int fapsol4 = NPC.FindFirstNPC(mod.NPCType("FAP")); - if (Main.rand.Next(5) == 0 && !Main.dayTime && Main.moonPhase == 0) + if (Main.rand.NextBool(5) && !Main.dayTime && Main.moonPhase == 0) { chat = "Care for a little Moonshine?"; } - if (Main.rand.Next(10) == 0 && fapsol4 != -1) + if (Main.rand.NextBool(10) && fapsol != -1) { - chat = "Sheesh, " + Main.npc[fapsol4].GivenName + " is a little cruel, isn't she? I never claimed to be an expert on anything but ale!"; + chat = "Sheesh, " + Main.npc[fapsol].GivenName + " is a little cruel, isn't she? I never claimed to be an expert on anything but ale!"; } break; + case NPCID.Pirate: - if (Main.rand.Next(5) == 0 && !CalamityWorld.downedLeviathan) + if (Main.rand.NextBool(5) && !CalamityWorld.downedLeviathan) { chat = "Aye, I’ve heard of a mythical creature in the oceans, singing with an alluring voice. Careful when yer fishin out there."; } - if (Main.rand.Next(5) == 0 && CalamityWorld.downedAquaticScourge) + if (Main.rand.NextBool(5) && CalamityWorld.downedAquaticScourge) { chat = "I have to thank ye again for takin' care of that sea serpent. Or was that another one..."; } break; + case NPCID.Cyborg: - if (Main.rand.Next(10) == 0 && Main.raining) + if (Main.rand.NextBool(10) && Main.raining) { chat = "All these moments will be lost in time. Like tears...in the rain."; } - if (Main.rand.Next(10) == 0 && NPC.downedMoonlord) + if (NPC.downedMoonlord) { - chat = "Always shoot for the moon! It has clearly worked before."; + if (Main.rand.NextBool(10)) + { + chat = "Always shoot for the moon! It has clearly worked before."; + } + + if (Main.rand.NextBool(10)) + { + chat = "Draedon? He's...a little 'high octane' if you know what I mean."; + } } - if (Main.rand.Next(10) == 0 && NPC.downedMoonlord) - { - chat = "Draedon? He's...a little 'high octane' if you know what I mean."; - } - - if (Main.rand.Next(10) == 0 && !CalamityWorld.downedPlaguebringer && NPC.downedGolemBoss) + if (Main.rand.NextBool(10) && !CalamityWorld.downedPlaguebringer && NPC.downedGolemBoss) { chat = "Those oversized bugs terrorizing the jungle... Surely you of all people could shut them down!"; } break; + case NPCID.Clothier: - if (Main.rand.Next(10) == 0 && NPC.downedMoonlord) + if (NPC.downedMoonlord) { - chat = "Who you gonna call?"; + if (Main.rand.NextBool(10)) + { + chat = "Who you gonna call?"; + } + + if (Main.rand.NextBool(10)) + { + chat = "Those screams...I’m not sure why, but I feel like a nameless fear has awoken in my heart."; + } + + if (Main.rand.NextBool(10)) + { + chat = "I can faintly hear ghostly shrieks from the dungeon...and not ones I’m familiar with at all. Just what is going on in there?"; + } } - if (Main.rand.Next(10) == 0 && NPC.downedMoonlord) - { - chat = "Those screams...I’m not sure why, but I feel like a nameless fear has awoken in my heart."; - } - - if (Main.rand.Next(10) == 0 && NPC.downedMoonlord) - { - chat = "I can faintly hear ghostly shrieks from the dungeon...and not ones I’m familiar with at all. Just what is going on in there?"; - } - - if (Main.rand.Next(10) == 0 && CalamityWorld.downedPolterghast) + if (Main.rand.NextBool(10) && CalamityWorld.downedPolterghast) { chat = "Whatever that thing was, I’m glad it’s gone now."; } - if (Main.rand.Next(5) == 0 && NPC.AnyNPCs(NPCID.MoonLordCore)) + if (Main.rand.NextBool(5) && NPC.AnyNPCs(NPCID.MoonLordCore)) { chat = "Houston, we've had a problem."; } break; + case NPCID.Steampunker: bool hasPortalGun = false; for (int k = 0; k < 255; k++) { Player player = Main.player[k]; - if (player.active) + if (player.active && player.HasItem(ItemID.PortalGun)) { - for (int j = 0; j < player.inventory.Length; j++) - { - if (player.inventory[j].type == ItemID.PortalGun) - { - hasPortalGun = true; - } - } + hasPortalGun = true; } } - if (Main.rand.Next(5) == 0 && NPC.downedMoonlord) - { - chat = "Yep! I'm also considering being a space pirate now."; - } - if (Main.rand.Next(5) == 0 && hasPortalGun) + if (Main.rand.NextBool(5) && hasPortalGun) { chat = "Just what is that contraption? It makes my Teleporters look like child's play!"; } + if (Main.rand.NextBool(5) && NPC.downedMoonlord) + { + chat = "Yep! I'm also considering being a space pirate now."; + } + break; + case NPCID.DyeTrader: - int permadong2 = NPC.FindFirstNPC(mod.NPCType("DILF")); - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { chat = "Have you seen those gemstone creatures in the caverns? Their colors are simply breathtaking!"; } - if (Main.rand.Next(5) == 0 && permadong2 != -1) + if (Main.rand.NextBool(5) && permadong != -1) { - chat = "Do you think " + Main.npc[permadong2].GivenName + " knows how to 'let it go?'"; + chat = "Do you think " + Main.npc[permadong].GivenName + " knows how to 'let it go?'"; } break; + case NPCID.TaxCollector: int platinumCoins = 0; for (int k = 0; k < 255; k++) @@ -3512,39 +3473,42 @@ namespace CalamityMod.NPCs { if (player.inventory[j].type == ItemID.PlatinumCoin) { - platinumCoins = player.inventory[j].stack; + platinumCoins += player.inventory[j].stack; } } } } - if (Main.rand.Next(5) == 0 && platinumCoins >= 100) + + if (Main.rand.NextBool(5) && platinumCoins >= 100) { chat = "BAH! Doesn't seem like I'll ever be able to quarrel with the debts of the town again!"; } - if (Main.rand.Next(5) == 0 && platinumCoins >= 500) + if (Main.rand.NextBool(5) && platinumCoins >= 500) { chat = "Where and how are you getting all of this money?"; } - if (Main.rand.Next(5) == 0 && !CalamityWorld.downedBrimstoneElemental) + if (Main.rand.NextBool(5) && !CalamityWorld.downedBrimstoneElemental) { chat = "Perhaps with all that time you've got you could check those old ruins? Certainly something of value in it for you!"; } - if (Main.rand.Next(10) == 0 && CalamityWorld.downedDoG) + if (Main.rand.NextBool(10) && CalamityWorld.downedDoG) { chat = "Devourer of what, you said? Devourer of Funds, if its payroll is anything to go by!"; } break; + case NPCID.Demolitionist: - if (Main.rand.Next(5) == 0 && CalamityWorld.downedDoG) + if (Main.rand.NextBool(5) && CalamityWorld.downedDoG) { chat = "God Slayer Dynamite? Boy do I like the sound of that!"; } break; + default: break; } @@ -3741,21 +3705,23 @@ namespace CalamityMod.NPCs Projectile projectile = Main.projectile[m]; if (projectile.active && projectile.bobber && projectile.owner == plr) { - int num8 = NPC.NewNPC((int)projectile.Center.X, (int)projectile.Center.Y + 100, mod.NPCType("OldDuke"), 0, 0f, 0f, 0f, 0f, 255); + int num8 = NPC.NewNPC((int)projectile.Center.X, (int)projectile.Center.Y + 100, mod.NPCType("OldDuke")); string typeName2 = Main.npc[num8].TypeName; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { - Main.NewText(Language.GetTextValue("Announcement.HasAwoken", typeName2), 175, 75, 255, false); + Main.NewText(Language.GetTextValue("Announcement.HasAwoken", typeName2), new Color(175, 75, 255)); return; } - if (Main.netMode == 2) + + if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasAwoken", new object[] { - Main.npc[num8].GetTypeNetName() - }), new Color(175, 75, 255), -1); + Main.npc[num8].GetTypeNetName() + }), new Color(175, 75, 255)); return; } + break; } else @@ -3771,14 +3737,14 @@ namespace CalamityMod.NPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, dustType, hitDirection * xSpeedMult, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, dustType, hitDirection * xSpeedMult, -1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, dustType, hitDirection * xSpeedMult, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, dustType, hitDirection * xSpeedMult, -1f); } } } @@ -3963,7 +3929,7 @@ namespace CalamityMod.NPCs //update if target dead. if (Main.player[npc.target].dead) { - between.X = (float)npc.direction * chaseMaxSpeed / 2f; + between.X = npc.direction * chaseMaxSpeed / 2f; between.Y = -chaseMaxSpeed / 2f; } npc.spriteDirection = -1; @@ -4103,7 +4069,7 @@ namespace CalamityMod.NPCs npc.netUpdate = true; } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int x = (int)npc.Center.X / 16; int y = (int)npc.Center.Y / 16; @@ -4142,9 +4108,9 @@ namespace CalamityMod.NPCs { npc.width = sitWidth; npc.noGravity = false; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { - if (npc.velocity.X != 0f || npc.velocity.Y < 0f || (double)npc.velocity.Y > 0.3) + if (npc.velocity.X != 0f || npc.velocity.Y < 0f || npc.velocity.Y > 0.3) { npc.ai[0] = 1f; npc.netUpdate = true; @@ -4181,6 +4147,7 @@ namespace CalamityMod.NPCs npc.velocity.X = -2f; } } + if (npc.collideY) { npc.velocity.Y = npc.oldVelocity.Y * -0.5f; @@ -4195,6 +4162,7 @@ namespace CalamityMod.NPCs npc.velocity.Y = -1f; } } + if (npc.direction == -1 && npc.velocity.X > -maxSpeed) { npc.velocity.X -= acceleration; @@ -4231,9 +4199,9 @@ namespace CalamityMod.NPCs npc.velocity.X = maxSpeed; } } + float xDistance = Math.Abs(npc.Center.X - Main.player[npc.target].Center.X); float yLimiter = Main.player[npc.target].position.Y - (npc.height / 2f); - if (xDistance > 50f) { yLimiter -= 100f; diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index 264a86af8c..0f6227aab5 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -105,9 +105,9 @@ namespace CalamityMod.NPCs { string key2 = "Mods.CalamityMod.UglyBossText"; Color messageColor2 = Color.Aquamarine; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) Main.NewText(Language.GetTextValue(key2), messageColor2); - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) NetMessage.BroadcastChatMessage(NetworkText.FromKey(key2), messageColor2); } } @@ -138,9 +138,9 @@ namespace CalamityMod.NPCs Color messageColor = Color.Crimson; if (!NPC.downedMechBoss3 && !CalamityWorld.downedBrimstoneElemental) { - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) Main.NewText(Language.GetTextValue(key), messageColor); - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } } @@ -160,9 +160,9 @@ namespace CalamityMod.NPCs WorldGenerationMethods.SpawnOre(mod.TileType("PerennialOre"), 12E-05, .5f, .7f); - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) Main.NewText(Language.GetTextValue(key2), messageColor2); - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) NetMessage.BroadcastChatMessage(NetworkText.FromKey(key2), messageColor2); } @@ -175,9 +175,9 @@ namespace CalamityMod.NPCs if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active) Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/WyrmScream"), (int)Main.player[Main.myPlayer].position.X, (int)Main.player[Main.myPlayer].position.Y); - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) Main.NewText(Language.GetTextValue(key), messageColor); - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } } @@ -197,12 +197,12 @@ namespace CalamityMod.NPCs string key2 = "Mods.CalamityMod.BabyBossText2"; Color messageColor2 = Color.Yellow; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); Main.NewText(Language.GetTextValue(key2), messageColor2); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); NetMessage.BroadcastChatMessage(NetworkText.FromKey(key2), messageColor2); @@ -242,9 +242,9 @@ namespace CalamityMod.NPCs string key = "Mods.CalamityMod.DeusText"; Color messageColor = Color.Gold; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) Main.NewText(Language.GetTextValue(key), messageColor); - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } } @@ -274,7 +274,7 @@ namespace CalamityMod.NPCs { WorldGenerationMethods.SpawnOre(mod.TileType("ExodiumOre"), 12E-05, .01f, .07f); - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); Main.NewText(Language.GetTextValue(key2), messageColor2); @@ -282,7 +282,7 @@ namespace CalamityMod.NPCs Main.NewText(Language.GetTextValue(key4), messageColor4); Main.NewText(Language.GetTextValue(key5), messageColor5); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); NetMessage.BroadcastChatMessage(NetworkText.FromKey(key2), messageColor2); @@ -383,9 +383,9 @@ namespace CalamityMod.NPCs string key = "Mods.CalamityMod.BossRushTierThreeEndText"; Color messageColor = Color.LightCoral; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) Main.NewText(Language.GetTextValue(key), messageColor); - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } else if (npc.type == mod.NPCType("ScavengerBody")) @@ -415,9 +415,9 @@ namespace CalamityMod.NPCs string key = "Mods.CalamityMod.BossRushTierFourEndText"; Color messageColor = Color.LightCoral; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) Main.NewText(Language.GetTextValue(key), messageColor); - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } else if (npc.type == mod.NPCType("Siren") || npc.type == mod.NPCType("Leviathan")) @@ -473,7 +473,7 @@ namespace CalamityMod.NPCs CalamityWorld.bossRushActive = false; CalamityMod.UpdateServerBoolean(); - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { var netMessage = mod.GetPacket(); netMessage.Write((byte)CalamityModMessageType.BossRushStage); @@ -483,9 +483,9 @@ namespace CalamityMod.NPCs string key = "Mods.CalamityMod.BossRushTierFiveEndText"; Color messageColor = Color.LightCoral; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) Main.NewText(Language.GetTextValue(key), messageColor); - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); return false; } @@ -522,9 +522,9 @@ namespace CalamityMod.NPCs string key = "Mods.CalamityMod.BossRushTierOneEndText"; Color messageColor = Color.LightCoral; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) Main.NewText(Language.GetTextValue(key), messageColor); - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); break; case NPCID.Spazmatism: @@ -549,9 +549,9 @@ namespace CalamityMod.NPCs string key2 = "Mods.CalamityMod.BossRushTierTwoEndText"; Color messageColor2 = Color.LightCoral; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) Main.NewText(Language.GetTextValue(key2), messageColor2); - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) NetMessage.BroadcastChatMessage(NetworkText.FromKey(key2), messageColor2); break; case NPCID.Plantera: @@ -570,7 +570,7 @@ namespace CalamityMod.NPCs break; } - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { var netMessage = mod.GetPacket(); netMessage.Write((byte)CalamityModMessageType.BossRushStage); @@ -639,7 +639,7 @@ namespace CalamityMod.NPCs npc.type != mod.NPCType("StormWeaverTail") && npc.type != mod.NPCType("DevourerofGodsHead") && npc.type != mod.NPCType("DevourerofGodsBody") && npc.type != mod.NPCType("DevourerofGodsTail")) { - if (Main.netMode != 2) + if (Main.netMode != NetmodeID.Server) { if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active) Main.player[Main.myPlayer].GetModPlayer(mod).adrenaline = 0; @@ -963,9 +963,9 @@ namespace CalamityMod.NPCs string key = "Mods.CalamityMod.GhostBossText2"; Color messageColor = Color.Cyan; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) Main.NewText(Language.GetTextValue(key), messageColor); - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } else if (CalamityMod.ghostKillCount == 20) @@ -973,13 +973,13 @@ namespace CalamityMod.NPCs string key = "Mods.CalamityMod.GhostBossText3"; Color messageColor = Color.Cyan; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) Main.NewText(Language.GetTextValue(key), messageColor); - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } - if (CalamityMod.ghostKillCount >= 30 && Main.netMode != 1) + if (CalamityMod.ghostKillCount >= 30 && Main.netMode != NetmodeID.MultiplayerClient) { int lastPlayer = npc.lastInteraction; @@ -1002,9 +1002,9 @@ namespace CalamityMod.NPCs string key = "Mods.CalamityMod.SandSharkText"; Color messageColor = Color.Goldenrod; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) Main.NewText(Language.GetTextValue(key), messageColor); - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } else if (CalamityMod.sharkKillCount == 8) @@ -1012,12 +1012,12 @@ namespace CalamityMod.NPCs string key = "Mods.CalamityMod.SandSharkText2"; Color messageColor = Color.Goldenrod; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) Main.NewText(Language.GetTextValue(key), messageColor); - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } - if (CalamityMod.sharkKillCount >= 10 && Main.netMode != 1) + if (CalamityMod.sharkKillCount >= 10 && Main.netMode != NetmodeID.MultiplayerClient) { if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active) { @@ -1046,9 +1046,9 @@ namespace CalamityMod.NPCs string key = "Mods.CalamityMod.DeusText2"; Color messageColor = Color.Gold; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) Main.NewText(Language.GetTextValue(key), messageColor); - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } else if (CalamityMod.astralKillCount == 2) @@ -1056,12 +1056,12 @@ namespace CalamityMod.NPCs string key = "Mods.CalamityMod.DeusText3"; Color messageColor = Color.Gold; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) Main.NewText(Language.GetTextValue(key), messageColor); - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } - if (CalamityMod.astralKillCount >= 3 && Main.netMode != 1) + if (CalamityMod.astralKillCount >= 3 && Main.netMode != NetmodeID.MultiplayerClient) { int lastPlayer = npc.lastInteraction; diff --git a/NPCs/CeaselessVoid/CeaselessVoid.cs b/NPCs/CeaselessVoid/CeaselessVoid.cs index 046e87800a..4270fa2744 100644 --- a/NPCs/CeaselessVoid/CeaselessVoid.cs +++ b/NPCs/CeaselessVoid/CeaselessVoid.cs @@ -115,7 +115,7 @@ namespace CalamityMod.NPCs.CeaselessVoid { npc.velocity = new Vector2(0f, -10f); CalamityWorld.DoGSecondStageCountdown = 0; - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { var netMessage = mod.GetPacket(); netMessage.Write((byte)CalamityModMessageType.DoGCountdownSync); @@ -190,7 +190,7 @@ namespace CalamityMod.NPCs.CeaselessVoid } } } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { beamPortal += expertMode ? 2 : 1; beamPortal += shootBoost; @@ -293,7 +293,7 @@ namespace CalamityMod.NPCs.CeaselessVoid } if (npc.life > 0) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int num660 = (int)((double)npc.lifeMax * 0.26); if ((float)(npc.life + num660) < bossLife) @@ -353,7 +353,7 @@ namespace CalamityMod.NPCs.CeaselessVoid else if (CalamityWorld.DoGSecondStageCountdown > 14460) { CalamityWorld.DoGSecondStageCountdown = 14460; - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { var netMessage = mod.GetPacket(); netMessage.Write((byte)CalamityModMessageType.DoGCountdownSync); @@ -376,7 +376,7 @@ namespace CalamityMod.NPCs.CeaselessVoid { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 173, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 173, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -388,9 +388,9 @@ namespace CalamityMod.NPCs.CeaselessVoid npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -398,10 +398,10 @@ namespace CalamityMod.NPCs.CeaselessVoid } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } float randomSpread = (float)(Main.rand.Next(-200, 200) / 100); diff --git a/NPCs/CeaselessVoid/DarkEnergy.cs b/NPCs/CeaselessVoid/DarkEnergy.cs index 528c59f14e..c0fd1e4f66 100644 --- a/NPCs/CeaselessVoid/DarkEnergy.cs +++ b/NPCs/CeaselessVoid/DarkEnergy.cs @@ -147,7 +147,7 @@ namespace CalamityMod.NPCs.CeaselessVoid npc.velocity.Y = npc.velocity.Y * 1.05f; //1.05f npc.velocity.X = npc.velocity.X * 1.05f; //1.05f } - if (Main.netMode != 1 && ((expertMode && Main.rand.Next(50) == 0) || Main.rand.Next(100) == 0)) + if (Main.netMode != NetmodeID.MultiplayerClient && ((expertMode && Main.rand.NextBool(50)) || Main.rand.NextBool(100))) { npc.TargetClosest(true); vector96 = new Vector2(npc.Center.X, npc.Center.Y); @@ -198,7 +198,7 @@ namespace CalamityMod.NPCs.CeaselessVoid { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 173, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 173, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/CeaselessVoid/DarkEnergy2.cs b/NPCs/CeaselessVoid/DarkEnergy2.cs index 682db2598a..09d5240184 100644 --- a/NPCs/CeaselessVoid/DarkEnergy2.cs +++ b/NPCs/CeaselessVoid/DarkEnergy2.cs @@ -158,7 +158,7 @@ namespace CalamityMod.NPCs.CeaselessVoid { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 173, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 173, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/CeaselessVoid/DarkEnergy3.cs b/NPCs/CeaselessVoid/DarkEnergy3.cs index 40cf26c103..a78e0d0adf 100644 --- a/NPCs/CeaselessVoid/DarkEnergy3.cs +++ b/NPCs/CeaselessVoid/DarkEnergy3.cs @@ -185,7 +185,7 @@ namespace CalamityMod.NPCs.CeaselessVoid { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 173, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 173, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/CosmicWraith/CosmicLantern.cs b/NPCs/CosmicWraith/CosmicLantern.cs index afa6fbe9c7..2bb0b87006 100644 --- a/NPCs/CosmicWraith/CosmicLantern.cs +++ b/NPCs/CosmicWraith/CosmicLantern.cs @@ -64,7 +64,7 @@ namespace CalamityMod.NPCs.CosmicWraith if (npc.alpha < 0) { npc.alpha = 0; - int num1262 = Dust.NewDust(npc.position, npc.width, npc.height, 204, 0f, 0f, 0, default(Color), 0.25f); + int num1262 = Dust.NewDust(npc.position, npc.width, npc.height, 204, 0f, 0f, 0, default, 0.25f); Main.dust[num1262].velocity *= 0.1f; Main.dust[num1262].noGravity = true; } @@ -121,7 +121,7 @@ namespace CalamityMod.NPCs.CosmicWraith { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 204, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 204, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/CosmicWraith/CosmicWraith.cs b/NPCs/CosmicWraith/CosmicWraith.cs index 9cb9937924..2be8a1348a 100644 --- a/NPCs/CosmicWraith/CosmicWraith.cs +++ b/NPCs/CosmicWraith/CosmicWraith.cs @@ -152,7 +152,7 @@ namespace CalamityMod.NPCs.CosmicWraith { if (Main.rand.Next(3) < 1) { - int num1012 = Dust.NewDust(npc.Center - new Vector2(70f), 70 * 2, 70 * 2, 173, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default(Color), 1.5f); + int num1012 = Dust.NewDust(npc.Center - new Vector2(70f), 70 * 2, 70 * 2, 173, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default, 1.5f); Main.dust[num1012].noGravity = true; Main.dust[num1012].velocity *= 0.2f; Main.dust[num1012].fadeIn = 1f; @@ -162,7 +162,7 @@ namespace CalamityMod.NPCs.CosmicWraith if (Vector2.Distance(player.Center, vectorCenter) > 6400f) { CalamityWorld.DoGSecondStageCountdown = 0; - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { var netMessage = mod.GetPacket(); netMessage.Write((byte)CalamityModMessageType.DoGCountdownSync); @@ -187,7 +187,7 @@ namespace CalamityMod.NPCs.CosmicWraith CosmicCountdown--; if (CosmicCountdown == 0) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int speed2 = revenge ? 13 : 12; if (npc.GetGlobalNPC(mod).enraged || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive)) @@ -253,7 +253,7 @@ namespace CalamityMod.NPCs.CosmicWraith if (npc.ai[0] == 0f) { npc.chaseable = true; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[1] += 1f; if (npc.localAI[1] >= 120f) @@ -272,12 +272,12 @@ namespace CalamityMod.NPCs.CosmicWraith int min = 12; int max = 15; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) num1250 += Main.rand.Next(min, max); else num1250 -= Main.rand.Next(min, max); - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) num1251 += Main.rand.Next(min, max); else num1251 -= Main.rand.Next(min, max); @@ -321,32 +321,32 @@ namespace CalamityMod.NPCs.CosmicWraith if (npc.alpha <= lifeToAlpha) { Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 122); - if (Main.netMode != 1 && revenge) + if (Main.netMode != NetmodeID.MultiplayerClient && revenge) { int num660 = NPC.NewNPC((int)(Main.player[npc.target].position.X + 750f), (int)(Main.player[npc.target].position.Y), mod.NPCType("SignusBomb"), 0, 0f, 0f, 0f, 0f, 255); - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { NetMessage.SendData(23, -1, -1, null, num660, 0f, 0f, 0f, 0, 0, 0); } int num661 = NPC.NewNPC((int)(Main.player[npc.target].position.X - 750f), (int)(Main.player[npc.target].position.Y), mod.NPCType("SignusBomb"), 0, 0f, 0f, 0f, 0f, 255); - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { NetMessage.SendData(23, -1, -1, null, num661, 0f, 0f, 0f, 0, 0, 0); } for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(Main.player[npc.target].position.X + 750f, Main.player[npc.target].position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(Main.player[npc.target].position.X + 750f, Main.player[npc.target].position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; Main.dust[num622].noGravity = true; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; } - int num623 = Dust.NewDust(new Vector2(Main.player[npc.target].position.X - 750f, Main.player[npc.target].position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + int num623 = Dust.NewDust(new Vector2(Main.player[npc.target].position.X - 750f, Main.player[npc.target].position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num623].velocity *= 3f; Main.dust[num623].noGravity = true; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num623].scale = 0.5f; Main.dust[num623].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -354,15 +354,15 @@ namespace CalamityMod.NPCs.CosmicWraith } for (int num623 = 0; num623 < 20; num623++) { - int num624 = Dust.NewDust(new Vector2(Main.player[npc.target].position.X + 750f, Main.player[npc.target].position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(Main.player[npc.target].position.X + 750f, Main.player[npc.target].position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(Main.player[npc.target].position.X + 750f, Main.player[npc.target].position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(Main.player[npc.target].position.X + 750f, Main.player[npc.target].position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; - int num625 = Dust.NewDust(new Vector2(Main.player[npc.target].position.X - 750f, Main.player[npc.target].position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 3f); + int num625 = Dust.NewDust(new Vector2(Main.player[npc.target].position.X - 750f, Main.player[npc.target].position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); Main.dust[num625].noGravity = true; Main.dust[num625].velocity *= 5f; - num625 = Dust.NewDust(new Vector2(Main.player[npc.target].position.X - 750f, Main.player[npc.target].position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + num625 = Dust.NewDust(new Vector2(Main.player[npc.target].position.X - 750f, Main.player[npc.target].position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num625].velocity *= 2f; } } @@ -413,7 +413,7 @@ namespace CalamityMod.NPCs.CosmicWraith } if (flag104) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { float num1070 = 15f; //changed from 10 if (npc.GetGlobalNPC(mod).enraged || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive)) @@ -508,19 +508,19 @@ namespace CalamityMod.NPCs.CosmicWraith { npc.dontTakeDamage = false; npc.chaseable = true; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (NPC.CountNPCS(mod.NPCType("CosmicLantern")) < 5) { for (int x = 0; x < 5; x++) { int num660 = NPC.NewNPC((int)(Main.player[npc.target].position.X + (float)spawnX), (int)(Main.player[npc.target].position.Y + (float)spawnY), mod.NPCType("CosmicLantern"), 0, 0f, 0f, 0f, 0f, 255); - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { NetMessage.SendData(23, -1, -1, null, num660, 0f, 0f, 0f, 0, 0, 0); } int num661 = NPC.NewNPC((int)(Main.player[npc.target].position.X - (float)spawnX), (int)(Main.player[npc.target].position.Y + (float)spawnY), mod.NPCType("CosmicLantern"), 0, 0f, 0f, 0f, 0f, 255); - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { NetMessage.SendData(23, -1, -1, null, num661, 0f, 0f, 0f, 0, 0, 0); } @@ -604,7 +604,7 @@ namespace CalamityMod.NPCs.CosmicWraith } else if (chargeSwitch == 2) //charging { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { dustTimer--; if (cosmicDust && dustTimer <= 0) @@ -790,7 +790,7 @@ namespace CalamityMod.NPCs.CosmicWraith if (CalamityWorld.DoGSecondStageCountdown > 600) { CalamityWorld.DoGSecondStageCountdown = 600; - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { var netMessage = mod.GetPacket(); netMessage.Write((byte)CalamityModMessageType.DoGCountdownSync); @@ -814,7 +814,7 @@ namespace CalamityMod.NPCs.CosmicWraith { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 173, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 173, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -826,9 +826,9 @@ namespace CalamityMod.NPCs.CosmicWraith npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -836,10 +836,10 @@ namespace CalamityMod.NPCs.CosmicWraith } for (int num623 = 0; num623 < 60; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } float randomSpread = (float)(Main.rand.Next(-200, 200) / 100); diff --git a/NPCs/CosmicWraith/SignusBomb.cs b/NPCs/CosmicWraith/SignusBomb.cs index 8a99178468..65ee85b303 100644 --- a/NPCs/CosmicWraith/SignusBomb.cs +++ b/NPCs/CosmicWraith/SignusBomb.cs @@ -154,9 +154,9 @@ namespace CalamityMod.NPCs.CosmicWraith npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 15; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -165,10 +165,10 @@ namespace CalamityMod.NPCs.CosmicWraith } for (int num623 = 0; num623 < 30; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; Main.dust[num624].noGravity = true; } diff --git a/NPCs/Crabulon/CrabShroom.cs b/NPCs/Crabulon/CrabShroom.cs index 2fbd7424dd..2292cbde86 100644 --- a/NPCs/Crabulon/CrabShroom.cs +++ b/NPCs/Crabulon/CrabShroom.cs @@ -82,13 +82,13 @@ namespace CalamityMod.NPCs.Crabulon { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 56, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 56, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 56, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 56, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Crabulon/CrabulonIdle.cs b/NPCs/Crabulon/CrabulonIdle.cs index 846ffab5f7..115e82938a 100644 --- a/NPCs/Crabulon/CrabulonIdle.cs +++ b/NPCs/Crabulon/CrabulonIdle.cs @@ -105,7 +105,7 @@ namespace CalamityMod.NPCs.Crabulon float num351 = (float)Math.Sqrt((double)(num349 * num349 + num350 * num350)); num349 *= num351; num350 *= num351; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int num352 = 1; npc.localAI[3] += 2f; @@ -179,7 +179,7 @@ namespace CalamityMod.NPCs.Crabulon } if (npc.ai[0] == 0f) { - if (Main.netMode != 2) + if (Main.netMode != NetmodeID.Server) { if (!player.dead && player.active && (player.Center - npc.Center).Length() < 800f) { @@ -347,14 +347,14 @@ namespace CalamityMod.NPCs.Crabulon if (npc.velocity.Y == 0f) { Main.PlaySound(SoundID.Item14, npc.position); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { Projectile.NewProjectile((int)npc.Center.X, (int)npc.Center.Y + 20, 0f, 0f, mod.ProjectileType("Mushmash"), 20, 0f, Main.myPlayer, 0f, 0f); } npc.ai[2] += 1f; if (npc.ai[2] >= 3f) { - if (Main.netMode != 1 && revenge) + if (Main.netMode != NetmodeID.MultiplayerClient && revenge) { for (int x = 0; x < 20; x++) { @@ -375,7 +375,7 @@ namespace CalamityMod.NPCs.Crabulon { for (int num623 = 0; num623 < 4; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X - 20f, npc.position.Y + (float)npc.height), npc.width + 20, 4, 56, 0f, 0f, 100, default(Color), 1.5f); + int num624 = Dust.NewDust(new Vector2(npc.position.X - 20f, npc.position.Y + (float)npc.height), npc.width + 20, 4, 56, 0f, 0f, 100, default, 1.5f); Main.dust[num624].velocity *= 0.2f; } } @@ -436,7 +436,7 @@ namespace CalamityMod.NPCs.Crabulon } if (npc.life > 0) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int num660 = (int)((double)npc.lifeMax * 0.05); if ((float)(npc.life + num660) < npc.localAI[0]) @@ -452,7 +452,7 @@ namespace CalamityMod.NPCs.Crabulon Main.npc[num664].SetDefaults(num663, -1f); Main.npc[num664].velocity.X = (float)Main.rand.Next(-50, 51) * 0.1f; Main.npc[num664].velocity.Y = (float)Main.rand.Next(-50, -31) * 0.1f; - if (Main.netMode == 2 && num664 < 200) + if (Main.netMode == NetmodeID.Server && num664 < 200) { NetMessage.SendData(23, -1, -1, null, num664, 0f, 0f, 0f, 0, 0, 0); } @@ -531,7 +531,7 @@ namespace CalamityMod.NPCs.Crabulon { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 56, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 56, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -543,9 +543,9 @@ namespace CalamityMod.NPCs.Crabulon npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 56, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 56, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -553,10 +553,10 @@ namespace CalamityMod.NPCs.Crabulon } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 56, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 56, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 56, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 56, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } float randomSpread = (float)(Main.rand.Next(-200, 200) / 100); diff --git a/NPCs/Cryogen/Cryocore.cs b/NPCs/Cryogen/Cryocore.cs index 1efa733050..3b9e2bd0b8 100644 --- a/NPCs/Cryogen/Cryocore.cs +++ b/NPCs/Cryogen/Cryocore.cs @@ -106,13 +106,13 @@ namespace CalamityMod.NPCs.Cryogen { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 67, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 67, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 67, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 67, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Cryocore"), 1f); } diff --git a/NPCs/Cryogen/Cryocore2.cs b/NPCs/Cryogen/Cryocore2.cs index 44b8ab9ebd..755d1e8e5f 100644 --- a/NPCs/Cryogen/Cryocore2.cs +++ b/NPCs/Cryogen/Cryocore2.cs @@ -106,13 +106,13 @@ namespace CalamityMod.NPCs.Cryogen { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 67, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 67, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 67, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 67, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Cryocore2"), 1f); } diff --git a/NPCs/Cryogen/Cryogen.cs b/NPCs/Cryogen/Cryogen.cs index ac033d209d..396a1981cc 100644 --- a/NPCs/Cryogen/Cryogen.cs +++ b/NPCs/Cryogen/Cryogen.cs @@ -108,7 +108,7 @@ namespace CalamityMod.NPCs.Cryogen bool expertMode = (Main.expertMode || CalamityWorld.bossRushActive); bool revenge = (CalamityWorld.revenge || CalamityWorld.bossRushActive); npc.TargetClosest(true); - if (npc.ai[2] == 0f && npc.localAI[1] == 0f && Main.netMode != 1 && npc.ai[0] < 4f) //spawn shield for phase 0 1 2 3, not 4 5 + if (npc.ai[2] == 0f && npc.localAI[1] == 0f && Main.netMode != NetmodeID.MultiplayerClient && npc.ai[0] < 4f) //spawn shield for phase 0 1 2 3, not 4 5 { int num6 = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("CryogenIce"), npc.whoAmI, 0f, 0f, 0f, 0f, 255); npc.ai[2] = (float)(num6 + 1); @@ -165,7 +165,7 @@ namespace CalamityMod.NPCs.Cryogen { npc.timeLeft = 2400; } - if (Main.netMode != 1 && expertMode) + if (Main.netMode != NetmodeID.MultiplayerClient && expertMode) { time++; if (CalamityWorld.death || CalamityWorld.bossRushActive) @@ -192,7 +192,7 @@ namespace CalamityMod.NPCs.Cryogen } if (npc.ai[0] == 0f) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[0] += 1f; if (npc.localAI[0] >= 120f) @@ -245,7 +245,7 @@ namespace CalamityMod.NPCs.Cryogen } else if (npc.ai[0] == 1f) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[0] += 1f; if (npc.localAI[0] >= 120f) @@ -329,7 +329,7 @@ namespace CalamityMod.NPCs.Cryogen npc.velocity.Y = npc.velocity.Y - num1165 * 2f; } } - if (npc.position.X + (float)npc.width > player.position.X && npc.position.X < player.position.X + (float)player.width && npc.position.Y + (float)npc.height < player.position.Y && Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height) && Main.netMode != 1) + if (npc.position.X + (float)npc.width > player.position.X && npc.position.X < player.position.X + (float)player.width && npc.position.Y + (float)npc.height < player.position.Y && Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height) && Main.netMode != NetmodeID.MultiplayerClient) { iceShard += 4; if (iceShard > 8) @@ -351,7 +351,7 @@ namespace CalamityMod.NPCs.Cryogen } else if (npc.ai[0] == 2f) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[0] += 1f; if (npc.localAI[0] >= 120f) @@ -361,7 +361,7 @@ namespace CalamityMod.NPCs.Cryogen npc.netUpdate = true; if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); float spread = 45f * 0.0174f; @@ -437,7 +437,7 @@ namespace CalamityMod.NPCs.Cryogen } else if (npc.ai[0] == 3f) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[0] += 1f; if (npc.localAI[0] >= 120f) @@ -528,7 +528,7 @@ namespace CalamityMod.NPCs.Cryogen npc.velocity.Y = npc.velocity.Y - num1165 * 2f; } } - if (npc.position.X + (float)npc.width > player.position.X && npc.position.X < player.position.X + (float)player.width && npc.position.Y + (float)npc.height < player.position.Y && Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height) && Main.netMode != 1) + if (npc.position.X + (float)npc.width > player.position.X && npc.position.X < player.position.X + (float)player.width && npc.position.Y + (float)npc.height < player.position.Y && Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height) && Main.netMode != NetmodeID.MultiplayerClient) { iceShard += 4; if (iceShard > 8) @@ -551,7 +551,7 @@ namespace CalamityMod.NPCs.Cryogen } else if (npc.ai[0] == 4f) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[0] += 1f; if (npc.localAI[0] >= 60f && npc.alpha == 0) @@ -597,7 +597,7 @@ namespace CalamityMod.NPCs.Cryogen { npc.chaseable = true; npc.dontTakeDamage = false; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[2] += 1f; if (npc.localAI[2] >= 180f) @@ -616,12 +616,12 @@ namespace CalamityMod.NPCs.Cryogen int min = 14; int max = 18; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) num1250 += Main.rand.Next(min, max); else num1250 -= Main.rand.Next(min, max); - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) num1251 += Main.rand.Next(min, max); else num1251 -= Main.rand.Next(min, max); @@ -677,9 +677,9 @@ namespace CalamityMod.NPCs.Cryogen drawAltTexture = true; for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 67, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 67, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -687,10 +687,10 @@ namespace CalamityMod.NPCs.Cryogen } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 67, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 67, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 67, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 67, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } float randomSpread = (float)(Main.rand.Next(-200, 200) / 100); @@ -706,11 +706,11 @@ namespace CalamityMod.NPCs.Cryogen npc.netUpdate = true; string key = "Mods.CalamityMod.CryogenBossText"; Color messageColor = Color.Cyan; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -813,7 +813,7 @@ namespace CalamityMod.NPCs.Cryogen } if (npc.life > 0) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int num660 = (int)((double)npc.lifeMax * 0.05); if ((float)(npc.life + num660) < npc.ai[3]) @@ -837,7 +837,7 @@ namespace CalamityMod.NPCs.Cryogen randomSpawn = mod.NPCType("Cryocore2"); } int num664 = NPC.NewNPC(x, y, randomSpawn, 0, 0f, 0f, 0f, 0f, 255); - if (Main.netMode == 2 && num664 < 200) + if (Main.netMode == NetmodeID.Server && num664 < 200) { NetMessage.SendData(23, -1, -1, null, num664, 0f, 0f, 0f, 0, 0, 0); } @@ -869,15 +869,15 @@ namespace CalamityMod.NPCs.Cryogen { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 67, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 67, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 67, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 67, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -885,10 +885,10 @@ namespace CalamityMod.NPCs.Cryogen } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 67, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 67, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 67, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 67, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } float randomSpread = (float)(Main.rand.Next(-200, 200) / 100); @@ -903,44 +903,44 @@ namespace CalamityMod.NPCs.Cryogen int num = 86400; int num2 = num / 24; Main.rainTime = Main.rand.Next(num2 * 8, num); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Main.rainTime += Main.rand.Next(0, num2); } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Main.rainTime += Main.rand.Next(0, num2 * 2); } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Main.rainTime += Main.rand.Next(0, num2 * 2); } - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) { Main.rainTime += Main.rand.Next(0, num2 * 3); } - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { Main.rainTime += Main.rand.Next(0, num2 * 4); } - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { Main.rainTime += Main.rand.Next(0, num2 * 5); } float num3 = 1f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { num3 += 0.05f; } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { num3 += 0.1f; } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { num3 += 0.15f; } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { num3 += 0.2f; } @@ -992,7 +992,7 @@ namespace CalamityMod.NPCs.Cryogen // Spawn Permafrost if he isn't in the world int permafrostNPC = NPC.FindFirstNPC(mod.NPCType("DILF")); - if (permafrostNPC == -1 && Main.netMode != 1) + if (permafrostNPC == -1 && Main.netMode != NetmodeID.MultiplayerClient) { NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("DILF"), 0, 0f, 0f, 0f, 0f, 255); } @@ -1004,9 +1004,9 @@ namespace CalamityMod.NPCs.Cryogen Color messageColor = Color.LightSkyBlue; WorldGenerationMethods.SpawnOre(mod.TileType("CryonicOre"), 15E-05, .45f, .65f); - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) Main.NewText(Language.GetTextValue(key), messageColor); - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } diff --git a/NPCs/Cryogen/CryogenIce.cs b/NPCs/Cryogen/CryogenIce.cs index c10ae8a5b1..8c1a7115fa 100644 --- a/NPCs/Cryogen/CryogenIce.cs +++ b/NPCs/Cryogen/CryogenIce.cs @@ -81,15 +81,15 @@ namespace CalamityMod.NPCs.Cryogen { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 67, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 67, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int num621 = 0; num621 < 25; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 67, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 67, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -97,10 +97,10 @@ namespace CalamityMod.NPCs.Cryogen } for (int num623 = 0; num623 < 50; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 67, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 67, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 67, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 67, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); diff --git a/NPCs/Cryogen/IceMass.cs b/NPCs/Cryogen/IceMass.cs index 2c0d3cf0eb..4cc8a31bd1 100644 --- a/NPCs/Cryogen/IceMass.cs +++ b/NPCs/Cryogen/IceMass.cs @@ -54,13 +54,13 @@ namespace CalamityMod.NPCs.Cryogen { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 67, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 67, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 67, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 67, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CryoSpirit"), 1f); } diff --git a/NPCs/DesertScourge/DesertScourgeBody.cs b/NPCs/DesertScourge/DesertScourgeBody.cs index c3804d49a1..482322e34b 100644 --- a/NPCs/DesertScourge/DesertScourgeBody.cs +++ b/NPCs/DesertScourge/DesertScourgeBody.cs @@ -94,7 +94,7 @@ namespace CalamityMod.NPCs.DesertScourge npc.alpha = 0; } } - if (Main.netMode != 1 && (CalamityWorld.revenge || CalamityWorld.bossRushActive)) + if (Main.netMode != NetmodeID.MultiplayerClient && (CalamityWorld.revenge || CalamityWorld.bossRushActive)) { npc.localAI[0] += (float)Main.rand.Next(4); if (npc.GetGlobalNPC(mod).enraged || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive)) @@ -119,7 +119,7 @@ namespace CalamityMod.NPCs.DesertScourge num943 *= num944; vector104.X += num942 * 5f; vector104.Y += num943 * 5f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, projectileType, damage, 0f, Main.myPlayer, 0f, 0f); } @@ -144,11 +144,11 @@ namespace CalamityMod.NPCs.DesertScourge int wormCount = 5; if (npc.life <= (npc.lifeMax * 0.75f) && NPC.CountNPCS(mod.NPCType("DriedSeekerHead")) < wormCount) { - if (Main.rand.Next(10) == 0 && Main.netMode != 1) + if (Main.rand.NextBool(10) && Main.netMode != NetmodeID.MultiplayerClient) { Vector2 spawnAt = npc.Center + new Vector2(0f, (float)npc.height / 2f); int seeker = NPC.NewNPC((int)spawnAt.X, (int)spawnAt.Y, mod.NPCType("DriedSeekerHead")); - if (Main.netMode == 2 && seeker < 200) + if (Main.netMode == NetmodeID.Server && seeker < 200) { NetMessage.SendData(23, -1, -1, null, seeker, 0f, 0f, 0f, 0, 0, 0); } @@ -157,7 +157,7 @@ namespace CalamityMod.NPCs.DesertScourge } for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -167,7 +167,7 @@ namespace CalamityMod.NPCs.DesertScourge Gore.NewGore(npc.position, npc.velocity * randomSpread * Main.rand.NextFloat(), mod.GetGoreSlot("Gores/ScourgeBody3"), 1f); for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/DesertScourge/DesertScourgeBodySmall.cs b/NPCs/DesertScourge/DesertScourgeBodySmall.cs index 94e860d990..e97f205ecd 100644 --- a/NPCs/DesertScourge/DesertScourgeBodySmall.cs +++ b/NPCs/DesertScourge/DesertScourgeBodySmall.cs @@ -79,7 +79,7 @@ namespace CalamityMod.NPCs.DesertScourge { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -89,7 +89,7 @@ namespace CalamityMod.NPCs.DesertScourge Gore.NewGore(npc.position, npc.velocity * randomSpread * Main.rand.NextFloat(), mod.GetGoreSlot("Gores/ScourgeBody3"), 0.65f); for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/DesertScourge/DesertScourgeHead.cs b/NPCs/DesertScourge/DesertScourgeHead.cs index 96509a943d..9ccf41fa8d 100644 --- a/NPCs/DesertScourge/DesertScourgeHead.cs +++ b/NPCs/DesertScourge/DesertScourgeHead.cs @@ -113,7 +113,7 @@ namespace CalamityMod.NPCs.DesertScourge { npc.alpha = 0; } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (!TailSpawned && npc.ai[0] == 0f) { @@ -503,9 +503,9 @@ namespace CalamityMod.NPCs.DesertScourge { string key = "Mods.CalamityMod.OpenSunkenSea"; Color messageColor = Color.Aquamarine; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) Main.NewText(Language.GetTextValue(key), messageColor); - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -519,7 +519,7 @@ namespace CalamityMod.NPCs.DesertScourge { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -527,7 +527,7 @@ namespace CalamityMod.NPCs.DesertScourge Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScourgeHead2"), 1f); for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/DesertScourge/DesertScourgeHeadSmall.cs b/NPCs/DesertScourge/DesertScourgeHeadSmall.cs index 51a0022aab..0d6e3137e5 100644 --- a/NPCs/DesertScourge/DesertScourgeHeadSmall.cs +++ b/NPCs/DesertScourge/DesertScourgeHeadSmall.cs @@ -387,7 +387,7 @@ namespace CalamityMod.NPCs.DesertScourge { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -395,7 +395,7 @@ namespace CalamityMod.NPCs.DesertScourge Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScourgeHead2"), 0.65f); for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/DesertScourge/DesertScourgeTail.cs b/NPCs/DesertScourge/DesertScourgeTail.cs index 39916b4f94..3904cb9b5a 100644 --- a/NPCs/DesertScourge/DesertScourgeTail.cs +++ b/NPCs/DesertScourge/DesertScourgeTail.cs @@ -99,14 +99,14 @@ namespace CalamityMod.NPCs.DesertScourge { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScourgeTail"), 1f); for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/DesertScourge/DesertScourgeTailSmall.cs b/NPCs/DesertScourge/DesertScourgeTailSmall.cs index efc1a4ad3e..9426ef6440 100644 --- a/NPCs/DesertScourge/DesertScourgeTailSmall.cs +++ b/NPCs/DesertScourge/DesertScourgeTailSmall.cs @@ -69,14 +69,14 @@ namespace CalamityMod.NPCs.DesertScourge { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScourgeTail"), 0.65f); for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/DesertScourge/DriedSeekerBody.cs b/NPCs/DesertScourge/DriedSeekerBody.cs index 76659ff397..53eee105d1 100644 --- a/NPCs/DesertScourge/DriedSeekerBody.cs +++ b/NPCs/DesertScourge/DriedSeekerBody.cs @@ -63,13 +63,13 @@ namespace CalamityMod.NPCs.DesertScourge { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/DesertScourge/DriedSeekerHead.cs b/NPCs/DesertScourge/DriedSeekerHead.cs index d60cc816f7..00cae820c0 100644 --- a/NPCs/DesertScourge/DriedSeekerHead.cs +++ b/NPCs/DesertScourge/DriedSeekerHead.cs @@ -89,13 +89,13 @@ namespace CalamityMod.NPCs.DesertScourge { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/DesertScourge/DriedSeekerTail.cs b/NPCs/DesertScourge/DriedSeekerTail.cs index 4b14c7e766..c00f08580c 100644 --- a/NPCs/DesertScourge/DriedSeekerTail.cs +++ b/NPCs/DesertScourge/DriedSeekerTail.cs @@ -58,13 +58,13 @@ namespace CalamityMod.NPCs.DesertScourge { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/GreatSandShark/GreatSandShark.cs b/NPCs/GreatSandShark/GreatSandShark.cs index 660d29a4dc..22122ae70f 100644 --- a/NPCs/GreatSandShark/GreatSandShark.cs +++ b/NPCs/GreatSandShark/GreatSandShark.cs @@ -331,7 +331,7 @@ namespace CalamityMod.NPCs.GreatSandShark { spawnFlag = false; } - if (spawnFlag && Main.netMode != 1) + if (spawnFlag && Main.netMode != NetmodeID.MultiplayerClient) { NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y + 50, NPCID.SandShark, 0, 0f, 0f, 0f, 0f, 255); Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/GreatSandSharkRoar"), (int)npc.position.X, (int)npc.position.Y); @@ -444,10 +444,10 @@ namespace CalamityMod.NPCs.GreatSandShark npc.localAI[0] = -1f; for (int num621 = 0; num621 < 25; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 32, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 32, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity.Y *= 6f; Main.dust[num622].velocity.X *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -455,10 +455,10 @@ namespace CalamityMod.NPCs.GreatSandShark } for (int num623 = 0; num623 < 50; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 85, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 85, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity.Y *= 10f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 268, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 268, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity.X *= 2f; } int spawnX = (int)(npc.width / 2); @@ -637,15 +637,15 @@ namespace CalamityMod.NPCs.GreatSandShark { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int num621 = 0; num621 < 50; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -653,10 +653,10 @@ namespace CalamityMod.NPCs.GreatSandShark } for (int num623 = 0; num623 < 100; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } @@ -665,7 +665,7 @@ namespace CalamityMod.NPCs.GreatSandShark public override void NPCLoot() { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrandScale")); - if (Main.expertMode && Main.rand.Next(3) == 0) + if (Main.expertMode && Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrandScale")); } diff --git a/NPCs/HiveMind/DankCreeper.cs b/NPCs/HiveMind/DankCreeper.cs index 5851b7c3a2..f47dc813b9 100644 --- a/NPCs/HiveMind/DankCreeper.cs +++ b/NPCs/HiveMind/DankCreeper.cs @@ -91,13 +91,13 @@ namespace CalamityMod.NPCs.HiveMind { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 13, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 13, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 13, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 13, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HiveMindGores/DankCreeperGore"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HiveMindGores/DankCreeperGore2"), 1f); @@ -107,7 +107,7 @@ namespace CalamityMod.NPCs.HiveMind public override void NPCLoot() { - if (Main.expertMode && Main.netMode != 1) + if (Main.expertMode && Main.netMode != NetmodeID.MultiplayerClient) { Projectile.NewProjectile(npc.Center.X, npc.Center.Y, 0f, 0f, mod.ProjectileType("ShadeNimbusHostile"), 14, 0f, Main.myPlayer, 0f, 0f); } diff --git a/NPCs/HiveMind/DarkHeart.cs b/NPCs/HiveMind/DarkHeart.cs index 9e56219096..a98db07d48 100644 --- a/NPCs/HiveMind/DarkHeart.cs +++ b/NPCs/HiveMind/DarkHeart.cs @@ -97,7 +97,7 @@ namespace CalamityMod.NPCs.HiveMind npc.velocity.Y = npc.velocity.Y - num1165 * 2f; } } - if (npc.position.X + (float)npc.width > Main.player[npc.target].position.X && npc.position.X < Main.player[npc.target].position.X + (float)Main.player[npc.target].width && npc.position.Y + (float)npc.height < Main.player[npc.target].position.Y && Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height) && Main.netMode != 1) + if (npc.position.X + (float)npc.width > Main.player[npc.target].position.X && npc.position.X < Main.player[npc.target].position.X + (float)Main.player[npc.target].width && npc.position.Y + (float)npc.height < Main.player[npc.target].position.Y && Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height) && Main.netMode != NetmodeID.MultiplayerClient) { npc.ai[0] += 4f; if (npc.ai[0] > 16f) @@ -124,13 +124,13 @@ namespace CalamityMod.NPCs.HiveMind { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 14, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 14, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 14, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 14, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/HiveMind/HiveBlob.cs b/NPCs/HiveMind/HiveBlob.cs index d78bee6827..1f86973c36 100644 --- a/NPCs/HiveMind/HiveBlob.cs +++ b/NPCs/HiveMind/HiveBlob.cs @@ -51,7 +51,7 @@ namespace CalamityMod.NPCs.HiveMind { num750 = (int)npc.ai[3] - 1; } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[0] -= 1f; if (npc.localAI[0] <= 0f) @@ -151,7 +151,7 @@ namespace CalamityMod.NPCs.HiveMind { npc.velocity.Y = -4f; } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (!Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { @@ -204,13 +204,13 @@ namespace CalamityMod.NPCs.HiveMind { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 14, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 14, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 14, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 14, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/HiveMind/HiveBlob2.cs b/NPCs/HiveMind/HiveBlob2.cs index e7352fa93f..9254041d1f 100644 --- a/NPCs/HiveMind/HiveBlob2.cs +++ b/NPCs/HiveMind/HiveBlob2.cs @@ -51,7 +51,7 @@ namespace CalamityMod.NPCs.HiveMind { num750 = (int)npc.ai[3] - 1; } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[0] -= 1f; if (npc.localAI[0] <= 0f) @@ -151,7 +151,7 @@ namespace CalamityMod.NPCs.HiveMind { npc.velocity.Y = -4f; } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (!Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { @@ -204,13 +204,13 @@ namespace CalamityMod.NPCs.HiveMind { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 14, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 14, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 14, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 14, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/HiveMind/HiveCyst.cs b/NPCs/HiveMind/HiveCyst.cs index 05f40feabf..5facf7d0a4 100644 --- a/NPCs/HiveMind/HiveCyst.cs +++ b/NPCs/HiveMind/HiveCyst.cs @@ -56,15 +56,15 @@ namespace CalamityMod.NPCs.HiveMind { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 14, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 14, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 14, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 14, hitDirection, -1f, 0, default, 1f); } - if (Main.netMode != 1 && NPC.CountNPCS(mod.NPCType("HiveMind")) < 1) + if (Main.netMode != NetmodeID.MultiplayerClient && NPC.CountNPCS(mod.NPCType("HiveMind")) < 1) { Vector2 spawnAt = npc.Center + new Vector2(0f, (float)npc.height / 2f); NPC.NewNPC((int)spawnAt.X, (int)spawnAt.Y, mod.NPCType("HiveMind")); diff --git a/NPCs/HiveMind/HiveMind.cs b/NPCs/HiveMind/HiveMind.cs index 498b520df6..a0215daf95 100644 --- a/NPCs/HiveMind/HiveMind.cs +++ b/NPCs/HiveMind/HiveMind.cs @@ -109,7 +109,7 @@ namespace CalamityMod.NPCs.HiveMind bool expertMode = (Main.expertMode || CalamityWorld.bossRushActive); bool revenge = (CalamityWorld.revenge || CalamityWorld.bossRushActive); CalamityGlobalNPC.hiveMind = npc.whoAmI; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (revenge) { @@ -156,7 +156,7 @@ namespace CalamityMod.NPCs.HiveMind } if (npc.life > 0) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int num660 = (int)((double)npc.lifeMax * 0.25); if ((float)(npc.life + num660) < npc.ai[3]) @@ -168,7 +168,7 @@ namespace CalamityMod.NPCs.HiveMind int x = (int)(npc.position.X + (float)Main.rand.Next(npc.width - 32)); int y = (int)(npc.position.Y + (float)Main.rand.Next(npc.height - 32)); int num663 = mod.NPCType("HiveBlob"); - if (Main.rand.Next(3) == 0 || npc.GetGlobalNPC(mod).enraged || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive)) + if (Main.rand.NextBool(3) || npc.GetGlobalNPC(mod).enraged || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive)) { num663 = mod.NPCType("DankCreeper"); } @@ -176,7 +176,7 @@ namespace CalamityMod.NPCs.HiveMind Main.npc[num664].SetDefaults(num663, -1f); Main.npc[num664].velocity.X = (float)Main.rand.Next(-15, 16) * 0.1f; Main.npc[num664].velocity.Y = (float)Main.rand.Next(-30, 1) * 0.1f; - if (Main.netMode == 2 && num664 < 200) + if (Main.netMode == NetmodeID.Server && num664 < 200) { NetMessage.SendData(23, -1, -1, null, num664, 0f, 0f, 0f, 0, 0, 0); } @@ -198,26 +198,26 @@ namespace CalamityMod.NPCs.HiveMind { npc.scale += 0.0165f; npc.alpha -= 4; - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.Center.Y), npc.width, npc.height / 2, 14, 0f, -3f, 100, default(Color), 2.5f * npc.scale); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.Center.Y), npc.width, npc.height / 2, 14, 0f, -3f, 100, default, 2.5f * npc.scale); Main.dust[num622].velocity *= 2f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; } for (int i = 0; i < 2; i++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.Center.Y), npc.width, npc.height / 2, 14, 0f, -3f, 100, default(Color), 3.5f * npc.scale); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.Center.Y), npc.width, npc.height / 2, 14, 0f, -3f, 100, default, 3.5f * npc.scale); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 3.5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.Center.Y), npc.width, npc.height / 2, 14, 0f, -3f, 100, default(Color), 2.5f * npc.scale); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.Center.Y), npc.width, npc.height / 2, 14, 0f, -3f, 100, default, 2.5f * npc.scale); Main.dust[num624].velocity *= 1f; } } else if (burrowTimer == -60) { npc.scale = 0.01f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.Center = player.Center; npc.position.Y = player.position.Y - npc.height; @@ -239,19 +239,19 @@ namespace CalamityMod.NPCs.HiveMind { npc.scale -= 0.0165f; npc.alpha += 4; - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.Center.Y), npc.width, npc.height / 2, 14, 0f, -3f, 100, default(Color), 2.5f * npc.scale); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.Center.Y), npc.width, npc.height / 2, 14, 0f, -3f, 100, default, 2.5f * npc.scale); Main.dust[num622].velocity *= 2f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; } for (int i = 0; i < 2; i++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.Center.Y), npc.width, npc.height / 2, 14, 0f, -3f, 100, default(Color), 3.5f * npc.scale); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.Center.Y), npc.width, npc.height / 2, 14, 0f, -3f, 100, default, 3.5f * npc.scale); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 3.5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.Center.Y), npc.width, npc.height / 2, 14, 0f, -3f, 100, default(Color), 2.5f * npc.scale); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.Center.Y), npc.width, npc.height / 2, 14, 0f, -3f, 100, default, 2.5f * npc.scale); Main.dust[num624].velocity *= 1f; } } @@ -282,12 +282,12 @@ namespace CalamityMod.NPCs.HiveMind { if (NPC.CountNPCS(NPCID.EaterofSouls) < 3 && NPC.CountNPCS(NPCID.DevourerHead) < 1) { - if (Main.rand.Next(60) == 0 && Main.netMode != 1) + if (Main.rand.NextBool(60) && Main.netMode != NetmodeID.MultiplayerClient) { Vector2 spawnAt = npc.Center + new Vector2(0f, (float)npc.height / 2f); NPC.NewNPC((int)spawnAt.X, (int)spawnAt.Y, NPCID.EaterofSouls); } - if (Main.rand.Next(150) == 0 && Main.netMode != 1) + if (Main.rand.NextBool(150) && Main.netMode != NetmodeID.MultiplayerClient) { Vector2 spawnAt = npc.Center + new Vector2(0f, (float)npc.height / 2f); NPC.NewNPC((int)spawnAt.X, (int)spawnAt.Y, NPCID.DevourerHead); @@ -296,7 +296,7 @@ namespace CalamityMod.NPCs.HiveMind int num285 = 0; while ((double)num285 < damage / (double)npc.lifeMax * 100.0) { - Dust.NewDust(npc.position, npc.width, npc.height, 14, (float)hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 14, (float)hitDirection, -1f, 0, default, 1f); num285++; } } @@ -306,7 +306,7 @@ namespace CalamityMod.NPCs.HiveMind Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HiveMindGores/HiveMindGore2"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HiveMindGores/HiveMindGore3"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HiveMindGores/HiveMindGore4"), 1f); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (NPC.CountNPCS(mod.NPCType("HiveMindP2")) < 1) { diff --git a/NPCs/HiveMind/HiveMindP2.cs b/NPCs/HiveMind/HiveMindP2.cs index dd32b7e72a..0652a06378 100644 --- a/NPCs/HiveMind/HiveMindP2.cs +++ b/NPCs/HiveMind/HiveMindP2.cs @@ -255,7 +255,7 @@ namespace CalamityMod.NPCs.HiveMind } else { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) SpawnStuff(); state = nextState; nextState = 0; @@ -303,7 +303,7 @@ namespace CalamityMod.NPCs.HiveMind } else { - if (CalamityWorld.revenge && (Main.rand.Next(4) == 0 || reelCount == 3)) + if (CalamityWorld.revenge && (Main.rand.NextBool(4) || reelCount == 3)) { reelCount = 0; nextState = 2; @@ -375,7 +375,7 @@ namespace CalamityMod.NPCs.HiveMind npc.alpha = 255; npc.velocity = Vector2.Zero; state = 0; - if (Main.netMode != 1 && npc.ai[1] != 0f && npc.ai[2] != 0f) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[1] != 0f && npc.ai[2] != 0f) { npc.position.X = npc.ai[1] * 16 - npc.width / 2; npc.position.Y = npc.ai[2] * 16 - npc.height / 2; @@ -387,8 +387,8 @@ namespace CalamityMod.NPCs.HiveMind { for (int i = 0; i < 10; i++) { - int posX = (int)player.Center.X / 16 + Main.rand.Next(15, 46) * (Main.rand.Next(2) == 0 ? -1 : 1); - int posY = (int)player.Center.Y / 16 + Main.rand.Next(15, 46) * (Main.rand.Next(2) == 0 ? -1 : 1); + int posX = (int)player.Center.X / 16 + Main.rand.Next(15, 46) * (Main.rand.NextBool(2) ? -1 : 1); + int posY = (int)player.Center.Y / 16 + Main.rand.Next(15, 46) * (Main.rand.NextBool(2) ? -1 : 1); if (!WorldGen.SolidTile(posX, posY) && Collision.CanHit(new Vector2(posX * 16, posY * 16), 1, 1, player.position, player.width, player.height)) { npc.ai[1] = posX; @@ -430,7 +430,7 @@ namespace CalamityMod.NPCs.HiveMind if (npc.alpha > 0) { npc.alpha -= lungeFade; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.Center = player.Center + new Vector2(teleportRadius, 0).RotatedBy(rotation); } @@ -453,7 +453,7 @@ namespace CalamityMod.NPCs.HiveMind } else { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.Center = player.Center + new Vector2(teleportRadius, 0).RotatedBy(rotation); } @@ -475,7 +475,7 @@ namespace CalamityMod.NPCs.HiveMind if (npc.alpha > 0) { npc.alpha -= 5; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.Center = player.Center; npc.position.Y += teleportRadius; @@ -500,7 +500,7 @@ namespace CalamityMod.NPCs.HiveMind { phase2timer = 0; npc.ai[0]++; - if (Main.netMode != 1 && Collision.CanHit(npc.Center, 1, 1, player.position, player.width, player.height)) //draw line of sight + if (Main.netMode != NetmodeID.MultiplayerClient && Collision.CanHit(npc.Center, 1, 1, player.position, player.width, player.height)) //draw line of sight { if (npc.ai[0] == 2 || npc.ai[0] == 4) { @@ -530,7 +530,7 @@ namespace CalamityMod.NPCs.HiveMind if (npc.alpha > 0) { npc.alpha -= 5; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.Center = player.Center; npc.position.Y -= teleportRadius; @@ -555,7 +555,7 @@ namespace CalamityMod.NPCs.HiveMind { phase2timer = 0; npc.ai[0]++; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int damage = Main.expertMode ? 14 : 18; Projectile.NewProjectile(npc.position.X + Main.rand.Next(npc.width), npc.position.Y + Main.rand.Next(npc.height), 0, 0, mod.ProjectileType("ShadeNimbusHostile"), damage, 0, Main.myPlayer, 11, 0); @@ -616,9 +616,9 @@ namespace CalamityMod.NPCs.HiveMind { for (int k = 0; k < damage / npc.lifeMax * 100.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 14, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 14, hitDirection, -1f, 0, default, 1f); } - if (Main.netMode != 1 && Main.rand.Next(15) == 0 && NPC.CountNPCS(mod.NPCType("HiveBlob2")) < 2) + if (Main.netMode != NetmodeID.MultiplayerClient && Main.rand.NextBool(15) && NPC.CountNPCS(mod.NPCType("HiveBlob2")) < 2) { Vector2 spawnAt = npc.Center + new Vector2(0f, (float)npc.height / 2f); NPC.NewNPC((int)spawnAt.X, (int)spawnAt.Y, mod.NPCType("HiveBlob2")); @@ -639,9 +639,9 @@ namespace CalamityMod.NPCs.HiveMind npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 14, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 14, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -649,10 +649,10 @@ namespace CalamityMod.NPCs.HiveMind } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 14, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 14, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 14, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 14, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } @@ -701,9 +701,9 @@ namespace CalamityMod.NPCs.HiveMind Color messageColor = Color.Cyan; WorldGenerationMethods.SpawnOre(mod.TileType("AerialiteOre"), 12E-05, .4f, .6f); - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) Main.NewText(Language.GetTextValue(key), messageColor); - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } diff --git a/NPCs/Leviathan/AquaticAberration.cs b/NPCs/Leviathan/AquaticAberration.cs index c44ba4cd5a..2ad5ea440b 100644 --- a/NPCs/Leviathan/AquaticAberration.cs +++ b/NPCs/Leviathan/AquaticAberration.cs @@ -90,7 +90,7 @@ namespace CalamityMod.NPCs.Leviathan { if (Main.rand.Next(3) < num1009) { - int num1012 = Dust.NewDust(npc.Center - new Vector2((float)num1010), num1010 * 2, num1010 * 2, 33, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default(Color), 1.5f); + int num1012 = Dust.NewDust(npc.Center - new Vector2((float)num1010), num1010 * 2, num1010 * 2, 33, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default, 1.5f); Main.dust[num1012].noGravity = true; Main.dust[num1012].velocity *= 0.2f; Main.dust[num1012].fadeIn = 1f; @@ -208,13 +208,13 @@ namespace CalamityMod.NPCs.Leviathan { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index c79bd34ab2..625c36b777 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -113,7 +113,7 @@ namespace CalamityMod.NPCs.Leviathan { soundChoice = 40; } - if (Main.rand.Next(600) == 0) + if (Main.rand.NextBool(600)) { Main.PlaySound(29, (int)npc.position.X, (int)npc.position.Y, ((sirenAlive && !CalamityWorld.death && !CalamityWorld.bossRushActive) ? soundChoice : soundChoiceRage)); @@ -246,7 +246,7 @@ namespace CalamityMod.NPCs.Leviathan vector40 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); num415 = player.position.X + (float)(player.width / 2) - vector40.X; num416 = player.position.Y + (float)(player.height / 2) - vector40.Y; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { float num418 = sirenAlive ? 13.5f : 16f; int num419 = 48; @@ -299,7 +299,7 @@ namespace CalamityMod.NPCs.Leviathan if (Collision.CanHit(vector119, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height) && flag103) { Main.PlaySound(29, (int)npc.position.X, (int)npc.position.Y, soundChoice); - if (Main.netMode != 1 && NPC.CountNPCS(mod.NPCType("Parasea")) < spawnLimit2 && NPC.CountNPCS(mod.NPCType("AquaticAberration")) < spawnLimit) + if (Main.netMode != NetmodeID.MultiplayerClient && NPC.CountNPCS(mod.NPCType("Parasea")) < spawnLimit2 && NPC.CountNPCS(mod.NPCType("AquaticAberration")) < spawnLimit) { int num1061; int value = CalamityWorld.death ? 2 : 3; @@ -395,9 +395,9 @@ namespace CalamityMod.NPCs.Leviathan int num24 = 7; for (int j = 0; j < num24; j++) { - Vector2 arg_E1C_0 = (Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f).RotatedBy((double)(j - (num24 / 2 - 1)) * 3.1415926535897931 / (double)((float)num24), default(Vector2)) + vector; + Vector2 arg_E1C_0 = (Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f).RotatedBy((double)(j - (num24 / 2 - 1)) * 3.1415926535897931 / (double)((float)num24), default) + vector; Vector2 vector4 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); - int num25 = Dust.NewDust(arg_E1C_0 + vector4, 0, 0, 172, vector4.X * 2f, vector4.Y * 2f, 100, default(Color), 1.4f); + int num25 = Dust.NewDust(arg_E1C_0 + vector4, 0, 0, 172, vector4.X * 2f, vector4.Y * 2f, 100, default, 1.4f); Main.dust[num25].noGravity = true; Main.dust[num25].noLight = true; Main.dust[num25].velocity /= 4f; @@ -540,7 +540,7 @@ namespace CalamityMod.NPCs.Leviathan { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -550,9 +550,9 @@ namespace CalamityMod.NPCs.Leviathan npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -560,10 +560,10 @@ namespace CalamityMod.NPCs.Leviathan } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } float randomSpread = (float)(Main.rand.Next(-200, 200) / 100); diff --git a/NPCs/Leviathan/LeviathanStart.cs b/NPCs/Leviathan/LeviathanStart.cs index 35b13a41d1..53d409e8ba 100644 --- a/NPCs/Leviathan/LeviathanStart.cs +++ b/NPCs/Leviathan/LeviathanStart.cs @@ -85,9 +85,9 @@ namespace CalamityMod.NPCs.Leviathan public override void NPCLoot() { - if (CalamityWorld.revenge && Main.rand.Next(4) == 0) + if (CalamityWorld.revenge && Main.rand.NextBool(4)) { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, (Main.rand.Next(2) == 0 ? mod.ItemType("SirensHeart") : mod.ItemType("SirensHeartAlt"))); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, (Main.rand.NextBool(2) ? mod.ItemType("SirensHeart") : mod.ItemType("SirensHeartAlt"))); } } @@ -97,16 +97,16 @@ namespace CalamityMod.NPCs.Leviathan { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } } else { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 67, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 67, hitDirection, -1f, 0, default, 1f); } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { NPC.NewNPC((int)npc.Center.X, (int)npc.position.Y + npc.height, mod.NPCType("Siren"), npc.whoAmI, 0f, 0f, 0f, 0f, 255); } diff --git a/NPCs/Leviathan/Parasea.cs b/NPCs/Leviathan/Parasea.cs index 6a1fee997a..75479c3dda 100644 --- a/NPCs/Leviathan/Parasea.cs +++ b/NPCs/Leviathan/Parasea.cs @@ -78,13 +78,13 @@ namespace CalamityMod.NPCs.Leviathan { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Leviathan/Siren.cs b/NPCs/Leviathan/Siren.cs index 47bc716c47..08689c5cfe 100644 --- a/NPCs/Leviathan/Siren.cs +++ b/NPCs/Leviathan/Siren.cs @@ -126,7 +126,7 @@ namespace CalamityMod.NPCs.Leviathan leviAlive = Main.npc[CalamityGlobalNPC.leviathan].active; // Spawn Leviathan and Clones, change music - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (phase2 || CalamityWorld.death || CalamityWorld.bossRushActive) { @@ -165,7 +165,7 @@ namespace CalamityMod.NPCs.Leviathan npc.defense = 25; // Ice Shield - if (npc.ai[3] == 0f && npc.localAI[1] == 0f && Main.netMode != 1) + if (npc.ai[3] == 0f && npc.localAI[1] == 0f && Main.netMode != NetmodeID.MultiplayerClient) { int num6 = NPC.NewNPC((int)vector.X, (int)vector.Y, mod.NPCType("SirenIce"), npc.whoAmI, 0f, 0f, 0f, 0f, 255); npc.ai[3] = (float)(num6 + 1); @@ -204,7 +204,7 @@ namespace CalamityMod.NPCs.Leviathan } // Play sound - if (Main.rand.Next(300) == 0) + if (Main.rand.NextBool(300)) Main.PlaySound(29, (int)npc.position.X, (int)npc.position.Y, 35); // Count number of players nearby @@ -340,7 +340,7 @@ namespace CalamityMod.NPCs.Leviathan if (Collision.CanHit(vector119, 1, 1, player.position, player.width, player.height) && flag103) { Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 85); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int num1061 = 371; int num1062 = NPC.NewNPC((int)vector119.X, (int)vector119.Y - 30, num1061, 0, 0f, 0f, 0f, 0f, 255); @@ -432,7 +432,7 @@ namespace CalamityMod.NPCs.Leviathan if (flag104 && (npc.position.Y + (float)npc.height < player.position.Y || (!leviAlive && phase2)) && Collision.CanHit(vector121, 1, 1, player.position, player.width, player.height)) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { float num1070 = revenge ? 13f : 11f; if (npc.GetGlobalNPC(mod).enraged || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive)) @@ -557,9 +557,9 @@ namespace CalamityMod.NPCs.Leviathan int num24 = 7; for (int j = 0; j < num24; j++) { - Vector2 arg_E1C_0 = (Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f).RotatedBy((double)(j - (num24 / 2 - 1)) * 3.1415926535897931 / (double)((float)num24), default(Vector2)) + vector; + Vector2 arg_E1C_0 = (Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f).RotatedBy((double)(j - (num24 / 2 - 1)) * 3.1415926535897931 / (double)((float)num24), default) + vector; Vector2 vector4 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); - int num25 = Dust.NewDust(arg_E1C_0 + vector4, 0, 0, 172, vector4.X * 2f, vector4.Y * 2f, 100, default(Color), 1.4f); + int num25 = Dust.NewDust(arg_E1C_0 + vector4, 0, 0, 172, vector4.X * 2f, vector4.Y * 2f, 100, default, 1.4f); Main.dust[num25].noGravity = true; Main.dust[num25].noLight = true; Main.dust[num25].velocity /= 4f; @@ -702,7 +702,7 @@ namespace CalamityMod.NPCs.Leviathan public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 3; k++) - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); if (npc.life <= 0) { @@ -713,7 +713,7 @@ namespace CalamityMod.NPCs.Leviathan Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SirenGores/Siren5"), 1f); for (int k = 0; k < 50; k++) - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } } diff --git a/NPCs/Leviathan/SirenClone.cs b/NPCs/Leviathan/SirenClone.cs index a95c9c2c89..8f3f22a504 100644 --- a/NPCs/Leviathan/SirenClone.cs +++ b/NPCs/Leviathan/SirenClone.cs @@ -66,7 +66,7 @@ namespace CalamityMod.NPCs.Leviathan if (npc.ai[0] > 45f) { npc.ai[0] = 0f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int damage = Main.expertMode ? 26 : 32; Projectile.NewProjectile(center.X, center.Y, direction.X, direction.Y, mod.ProjectileType("WaterSpear"), damage, 0f, npc.target); @@ -89,13 +89,13 @@ namespace CalamityMod.NPCs.Leviathan { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 67, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 67, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Leviathan/SirenIce.cs b/NPCs/Leviathan/SirenIce.cs index e8a3df8514..dd504b7862 100644 --- a/NPCs/Leviathan/SirenIce.cs +++ b/NPCs/Leviathan/SirenIce.cs @@ -87,13 +87,13 @@ namespace CalamityMod.NPCs.Leviathan { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 67, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 67, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 25; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 67, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 67, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/AeroSlime.cs b/NPCs/NormalNPCs/AeroSlime.cs index 6c0bbd1990..eba95c3a1d 100644 --- a/NPCs/NormalNPCs/AeroSlime.cs +++ b/NPCs/NormalNPCs/AeroSlime.cs @@ -50,13 +50,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 59, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 59, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/AngryDog.cs b/NPCs/NormalNPCs/AngryDog.cs index 8467883e86..a0e236de6c 100644 --- a/NPCs/NormalNPCs/AngryDog.cs +++ b/NPCs/NormalNPCs/AngryDog.cs @@ -55,7 +55,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void AI() { - if (Main.rand.Next(900) == 0) + if (Main.rand.NextBool(900)) { Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/AngryDogGrowl"), (int)npc.position.X, (int)npc.position.Y); } @@ -145,7 +145,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.velocity.Y = npc.velocity.Y - 4f; for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 33, 0f, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 33, 0f, -1f, 0, default, 1f); } } if (npc.ai[3] < (float)num) @@ -640,24 +640,24 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } } } public override void NPCLoot() { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Leather, Main.rand.Next(1, 3)); } - if (Main.rand.Next(100) == 0) + if (Main.rand.NextBool(100)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Cryophobia")); } diff --git a/NPCs/NormalNPCs/ArmoredDiggerBody.cs b/NPCs/NormalNPCs/ArmoredDiggerBody.cs index 4ea59cd36d..f860fee5ba 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerBody.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerBody.cs @@ -69,7 +69,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.HitEffect(0, 10.0); npc.checkDead(); } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[0] += (float)Main.rand.Next(4); if (npc.localAI[0] >= (float)Main.rand.Next(1800, 26000)) @@ -133,13 +133,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/ArmoredDiggerHead.cs b/NPCs/NormalNPCs/ArmoredDiggerHead.cs index 7869f8a86f..19616909e7 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerHead.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerHead.cs @@ -52,7 +52,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.TargetClosest(true); } npc.velocity.Length(); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (!TailSpawned) { @@ -395,24 +395,24 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default, 1f); } } } public override void NPCLoot() { - if (Main.rand.Next(40) == 0) + if (Main.rand.NextBool(40)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LeadWizard")); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DraedonsRemote")); } diff --git a/NPCs/NormalNPCs/ArmoredDiggerTail.cs b/NPCs/NormalNPCs/ArmoredDiggerTail.cs index a119fe642d..7d8719da38 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerTail.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerTail.cs @@ -122,13 +122,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/BlightedEye.cs b/NPCs/NormalNPCs/BlightedEye.cs index 8a47861f46..91cb1a19ee 100644 --- a/NPCs/NormalNPCs/BlightedEye.cs +++ b/NPCs/NormalNPCs/BlightedEye.cs @@ -35,13 +35,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } } } @@ -62,7 +62,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BlightedLens")); } diff --git a/NPCs/NormalNPCs/BloomSlime.cs b/NPCs/NormalNPCs/BloomSlime.cs index 478bf2bde4..3743a21767 100644 --- a/NPCs/NormalNPCs/BloomSlime.cs +++ b/NPCs/NormalNPCs/BloomSlime.cs @@ -50,13 +50,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 75, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 75, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 75, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 75, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/Bohldohr.cs b/NPCs/NormalNPCs/Bohldohr.cs index acfcfa0c89..ececfd4dd1 100644 --- a/NPCs/NormalNPCs/Bohldohr.cs +++ b/NPCs/NormalNPCs/Bohldohr.cs @@ -328,13 +328,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 155, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 155, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 155, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 155, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/CalamityEye.cs b/NPCs/NormalNPCs/CalamityEye.cs index a20f31409a..f508d4e14a 100644 --- a/NPCs/NormalNPCs/CalamityEye.cs +++ b/NPCs/NormalNPCs/CalamityEye.cs @@ -36,13 +36,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } } } @@ -64,11 +64,11 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BlightedLens")); } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Lens); } diff --git a/NPCs/NormalNPCs/CharredSlime.cs b/NPCs/NormalNPCs/CharredSlime.cs index 04062e0641..31c467bf39 100644 --- a/NPCs/NormalNPCs/CharredSlime.cs +++ b/NPCs/NormalNPCs/CharredSlime.cs @@ -47,13 +47,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/Cnidrion.cs b/NPCs/NormalNPCs/Cnidrion.cs index 9c1a25227e..cd9c9cf42b 100644 --- a/NPCs/NormalNPCs/Cnidrion.cs +++ b/NPCs/NormalNPCs/Cnidrion.cs @@ -81,7 +81,7 @@ namespace CalamityMod.NPCs.NormalNPCs { npc.ai[1] += 1f; } - if (npc.ai[1] >= 300f && Main.netMode != 1) + if (npc.ai[1] >= 300f && Main.netMode != NetmodeID.MultiplayerClient) { npc.ai[1] = 0f; if ((double)npc.life < (double)npc.lifeMax * 0.25) @@ -274,13 +274,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 40; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 2f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 2f); } } } @@ -291,9 +291,9 @@ namespace CalamityMod.NPCs.NormalNPCs Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Starfish, Main.rand.Next(1, 4)); Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Seashell, Main.rand.Next(1, 4)); Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("VictoryShard"), Main.rand.Next(1, 4)); - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { - if (Main.rand.Next(25) == 0) + if (Main.rand.NextBool(25)) Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TheTransformer")); else Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AmidiasSpark")); diff --git a/NPCs/NormalNPCs/CosmicElemental.cs b/NPCs/NormalNPCs/CosmicElemental.cs index 7c2dd7ef8b..f9bc766892 100644 --- a/NPCs/NormalNPCs/CosmicElemental.cs +++ b/NPCs/NormalNPCs/CosmicElemental.cs @@ -55,46 +55,46 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 70, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 70, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 70, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 70, hitDirection, -1f, 0, default, 1f); } } } public override void NPCLoot() { - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.BoneSword); } - if (Main.rand.Next(50) == 0) + if (Main.rand.NextBool(50)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Starfury); } - if (Main.rand.Next(100) == 0) + if (Main.rand.NextBool(100)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.EnchantedSword); } - if (Main.rand.Next(1000) == 0) + if (Main.rand.NextBool(1000)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Arkhalis); } if (CalamityWorld.defiled) { - if (Main.rand.Next(20) == 0) + if (Main.rand.NextBool(20)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Starfury); } - if (Main.rand.Next(20) == 0) + if (Main.rand.NextBool(20)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.EnchantedSword); } - if (Main.rand.Next(20) == 0) + if (Main.rand.NextBool(20)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Arkhalis); } diff --git a/NPCs/NormalNPCs/CrawlerAmber.cs b/NPCs/NormalNPCs/CrawlerAmber.cs index a393232737..c3b96e5147 100644 --- a/NPCs/NormalNPCs/CrawlerAmber.cs +++ b/NPCs/NormalNPCs/CrawlerAmber.cs @@ -252,13 +252,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 32, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 32, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 32, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 32, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/CrawlerAmethyst.cs b/NPCs/NormalNPCs/CrawlerAmethyst.cs index 22eef65da1..67068b68f1 100644 --- a/NPCs/NormalNPCs/CrawlerAmethyst.cs +++ b/NPCs/NormalNPCs/CrawlerAmethyst.cs @@ -252,13 +252,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 70, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 70, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 70, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 70, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/CrawlerCrystal.cs b/NPCs/NormalNPCs/CrawlerCrystal.cs index 4d680d4998..3db18a7143 100644 --- a/NPCs/NormalNPCs/CrawlerCrystal.cs +++ b/NPCs/NormalNPCs/CrawlerCrystal.cs @@ -252,13 +252,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default, 1f); } } } @@ -266,7 +266,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.CrystalShard, Main.rand.Next(2, 5)); - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CrystalBlade")); } diff --git a/NPCs/NormalNPCs/CrawlerDiamond.cs b/NPCs/NormalNPCs/CrawlerDiamond.cs index dfb447a666..ac4bf8d9a8 100644 --- a/NPCs/NormalNPCs/CrawlerDiamond.cs +++ b/NPCs/NormalNPCs/CrawlerDiamond.cs @@ -252,13 +252,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 91, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 91, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 91, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 91, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/CrawlerEmerald.cs b/NPCs/NormalNPCs/CrawlerEmerald.cs index 6815afaf2e..f990b1229b 100644 --- a/NPCs/NormalNPCs/CrawlerEmerald.cs +++ b/NPCs/NormalNPCs/CrawlerEmerald.cs @@ -252,13 +252,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 89, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 89, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 89, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 89, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/CrawlerRuby.cs b/NPCs/NormalNPCs/CrawlerRuby.cs index 2310d93573..0bb9101981 100644 --- a/NPCs/NormalNPCs/CrawlerRuby.cs +++ b/NPCs/NormalNPCs/CrawlerRuby.cs @@ -252,13 +252,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 12, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 12, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 12, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 12, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/CrawlerSapphire.cs b/NPCs/NormalNPCs/CrawlerSapphire.cs index b92b905156..8945e13f8e 100644 --- a/NPCs/NormalNPCs/CrawlerSapphire.cs +++ b/NPCs/NormalNPCs/CrawlerSapphire.cs @@ -252,13 +252,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/CrawlerTopaz.cs b/NPCs/NormalNPCs/CrawlerTopaz.cs index ce81fa6cd7..4a5d38a4f9 100644 --- a/NPCs/NormalNPCs/CrawlerTopaz.cs +++ b/NPCs/NormalNPCs/CrawlerTopaz.cs @@ -252,13 +252,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 147, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 147, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 147, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 147, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/CrimulanBlightSlime.cs b/NPCs/NormalNPCs/CrimulanBlightSlime.cs index 65086b9ead..7b4746a3eb 100644 --- a/NPCs/NormalNPCs/CrimulanBlightSlime.cs +++ b/NPCs/NormalNPCs/CrimulanBlightSlime.cs @@ -49,13 +49,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 40; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } } } @@ -70,7 +70,7 @@ namespace CalamityMod.NPCs.NormalNPCs { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EbonianGel"), Main.rand.Next(15, 17)); Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Gel, Main.rand.Next(10, 15)); - if (Main.rand.Next(100) == 0 && NPC.downedBoss3) + if (Main.rand.NextBool(100) && NPC.downedBoss3) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Carnage")); } diff --git a/NPCs/NormalNPCs/CryoSlime.cs b/NPCs/NormalNPCs/CryoSlime.cs index 8e7c4f672e..d922292a26 100644 --- a/NPCs/NormalNPCs/CryoSlime.cs +++ b/NPCs/NormalNPCs/CryoSlime.cs @@ -50,13 +50,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("MSparkle"), hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("MSparkle"), hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("MSparkle"), hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("MSparkle"), hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/Cryon.cs b/NPCs/NormalNPCs/Cryon.cs index d164a757d9..a77b960ce5 100644 --- a/NPCs/NormalNPCs/Cryon.cs +++ b/NPCs/NormalNPCs/Cryon.cs @@ -351,7 +351,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void OnHitPlayer(Player player, int damage, bool crit) { player.AddBuff(BuffID.Frostburn, 300, true); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.AddBuff(mod.BuffType("GlacialState"), 30, true); } @@ -361,20 +361,20 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 92, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 92, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 15; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 92, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 92, hitDirection, -1f, 0, default, 1f); } } } public override void NPCLoot() { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofEleum")); } diff --git a/NPCs/NormalNPCs/EbonianBlightSlime.cs b/NPCs/NormalNPCs/EbonianBlightSlime.cs index 6e63636ed1..67d8bbf0c9 100644 --- a/NPCs/NormalNPCs/EbonianBlightSlime.cs +++ b/NPCs/NormalNPCs/EbonianBlightSlime.cs @@ -40,13 +40,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 14, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 14, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 40; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 14, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 14, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/Eidolist.cs b/NPCs/NormalNPCs/Eidolist.cs index e4c3fb341e..bb20838cff 100644 --- a/NPCs/NormalNPCs/Eidolist.cs +++ b/NPCs/NormalNPCs/Eidolist.cs @@ -126,7 +126,7 @@ namespace CalamityMod.NPCs.NormalNPCs if (npc.localAI[1] == 1f) { npc.localAI[1] = 0f; - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { npc.ai[0] = (float)num1447; } @@ -138,7 +138,7 @@ namespace CalamityMod.NPCs.NormalNPCs Vector2 vector251 = Main.player[npc.target].Center - value53; bool flag104 = Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].Center, 1, 1); npc.localAI[0] += 1f; - if (Main.netMode != 1 && npc.localAI[0] >= 300f) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] >= 300f) { npc.localAI[0] = 0f; if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) @@ -224,7 +224,7 @@ namespace CalamityMod.NPCs.NormalNPCs int var_9_48E3C_cp_1 = 0; num244 = var_9_48E3C_cp_0[var_9_48E3C_cp_1]; var_9_48E3C_cp_0[var_9_48E3C_cp_1] = num244 + 1f; - if (npc.ai[0] >= (float)num1447 && Main.netMode != 1) + if (npc.ai[0] >= (float)num1447 && Main.netMode != NetmodeID.MultiplayerClient) { npc.ai[0] = 0f; Point point12 = npc.Center.ToTileCoordinates(); @@ -301,20 +301,20 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default, 1f); } } } public override void NPCLoot() { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { if (!NPC.LunarApocalypseIsUp) { @@ -326,7 +326,7 @@ namespace CalamityMod.NPCs.NormalNPCs if (CalamityWorld.downedCalamitas || NPC.downedPlantBoss) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Lumenite"), Main.rand.Next(8, 11)); - if (Main.expertMode && Main.rand.Next(2) == 0) + if (Main.expertMode && Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Lumenite"), Main.rand.Next(2, 5)); } diff --git a/NPCs/NormalNPCs/FearlessGoldfishWarrior.cs b/NPCs/NormalNPCs/FearlessGoldfishWarrior.cs index 5709b1a4cb..5b60cb6293 100644 --- a/NPCs/NormalNPCs/FearlessGoldfishWarrior.cs +++ b/NPCs/NormalNPCs/FearlessGoldfishWarrior.cs @@ -275,7 +275,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.ai[1] = 10f; } WorldGen.KillTile(num170, num171 - 1, true, false, false); - if ((Main.netMode != 1 || !flag23) && flag23 && Main.netMode != 1) + if ((Main.netMode != NetmodeID.MultiplayerClient || !flag23) && flag23 && Main.netMode != NetmodeID.MultiplayerClient) { if (Main.tile[num170, num171 - 1].type == 10) { @@ -285,7 +285,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.ai[3] = (float)num35; npc.netUpdate = true; } - if (Main.netMode == 2 & flag24) + if (Main.netMode == NetmodeID.Server & flag24) { NetMessage.SendData(19, -1, -1, null, 0, (float)num170, (float)(num171 - 1), (float)npc.direction, 0, 0, 0); } @@ -298,7 +298,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.ai[3] = (float)num35; npc.netUpdate = true; } - if (Main.netMode == 2 & flag25) + if (Main.netMode == NetmodeID.Server & flag25) { NetMessage.SendData(19, -1, -1, null, 4, (float)num170, (float)(num171 - 1), 0f, 0, 0, 0); } @@ -421,13 +421,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 15; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/HeatSpirit.cs b/NPCs/NormalNPCs/HeatSpirit.cs index fbd987d8e7..d765087155 100644 --- a/NPCs/NormalNPCs/HeatSpirit.cs +++ b/NPCs/NormalNPCs/HeatSpirit.cs @@ -79,20 +79,20 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default, 1f); } } } public override void NPCLoot() { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofChaos")); } diff --git a/NPCs/NormalNPCs/Horse.cs b/NPCs/NormalNPCs/Horse.cs index 0257da81ce..68d335282c 100644 --- a/NPCs/NormalNPCs/Horse.cs +++ b/NPCs/NormalNPCs/Horse.cs @@ -79,19 +79,19 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AridArtifact")); } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SlagMagnum")); } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Aftershock")); } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EarthenPike")); } @@ -101,7 +101,7 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 31, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 31, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -114,9 +114,9 @@ namespace CalamityMod.NPCs.NormalNPCs npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 31, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -124,10 +124,10 @@ namespace CalamityMod.NPCs.NormalNPCs } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 6, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 6, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 6, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 6, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } for (int num625 = 0; num625 < 3; num625++) @@ -141,25 +141,25 @@ namespace CalamityMod.NPCs.NormalNPCs { scaleFactor10 = 1f; } - int num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + int num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13AB6_cp_0 = Main.gore[num626]; expr_13AB6_cp_0.velocity.X = expr_13AB6_cp_0.velocity.X + 1f; Gore expr_13AD6_cp_0 = Main.gore[num626]; expr_13AD6_cp_0.velocity.Y = expr_13AD6_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13B79_cp_0 = Main.gore[num626]; expr_13B79_cp_0.velocity.X = expr_13B79_cp_0.velocity.X - 1f; Gore expr_13B99_cp_0 = Main.gore[num626]; expr_13B99_cp_0.velocity.Y = expr_13B99_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13C3C_cp_0 = Main.gore[num626]; expr_13C3C_cp_0.velocity.X = expr_13C3C_cp_0.velocity.X + 1f; Gore expr_13C5C_cp_0 = Main.gore[num626]; expr_13C5C_cp_0.velocity.Y = expr_13C5C_cp_0.velocity.Y - 1f; - num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13CFF_cp_0 = Main.gore[num626]; expr_13CFF_cp_0.velocity.X = expr_13CFF_cp_0.velocity.X - 1f; @@ -171,7 +171,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override bool PreAI() { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[0] += 1f; if (npc.localAI[0] >= 300f) @@ -197,7 +197,7 @@ namespace CalamityMod.NPCs.NormalNPCs value9.Y += num182; for (int num186 = 0; num186 < 4; num186++) { - num185 = (Main.rand.Next(4) == 0 ? mod.ProjectileType("EarthRockBig") : mod.ProjectileType("EarthRockSmall")); + num185 = (Main.rand.NextBool(4) ? mod.ProjectileType("EarthRockBig") : mod.ProjectileType("EarthRockSmall")); num180 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - value9.X; num182 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - value9.Y; num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); diff --git a/NPCs/NormalNPCs/IceClasper.cs b/NPCs/NormalNPCs/IceClasper.cs index db156472b9..94f299ae6b 100644 --- a/NPCs/NormalNPCs/IceClasper.cs +++ b/NPCs/NormalNPCs/IceClasper.cs @@ -119,7 +119,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.velocity.Y = npc.velocity.Y - num2; } npc.localAI[0] += 1f; - if (Main.netMode != 1 && npc.localAI[0] >= 150f) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] >= 150f) { npc.localAI[0] = 0f; if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) @@ -246,7 +246,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void OnHitPlayer(Player player, int damage, bool crit) { player.AddBuff(BuffID.Frostburn, 300, true); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.AddBuff(mod.BuffType("GlacialState"), 30, true); } @@ -256,13 +256,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 92, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 92, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 15; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 92, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 92, hitDirection, -1f, 0, default, 1f); } } } @@ -270,11 +270,11 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofEleum")); - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FrostBarrier")); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AncientIceChunk")); } diff --git a/NPCs/NormalNPCs/ImpiousImmolator.cs b/NPCs/NormalNPCs/ImpiousImmolator.cs index 48ec5ed606..dbbd84abb8 100644 --- a/NPCs/NormalNPCs/ImpiousImmolator.cs +++ b/NPCs/NormalNPCs/ImpiousImmolator.cs @@ -122,7 +122,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.velocity.Y = -12f; } npc.localAI[0] += 1f; - if (Main.netMode != 1 && npc.localAI[0] >= 90f) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] >= 90f) { npc.localAI[0] = 0f; if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) @@ -267,7 +267,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("UnholyEssence"), Main.rand.Next(2, 5)); - if (Main.rand.Next(15) == 0) + if (Main.rand.NextBool(15)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EnergyStaff")); } @@ -277,13 +277,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 25; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/IrradiatedSlime.cs b/NPCs/NormalNPCs/IrradiatedSlime.cs index e3a142d237..c8596d287e 100644 --- a/NPCs/NormalNPCs/IrradiatedSlime.cs +++ b/NPCs/NormalNPCs/IrradiatedSlime.cs @@ -70,13 +70,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 75, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 75, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 75, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 75, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IrradiatedSlime"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IrradiatedSlime2"), 1f); @@ -85,7 +85,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LeadCore")); } diff --git a/NPCs/NormalNPCs/KingSlimeJewel.cs b/NPCs/NormalNPCs/KingSlimeJewel.cs index 12da38c13c..6da0a74224 100644 --- a/NPCs/NormalNPCs/KingSlimeJewel.cs +++ b/NPCs/NormalNPCs/KingSlimeJewel.cs @@ -101,7 +101,7 @@ namespace CalamityMod.NPCs.NormalNPCs } // Fire projectiles - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { // Fire bolt every 1.5 seconds npc.localAI[0] += 1f; @@ -128,10 +128,10 @@ namespace CalamityMod.NPCs.NormalNPCs { Vector2 velocity2 = new Vector2(num506, num507); velocity2.Normalize(); - int num622 = Dust.NewDust(npc.Center, npc.width, npc.height, 90, velocity2.X, velocity2.Y, 100, default(Color), 2f); + int num622 = Dust.NewDust(npc.Center, npc.width, npc.height, 90, velocity2.X, velocity2.Y, 100, default, 2f); Main.dust[num622].velocity *= 1.5f; Main.dust[num622].noGravity = true; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/NPCs/NormalNPCs/OverloadedSoldier.cs b/NPCs/NormalNPCs/OverloadedSoldier.cs index 6c2c6ac42d..45c3deceea 100644 --- a/NPCs/NormalNPCs/OverloadedSoldier.cs +++ b/NPCs/NormalNPCs/OverloadedSoldier.cs @@ -59,13 +59,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 60, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 60, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 15; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 60, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 60, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/PerennialSlime.cs b/NPCs/NormalNPCs/PerennialSlime.cs index e19785eddc..62afec160a 100644 --- a/NPCs/NormalNPCs/PerennialSlime.cs +++ b/NPCs/NormalNPCs/PerennialSlime.cs @@ -49,13 +49,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CESparkle"), hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CESparkle"), hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CESparkle"), hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CESparkle"), hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/PhantomDebris.cs b/NPCs/NormalNPCs/PhantomDebris.cs index 1c91683911..934a2cfec0 100644 --- a/NPCs/NormalNPCs/PhantomDebris.cs +++ b/NPCs/NormalNPCs/PhantomDebris.cs @@ -106,13 +106,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 60, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 60, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 15; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 60, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 60, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/PhantomSpirit.cs b/NPCs/NormalNPCs/PhantomSpirit.cs index f7862068e8..5603de952b 100644 --- a/NPCs/NormalNPCs/PhantomSpirit.cs +++ b/NPCs/NormalNPCs/PhantomSpirit.cs @@ -49,7 +49,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.velocity.X = (npc.velocity.X * 100f + num818) / 101f; npc.velocity.Y = (npc.velocity.Y * 100f + num819) / 101f; npc.rotation = (float)Math.Atan2((double)num819, (double)num818) - 1.57f; - int num822 = Dust.NewDust(npc.position, npc.width, npc.height, 60, 0f, 0f, 0, default(Color), 1f); + int num822 = Dust.NewDust(npc.position, npc.width, npc.height, 60, 0f, 0f, 0, default, 1f); Dust dust = Main.dust[num822]; dust.velocity *= 0.1f; Main.dust[num822].scale = 1.3f; @@ -69,13 +69,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 60, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 60, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int num288 = 0; num288 < 50; num288++) { - int num289 = Dust.NewDust(npc.position, npc.width, npc.height, 60, npc.velocity.X, npc.velocity.Y, 0, default(Color), 1f); + int num289 = Dust.NewDust(npc.position, npc.width, npc.height, 60, npc.velocity.X, npc.velocity.Y, 0, default, 1f); Dust dust = Main.dust[num289]; dust.velocity *= 2f; Main.dust[num289].noGravity = true; diff --git a/NPCs/NormalNPCs/PhantomSpiritL.cs b/NPCs/NormalNPCs/PhantomSpiritL.cs index 138e072249..6bf47b2c4d 100644 --- a/NPCs/NormalNPCs/PhantomSpiritL.cs +++ b/NPCs/NormalNPCs/PhantomSpiritL.cs @@ -57,7 +57,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.velocity.X = (npc.velocity.X * 100f + num818) / 101f; npc.velocity.Y = (npc.velocity.Y * 100f + num819) / 101f; npc.rotation = (float)Math.Atan2((double)num819, (double)num818) - 1.57f; - int num822 = Dust.NewDust(npc.position, npc.width, npc.height, 60, 0f, 0f, 0, default(Color), 1f); + int num822 = Dust.NewDust(npc.position, npc.width, npc.height, 60, 0f, 0f, 0, default, 1f); Dust dust = Main.dust[num822]; dust.velocity *= 0.1f; Main.dust[num822].scale = 1.3f; @@ -89,7 +89,7 @@ namespace CalamityMod.NPCs.NormalNPCs { npc.ai[3] = 0f; } - if (Main.netMode != 1 && npc.ai[2] == 20f) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == 20f) { float num151 = 5f; int num152 = 60; @@ -114,13 +114,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 60, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 60, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int num288 = 0; num288 < 50; num288++) { - int num289 = Dust.NewDust(npc.position, npc.width, npc.height, 60, npc.velocity.X, npc.velocity.Y, 0, default(Color), 1f); + int num289 = Dust.NewDust(npc.position, npc.width, npc.height, 60, npc.velocity.X, npc.velocity.Y, 0, default, 1f); Dust dust = Main.dust[num289]; dust.velocity *= 2f; Main.dust[num289].noGravity = true; diff --git a/NPCs/NormalNPCs/PhantomSpiritM.cs b/NPCs/NormalNPCs/PhantomSpiritM.cs index 667a55f710..4ca95ed69c 100644 --- a/NPCs/NormalNPCs/PhantomSpiritM.cs +++ b/NPCs/NormalNPCs/PhantomSpiritM.cs @@ -57,7 +57,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.velocity.X = (npc.velocity.X * 100f + num818) / 101f; npc.velocity.Y = (npc.velocity.Y * 100f + num819) / 101f; npc.rotation = (float)Math.Atan2((double)num819, (double)num818) - 1.57f; - int num822 = Dust.NewDust(npc.position, npc.width, npc.height, 60, 0f, 0f, 0, default(Color), 1f); + int num822 = Dust.NewDust(npc.position, npc.width, npc.height, 60, 0f, 0f, 0, default, 1f); Dust dust = Main.dust[num822]; dust.velocity *= 0.1f; Main.dust[num822].scale = 1.3f; @@ -77,13 +77,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 60, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 60, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int num288 = 0; num288 < 50; num288++) { - int num289 = Dust.NewDust(npc.position, npc.width, npc.height, 60, npc.velocity.X, npc.velocity.Y, 0, default(Color), 1f); + int num289 = Dust.NewDust(npc.position, npc.width, npc.height, 60, npc.velocity.X, npc.velocity.Y, 0, default, 1f); Dust dust = Main.dust[num289]; dust.velocity *= 2f; Main.dust[num289].noGravity = true; diff --git a/NPCs/NormalNPCs/PhantomSpiritS.cs b/NPCs/NormalNPCs/PhantomSpiritS.cs index da76a4bd2b..4b2e73f002 100644 --- a/NPCs/NormalNPCs/PhantomSpiritS.cs +++ b/NPCs/NormalNPCs/PhantomSpiritS.cs @@ -56,7 +56,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.velocity.X = (npc.velocity.X * 100f + num818) / 101f; npc.velocity.Y = (npc.velocity.Y * 100f + num819) / 101f; npc.rotation = (float)Math.Atan2((double)num819, (double)num818) - 1.57f; - int num822 = Dust.NewDust(npc.position, npc.width, npc.height, 60, 0f, 0f, 0, default(Color), 1f); + int num822 = Dust.NewDust(npc.position, npc.width, npc.height, 60, 0f, 0f, 0, default, 1f); Dust dust = Main.dust[num822]; dust.velocity *= 0.1f; Main.dust[num822].scale = 1.3f; @@ -76,13 +76,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 60, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 60, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int num288 = 0; num288 < 50; num288++) { - int num289 = Dust.NewDust(npc.position, npc.width, npc.height, 60, npc.velocity.X, npc.velocity.Y, 0, default(Color), 1f); + int num289 = Dust.NewDust(npc.position, npc.width, npc.height, 60, npc.velocity.X, npc.velocity.Y, 0, default, 1f); Dust dust = Main.dust[num289]; dust.velocity *= 2f; Main.dust[num289].noGravity = true; diff --git a/NPCs/NormalNPCs/Piggy.cs b/NPCs/NormalNPCs/Piggy.cs index 7ac4bebcf7..b5ddc47e99 100644 --- a/NPCs/NormalNPCs/Piggy.cs +++ b/NPCs/NormalNPCs/Piggy.cs @@ -89,13 +89,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 15; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/Pitbull.cs b/NPCs/NormalNPCs/Pitbull.cs index 5528069cdd..302da3a19b 100644 --- a/NPCs/NormalNPCs/Pitbull.cs +++ b/NPCs/NormalNPCs/Pitbull.cs @@ -50,13 +50,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/PlagueBee.cs b/NPCs/NormalNPCs/PlagueBee.cs index e15e200e43..6478b4c865 100644 --- a/NPCs/NormalNPCs/PlagueBee.cs +++ b/NPCs/NormalNPCs/PlagueBee.cs @@ -69,13 +69,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/PlagueBeeLarge.cs b/NPCs/NormalNPCs/PlagueBeeLarge.cs index 5f619a6531..4bb5992227 100644 --- a/NPCs/NormalNPCs/PlagueBeeLarge.cs +++ b/NPCs/NormalNPCs/PlagueBeeLarge.cs @@ -69,13 +69,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/PlaguedDerpling.cs b/NPCs/NormalNPCs/PlaguedDerpling.cs index c638b0a007..72a8dbeab9 100644 --- a/NPCs/NormalNPCs/PlaguedDerpling.cs +++ b/NPCs/NormalNPCs/PlaguedDerpling.cs @@ -144,7 +144,7 @@ namespace CalamityMod.NPCs.NormalNPCs { npc.netUpdate = true; } - int num13 = Dust.NewDust(new Vector2(npc.position.X - npc.velocity.X, npc.position.Y - npc.velocity.Y), npc.width, npc.height, 46, npc.velocity.X * 0.2f, npc.velocity.Y * 0.2f, 100, default(Color), 2f); + int num13 = Dust.NewDust(new Vector2(npc.position.X - npc.velocity.X, npc.position.Y - npc.velocity.Y), npc.width, npc.height, 46, npc.velocity.X * 0.2f, npc.velocity.Y * 0.2f, 100, default, 2f); Main.dust[num13].noGravity = true; Dust expr_F26_cp_0 = Main.dust[num13]; expr_F26_cp_0.velocity.X = expr_F26_cp_0.velocity.X * 0.3f; @@ -170,13 +170,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Viruling"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Viruling2"), 1f); diff --git a/NPCs/NormalNPCs/PlaguedFlyingFox.cs b/NPCs/NormalNPCs/PlaguedFlyingFox.cs index 7ed6e5336b..8ef361cb81 100644 --- a/NPCs/NormalNPCs/PlaguedFlyingFox.cs +++ b/NPCs/NormalNPCs/PlaguedFlyingFox.cs @@ -62,13 +62,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/PlaguedJungleSlime.cs b/NPCs/NormalNPCs/PlaguedJungleSlime.cs index 37e33ff616..b5563c7d44 100644 --- a/NPCs/NormalNPCs/PlaguedJungleSlime.cs +++ b/NPCs/NormalNPCs/PlaguedJungleSlime.cs @@ -68,7 +68,7 @@ namespace CalamityMod.NPCs.NormalNPCs { npc.velocity.X = npc.velocity.X * 0.9f; } - if (Main.netMode != 1 && spikeTimer == 0f) + if (Main.netMode != NetmodeID.MultiplayerClient && spikeTimer == 0f) { Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 42); for (int n = 0; n < 5; n++) @@ -90,7 +90,7 @@ namespace CalamityMod.NPCs.NormalNPCs { npc.velocity.X = npc.velocity.X * 0.9f; } - if (Main.netMode != 1 && spikeTimer == 0f) + if (Main.netMode != NetmodeID.MultiplayerClient && spikeTimer == 0f) { Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 42); num15 = Main.player[npc.target].position.Y - vector3.Y - (float)Main.rand.Next(0, 200); @@ -118,13 +118,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/PlaguedTortoise.cs b/NPCs/NormalNPCs/PlaguedTortoise.cs index f35a9e7c24..7b36ebf537 100644 --- a/NPCs/NormalNPCs/PlaguedTortoise.cs +++ b/NPCs/NormalNPCs/PlaguedTortoise.cs @@ -48,13 +48,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/ProfanedEnergyBody.cs b/NPCs/NormalNPCs/ProfanedEnergyBody.cs index eb0ea0f573..74346d819b 100644 --- a/NPCs/NormalNPCs/ProfanedEnergyBody.cs +++ b/NPCs/NormalNPCs/ProfanedEnergyBody.cs @@ -35,7 +35,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void AI() { CalamityGlobalNPC.energyFlame = npc.whoAmI; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (npc.localAI[0] == 0f) { @@ -65,13 +65,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 50; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/ProfanedEnergyLantern.cs b/NPCs/NormalNPCs/ProfanedEnergyLantern.cs index c4b1e2369b..885801d0d5 100644 --- a/NPCs/NormalNPCs/ProfanedEnergyLantern.cs +++ b/NPCs/NormalNPCs/ProfanedEnergyLantern.cs @@ -45,7 +45,7 @@ namespace CalamityMod.NPCs.NormalNPCs { num750 = (int)npc.ai[3] - 1; } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[0] -= 1f; if (npc.localAI[0] <= 0f) @@ -141,7 +141,7 @@ namespace CalamityMod.NPCs.NormalNPCs { npc.velocity.Y = -8f; } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (!Main.player[npc.target].dead) { @@ -225,7 +225,7 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 50; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/SandTortoise.cs b/NPCs/NormalNPCs/SandTortoise.cs index 031afaa084..98acbb3738 100644 --- a/NPCs/NormalNPCs/SandTortoise.cs +++ b/NPCs/NormalNPCs/SandTortoise.cs @@ -38,13 +38,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } } } @@ -60,7 +60,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.TurtleShell); } diff --git a/NPCs/NormalNPCs/ScornEater.cs b/NPCs/NormalNPCs/ScornEater.cs index 4f3887f705..5555cca2bf 100644 --- a/NPCs/NormalNPCs/ScornEater.cs +++ b/NPCs/NormalNPCs/ScornEater.cs @@ -44,7 +44,7 @@ namespace CalamityMod.NPCs.NormalNPCs if (npc.ai[0] == 0f) { npc.TargetClosest(true); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (npc.velocity.X != 0f || npc.velocity.Y < 0f || (double)npc.velocity.Y > 0.9) { @@ -162,13 +162,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 50; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScornEater"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScornEater2"), 1f); diff --git a/NPCs/NormalNPCs/ShockstormShuttle.cs b/NPCs/NormalNPCs/ShockstormShuttle.cs index 2e6423b179..64592d903a 100644 --- a/NPCs/NormalNPCs/ShockstormShuttle.cs +++ b/NPCs/NormalNPCs/ShockstormShuttle.cs @@ -35,7 +35,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void AI() { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[0] += (float)Main.rand.Next(4); //adds to localAI to fire projectiles at random times if (npc.localAI[0] >= (float)Main.rand.Next(100, 120)) //rate at which projectiles are shot @@ -60,7 +60,7 @@ namespace CalamityMod.NPCs.NormalNPCs num184 = 22; } int num185 = 435; //projectile ID - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { num185 = 449; //more powerful projectile ID } @@ -81,7 +81,7 @@ namespace CalamityMod.NPCs.NormalNPCs } } } - if (npc.localAI[3] == 0f && Main.netMode != 1) + if (npc.localAI[3] == 0f && Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[3] = 1f; } @@ -381,17 +381,17 @@ namespace CalamityMod.NPCs.NormalNPCs } if (npc.ai[1] < 40f) { - npc.rotation = Vector2.UnitY.RotatedBy((double)(npc.ai[1] / 40f * 6.28318548f), default(Vector2)).Y * 0.2f; + npc.rotation = Vector2.UnitY.RotatedBy((double)(npc.ai[1] / 40f * 6.28318548f), default).Y * 0.2f; return; } if (npc.ai[1] < 80f) { - npc.rotation = Vector2.UnitY.RotatedBy((double)(npc.ai[1] / 20f * 6.28318548f), default(Vector2)).Y * 0.3f; + npc.rotation = Vector2.UnitY.RotatedBy((double)(npc.ai[1] / 20f * 6.28318548f), default).Y * 0.3f; return; } if (npc.ai[1] < 120f) { - npc.rotation = Vector2.UnitY.RotatedBy((double)(npc.ai[1] / 10f * 6.28318548f), default(Vector2)).Y * 0.4f; + npc.rotation = Vector2.UnitY.RotatedBy((double)(npc.ai[1] / 10f * 6.28318548f), default).Y * 0.4f; return; } npc.rotation = (npc.ai[1] - 120f) / 30f * 6.28318548f; @@ -419,7 +419,7 @@ namespace CalamityMod.NPCs.NormalNPCs if (num1608 == 1) { npc.ai[2] = (float)((Math.Sign((player8.Center - center16).X) == 1) ? 1 : -1); - if (Main.netMode != 1) //second projectile being shot. Didn't use this + if (Main.netMode != NetmodeID.MultiplayerClient) //second projectile being shot. Didn't use this { npc.localAI[0] += (float)Main.rand.Next(4); if (npc.localAI[0] >= (float)Main.rand.Next(50, 100)) @@ -541,13 +541,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 234, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 234, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 234, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 234, hitDirection, -1f, 0, default, 1f); } } } @@ -569,7 +569,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.MartianConduitPlating, Main.rand.Next(10, 30)); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofCinder")); } diff --git a/NPCs/NormalNPCs/StormlionCharger.cs b/NPCs/NormalNPCs/StormlionCharger.cs index 517c09e08b..f2b9cbcafa 100644 --- a/NPCs/NormalNPCs/StormlionCharger.cs +++ b/NPCs/NormalNPCs/StormlionCharger.cs @@ -35,13 +35,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } } } @@ -62,7 +62,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StormlionMandible")); } diff --git a/NPCs/NormalNPCs/SunBat.cs b/NPCs/NormalNPCs/SunBat.cs index 17756362c1..1971be5583 100644 --- a/NPCs/NormalNPCs/SunBat.cs +++ b/NPCs/NormalNPCs/SunBat.cs @@ -65,20 +65,20 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 64, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 64, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 64, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 64, hitDirection, -1f, 0, default, 1f); } } } public override void NPCLoot() { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofCinder")); } diff --git a/NPCs/NormalNPCs/Sunskater.cs b/NPCs/NormalNPCs/Sunskater.cs index 63a66e2537..7f2075bb6e 100644 --- a/NPCs/NormalNPCs/Sunskater.cs +++ b/NPCs/NormalNPCs/Sunskater.cs @@ -233,7 +233,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { - if (Main.hardMode && Main.rand.Next(3) == 0) + if (Main.hardMode && Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofCinder")); } @@ -243,13 +243,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 64, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 64, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 25; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 64, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 64, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/ThiccWaifu.cs b/NPCs/NormalNPCs/ThiccWaifu.cs index 22b87aa094..839f2bf31f 100644 --- a/NPCs/NormalNPCs/ThiccWaifu.cs +++ b/NPCs/NormalNPCs/ThiccWaifu.cs @@ -85,7 +85,7 @@ namespace CalamityMod.NPCs.NormalNPCs Vector2 vector = npc.Center; vector = Vector2.UnitX * (float)npc.direction * 200f; Vector2 vector223 = npc.Center + Vector2.UnitX * (float)npc.direction * 50f - Vector2.UnitY * 6f; - if (npc.ai[0] == 54f && Main.netMode != 1) + if (npc.ai[0] == 54f && Main.netMode != NetmodeID.MultiplayerClient) { List list4 = new List(); Vector2 vec5 = Main.player[npc.target].Center + new Vector2(Main.player[npc.target].velocity.X * 30f, 0f); @@ -283,13 +283,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 16, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 16, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 50; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 16, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 16, hitDirection, -1f, 0, default, 1f); } } } @@ -297,22 +297,22 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EssenceofCinder"), Main.rand.Next(2, 4)); - if (Main.rand.Next(100) == 0 && CalamityWorld.downedProvidence) + if (Main.rand.NextBool(100) && CalamityWorld.downedProvidence) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Thunderstorm")); } if (Main.expertMode) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EyeoftheStorm")); } } - else if (Main.rand.Next(4) == 0) + else if (Main.rand.NextBool(4)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EyeoftheStorm")); } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StormSaber")); } diff --git a/NPCs/NormalNPCs/WulfrumDrone.cs b/NPCs/NormalNPCs/WulfrumDrone.cs index 9ee889aba1..71db588b6a 100644 --- a/NPCs/NormalNPCs/WulfrumDrone.cs +++ b/NPCs/NormalNPCs/WulfrumDrone.cs @@ -57,13 +57,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 3, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 3, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 15; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 3, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 3, hitDirection, -1f, 0, default, 1f); } } } @@ -71,7 +71,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("WulfrumShard"), Main.rand.Next(1, 4)); - if (Main.expertMode && Main.rand.Next(2) == 0) + if (Main.expertMode && Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("WulfrumShard")); } diff --git a/NPCs/NormalNPCs/WulfrumSlime.cs b/NPCs/NormalNPCs/WulfrumSlime.cs index bfa3fb4219..afe985cf2c 100644 --- a/NPCs/NormalNPCs/WulfrumSlime.cs +++ b/NPCs/NormalNPCs/WulfrumSlime.cs @@ -48,13 +48,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 3, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 3, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 15; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 3, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 3, hitDirection, -1f, 0, default, 1f); } } } @@ -62,7 +62,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("WulfrumShard")); - if (Main.expertMode && Main.rand.Next(2) == 0) + if (Main.expertMode && Main.rand.NextBool(2)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("WulfrumShard")); } diff --git a/NPCs/Perforator/PerforatorBodyLarge.cs b/NPCs/Perforator/PerforatorBodyLarge.cs index 166a999b8a..da8311707b 100644 --- a/NPCs/Perforator/PerforatorBodyLarge.cs +++ b/NPCs/Perforator/PerforatorBodyLarge.cs @@ -54,7 +54,7 @@ namespace CalamityMod.NPCs.Perforator { bool expertMode = (Main.expertMode || CalamityWorld.bossRushActive); bool revenge = (CalamityWorld.revenge || CalamityWorld.bossRushActive); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int shoot = revenge ? 5 : 4; npc.localAI[0] += (float)Main.rand.Next(shoot); @@ -78,7 +78,7 @@ namespace CalamityMod.NPCs.Perforator int num946 = mod.ProjectileType("BloodClot"); vector104.X += num942 * 5f; vector104.Y += num943 * 5f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { int num947 = Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, num946, num945, 0f, Main.myPlayer, 0f, 0f); Main.projectile[num947].timeLeft = 160; @@ -125,13 +125,13 @@ namespace CalamityMod.NPCs.Perforator { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/LargePerf2"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/LargePerf3"), 1f); diff --git a/NPCs/Perforator/PerforatorBodyMedium.cs b/NPCs/Perforator/PerforatorBodyMedium.cs index b4f1b88b91..ac755bbce4 100644 --- a/NPCs/Perforator/PerforatorBodyMedium.cs +++ b/NPCs/Perforator/PerforatorBodyMedium.cs @@ -53,7 +53,7 @@ namespace CalamityMod.NPCs.Perforator { bool expertMode = (Main.expertMode || CalamityWorld.bossRushActive); bool revenge = (CalamityWorld.revenge || CalamityWorld.bossRushActive); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int shoot = revenge ? 5 : 4; npc.localAI[0] += (float)Main.rand.Next(shoot); @@ -77,7 +77,7 @@ namespace CalamityMod.NPCs.Perforator int num946 = mod.ProjectileType("BloodClot"); vector104.X += num942 * 5f; vector104.Y += num943 * 5f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { int num947 = Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, num946, num945, 0f, Main.myPlayer, 0f, 0f); Main.projectile[num947].timeLeft = 160; @@ -116,13 +116,13 @@ namespace CalamityMod.NPCs.Perforator { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MediumPerf2"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MediumPerf3"), 1f); diff --git a/NPCs/Perforator/PerforatorBodySmall.cs b/NPCs/Perforator/PerforatorBodySmall.cs index a98e25be32..730f8ffe4c 100644 --- a/NPCs/Perforator/PerforatorBodySmall.cs +++ b/NPCs/Perforator/PerforatorBodySmall.cs @@ -53,7 +53,7 @@ namespace CalamityMod.NPCs.Perforator { bool expertMode = (Main.expertMode || CalamityWorld.bossRushActive); bool revenge = (CalamityWorld.revenge || CalamityWorld.bossRushActive); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int shoot = revenge ? 5 : 4; npc.localAI[0] += (float)Main.rand.Next(shoot); @@ -77,7 +77,7 @@ namespace CalamityMod.NPCs.Perforator int num946 = mod.ProjectileType("BloodClot"); vector104.X += num942 * 5f; vector104.Y += num943 * 5f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { int num947 = Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, num946, num945, 0f, Main.myPlayer, 0f, 0f); Main.projectile[num947].timeLeft = 160; @@ -116,13 +116,13 @@ namespace CalamityMod.NPCs.Perforator { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SmallPerf2"), 1f); } diff --git a/NPCs/Perforator/PerforatorCyst.cs b/NPCs/Perforator/PerforatorCyst.cs index 2b23f580d7..f87159a13e 100644 --- a/NPCs/Perforator/PerforatorCyst.cs +++ b/NPCs/Perforator/PerforatorCyst.cs @@ -56,15 +56,15 @@ namespace CalamityMod.NPCs.Perforator { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } - if (Main.netMode != 1 && NPC.CountNPCS(mod.NPCType("PerforatorHive")) < 1) + if (Main.netMode != NetmodeID.MultiplayerClient && NPC.CountNPCS(mod.NPCType("PerforatorHive")) < 1) { Vector2 spawnAt = npc.Center + new Vector2(0f, (float)npc.height / 2f); NPC.NewNPC((int)spawnAt.X, (int)spawnAt.Y, mod.NPCType("PerforatorHive")); diff --git a/NPCs/Perforator/PerforatorHeadLarge.cs b/NPCs/Perforator/PerforatorHeadLarge.cs index 114c3aa02e..57a205705d 100644 --- a/NPCs/Perforator/PerforatorHeadLarge.cs +++ b/NPCs/Perforator/PerforatorHeadLarge.cs @@ -395,13 +395,13 @@ namespace CalamityMod.NPCs.Perforator { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/LargePerf"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/LargePerf2"), 1f); diff --git a/NPCs/Perforator/PerforatorHeadMedium.cs b/NPCs/Perforator/PerforatorHeadMedium.cs index cdd6057e25..bce50383ec 100644 --- a/NPCs/Perforator/PerforatorHeadMedium.cs +++ b/NPCs/Perforator/PerforatorHeadMedium.cs @@ -392,13 +392,13 @@ namespace CalamityMod.NPCs.Perforator { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MediumPerf"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MediumPerf2"), 1f); diff --git a/NPCs/Perforator/PerforatorHeadSmall.cs b/NPCs/Perforator/PerforatorHeadSmall.cs index 87165223fa..03c5c0e8bd 100644 --- a/NPCs/Perforator/PerforatorHeadSmall.cs +++ b/NPCs/Perforator/PerforatorHeadSmall.cs @@ -391,13 +391,13 @@ namespace CalamityMod.NPCs.Perforator { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SmallPerf"), 1f); } diff --git a/NPCs/Perforator/PerforatorHive.cs b/NPCs/Perforator/PerforatorHive.cs index b23b1ad2d7..6946c2e54a 100644 --- a/NPCs/Perforator/PerforatorHive.cs +++ b/NPCs/Perforator/PerforatorHive.cs @@ -123,7 +123,7 @@ namespace CalamityMod.NPCs.Perforator { npc.dontTakeDamage = isCrimson ? false : true; } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int shoot = revenge ? 6 : 4; if (CalamityWorld.death || CalamityWorld.bossRushActive) @@ -137,9 +137,9 @@ namespace CalamityMod.NPCs.Perforator Main.PlaySound(3, (int)npc.position.X, (int)npc.position.Y, 20); for (int num621 = 0; num621 < 8; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 170, 0f, 0f, 100, default(Color), 1f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 170, 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.25f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -147,10 +147,10 @@ namespace CalamityMod.NPCs.Perforator } for (int num623 = 0; num623 < 16; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default(Color), 1.5f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default, 1.5f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default(Color), 1f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } float num179 = 8f; @@ -164,7 +164,7 @@ namespace CalamityMod.NPCs.Perforator num180 *= num183; num182 *= num183; int num184 = expertMode ? 14 : 18; - int num185 = (Main.rand.Next(2) == 0 ? mod.ProjectileType("IchorShot") : mod.ProjectileType("BloodGeyser")); + int num185 = (Main.rand.NextBool(2) ? mod.ProjectileType("IchorShot") : mod.ProjectileType("BloodGeyser")); value9.X += num180; value9.Y += num182; for (int num186 = 0; num186 < 20; num186++) @@ -235,7 +235,7 @@ namespace CalamityMod.NPCs.Perforator } if (npc.life > 0) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int num660 = (int)((double)npc.lifeMax * 0.3); if ((float)(npc.life + num660) < npc.ai[3]) @@ -323,9 +323,9 @@ namespace CalamityMod.NPCs.Perforator Color messageColor = Color.Cyan; WorldGenerationMethods.SpawnOre(mod.TileType("AerialiteOre"), 12E-05, .4f, .6f); - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) Main.NewText(Language.GetTextValue(key), messageColor); - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -338,7 +338,7 @@ namespace CalamityMod.NPCs.Perforator { for (int k = 0; k < damage / npc.lifeMax * 100.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -354,9 +354,9 @@ namespace CalamityMod.NPCs.Perforator npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -364,10 +364,10 @@ namespace CalamityMod.NPCs.Perforator } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/Perforator/PerforatorTailLarge.cs b/NPCs/Perforator/PerforatorTailLarge.cs index 7be58b24be..851ab09990 100644 --- a/NPCs/Perforator/PerforatorTailLarge.cs +++ b/NPCs/Perforator/PerforatorTailLarge.cs @@ -70,13 +70,13 @@ namespace CalamityMod.NPCs.Perforator { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/LargePerf4"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/LargePerf5"), 1f); diff --git a/NPCs/Perforator/PerforatorTailMedium.cs b/NPCs/Perforator/PerforatorTailMedium.cs index 1442a17bcd..c59c2eb908 100644 --- a/NPCs/Perforator/PerforatorTailMedium.cs +++ b/NPCs/Perforator/PerforatorTailMedium.cs @@ -70,13 +70,13 @@ namespace CalamityMod.NPCs.Perforator { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MediumPerf3"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MediumPerf4"), 1f); diff --git a/NPCs/Perforator/PerforatorTailSmall.cs b/NPCs/Perforator/PerforatorTailSmall.cs index cbeebdb2ae..1fc1b988c4 100644 --- a/NPCs/Perforator/PerforatorTailSmall.cs +++ b/NPCs/Perforator/PerforatorTailSmall.cs @@ -71,13 +71,13 @@ namespace CalamityMod.NPCs.Perforator { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SmallPerf3"), 1f); } diff --git a/NPCs/PlaguebringerGoliath/PlagueBeeG.cs b/NPCs/PlaguebringerGoliath/PlagueBeeG.cs index 79c2791222..a745af0f00 100644 --- a/NPCs/PlaguebringerGoliath/PlagueBeeG.cs +++ b/NPCs/PlaguebringerGoliath/PlagueBeeG.cs @@ -213,13 +213,13 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/PlaguebringerGoliath/PlagueBeeLargeG.cs b/NPCs/PlaguebringerGoliath/PlagueBeeLargeG.cs index dee1cda3b0..36b0a30feb 100644 --- a/NPCs/PlaguebringerGoliath/PlagueBeeLargeG.cs +++ b/NPCs/PlaguebringerGoliath/PlagueBeeLargeG.cs @@ -108,13 +108,13 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs index 0d608b57e6..d75c81ae3b 100644 --- a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs +++ b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs @@ -54,26 +54,26 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath num247 = npc.velocity.X * 0.5f; num248 = npc.velocity.Y * 0.5f; } - int num249 = Dust.NewDust(new Vector2(npc.position.X + 3f + num247, npc.position.Y + 3f + num248) - npc.velocity * 0.5f, npc.width - 8, npc.height - 8, 6, 0f, 0f, 100, default(Color), 0.5f); + int num249 = Dust.NewDust(new Vector2(npc.position.X + 3f + num247, npc.position.Y + 3f + num248) - npc.velocity * 0.5f, npc.width - 8, npc.height - 8, 6, 0f, 0f, 100, default, 0.5f); Main.dust[num249].scale *= 2f + (float)Main.rand.Next(10) * 0.1f; Main.dust[num249].velocity *= 0.2f; Main.dust[num249].noGravity = true; - num249 = Dust.NewDust(new Vector2(npc.position.X + 3f + num247, npc.position.Y + 3f + num248) - npc.velocity * 0.5f, npc.width - 8, npc.height - 8, 31, 0f, 0f, 100, default(Color), 0.25f); + num249 = Dust.NewDust(new Vector2(npc.position.X + 3f + num247, npc.position.Y + 3f + num248) - npc.velocity * 0.5f, npc.width - 8, npc.height - 8, 31, 0f, 0f, 100, default, 0.25f); Main.dust[num249].fadeIn = 1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num249].velocity *= 0.05f; } - else if (Main.rand.Next(4) == 0) + else if (Main.rand.NextBool(4)) { - int num252 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 31, 0f, 0f, 100, default(Color), 0.5f); + int num252 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 31, 0f, 0f, 100, default, 0.5f); Main.dust[num252].scale = 0.1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].fadeIn = 1.5f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].noGravity = true; - Main.dust[num252].position = npc.Center + new Vector2(0f, (float)(-(float)npc.height / 2)).RotatedBy((double)npc.rotation, default(Vector2)) * 1.1f; + Main.dust[num252].position = npc.Center + new Vector2(0f, (float)(-(float)npc.height / 2)).RotatedBy((double)npc.rotation, default) * 1.1f; Main.rand.Next(2); - num252 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 6, 0f, 0f, 100, default(Color), 1f); + num252 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 6, 0f, 0f, 100, default, 1f); Main.dust[num252].scale = 1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].noGravity = true; - Main.dust[num252].position = npc.Center + new Vector2(0f, (float)(-(float)npc.height / 2 - 6)).RotatedBy((double)npc.rotation, default(Vector2)) * 1.1f; + Main.dust[num252].position = npc.Center + new Vector2(0f, (float)(-(float)npc.height / 2 - 6)).RotatedBy((double)npc.rotation, default) * 1.1f; } npc.rotation = npc.velocity.ToRotation() + 1.57079637f; if (npc.ai[2] < 90f) @@ -127,7 +127,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { num762 += 6.2831853071795862; } - npc.velocity = npc.velocity.RotatedBy(num762 * 0.20000000298023224, default(Vector2)); + npc.velocity = npc.velocity.RotatedBy(num762 * 0.20000000298023224, default); } else { @@ -165,9 +165,9 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 15; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 89, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 89, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -176,10 +176,10 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath } for (int num623 = 0; num623 < 30; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 89, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 89, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 89, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 89, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; Main.dust[num624].noGravity = true; } @@ -200,13 +200,13 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/PlaguebringerGoliath/PlagueMine.cs b/NPCs/PlaguebringerGoliath/PlagueMine.cs index 0596cbb9e1..b27a3d47f7 100644 --- a/NPCs/PlaguebringerGoliath/PlagueMine.cs +++ b/NPCs/PlaguebringerGoliath/PlagueMine.cs @@ -130,9 +130,9 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 15; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 89, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 89, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -141,10 +141,10 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath } for (int num623 = 0; num623 < 30; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 89, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 89, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 89, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 89, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; Main.dust[num624].noGravity = true; } diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index 3121c66331..a913bcd319 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -119,9 +119,9 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { string key = "Mods.CalamityMod.PlagueBossText"; Color messageColor = Color.Lime; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) Main.NewText(Language.GetTextValue(key), messageColor); - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); halfLife = true; @@ -182,7 +182,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath // Phase switch if (npc.ai[0] == -1f) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { float num595 = npc.ai[1]; int num596; @@ -462,7 +462,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { Main.PlaySound(3, (int)npc.position.X, (int)npc.position.Y, 8); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int randomAmt = expertMode ? 2 : 4; if (Main.rand.Next(randomAmt) == 0) @@ -537,7 +537,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 88); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (expertMode && NPC.CountNPCS(mod.NPCType("PlagueMine")) < (aboveGroundEnrage ? 6 : 4)) NPC.NewNPC((int)vector119.X, (int)vector119.Y, mod.NPCType("PlagueMine"), 0, 0f, 0f, 0f, 0f, 255); @@ -611,7 +611,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 42); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { float projectileSpeed = revenge ? 6.5f : 6f; if (jungleEnrage || npc.GetGlobalNPC(mod).enraged || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive)) @@ -625,14 +625,14 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath num1072 *= num1073; int num1074 = 40; //projectile damage - int num1075 = (Main.rand.Next(2) == 0 ? mod.ProjectileType("PlagueStingerGoliath") : mod.ProjectileType("PlagueStingerGoliathV2")); + int num1075 = (Main.rand.NextBool(2) ? mod.ProjectileType("PlagueStingerGoliath") : mod.ProjectileType("PlagueStingerGoliathV2")); if (expertMode) { num1074 = 28; //112 int damageBoost = (int)(6f * (1f - (float)npc.life / (float)npc.lifeMax)); num1074 += damageBoost; //112 to 136 - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) { num1074 += 8; //144 to 168 num1075 = mod.ProjectileType("HiveBombGoliath"); @@ -640,7 +640,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath } else { - if (Main.rand.Next(9) == 0) + if (Main.rand.NextBool(9)) { num1074 = 50; num1075 = mod.ProjectileType("HiveBombGoliath"); @@ -691,7 +691,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 116); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int speed = revenge ? 6 : 5; float spawnX = npc.Center.X; @@ -868,7 +868,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { for (int k = 0; k < 2; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -885,9 +885,9 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 46, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 46, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -895,10 +895,10 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 46, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 46, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 46, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 46, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/PlaguebringerShade/PlaguebringerShade.cs b/NPCs/PlaguebringerShade/PlaguebringerShade.cs index d2d783429d..fb47952caa 100644 --- a/NPCs/PlaguebringerShade/PlaguebringerShade.cs +++ b/NPCs/PlaguebringerShade/PlaguebringerShade.cs @@ -116,7 +116,7 @@ namespace CalamityMod.NPCs.PlaguebringerShade } else if (npc.ai[0] == -1f) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { float num1041 = npc.ai[1]; int num1042; @@ -347,10 +347,10 @@ namespace CalamityMod.NPCs.PlaguebringerShade if (Collision.CanHit(vector119, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height) && flag103) { Main.PlaySound(3, (int)npc.position.X, (int)npc.position.Y, 8); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int num1061; - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { num1061 = mod.NPCType("PlagueBeeLargeG"); } @@ -446,7 +446,7 @@ namespace CalamityMod.NPCs.PlaguebringerShade if (flag104 && npc.position.Y + (float)npc.height < Main.player[npc.target].position.Y && Collision.CanHit(vector121, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 42); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { float num1070 = 6f; //changed from 8 if (flag113) @@ -461,7 +461,7 @@ namespace CalamityMod.NPCs.PlaguebringerShade num1072 *= num1073; int num1074 = 20; //projectile damage int num1075 = mod.ProjectileType("PlagueStingerGoliathV2"); //projectile type - if (Main.rand.Next(15) == 0) + if (Main.rand.NextBool(15)) { num1074 = 25; num1075 = mod.ProjectileType("HiveBombGoliath"); @@ -572,7 +572,7 @@ namespace CalamityMod.NPCs.PlaguebringerShade { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -589,9 +589,9 @@ namespace CalamityMod.NPCs.PlaguebringerShade npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 46, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 46, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -599,10 +599,10 @@ namespace CalamityMod.NPCs.PlaguebringerShade } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 46, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 46, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 46, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 46, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/Polterghast/PhantomFuckYou.cs b/NPCs/Polterghast/PhantomFuckYou.cs index 7600277230..b5e592f4c9 100644 --- a/NPCs/Polterghast/PhantomFuckYou.cs +++ b/NPCs/Polterghast/PhantomFuckYou.cs @@ -58,7 +58,7 @@ namespace CalamityMod.NPCs.Polterghast { for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 180, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 180, 0f, 0f, 100, default, 2f); } npc.ai[1] = npc.ai[0]; start = false; @@ -81,7 +81,7 @@ namespace CalamityMod.NPCs.Polterghast } if (timer > 180) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int damage = expertMode ? 58 : 70; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, direction.X * 0.05f, direction.Y * 0.05f, mod.ProjectileType("PhantomMine"), damage, 1f, npc.target); diff --git a/NPCs/Polterghast/PolterPhantom.cs b/NPCs/Polterghast/PolterPhantom.cs index c3ef0e1d9f..2287455f64 100644 --- a/NPCs/Polterghast/PolterPhantom.cs +++ b/NPCs/Polterghast/PolterPhantom.cs @@ -273,7 +273,7 @@ namespace CalamityMod.NPCs.Polterghast public override void HitEffect(int hitDirection, double damage) { - Dust.NewDust(npc.position, npc.width, npc.height, 180, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 180, hitDirection, -1f, 0, default, 1f); if (npc.life <= 0) { npc.position.X = npc.position.X + (float)(npc.width / 2); @@ -284,9 +284,9 @@ namespace CalamityMod.NPCs.Polterghast npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 60, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 60, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -294,10 +294,10 @@ namespace CalamityMod.NPCs.Polterghast } for (int num623 = 0; num623 < 60; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 180, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 180, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 180, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 180, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/Polterghast/Polterghast.cs b/NPCs/Polterghast/Polterghast.cs index ff38690a5c..8a5c6d9b69 100644 --- a/NPCs/Polterghast/Polterghast.cs +++ b/NPCs/Polterghast/Polterghast.cs @@ -112,7 +112,7 @@ namespace CalamityMod.NPCs.Polterghast if (Vector2.Distance(Main.player[npc.target].Center, vector) > (despawnBoost ? 1500f : 6000f)) npc.active = false; - if (npc.localAI[0] == 0f && Main.netMode != 1) + if (npc.localAI[0] == 0f && Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[0] = 1f; int num729 = NPC.NewNPC((int)vector.X, (int)vector.Y, mod.NPCType("PolterghastHook"), npc.whoAmI, 0f, 0f, 0f, 0f, 255); @@ -207,17 +207,17 @@ namespace CalamityMod.NPCs.Polterghast if (npc.localAI[2] >= 600f) { npc.localAI[2] = 0f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { NPC.NewNPC((int)vector.X, (int)vector.Y, mod.NPCType("PolterPhantom"), 0, 0f, 0f, 0f, 0f, 255); } Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 122); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; Main.dust[num622].noGravity = true; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -225,10 +225,10 @@ namespace CalamityMod.NPCs.Polterghast } for (int num623 = 0; num623 < 30; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 180, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 180, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } @@ -326,7 +326,7 @@ namespace CalamityMod.NPCs.Polterghast npc.damage = expertMode ? 240 : 150; npc.defense = 150; } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[1] += (expertMode ? 2f : 1.5f); if (speedBoost1 || CalamityWorld.bossRushActive) @@ -426,10 +426,10 @@ namespace CalamityMod.NPCs.Polterghast Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Polt5"), 1f); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 60, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 60, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; Main.dust[num622].noGravity = true; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -437,10 +437,10 @@ namespace CalamityMod.NPCs.Polterghast } for (int num623 = 0; num623 < 30; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 180, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 180, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 180, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 180, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } @@ -455,7 +455,7 @@ namespace CalamityMod.NPCs.Polterghast npc.damage = expertMode ? 288 : 180; npc.defense = 100; } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[1] += (expertMode ? 2f : 1.5f); if (speedBoost1 || CalamityWorld.bossRushActive) @@ -548,7 +548,7 @@ namespace CalamityMod.NPCs.Polterghast if (!spawnGhost) { spawnGhost = true; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { NPC.NewNPC((int)vector.X, (int)vector.Y, mod.NPCType("PolterPhantom"), 0, 0f, 0f, 0f, 0f, 255); for (int I = 0; I < 3; I++) @@ -568,10 +568,10 @@ namespace CalamityMod.NPCs.Polterghast Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Polt5"), 1f); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 60, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 60, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; Main.dust[num622].noGravity = true; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -579,10 +579,10 @@ namespace CalamityMod.NPCs.Polterghast } for (int num623 = 0; num623 < 30; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 180, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 180, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 180, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 180, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } @@ -616,7 +616,7 @@ namespace CalamityMod.NPCs.Polterghast num761 = num757 / num761; num758 *= num761; num760 *= num761; - if (NPC.CountNPCS(mod.NPCType("PhantomSpiritL")) < (revenge ? 3 : 2) && Main.netMode != 1) + if (NPC.CountNPCS(mod.NPCType("PhantomSpiritL")) < (revenge ? 3 : 2) && Main.netMode != NetmodeID.MultiplayerClient) { int num762 = NPC.NewNPC((int)vector.X, (int)vector.Y, mod.NPCType("PhantomSpiritL"), 0, 0f, 0f, 0f, 0f, 255); Main.npc[num762].velocity.X = num758; @@ -664,9 +664,9 @@ namespace CalamityMod.NPCs.Polterghast string key = "Mods.CalamityMod.GhostBossText"; Color messageColor = Color.RoyalBlue; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) Main.NewText(Language.GetTextValue(key), messageColor); - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -766,7 +766,7 @@ namespace CalamityMod.NPCs.Polterghast public override void HitEffect(int hitDirection, double damage) { - Dust.NewDust(npc.position, npc.width, npc.height, 180, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 180, hitDirection, -1f, 0, default, 1f); if (npc.life <= 0) { npc.position.X = npc.position.X + (float)(npc.width / 2); @@ -777,9 +777,9 @@ namespace CalamityMod.NPCs.Polterghast npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 60, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 60, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -787,10 +787,10 @@ namespace CalamityMod.NPCs.Polterghast } for (int num623 = 0; num623 < 60; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 180, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 180, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 180, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 180, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/Polterghast/PolterghastHook.cs b/NPCs/Polterghast/PolterghastHook.cs index 1cdfa9be75..0ac4b27dfe 100644 --- a/NPCs/Polterghast/PolterghastHook.cs +++ b/NPCs/Polterghast/PolterghastHook.cs @@ -86,7 +86,7 @@ namespace CalamityMod.NPCs.Polterghast phase2 = true; } npc.TargetClosest(true); - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { if (npc.ai[0] == 0f) { @@ -97,7 +97,7 @@ namespace CalamityMod.NPCs.Polterghast npc.ai[1] = (float)((int)(npc.Center.X / 16f)); } } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (npc.ai[0] == 0f || npc.ai[1] == 0f) { @@ -233,7 +233,7 @@ namespace CalamityMod.NPCs.Polterghast { npc.ai[3] = 0f; } - if (Main.netMode != 1 && npc.ai[2] == 20f) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == 20f) { float num151 = 5f; int num152 = 60; @@ -246,7 +246,7 @@ namespace CalamityMod.NPCs.Polterghast } return; } - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { if (npc.ai[0] == 0f) { @@ -257,7 +257,7 @@ namespace CalamityMod.NPCs.Polterghast npc.ai[1] = (float)((int)(npc.Center.X / 16f)); } } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (npc.ai[0] == 0f || npc.ai[1] == 0f) { @@ -469,13 +469,13 @@ namespace CalamityMod.NPCs.Polterghast { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 180, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 180, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 180, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 180, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/ProfanedGuardianBoss/ProfanedGuardianBoss.cs b/NPCs/ProfanedGuardianBoss/ProfanedGuardianBoss.cs index 976fbbad7f..a73f61cfdd 100644 --- a/NPCs/ProfanedGuardianBoss/ProfanedGuardianBoss.cs +++ b/NPCs/ProfanedGuardianBoss/ProfanedGuardianBoss.cs @@ -99,7 +99,7 @@ namespace CalamityMod.NPCs.ProfanedGuardianBoss Player player = Main.player[npc.target]; Vector2 vector = npc.Center; - if (Main.netMode != 1 && npc.localAI[1] == 0f) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[1] == 0f) { npc.localAI[1] = 1f; NPC.NewNPC((int)vector.X, (int)vector.Y, mod.NPCType("ProfanedGuardianBoss2"), 0, 0f, 0f, 0f, 0f, 255); @@ -179,13 +179,13 @@ namespace CalamityMod.NPCs.ProfanedGuardianBoss { if (Main.rand.Next(3) < num1009) { - int num1012 = Dust.NewDust(npc.Center - new Vector2((float)num1010), num1010 * 2, num1010 * 2, 244, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default(Color), 1.5f); + int num1012 = Dust.NewDust(npc.Center - new Vector2((float)num1010), num1010 * 2, num1010 * 2, 244, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default, 1.5f); Main.dust[num1012].noGravity = true; Main.dust[num1012].velocity *= 0.2f; Main.dust[num1012].fadeIn = 1f; } } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[0] += 1f + (2f * (1f - lifeRatio)); if (npc.localAI[0] >= 240f) @@ -313,7 +313,7 @@ namespace CalamityMod.NPCs.ProfanedGuardianBoss } else if (npc.ai[0] == 2f) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { dustTimer--; if (lifeRatio < 0.5f && dustTimer <= 0) @@ -453,7 +453,7 @@ namespace CalamityMod.NPCs.ProfanedGuardianBoss { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -463,7 +463,7 @@ namespace CalamityMod.NPCs.ProfanedGuardianBoss Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossA4"), 1f); for (int k = 0; k < 50; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/ProfanedGuardianBoss/ProfanedGuardianBoss2.cs b/NPCs/ProfanedGuardianBoss/ProfanedGuardianBoss2.cs index f634e5da10..c5455a881e 100644 --- a/NPCs/ProfanedGuardianBoss/ProfanedGuardianBoss2.cs +++ b/NPCs/ProfanedGuardianBoss/ProfanedGuardianBoss2.cs @@ -116,7 +116,7 @@ namespace CalamityMod.NPCs.ProfanedGuardianBoss { dustType = 160; } - int num1012 = Dust.NewDust(npc.Center - new Vector2((float)num1010), num1010 * 2, num1010 * 2, dustType, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default(Color), 1.5f); + int num1012 = Dust.NewDust(npc.Center - new Vector2((float)num1010), num1010 * 2, num1010 * 2, dustType, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default, 1.5f); Main.dust[num1012].noGravity = true; Main.dust[num1012].velocity *= 0.2f; Main.dust[num1012].fadeIn = 1f; @@ -148,7 +148,7 @@ namespace CalamityMod.NPCs.ProfanedGuardianBoss npc.velocity.Y = npc.velocity.Y * 1.15f; //1.05f npc.velocity.X = npc.velocity.X * 1.15f; //1.05f } - if (Main.netMode != 1 && ((expertMode && Main.rand.Next(50) == 0) || Main.rand.Next(100) == 0)) + if (Main.netMode != NetmodeID.MultiplayerClient && ((expertMode && Main.rand.NextBool(50)) || Main.rand.NextBool(100))) { npc.TargetClosest(true); vector96 = new Vector2(npc.Center.X, npc.Center.Y); @@ -179,7 +179,7 @@ namespace CalamityMod.NPCs.ProfanedGuardianBoss return; } } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[0] += expertMode ? 2f : 1f; if (npc.localAI[0] >= 420f) @@ -235,7 +235,7 @@ namespace CalamityMod.NPCs.ProfanedGuardianBoss { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -244,7 +244,7 @@ namespace CalamityMod.NPCs.ProfanedGuardianBoss Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossT3"), 1f); for (int k = 0; k < 50; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/ProfanedGuardianBoss/ProfanedGuardianBoss3.cs b/NPCs/ProfanedGuardianBoss/ProfanedGuardianBoss3.cs index c99ca24fc9..f3df268c66 100644 --- a/NPCs/ProfanedGuardianBoss/ProfanedGuardianBoss3.cs +++ b/NPCs/ProfanedGuardianBoss/ProfanedGuardianBoss3.cs @@ -116,7 +116,7 @@ namespace CalamityMod.NPCs.ProfanedGuardianBoss { dustType = 107; } - int num1012 = Dust.NewDust(npc.Center - new Vector2((float)num1010), num1010 * 2, num1010 * 2, dustType, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default(Color), 1.5f); + int num1012 = Dust.NewDust(npc.Center - new Vector2((float)num1010), num1010 * 2, num1010 * 2, dustType, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default, 1.5f); Main.dust[num1012].noGravity = true; Main.dust[num1012].velocity *= 0.2f; Main.dust[num1012].fadeIn = 1f; @@ -148,7 +148,7 @@ namespace CalamityMod.NPCs.ProfanedGuardianBoss npc.velocity.Y = npc.velocity.Y * 1.15f; //1.05f npc.velocity.X = npc.velocity.X * 1.15f; //1.05f } - if (Main.netMode != 1 && ((expertMode && Main.rand.Next(50) == 0) || Main.rand.Next(100) == 0)) + if (Main.netMode != NetmodeID.MultiplayerClient && ((expertMode && Main.rand.NextBool(50)) || Main.rand.NextBool(100))) { npc.TargetClosest(true); vector96 = new Vector2(npc.Center.X, npc.Center.Y); @@ -179,7 +179,7 @@ namespace CalamityMod.NPCs.ProfanedGuardianBoss return; } } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[0] += expertMode ? 2f : 1f; if (npc.localAI[0] >= 600f) @@ -235,7 +235,7 @@ namespace CalamityMod.NPCs.ProfanedGuardianBoss { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -246,7 +246,7 @@ namespace CalamityMod.NPCs.ProfanedGuardianBoss Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossH5"), 1f); for (int k = 0; k < 50; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Providence/ProvSpawnDefense.cs b/NPCs/Providence/ProvSpawnDefense.cs index 1ca1de8b97..b600720efb 100644 --- a/NPCs/Providence/ProvSpawnDefense.cs +++ b/NPCs/Providence/ProvSpawnDefense.cs @@ -95,7 +95,7 @@ namespace CalamityMod.NPCs.Providence { dustType = 160; } - int num1012 = Dust.NewDust(npc.Center - new Vector2((float)num1010), num1010 * 2, num1010 * 2, dustType, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default(Color), 0.5f); + int num1012 = Dust.NewDust(npc.Center - new Vector2((float)num1010), num1010 * 2, num1010 * 2, dustType, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default, 0.5f); Main.dust[num1012].noGravity = true; Main.dust[num1012].velocity *= 0.2f; Main.dust[num1012].fadeIn = 1f; @@ -148,7 +148,7 @@ namespace CalamityMod.NPCs.Providence { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -157,7 +157,7 @@ namespace CalamityMod.NPCs.Providence Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossT3"), 1f); for (int k = 0; k < 30; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Providence/ProvSpawnHealer.cs b/NPCs/Providence/ProvSpawnHealer.cs index ac24be6a6b..a88c59781a 100644 --- a/NPCs/Providence/ProvSpawnHealer.cs +++ b/NPCs/Providence/ProvSpawnHealer.cs @@ -95,7 +95,7 @@ namespace CalamityMod.NPCs.Providence { dustType = 107; } - int num1012 = Dust.NewDust(npc.Center - new Vector2((float)num1010), num1010 * 2, num1010 * 2, dustType, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default(Color), 0.5f); + int num1012 = Dust.NewDust(npc.Center - new Vector2((float)num1010), num1010 * 2, num1010 * 2, dustType, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default, 0.5f); Main.dust[num1012].noGravity = true; Main.dust[num1012].velocity *= 0.2f; Main.dust[num1012].fadeIn = 1f; @@ -121,7 +121,7 @@ namespace CalamityMod.NPCs.Providence npc.velocity.Y = npc.velocity.Y * 1.05f; //1.05f npc.velocity.X = npc.velocity.X * 1.05f; //1.05f } - if (Main.netMode != 1 && ((expertMode && Main.rand.Next(2000) == 0) || Main.rand.Next(1000) == 0)) + if (Main.netMode != NetmodeID.MultiplayerClient && ((expertMode && Main.rand.NextBool(2000)) || Main.rand.NextBool(1000))) { npc.TargetClosest(true); vector96 = new Vector2(npc.Center.X, npc.Center.Y); @@ -175,7 +175,7 @@ namespace CalamityMod.NPCs.Providence { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -186,7 +186,7 @@ namespace CalamityMod.NPCs.Providence Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossH5"), 1f); for (int k = 0; k < 50; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Providence/ProvSpawnOffense.cs b/NPCs/Providence/ProvSpawnOffense.cs index 7a3dd4730c..723272a0fb 100644 --- a/NPCs/Providence/ProvSpawnOffense.cs +++ b/NPCs/Providence/ProvSpawnOffense.cs @@ -106,7 +106,7 @@ namespace CalamityMod.NPCs.Providence { if (Main.rand.Next(3) < num1009) { - int num1012 = Dust.NewDust(npc.Center - new Vector2((float)num1010), num1010 * 2, num1010 * 2, 244, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default(Color), 0.5f); + int num1012 = Dust.NewDust(npc.Center - new Vector2((float)num1010), num1010 * 2, num1010 * 2, 244, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default, 0.5f); Main.dust[num1012].noGravity = true; Main.dust[num1012].velocity *= 0.2f; Main.dust[num1012].fadeIn = 1f; @@ -174,7 +174,7 @@ namespace CalamityMod.NPCs.Providence } else if (npc.ai[0] == 2f) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { dustTimer--; if (fireDust && dustTimer <= 0) @@ -299,7 +299,7 @@ namespace CalamityMod.NPCs.Providence { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -309,7 +309,7 @@ namespace CalamityMod.NPCs.Providence Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossA4"), 1f); for (int k = 0; k < 30; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 903ba34247..7b7cc44a9a 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -255,7 +255,7 @@ namespace CalamityMod.NPCs.Providence if (healTimer >= heal) { healTimer = 0; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int healAmt = npc.lifeMax / 200; if (healAmt > npc.lifeMax - npc.life) @@ -292,7 +292,7 @@ namespace CalamityMod.NPCs.Providence bossLife = (float)npc.lifeMax; if (npc.life > 0) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int num660 = (int)((double)npc.lifeMax * 0.66); if ((float)(npc.life + num660) < bossLife) @@ -555,7 +555,7 @@ namespace CalamityMod.NPCs.Providence if (npc.ai[3] >= (float)num856) npc.ai[3] = (float)(-(float)num856); - if (npc.ai[3] == 0f && Main.netMode != 1) + if (npc.ai[3] == 0f && Main.netMode != NetmodeID.MultiplayerClient) { vector.X += npc.velocity.X * 7f; float num857 = player.position.X + (float)player.width * 0.5f - vector.X; @@ -580,7 +580,7 @@ namespace CalamityMod.NPCs.Providence else if (npc.ai[3] < 0f) npc.ai[3] += 1f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.ai[1] += 1f; if (npc.ai[1] >= 300f) @@ -594,7 +594,7 @@ namespace CalamityMod.NPCs.Providence npc.noGravity = true; npc.noTileCollide = true; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.ai[3] += 1f; @@ -621,7 +621,7 @@ namespace CalamityMod.NPCs.Providence } } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.ai[1] += 1f; if (npc.ai[1] >= 300f) @@ -663,9 +663,9 @@ namespace CalamityMod.NPCs.Providence { npc.ai[3] = 0f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { - if (Main.rand.Next(4) == 0 && !CalamityWorld.death && !CalamityWorld.bossRushActive) + if (Main.rand.NextBool(4) && !CalamityWorld.death && !CalamityWorld.bossRushActive) Projectile.NewProjectile(vector114.X, vector114.Y, num866, num867, mod.ProjectileType("HolyLight"), 0, 0f, Main.myPlayer, 0f, 0f); else Projectile.NewProjectile(vector114.X, vector114.Y, num866, num867, mod.ProjectileType("HolyBurnOrb"), 0, 0f, Main.myPlayer, 0f, 0f); @@ -680,16 +680,16 @@ namespace CalamityMod.NPCs.Providence string key = "Mods.CalamityMod.ProfanedBossText"; Color messageColor = Color.Orange; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) Main.NewText(Language.GetTextValue(key), messageColor); - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } // Inflict Icarus Folly if (npc.ai[1] >= 600f) { - if (Main.netMode != 2) + if (Main.netMode != NetmodeID.Server) { Player player2 = Main.player[Main.myPlayer]; bool inLiquid = (player2.wet || player2.honeyWet) && !player2.lavaWet; @@ -702,9 +702,9 @@ namespace CalamityMod.NPCs.Providence for (int num621 = 0; num621 < 40; num621++) { int num622 = Dust.NewDust(new Vector2(player2.position.X, player2.position.Y), - player2.width, player2.height, 244, 0f, 0f, 100, default(Color), 2f); + player2.width, player2.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -714,11 +714,11 @@ namespace CalamityMod.NPCs.Providence for (int num623 = 0; num623 < 60; num623++) { int num624 = Dust.NewDust(new Vector2(player2.position.X, player2.position.Y), - player2.width, player2.height, 244, 0f, 0f, 100, default(Color), 3f); + player2.width, player2.height, 244, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; num624 = Dust.NewDust(new Vector2(player2.position.X, player2.position.Y), - player2.width, player2.height, 244, 0f, 0f, 100, default(Color), 2f); + player2.width, player2.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } @@ -749,7 +749,7 @@ namespace CalamityMod.NPCs.Providence if (npc.ai[3] >= (float)num856) npc.ai[3] = (float)(-(float)num856); - if (npc.ai[3] == 0f && Main.netMode != 1) + if (npc.ai[3] == 0f && Main.netMode != NetmodeID.MultiplayerClient) { vector.X += npc.velocity.X * 7f; float num857 = player.position.X + (float)player.width * 0.5f - vector.X; @@ -774,7 +774,7 @@ namespace CalamityMod.NPCs.Providence else if (npc.ai[3] < 0f) npc.ai[3] += 1f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.ai[1] += 1f; if (npc.ai[1] >= 300f) @@ -788,7 +788,7 @@ namespace CalamityMod.NPCs.Providence npc.noGravity = true; npc.noTileCollide = true; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.ai[3] += 1f; @@ -815,7 +815,7 @@ namespace CalamityMod.NPCs.Providence } } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.ai[1] += 1f; if (npc.ai[1] >= 300f) @@ -833,7 +833,7 @@ namespace CalamityMod.NPCs.Providence npc.velocity *= 0.95f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.ai[2] += ((npc.GetGlobalNPC(mod).enraged || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive)) ? 2f : 1f) + (2f * (1f - lifeRatio)); @@ -864,7 +864,7 @@ namespace CalamityMod.NPCs.Providence } } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.ai[1] += 1f; if (npc.ai[1] >= 300f) @@ -882,7 +882,7 @@ namespace CalamityMod.NPCs.Providence npc.velocity *= 0.95f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.ai[1] += 1f; if (npc.ai[1] >= 60f) @@ -925,7 +925,7 @@ namespace CalamityMod.NPCs.Providence num1223 = 2.8f; Vector2 vector199 = vector + ((float)Main.rand.NextDouble() * 6.28318548f).ToRotationVector2() * value19 / 2f; - int num1224 = Dust.NewDust(vector199 - Vector2.One * 8f, 16, 16, num1222, npc.velocity.X / 2f, npc.velocity.Y / 2f, 0, default(Color), 1f); + int num1224 = Dust.NewDust(vector199 - Vector2.One * 8f, 16, 16, num1222, npc.velocity.X / 2f, npc.velocity.Y / 2f, 0, default, 1f); Main.dust[num1224].velocity = Vector2.Normalize(vector - vector199) * 3.5f * (10f - (float)num1220 * 2f) / 10f; Main.dust[num1224].noGravity = true; Main.dust[num1224].scale = num1223; @@ -939,7 +939,7 @@ namespace CalamityMod.NPCs.Providence if (Main.player[Main.myPlayer].active && !Main.player[Main.myPlayer].dead && Vector2.Distance(Main.player[Main.myPlayer].Center, vector) < 2800f) Main.PlaySound(29, (int)Main.player[Main.myPlayer].position.X, (int)Main.player[Main.myPlayer].position.Y, 104, 1f, 0f); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.TargetClosest(false); @@ -950,7 +950,7 @@ namespace CalamityMod.NPCs.Providence if (vector200.X < 0f) num1225 = 1f; - vector200 = vector200.RotatedBy((double)(-(double)num1225 * 6.28318548f / 6f), default(Vector2)); + vector200 = vector200.RotatedBy((double)(-(double)num1225 * 6.28318548f / 6f), default); Projectile.NewProjectile(vector.X, vector.Y - 32f, vector200.X, vector200.Y, mod.ProjectileType("ProvidenceHolyRay"), 100, 0f, Main.myPlayer, num1225 * 6.28318548f / rotation, (float)npc.whoAmI); if (revenge) @@ -981,7 +981,7 @@ namespace CalamityMod.NPCs.Providence npc.localAI[1] = 0f; } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.ai[1] += 1f; if (npc.ai[1] >= (revenge ? 235f : 315f)) @@ -1030,7 +1030,7 @@ namespace CalamityMod.NPCs.Providence DropHelper.DropItem(npc, mod.ItemType("RuneofCos")); } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { SpawnLootBox(); } @@ -1045,12 +1045,12 @@ namespace CalamityMod.NPCs.Providence WorldGenerationMethods.SpawnOre(mod.TileType("UelibloomOre"), 15E-05, .4f, .8f); - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key2), messageColor2); Main.NewText(Language.GetTextValue(key3), messageColor3); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key2), messageColor2); NetMessage.BroadcastChatMessage(NetworkText.FromKey(key3), messageColor3); @@ -1080,7 +1080,7 @@ namespace CalamityMod.NPCs.Providence Main.tile[x, y].lava(false); Main.tile[x, y].liquid = 0; - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) NetMessage.SendTileSquare(-1, x, y, 1, TileChangeType.None); else WorldGen.SquareTileFrame(x, y, true); @@ -1208,7 +1208,7 @@ namespace CalamityMod.NPCs.Providence public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 15; k++) - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); if (npc.life <= 0) { @@ -1225,9 +1225,9 @@ namespace CalamityMod.NPCs.Providence npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 60; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 244, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -1235,10 +1235,10 @@ namespace CalamityMod.NPCs.Providence } for (int num623 = 0; num623 < 90; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 244, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 244, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 244, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/Scavenger/FlamePillar.cs b/NPCs/Scavenger/FlamePillar.cs index 7bd492a2e2..8dc0e921e5 100644 --- a/NPCs/Scavenger/FlamePillar.cs +++ b/NPCs/Scavenger/FlamePillar.cs @@ -95,7 +95,7 @@ namespace CalamityMod.NPCs.Scavenger float SpeedY = (float)Main.rand.Next(-12, -8); if (npc.localAI[0] >= 60f) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { Vector2 shootFromVector = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); int damage = Main.expertMode ? 32 : 45; @@ -142,9 +142,9 @@ namespace CalamityMod.NPCs.Scavenger npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 30; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 135, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 135, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -152,10 +152,10 @@ namespace CalamityMod.NPCs.Scavenger } for (int num623 = 0; num623 < 30; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 1, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 1, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 8, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 8, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/Scavenger/RockPillar.cs b/NPCs/Scavenger/RockPillar.cs index 52c977b475..2177399dfe 100644 --- a/NPCs/Scavenger/RockPillar.cs +++ b/NPCs/Scavenger/RockPillar.cs @@ -181,9 +181,9 @@ namespace CalamityMod.NPCs.Scavenger npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 30; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 8, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 8, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -191,10 +191,10 @@ namespace CalamityMod.NPCs.Scavenger } for (int num623 = 0; num623 < 30; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 1, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 1, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 8, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 8, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/Scavenger/ScavengerBody.cs b/NPCs/Scavenger/ScavengerBody.cs index e4ebf0a3db..74049746a7 100644 --- a/NPCs/Scavenger/ScavengerBody.cs +++ b/NPCs/Scavenger/ScavengerBody.cs @@ -107,7 +107,7 @@ namespace CalamityMod.NPCs.Scavenger CalamityGlobalNPC.scavenger = npc.whoAmI; - if (npc.localAI[0] == 0f && Main.netMode != 1) + if (npc.localAI[0] == 0f && Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[0] = 1f; NPC.NewNPC((int)npc.Center.X - 70, (int)npc.Center.Y + 88, mod.NPCType("ScavengerLegLeft"), 0, 0f, 0f, 0f, 0f, 255); @@ -162,7 +162,7 @@ namespace CalamityMod.NPCs.Scavenger else { npc.dontTakeDamage = false; - if (Main.netMode != 2) + if (Main.netMode != NetmodeID.Server) { if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active) Main.player[Main.myPlayer].AddBuff(mod.BuffType("WeakPetrification"), 2); @@ -171,7 +171,7 @@ namespace CalamityMod.NPCs.Scavenger if (!headActive) { - int rightDust = Dust.NewDust(new Vector2(npc.Center.X, npc.Center.Y - 30f), 8, 8, 5, 0f, 0f, 100, default(Color), 2.5f); + int rightDust = Dust.NewDust(new Vector2(npc.Center.X, npc.Center.Y - 30f), 8, 8, 5, 0f, 0f, 100, default, 2.5f); Main.dust[rightDust].alpha += Main.rand.Next(100); Main.dust[rightDust].velocity *= 0.2f; @@ -179,9 +179,9 @@ namespace CalamityMod.NPCs.Scavenger rightDustExpr.velocity.Y = rightDustExpr.velocity.Y - (3f + (float)Main.rand.Next(10) * 0.1f); Main.dust[rightDust].fadeIn = 0.5f + (float)Main.rand.Next(10) * 0.1f; - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { - rightDust = Dust.NewDust(new Vector2(npc.Center.X, npc.Center.Y - 30f), 8, 8, 6, 0f, 0f, 0, default(Color), 1.5f); + rightDust = Dust.NewDust(new Vector2(npc.Center.X, npc.Center.Y - 30f), 8, 8, 6, 0f, 0f, 0, default, 1.5f); if (Main.rand.Next(20) != 0) { Main.dust[rightDust].noGravity = true; @@ -191,7 +191,7 @@ namespace CalamityMod.NPCs.Scavenger } } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[1] += (enrage ? 6f : 1f); if (npc.localAI[1] >= 600f) @@ -220,7 +220,7 @@ namespace CalamityMod.NPCs.Scavenger if (!rightClawActive) { - int rightDust = Dust.NewDust(new Vector2(npc.Center.X + 80f, npc.Center.Y + 45f), 8, 8, 5, 0f, 0f, 100, default(Color), 3f); + int rightDust = Dust.NewDust(new Vector2(npc.Center.X + 80f, npc.Center.Y + 45f), 8, 8, 5, 0f, 0f, 100, default, 3f); Main.dust[rightDust].alpha += Main.rand.Next(100); Main.dust[rightDust].velocity *= 0.2f; @@ -228,9 +228,9 @@ namespace CalamityMod.NPCs.Scavenger rightDustExpr.velocity.X = rightDustExpr.velocity.X + (3f + (float)Main.rand.Next(10) * 0.1f); Main.dust[rightDust].fadeIn = 0.5f + (float)Main.rand.Next(10) * 0.1f; - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { - rightDust = Dust.NewDust(new Vector2(npc.Center.X + 80f, npc.Center.Y + 45f), 8, 8, 6, 0f, 0f, 0, default(Color), 2f); + rightDust = Dust.NewDust(new Vector2(npc.Center.X + 80f, npc.Center.Y + 45f), 8, 8, 6, 0f, 0f, 0, default, 2f); if (Main.rand.Next(20) != 0) { Main.dust[rightDust].noGravity = true; @@ -240,7 +240,7 @@ namespace CalamityMod.NPCs.Scavenger } } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[2] += (enrage ? 2f : 1f); if (npc.localAI[2] >= 480f) @@ -256,7 +256,7 @@ namespace CalamityMod.NPCs.Scavenger if (!leftClawActive) { - int leftDust = Dust.NewDust(new Vector2(npc.Center.X - 80f, npc.Center.Y + 45f), 8, 8, 5, 0f, 0f, 100, default(Color), 3f); + int leftDust = Dust.NewDust(new Vector2(npc.Center.X - 80f, npc.Center.Y + 45f), 8, 8, 5, 0f, 0f, 100, default, 3f); Main.dust[leftDust].alpha += Main.rand.Next(100); Main.dust[leftDust].velocity *= 0.2f; @@ -264,9 +264,9 @@ namespace CalamityMod.NPCs.Scavenger leftDustExpr.velocity.X = leftDustExpr.velocity.X - (3f + (float)Main.rand.Next(10) * 0.1f); Main.dust[leftDust].fadeIn = 0.5f + (float)Main.rand.Next(10) * 0.1f; - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { - leftDust = Dust.NewDust(new Vector2(npc.Center.X - 80f, npc.Center.Y + 45f), 8, 8, 6, 0f, 0f, 0, default(Color), 2f); + leftDust = Dust.NewDust(new Vector2(npc.Center.X - 80f, npc.Center.Y + 45f), 8, 8, 6, 0f, 0f, 0, default, 2f); if (Main.rand.Next(20) != 0) { Main.dust[leftDust].noGravity = true; @@ -276,7 +276,7 @@ namespace CalamityMod.NPCs.Scavenger } } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[3] += (enrage ? 2f : 1f); if (npc.localAI[3] >= 480f) @@ -292,7 +292,7 @@ namespace CalamityMod.NPCs.Scavenger if (!rightLegActive) { - int rightDust = Dust.NewDust(new Vector2(npc.Center.X + 60f, npc.Center.Y + 60f), 8, 8, 5, 0f, 0f, 100, default(Color), 2f); + int rightDust = Dust.NewDust(new Vector2(npc.Center.X + 60f, npc.Center.Y + 60f), 8, 8, 5, 0f, 0f, 100, default, 2f); Main.dust[rightDust].alpha += Main.rand.Next(100); Main.dust[rightDust].velocity *= 0.2f; @@ -300,9 +300,9 @@ namespace CalamityMod.NPCs.Scavenger rightDustExpr.velocity.Y = rightDustExpr.velocity.Y + (0.5f + (float)Main.rand.Next(10) * 0.1f); Main.dust[rightDust].fadeIn = 0.5f + (float)Main.rand.Next(10) * 0.1f; - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { - rightDust = Dust.NewDust(new Vector2(npc.Center.X + 60f, npc.Center.Y + 60f), 8, 8, 6, 0f, 0f, 0, default(Color), 1.5f); + rightDust = Dust.NewDust(new Vector2(npc.Center.X + 60f, npc.Center.Y + 60f), 8, 8, 6, 0f, 0f, 0, default, 1.5f); if (Main.rand.Next(20) != 0) { Main.dust[rightDust].noGravity = true; @@ -312,7 +312,7 @@ namespace CalamityMod.NPCs.Scavenger } } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.ai[2] += 1f; if (npc.ai[2] >= 300f) @@ -328,7 +328,7 @@ namespace CalamityMod.NPCs.Scavenger if (!leftLegActive) { - int leftDust = Dust.NewDust(new Vector2(npc.Center.X - 60f, npc.Center.Y + 60f), 8, 8, 5, 0f, 0f, 100, default(Color), 2f); + int leftDust = Dust.NewDust(new Vector2(npc.Center.X - 60f, npc.Center.Y + 60f), 8, 8, 5, 0f, 0f, 100, default, 2f); Main.dust[leftDust].alpha += Main.rand.Next(100); Main.dust[leftDust].velocity *= 0.2f; @@ -336,9 +336,9 @@ namespace CalamityMod.NPCs.Scavenger leftDustExpr.velocity.Y = leftDustExpr.velocity.Y + (0.5f + (float)Main.rand.Next(10) * 0.1f); Main.dust[leftDust].fadeIn = 0.5f + (float)Main.rand.Next(10) * 0.1f; - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { - leftDust = Dust.NewDust(new Vector2(npc.Center.X - 60f, npc.Center.Y + 60f), 8, 8, 6, 0f, 0f, 0, default(Color), 1.5f); + leftDust = Dust.NewDust(new Vector2(npc.Center.X - 60f, npc.Center.Y + 60f), 8, 8, 6, 0f, 0f, 0, default, 1.5f); if (Main.rand.Next(20) != 0) { Main.dust[leftDust].noGravity = true; @@ -348,7 +348,7 @@ namespace CalamityMod.NPCs.Scavenger } } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.ai[3] += 1f; if (npc.ai[3] >= 300f) @@ -403,7 +403,7 @@ namespace CalamityMod.NPCs.Scavenger npc.ai[0] = 0f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (NPC.CountNPCS(mod.NPCType("RockPillar")) < 2) { @@ -422,11 +422,11 @@ namespace CalamityMod.NPCs.Scavenger { for (int stompDustAmount = 0; stompDustAmount < 6; stompDustAmount++) { - int stompDust = Dust.NewDust(new Vector2(npc.position.X - 30f, npc.position.Y + (float)npc.height), npc.width + 30, 4, 31, 0f, 0f, 100, default(Color), 1.5f); + int stompDust = Dust.NewDust(new Vector2(npc.position.X - 30f, npc.position.Y + (float)npc.height), npc.width + 30, 4, 31, 0f, 0f, 100, default, 1.5f); Main.dust[stompDust].velocity *= 0.2f; } - int stompGore = Gore.NewGore(new Vector2((float)(stompDustArea - 30), npc.position.Y + (float)npc.height - 12f), default(Vector2), Main.rand.Next(61, 64), 1f); + int stompGore = Gore.NewGore(new Vector2((float)(stompDustArea - 30), npc.position.Y + (float)npc.height - 12f), default, Main.rand.Next(61, 64), 1f); Main.gore[stompGore].velocity *= 0.4f; } } @@ -514,15 +514,15 @@ namespace CalamityMod.NPCs.Scavenger Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)center.X / 16, (int)(center.Y / 16f)); Main.spriteBatch.Draw(mod.GetTexture("NPCs/Scavenger/ScavengerLegRight"), new Vector2(center.X - Main.screenPosition.X + 28f, center.Y - Main.screenPosition.Y + 20f), //72 new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, mod.GetTexture("NPCs/Scavenger/ScavengerLegRight").Width, mod.GetTexture("NPCs/Scavenger/ScavengerLegRight").Height)), - color2, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + color2, 0f, default, 1f, SpriteEffects.None, 0f); Main.spriteBatch.Draw(mod.GetTexture("NPCs/Scavenger/ScavengerLegLeft"), new Vector2(center.X - Main.screenPosition.X - 112f, center.Y - Main.screenPosition.Y + 20f), //72 new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, mod.GetTexture("NPCs/Scavenger/ScavengerLegLeft").Width, mod.GetTexture("NPCs/Scavenger/ScavengerLegLeft").Height)), - color2, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + color2, 0f, default, 1f, SpriteEffects.None, 0f); if (NPC.CountNPCS(mod.NPCType("ScavengerHead")) > 0) { Main.spriteBatch.Draw(mod.GetTexture("NPCs/Scavenger/ScavengerHead"), new Vector2(center.X - Main.screenPosition.X - 70f, center.Y - Main.screenPosition.Y - 75f), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, mod.GetTexture("NPCs/Scavenger/ScavengerHead").Width, mod.GetTexture("NPCs/Scavenger/ScavengerHead").Height)), - color2, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + color2, 0f, default, 1f, SpriteEffects.None, 0f); } } @@ -536,8 +536,8 @@ namespace CalamityMod.NPCs.Scavenger { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 2f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 2f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -548,8 +548,8 @@ namespace CalamityMod.NPCs.Scavenger Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGores/ScavengerBody5"), 1f); for (int k = 0; k < 50; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 2f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 2f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Scavenger/ScavengerClawLeft.cs b/NPCs/Scavenger/ScavengerClawLeft.cs index 0cb9f984ea..ac7aa00aa8 100644 --- a/NPCs/Scavenger/ScavengerClawLeft.cs +++ b/NPCs/Scavenger/ScavengerClawLeft.cs @@ -314,7 +314,7 @@ namespace CalamityMod.NPCs.Scavenger int num285 = 0; while ((double)num285 < damage / (double)npc.lifeMax * 100.0) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default, 1f); num285++; } } diff --git a/NPCs/Scavenger/ScavengerClawRight.cs b/NPCs/Scavenger/ScavengerClawRight.cs index b1d801ab6d..44b7b2b550 100644 --- a/NPCs/Scavenger/ScavengerClawRight.cs +++ b/NPCs/Scavenger/ScavengerClawRight.cs @@ -314,7 +314,7 @@ namespace CalamityMod.NPCs.Scavenger int num285 = 0; while ((double)num285 < damage / (double)npc.lifeMax * 100.0) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default, 1f); num285++; } } diff --git a/NPCs/Scavenger/ScavengerHead.cs b/NPCs/Scavenger/ScavengerHead.cs index c7265ad5fd..b05af65209 100644 --- a/NPCs/Scavenger/ScavengerHead.cs +++ b/NPCs/Scavenger/ScavengerHead.cs @@ -121,7 +121,7 @@ namespace CalamityMod.NPCs.Scavenger playerDistanceY *= totalPlayerDistance; int nukeDamage = expertMode ? 40 : 60; int projectileType = mod.ProjectileType("ScavengerNuke"); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int nuke = Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, playerDistanceX, playerDistanceY, projectileType, nukeDamage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); Main.projectile[nuke].velocity.Y = -15f; @@ -141,11 +141,11 @@ namespace CalamityMod.NPCs.Scavenger int num285 = 0; while ((double)num285 < damage / (double)npc.lifeMax * 100.0) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default, 1f); num285++; } } - else if (Main.netMode != 1) + else if (Main.netMode != NetmodeID.MultiplayerClient) { NPC.NewNPC((int)npc.Center.X, (int)npc.position.Y + npc.height, mod.NPCType("ScavengerHead2"), npc.whoAmI, 0f, 0f, 0f, 0f, 255); } diff --git a/NPCs/Scavenger/ScavengerHead2.cs b/NPCs/Scavenger/ScavengerHead2.cs index fb7bcab80f..58b4383671 100644 --- a/NPCs/Scavenger/ScavengerHead2.cs +++ b/NPCs/Scavenger/ScavengerHead2.cs @@ -152,7 +152,7 @@ namespace CalamityMod.NPCs.Scavenger playerDistanceY *= totalPlayerDistance; int nukeDamage = Main.expertMode ? 40 : 60; int projectileType = mod.ProjectileType("ScavengerNuke"); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int nuke = Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, playerDistanceX, playerDistanceY, projectileType, nukeDamage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); } @@ -174,7 +174,7 @@ namespace CalamityMod.NPCs.Scavenger { npc.localAI[1] += 1f; } - if (Main.netMode != 1 && npc.localAI[0] >= 900f) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] >= 900f) { npc.localAI[0] = 0f; if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) @@ -189,7 +189,7 @@ namespace CalamityMod.NPCs.Scavenger Projectile.NewProjectile(vector.X, vector.Y, num4, num5, num9, num8 + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); } } - if (Main.netMode != 1 && npc.localAI[1] >= 30f) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[1] >= 30f) { npc.localAI[1] = 0f; if (!Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) @@ -268,8 +268,8 @@ namespace CalamityMod.NPCs.Scavenger { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -278,8 +278,8 @@ namespace CalamityMod.NPCs.Scavenger Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGores/ScavengerHead3"), 1f); for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Scavenger/ScavengerLegLeft.cs b/NPCs/Scavenger/ScavengerLegLeft.cs index c79798d471..9985f016a2 100644 --- a/NPCs/Scavenger/ScavengerLegLeft.cs +++ b/NPCs/Scavenger/ScavengerLegLeft.cs @@ -84,7 +84,7 @@ namespace CalamityMod.NPCs.Scavenger } if (Main.npc[CalamityGlobalNPC.scavenger].ai[0] == 1f && Main.npc[CalamityGlobalNPC.scavenger].velocity.Y == 0f) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int smash = Projectile.NewProjectile((float)center.X, (float)center.Y, 0f, 0f, mod.ProjectileType("HiveExplosion"), 35 + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); Main.projectile[smash].timeLeft = 30; @@ -137,8 +137,8 @@ namespace CalamityMod.NPCs.Scavenger { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -146,8 +146,8 @@ namespace CalamityMod.NPCs.Scavenger Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGores/ScavengerLegLeft2"), 1f); for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Scavenger/ScavengerLegRight.cs b/NPCs/Scavenger/ScavengerLegRight.cs index e01b350614..7589b11421 100644 --- a/NPCs/Scavenger/ScavengerLegRight.cs +++ b/NPCs/Scavenger/ScavengerLegRight.cs @@ -84,7 +84,7 @@ namespace CalamityMod.NPCs.Scavenger } if (Main.npc[CalamityGlobalNPC.scavenger].ai[0] == 1f && Main.npc[CalamityGlobalNPC.scavenger].velocity.Y == 0f) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int smash = Projectile.NewProjectile((float)center.X, (float)center.Y, 0f, 0f, mod.ProjectileType("HiveExplosion"), 35 + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); Main.projectile[smash].timeLeft = 30; @@ -137,8 +137,8 @@ namespace CalamityMod.NPCs.Scavenger { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -146,8 +146,8 @@ namespace CalamityMod.NPCs.Scavenger Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGores/ScavengerLegRight2"), 1f); for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/SlimeGod/SlimeGod.cs b/NPCs/SlimeGod/SlimeGod.cs index e4fa2a02d0..569372aa20 100644 --- a/NPCs/SlimeGod/SlimeGod.cs +++ b/NPCs/SlimeGod/SlimeGod.cs @@ -65,7 +65,7 @@ namespace CalamityMod.NPCs.SlimeGod npc.position.X = (float)(Main.player[npc.target].Center.X / 16) * 16f - (float)(npc.width / 2); npc.position.Y = ((float)(Main.player[npc.target].Center.Y / 16) * 16f - (float)(npc.height / 2)) - 150f; } - if ((double)npc.life <= (double)npc.lifeMax * 0.5 && Main.netMode != 1) + if ((double)npc.life <= (double)npc.lifeMax * 0.5 && Main.netMode != NetmodeID.MultiplayerClient) { Main.PlaySound(4, (int)npc.position.X, (int)npc.position.Y, 1); Vector2 spawnAt = vector + new Vector2(0f, (float)npc.height / 2f); @@ -89,10 +89,10 @@ namespace CalamityMod.NPCs.SlimeGod flag100 = false; hyperMode = true; } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[0] += flag100 ? 1f : 2f; - if (expertMode && Main.rand.Next(2) == 0) + if (expertMode && Main.rand.NextBool(2)) { if (npc.localAI[0] >= 600f) { @@ -249,7 +249,7 @@ namespace CalamityMod.NPCs.SlimeGod } } npc.ai[2] += 1f; - if ((double)npc.ai[2] > 360.0 && npc.velocity.Y == 0f && Main.netMode != 1) + if ((double)npc.ai[2] > 360.0 && npc.velocity.Y == 0f && Main.netMode != NetmodeID.MultiplayerClient) { int num1882 = Main.rand.Next(3); if (num1882 == 0) @@ -503,7 +503,7 @@ namespace CalamityMod.NPCs.SlimeGod npc.position.X = npc.position.X - (float)(npc.width / 2); npc.position.Y = npc.position.Y - (float)npc.height; } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int num660 = (int)((double)npc.lifeMax * 0.15); if ((float)(npc.life + num660) < bossLife) @@ -521,7 +521,7 @@ namespace CalamityMod.NPCs.SlimeGod Main.npc[num664].velocity.Y = (float)Main.rand.Next(-30, 1) * 0.1f; Main.npc[num664].ai[0] = (float)(-1000 * Main.rand.Next(3)); Main.npc[num664].ai[1] = 0f; - if (Main.netMode == 2 && num664 < 200) + if (Main.netMode == NetmodeID.Server && num664 < 200) { NetMessage.SendData(23, -1, -1, null, num664, 0f, 0f, 0f, 0, 0, 0); } @@ -562,7 +562,7 @@ namespace CalamityMod.NPCs.SlimeGod { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default, 1f); } } diff --git a/NPCs/SlimeGod/SlimeGodCore.cs b/NPCs/SlimeGod/SlimeGodCore.cs index 7706bacfb2..c91e141841 100644 --- a/NPCs/SlimeGod/SlimeGodCore.cs +++ b/NPCs/SlimeGod/SlimeGodCore.cs @@ -126,10 +126,10 @@ namespace CalamityMod.NPCs.SlimeGod if (!flag100) { npc.damage = expertMode ? 128 : 80; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[1] += ((npc.GetGlobalNPC(mod).enraged || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive)) ? 2f : 1f); - if (expertMode && Main.rand.Next(2) == 0) + if (expertMode && Main.rand.NextBool(2)) { if (npc.localAI[0] >= 75f) { @@ -382,7 +382,7 @@ namespace CalamityMod.NPCs.SlimeGod { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -394,9 +394,9 @@ namespace CalamityMod.NPCs.SlimeGod npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 4, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 4, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -404,10 +404,10 @@ namespace CalamityMod.NPCs.SlimeGod } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 4, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 4, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 4, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 4, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/SlimeGod/SlimeGodRun.cs b/NPCs/SlimeGod/SlimeGodRun.cs index 7b51c2f275..6941f2fb73 100644 --- a/NPCs/SlimeGod/SlimeGodRun.cs +++ b/NPCs/SlimeGod/SlimeGodRun.cs @@ -68,7 +68,7 @@ namespace CalamityMod.NPCs.SlimeGod npc.position.X = (float)(Main.player[npc.target].Center.X / 16) * 16f - (float)(npc.width / 2); npc.position.Y = ((float)(Main.player[npc.target].Center.Y / 16) * 16f - (float)(npc.height / 2)) - 150f; } - if ((double)npc.life <= (double)npc.lifeMax * 0.5 && Main.netMode != 1) + if ((double)npc.life <= (double)npc.lifeMax * 0.5 && Main.netMode != NetmodeID.MultiplayerClient) { Main.PlaySound(4, (int)npc.position.X, (int)npc.position.Y, 1); Vector2 spawnAt = vector + new Vector2(0f, (float)npc.height / 2f); @@ -100,7 +100,7 @@ namespace CalamityMod.NPCs.SlimeGod { npc.defense = 20; } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (!flag100) { @@ -114,7 +114,7 @@ namespace CalamityMod.NPCs.SlimeGod { npc.localAI[0] += 1f; } - if (expertMode && Main.rand.Next(2) == 0) + if (expertMode && Main.rand.NextBool(2)) { if (npc.localAI[0] >= 450f) { @@ -275,7 +275,7 @@ namespace CalamityMod.NPCs.SlimeGod } } npc.ai[2] += 1f; - if ((double)npc.ai[2] > 300.0 && npc.velocity.Y == 0f && Main.netMode != 1) + if ((double)npc.ai[2] > 300.0 && npc.velocity.Y == 0f && Main.netMode != NetmodeID.MultiplayerClient) { int num1882 = Main.rand.Next(3); if (num1882 == 0) @@ -528,7 +528,7 @@ namespace CalamityMod.NPCs.SlimeGod npc.position.X = npc.position.X - (float)(npc.width / 2); npc.position.Y = npc.position.Y - (float)npc.height; } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int num660 = (int)((double)npc.lifeMax * 0.05); if ((float)(npc.life + num660) < bossLife) @@ -540,7 +540,7 @@ namespace CalamityMod.NPCs.SlimeGod int x = (int)(npc.position.X + (float)Main.rand.Next(npc.width - 32)); int y = (int)(npc.position.Y + (float)Main.rand.Next(npc.height - 32)); int num663 = mod.NPCType("SlimeSpawnCrimson"); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { num663 = mod.NPCType("SlimeSpawnCrimson2"); } @@ -550,7 +550,7 @@ namespace CalamityMod.NPCs.SlimeGod Main.npc[num664].velocity.Y = (float)Main.rand.Next(-30, 1) * 0.1f; Main.npc[num664].ai[0] = (float)(-1000 * Main.rand.Next(3)); Main.npc[num664].ai[1] = 0f; - if (Main.netMode == 2 && num664 < 200) + if (Main.netMode == NetmodeID.Server && num664 < 200) { NetMessage.SendData(23, -1, -1, null, num664, 0f, 0f, 0f, 0, 0, 0); } @@ -591,7 +591,7 @@ namespace CalamityMod.NPCs.SlimeGod { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default, 1f); } } diff --git a/NPCs/SlimeGod/SlimeGodRunSplit.cs b/NPCs/SlimeGod/SlimeGodRunSplit.cs index f352ee52aa..786666219b 100644 --- a/NPCs/SlimeGod/SlimeGodRunSplit.cs +++ b/NPCs/SlimeGod/SlimeGodRunSplit.cs @@ -85,7 +85,7 @@ namespace CalamityMod.NPCs.SlimeGod { npc.defense = 15; } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (!flag100) { @@ -95,7 +95,7 @@ namespace CalamityMod.NPCs.SlimeGod { npc.localAI[0] += 1f; } - if (expertMode && Main.rand.Next(2) == 0) + if (expertMode && Main.rand.NextBool(2)) { if (npc.localAI[0] >= 450f) { @@ -250,7 +250,7 @@ namespace CalamityMod.NPCs.SlimeGod } } npc.ai[2] += 1f; - if ((double)npc.ai[2] > 240.0 && npc.velocity.Y == 0f && Main.netMode != 1) + if ((double)npc.ai[2] > 240.0 && npc.velocity.Y == 0f && Main.netMode != NetmodeID.MultiplayerClient) { int num1882 = Main.rand.Next(3); if (num1882 == 0) @@ -503,7 +503,7 @@ namespace CalamityMod.NPCs.SlimeGod npc.position.X = npc.position.X - (float)(npc.width / 2); npc.position.Y = npc.position.Y - (float)npc.height; } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int num660 = (int)((double)npc.lifeMax * 0.05); if ((float)(npc.life + num660) < bossLife) @@ -515,7 +515,7 @@ namespace CalamityMod.NPCs.SlimeGod int x = (int)(npc.position.X + (float)Main.rand.Next(npc.width - 32)); int y = (int)(npc.position.Y + (float)Main.rand.Next(npc.height - 32)); int num663 = mod.NPCType("SlimeSpawnCrimson"); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { num663 = mod.NPCType("SlimeSpawnCrimson2"); } @@ -525,7 +525,7 @@ namespace CalamityMod.NPCs.SlimeGod Main.npc[num664].velocity.Y = (float)Main.rand.Next(-30, 1) * 0.1f; Main.npc[num664].ai[0] = (float)(-1000 * Main.rand.Next(3)); Main.npc[num664].ai[1] = 0f; - if (Main.netMode == 2 && num664 < 200) + if (Main.netMode == NetmodeID.Server && num664 < 200) { NetMessage.SendData(23, -1, -1, null, num664, 0f, 0f, 0f, 0, 0, 0); } @@ -561,7 +561,7 @@ namespace CalamityMod.NPCs.SlimeGod { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -573,9 +573,9 @@ namespace CalamityMod.NPCs.SlimeGod npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 4, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 4, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -583,10 +583,10 @@ namespace CalamityMod.NPCs.SlimeGod } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 4, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 4, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 4, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 4, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/SlimeGod/SlimeGodSplit.cs b/NPCs/SlimeGod/SlimeGodSplit.cs index 3967ce8aca..2a92ae8149 100644 --- a/NPCs/SlimeGod/SlimeGodSplit.cs +++ b/NPCs/SlimeGod/SlimeGodSplit.cs @@ -77,10 +77,10 @@ namespace CalamityMod.NPCs.SlimeGod hyperMode = true; flag100 = false; } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[0] += flag100 ? 1f : 2f; - if (expertMode && Main.rand.Next(2) == 0) + if (expertMode && Main.rand.NextBool(2)) { if (npc.localAI[0] >= 600f) { @@ -234,7 +234,7 @@ namespace CalamityMod.NPCs.SlimeGod } } npc.ai[2] += 1f; - if ((double)npc.ai[2] > 150.0 && npc.velocity.Y == 0f && Main.netMode != 1) + if ((double)npc.ai[2] > 150.0 && npc.velocity.Y == 0f && Main.netMode != NetmodeID.MultiplayerClient) { int num1882 = Main.rand.Next(3); if (num1882 == 0) @@ -488,7 +488,7 @@ namespace CalamityMod.NPCs.SlimeGod npc.position.X = npc.position.X - (float)(npc.width / 2); npc.position.Y = npc.position.Y - (float)npc.height; } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int num660 = (int)((double)npc.lifeMax * 0.15); if ((float)(npc.life + num660) < bossLife) @@ -506,7 +506,7 @@ namespace CalamityMod.NPCs.SlimeGod Main.npc[num664].velocity.Y = (float)Main.rand.Next(-30, 1) * 0.1f; Main.npc[num664].ai[0] = (float)(-1000 * Main.rand.Next(3)); Main.npc[num664].ai[1] = 0f; - if (Main.netMode == 2 && num664 < 200) + if (Main.netMode == NetmodeID.Server && num664 < 200) { NetMessage.SendData(23, -1, -1, null, num664, 0f, 0f, 0f, 0, 0, 0); } @@ -542,7 +542,7 @@ namespace CalamityMod.NPCs.SlimeGod { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -554,9 +554,9 @@ namespace CalamityMod.NPCs.SlimeGod npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 4, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 4, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -564,10 +564,10 @@ namespace CalamityMod.NPCs.SlimeGod } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 4, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 4, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 4, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 4, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/SlimeGod/SlimeSpawnCorrupt.cs b/NPCs/SlimeGod/SlimeSpawnCorrupt.cs index 6971c4b40f..8d44403c3a 100644 --- a/NPCs/SlimeGod/SlimeSpawnCorrupt.cs +++ b/NPCs/SlimeGod/SlimeSpawnCorrupt.cs @@ -52,14 +52,14 @@ namespace CalamityMod.NPCs.SlimeGod public override void HitEffect(int hitDirection, double damage) { - if (Main.netMode != 1 && npc.life <= 0) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.life <= 0) { Vector2 spawnAt = npc.Center + new Vector2(0f, (float)npc.height / 2f); NPC.NewNPC((int)spawnAt.X, (int)spawnAt.Y, mod.NPCType("SlimeSpawnCorrupt2")); } for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default, 1f); } } diff --git a/NPCs/SlimeGod/SlimeSpawnCorrupt2.cs b/NPCs/SlimeGod/SlimeSpawnCorrupt2.cs index c6df986f71..fae63f46c2 100644 --- a/NPCs/SlimeGod/SlimeSpawnCorrupt2.cs +++ b/NPCs/SlimeGod/SlimeSpawnCorrupt2.cs @@ -42,13 +42,13 @@ namespace CalamityMod.NPCs.SlimeGod { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/SlimeGod/SlimeSpawnCrimson.cs b/NPCs/SlimeGod/SlimeSpawnCrimson.cs index 32eaeb4e57..a24387f33e 100644 --- a/NPCs/SlimeGod/SlimeSpawnCrimson.cs +++ b/NPCs/SlimeGod/SlimeSpawnCrimson.cs @@ -42,13 +42,13 @@ namespace CalamityMod.NPCs.SlimeGod { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default, 1f); } } } @@ -57,12 +57,12 @@ namespace CalamityMod.NPCs.SlimeGod { if (Main.expertMode) { - if (Main.rand.Next(50) == 0) + if (Main.rand.NextBool(50)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Nazar); } } - else if (Main.rand.Next(100) == 0) + else if (Main.rand.NextBool(100)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Nazar); } diff --git a/NPCs/SlimeGod/SlimeSpawnCrimson2.cs b/NPCs/SlimeGod/SlimeSpawnCrimson2.cs index d1ec7c0c59..6c09b15548 100644 --- a/NPCs/SlimeGod/SlimeSpawnCrimson2.cs +++ b/NPCs/SlimeGod/SlimeSpawnCrimson2.cs @@ -60,7 +60,7 @@ namespace CalamityMod.NPCs.SlimeGod { npc.velocity.X = npc.velocity.X * 0.9f; } - if (Main.netMode != 1 && spikeTimer == 0f) + if (Main.netMode != NetmodeID.MultiplayerClient && spikeTimer == 0f) { for (int n = 0; n < 5; n++) { @@ -81,7 +81,7 @@ namespace CalamityMod.NPCs.SlimeGod { npc.velocity.X = npc.velocity.X * 0.9f; } - if (Main.netMode != 1 && spikeTimer == 0f) + if (Main.netMode != NetmodeID.MultiplayerClient && spikeTimer == 0f) { num15 = Main.player[npc.target].position.Y - vector3.Y - (float)Main.rand.Next(0, 200); num16 = (float)Math.Sqrt((double)(num14 * num14 + num15 * num15)); @@ -99,13 +99,13 @@ namespace CalamityMod.NPCs.SlimeGod { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, hitDirection, -1f, 0, default, 1f); } } } @@ -114,12 +114,12 @@ namespace CalamityMod.NPCs.SlimeGod { if (Main.expertMode) { - if (Main.rand.Next(50) == 0) + if (Main.rand.NextBool(50)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Nazar); } } - else if (Main.rand.Next(100) == 0) + else if (Main.rand.NextBool(100)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Nazar); } diff --git a/NPCs/StormWeaver/StasisProbe.cs b/NPCs/StormWeaver/StasisProbe.cs index 64f0d4b7db..b6558ddee8 100644 --- a/NPCs/StormWeaver/StasisProbe.cs +++ b/NPCs/StormWeaver/StasisProbe.cs @@ -123,7 +123,7 @@ namespace CalamityMod.NPCs.StormWeaver { npc.localAI[0] = 0f; } - if (Main.netMode != 1 && npc.localAI[0] >= 90f) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] >= 90f) { npc.localAI[0] = 0f; if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) @@ -221,9 +221,9 @@ namespace CalamityMod.NPCs.StormWeaver npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -231,10 +231,10 @@ namespace CalamityMod.NPCs.StormWeaver } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } for (int num625 = 0; num625 < 3; num625++) @@ -248,25 +248,25 @@ namespace CalamityMod.NPCs.StormWeaver { scaleFactor10 = 1f; } - int num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + int num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13AB6_cp_0 = Main.gore[num626]; expr_13AB6_cp_0.velocity.X = expr_13AB6_cp_0.velocity.X + 1f; Gore expr_13AD6_cp_0 = Main.gore[num626]; expr_13AD6_cp_0.velocity.Y = expr_13AD6_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13B79_cp_0 = Main.gore[num626]; expr_13B79_cp_0.velocity.X = expr_13B79_cp_0.velocity.X - 1f; Gore expr_13B99_cp_0 = Main.gore[num626]; expr_13B99_cp_0.velocity.Y = expr_13B99_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13C3C_cp_0 = Main.gore[num626]; expr_13C3C_cp_0.velocity.X = expr_13C3C_cp_0.velocity.X + 1f; Gore expr_13C5C_cp_0 = Main.gore[num626]; expr_13C5C_cp_0.velocity.Y = expr_13C5C_cp_0.velocity.Y - 1f; - num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13CFF_cp_0 = Main.gore[num626]; expr_13CFF_cp_0.velocity.X = expr_13CFF_cp_0.velocity.X - 1f; diff --git a/NPCs/StormWeaver/StasisProbeNaked.cs b/NPCs/StormWeaver/StasisProbeNaked.cs index 314fea9c47..f5b12ea4ef 100644 --- a/NPCs/StormWeaver/StasisProbeNaked.cs +++ b/NPCs/StormWeaver/StasisProbeNaked.cs @@ -123,7 +123,7 @@ namespace CalamityMod.NPCs.StormWeaver { npc.localAI[0] = 0f; } - if (Main.netMode != 1 && npc.localAI[0] >= 180f) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] >= 180f) { npc.localAI[0] = 0f; if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) @@ -221,9 +221,9 @@ namespace CalamityMod.NPCs.StormWeaver npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -231,10 +231,10 @@ namespace CalamityMod.NPCs.StormWeaver } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } for (int num625 = 0; num625 < 3; num625++) @@ -248,25 +248,25 @@ namespace CalamityMod.NPCs.StormWeaver { scaleFactor10 = 1f; } - int num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + int num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13AB6_cp_0 = Main.gore[num626]; expr_13AB6_cp_0.velocity.X = expr_13AB6_cp_0.velocity.X + 1f; Gore expr_13AD6_cp_0 = Main.gore[num626]; expr_13AD6_cp_0.velocity.Y = expr_13AD6_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13B79_cp_0 = Main.gore[num626]; expr_13B79_cp_0.velocity.X = expr_13B79_cp_0.velocity.X - 1f; Gore expr_13B99_cp_0 = Main.gore[num626]; expr_13B99_cp_0.velocity.Y = expr_13B99_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13C3C_cp_0 = Main.gore[num626]; expr_13C3C_cp_0.velocity.X = expr_13C3C_cp_0.velocity.X + 1f; Gore expr_13C5C_cp_0 = Main.gore[num626]; expr_13C5C_cp_0.velocity.Y = expr_13C5C_cp_0.velocity.Y - 1f; - num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13CFF_cp_0 = Main.gore[num626]; expr_13CFF_cp_0.velocity.X = expr_13CFF_cp_0.velocity.X - 1f; diff --git a/NPCs/StormWeaver/StormWeaverBody.cs b/NPCs/StormWeaver/StormWeaverBody.cs index 17d194f119..4c1fe0a0dd 100644 --- a/NPCs/StormWeaver/StormWeaverBody.cs +++ b/NPCs/StormWeaver/StormWeaverBody.cs @@ -113,7 +113,7 @@ namespace CalamityMod.NPCs.StormWeaver { for (int num934 = 0; num934 < 2; num934++) { - int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default(Color), 2f); + int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default, 2f); Main.dust[num935].noGravity = true; Main.dust[num935].noLight = true; } @@ -218,9 +218,9 @@ namespace CalamityMod.NPCs.StormWeaver npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -228,20 +228,20 @@ namespace CalamityMod.NPCs.StormWeaver } for (int num623 = 0; num623 < 40; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } if (NPC.CountNPCS(mod.NPCType("StasisProbe")) < 3) { - if (npc.life > 0 && Main.netMode != 1 && spawn == 0 && Main.rand.Next(15) == 0) + if (npc.life > 0 && Main.netMode != NetmodeID.MultiplayerClient && spawn == 0 && Main.rand.NextBool(15)) { spawn = 1; int num660 = NPC.NewNPC((int)(npc.position.X + (float)(npc.width / 2)), (int)(npc.position.Y + (float)npc.height), mod.NPCType("StasisProbe"), 0, 0f, 0f, 0f, 0f, 255); - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { NetMessage.SendData(23, -1, -1, null, num660, 0f, 0f, 0f, 0, 0, 0); } diff --git a/NPCs/StormWeaver/StormWeaverBodyNaked.cs b/NPCs/StormWeaver/StormWeaverBodyNaked.cs index 6e208f17cc..984a0c6b41 100644 --- a/NPCs/StormWeaver/StormWeaverBodyNaked.cs +++ b/NPCs/StormWeaver/StormWeaverBodyNaked.cs @@ -136,7 +136,7 @@ namespace CalamityMod.NPCs.StormWeaver { for (int num934 = 0; num934 < 2; num934++) { - int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default(Color), 2f); + int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default, 2f); Main.dust[num935].noGravity = true; Main.dust[num935].noLight = true; } @@ -276,9 +276,9 @@ namespace CalamityMod.NPCs.StormWeaver npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -286,21 +286,21 @@ namespace CalamityMod.NPCs.StormWeaver } for (int num623 = 0; num623 < 40; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } if (NPC.CountNPCS(mod.NPCType("StasisProbeNaked")) < 3) { spawn--; - if (npc.life > 0 && Main.netMode != 1 && spawn <= 0) + if (npc.life > 0 && Main.netMode != NetmodeID.MultiplayerClient && spawn <= 0) { spawn = 14; int num660 = NPC.NewNPC((int)(npc.position.X + (float)(npc.width / 2)), (int)(npc.position.Y + (float)npc.height), mod.NPCType("StasisProbeNaked"), 0, 0f, 0f, 0f, 0f, 255); - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { NetMessage.SendData(23, -1, -1, null, num660, 0f, 0f, 0f, 0, 0, 0); } diff --git a/NPCs/StormWeaver/StormWeaverHead.cs b/NPCs/StormWeaver/StormWeaverHead.cs index 775ac0bb6c..b0ef847c3c 100644 --- a/NPCs/StormWeaver/StormWeaverHead.cs +++ b/NPCs/StormWeaver/StormWeaverHead.cs @@ -111,7 +111,7 @@ namespace CalamityMod.NPCs.StormWeaver { for (int num934 = 0; num934 < 2; num934++) { - int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default(Color), 2f); + int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default, 2f); Main.dust[num935].noGravity = true; Main.dust[num935].noLight = true; } @@ -121,7 +121,7 @@ namespace CalamityMod.NPCs.StormWeaver { npc.alpha = 0; } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (!tail && npc.ai[0] == 0f) { @@ -153,7 +153,7 @@ namespace CalamityMod.NPCs.StormWeaver npc.TargetClosest(true); npc.netUpdate = true; int damage = expertMode ? 50 : 70; - float xPos = (Main.rand.Next(2) == 0 ? npc.position.X + 300f : npc.position.X - 300f); + float xPos = (Main.rand.NextBool(2) ? npc.position.X + 300f : npc.position.X - 300f); Vector2 vector2 = new Vector2(xPos, npc.position.Y + Main.rand.Next(-300, 301)); Projectile.NewProjectile(vector2.X, vector2.Y, 0f, 0f, 465, damage, 0f, Main.myPlayer, 0f, 0f); } @@ -203,7 +203,7 @@ namespace CalamityMod.NPCs.StormWeaver if ((double)npc.position.Y < Main.topWorld + 16f) { CalamityWorld.DoGSecondStageCountdown = 0; - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { var netMessage = mod.GetPacket(); netMessage.Write((byte)CalamityModMessageType.DoGCountdownSync); @@ -222,7 +222,7 @@ namespace CalamityMod.NPCs.StormWeaver if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > 10000f) { CalamityWorld.DoGSecondStageCountdown = 0; - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { var netMessage = mod.GetPacket(); netMessage.Write((byte)CalamityModMessageType.DoGCountdownSync); @@ -466,44 +466,44 @@ namespace CalamityMod.NPCs.StormWeaver int num = 86400; int num2 = num / 24; Main.rainTime = Main.rand.Next(num2 * 8, num); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Main.rainTime += Main.rand.Next(0, num2); } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Main.rainTime += Main.rand.Next(0, num2 * 2); } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Main.rainTime += Main.rand.Next(0, num2 * 2); } - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) { Main.rainTime += Main.rand.Next(0, num2 * 3); } - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { Main.rainTime += Main.rand.Next(0, num2 * 4); } - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { Main.rainTime += Main.rand.Next(0, num2 * 5); } float num3 = 1f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { num3 += 0.05f; } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { num3 += 0.1f; } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { num3 += 0.15f; } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { num3 += 0.2f; } @@ -533,7 +533,7 @@ namespace CalamityMod.NPCs.StormWeaver { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 173, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 173, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -546,9 +546,9 @@ namespace CalamityMod.NPCs.StormWeaver npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -556,10 +556,10 @@ namespace CalamityMod.NPCs.StormWeaver } for (int num623 = 0; num623 < 40; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } @@ -574,7 +574,7 @@ namespace CalamityMod.NPCs.StormWeaver Main.npc[num957].active = false; } } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { NPC.SpawnOnPlayer(Main.LocalPlayer.whoAmI, mod.NPCType("StormWeaverHeadNaked")); } diff --git a/NPCs/StormWeaver/StormWeaverHeadNaked.cs b/NPCs/StormWeaver/StormWeaverHeadNaked.cs index efc094a12d..f1be2bcc73 100644 --- a/NPCs/StormWeaver/StormWeaverHeadNaked.cs +++ b/NPCs/StormWeaver/StormWeaverHeadNaked.cs @@ -131,7 +131,7 @@ namespace CalamityMod.NPCs.StormWeaver { for (int num934 = 0; num934 < 2; num934++) { - int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default(Color), 2f); + int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default, 2f); Main.dust[num935].noGravity = true; Main.dust[num935].noLight = true; } @@ -141,7 +141,7 @@ namespace CalamityMod.NPCs.StormWeaver { npc.alpha = 0; } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (!tail && npc.ai[0] == 0f) { @@ -173,7 +173,7 @@ namespace CalamityMod.NPCs.StormWeaver npc.TargetClosest(true); npc.netUpdate = true; int damage = expertMode ? 50 : 70; - float xPos = (Main.rand.Next(2) == 0 ? npc.position.X + 300f : npc.position.X - 300f); + float xPos = (Main.rand.NextBool(2) ? npc.position.X + 300f : npc.position.X - 300f); Vector2 vector2 = new Vector2(xPos, npc.position.Y + Main.rand.Next(-300, 301)); Projectile.NewProjectile(vector2.X, vector2.Y, 0f, 0f, 465, damage, 0f, Main.myPlayer, 0f, 0f); } @@ -223,7 +223,7 @@ namespace CalamityMod.NPCs.StormWeaver if ((double)npc.position.Y < Main.topWorld + 16f) { CalamityWorld.DoGSecondStageCountdown = 0; - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { var netMessage = mod.GetPacket(); netMessage.Write((byte)CalamityModMessageType.DoGCountdownSync); @@ -242,7 +242,7 @@ namespace CalamityMod.NPCs.StormWeaver if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > 10000f) { CalamityWorld.DoGSecondStageCountdown = 0; - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { var netMessage = mod.GetPacket(); netMessage.Write((byte)CalamityModMessageType.DoGCountdownSync); @@ -443,44 +443,44 @@ namespace CalamityMod.NPCs.StormWeaver int num = 86400; int num2 = num / 24; Main.rainTime = Main.rand.Next(num2 * 8, num); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Main.rainTime += Main.rand.Next(0, num2); } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Main.rainTime += Main.rand.Next(0, num2 * 2); } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Main.rainTime += Main.rand.Next(0, num2 * 2); } - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) { Main.rainTime += Main.rand.Next(0, num2 * 3); } - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { Main.rainTime += Main.rand.Next(0, num2 * 4); } - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { Main.rainTime += Main.rand.Next(0, num2 * 5); } float num3 = 1f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { num3 += 0.05f; } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { num3 += 0.1f; } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { num3 += 0.15f; } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { num3 += 0.2f; } @@ -557,7 +557,7 @@ namespace CalamityMod.NPCs.StormWeaver { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 173, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 173, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -570,9 +570,9 @@ namespace CalamityMod.NPCs.StormWeaver npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -580,10 +580,10 @@ namespace CalamityMod.NPCs.StormWeaver } for (int num623 = 0; num623 < 40; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } Vector2 spawnAt = npc.Center + new Vector2(0f, (float)npc.height / 2f); @@ -642,7 +642,7 @@ namespace CalamityMod.NPCs.StormWeaver if (CalamityWorld.DoGSecondStageCountdown > 7260) { CalamityWorld.DoGSecondStageCountdown = 7260; - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { var netMessage = mod.GetPacket(); netMessage.Write((byte)CalamityModMessageType.DoGCountdownSync); diff --git a/NPCs/StormWeaver/StormWeaverTail.cs b/NPCs/StormWeaver/StormWeaverTail.cs index 5a4b79747b..a9b643b19d 100644 --- a/NPCs/StormWeaver/StormWeaverTail.cs +++ b/NPCs/StormWeaver/StormWeaverTail.cs @@ -106,7 +106,7 @@ namespace CalamityMod.NPCs.StormWeaver { for (int num934 = 0; num934 < 2; num934++) { - int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default(Color), 2f); + int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default, 2f); Main.dust[num935].noGravity = true; Main.dust[num935].noLight = true; } @@ -172,7 +172,7 @@ namespace CalamityMod.NPCs.StormWeaver { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 173, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 173, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -185,9 +185,9 @@ namespace CalamityMod.NPCs.StormWeaver npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -195,10 +195,10 @@ namespace CalamityMod.NPCs.StormWeaver } for (int num623 = 0; num623 < 40; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/StormWeaver/StormWeaverTailNaked.cs b/NPCs/StormWeaver/StormWeaverTailNaked.cs index e98e7c38f4..ae2faf1699 100644 --- a/NPCs/StormWeaver/StormWeaverTailNaked.cs +++ b/NPCs/StormWeaver/StormWeaverTailNaked.cs @@ -134,7 +134,7 @@ namespace CalamityMod.NPCs.StormWeaver { for (int num934 = 0; num934 < 2; num934++) { - int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default(Color), 2f); + int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default, 2f); Main.dust[num935].noGravity = true; Main.dust[num935].noLight = true; } @@ -253,7 +253,7 @@ namespace CalamityMod.NPCs.StormWeaver { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 173, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 173, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -266,9 +266,9 @@ namespace CalamityMod.NPCs.StormWeaver npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -276,10 +276,10 @@ namespace CalamityMod.NPCs.StormWeaver } for (int num623 = 0; num623 < 40; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/SunkenSeaNPCs/BlindedAngler.cs b/NPCs/SunkenSeaNPCs/BlindedAngler.cs index 06976528ff..d4637aff21 100644 --- a/NPCs/SunkenSeaNPCs/BlindedAngler.cs +++ b/NPCs/SunkenSeaNPCs/BlindedAngler.cs @@ -255,7 +255,7 @@ namespace CalamityMod.NPCs.SunkenSeaNPCs public override void NPCLoot() { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EutrophicScimitar")); } @@ -266,13 +266,13 @@ namespace CalamityMod.NPCs.SunkenSeaNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 25; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BlindedAngler/BlindAnglerGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BlindedAngler/BlindAnglerGore2"), 1f); diff --git a/NPCs/SunkenSeaNPCs/Clam.cs b/NPCs/SunkenSeaNPCs/Clam.cs index ab91943cc2..5a2b7e4793 100644 --- a/NPCs/SunkenSeaNPCs/Clam.cs +++ b/NPCs/SunkenSeaNPCs/Clam.cs @@ -84,7 +84,7 @@ namespace CalamityMod.NPCs.SunkenSeaNPCs } if (npc.ai[0] == 0f) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (npc.velocity.X != 0f || npc.velocity.Y < 0f || (double)npc.velocity.Y > 0.9) { @@ -202,13 +202,13 @@ namespace CalamityMod.NPCs.SunkenSeaNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 50; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Clam/Clam1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Clam/Clam2"), 1f); @@ -218,7 +218,7 @@ namespace CalamityMod.NPCs.SunkenSeaNPCs public override void NPCLoot() { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Navystone"), Main.rand.Next(8, 13)); - if (Main.rand.Next(2) == 0 && Main.hardMode) + if (Main.rand.NextBool(2) && Main.hardMode) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MolluskHusk")); } diff --git a/NPCs/SunkenSeaNPCs/EutrophicRay.cs b/NPCs/SunkenSeaNPCs/EutrophicRay.cs index a94004b2c4..5ca7a673a5 100644 --- a/NPCs/SunkenSeaNPCs/EutrophicRay.cs +++ b/NPCs/SunkenSeaNPCs/EutrophicRay.cs @@ -193,7 +193,7 @@ namespace CalamityMod.NPCs.SunkenSeaNPCs public override void NPCLoot() { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EutrophicShank")); } @@ -203,13 +203,13 @@ namespace CalamityMod.NPCs.SunkenSeaNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 25; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EutrophicRay/RayGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EutrophicRay/RayGore2"), 1f); diff --git a/NPCs/SunkenSeaNPCs/GhostBell.cs b/NPCs/SunkenSeaNPCs/GhostBell.cs index e1a4405e1e..85bc195c7e 100644 --- a/NPCs/SunkenSeaNPCs/GhostBell.cs +++ b/NPCs/SunkenSeaNPCs/GhostBell.cs @@ -148,13 +148,13 @@ namespace CalamityMod.NPCs.SunkenSeaNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 25; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/SunkenSeaNPCs/GhostBellSmall.cs b/NPCs/SunkenSeaNPCs/GhostBellSmall.cs index 323173f9c3..6f6701bb54 100644 --- a/NPCs/SunkenSeaNPCs/GhostBellSmall.cs +++ b/NPCs/SunkenSeaNPCs/GhostBellSmall.cs @@ -123,13 +123,13 @@ namespace CalamityMod.NPCs.SunkenSeaNPCs { for (int k = 0; k < 2; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/SunkenSeaNPCs/GiantClam.cs b/NPCs/SunkenSeaNPCs/GiantClam.cs index 6ccb72bce7..51dee37cbe 100644 --- a/NPCs/SunkenSeaNPCs/GiantClam.cs +++ b/NPCs/SunkenSeaNPCs/GiantClam.cs @@ -87,7 +87,7 @@ namespace CalamityMod.NPCs.SunkenSeaNPCs npc.chaseable = hasBeenHit; if (hitAmount == 5) { - if (Main.netMode != 2) + if (Main.netMode != NetmodeID.Server) { if (!Main.player[npc.target].dead && Main.player[npc.target].active) { @@ -146,7 +146,7 @@ namespace CalamityMod.NPCs.SunkenSeaNPCs { if (npc.ai[2] == 0f) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.TargetClosest(true); npc.ai[2] = 1f; @@ -174,9 +174,9 @@ namespace CalamityMod.NPCs.SunkenSeaNPCs } else if (npc.ai[2] == 2f) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { - int num5 = Dust.NewDust(npc.position, npc.width, npc.height, 226, 0f, 0f, 200, default(Color), 1.5f); + int num5 = Dust.NewDust(npc.position, npc.width, npc.height, 226, 0f, 0f, 200, default, 1.5f); Main.dust[num5].noGravity = true; Main.dust[num5].velocity *= 0.75f; Main.dust[num5].fadeIn = 1.3f; @@ -228,10 +228,10 @@ namespace CalamityMod.NPCs.SunkenSeaNPCs { for (int stompDustAmount = 0; stompDustAmount < 5; stompDustAmount++) { - int stompDust = Dust.NewDust(new Vector2(npc.position.X - 30f, npc.position.Y + (float)npc.height), npc.width + 30, 4, 33, 0f, 0f, 100, default(Color), 1.5f); + int stompDust = Dust.NewDust(new Vector2(npc.position.X - 30f, npc.position.Y + (float)npc.height), npc.width + 30, 4, 33, 0f, 0f, 100, default, 1.5f); Main.dust[stompDust].velocity *= 0.2f; } - int stompGore = Gore.NewGore(new Vector2((float)(stompDustArea - 30), npc.position.Y + (float)npc.height - 12f), default(Vector2), Main.rand.Next(61, 64), 1f); + int stompGore = Gore.NewGore(new Vector2((float)(stompDustArea - 30), npc.position.Y + (float)npc.height - 12f), default, Main.rand.Next(61, 64), 1f); Main.gore[stompGore].velocity *= 0.4f; } } @@ -280,7 +280,7 @@ namespace CalamityMod.NPCs.SunkenSeaNPCs } else if (attack == 3) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { Main.PlaySound(SoundID.Item68, npc.position); int damage = Main.expertMode ? 28 : 35; @@ -358,13 +358,13 @@ namespace CalamityMod.NPCs.SunkenSeaNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 50; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GiantClam/GiantClam1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GiantClam/GiantClam2"), 1f); @@ -398,7 +398,7 @@ namespace CalamityMod.NPCs.SunkenSeaNPCs { // Spawn Amidias if he isn't in the world int amidiasNPC = NPC.FindFirstNPC(mod.NPCType("SEAHOE")); - if (amidiasNPC == -1 && Main.netMode != 1) + if (amidiasNPC == -1 && Main.netMode != NetmodeID.MultiplayerClient) { NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("SEAHOE"), 0, 0f, 0f, 0f, 0f, 255); } diff --git a/NPCs/SunkenSeaNPCs/PrismTurtle.cs b/NPCs/SunkenSeaNPCs/PrismTurtle.cs index f8ae74ad07..7a91c5d061 100644 --- a/NPCs/SunkenSeaNPCs/PrismTurtle.cs +++ b/NPCs/SunkenSeaNPCs/PrismTurtle.cs @@ -273,7 +273,7 @@ namespace CalamityMod.NPCs.SunkenSeaNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -284,7 +284,7 @@ namespace CalamityMod.NPCs.SunkenSeaNPCs Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PrismTurtle/PrismTurtleGore5"), 1f); for (int k = 0; k < 25; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/SunkenSeaNPCs/SeaFloaty.cs b/NPCs/SunkenSeaNPCs/SeaFloaty.cs index 5e5746866f..b8c6f36391 100644 --- a/NPCs/SunkenSeaNPCs/SeaFloaty.cs +++ b/NPCs/SunkenSeaNPCs/SeaFloaty.cs @@ -137,13 +137,13 @@ namespace CalamityMod.NPCs.SunkenSeaNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 25; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SeaFloaty/SeaFloatyGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SeaFloaty/SeaFloatyGore2"), 1f); diff --git a/NPCs/SunkenSeaNPCs/SeaMinnow.cs b/NPCs/SunkenSeaNPCs/SeaMinnow.cs index 588c44b030..62c3f303c1 100644 --- a/NPCs/SunkenSeaNPCs/SeaMinnow.cs +++ b/NPCs/SunkenSeaNPCs/SeaMinnow.cs @@ -210,7 +210,7 @@ namespace CalamityMod.NPCs.SunkenSeaNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 68, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/SunkenSeaNPCs/SeaSerpent1.cs b/NPCs/SunkenSeaNPCs/SeaSerpent1.cs index c27f96b06f..fe107751c2 100644 --- a/NPCs/SunkenSeaNPCs/SeaSerpent1.cs +++ b/NPCs/SunkenSeaNPCs/SeaSerpent1.cs @@ -56,7 +56,7 @@ namespace CalamityMod.NPCs.SunkenSeaNPCs npc.TargetClosest(true); } npc.velocity.Length(); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (!TailSpawned && npc.ai[0] == 0f) { @@ -325,7 +325,7 @@ namespace CalamityMod.NPCs.SunkenSeaNPCs public override void NPCLoot() { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Serpentine")); } @@ -335,13 +335,13 @@ namespace CalamityMod.NPCs.SunkenSeaNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SeaSerpent/SeaSerpentGore1"), 1f); } @@ -349,14 +349,14 @@ namespace CalamityMod.NPCs.SunkenSeaNPCs public override bool CheckActive() { - if (npc.timeLeft <= 0 && Main.netMode != 1) + if (npc.timeLeft <= 0 && Main.netMode != NetmodeID.MultiplayerClient) { for (int k = (int)npc.ai[0]; k > 0; k = (int)Main.npc[k].ai[0]) { if (Main.npc[k].active) { Main.npc[k].active = false; - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { Main.npc[k].life = 0; Main.npc[k].netSkip = -1; diff --git a/NPCs/SunkenSeaNPCs/SeaSerpent2.cs b/NPCs/SunkenSeaNPCs/SeaSerpent2.cs index 0bcc56f773..5209fde852 100644 --- a/NPCs/SunkenSeaNPCs/SeaSerpent2.cs +++ b/NPCs/SunkenSeaNPCs/SeaSerpent2.cs @@ -153,13 +153,13 @@ namespace CalamityMod.NPCs.SunkenSeaNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SeaSerpent/SeaSerpentGore2"), 1f); } diff --git a/NPCs/SunkenSeaNPCs/SeaSerpent3.cs b/NPCs/SunkenSeaNPCs/SeaSerpent3.cs index 130ff16681..71f258a126 100644 --- a/NPCs/SunkenSeaNPCs/SeaSerpent3.cs +++ b/NPCs/SunkenSeaNPCs/SeaSerpent3.cs @@ -150,13 +150,13 @@ namespace CalamityMod.NPCs.SunkenSeaNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SeaSerpent/SeaSerpentGore3"), 1f); } diff --git a/NPCs/SunkenSeaNPCs/SeaSerpent4.cs b/NPCs/SunkenSeaNPCs/SeaSerpent4.cs index a522391ac5..c1ba4d7760 100644 --- a/NPCs/SunkenSeaNPCs/SeaSerpent4.cs +++ b/NPCs/SunkenSeaNPCs/SeaSerpent4.cs @@ -150,13 +150,13 @@ namespace CalamityMod.NPCs.SunkenSeaNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SeaSerpent/SeaSerpentGore4"), 1f); } diff --git a/NPCs/SunkenSeaNPCs/SeaSerpent5.cs b/NPCs/SunkenSeaNPCs/SeaSerpent5.cs index 453d6643ca..a8e86032b0 100644 --- a/NPCs/SunkenSeaNPCs/SeaSerpent5.cs +++ b/NPCs/SunkenSeaNPCs/SeaSerpent5.cs @@ -150,13 +150,13 @@ namespace CalamityMod.NPCs.SunkenSeaNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 37, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SeaSerpent/SeaSerpentGore5"), 1f); } diff --git a/NPCs/SupremeCalamitas/SCalWormBody.cs b/NPCs/SupremeCalamitas/SCalWormBody.cs index e6d4b42749..bdb74c2749 100644 --- a/NPCs/SupremeCalamitas/SCalWormBody.cs +++ b/NPCs/SupremeCalamitas/SCalWormBody.cs @@ -122,9 +122,9 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -132,10 +132,10 @@ namespace CalamityMod.NPCs.SupremeCalamitas } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/SupremeCalamitas/SCalWormBodyWeak.cs b/NPCs/SupremeCalamitas/SCalWormBodyWeak.cs index 3310942769..ac1aee109b 100644 --- a/NPCs/SupremeCalamitas/SCalWormBodyWeak.cs +++ b/NPCs/SupremeCalamitas/SCalWormBodyWeak.cs @@ -72,7 +72,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.alpha = 0; } } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[0] += 1f; if (npc.localAI[0] >= 900f) diff --git a/NPCs/SupremeCalamitas/SCalWormHead.cs b/NPCs/SupremeCalamitas/SCalWormHead.cs index 1be34c15db..fea35229c4 100644 --- a/NPCs/SupremeCalamitas/SCalWormHead.cs +++ b/NPCs/SupremeCalamitas/SCalWormHead.cs @@ -90,7 +90,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.TargetClosest(true); } npc.velocity.Length(); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (!TailSpawned && npc.ai[0] == 0f) { @@ -129,7 +129,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } TailSpawned = true; } - if (!npc.active && Main.netMode == 2) + if (!npc.active && Main.netMode == NetmodeID.Server) { NetMessage.SendData(28, -1, -1, null, npc.whoAmI, -1f, 0f, 0f, 0, 0, 0); } @@ -395,9 +395,9 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -405,10 +405,10 @@ namespace CalamityMod.NPCs.SupremeCalamitas } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/SupremeCalamitas/SCalWormTail.cs b/NPCs/SupremeCalamitas/SCalWormTail.cs index 09d4bb1f45..a2de006140 100644 --- a/NPCs/SupremeCalamitas/SCalWormTail.cs +++ b/NPCs/SupremeCalamitas/SCalWormTail.cs @@ -92,9 +92,9 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -102,10 +102,10 @@ namespace CalamityMod.NPCs.SupremeCalamitas } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs index a2984c70ea..8aa2753bd8 100644 --- a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs +++ b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs @@ -51,7 +51,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); } npc.ai[1] = npc.ai[0]; start = false; @@ -64,7 +64,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas timer++; if (timer > 180) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int damage = expertMode ? 150 : 200; //600 500 Projectile.NewProjectile(npc.Center.X, npc.Center.Y, direction.X, direction.Y, mod.ProjectileType("BrimstoneBarrage"), damage, 1f, npc.target); @@ -111,9 +111,9 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -121,10 +121,10 @@ namespace CalamityMod.NPCs.SupremeCalamitas } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index a1c59bfcf4..af9eb2d86c 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -53,7 +53,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas private int bulletHellCounter = 0; private int bulletHellCounter2 = 0; - private Rectangle safeBox = default(Rectangle); + private Rectangle safeBox = default; public override void SetStaticDefaults() { @@ -221,11 +221,11 @@ namespace CalamityMod.NPCs.SupremeCalamitas { string key = "Mods.CalamityMod.SupremeBossText12"; //kill SCal 4 times Color messageColor = Color.Orange; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -234,11 +234,11 @@ namespace CalamityMod.NPCs.SupremeCalamitas { string key = "Mods.CalamityMod.SupremeBossText11"; //kill SCal once Color messageColor = Color.Orange; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -249,11 +249,11 @@ namespace CalamityMod.NPCs.SupremeCalamitas { string key = "Mods.CalamityMod.SupremeBossText15"; //die 50 or more times Color messageColor = Color.Orange; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -262,11 +262,11 @@ namespace CalamityMod.NPCs.SupremeCalamitas { string key = "Mods.CalamityMod.SupremeBossText14"; //die 20 or more times Color messageColor = Color.Orange; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -275,11 +275,11 @@ namespace CalamityMod.NPCs.SupremeCalamitas { string key = "Mods.CalamityMod.SupremeBossText13"; //die 5 or more times Color messageColor = Color.Orange; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -311,7 +311,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas safeBox.Height = 2500; spawnYAdd = 125; } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int num52 = (int)(safeBox.X + (float)(safeBox.Width / 2)) / 16; int num53 = (int)(safeBox.Y + (float)(safeBox.Height / 2)) / 16; @@ -325,7 +325,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas Main.tile[num55, num56].type = (ushort)mod.TileType("ArenaTile"); Main.tile[num55, num56].active(true); } - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { NetMessage.SendTileSquare(-1, num55, num56, 1, TileChangeType.None); } @@ -397,7 +397,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float num740 = player.Center.X - vector92.X; float num741 = player.Center.Y - vector92.Y; npc.rotation = (float)Math.Atan2((double)num741, (double)num740) - 1.57f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { bulletHellCounter += 1; if (bulletHellCounter > ((npc.GetGlobalNPC(mod).enraged || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive)) ? 4 : 6)) @@ -428,15 +428,15 @@ namespace CalamityMod.NPCs.SupremeCalamitas { string key = "Mods.CalamityMod.SupremeBossText3"; Color messageColor = Color.Orange; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { spawnY += 250; if (CalamityWorld.death) @@ -473,7 +473,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float num740 = player.Center.X - vector92.X; float num741 = player.Center.Y - vector92.Y; npc.rotation = (float)Math.Atan2((double)num741, (double)num740) - 1.57f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int damage = expertMode ? 150 : 200; //600 400 if (bulletHellCounter2 < 1200) @@ -523,11 +523,11 @@ namespace CalamityMod.NPCs.SupremeCalamitas { string key = "Mods.CalamityMod.SupremeBossText4"; Color messageColor = Color.Orange; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -549,7 +549,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float num740 = player.Center.X - vector92.X; float num741 = player.Center.Y - vector92.Y; npc.rotation = (float)Math.Atan2((double)num741, (double)num740) - 1.57f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int damage = expertMode ? 150 : 200; if (bulletHellCounter2 % 180 == 0) //blasts from top @@ -591,11 +591,11 @@ namespace CalamityMod.NPCs.SupremeCalamitas music = MusicID.Boss3; string key = "Mods.CalamityMod.SupremeBossText5"; Color messageColor = Color.Orange; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -617,7 +617,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float num740 = player.Center.X - vector92.X; float num741 = player.Center.Y - vector92.Y; npc.rotation = (float)Math.Atan2((double)num741, (double)num740) - 1.57f; - if (Main.netMode != 1) //more clustered attack + if (Main.netMode != NetmodeID.MultiplayerClient) //more clustered attack { int damage = expertMode ? 150 : 200; if (bulletHellCounter2 % 180 == 0) //blasts from top @@ -664,11 +664,11 @@ namespace CalamityMod.NPCs.SupremeCalamitas music = MusicID.LunarBoss; string key = "Mods.CalamityMod.SupremeBossText7"; Color messageColor = Color.Orange; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -690,7 +690,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float num740 = player.Center.X - vector92.X; float num741 = player.Center.Y - vector92.Y; npc.rotation = (float)Math.Atan2((double)num741, (double)num740) - 1.57f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int damage = expertMode ? 150 : 200; if (bulletHellCounter2 % 240 == 0) //blasts from top @@ -738,11 +738,11 @@ namespace CalamityMod.NPCs.SupremeCalamitas { string key = "Mods.CalamityMod.SupremeBossText9"; Color messageColor = Color.Orange; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -774,11 +774,11 @@ namespace CalamityMod.NPCs.SupremeCalamitas { string key = "Mods.CalamityMod.SupremeBossText27"; Color messageColor = Color.Orange; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -792,11 +792,11 @@ namespace CalamityMod.NPCs.SupremeCalamitas { string key = "Mods.CalamityMod.SupremeBossText25"; Color messageColor = Color.Orange; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -805,11 +805,11 @@ namespace CalamityMod.NPCs.SupremeCalamitas { string key = "Mods.CalamityMod.SupremeBossText26"; Color messageColor = Color.Orange; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -829,11 +829,11 @@ namespace CalamityMod.NPCs.SupremeCalamitas { string key = "Mods.CalamityMod.SupremeBossText24"; Color messageColor = Color.Orange; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -844,11 +844,11 @@ namespace CalamityMod.NPCs.SupremeCalamitas { string key = "Mods.CalamityMod.SupremeBossText23"; Color messageColor = Color.Orange; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -859,11 +859,11 @@ namespace CalamityMod.NPCs.SupremeCalamitas { string key = "Mods.CalamityMod.SupremeBossText22"; Color messageColor = Color.Orange; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -874,11 +874,11 @@ namespace CalamityMod.NPCs.SupremeCalamitas { string key = "Mods.CalamityMod.SupremeBossText21"; Color messageColor = Color.Orange; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -889,15 +889,15 @@ namespace CalamityMod.NPCs.SupremeCalamitas { string key = "Mods.CalamityMod.SupremeBossText20"; Color messageColor = Color.Orange; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { spawnY += 250; if (CalamityWorld.death) @@ -953,11 +953,11 @@ namespace CalamityMod.NPCs.SupremeCalamitas { string key = "Mods.CalamityMod.SupremeBossText"; Color messageColor = Color.Orange; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -969,15 +969,15 @@ namespace CalamityMod.NPCs.SupremeCalamitas { string key = "Mods.CalamityMod.SupremeBossText8"; Color messageColor = Color.Orange; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 74); for (int I = 0; I < 20; I++) @@ -997,7 +997,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } if (npc.life > 0) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int num660 = (int)((double)npc.lifeMax * 0.55); if ((float)(npc.life + num660) < bossLife) @@ -1007,11 +1007,11 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.SpawnOnPlayer(npc.FindClosestPlayer(), mod.NPCType("SupremeCatastrophe")); string key = "Mods.CalamityMod.SupremeBossText6"; Color messageColor = Color.Orange; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -1160,7 +1160,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas num825 = player.position.X + (float)(player.width / 2) - vector82.X; num826 = player.position.Y + (float)(player.height / 2) - vector82.Y; npc.rotation = (float)Math.Atan2((double)num826, (double)num825) - 1.57f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[1] += wormAlive ? 0.5f : 1f; if (npc.localAI[1] > 90f) @@ -1360,7 +1360,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas vector40 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); num415 = player.position.X + (float)(player.width / 2) - vector40.X; num416 = player.position.Y + (float)(player.height / 2) - vector40.Y; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { float num418 = 10f * uDieLul; int num419 = expertMode ? 150 : 200; //600 500 @@ -1428,7 +1428,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas num834 = player.position.X + (float)(player.width / 2) - vector83.X; num835 = player.position.Y + (float)(player.height / 2) - vector83.Y; npc.rotation = (float)Math.Atan2((double)num835, (double)num834) - 1.57f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[1] += wormAlive ? 0.5f : 1f; if (npc.localAI[1] > 140f) @@ -1541,12 +1541,12 @@ namespace CalamityMod.NPCs.SupremeCalamitas { for (int num388 = 0; num388 < 50; num388++) { - Dust.NewDust(npc.position, npc.width, npc.height, 235, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 235, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default, 1f); } Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); } } - Dust.NewDust(npc.position, npc.width, npc.height, 235, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 235, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default, 1f); npc.velocity.X = npc.velocity.X * 0.98f; npc.velocity.Y = npc.velocity.Y * 0.98f; if ((double)npc.velocity.X > -0.1 && (double)npc.velocity.X < 0.1) @@ -1636,7 +1636,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas num825 = player.position.X + (float)(player.width / 2) - vector82.X; num826 = player.position.Y + (float)(player.height / 2) - vector82.Y; npc.rotation = (float)Math.Atan2((double)num826, (double)num825) - 1.57f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[1] += wormAlive ? 0.5f : 1f; if (npc.localAI[1] > 60f) @@ -1828,7 +1828,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas vector40 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); num415 = player.position.X + (float)(player.width / 2) - vector40.X; num416 = player.position.Y + (float)(player.height / 2) - vector40.Y; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { float num418 = 10f * uDieLul; int num419 = expertMode ? 150 : 200; //600 500 @@ -1896,7 +1896,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas num834 = player.position.X + (float)(player.width / 2) - vector83.X; num835 = player.position.Y + (float)(player.height / 2) - vector83.Y; npc.rotation = (float)Math.Atan2((double)num835, (double)num834) - 1.57f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[1] += wormAlive ? 0.5f : 1f; if (npc.localAI[1] > 100f) @@ -1980,11 +1980,11 @@ namespace CalamityMod.NPCs.SupremeCalamitas { string key = "Mods.CalamityMod.SupremeBossText2"; Color messageColor = Color.Orange; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -2077,9 +2077,9 @@ namespace CalamityMod.NPCs.SupremeCalamitas key = "Mods.CalamityMod.SupremeBossText10"; } - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) Main.NewText(Language.GetTextValue(key), messageColor); - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -2220,7 +2220,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -2232,9 +2232,9 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -2242,10 +2242,10 @@ namespace CalamityMod.NPCs.SupremeCalamitas } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/SupremeCalamitas/SupremeCataclysm.cs b/NPCs/SupremeCalamitas/SupremeCataclysm.cs index 2d4dcfee5a..95132e08ad 100644 --- a/NPCs/SupremeCalamitas/SupremeCataclysm.cs +++ b/NPCs/SupremeCalamitas/SupremeCataclysm.cs @@ -149,7 +149,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float num689 = -8f; int num690 = expertMode ? 150 : 200; //600 500 int num691 = mod.ProjectileType("BrimstoneWave"); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int num695 = Projectile.NewProjectile(vector85.X, vector85.Y, num689, 0f, num691, num690, 0f, Main.myPlayer, 0f, 0f); } @@ -170,7 +170,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas double deltaAngle = spread / 8f; double offsetAngle; int i; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { for (i = 0; i < 8; i++) { @@ -299,9 +299,9 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -309,10 +309,10 @@ namespace CalamityMod.NPCs.SupremeCalamitas } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs index bf74b8480e..345a09c434 100644 --- a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs +++ b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs @@ -149,7 +149,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float num689 = 4f; int num690 = expertMode ? 150 : 200; //600 500 int num691 = mod.ProjectileType("BrimstoneHellblast2"); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int num695 = Projectile.NewProjectile(vector85.X, vector85.Y, num689, 0f, num691, num690, 0f, Main.myPlayer, 0f, 0f); } @@ -170,7 +170,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas double deltaAngle = spread / 8f; double offsetAngle; int i; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { for (i = 0; i < 8; i++) { @@ -299,9 +299,9 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -309,10 +309,10 @@ namespace CalamityMod.NPCs.SupremeCalamitas } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/TheDevourerofGods/DevourerofGodsBody.cs b/NPCs/TheDevourerofGods/DevourerofGodsBody.cs index 936ec37664..0195e92a6d 100644 --- a/NPCs/TheDevourerofGods/DevourerofGodsBody.cs +++ b/NPCs/TheDevourerofGods/DevourerofGodsBody.cs @@ -124,7 +124,7 @@ namespace CalamityMod.NPCs.TheDevourerofGods { for (int num934 = 0; num934 < 2; num934++) { - int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default(Color), 2f); + int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default, 2f); Main.dust[num935].noGravity = true; Main.dust[num935].noLight = true; } @@ -135,7 +135,7 @@ namespace CalamityMod.NPCs.TheDevourerofGods npc.alpha = 0; } } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[0] += (expertMode ? 2f : 1f); int projectileType = mod.ProjectileType("DoGNebulaShot"); @@ -247,9 +247,9 @@ namespace CalamityMod.NPCs.TheDevourerofGods npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -257,10 +257,10 @@ namespace CalamityMod.NPCs.TheDevourerofGods } for (int num623 = 0; num623 < 20; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/TheDevourerofGods/DevourerofGodsBody2.cs b/NPCs/TheDevourerofGods/DevourerofGodsBody2.cs index f028390e02..62820c0f4d 100644 --- a/NPCs/TheDevourerofGods/DevourerofGodsBody2.cs +++ b/NPCs/TheDevourerofGods/DevourerofGodsBody2.cs @@ -82,7 +82,7 @@ namespace CalamityMod.NPCs.TheDevourerofGods { if (npc.alpha != 0) { - int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default(Color), 2f); + int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default, 2f); Main.dust[num935].noGravity = true; Main.dust[num935].noLight = true; } @@ -133,9 +133,9 @@ namespace CalamityMod.NPCs.TheDevourerofGods npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -143,10 +143,10 @@ namespace CalamityMod.NPCs.TheDevourerofGods } for (int num623 = 0; num623 < 20; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/TheDevourerofGods/DevourerofGodsBodyS.cs b/NPCs/TheDevourerofGods/DevourerofGodsBodyS.cs index eeb1c35535..b10f615674 100644 --- a/NPCs/TheDevourerofGods/DevourerofGodsBodyS.cs +++ b/NPCs/TheDevourerofGods/DevourerofGodsBodyS.cs @@ -236,9 +236,9 @@ namespace CalamityMod.NPCs.TheDevourerofGods npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -246,10 +246,10 @@ namespace CalamityMod.NPCs.TheDevourerofGods } for (int num623 = 0; num623 < 20; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/TheDevourerofGods/DevourerofGodsHead.cs b/NPCs/TheDevourerofGods/DevourerofGodsHead.cs index efe736cc89..58712e0845 100644 --- a/NPCs/TheDevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/TheDevourerofGods/DevourerofGodsHead.cs @@ -116,9 +116,9 @@ namespace CalamityMod.NPCs.TheDevourerofGods string key = "Mods.CalamityMod.EdgyBossText"; Color messageColor = Color.Cyan; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) Main.NewText(Language.GetTextValue(key), messageColor); - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); halfLife = true; @@ -126,7 +126,7 @@ namespace CalamityMod.NPCs.TheDevourerofGods if (spawnDoGCountdown > 0) { spawnDoGCountdown--; - if (spawnDoGCountdown == 0 && Main.netMode != 1) + if (spawnDoGCountdown == 0 && Main.netMode != NetmodeID.MultiplayerClient) { for (int i = 0; i < 2; i++) NPC.SpawnOnPlayer(npc.FindClosestPlayer(), mod.NPCType("DevourerofGodsHead2")); @@ -145,7 +145,7 @@ namespace CalamityMod.NPCs.TheDevourerofGods if (spawnDoGCountdown > 0) { spawnDoGCountdown--; - if (spawnDoGCountdown == 0 && Main.netMode != 1) + if (spawnDoGCountdown == 0 && Main.netMode != NetmodeID.MultiplayerClient) NPC.SpawnOnPlayer(npc.FindClosestPlayer(), mod.NPCType("DevourerofGodsHead2")); } } @@ -158,7 +158,7 @@ namespace CalamityMod.NPCs.TheDevourerofGods { for (int spawnDust = 0; spawnDust < 2; spawnDust++) { - int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default(Color), 2f); + int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default, 2f); Main.dust[num935].noGravity = true; Main.dust[num935].noLight = true; } @@ -170,7 +170,7 @@ namespace CalamityMod.NPCs.TheDevourerofGods npc.alpha = 0; // Spawn segments - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (!tail && npc.ai[0] == 0f) { @@ -239,7 +239,7 @@ namespace CalamityMod.NPCs.TheDevourerofGods // Flight if (npc.ai[2] == 0f) { - if (Main.netMode != 2) + if (Main.netMode != NetmodeID.Server) { if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active && Vector2.Distance(Main.player[Main.myPlayer].Center, vector) < 5600f) Main.player[Main.myPlayer].AddBuff(mod.BuffType("Warped"), 2); @@ -449,7 +449,7 @@ namespace CalamityMod.NPCs.TheDevourerofGods // Ground else { - if (Main.netMode != 2) + if (Main.netMode != NetmodeID.Server) { if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active && Vector2.Distance(Main.player[Main.myPlayer].Center, vector) < 5600f) Main.player[Main.myPlayer].AddBuff(mod.BuffType("ExtremeGrav"), 2); @@ -688,7 +688,7 @@ namespace CalamityMod.NPCs.TheDevourerofGods // Skip the sentinel phase entirely if DoG has already been killed CalamityWorld.DoGSecondStageCountdown = CalamityWorld.downedDoG ? 600 : 21600; - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { var netMessage = mod.GetPacket(); netMessage.Write((byte)CalamityModMessageType.DoGCountdownSync); @@ -717,11 +717,11 @@ namespace CalamityMod.NPCs.TheDevourerofGods { string key = "Mods.CalamityMod.EdgyBossText2"; Color messageColor = Color.Cyan; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -755,9 +755,9 @@ namespace CalamityMod.NPCs.TheDevourerofGods npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 15; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -765,10 +765,10 @@ namespace CalamityMod.NPCs.TheDevourerofGods } for (int num623 = 0; num623 < 30; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } @@ -811,11 +811,11 @@ namespace CalamityMod.NPCs.TheDevourerofGods key = "Mods.CalamityMod.EdgyBossText7"; } Color messageColor = Color.Cyan; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } diff --git a/NPCs/TheDevourerofGods/DevourerofGodsHead2.cs b/NPCs/TheDevourerofGods/DevourerofGodsHead2.cs index a23c518f62..a172d4b524 100644 --- a/NPCs/TheDevourerofGods/DevourerofGodsHead2.cs +++ b/NPCs/TheDevourerofGods/DevourerofGodsHead2.cs @@ -89,7 +89,7 @@ namespace CalamityMod.NPCs.TheDevourerofGods npc.velocity.Length(); if (npc.alpha != 0) { - int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default(Color), 2f); + int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default, 2f); Main.dust[num935].noGravity = true; Main.dust[num935].noLight = true; } @@ -98,7 +98,7 @@ namespace CalamityMod.NPCs.TheDevourerofGods { npc.alpha = 0; } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (!tail && npc.ai[0] == 0f) { @@ -123,7 +123,7 @@ namespace CalamityMod.NPCs.TheDevourerofGods } tail = true; } - if (!npc.active && Main.netMode == 2) + if (!npc.active && Main.netMode == NetmodeID.Server) { NetMessage.SendData(28, -1, -1, null, npc.whoAmI, -1f, 0f, 0f, 0, 0, 0); } @@ -460,9 +460,9 @@ namespace CalamityMod.NPCs.TheDevourerofGods npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 15; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -470,10 +470,10 @@ namespace CalamityMod.NPCs.TheDevourerofGods } for (int num623 = 0; num623 < 30; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/TheDevourerofGods/DevourerofGodsHeadS.cs b/NPCs/TheDevourerofGods/DevourerofGodsHeadS.cs index 0c8d96b0f4..1c47f90080 100644 --- a/NPCs/TheDevourerofGods/DevourerofGodsHeadS.cs +++ b/NPCs/TheDevourerofGods/DevourerofGodsHeadS.cs @@ -131,7 +131,7 @@ namespace CalamityMod.NPCs.TheDevourerofGods { if (laserWallPhase == 0) //start laser wall phase { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { laserWallCounter += 1; if (laserWallCounter >= 720) @@ -185,9 +185,9 @@ namespace CalamityMod.NPCs.TheDevourerofGods { string key = "Mods.CalamityMod.EdgyBossText11"; Color messageColor = Color.Cyan; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) Main.NewText(Language.GetTextValue(key), messageColor); - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); halfLife = true; @@ -209,7 +209,7 @@ namespace CalamityMod.NPCs.TheDevourerofGods npc.velocity.Length(); // Spawn segments and fire projectiles - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { // Segments if (!tail && npc.ai[0] == 0f) @@ -244,7 +244,7 @@ namespace CalamityMod.NPCs.TheDevourerofGods Vector2 vector44 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); float num427 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector44.X; float num428 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector44.Y; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { float num430 = 16f; int num432 = mod.ProjectileType("DoGFire"); @@ -279,7 +279,7 @@ namespace CalamityMod.NPCs.TheDevourerofGods { Main.PlaySound(2, (int)Main.player[npc.target].position.X, (int)Main.player[npc.target].position.Y, 12); - float targetPosY = Main.player[npc.target].position.Y + (Main.rand.Next(2) == 0 ? 50f : 0f); + float targetPosY = Main.player[npc.target].position.Y + (Main.rand.NextBool(2) ? 50f : 0f); for (int x = 0; x < totalShots; x++) { @@ -288,13 +288,13 @@ namespace CalamityMod.NPCs.TheDevourerofGods shotSpacing[0] -= spacingVar; //105 } - if (Main.rand.Next(2) == 0 && (CalamityWorld.revenge || CalamityWorld.bossRushActive)) + if (Main.rand.NextBool(2) && (CalamityWorld.revenge || CalamityWorld.bossRushActive)) { for (int x = 0; x < 10; x++) { Projectile.NewProjectile(Main.player[npc.target].position.X + 1000f, targetPosY + (float)shotSpacing[3], -speed, 0f, mod.ProjectileType("DoGDeath"), projectileDamage, 0f, Main.myPlayer, 0f, 0f); Projectile.NewProjectile(Main.player[npc.target].position.X - 1000f, targetPosY + (float)shotSpacing[3], speed, 0f, mod.ProjectileType("DoGDeath"), projectileDamage, 0f, Main.myPlayer, 0f, 0f); - shotSpacing[3] -= (Main.rand.Next(2) == 0 ? 180 : 200); + shotSpacing[3] -= (Main.rand.NextBool(2) ? 180 : 200); } shotSpacing[3] = 1050; } @@ -391,7 +391,7 @@ namespace CalamityMod.NPCs.TheDevourerofGods // Flight if (npc.ai[2] == 0f) { - if (Main.netMode != 2) + if (Main.netMode != NetmodeID.Server) { if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active && Vector2.Distance(Main.player[Main.myPlayer].Center, vector) < 5600f) Main.player[Main.myPlayer].AddBuff(mod.BuffType("Warped"), 2); @@ -612,7 +612,7 @@ namespace CalamityMod.NPCs.TheDevourerofGods // Ground else { - if (Main.netMode != 2) + if (Main.netMode != NetmodeID.Server) { if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active && Vector2.Distance(Main.player[Main.myPlayer].Center, vector) < 5600f) Main.player[Main.myPlayer].AddBuff(mod.BuffType("ExtremeGrav"), 2); @@ -893,12 +893,12 @@ namespace CalamityMod.NPCs.TheDevourerofGods string key2 = "Mods.CalamityMod.DoGBossText2"; Color messageColor2 = Color.Orange; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); Main.NewText(Language.GetTextValue(key2), messageColor2); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); NetMessage.BroadcastChatMessage(NetworkText.FromKey(key2), messageColor2); @@ -930,11 +930,11 @@ namespace CalamityMod.NPCs.TheDevourerofGods { string key = "Mods.CalamityMod.EdgyBossText2"; Color messageColor = Color.Cyan; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -969,9 +969,9 @@ namespace CalamityMod.NPCs.TheDevourerofGods npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 15; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -979,10 +979,10 @@ namespace CalamityMod.NPCs.TheDevourerofGods } for (int num623 = 0; num623 < 30; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } @@ -1025,11 +1025,11 @@ namespace CalamityMod.NPCs.TheDevourerofGods key = "Mods.CalamityMod.EdgyBossText7"; } Color messageColor = Color.Cyan; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } diff --git a/NPCs/TheDevourerofGods/DevourerofGodsTail.cs b/NPCs/TheDevourerofGods/DevourerofGodsTail.cs index 1329741259..7828a42da0 100644 --- a/NPCs/TheDevourerofGods/DevourerofGodsTail.cs +++ b/NPCs/TheDevourerofGods/DevourerofGodsTail.cs @@ -100,7 +100,7 @@ namespace CalamityMod.NPCs.TheDevourerofGods { for (int num934 = 0; num934 < 2; num934++) { - int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default(Color), 2f); + int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default, 2f); Main.dust[num935].noGravity = true; Main.dust[num935].noLight = true; } @@ -179,9 +179,9 @@ namespace CalamityMod.NPCs.TheDevourerofGods npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -189,10 +189,10 @@ namespace CalamityMod.NPCs.TheDevourerofGods } for (int num623 = 0; num623 < 20; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } @@ -239,11 +239,11 @@ namespace CalamityMod.NPCs.TheDevourerofGods key = "Mods.CalamityMod.EdgyBossText9"; } Color messageColor = Color.Cyan; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } diff --git a/NPCs/TheDevourerofGods/DevourerofGodsTail2.cs b/NPCs/TheDevourerofGods/DevourerofGodsTail2.cs index 50214a4279..814602f733 100644 --- a/NPCs/TheDevourerofGods/DevourerofGodsTail2.cs +++ b/NPCs/TheDevourerofGods/DevourerofGodsTail2.cs @@ -82,7 +82,7 @@ namespace CalamityMod.NPCs.TheDevourerofGods { if (npc.alpha != 0) { - int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default(Color), 2f); + int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default, 2f); Main.dust[num935].noGravity = true; Main.dust[num935].noLight = true; } @@ -117,9 +117,9 @@ namespace CalamityMod.NPCs.TheDevourerofGods npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -127,10 +127,10 @@ namespace CalamityMod.NPCs.TheDevourerofGods } for (int num623 = 0; num623 < 20; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/TheDevourerofGods/DevourerofGodsTailS.cs b/NPCs/TheDevourerofGods/DevourerofGodsTailS.cs index 25a88b0d2a..420106eccd 100644 --- a/NPCs/TheDevourerofGods/DevourerofGodsTailS.cs +++ b/NPCs/TheDevourerofGods/DevourerofGodsTailS.cs @@ -214,9 +214,9 @@ namespace CalamityMod.NPCs.TheDevourerofGods npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -224,10 +224,10 @@ namespace CalamityMod.NPCs.TheDevourerofGods } for (int num623 = 0; num623 < 20; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } @@ -282,11 +282,11 @@ namespace CalamityMod.NPCs.TheDevourerofGods key = "Mods.CalamityMod.EdgyBossText9"; } Color messageColor = Color.Cyan; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } diff --git a/NPCs/TownNPCs/DILF.cs b/NPCs/TownNPCs/DILF.cs index 4a056707aa..5e97892ae1 100644 --- a/NPCs/TownNPCs/DILF.cs +++ b/NPCs/TownNPCs/DILF.cs @@ -56,7 +56,7 @@ namespace CalamityMod.NPCs.TownNPCs { if (npc.homeless) //not sure how to check if he has ever found a home before (to make this dialogue only run when he first spawns) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) return "I deeply appreciate you rescuing me from being trapped within my frozen castle…. It's been many, many years..."; else return "Thank you for saving me...though now I admit I am without a home since mine got destroyed."; diff --git a/NPCs/TownNPCs/FAP.cs b/NPCs/TownNPCs/FAP.cs index cd3631ba54..17005c6eb6 100644 --- a/NPCs/TownNPCs/FAP.cs +++ b/NPCs/TownNPCs/FAP.cs @@ -74,7 +74,7 @@ namespace CalamityMod.NPCs.TownNPCs if (npc.homeless) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) return "I could smell my vodka from MILES away!"; else return "Have any spare rooms available? Preferably candle-lit with a hefty supply of booze."; diff --git a/NPCs/TownNPCs/SEAHOE.cs b/NPCs/TownNPCs/SEAHOE.cs index de3ba00e69..405b4d87bf 100644 --- a/NPCs/TownNPCs/SEAHOE.cs +++ b/NPCs/TownNPCs/SEAHOE.cs @@ -62,7 +62,7 @@ namespace CalamityMod.NPCs.TownNPCs if (npc.homeless) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) return "Is this...what the world is like now? It seems so much more lifeless than when I saw it before I disappeared."; else return "Thank you for your service, my child, but I am afraid I am without a home now."; diff --git a/NPCs/Yharon/DetonatingFlare.cs b/NPCs/Yharon/DetonatingFlare.cs index 6ffd6fb464..53b6de4383 100644 --- a/NPCs/Yharon/DetonatingFlare.cs +++ b/NPCs/Yharon/DetonatingFlare.cs @@ -133,7 +133,7 @@ namespace CalamityMod.NPCs.Yharon } int shoot = revenge ? 4 : 3; npc.localAI[0] += (float)(Main.rand.Next(shoot)); - if (Main.netMode != 1 && npc.localAI[0] >= 300f) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] >= 300f) { npc.localAI[0] = 0f; if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index dbec00ee1b..a3393ffdfe 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -18,7 +18,7 @@ namespace CalamityMod.NPCs.Yharon [AutoloadBossHead] public class Yharon : ModNPC { - private Rectangle safeBox = default(Rectangle); + private Rectangle safeBox = default; private bool protectionBoost = false; private bool moveCloser = false; private bool phaseOneLoot = false; @@ -156,11 +156,11 @@ namespace CalamityMod.NPCs.Yharon { string key = "Mods.CalamityMod.DargonBossText2"; Color messageColor = Color.Orange; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -205,7 +205,7 @@ namespace CalamityMod.NPCs.Yharon safeBox.Y = (int)(vectorPlayer.Y - (revenge ? 9000f : 10500f)); safeBox.Width = revenge ? 6000 : 7000; safeBox.Height = revenge ? 18000 : 21000; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { Projectile.NewProjectile(Main.player[npc.target].position.X + (revenge ? 3000f : 3500f), Main.player[npc.target].position.Y + 100f, 0f, 0f, mod.ProjectileType("SkyFlareRevenge"), 0, 0f, Main.myPlayer, 0f, 0f); Projectile.NewProjectile(Main.player[npc.target].position.X - (revenge ? 3000f : 3500f), Main.player[npc.target].position.Y + 100f, 0f, 0f, mod.ProjectileType("SkyFlareRevenge"), 0, 0f, Main.myPlayer, 0f, 0f); @@ -350,7 +350,7 @@ namespace CalamityMod.NPCs.Yharon npc.localAI[0] = 1f; npc.alpha = 255; npc.rotation = 0f; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.ai[0] = -1f; npc.netUpdate = true; @@ -513,9 +513,9 @@ namespace CalamityMod.NPCs.Yharon for (int num1469 = 0; num1469 < num1468; num1469++) { Vector2 vector169 = Vector2.Normalize(npc.velocity) * new Vector2((float)npc.width / 2f, (float)npc.height) * 0.75f * 0.5f; - vector169 = vector169.RotatedBy((double)((float)(num1469 - (num1468 / 2 - 1)) * 6.28318548f / (float)num1468), default(Vector2)) + npc.Center; + vector169 = vector169.RotatedBy((double)((float)(num1469 - (num1468 / 2 - 1)) * 6.28318548f / (float)num1468), default) + npc.Center; Vector2 value16 = vector169 - npc.Center; - int num1470 = Dust.NewDust(vector169 + value16, 0, 0, 244, value16.X * 2f, value16.Y * 2f, 100, default(Color), 1.4f); + int num1470 = Dust.NewDust(vector169 + value16, 0, 0, 244, value16.X * 2f, value16.Y * 2f, 100, default, 1.4f); Main.dust[num1470].noGravity = true; Main.dust[num1470].noLight = true; Main.dust[num1470].velocity = Vector2.Normalize(value16) * 3f; @@ -679,9 +679,9 @@ namespace CalamityMod.NPCs.Yharon for (int num1474 = 0; num1474 < num1473; num1474++) { Vector2 vector171 = Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f; - vector171 = vector171.RotatedBy((double)(num1474 - (num1473 / 2 - 1)) * 3.1415926535897931 / (double)((float)num1473), default(Vector2)) + vectorCenter; + vector171 = vector171.RotatedBy((double)(num1474 - (num1473 / 2 - 1)) * 3.1415926535897931 / (double)((float)num1473), default) + vectorCenter; Vector2 value18 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); - int num1475 = Dust.NewDust(vector171 + value18, 0, 0, 244, value18.X * 2f, value18.Y * 2f, 100, default(Color), 1.4f); + int num1475 = Dust.NewDust(vector171 + value18, 0, 0, 244, value18.X * 2f, value18.Y * 2f, 100, default, 1.4f); Main.dust[num1475].noGravity = true; Main.dust[num1475].noLight = true; Main.dust[num1475].velocity /= 4f; @@ -744,7 +744,7 @@ namespace CalamityMod.NPCs.Yharon if (npc.ai[2] % (float)num1455 == 0f) //fire flare bombs from mouth { Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { Vector2 vector = Vector2.Normalize(player.Center - vectorCenter) * (float)(npc.width + 20) / 2f + vectorCenter; if (NPC.CountNPCS(mod.NPCType("DetonatingFlare")) < flareCount) @@ -782,7 +782,7 @@ namespace CalamityMod.NPCs.Yharon { Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); } - if (Main.netMode != 1 && npc.ai[2] == (float)(num1457 - 30)) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == (float)(num1457 - 30)) { Projectile.NewProjectile(vectorCenter.X, vectorCenter.Y, (float)(npc.direction * 2), 8f, mod.ProjectileType("Flare"), 0, 0f, Main.myPlayer, 1f, (float)(npc.target + 1)); //changed Projectile.NewProjectile(vectorCenter.X, vectorCenter.Y, (float)(-(float)npc.direction * 2), 8f, mod.ProjectileType("Flare"), 0, 0f, Main.myPlayer, 0f, 0f); //changed @@ -822,9 +822,9 @@ namespace CalamityMod.NPCs.Yharon for (int num1474 = 0; num1474 < num1473; num1474++) { Vector2 vector171 = Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f; - vector171 = vector171.RotatedBy((double)(num1474 - (num1473 / 2 - 1)) * 3.1415926535897931 / (double)((float)num1473), default(Vector2)) + vectorCenter; + vector171 = vector171.RotatedBy((double)(num1474 - (num1473 / 2 - 1)) * 3.1415926535897931 / (double)((float)num1473), default) + vectorCenter; Vector2 value18 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); - int num1475 = Dust.NewDust(vector171 + value18, 0, 0, 244, value18.X * 2f, value18.Y * 2f, 100, default(Color), 1.4f); //changed + int num1475 = Dust.NewDust(vector171 + value18, 0, 0, 244, value18.X * 2f, value18.Y * 2f, 100, default, 1.4f); //changed Main.dust[num1475].noGravity = true; Main.dust[num1475].noLight = true; Main.dust[num1475].velocity /= 4f; @@ -1020,9 +1020,9 @@ namespace CalamityMod.NPCs.Yharon for (int num1480 = 0; num1480 < num1479; num1480++) { Vector2 vector176 = Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f; - vector176 = vector176.RotatedBy((double)(num1480 - (num1479 / 2 - 1)) * 3.1415926535897931 / (double)((float)num1479), default(Vector2)) + vectorCenter; + vector176 = vector176.RotatedBy((double)(num1480 - (num1479 / 2 - 1)) * 3.1415926535897931 / (double)((float)num1479), default) + vectorCenter; Vector2 value21 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); - int num1481 = Dust.NewDust(vector176 + value21, 0, 0, 244, value21.X * 2f, value21.Y * 2f, 100, default(Color), 1.4f); //changed + int num1481 = Dust.NewDust(vector176 + value21, 0, 0, 244, value21.X * 2f, value21.Y * 2f, 100, default, 1.4f); //changed Main.dust[num1481].noGravity = true; Main.dust[num1481].noLight = true; Main.dust[num1481].velocity /= 4f; @@ -1047,7 +1047,7 @@ namespace CalamityMod.NPCs.Yharon if (npc.ai[2] % (float)num1462 == 0f) { Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { Vector2 vector = Vector2.Normalize(player.Center - vectorCenter) * (float)(npc.width + 20) / 2f + vectorCenter; if (NPC.CountNPCS(mod.NPCType("DetonatingFlare2")) < flareCount) @@ -1057,7 +1057,7 @@ namespace CalamityMod.NPCs.Yharon Projectile.NewProjectile((int)vector.X + xPos, (int)vector.Y - 15, (float)Main.rand.Next(-400, 401) * 0.13f, (float)Main.rand.Next(-30, 31) * 0.13f, mod.ProjectileType("FlareDust"), 0, 0f, Main.myPlayer, 0f, 0f); //changed } } - npc.velocity = npc.velocity.RotatedBy((double)(-(double)num1463 * (float)npc.direction), default(Vector2)); + npc.velocity = npc.velocity.RotatedBy((double)(-(double)num1463 * (float)npc.direction), default); npc.rotation -= num1463 * (float)npc.direction; npc.ai[2] += 1f; if (npc.ai[2] >= (float)num1461) @@ -1076,7 +1076,7 @@ namespace CalamityMod.NPCs.Yharon { Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); } - if (Main.netMode != 1 && npc.ai[2] == (float)(num1457 - 30)) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == (float)(num1457 - 30)) { Projectile.NewProjectile(vectorCenter.X, vectorCenter.Y, 0f, 0f, mod.ProjectileType("BigFlare"), 0, 0f, Main.myPlayer, 1f, (float)(npc.target + 1)); } @@ -1115,9 +1115,9 @@ namespace CalamityMod.NPCs.Yharon for (int num1480 = 0; num1480 < num1479; num1480++) { Vector2 vector176 = Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f; - vector176 = vector176.RotatedBy((double)(num1480 - (num1479 / 2 - 1)) * 3.1415926535897931 / (double)((float)num1479), default(Vector2)) + vectorCenter; + vector176 = vector176.RotatedBy((double)(num1480 - (num1479 / 2 - 1)) * 3.1415926535897931 / (double)((float)num1479), default) + vectorCenter; Vector2 value21 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); - int num1481 = Dust.NewDust(vector176 + value21, 0, 0, 244, value21.X * 2f, value21.Y * 2f, 100, default(Color), 1.4f); //changed + int num1481 = Dust.NewDust(vector176 + value21, 0, 0, 244, value21.X * 2f, value21.Y * 2f, 100, default, 1.4f); //changed Main.dust[num1481].noGravity = true; Main.dust[num1481].noLight = true; Main.dust[num1481].velocity /= 4f; @@ -1142,7 +1142,7 @@ namespace CalamityMod.NPCs.Yharon if (npc.ai[2] % (float)num1462 == 0f) { Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int damage = expertMode ? 75 : 90; //700 Vector2 vector173 = Vector2.Normalize(player.Center - vectorCenter) * (float)(npc.width + 20) / 2f + vectorCenter; @@ -1157,7 +1157,7 @@ namespace CalamityMod.NPCs.Yharon Projectile.NewProjectile((int)vector173.X + xPos, (int)vector173.Y - 15, playerX, playerY, mod.ProjectileType("FlareDust2"), damage, 0f, Main.myPlayer, 0f, 0f); } } - npc.velocity = npc.velocity.RotatedBy((double)(-(double)num1463 * (float)npc.direction), default(Vector2)); + npc.velocity = npc.velocity.RotatedBy((double)(-(double)num1463 * (float)npc.direction), default); npc.rotation -= num1463 * (float)npc.direction; npc.ai[2] += 1f; if (npc.ai[2] >= (float)num1461) @@ -1360,9 +1360,9 @@ namespace CalamityMod.NPCs.Yharon for (int num1480 = 0; num1480 < num1479; num1480++) { Vector2 vector176 = Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f; - vector176 = vector176.RotatedBy((double)(num1480 - (num1479 / 2 - 1)) * 3.1415926535897931 / (double)((float)num1479), default(Vector2)) + vectorCenter; + vector176 = vector176.RotatedBy((double)(num1480 - (num1479 / 2 - 1)) * 3.1415926535897931 / (double)((float)num1479), default) + vectorCenter; Vector2 value21 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); - int num1481 = Dust.NewDust(vector176 + value21, 0, 0, 244, value21.X * 2f, value21.Y * 2f, 100, default(Color), 1.4f); + int num1481 = Dust.NewDust(vector176 + value21, 0, 0, 244, value21.X * 2f, value21.Y * 2f, 100, default, 1.4f); Main.dust[num1481].noGravity = true; Main.dust[num1481].noLight = true; Main.dust[num1481].velocity /= 4f; @@ -1389,18 +1389,18 @@ namespace CalamityMod.NPCs.Yharon if (npc.ai[2] % (float)num1462 == 0f) { Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { Vector2 vector = Vector2.Normalize(player.Center - vectorCenter) * (float)(npc.width + 20) / 2f + vectorCenter; if (NPC.CountNPCS(mod.NPCType("DetonatingFlare2")) < flareCount && NPC.CountNPCS(mod.NPCType("DetonatingFlare")) < flareCount) { - NPC.NewNPC((int)vector.X + xPos, (int)vector.Y - 15, (Main.rand.Next(2) == 0 ? mod.NPCType("DetonatingFlare") : mod.NPCType("DetonatingFlare2")), 0, 0f, 0f, 0f, 0f, 255); + NPC.NewNPC((int)vector.X + xPos, (int)vector.Y - 15, (Main.rand.NextBool(2) ? mod.NPCType("DetonatingFlare") : mod.NPCType("DetonatingFlare2")), 0, 0f, 0f, 0f, 0f, 255); } Projectile.NewProjectile((int)vector.X + xPos, (int)vector.Y - 15, (float)Main.rand.Next(-401, 401) * 0.13f, (float)Main.rand.Next(-31, 31) * 0.13f, mod.ProjectileType("FlareDust"), 0, 0f, Main.myPlayer, 0f, 0f); //changed Projectile.NewProjectile((int)vector.X + xPos, (int)vector.Y - 15, (float)Main.rand.Next(-31, 31) * 0.13f, (float)Main.rand.Next(-151, 151) * 0.13f, mod.ProjectileType("FlareDust"), 0, 0f, Main.myPlayer, 0f, 0f); //changed } } - npc.velocity = npc.velocity.RotatedBy((double)(-(double)num1463 * (float)npc.direction), default(Vector2)); + npc.velocity = npc.velocity.RotatedBy((double)(-(double)num1463 * (float)npc.direction), default); npc.rotation -= num1463 * (float)npc.direction; npc.ai[2] += 1f; if (npc.ai[2] >= (float)num1461) @@ -1421,7 +1421,7 @@ namespace CalamityMod.NPCs.Yharon { Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); } - if (Main.netMode != 1 && npc.ai[2] == (float)(num1457 - 30)) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == (float)(num1457 - 30)) { Projectile.NewProjectile(vectorCenter.X, vectorCenter.Y, 0f, 0f, mod.ProjectileType("BigFlare"), 0, 0f, Main.myPlayer, 1f, (float)(npc.target + 1)); } @@ -1491,9 +1491,9 @@ namespace CalamityMod.NPCs.Yharon for (int num1480 = 0; num1480 < num1479; num1480++) { Vector2 vector176 = Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f; - vector176 = vector176.RotatedBy((double)(num1480 - (num1479 / 2 - 1)) * 3.1415926535897931 / (double)((float)num1479), default(Vector2)) + vectorCenter; + vector176 = vector176.RotatedBy((double)(num1480 - (num1479 / 2 - 1)) * 3.1415926535897931 / (double)((float)num1479), default) + vectorCenter; Vector2 value21 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); - int num1481 = Dust.NewDust(vector176 + value21, 0, 0, 244, value21.X * 2f, value21.Y * 2f, 100, default(Color), 1.4f); + int num1481 = Dust.NewDust(vector176 + value21, 0, 0, 244, value21.X * 2f, value21.Y * 2f, 100, default, 1.4f); Main.dust[num1481].noGravity = true; Main.dust[num1481].noLight = true; Main.dust[num1481].velocity /= 4f; @@ -1520,7 +1520,7 @@ namespace CalamityMod.NPCs.Yharon if (npc.ai[2] % (float)num1462 == 0f) { Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int damage = expertMode ? 75 : 90; //700 Vector2 vector173 = Vector2.Normalize(player.Center - vectorCenter) * (float)(npc.width + 20) / 2f + vectorCenter; @@ -1535,7 +1535,7 @@ namespace CalamityMod.NPCs.Yharon Projectile.NewProjectile((int)vector173.X + xPos, (int)vector173.Y - 15, playerX, playerY, mod.ProjectileType("FlareDust2"), damage, 0f, Main.myPlayer, 0f, 0f); } } - npc.velocity = npc.velocity.RotatedBy((double)(-(double)num1463 * (float)npc.direction), default(Vector2)); + npc.velocity = npc.velocity.RotatedBy((double)(-(double)num1463 * (float)npc.direction), default); npc.rotation -= num1463 * (float)npc.direction; npc.ai[2] += 1f; if (npc.ai[2] >= (float)num1461) @@ -1559,14 +1559,14 @@ namespace CalamityMod.NPCs.Yharon } if (CalamityWorld.death && !CalamityWorld.bossRushActive) { - if (Main.netMode != 1 && npc.ai[2] == (float)(num1457 - 30)) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == (float)(num1457 - 30)) { Projectile.NewProjectile(vectorCenter.X, vectorCenter.Y, 0f, 0f, mod.ProjectileType("BigFlare"), 0, 0f, Main.myPlayer, 1f, (float)(npc.target + 1)); } } else { - if (Main.netMode != 1 && npc.ai[2] == (float)(num1457 - 30)) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == (float)(num1457 - 30)) { Projectile.NewProjectile(vectorCenter.X, vectorCenter.Y, 0f, 0f, mod.ProjectileType("Flare"), 0, 0f, Main.myPlayer, 1f, (float)(npc.target + 1)); } @@ -1596,7 +1596,7 @@ namespace CalamityMod.NPCs.Yharon } if (npc.ai[1] == 0f) { - teleportLocation = (Main.rand.Next(2) == 0 ? (revenge ? 500 : 600) : (revenge ? -500 : -600)); + teleportLocation = (Main.rand.NextBool(2) ? (revenge ? 500 : 600) : (revenge ? -500 : -600)); npc.ai[1] = (float)(360 * Math.Sign((vectorCenter - player.Center).X)); } Vector2 value7 = player.Center + new Vector2(npc.ai[1], (float)teleportLocation) - vectorCenter; //teleport distance @@ -1702,9 +1702,9 @@ namespace CalamityMod.NPCs.Yharon for (int m = 0; m < num34; m++) { Vector2 vector11 = Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f; - vector11 = vector11.RotatedBy((double)(m - (num34 / 2 - 1)) * 3.1415926535897931 / (double)((float)num34), default(Vector2)) + vectorCenter; + vector11 = vector11.RotatedBy((double)(m - (num34 / 2 - 1)) * 3.1415926535897931 / (double)((float)num34), default) + vectorCenter; Vector2 value8 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); - int num35 = Dust.NewDust(vector11 + value8, 0, 0, 244, value8.X * 2f, value8.Y * 2f, 100, default(Color), 1.4f); + int num35 = Dust.NewDust(vector11 + value8, 0, 0, 244, value8.X * 2f, value8.Y * 2f, 100, default, 1.4f); Main.dust[num35].noGravity = true; Main.dust[num35].noLight = true; Main.dust[num35].velocity /= 4f; @@ -1738,7 +1738,7 @@ namespace CalamityMod.NPCs.Yharon { Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); } - if (Main.netMode != 1 && npc.ai[2] == (float)(num1460 / 2)) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == (float)(num1460 / 2)) { if (npc.ai[1] == 0f) { @@ -1768,7 +1768,7 @@ namespace CalamityMod.NPCs.Yharon npc.ai[1] = 0f; npc.ai[2] = 0f; npc.ai[3] += 1f; - if (npc.ai[3] == 5f && Main.netMode != 1) + if (npc.ai[3] == 5f && Main.netMode != NetmodeID.MultiplayerClient) { Projectile.NewProjectile(vectorCenter.X, vectorCenter.Y, 0f, 0f, mod.ProjectileType("BigFlare"), 0, 0f, Main.myPlayer, 1f, (float)(npc.target + 1)); } @@ -1787,7 +1787,7 @@ namespace CalamityMod.NPCs.Yharon { Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); } - npc.velocity = npc.velocity.RotatedBy((double)(-(double)num1463 * (float)npc.direction), default(Vector2)); + npc.velocity = npc.velocity.RotatedBy((double)(-(double)num1463 * (float)npc.direction), default); npc.rotation -= num1463 * (float)npc.direction; npc.ai[2] += 1f; if (npc.ai[2] >= (float)num1461) @@ -1863,11 +1863,11 @@ namespace CalamityMod.NPCs.Yharon moveCloser = true; string key = "Mods.CalamityMod.FlameText"; Color messageColor = Color.Orange; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -1881,7 +1881,7 @@ namespace CalamityMod.NPCs.Yharon if (healCounter >= heal) { healCounter = 0; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { int healAmt = npc.lifeMax / 200; if (healAmt > npc.lifeMax - npc.life) @@ -2257,9 +2257,9 @@ namespace CalamityMod.NPCs.Yharon for (int num1474 = 0; num1474 < num1473; num1474++) { Vector2 vector171 = Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f; - vector171 = vector171.RotatedBy((double)(num1474 - (num1473 / 2 - 1)) * 3.1415926535897931 / (double)((float)num1473), default(Vector2)) + npc.Center; + vector171 = vector171.RotatedBy((double)(num1474 - (num1473 / 2 - 1)) * 3.1415926535897931 / (double)((float)num1473), default) + npc.Center; Vector2 value18 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); - int num1475 = Dust.NewDust(vector171 + value18, 0, 0, 244, value18.X * 2f, value18.Y * 2f, 100, default(Color), 1.4f); + int num1475 = Dust.NewDust(vector171 + value18, 0, 0, 244, value18.X * 2f, value18.Y * 2f, 100, default, 1.4f); Main.dust[num1475].noGravity = true; Main.dust[num1475].noLight = true; Main.dust[num1475].velocity /= 4f; @@ -2307,11 +2307,11 @@ namespace CalamityMod.NPCs.Yharon } if (npc.ai[1] >= num11) { - if (npc.ai[1] % 8 == 0 && Main.netMode != 1) + if (npc.ai[1] % 8 == 0 && Main.netMode != NetmodeID.MultiplayerClient) { float num33 = 30f; Vector2 position = npc.Center + new Vector2((110f + num33) * (float)npc.direction, -20f).RotatedBy((double)npc.rotation, - default(Vector2)); + default); float speed = 0.01f; Vector2 vectorShoot = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f + 30f); float playerX = targetData.Center.X - vectorShoot.X; @@ -2375,9 +2375,9 @@ namespace CalamityMod.NPCs.Yharon } float num33 = 30f; Vector2 position = npc.Center + new Vector2((110f + num33) * (float)npc.direction, -20f).RotatedBy((double)npc.rotation, - default(Vector2)); + default); int num34 = (int)(npc.ai[1] - num15 + 1f); - if (num34 <= num17 && num34 % num16 == 0 && Main.netMode != 1) + if (num34 <= num17 && num34 % num16 == 0 && Main.netMode != NetmodeID.MultiplayerClient) { Projectile.NewProjectile(position, npc.velocity, mod.ProjectileType("YharonFireball"), num4, 0f, Main.myPlayer, 0f, 0f); } @@ -2396,7 +2396,7 @@ namespace CalamityMod.NPCs.Yharon } else if (npc.ai[0] == 5f) //spin 2 win { - npc.velocity = npc.velocity.RotatedBy((double)(-(double)num22 * (float)npc.direction), default(Vector2)); + npc.velocity = npc.velocity.RotatedBy((double)(-(double)num22 * (float)npc.direction), default); npc.position.Y = npc.position.Y - 0.1f; npc.position += npc.DirectionTo(targetData.Center) * 10f; npc.rotation -= num22 * (float)npc.direction; @@ -2409,13 +2409,13 @@ namespace CalamityMod.NPCs.Yharon int expr_B0F_cp_1 = 1; num26 = expr_B0F_cp_0[expr_B0F_cp_1] + 1f; expr_B0F_cp_0[expr_B0F_cp_1] = num26; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (npc.ai[1] % 12 == 0) { float num33 = 30f; Vector2 position = npc.Center + new Vector2((110f + num33) * (float)npc.direction, -20f).RotatedBy((double)npc.rotation, - default(Vector2)); + default); Projectile.NewProjectile(position, npc.velocity, mod.ProjectileType("YharonFireball"), num4, 0f, Main.myPlayer, 0f, 0f); if (phase4) { @@ -2489,7 +2489,7 @@ namespace CalamityMod.NPCs.Yharon { flag3 = false; } - if (flag3 && Main.netMode != 1) + if (flag3 && Main.netMode != NetmodeID.MultiplayerClient) { Vector2 vector7 = npc.Center + (6.28318548f * Main.rand.NextFloat()).ToRotationVector2() * new Vector2(2f, 1f) * 100f * (0.6f + Main.rand.NextFloat() * 0.4f); if (Vector2.Distance(vector7, targetData.Center) > 100f) @@ -2498,14 +2498,14 @@ namespace CalamityMod.NPCs.Yharon NPC.NewNPC(point2.X, point2.Y, mod.NPCType("DetonatingFlare"), npc.whoAmI, 0f, 0f, 0f, 0f, 255); NPC.NewNPC(point2.X, point2.Y, mod.NPCType("DetonatingFlare2"), npc.whoAmI, 0f, 0f, 0f, 0f, 255); } - NPC.NewNPC((int)npc.Center.X + (Main.rand.Next(2) == 0 ? 100 : -100), (int)npc.Center.Y - 100, mod.NPCType("DetonatingFlare"), 0, 0f, 0f, 0f, 0f, 255); - NPC.NewNPC((int)npc.Center.X + (Main.rand.Next(2) == 0 ? 100 : -100), (int)npc.Center.Y - 100, mod.NPCType("DetonatingFlare2"), 0, 0f, 0f, 0f, 0f, 255); + NPC.NewNPC((int)npc.Center.X + (Main.rand.NextBool(2) ? 100 : -100), (int)npc.Center.Y - 100, mod.NPCType("DetonatingFlare"), 0, 0f, 0f, 0f, 0f, 255); + NPC.NewNPC((int)npc.Center.X + (Main.rand.NextBool(2) ? 100 : -100), (int)npc.Center.Y - 100, mod.NPCType("DetonatingFlare2"), 0, 0f, 0f, 0f, 0f, 255); } npc.ai[1] += 1f; } if (npc.ai[1] >= 90f) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { Projectile.NewProjectile(npc.Center.X, npc.Center.Y, 0f, 0f, mod.ProjectileType("BigFlare2"), 0, 0f, Main.myPlayer, 1f, (float)(npc.target + 1)); Boom(600, num4); @@ -2525,9 +2525,9 @@ namespace CalamityMod.NPCs.Yharon for (int num1474 = 0; num1474 < num1473; num1474++) { Vector2 vector171 = Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f; - vector171 = vector171.RotatedBy((double)(num1474 - (num1473 / 2 - 1)) * 3.1415926535897931 / (double)((float)num1473), default(Vector2)) + npc.Center; + vector171 = vector171.RotatedBy((double)(num1474 - (num1473 / 2 - 1)) * 3.1415926535897931 / (double)((float)num1473), default) + npc.Center; Vector2 value18 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); - int num1475 = Dust.NewDust(vector171 + value18, 0, 0, 244, value18.X * 2f, value18.Y * 2f, 100, default(Color), 1.4f); + int num1475 = Dust.NewDust(vector171 + value18, 0, 0, 244, value18.X * 2f, value18.Y * 2f, 100, default, 1.4f); Main.dust[num1475].noGravity = true; Main.dust[num1475].noLight = true; Main.dust[num1475].velocity /= 4f; @@ -2561,13 +2561,13 @@ namespace CalamityMod.NPCs.Yharon { Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); } - if (Main.netMode != 1 && npc.ai[2] == 15f) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == 15f) { if (npc.ai[1] == 0f) { npc.ai[1] = (float)(300 * Math.Sign((npcCenter - targetData.Center).X)); } - teleportLocation = (Main.rand.Next(2) == 0 ? (revenge ? 600 : 700) : (revenge ? -600 : -700)); + teleportLocation = (Main.rand.NextBool(2) ? (revenge ? 600 : 700) : (revenge ? -600 : -700)); Vector2 center = targetData.Center + new Vector2(-npc.ai[1], (float)teleportLocation); //teleport distance npcCenter = (npc.Center = center); } @@ -2788,9 +2788,9 @@ namespace CalamityMod.NPCs.Yharon string key = "Mods.CalamityMod.DargonBossText"; Color messageColor = Color.Orange; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) Main.NewText(Language.GetTextValue(key), messageColor); - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -2841,9 +2841,9 @@ namespace CalamityMod.NPCs.Yharon string key = "Mods.CalamityMod.AuricOreText"; Color messageColor = Color.Gold; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) Main.NewText(Language.GetTextValue(key), messageColor); - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -3005,7 +3005,7 @@ namespace CalamityMod.NPCs.Yharon #region Boom public void Boom(int timeLeft, int damage) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { Vector2 valueBoom = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); float spreadBoom = 15f * 0.0174f; @@ -3030,7 +3030,7 @@ namespace CalamityMod.NPCs.Yharon { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -3043,9 +3043,9 @@ namespace CalamityMod.NPCs.Yharon npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 244, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -3053,10 +3053,10 @@ namespace CalamityMod.NPCs.Yharon } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 244, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 244, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 244, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Amidias/HermitCrab.cs b/Projectiles/Amidias/HermitCrab.cs index 122f2c3ac2..a2427df035 100644 --- a/Projectiles/Amidias/HermitCrab.cs +++ b/Projectiles/Amidias/HermitCrab.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Amidias int num501 = 20; for (int num502 = 0; num502 < num501; num502++) { - int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 33, 0f, 0f, 0, default(Color), 1f); + int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 33, 0f, 0f, 0, default, 1f); Main.dust[num503].velocity *= 2f; Main.dust[num503].scale *= 1.15f; } diff --git a/Projectiles/Amidias/WaywasherProj.cs b/Projectiles/Amidias/WaywasherProj.cs index 61310b9e3c..578edd636a 100644 --- a/Projectiles/Amidias/WaywasherProj.cs +++ b/Projectiles/Amidias/WaywasherProj.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Amidias Dust expr_4815_cp_0 = Main.dust[num102]; expr_4815_cp_0.position.Y = expr_4815_cp_0.position.Y - num100; } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int num103 = 4; int num104 = Dust.NewDust(new Vector2(projectile.position.X + (float)num103, projectile.position.Y + (float)num103), projectile.width - num103 * 2, projectile.height - num103 * 2, 33, 0f, 0f, 0, new Color(0, 142, 255), 0.6f); diff --git a/Projectiles/Astral/AstralCannonProjectile.cs b/Projectiles/Astral/AstralCannonProjectile.cs index a0b671d65f..7d6e5b0f27 100644 --- a/Projectiles/Astral/AstralCannonProjectile.cs +++ b/Projectiles/Astral/AstralCannonProjectile.cs @@ -86,14 +86,14 @@ namespace CalamityMod.Projectiles.Astral Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("AstralCannonExplosion"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); for (int num193 = 0; num193 < 2; num193++) { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 50, default(Color), 1f); + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 50, default, 1f); } for (int num194 = 0; num194 < 20; num194++) { - int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 0, default(Color), 1.5f); + int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 0, default, 1.5f); Main.dust[num195].noGravity = true; Main.dust[num195].velocity *= 3f; - num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralBlue"), 0f, 0f, 50, default(Color), 1f); + num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralBlue"), 0f, 0f, 50, default, 1f); Main.dust[num195].velocity *= 2f; Main.dust[num195].noGravity = true; } diff --git a/Projectiles/Astral/AstralachneaFang.cs b/Projectiles/Astral/AstralachneaFang.cs index be53e6c7aa..a300962205 100644 --- a/Projectiles/Astral/AstralachneaFang.cs +++ b/Projectiles/Astral/AstralachneaFang.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Astral public override void AI() { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 1f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 1f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; if (projectile.velocity.X < 0f) diff --git a/Projectiles/Astral/HeavenfallenEnergy.cs b/Projectiles/Astral/HeavenfallenEnergy.cs index 4454df6e8e..67efba475b 100644 --- a/Projectiles/Astral/HeavenfallenEnergy.cs +++ b/Projectiles/Astral/HeavenfallenEnergy.cs @@ -31,11 +31,11 @@ namespace CalamityMod.Projectiles.Astral { if (projectile.ai[0] % 4 == 0) { - coolDust = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num154 * 2, projectile.height - num154 * 2, mod.DustType("AstralBlue"), 0f, 0f, 100, default(Color), 1.5f); + coolDust = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num154 * 2, projectile.height - num154 * 2, mod.DustType("AstralBlue"), 0f, 0f, 100, default, 1.5f); } else { - coolDust = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num154 * 2, projectile.height - num154 * 2, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 1.5f); + coolDust = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num154 * 2, projectile.height - num154 * 2, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 1.5f); } Main.dust[coolDust].noGravity = true; Main.dust[coolDust].velocity *= 0.1f; diff --git a/Projectiles/Astral/HeavenfallenStardisk.cs b/Projectiles/Astral/HeavenfallenStardisk.cs index 009f2842ba..ac59215813 100644 --- a/Projectiles/Astral/HeavenfallenStardisk.cs +++ b/Projectiles/Astral/HeavenfallenStardisk.cs @@ -44,13 +44,13 @@ namespace CalamityMod.Projectiles.Astral for (int i = 0; i < 2; i++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralBlue"), 0f, 0f, 100, default(Color), 1f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralBlue"), 0f, 0f, 100, default, 1f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } for (int i = 0; i < 2; i++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 1f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 1f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } @@ -146,13 +146,13 @@ namespace CalamityMod.Projectiles.Astral Main.PlaySound(SoundID.Item10, projectile.position); for (int i = 0; i < 10; i++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralBlue"), 0f, 0f, 100, default(Color), 1.5f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralBlue"), 0f, 0f, 100, default, 1.5f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } for (int i = 0; i < 10; i++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 1.5f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 1.5f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Astral/RadiantExplosion.cs b/Projectiles/Astral/RadiantExplosion.cs index 66ba8674e4..7afaa6a00f 100644 --- a/Projectiles/Astral/RadiantExplosion.cs +++ b/Projectiles/Astral/RadiantExplosion.cs @@ -32,13 +32,13 @@ namespace CalamityMod.Projectiles.Astral { for (int i = 0; i < 5; i++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralBlue"), 0f, 0f, 100, default(Color), 1.5f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralBlue"), 0f, 0f, 100, default, 1.5f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } for (int i = 0; i < 5; i++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 1.5f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 1.5f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Boss/AbyssBallVolley.cs b/Projectiles/Boss/AbyssBallVolley.cs index 1731e54511..d8f4cb1419 100644 --- a/Projectiles/Boss/AbyssBallVolley.cs +++ b/Projectiles/Boss/AbyssBallVolley.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Boss projectile.ai[1] = 1f; Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 33); } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 173, 0f, 0f); } diff --git a/Projectiles/Boss/AbyssBallVolley2.cs b/Projectiles/Boss/AbyssBallVolley2.cs index 7e10a83c54..e2a6e6283a 100644 --- a/Projectiles/Boss/AbyssBallVolley2.cs +++ b/Projectiles/Boss/AbyssBallVolley2.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Boss projectile.ai[1] = 1f; Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 33); } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 127, 0f, 0f); Main.dust[dust].noGravity = true; diff --git a/Projectiles/Boss/AbyssMine.cs b/Projectiles/Boss/AbyssMine.cs index 3177498128..521e63a5c5 100644 --- a/Projectiles/Boss/AbyssMine.cs +++ b/Projectiles/Boss/AbyssMine.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Boss projectile.ai[1] = 1f; Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 33); } - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 173, 0f, 0f); } @@ -48,9 +48,9 @@ namespace CalamityMod.Projectiles.Boss projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 30; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 1.2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -58,9 +58,9 @@ namespace CalamityMod.Projectiles.Boss } for (int num623 = 0; num623 < 60; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 1.7f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1.7f); Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 1f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } projectile.Damage(); diff --git a/Projectiles/Boss/AbyssMine2.cs b/Projectiles/Boss/AbyssMine2.cs index 564fa09ee2..8c521833f9 100644 --- a/Projectiles/Boss/AbyssMine2.cs +++ b/Projectiles/Boss/AbyssMine2.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Boss projectile.ai[1] = 1f; Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 33); } - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) { int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 127, 0f, 0f); Main.dust[dust].noGravity = true; @@ -49,10 +49,10 @@ namespace CalamityMod.Projectiles.Boss projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 30; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default(Color), 1.2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; Main.dust[num622].noGravity = true; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -60,10 +60,10 @@ namespace CalamityMod.Projectiles.Boss } for (int num623 = 0; num623 < 60; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default(Color), 1.7f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, 1.7f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default(Color), 1f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } projectile.Damage(); diff --git a/Projectiles/Boss/AstralFlame.cs b/Projectiles/Boss/AstralFlame.cs index e1bed52911..8347da1e52 100644 --- a/Projectiles/Boss/AstralFlame.cs +++ b/Projectiles/Boss/AstralFlame.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Boss projectile.ai[0] += 1f; if (projectile.ai[0] > 15f) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 0.8f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 0.8f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } @@ -111,14 +111,14 @@ namespace CalamityMod.Projectiles.Boss projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num193 = 0; num193 < 2; num193++) { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 50, default(Color), 1f); + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 50, default, 1f); } for (int num194 = 0; num194 < 20; num194++) { - int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 0, default(Color), 1.5f); + int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 0, default, 1.5f); Main.dust[num195].noGravity = true; Main.dust[num195].velocity *= 3f; - num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 50, default(Color), 1f); + num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 50, default, 1f); Main.dust[num195].velocity *= 2f; Main.dust[num195].noGravity = true; } diff --git a/Projectiles/Boss/BigFlare.cs b/Projectiles/Boss/BigFlare.cs index d90c37626e..40f8216fc0 100644 --- a/Projectiles/Boss/BigFlare.cs +++ b/Projectiles/Boss/BigFlare.cs @@ -63,9 +63,9 @@ namespace CalamityMod.Projectiles.Boss for (int num627 = 0; num627 < num626; num627++) { Vector2 vector45 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector45 = vector45.RotatedBy((double)(num627 - (num626 / 2 - 1)) * 3.1415926535897931 / (double)((float)num626), default(Vector2)) + projectile.Center; + vector45 = vector45.RotatedBy((double)(num627 - (num626 / 2 - 1)) * 3.1415926535897931 / (double)((float)num626), default) + projectile.Center; Vector2 value15 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); - int num628 = Dust.NewDust(vector45 + value15, 0, 0, 244, value15.X * 2f, value15.Y * 2f, 100, default(Color), 1.4f); + int num628 = Dust.NewDust(vector45 + value15, 0, 0, 244, value15.X * 2f, value15.Y * 2f, 100, default, 1.4f); Main.dust[num628].noGravity = true; Main.dust[num628].noLight = true; Main.dust[num628].velocity /= 4f; @@ -132,9 +132,9 @@ namespace CalamityMod.Projectiles.Boss for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 244, vector7.X * 2f, vector7.Y * 2f, 100, default(Color), 1.4f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 244, vector7.X * 2f, vector7.Y * 2f, 100, default, 1.4f); Main.dust[num228].noGravity = true; Main.dust[num228].noLight = true; Main.dust[num228].velocity = vector7; diff --git a/Projectiles/Boss/BigFlare2.cs b/Projectiles/Boss/BigFlare2.cs index 49599976c6..fb44f3d678 100644 --- a/Projectiles/Boss/BigFlare2.cs +++ b/Projectiles/Boss/BigFlare2.cs @@ -62,9 +62,9 @@ namespace CalamityMod.Projectiles.Boss for (int num627 = 0; num627 < num626; num627++) { Vector2 vector45 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector45 = vector45.RotatedBy((double)(num627 - (num626 / 2 - 1)) * 3.1415926535897931 / (double)((float)num626), default(Vector2)) + projectile.Center; + vector45 = vector45.RotatedBy((double)(num627 - (num626 / 2 - 1)) * 3.1415926535897931 / (double)((float)num626), default) + projectile.Center; Vector2 value15 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); - int num628 = Dust.NewDust(vector45 + value15, 0, 0, 244, value15.X * 2f, value15.Y * 2f, 100, default(Color), 1.4f); + int num628 = Dust.NewDust(vector45 + value15, 0, 0, 244, value15.X * 2f, value15.Y * 2f, 100, default, 1.4f); Main.dust[num628].noGravity = true; Main.dust[num628].noLight = true; Main.dust[num628].velocity /= 4f; @@ -130,9 +130,9 @@ namespace CalamityMod.Projectiles.Boss for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 244, vector7.X * 2f, vector7.Y * 2f, 100, default(Color), 1.4f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 244, vector7.X * 2f, vector7.Y * 2f, 100, default, 1.4f); Main.dust[num228].noGravity = true; Main.dust[num228].noLight = true; Main.dust[num228].velocity = vector7; diff --git a/Projectiles/Boss/BloodClot.cs b/Projectiles/Boss/BloodClot.cs index 4cc92eeb4e..7285d4b115 100644 --- a/Projectiles/Boss/BloodClot.cs +++ b/Projectiles/Boss/BloodClot.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Boss { for (int num468 = 0; num468 < 2; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default(Color), 1.25f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default, 1.25f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Boss/BloodGeyser.cs b/Projectiles/Boss/BloodGeyser.cs index f2d4dce9a4..0903145768 100644 --- a/Projectiles/Boss/BloodGeyser.cs +++ b/Projectiles/Boss/BloodGeyser.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Boss projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, 0f, 0f, 100, default(Color), 0.5f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, 0f, 0f, 100, default, 0.5f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Boss/BrimstoneBall.cs b/Projectiles/Boss/BrimstoneBall.cs index 343c5d3769..8ff03d8f14 100644 --- a/Projectiles/Boss/BrimstoneBall.cs +++ b/Projectiles/Boss/BrimstoneBall.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Boss Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.25f) / 255f, ((255 - projectile.alpha) * 0.05f) / 255f, ((255 - projectile.alpha) * 0.05f) / 255f); for (int num468 = 0; num468 < 5; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default(Color), 1f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default, 1f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Boss/BrimstoneBall2.cs b/Projectiles/Boss/BrimstoneBall2.cs index 98a98c0151..6572a04e92 100644 --- a/Projectiles/Boss/BrimstoneBall2.cs +++ b/Projectiles/Boss/BrimstoneBall2.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Boss Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.25f) / 255f, ((255 - projectile.alpha) * 0.05f) / 255f, ((255 - projectile.alpha) * 0.05f) / 255f); for (int num468 = 0; num468 < 5; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default(Color), 2f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default, 2f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Boss/BrimstoneFire.cs b/Projectiles/Boss/BrimstoneFire.cs index 5dcb290011..0b85c4dc89 100644 --- a/Projectiles/Boss/BrimstoneFire.cs +++ b/Projectiles/Boss/BrimstoneFire.cs @@ -46,12 +46,12 @@ namespace CalamityMod.Projectiles.Boss } projectile.ai[0] += 1f; int num297 = 235; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { for (int num298 = 0; num298 < 1; num298++) { - int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 100, default(Color), 1f); - if (Main.rand.Next(3) == 0) + int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 100, default, 1f); + if (Main.rand.NextBool(3)) { Main.dust[num299].noGravity = true; Main.dust[num299].scale *= 3f; diff --git a/Projectiles/Boss/BrimstoneHellfireball.cs b/Projectiles/Boss/BrimstoneHellfireball.cs index 6abdb068cc..fa227fcc5c 100644 --- a/Projectiles/Boss/BrimstoneHellfireball.cs +++ b/Projectiles/Boss/BrimstoneHellfireball.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Boss } for (int num457 = 0; num457 < 5; num457++) { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default(Color), 1.6f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default, 1.6f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; diff --git a/Projectiles/Boss/CosmicFlameBurst.cs b/Projectiles/Boss/CosmicFlameBurst.cs index 5061591d2c..29184fb810 100644 --- a/Projectiles/Boss/CosmicFlameBurst.cs +++ b/Projectiles/Boss/CosmicFlameBurst.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Boss { for (int num468 = 0; num468 < 5; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 2f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } @@ -52,9 +52,9 @@ namespace CalamityMod.Projectiles.Boss projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -62,10 +62,10 @@ namespace CalamityMod.Projectiles.Boss } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } projectile.Damage(); diff --git a/Projectiles/Boss/DeusMine.cs b/Projectiles/Boss/DeusMine.cs index ccfb3bc42c..aa50a4d994 100644 --- a/Projectiles/Boss/DeusMine.cs +++ b/Projectiles/Boss/DeusMine.cs @@ -83,9 +83,9 @@ namespace CalamityMod.Projectiles.Boss projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 30; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 1.2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -93,10 +93,10 @@ namespace CalamityMod.Projectiles.Boss } for (int num623 = 0; num623 < 60; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 1.7f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 1.7f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 1.5f; - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 1f); + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 1f); } projectile.Damage(); } diff --git a/Projectiles/Boss/DoGBeamPortal.cs b/Projectiles/Boss/DoGBeamPortal.cs index e1ebe2e231..0d2955fc0f 100644 --- a/Projectiles/Boss/DoGBeamPortal.cs +++ b/Projectiles/Boss/DoGBeamPortal.cs @@ -107,9 +107,9 @@ namespace CalamityMod.Projectiles.Boss Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 92); for (int num621 = 0; num621 < 30; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 1.2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -117,10 +117,10 @@ namespace CalamityMod.Projectiles.Boss } for (int num623 = 0; num623 < 60; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 1.7f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1.7f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 1f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Boss/DoGFire.cs b/Projectiles/Boss/DoGFire.cs index 658c53c65f..e3c042b9f9 100644 --- a/Projectiles/Boss/DoGFire.cs +++ b/Projectiles/Boss/DoGFire.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Boss Main.PlaySound(SoundID.Item20, projectile.position); } - int dust = Dust.NewDust(new Vector2(projectile.position.X + projectile.velocity.X, projectile.position.Y + projectile.velocity.Y), projectile.width, projectile.height, 173, projectile.velocity.X, projectile.velocity.Y, 100, default(Color), 3f); + int dust = Dust.NewDust(new Vector2(projectile.position.X + projectile.velocity.X, projectile.position.Y + projectile.velocity.Y), projectile.width, projectile.height, 173, projectile.velocity.X, projectile.velocity.Y, 100, default, 3f); Main.dust[dust].noGravity = true; projectile.rotation += 0.3f * (float)projectile.direction; @@ -77,11 +77,11 @@ namespace CalamityMod.Projectiles.Boss int num3; for (int num584 = 0; num584 < 20; num584 = num3 + 1) { - int num585 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, -projectile.velocity.X * 0.2f, -projectile.velocity.Y * 0.2f, 100, default(Color), 2.5f); + int num585 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, -projectile.velocity.X * 0.2f, -projectile.velocity.Y * 0.2f, 100, default, 2.5f); Main.dust[num585].noGravity = true; Dust dust = Main.dust[num585]; dust.velocity *= 2f; - num585 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, -projectile.velocity.X * 0.2f, -projectile.velocity.Y * 0.2f, 100, default(Color), 1.2f); + num585 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, -projectile.velocity.X * 0.2f, -projectile.velocity.Y * 0.2f, 100, default, 1.2f); dust = Main.dust[num585]; dust.velocity *= 2f; num3 = num584; diff --git a/Projectiles/Boss/EssenceDust.cs b/Projectiles/Boss/EssenceDust.cs index f851d74ec7..335c7f50f4 100644 --- a/Projectiles/Boss/EssenceDust.cs +++ b/Projectiles/Boss/EssenceDust.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Boss Lighting.AddLight(projectile.Center, 0.45f, 0f, 0.55f); for (int num468 = 0; num468 < 5; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 0.5f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 0.5f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } @@ -45,9 +45,9 @@ namespace CalamityMod.Projectiles.Boss projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 1f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -55,10 +55,10 @@ namespace CalamityMod.Projectiles.Boss } for (int num623 = 0; num623 < 15; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 2f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 1f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } projectile.Damage(); diff --git a/Projectiles/Boss/Flare.cs b/Projectiles/Boss/Flare.cs index 00fcc28766..0e8a6e409c 100644 --- a/Projectiles/Boss/Flare.cs +++ b/Projectiles/Boss/Flare.cs @@ -63,9 +63,9 @@ namespace CalamityMod.Projectiles.Boss for (int num627 = 0; num627 < num626; num627++) { Vector2 vector45 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector45 = vector45.RotatedBy((double)(num627 - (num626 / 2 - 1)) * 3.1415926535897931 / (double)((float)num626), default(Vector2)) + projectile.Center; + vector45 = vector45.RotatedBy((double)(num627 - (num626 / 2 - 1)) * 3.1415926535897931 / (double)((float)num626), default) + projectile.Center; Vector2 value15 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); - int num628 = Dust.NewDust(vector45 + value15, 0, 0, 244, value15.X * 2f, value15.Y * 2f, 100, default(Color), 1.4f); + int num628 = Dust.NewDust(vector45 + value15, 0, 0, 244, value15.X * 2f, value15.Y * 2f, 100, default, 1.4f); Main.dust[num628].noGravity = true; Main.dust[num628].noLight = true; Main.dust[num628].velocity /= 4f; @@ -132,9 +132,9 @@ namespace CalamityMod.Projectiles.Boss for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 244, vector7.X * 2f, vector7.Y * 2f, 100, default(Color), 1.4f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 244, vector7.X * 2f, vector7.Y * 2f, 100, default, 1.4f); Main.dust[num228].noGravity = true; Main.dust[num228].noLight = true; Main.dust[num228].velocity = vector7; diff --git a/Projectiles/Boss/FlareBomb.cs b/Projectiles/Boss/FlareBomb.cs index 55fced1af9..067a6f5156 100644 --- a/Projectiles/Boss/FlareBomb.cs +++ b/Projectiles/Boss/FlareBomb.cs @@ -114,9 +114,9 @@ namespace CalamityMod.Projectiles.Boss projectile.Damage(); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -124,10 +124,10 @@ namespace CalamityMod.Projectiles.Boss } for (int num623 = 0; num623 < 15; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } for (int num625 = 0; num625 < 3; num625++) @@ -141,25 +141,25 @@ namespace CalamityMod.Projectiles.Boss { scaleFactor10 = 1f; } - int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13AB6_cp_0 = Main.gore[num626]; expr_13AB6_cp_0.velocity.X = expr_13AB6_cp_0.velocity.X + 1f; Gore expr_13AD6_cp_0 = Main.gore[num626]; expr_13AD6_cp_0.velocity.Y = expr_13AD6_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13B79_cp_0 = Main.gore[num626]; expr_13B79_cp_0.velocity.X = expr_13B79_cp_0.velocity.X - 1f; Gore expr_13B99_cp_0 = Main.gore[num626]; expr_13B99_cp_0.velocity.Y = expr_13B99_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13C3C_cp_0 = Main.gore[num626]; expr_13C3C_cp_0.velocity.X = expr_13C3C_cp_0.velocity.X + 1f; Gore expr_13C5C_cp_0 = Main.gore[num626]; expr_13C5C_cp_0.velocity.Y = expr_13C5C_cp_0.velocity.Y - 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13CFF_cp_0 = Main.gore[num626]; expr_13CFF_cp_0.velocity.X = expr_13CFF_cp_0.velocity.X - 1f; diff --git a/Projectiles/Boss/FlareDust.cs b/Projectiles/Boss/FlareDust.cs index 9bb6c7457b..ee23c8bfa8 100644 --- a/Projectiles/Boss/FlareDust.cs +++ b/Projectiles/Boss/FlareDust.cs @@ -66,9 +66,9 @@ namespace CalamityMod.Projectiles.Boss projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 1f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -76,10 +76,10 @@ namespace CalamityMod.Projectiles.Boss } for (int num623 = 0; num623 < 5; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 1f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } for (int num625 = 0; num625 < 3; num625++) @@ -93,25 +93,25 @@ namespace CalamityMod.Projectiles.Boss { scaleFactor10 = 1f; } - int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13AB6_cp_0 = Main.gore[num626]; expr_13AB6_cp_0.velocity.X = expr_13AB6_cp_0.velocity.X + 1f; Gore expr_13AD6_cp_0 = Main.gore[num626]; expr_13AD6_cp_0.velocity.Y = expr_13AD6_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13B79_cp_0 = Main.gore[num626]; expr_13B79_cp_0.velocity.X = expr_13B79_cp_0.velocity.X - 1f; Gore expr_13B99_cp_0 = Main.gore[num626]; expr_13B99_cp_0.velocity.Y = expr_13B99_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13C3C_cp_0 = Main.gore[num626]; expr_13C3C_cp_0.velocity.X = expr_13C3C_cp_0.velocity.X + 1f; Gore expr_13C5C_cp_0 = Main.gore[num626]; expr_13C5C_cp_0.velocity.Y = expr_13C5C_cp_0.velocity.Y - 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13CFF_cp_0 = Main.gore[num626]; expr_13CFF_cp_0.velocity.X = expr_13CFF_cp_0.velocity.X - 1f; diff --git a/Projectiles/Boss/FlareDust2.cs b/Projectiles/Boss/FlareDust2.cs index bfd05eb575..bedc5d15af 100644 --- a/Projectiles/Boss/FlareDust2.cs +++ b/Projectiles/Boss/FlareDust2.cs @@ -81,9 +81,9 @@ namespace CalamityMod.Projectiles.Boss projectile.Damage(); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 1f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -91,10 +91,10 @@ namespace CalamityMod.Projectiles.Boss } for (int num623 = 0; num623 < 5; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 1f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } for (int num625 = 0; num625 < 3; num625++) @@ -108,25 +108,25 @@ namespace CalamityMod.Projectiles.Boss { scaleFactor10 = 1f; } - int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13AB6_cp_0 = Main.gore[num626]; expr_13AB6_cp_0.velocity.X = expr_13AB6_cp_0.velocity.X + 1f; Gore expr_13AD6_cp_0 = Main.gore[num626]; expr_13AD6_cp_0.velocity.Y = expr_13AD6_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13B79_cp_0 = Main.gore[num626]; expr_13B79_cp_0.velocity.X = expr_13B79_cp_0.velocity.X - 1f; Gore expr_13B99_cp_0 = Main.gore[num626]; expr_13B99_cp_0.velocity.Y = expr_13B99_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13C3C_cp_0 = Main.gore[num626]; expr_13C3C_cp_0.velocity.X = expr_13C3C_cp_0.velocity.X + 1f; Gore expr_13C5C_cp_0 = Main.gore[num626]; expr_13C5C_cp_0.velocity.Y = expr_13C5C_cp_0.velocity.Y - 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13CFF_cp_0 = Main.gore[num626]; expr_13CFF_cp_0.velocity.X = expr_13CFF_cp_0.velocity.X - 1f; diff --git a/Projectiles/Boss/FlareExplosionHuge.cs b/Projectiles/Boss/FlareExplosionHuge.cs index 3158438c8b..8395cb1802 100644 --- a/Projectiles/Boss/FlareExplosionHuge.cs +++ b/Projectiles/Boss/FlareExplosionHuge.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Boss Lighting.AddLight(projectile.Center, 3f, 3f, 0f); for (int num468 = 0; num468 < 3; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 0.35f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 0.35f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Boss/FrostMist.cs b/Projectiles/Boss/FrostMist.cs index 3f7a6196b3..e1ef077b64 100644 --- a/Projectiles/Boss/FrostMist.cs +++ b/Projectiles/Boss/FrostMist.cs @@ -57,9 +57,9 @@ namespace CalamityMod.Projectiles.Boss { for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 187, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 187, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -75,9 +75,9 @@ namespace CalamityMod.Projectiles.Boss for (int l = 0; l < 12; l++) { Vector2 vector3 = Vector2.UnitX * (float)(-(float)projectile.width) / 2f; - vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default(Vector2)) * new Vector2(8f, 16f); - vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default(Vector2)); - int num9 = Dust.NewDust(projectile.Center, 0, 0, 187, 0f, 0f, 160, default(Color), 1f); + vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default) * new Vector2(8f, 16f); + vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default); + int num9 = Dust.NewDust(projectile.Center, 0, 0, 187, 0f, 0f, 160, default, 1f); Main.dust[num9].scale = 1.1f; Main.dust[num9].noGravity = true; Main.dust[num9].position = projectile.Center + vector3; diff --git a/Projectiles/Boss/GreatSandBlast.cs b/Projectiles/Boss/GreatSandBlast.cs index 8296cf65de..7e62dd1250 100644 --- a/Projectiles/Boss/GreatSandBlast.cs +++ b/Projectiles/Boss/GreatSandBlast.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Boss { projectile.alpha = 0; } - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 85, 0f, 0f, 100, default(Color), 1f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 85, 0f, 0f, 100, default, 1f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } @@ -68,9 +68,9 @@ namespace CalamityMod.Projectiles.Boss for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 85, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default(Color), 1.2f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 85, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default, 1.2f); Main.dust[num228].noGravity = true; Main.dust[num228].noLight = true; Main.dust[num228].velocity = vector7; diff --git a/Projectiles/Boss/HealOrbProv.cs b/Projectiles/Boss/HealOrbProv.cs index aeca6af3ff..5d45bfe403 100644 --- a/Projectiles/Boss/HealOrbProv.cs +++ b/Projectiles/Boss/HealOrbProv.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Boss { float num498 = projectile.velocity.X * 0.2f * (float)num497; float num499 = -(projectile.velocity.Y * 0.2f) * (float)num497; - int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default(Color), 1f); + int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, 1f); Main.dust[num500].noGravity = true; Main.dust[num500].velocity *= 0f; Dust expr_154F9_cp_0 = Main.dust[num500]; diff --git a/Projectiles/Boss/HellfireExplosion.cs b/Projectiles/Boss/HellfireExplosion.cs index 5eda4fab68..9df011cc99 100644 --- a/Projectiles/Boss/HellfireExplosion.cs +++ b/Projectiles/Boss/HellfireExplosion.cs @@ -86,7 +86,7 @@ namespace CalamityMod.Projectiles.Boss num466 = num465 / num466; num463 *= num466; num464 *= num466; - int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default(Color), 1.5f); + int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default, 1.5f); Main.dust[num467].noGravity = true; Main.dust[num467].position.X = projectile.Center.X; Main.dust[num467].position.Y = projectile.Center.Y; diff --git a/Projectiles/Boss/HiveBombGoliath.cs b/Projectiles/Boss/HiveBombGoliath.cs index 03761760ee..8f94dfaf9f 100644 --- a/Projectiles/Boss/HiveBombGoliath.cs +++ b/Projectiles/Boss/HiveBombGoliath.cs @@ -53,26 +53,26 @@ namespace CalamityMod.Projectiles.Boss num247 = projectile.velocity.X * 0.5f; num248 = projectile.velocity.Y * 0.5f; } - int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 6, 0f, 0f, 100, default(Color), 0.5f); + int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 6, 0f, 0f, 100, default, 0.5f); Main.dust[num249].scale *= 2f + (float)Main.rand.Next(10) * 0.1f; Main.dust[num249].velocity *= 0.2f; Main.dust[num249].noGravity = true; - num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 31, 0f, 0f, 100, default(Color), 0.25f); + num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 31, 0f, 0f, 100, default, 0.25f); Main.dust[num249].fadeIn = 1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num249].velocity *= 0.05f; } - else if (Main.rand.Next(4) == 0) + else if (Main.rand.NextBool(4)) { - int num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 0.5f); + int num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 0.5f); Main.dust[num252].scale = 0.1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].fadeIn = 1.5f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].noGravity = true; - Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2)).RotatedBy((double)projectile.rotation, default(Vector2)) * 1.1f; + Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2)).RotatedBy((double)projectile.rotation, default) * 1.1f; Main.rand.Next(2); - num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 1f); + num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 1f); Main.dust[num252].scale = 1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].noGravity = true; - Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2 - 6)).RotatedBy((double)projectile.rotation, default(Vector2)) * 1.1f; + Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2 - 6)).RotatedBy((double)projectile.rotation, default) * 1.1f; } projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; } @@ -103,9 +103,9 @@ namespace CalamityMod.Projectiles.Boss projectile.Damage(); for (int num621 = 0; num621 < 8; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -113,10 +113,10 @@ namespace CalamityMod.Projectiles.Boss } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } for (int num625 = 0; num625 < 3; num625++) @@ -130,25 +130,25 @@ namespace CalamityMod.Projectiles.Boss { scaleFactor10 = 1f; } - int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13AB6_cp_0 = Main.gore[num626]; expr_13AB6_cp_0.velocity.X = expr_13AB6_cp_0.velocity.X + 1f; Gore expr_13AD6_cp_0 = Main.gore[num626]; expr_13AD6_cp_0.velocity.Y = expr_13AD6_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13B79_cp_0 = Main.gore[num626]; expr_13B79_cp_0.velocity.X = expr_13B79_cp_0.velocity.X - 1f; Gore expr_13B99_cp_0 = Main.gore[num626]; expr_13B99_cp_0.velocity.Y = expr_13B99_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13C3C_cp_0 = Main.gore[num626]; expr_13C3C_cp_0.velocity.X = expr_13C3C_cp_0.velocity.X + 1f; Gore expr_13C5C_cp_0 = Main.gore[num626]; expr_13C5C_cp_0.velocity.Y = expr_13C5C_cp_0.velocity.Y - 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13CFF_cp_0 = Main.gore[num626]; expr_13CFF_cp_0.velocity.X = expr_13CFF_cp_0.velocity.X - 1f; diff --git a/Projectiles/Boss/HolyBlast.cs b/Projectiles/Boss/HolyBlast.cs index 90331a2f75..e63ea4683c 100644 --- a/Projectiles/Boss/HolyBlast.cs +++ b/Projectiles/Boss/HolyBlast.cs @@ -44,9 +44,9 @@ namespace CalamityMod.Projectiles.Boss { for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -103,14 +103,14 @@ namespace CalamityMod.Projectiles.Boss Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); for (int num193 = 0; num193 < 6; num193++) { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 50, default(Color), 1.5f); + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 50, default, 1.5f); } for (int num194 = 0; num194 < 60; num194++) { - int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 0, default(Color), 2.5f); + int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 0, default, 2.5f); Main.dust[num195].noGravity = true; Main.dust[num195].velocity *= 3f; - num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 50, default(Color), 1.5f); + num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 50, default, 1.5f); Main.dust[num195].velocity *= 2f; Main.dust[num195].noGravity = true; } diff --git a/Projectiles/Boss/HolyBomb.cs b/Projectiles/Boss/HolyBomb.cs index a0f21cf615..73136352ec 100644 --- a/Projectiles/Boss/HolyBomb.cs +++ b/Projectiles/Boss/HolyBomb.cs @@ -100,14 +100,14 @@ namespace CalamityMod.Projectiles.Boss projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num193 = 0; num193 < 3; num193++) { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 50, default(Color), 1.5f); + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 50, default, 1.5f); } for (int num194 = 0; num194 < 30; num194++) { - int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 0, default(Color), 2.5f); + int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 0, default, 2.5f); Main.dust[num195].noGravity = true; Main.dust[num195].velocity *= 3f; - num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 50, default(Color), 1.5f); + num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 50, default, 1.5f); Main.dust[num195].velocity *= 2f; Main.dust[num195].noGravity = true; } diff --git a/Projectiles/Boss/HolyBurnOrb.cs b/Projectiles/Boss/HolyBurnOrb.cs index e974de0fdf..22044ba7f1 100644 --- a/Projectiles/Boss/HolyBurnOrb.cs +++ b/Projectiles/Boss/HolyBurnOrb.cs @@ -85,9 +85,9 @@ namespace CalamityMod.Projectiles.Boss projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -95,10 +95,10 @@ namespace CalamityMod.Projectiles.Boss } for (int num623 = 0; num623 < 15; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 247, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 247, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Boss/HolyFire.cs b/Projectiles/Boss/HolyFire.cs index ab9030f1bb..d75afaeb60 100644 --- a/Projectiles/Boss/HolyFire.cs +++ b/Projectiles/Boss/HolyFire.cs @@ -92,8 +92,8 @@ namespace CalamityMod.Projectiles.Boss projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); - if (Main.rand.Next(2) == 0) + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -101,9 +101,9 @@ namespace CalamityMod.Projectiles.Boss } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); } } diff --git a/Projectiles/Boss/HolyFire2.cs b/Projectiles/Boss/HolyFire2.cs index a594506e3e..4af7e9c933 100644 --- a/Projectiles/Boss/HolyFire2.cs +++ b/Projectiles/Boss/HolyFire2.cs @@ -81,8 +81,8 @@ namespace CalamityMod.Projectiles.Boss projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); - if (Main.rand.Next(2) == 0) + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -90,9 +90,9 @@ namespace CalamityMod.Projectiles.Boss } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); } } diff --git a/Projectiles/Boss/HolyFlare.cs b/Projectiles/Boss/HolyFlare.cs index 3958179491..fdd055b002 100644 --- a/Projectiles/Boss/HolyFlare.cs +++ b/Projectiles/Boss/HolyFlare.cs @@ -92,8 +92,8 @@ namespace CalamityMod.Projectiles.Boss projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); - if (Main.rand.Next(2) == 0) + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -101,9 +101,9 @@ namespace CalamityMod.Projectiles.Boss } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); } } diff --git a/Projectiles/Boss/HolyLight.cs b/Projectiles/Boss/HolyLight.cs index 3f1e612eba..4f5b2fb334 100644 --- a/Projectiles/Boss/HolyLight.cs +++ b/Projectiles/Boss/HolyLight.cs @@ -74,9 +74,9 @@ namespace CalamityMod.Projectiles.Boss projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -84,10 +84,10 @@ namespace CalamityMod.Projectiles.Boss } for (int num623 = 0; num623 < 15; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 247, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 247, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Boss/IceBlast.cs b/Projectiles/Boss/IceBlast.cs index d70f09fc2e..541945992d 100644 --- a/Projectiles/Boss/IceBlast.cs +++ b/Projectiles/Boss/IceBlast.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Boss int num3; for (int num322 = 0; num322 < 2; num322 = num3 + 1) { - int num323 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 92, projectile.velocity.X, projectile.velocity.Y, 50, default(Color), 0.6f); + int num323 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 92, projectile.velocity.X, projectile.velocity.Y, 50, default, 0.6f); Main.dust[num323].noGravity = true; Dust dust = Main.dust[num323]; dust.velocity *= 0.3f; @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Boss int num3; for (int num498 = 0; num498 < num497; num498 = num3 + 1) { - int num499 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 92, 0f, 0f, 0, default(Color), 1f); + int num499 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 92, 0f, 0f, 0, default, 1f); if (Main.rand.Next(3) != 0) { Dust dust = Main.dust[num499]; diff --git a/Projectiles/Boss/IceRain.cs b/Projectiles/Boss/IceRain.cs index d32f511a2f..a1e679d213 100644 --- a/Projectiles/Boss/IceRain.cs +++ b/Projectiles/Boss/IceRain.cs @@ -68,7 +68,7 @@ namespace CalamityMod.Projectiles.Boss int num3; for (int num373 = 0; num373 < 3; num373 = num3 + 1) { - int num374 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 76, 0f, 0f, 0, default(Color), 1f); + int num374 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 76, 0f, 0f, 0, default, 1f); Main.dust[num374].noGravity = true; Main.dust[num374].noLight = true; Main.dust[num374].scale = 0.7f; diff --git a/Projectiles/Boss/IchorShot.cs b/Projectiles/Boss/IchorShot.cs index dcf761be79..c398e43236 100644 --- a/Projectiles/Boss/IchorShot.cs +++ b/Projectiles/Boss/IchorShot.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Boss projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 170, 0f, 0f, 100, default(Color), 0.5f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 170, 0f, 0f, 100, default, 0.5f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; diff --git a/Projectiles/Boss/LeviathanBomb.cs b/Projectiles/Boss/LeviathanBomb.cs index cde9e86380..ecadbf449f 100644 --- a/Projectiles/Boss/LeviathanBomb.cs +++ b/Projectiles/Boss/LeviathanBomb.cs @@ -71,9 +71,9 @@ namespace CalamityMod.Projectiles.Boss projectile.Damage(); for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -81,10 +81,10 @@ namespace CalamityMod.Projectiles.Boss } for (int num623 = 0; num623 < 30; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Boss/MoltenBlast.cs b/Projectiles/Boss/MoltenBlast.cs index 1c257c8eda..e625f9b67a 100644 --- a/Projectiles/Boss/MoltenBlast.cs +++ b/Projectiles/Boss/MoltenBlast.cs @@ -55,9 +55,9 @@ namespace CalamityMod.Projectiles.Boss { for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -73,9 +73,9 @@ namespace CalamityMod.Projectiles.Boss for (int l = 0; l < 12; l++) { Vector2 vector3 = Vector2.UnitX * (float)(-(float)projectile.width) / 2f; - vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default(Vector2)) * new Vector2(8f, 16f); - vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default(Vector2)); - int num9 = Dust.NewDust(projectile.Center, 0, 0, 244, 0f, 0f, 160, default(Color), 1f); + vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default) * new Vector2(8f, 16f); + vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default); + int num9 = Dust.NewDust(projectile.Center, 0, 0, 244, 0f, 0f, 160, default, 1f); Main.dust[num9].scale = 1.1f; Main.dust[num9].noGravity = true; Main.dust[num9].position = projectile.Center + vector3; @@ -120,14 +120,14 @@ namespace CalamityMod.Projectiles.Boss Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); for (int num193 = 0; num193 < 3; num193++) { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 50, default(Color), 1.5f); + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 50, default, 1.5f); } for (int num194 = 0; num194 < 30; num194++) { - int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 0, default(Color), 2.5f); + int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 0, default, 2.5f); Main.dust[num195].noGravity = true; Main.dust[num195].velocity *= 3f; - num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 50, default(Color), 1.5f); + num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 50, default, 1.5f); Main.dust[num195].velocity *= 2f; Main.dust[num195].noGravity = true; } diff --git a/Projectiles/Boss/MoltenBlob.cs b/Projectiles/Boss/MoltenBlob.cs index 5a58516bbe..4ae051dfe3 100644 --- a/Projectiles/Boss/MoltenBlob.cs +++ b/Projectiles/Boss/MoltenBlob.cs @@ -81,8 +81,8 @@ namespace CalamityMod.Projectiles.Boss projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 3; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); - if (Main.rand.Next(2) == 0) + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -90,9 +90,9 @@ namespace CalamityMod.Projectiles.Boss } for (int num623 = 0; num623 < 5; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); } } diff --git a/Projectiles/Boss/MushBomb.cs b/Projectiles/Boss/MushBomb.cs index 7bd88347ef..91ecbd46b8 100644 --- a/Projectiles/Boss/MushBomb.cs +++ b/Projectiles/Boss/MushBomb.cs @@ -55,9 +55,9 @@ namespace CalamityMod.Projectiles.Boss projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 7; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -65,10 +65,10 @@ namespace CalamityMod.Projectiles.Boss } for (int num623 = 0; num623 < 20; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Boss/MushBombFall.cs b/Projectiles/Boss/MushBombFall.cs index 5a410c3aa0..601d43d573 100644 --- a/Projectiles/Boss/MushBombFall.cs +++ b/Projectiles/Boss/MushBombFall.cs @@ -56,9 +56,9 @@ namespace CalamityMod.Projectiles.Boss projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 7; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -66,10 +66,10 @@ namespace CalamityMod.Projectiles.Boss } for (int num623 = 0; num623 < 20; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Boss/PhantomBlast.cs b/Projectiles/Boss/PhantomBlast.cs index 09099deb45..551dcf7d41 100644 --- a/Projectiles/Boss/PhantomBlast.cs +++ b/Projectiles/Boss/PhantomBlast.cs @@ -82,9 +82,9 @@ namespace CalamityMod.Projectiles.Boss for (int l = 0; l < 12; l++) { Vector2 vector3 = Vector2.UnitX * (float)(-(float)projectile.width) / 2f; - vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default(Vector2)) * new Vector2(8f, 16f); - vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default(Vector2)); - int num9 = Dust.NewDust(projectile.Center, 0, 0, 180, 0f, 0f, 160, default(Color), 1f); + vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default) * new Vector2(8f, 16f); + vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default); + int num9 = Dust.NewDust(projectile.Center, 0, 0, 180, 0f, 0f, 160, default, 1f); Main.dust[num9].scale = 1.1f; Main.dust[num9].noGravity = true; Main.dust[num9].position = projectile.Center + vector3; @@ -110,10 +110,10 @@ namespace CalamityMod.Projectiles.Boss projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 3; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 180, 0f, 0f, 100, default(Color), 1.2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 180, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; Main.dust[num622].noGravity = true; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -121,10 +121,10 @@ namespace CalamityMod.Projectiles.Boss } for (int num623 = 0; num623 < 5; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 180, 0f, 0f, 100, default(Color), 1.7f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 180, 0f, 0f, 100, default, 1.7f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 180, 0f, 0f, 100, default(Color), 1f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 180, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Boss/PhantomBlast2.cs b/Projectiles/Boss/PhantomBlast2.cs index 87c74cef9b..bbc8d8adbd 100644 --- a/Projectiles/Boss/PhantomBlast2.cs +++ b/Projectiles/Boss/PhantomBlast2.cs @@ -82,9 +82,9 @@ namespace CalamityMod.Projectiles.Boss for (int l = 0; l < 12; l++) { Vector2 vector3 = Vector2.UnitX * (float)(-(float)projectile.width) / 2f; - vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default(Vector2)) * new Vector2(8f, 16f); - vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default(Vector2)); - int num9 = Dust.NewDust(projectile.Center, 0, 0, 60, 0f, 0f, 160, default(Color), 1f); + vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default) * new Vector2(8f, 16f); + vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default); + int num9 = Dust.NewDust(projectile.Center, 0, 0, 60, 0f, 0f, 160, default, 1f); Main.dust[num9].scale = 1.1f; Main.dust[num9].noGravity = true; Main.dust[num9].position = projectile.Center + vector3; @@ -110,10 +110,10 @@ namespace CalamityMod.Projectiles.Boss projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 3; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default(Color), 1.2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; Main.dust[num622].noGravity = true; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -121,10 +121,10 @@ namespace CalamityMod.Projectiles.Boss } for (int num623 = 0; num623 < 5; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default(Color), 1.7f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default, 1.7f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default(Color), 1f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Boss/PhantomGhostShot.cs b/Projectiles/Boss/PhantomGhostShot.cs index 3c6c621d91..80b6d55023 100644 --- a/Projectiles/Boss/PhantomGhostShot.cs +++ b/Projectiles/Boss/PhantomGhostShot.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Boss { for (int num151 = 0; num151 < 40; num151++) { - int num152 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default(Color), 1f); + int num152 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default, 1f); Main.dust[num152].velocity *= 3f; Main.dust[num152].velocity += projectile.velocity * 0.75f; Main.dust[num152].scale *= 1.2f; diff --git a/Projectiles/Boss/PhantomHookShot.cs b/Projectiles/Boss/PhantomHookShot.cs index 0f9d51b78f..ea6b325eaf 100644 --- a/Projectiles/Boss/PhantomHookShot.cs +++ b/Projectiles/Boss/PhantomHookShot.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Boss { for (int num151 = 0; num151 < 40; num151++) { - int num152 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 180, 0f, 0f, 100, default(Color), 1f); + int num152 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 180, 0f, 0f, 100, default, 1f); Main.dust[num152].velocity *= 3f; Main.dust[num152].velocity += projectile.velocity * 0.75f; Main.dust[num152].scale *= 1.2f; diff --git a/Projectiles/Boss/PhantomMine.cs b/Projectiles/Boss/PhantomMine.cs index 4ca5a4b5bd..c3f48337d9 100644 --- a/Projectiles/Boss/PhantomMine.cs +++ b/Projectiles/Boss/PhantomMine.cs @@ -48,9 +48,9 @@ namespace CalamityMod.Projectiles.Boss projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 15; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 180, 0f, 0f, 100, default(Color), 1.2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 180, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -58,10 +58,10 @@ namespace CalamityMod.Projectiles.Boss } for (int num623 = 0; num623 < 30; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 180, 0f, 0f, 100, default(Color), 1.7f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 180, 0f, 0f, 100, default, 1.7f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default(Color), 1f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Boss/PhoenixFire.cs b/Projectiles/Boss/PhoenixFire.cs index b3b765a7e8..b7c44ecb9d 100644 --- a/Projectiles/Boss/PhoenixFire.cs +++ b/Projectiles/Boss/PhoenixFire.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Boss Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.45f) / 255f, ((255 - projectile.alpha) * 0.35f) / 255f, ((255 - projectile.alpha) * 0f) / 255f); for (int num457 = 0; num457 < 2; num457++) { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 0.7f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 0.7f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; diff --git a/Projectiles/Boss/PlagueExplosion.cs b/Projectiles/Boss/PlagueExplosion.cs index 677192847c..5b63a13f96 100644 --- a/Projectiles/Boss/PlagueExplosion.cs +++ b/Projectiles/Boss/PlagueExplosion.cs @@ -70,7 +70,7 @@ namespace CalamityMod.Projectiles.Boss num466 = num465 / num466; num463 *= num466; num464 *= num466; - int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default(Color), 0.5f); + int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default, 0.5f); Main.dust[num467].noGravity = true; Main.dust[num467].position.X = projectile.Center.X; Main.dust[num467].position.Y = projectile.Center.Y; diff --git a/Projectiles/Boss/ProfanedSpear.cs b/Projectiles/Boss/ProfanedSpear.cs index 71def3dac3..cbf19fabf2 100644 --- a/Projectiles/Boss/ProfanedSpear.cs +++ b/Projectiles/Boss/ProfanedSpear.cs @@ -68,9 +68,9 @@ namespace CalamityMod.Projectiles.Boss for (int l = 0; l < 12; l++) { Vector2 vector3 = Vector2.UnitX * (float)(-(float)projectile.width) / 2f; - vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default(Vector2)) * new Vector2(8f, 16f); - vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default(Vector2)); - int num9 = Dust.NewDust(projectile.Center, 0, 0, 244, 0f, 0f, 160, default(Color), 1f); + vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default) * new Vector2(8f, 16f); + vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default); + int num9 = Dust.NewDust(projectile.Center, 0, 0, 244, 0f, 0f, 160, default, 1f); Main.dust[num9].scale = 1.1f; Main.dust[num9].noGravity = true; Main.dust[num9].position = projectile.Center + vector3; diff --git a/Projectiles/Boss/ProvidenceCrystal.cs b/Projectiles/Boss/ProvidenceCrystal.cs index fca5d2bce6..1ef4e01e73 100644 --- a/Projectiles/Boss/ProvidenceCrystal.cs +++ b/Projectiles/Boss/ProvidenceCrystal.cs @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Boss { projectile.direction = Main.player[projectile.owner].direction; } - if (projectile.alpha == 0 && Main.rand.Next(15) == 0) + if (projectile.alpha == 0 && Main.rand.NextBool(15)) { Dust dust34 = Main.dust[Dust.NewDust(projectile.Top, 0, 0, 267, 0f, 0f, 100, new Color(255, 200, Main.DiscoB), 1f)]; dust34.velocity.X = 0f; @@ -125,7 +125,7 @@ namespace CalamityMod.Projectiles.Boss Vector2 arg_F8CE_0 = vector59; Vector2 arg_F8BE_0 = Vector2.UnitY; double arg_F8BE_1 = (double)(num286 * 1.57079637f); - Vector2 center = default(Vector2); + Vector2 center = default; arg_F907_0.Draw(arg_F907_1, arg_F8CE_0 + arg_F8BE_0.RotatedBy(arg_F8BE_1, center) * scaleFactor5, new Microsoft.Xna.Framework.Rectangle?(rectangle17), alpha5 * 0.2f, projectile.rotation, origin11, projectile.scale, SpriteEffects.None, 0f); } return false; diff --git a/Projectiles/Boss/ProvidenceCrystalShard.cs b/Projectiles/Boss/ProvidenceCrystalShard.cs index ecc138575b..5b27723980 100644 --- a/Projectiles/Boss/ProvidenceCrystalShard.cs +++ b/Projectiles/Boss/ProvidenceCrystalShard.cs @@ -80,9 +80,9 @@ namespace CalamityMod.Projectiles.Boss int num3; for (int num979 = 0; num979 < 2; num979 = num3 + 1) { - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { - Vector2 value55 = Vector2.UnitY.RotatedBy((double)((float)num979 * 3.14159274f), default(Vector2)).RotatedBy((double)projectile.rotation, default(Vector2)); + Vector2 value55 = Vector2.UnitY.RotatedBy((double)((float)num979 * 3.14159274f), default).RotatedBy((double)projectile.rotation, default); Dust dust24 = Main.dust[Dust.NewDust(projectile.Center, 0, 0, 267, 0f, 0f, 225, newColor2, 1.5f)]; dust24.noGravity = true; dust24.noLight = true; @@ -94,9 +94,9 @@ namespace CalamityMod.Projectiles.Boss } for (int num980 = 0; num980 < 2; num980 = num3 + 1) { - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { - Vector2 value56 = Vector2.UnitY.RotatedBy((double)((float)num980 * 3.14159274f), default(Vector2)); + Vector2 value56 = Vector2.UnitY.RotatedBy((double)((float)num980 * 3.14159274f), default); Dust dust25 = Main.dust[Dust.NewDust(projectile.Center, 0, 0, 267, 0f, 0f, 225, newColor2, 1.5f)]; dust25.noGravity = true; dust25.noLight = true; @@ -106,7 +106,7 @@ namespace CalamityMod.Projectiles.Boss } num3 = num980; } - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { float scaleFactor13 = 1f + Main.rand.NextFloat() * 2f; float fadeIn = 1f + Main.rand.NextFloat(); @@ -160,7 +160,7 @@ namespace CalamityMod.Projectiles.Boss { int num71 = Dust.NewDust(projectile.Center, 0, 0, 267, 0f, 0f, 0, newColor, 1f); Main.dust[num71].position = projectile.Center; - Main.dust[num71].velocity = spinningpoint.RotatedBy((double)(6.28318548f * num70 / num69), default(Vector2)) * value5 * (0.8f + Main.rand.NextFloat() * 0.4f); + Main.dust[num71].velocity = spinningpoint.RotatedBy((double)(6.28318548f * num70 / num69), default) * value5 * (0.8f + Main.rand.NextFloat() * 0.4f); Main.dust[num71].noGravity = true; Main.dust[num71].scale = 2f; Main.dust[num71].fadeIn = Main.rand.NextFloat() * 2f; @@ -176,7 +176,7 @@ namespace CalamityMod.Projectiles.Boss { int num74 = Dust.NewDust(projectile.Center, 0, 0, 267, 0f, 0f, 0, newColor, 1f); Main.dust[num74].position = projectile.Center; - Main.dust[num74].velocity = spinningpoint.RotatedBy((double)(6.28318548f * num73 / num69), default(Vector2)) * value5 * (0.8f + Main.rand.NextFloat() * 0.4f); + Main.dust[num74].velocity = spinningpoint.RotatedBy((double)(6.28318548f * num73 / num69), default) * value5 * (0.8f + Main.rand.NextFloat() * 0.4f); Dust dust = Main.dust[num74]; dust.velocity *= Main.rand.NextFloat() * 0.8f; Main.dust[num74].noGravity = true; diff --git a/Projectiles/Boss/ProvidenceHolyRay.cs b/Projectiles/Boss/ProvidenceHolyRay.cs index e46aa75917..46c8f69897 100644 --- a/Projectiles/Boss/ProvidenceHolyRay.cs +++ b/Projectiles/Boss/ProvidenceHolyRay.cs @@ -115,16 +115,16 @@ namespace CalamityMod.Projectiles.Boss float num810 = projectile.velocity.ToRotation() + ((Main.rand.Next(2) == 1) ? -1f : 1f) * 1.57079637f; float num811 = (float)Main.rand.NextDouble() * 2f + 2f; Vector2 vector80 = new Vector2((float)Math.Cos((double)num810) * num811, (float)Math.Sin((double)num810) * num811); - int num812 = Dust.NewDust(vector79, 0, 0, 244, vector80.X, vector80.Y, 0, default(Color), 1f); + int num812 = Dust.NewDust(vector79, 0, 0, 244, vector80.X, vector80.Y, 0, default, 1f); Main.dust[num812].noGravity = true; Main.dust[num812].scale = 1.7f; num3 = num809; } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { - Vector2 value29 = projectile.velocity.RotatedBy(1.5707963705062866, default(Vector2)) * ((float)Main.rand.NextDouble() - 0.5f) * (float)projectile.width; - int num813 = Dust.NewDust(vector79 + value29 - Vector2.One * 4f, 8, 8, 244, 0f, 0f, 100, default(Color), 1.5f); + Vector2 value29 = projectile.velocity.RotatedBy(1.5707963705062866, default) * ((float)Main.rand.NextDouble() - 0.5f) * (float)projectile.width; + int num813 = Dust.NewDust(vector79 + value29 - Vector2.One * 4f, 8, 8, 244, 0f, 0f, 100, default, 1.5f); Dust dust = Main.dust[num813]; dust.velocity *= 0.5f; Main.dust[num813].velocity.Y = -Math.Abs(Main.dust[num813].velocity.Y); diff --git a/Projectiles/Boss/RavagerFlame.cs b/Projectiles/Boss/RavagerFlame.cs index ba5b8be8a3..71e390f152 100644 --- a/Projectiles/Boss/RavagerFlame.cs +++ b/Projectiles/Boss/RavagerFlame.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Boss { for (int num468 = 0; num468 < 2; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 135, 0f, 0f, 100, default(Color), 3f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 135, 0f, 0f, 100, default, 3f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Boss/RedLightningFeather.cs b/Projectiles/Boss/RedLightningFeather.cs index 89ca444082..ac0b651c60 100644 --- a/Projectiles/Boss/RedLightningFeather.cs +++ b/Projectiles/Boss/RedLightningFeather.cs @@ -97,14 +97,14 @@ namespace CalamityMod.Projectiles.Boss projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num193 = 0; num193 < 6; num193++) { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default(Color), 1.5f); + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default, 1.5f); } for (int num194 = 0; num194 < 10; num194++) { - int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 0, default(Color), 2.5f); + int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 0, default, 2.5f); Main.dust[num195].noGravity = true; Main.dust[num195].velocity *= 3f; - num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default(Color), 1.5f); + num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default, 1.5f); Main.dust[num195].velocity *= 2f; Main.dust[num195].noGravity = true; } diff --git a/Projectiles/Boss/SandBlast.cs b/Projectiles/Boss/SandBlast.cs index e205eee544..d78605f7d8 100644 --- a/Projectiles/Boss/SandBlast.cs +++ b/Projectiles/Boss/SandBlast.cs @@ -33,9 +33,9 @@ namespace CalamityMod.Projectiles.Boss { for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 85, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 85, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Boss { projectile.alpha = 0; } - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 85, 0f, 0f, 100, default(Color), 1f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 85, 0f, 0f, 100, default, 1f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Boss num466 = num465 / num466; num463 *= num466; num464 *= num466; - int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 85, 0f, 0f, 100, default(Color), 1.2f); + int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 85, 0f, 0f, 100, default, 1.2f); Main.dust[num467].noGravity = true; Main.dust[num467].position.X = projectile.Center.X; Main.dust[num467].position.Y = projectile.Center.Y; diff --git a/Projectiles/Boss/ScavengerLaser.cs b/Projectiles/Boss/ScavengerLaser.cs index 25a9a6bdec..0ef0807407 100644 --- a/Projectiles/Boss/ScavengerLaser.cs +++ b/Projectiles/Boss/ScavengerLaser.cs @@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Boss projectile.ai[1] = (float)Player.FindClosest(projectile.position, projectile.width, projectile.height); projectile.netUpdate = true; } - projectile.velocity.X = projectile.velocity.RotatedBy(0.0, default(Vector2)).X; + projectile.velocity.X = projectile.velocity.RotatedBy(0.0, default).X; projectile.velocity.X = MathHelper.Clamp(projectile.velocity.X, -6f, 6f); projectile.velocity.Y = projectile.velocity.Y - 0.08f; if (projectile.velocity.Y > 0f) @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Boss projectile.ai[0] = 2f; projectile.netUpdate = true; } - projectile.velocity.X = projectile.velocity.RotatedBy(0.0, default(Vector2)).X; + projectile.velocity.X = projectile.velocity.RotatedBy(0.0, default).X; projectile.velocity.X = MathHelper.Clamp(projectile.velocity.X, -6f, 6f); projectile.velocity.Y = projectile.velocity.Y - 0.08f; if (projectile.velocity.Y > 0f) @@ -187,14 +187,14 @@ namespace CalamityMod.Projectiles.Boss projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num193 = 0; num193 < 2; num193++) { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 1.5f); + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 1.5f); } for (int num194 = 0; num194 < 20; num194++) { - int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 0, default(Color), 2.5f); + int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 0, default, 2.5f); Main.dust[num195].noGravity = true; Main.dust[num195].velocity *= 3f; - num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 1.5f); + num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1.5f); Main.dust[num195].velocity *= 2f; Main.dust[num195].noGravity = true; } diff --git a/Projectiles/Boss/ScavengerNuke.cs b/Projectiles/Boss/ScavengerNuke.cs index 6cba43636c..3e9dada0b8 100644 --- a/Projectiles/Boss/ScavengerNuke.cs +++ b/Projectiles/Boss/ScavengerNuke.cs @@ -111,9 +111,9 @@ namespace CalamityMod.Projectiles.Boss projectile.Damage(); for (int num621 = 0; num621 < 30; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -121,10 +121,10 @@ namespace CalamityMod.Projectiles.Boss } for (int num623 = 0; num623 < 40; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } for (int num625 = 0; num625 < 3; num625++) @@ -138,25 +138,25 @@ namespace CalamityMod.Projectiles.Boss { scaleFactor10 = 1f; } - int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13AB6_cp_0 = Main.gore[num626]; expr_13AB6_cp_0.velocity.X = expr_13AB6_cp_0.velocity.X + 1f; Gore expr_13AD6_cp_0 = Main.gore[num626]; expr_13AD6_cp_0.velocity.Y = expr_13AD6_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13B79_cp_0 = Main.gore[num626]; expr_13B79_cp_0.velocity.X = expr_13B79_cp_0.velocity.X - 1f; Gore expr_13B99_cp_0 = Main.gore[num626]; expr_13B99_cp_0.velocity.Y = expr_13B99_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13C3C_cp_0 = Main.gore[num626]; expr_13C3C_cp_0.velocity.X = expr_13C3C_cp_0.velocity.X + 1f; Gore expr_13C5C_cp_0 = Main.gore[num626]; expr_13C5C_cp_0.velocity.Y = expr_13C5C_cp_0.velocity.Y - 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13CFF_cp_0 = Main.gore[num626]; expr_13CFF_cp_0.velocity.X = expr_13CFF_cp_0.velocity.X - 1f; diff --git a/Projectiles/Boss/ShaderainHostile.cs b/Projectiles/Boss/ShaderainHostile.cs index d1d5d09236..f6b7b7a0bc 100644 --- a/Projectiles/Boss/ShaderainHostile.cs +++ b/Projectiles/Boss/ShaderainHostile.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { - int num310 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + (float)projectile.height - 2f), 2, 2, 14, 0f, 0f, 0, default(Color), 1f); + int num310 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + (float)projectile.height - 2f), 2, 2, 14, 0f, 0f, 0, default, 1f); Dust expr_A0A0_cp_0 = Main.dust[num310]; expr_A0A0_cp_0.position.X = expr_A0A0_cp_0.position.X - 2f; Main.dust[num310].alpha = 38; diff --git a/Projectiles/Boss/Shadowflame.cs b/Projectiles/Boss/Shadowflame.cs index e270e7aba7..27c2066c62 100644 --- a/Projectiles/Boss/Shadowflame.cs +++ b/Projectiles/Boss/Shadowflame.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Boss Main.PlaySound(SoundID.Item20, projectile.position); } - int dust = Dust.NewDust(new Vector2(projectile.position.X + projectile.velocity.X, projectile.position.Y + projectile.velocity.Y), projectile.width, projectile.height, 27, projectile.velocity.X, projectile.velocity.Y, 100, default(Color), 3f); + int dust = Dust.NewDust(new Vector2(projectile.position.X + projectile.velocity.X, projectile.position.Y + projectile.velocity.Y), projectile.width, projectile.height, 27, projectile.velocity.X, projectile.velocity.Y, 100, default, 3f); Main.dust[dust].noGravity = true; projectile.rotation += 0.3f * (float)projectile.direction; @@ -67,11 +67,11 @@ namespace CalamityMod.Projectiles.Boss public override void OnHitPlayer(Player target, int damage, bool crit) { - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) target.AddBuff(mod.BuffType("Shadowflame"), 180, true); - else if (Main.rand.Next(4) == 0) + else if (Main.rand.NextBool(4)) target.AddBuff(mod.BuffType("Shadowflame"), 120, true); - else if (Main.rand.Next(2) == 0) + else if (Main.rand.NextBool(2)) target.AddBuff(mod.BuffType("Shadowflame"), 60, true); } @@ -81,11 +81,11 @@ namespace CalamityMod.Projectiles.Boss int num3; for (int num584 = 0; num584 < 20; num584 = num3 + 1) { - int num585 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 27, -projectile.velocity.X * 0.2f, -projectile.velocity.Y * 0.2f, 100, default(Color), 2.5f); + int num585 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 27, -projectile.velocity.X * 0.2f, -projectile.velocity.Y * 0.2f, 100, default, 2.5f); Main.dust[num585].noGravity = true; Dust dust = Main.dust[num585]; dust.velocity *= 2f; - num585 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 27, -projectile.velocity.X * 0.2f, -projectile.velocity.Y * 0.2f, 100, default(Color), 1.2f); + num585 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 27, -projectile.velocity.X * 0.2f, -projectile.velocity.Y * 0.2f, 100, default, 1.2f); dust = Main.dust[num585]; dust.velocity *= 2f; num3 = num584; diff --git a/Projectiles/Boss/Shadowflamethrower.cs b/Projectiles/Boss/Shadowflamethrower.cs index 18337e47c2..15ed4e4a26 100644 --- a/Projectiles/Boss/Shadowflamethrower.cs +++ b/Projectiles/Boss/Shadowflamethrower.cs @@ -37,12 +37,12 @@ namespace CalamityMod.Projectiles.Boss num302 = 0.75f; projectile.ai[0] += 1f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { - int num305 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 27, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1f); + int num305 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 27, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); Dust dust; - if (Main.rand.Next(3) != 0 || Main.rand.Next(3) == 0) + if (Main.rand.Next(3) != 0 || Main.rand.NextBool(3)) { Main.dust[num305].noGravity = true; dust = Main.dust[num305]; @@ -70,11 +70,11 @@ namespace CalamityMod.Projectiles.Boss public override void OnHitPlayer(Player target, int damage, bool crit) { - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) target.AddBuff(mod.BuffType("Shadowflame"), 240, true); - else if (Main.rand.Next(4) == 0) + else if (Main.rand.NextBool(4)) target.AddBuff(mod.BuffType("Shadowflame"), 150, true); - else if (Main.rand.Next(2) == 0) + else if (Main.rand.NextBool(2)) target.AddBuff(mod.BuffType("Shadowflame"), 90, true); } } diff --git a/Projectiles/Boss/SignusScythe.cs b/Projectiles/Boss/SignusScythe.cs index 93c85e587d..4c51d0517b 100644 --- a/Projectiles/Boss/SignusScythe.cs +++ b/Projectiles/Boss/SignusScythe.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Boss projectile.localAI[0] = 1f; Main.PlaySound(SoundID.Item73, projectile.position); } - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 1f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; projectile.ai[0] += 1f; @@ -127,9 +127,9 @@ namespace CalamityMod.Projectiles.Boss Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 74); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 1f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -137,10 +137,10 @@ namespace CalamityMod.Projectiles.Boss } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 1.5f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1.5f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 1f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Boss/SkyFlare.cs b/Projectiles/Boss/SkyFlare.cs index 7c51903aef..b3f82bc178 100644 --- a/Projectiles/Boss/SkyFlare.cs +++ b/Projectiles/Boss/SkyFlare.cs @@ -69,9 +69,9 @@ namespace CalamityMod.Projectiles.Boss for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 244, vector7.X * 2f, vector7.Y * 2f, 100, default(Color), 1.4f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 244, vector7.X * 2f, vector7.Y * 2f, 100, default, 1.4f); Main.dust[num228].noGravity = true; Main.dust[num228].noLight = true; Main.dust[num228].velocity = vector7; diff --git a/Projectiles/Boss/SkyFlareRevenge.cs b/Projectiles/Boss/SkyFlareRevenge.cs index 4a431c67e1..a41f127818 100644 --- a/Projectiles/Boss/SkyFlareRevenge.cs +++ b/Projectiles/Boss/SkyFlareRevenge.cs @@ -58,9 +58,9 @@ namespace CalamityMod.Projectiles.Boss for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 244, vector7.X * 2f, vector7.Y * 2f, 100, default(Color), 1.4f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 244, vector7.X * 2f, vector7.Y * 2f, 100, default, 1.4f); Main.dust[num228].noGravity = true; Main.dust[num228].noLight = true; Main.dust[num228].velocity = vector7; diff --git a/Projectiles/Boss/VileClot.cs b/Projectiles/Boss/VileClot.cs index f3c7c32bf7..acec63c25e 100644 --- a/Projectiles/Boss/VileClot.cs +++ b/Projectiles/Boss/VileClot.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Boss if (projectile.ai[0] > 3f) { int num104 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), - projectile.width, projectile.height, 75, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 100, default(Color), 1f); + projectile.width, projectile.height, 75, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 100, default, 1f); Main.dust[num104].noGravity = true; } } diff --git a/Projectiles/Boss/WaterSpear.cs b/Projectiles/Boss/WaterSpear.cs index 8223b2a85f..7da791437f 100644 --- a/Projectiles/Boss/WaterSpear.cs +++ b/Projectiles/Boss/WaterSpear.cs @@ -46,9 +46,9 @@ namespace CalamityMod.Projectiles.Boss { for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Boss/YharonFireball.cs b/Projectiles/Boss/YharonFireball.cs index 0574eecd95..9ca4ced310 100644 --- a/Projectiles/Boss/YharonFireball.cs +++ b/Projectiles/Boss/YharonFireball.cs @@ -99,14 +99,14 @@ namespace CalamityMod.Projectiles.Boss projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num193 = 0; num193 < 2; num193++) { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 55, 0f, 0f, 50, default(Color), 1.5f); + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 55, 0f, 0f, 50, default, 1.5f); } for (int num194 = 0; num194 < 20; num194++) { - int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 55, 0f, 0f, 0, default(Color), 2.5f); + int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 55, 0f, 0f, 0, default, 2.5f); Main.dust[num195].noGravity = true; Main.dust[num195].velocity *= 3f; - num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 55, 0f, 0f, 50, default(Color), 1.5f); + num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 55, 0f, 0f, 50, default, 1.5f); Main.dust[num195].velocity *= 2f; Main.dust[num195].noGravity = true; } diff --git a/Projectiles/Boss/YharonFireball2.cs b/Projectiles/Boss/YharonFireball2.cs index fce31aaf85..140130edfc 100644 --- a/Projectiles/Boss/YharonFireball2.cs +++ b/Projectiles/Boss/YharonFireball2.cs @@ -73,9 +73,9 @@ namespace CalamityMod.Projectiles.Boss projectile.alpha = 0; } } - if (Main.rand.Next(16) == 0) + if (Main.rand.NextBool(16)) { - Dust expr_733B = Dust.NewDustDirect(projectile.position, projectile.width, projectile.height, 55, 0f, 0f, 200, default(Color), 1f); + Dust expr_733B = Dust.NewDustDirect(projectile.position, projectile.width, projectile.height, 55, 0f, 0f, 200, default, 1f); expr_733B.scale *= 0.7f; expr_733B.velocity += projectile.velocity * 0.25f; } @@ -110,14 +110,14 @@ namespace CalamityMod.Projectiles.Boss projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num193 = 0; num193 < 2; num193++) { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 55, 0f, 0f, 100, default(Color), 1.5f); + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 55, 0f, 0f, 100, default, 1.5f); } for (int num194 = 0; num194 < 20; num194++) { - int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 55, 0f, 0f, 0, default(Color), 2.5f); + int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 55, 0f, 0f, 0, default, 2.5f); Main.dust[num195].noGravity = true; Main.dust[num195].velocity *= 3f; - num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 55, 0f, 0f, 100, default(Color), 1.5f); + num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 55, 0f, 0f, 100, default, 1.5f); Main.dust[num195].velocity *= 2f; Main.dust[num195].noGravity = true; } diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 5a7a45fa37..22169cc97d 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -409,7 +409,7 @@ namespace CalamityMod.Projectiles } } - if (Main.player[projectile.owner].GetModPlayer(mod).eQuiver && projectile.ranged && + if (Main.player[projectile.owner].GetCalamityPlayer().eQuiver && projectile.ranged && projectile.friendly && CalamityMod.rangedProjectileExceptionList.TrueForAll(x => projectile.type != x)) { if (Main.rand.Next(200) > 198) @@ -430,7 +430,7 @@ namespace CalamityMod.Projectiles } } - if (Main.player[projectile.owner].GetModPlayer(mod).fungalSymbiote && trueMelee) + if (Main.player[projectile.owner].GetCalamityPlayer().fungalSymbiote && trueMelee) { counter++; if (counter >= 6) @@ -464,7 +464,7 @@ namespace CalamityMod.Projectiles } } - if (Main.player[projectile.owner].GetModPlayer(mod).nanotech && rogue && projectile.friendly) + if (Main.player[projectile.owner].GetCalamityPlayer().nanotech && rogue && projectile.friendly) { counter++; if (counter >= 30) @@ -478,7 +478,7 @@ namespace CalamityMod.Projectiles } } - if (Main.player[projectile.owner].GetModPlayer(mod).daedalusSplit && rogue && projectile.friendly) + if (Main.player[projectile.owner].GetCalamityPlayer().daedalusSplit && rogue && projectile.friendly) { counter2++; if (counter2 >= 30) @@ -502,16 +502,16 @@ namespace CalamityMod.Projectiles } } - if (Main.player[projectile.owner].GetModPlayer(mod).theBeeDamage > 0 && projectile.owner == Main.myPlayer && projectile.friendly && projectile.damage > 0 && + if (Main.player[projectile.owner].GetCalamityPlayer().theBeeDamage > 0 && projectile.owner == Main.myPlayer && projectile.friendly && projectile.damage > 0 && (projectile.melee || projectile.ranged || projectile.magic || rogue)) { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 91, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f, 0, default(Color), 0.5f); + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 91, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f, 0, default, 0.5f); Main.dust[dust].noGravity = true; } - if (Main.player[projectile.owner].GetModPlayer(mod).providenceLore && projectile.owner == Main.myPlayer && projectile.friendly && projectile.damage > 0 && + if (Main.player[projectile.owner].GetCalamityPlayer().providenceLore && projectile.owner == Main.myPlayer && projectile.friendly && projectile.damage > 0 && (projectile.melee || projectile.ranged || projectile.magic || rogue)) { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 244, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f, 0, default(Color), 0.5f); + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 244, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f, 0, default, 0.5f); Main.dust[dust].noGravity = true; } } @@ -572,7 +572,7 @@ namespace CalamityMod.Projectiles } Main.player[Main.myPlayer].lifeSteal -= num; } - if (Main.player[projectile.owner].GetModPlayer(mod).alchFlask && + if (Main.player[projectile.owner].GetCalamityPlayer().alchFlask && (projectile.magic || rogue || projectile.melee || projectile.minion || projectile.ranged || projectile.sentry || CalamityMod.projectileMinionList.Contains(projectile.type)) && Main.player[projectile.owner].ownedProjectileCounts[mod.ProjectileType("PlagueSeeker")] < 6) { @@ -584,7 +584,7 @@ namespace CalamityMod.Projectiles int plague = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("PlagueSeeker"), newDamage, 0f, projectile.owner, 0f, 0f); Main.projectile[plague].melee = false; } - if (Main.player[projectile.owner].GetModPlayer(mod).reaverBlast && projectile.melee) + if (Main.player[projectile.owner].GetCalamityPlayer().reaverBlast && projectile.melee) { int newDamage = (int)((double)projectile.damage * 0.2); if (newDamage > 30) @@ -593,7 +593,7 @@ namespace CalamityMod.Projectiles } Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("ReaverBlast"), newDamage, 0f, projectile.owner, 0f, 0f); } - if (Main.player[projectile.owner].GetModPlayer(mod).auricSet && target.canGhostHeal) + if (Main.player[projectile.owner].GetCalamityPlayer().auricSet && target.canGhostHeal) { float num11 = 0.05f; num11 -= (float)projectile.numHits * 0.025f; @@ -627,7 +627,7 @@ namespace CalamityMod.Projectiles } Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("AuricOrb"), 0, 0f, projectile.owner, (float)num14, num12); } - else if (Main.player[projectile.owner].GetModPlayer(mod).silvaSet && target.canGhostHeal) + else if (Main.player[projectile.owner].GetCalamityPlayer().silvaSet && target.canGhostHeal) { float num11 = 0.03f; num11 -= (float)projectile.numHits * 0.015f; @@ -663,7 +663,7 @@ namespace CalamityMod.Projectiles } if (projectile.magic) { - if (Main.player[projectile.owner].GetModPlayer(mod).silvaMage && projectile.penetrate == 1 && + if (Main.player[projectile.owner].GetCalamityPlayer().silvaMage && projectile.penetrate == 1 && Main.rand.Next(0, 100) >= 97) { Main.PlaySound(29, (int)projectile.position.X, (int)projectile.position.Y, 103); @@ -684,14 +684,14 @@ namespace CalamityMod.Projectiles Main.dust[num195].velocity *= 2f; Main.dust[num195].noGravity = true; } - projectile.damage *= (Main.player[projectile.owner].GetModPlayer(mod).auricSet ? 7 : 4); + projectile.damage *= (Main.player[projectile.owner].GetCalamityPlayer().auricSet ? 7 : 4); projectile.Damage(); } - if (Main.player[projectile.owner].GetModPlayer(mod).tarraMage && target.canGhostHeal) + if (Main.player[projectile.owner].GetCalamityPlayer().tarraMage && target.canGhostHeal) { - if (Main.player[projectile.owner].GetModPlayer(mod).tarraMageHealCooldown <= 0) + if (Main.player[projectile.owner].GetCalamityPlayer().tarraMageHealCooldown <= 0) { - Main.player[projectile.owner].GetModPlayer(mod).tarraMageHealCooldown = 90; + Main.player[projectile.owner].GetCalamityPlayer().tarraMageHealCooldown = 90; float num11 = 0.03f; num11 -= (float)projectile.numHits * 0.015f; if (num11 <= 0f) @@ -708,7 +708,7 @@ namespace CalamityMod.Projectiles return; } Main.player[Main.myPlayer].lifeSteal -= num12 * 1.5f; - int healAmount = (Main.player[projectile.owner].GetModPlayer(mod).auricSet ? projectile.damage / 100 : projectile.damage / 50); + int healAmount = (Main.player[projectile.owner].GetCalamityPlayer().auricSet ? projectile.damage / 100 : projectile.damage / 50); Player player = Main.player[projectile.owner]; player.statLife += healAmount; player.HealEffect(healAmount); @@ -718,7 +718,7 @@ namespace CalamityMod.Projectiles } } } - if (Main.player[projectile.owner].GetModPlayer(mod).reaverBurst) + if (Main.player[projectile.owner].GetCalamityPlayer().reaverBurst) { int num251 = Main.rand.Next(2, 5); for (int num252 = 0; num252 < num251; num252++) @@ -740,11 +740,11 @@ namespace CalamityMod.Projectiles Main.projectile[proj].localNPCHitCooldown = 30; } } - else if (Main.player[projectile.owner].GetModPlayer(mod).ataxiaMage && - Main.player[projectile.owner].GetModPlayer(mod).ataxiaDmg <= 0) + else if (Main.player[projectile.owner].GetCalamityPlayer().ataxiaMage && + Main.player[projectile.owner].GetCalamityPlayer().ataxiaDmg <= 0) { int num = projectile.damage / 2; - Main.player[projectile.owner].GetModPlayer(mod).ataxiaDmg += (float)num; + Main.player[projectile.owner].GetCalamityPlayer().ataxiaDmg += (float)num; int[] array = new int[200]; int num3 = 0; int num4 = 0; @@ -824,11 +824,11 @@ namespace CalamityMod.Projectiles Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("AtaxiaHealOrb"), 0, 0f, projectile.owner, (float)num14, num12); } } - else if (Main.player[projectile.owner].GetModPlayer(mod).xerocSet && - Main.player[projectile.owner].GetModPlayer(mod).xerocDmg <= 0) + else if (Main.player[projectile.owner].GetCalamityPlayer().xerocSet && + Main.player[projectile.owner].GetCalamityPlayer().xerocDmg <= 0) { int num = projectile.damage / 2; - Main.player[projectile.owner].GetModPlayer(mod).xerocDmg += (float)num; + Main.player[projectile.owner].GetCalamityPlayer().xerocDmg += (float)num; int[] array = new int[200]; int num3 = 0; int num4 = 0; @@ -908,11 +908,11 @@ namespace CalamityMod.Projectiles Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("XerocHealOrb"), 0, 0f, projectile.owner, (float)num14, num12); } } - else if (Main.player[projectile.owner].GetModPlayer(mod).godSlayerMage && - Main.player[projectile.owner].GetModPlayer(mod).godSlayerDmg <= 0) + else if (Main.player[projectile.owner].GetCalamityPlayer().godSlayerMage && + Main.player[projectile.owner].GetCalamityPlayer().godSlayerDmg <= 0) { int num = projectile.damage / 2; - Main.player[projectile.owner].GetModPlayer(mod).godSlayerDmg += (float)num; + Main.player[projectile.owner].GetCalamityPlayer().godSlayerDmg += (float)num; int[] array = new int[200]; int num3 = 0; int num4 = 0; @@ -957,10 +957,10 @@ namespace CalamityMod.Projectiles num8 *= num10; num9 *= num10; Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, num8, num9, mod.ProjectileType("GodSlayerOrb"), - (int)((double)num * (Main.player[projectile.owner].GetModPlayer(mod).auricSet ? 2.0 : 1.5)), 0f, projectile.owner, (float)num6, 0f); + (int)((double)num * (Main.player[projectile.owner].GetCalamityPlayer().auricSet ? 2.0 : 1.5)), 0f, projectile.owner, (float)num6, 0f); if (target.canGhostHeal) { - float num11 = (Main.player[projectile.owner].GetModPlayer(mod).auricSet ? 0.03f : 0.06f); //0.2 + float num11 = (Main.player[projectile.owner].GetCalamityPlayer().auricSet ? 0.03f : 0.06f); //0.2 num11 -= (float)projectile.numHits * 0.015f; //0.05 if (num11 <= 0f) { @@ -996,7 +996,7 @@ namespace CalamityMod.Projectiles } else if (projectile.melee) { - if (Main.player[projectile.owner].GetModPlayer(mod).ataxiaGeyser && + if (Main.player[projectile.owner].GetCalamityPlayer().ataxiaGeyser && Main.player[projectile.owner].ownedProjectileCounts[mod.ProjectileType("ChaosGeyser")] < 3) { int newDamage = (int)((double)projectile.damage * 0.15); @@ -1006,7 +1006,7 @@ namespace CalamityMod.Projectiles } Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("ChaosGeyser"), newDamage, 0f, projectile.owner, 0f, 0f); } - else if (Main.player[projectile.owner].GetModPlayer(mod).xerocSet && + else if (Main.player[projectile.owner].GetCalamityPlayer().xerocSet && Main.player[projectile.owner].ownedProjectileCounts[mod.ProjectileType("XerocBlast")] < 3) { int newDamage = (int)((double)projectile.damage * 0.2); @@ -1019,7 +1019,7 @@ namespace CalamityMod.Projectiles } else if (projectile.ranged) { - if (Main.player[projectile.owner].GetModPlayer(mod).xerocSet && + if (Main.player[projectile.owner].GetCalamityPlayer().xerocSet && Main.player[projectile.owner].ownedProjectileCounts[mod.ProjectileType("XerocFire")] < 3) { int newDamage = (int)((double)projectile.damage * 0.15); @@ -1032,11 +1032,11 @@ namespace CalamityMod.Projectiles } else if (rogue) { - if (Main.player[projectile.owner].GetModPlayer(mod).xerocSet && - Main.player[projectile.owner].GetModPlayer(mod).xerocDmg <= 0) + if (Main.player[projectile.owner].GetCalamityPlayer().xerocSet && + Main.player[projectile.owner].GetCalamityPlayer().xerocDmg <= 0) { int num = projectile.damage / 2; - Main.player[projectile.owner].GetModPlayer(mod).xerocDmg += (float)num; + Main.player[projectile.owner].GetCalamityPlayer().xerocDmg += (float)num; int[] array = new int[200]; int num3 = 0; int num4 = 0; @@ -1085,24 +1085,24 @@ namespace CalamityMod.Projectiles } else if (projectile.minion || projectile.sentry || CalamityMod.projectileMinionList.Contains(projectile.type)) { - if (Main.player[projectile.owner].GetModPlayer(mod).pArtifact) + if (Main.player[projectile.owner].GetCalamityPlayer().pArtifact) { target.AddBuff(mod.BuffType("HolyLight"), 300); } - if (Main.player[projectile.owner].GetModPlayer(mod).tearMinions) + if (Main.player[projectile.owner].GetCalamityPlayer().tearMinions) { target.AddBuff(mod.BuffType("TemporalSadness"), 60); } - if (Main.player[projectile.owner].GetModPlayer(mod).shadowMinions) + if (Main.player[projectile.owner].GetCalamityPlayer().shadowMinions) { target.AddBuff(BuffID.ShadowFlame, 300); } - if (Main.player[projectile.owner].GetModPlayer(mod).godSlayerSummon && - Main.player[projectile.owner].GetModPlayer(mod).godSlayerDmg <= 0) + if (Main.player[projectile.owner].GetCalamityPlayer().godSlayerSummon && + Main.player[projectile.owner].GetCalamityPlayer().godSlayerDmg <= 0) { int num = projectile.damage / 2; float ai1 = (Main.rand.NextFloat() + 0.5f); - Main.player[projectile.owner].GetModPlayer(mod).godSlayerDmg += (float)num; + Main.player[projectile.owner].GetCalamityPlayer().godSlayerDmg += (float)num; int[] array = new int[200]; int num3 = 0; int num4 = 0; @@ -1148,11 +1148,11 @@ namespace CalamityMod.Projectiles num9 *= num10; Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, num8, num9, mod.ProjectileType("GodSlayerPhantom"), (int)((double)num * 2.0), 0f, projectile.owner, 0f, ai1); } - else if (Main.player[projectile.owner].GetModPlayer(mod).xerocSet && - Main.player[projectile.owner].GetModPlayer(mod).xerocDmg <= 0) + else if (Main.player[projectile.owner].GetCalamityPlayer().xerocSet && + Main.player[projectile.owner].GetCalamityPlayer().xerocDmg <= 0) { int num = projectile.damage / 2; - Main.player[projectile.owner].GetModPlayer(mod).xerocDmg += (float)num; + Main.player[projectile.owner].GetCalamityPlayer().xerocDmg += (float)num; int[] array = new int[200]; int num3 = 0; int num4 = 0; @@ -1345,19 +1345,19 @@ namespace CalamityMod.Projectiles { if (projectile.owner == Main.myPlayer) { - if (Main.player[projectile.owner].GetModPlayer(mod).providenceLore && projectile.friendly && projectile.damage > 0 && + if (Main.player[projectile.owner].GetCalamityPlayer().providenceLore && projectile.friendly && projectile.damage > 0 && (projectile.melee || projectile.ranged || projectile.magic || rogue)) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); for (int i = 0; i < 3; i++) { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 244, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f, 0, default(Color), 1f); + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 244, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f, 0, default, 1f); Main.dust[dust].noGravity = true; } } if (projectile.ranged) { - if (Main.player[projectile.owner].GetModPlayer(mod).tarraRanged && Main.rand.Next(0, 100) >= 88) + if (Main.player[projectile.owner].GetCalamityPlayer().tarraRanged && Main.rand.Next(0, 100) >= 88) { int num251 = Main.rand.Next(2, 4); for (int num252 = 0; num252 < num251; num252++) diff --git a/Projectiles/Enemy/CrimsonSpike.cs b/Projectiles/Enemy/CrimsonSpike.cs index d0dfd4cdf1..b3661edf2e 100644 --- a/Projectiles/Enemy/CrimsonSpike.cs +++ b/Projectiles/Enemy/CrimsonSpike.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Enemy public override void AI() { - if (projectile.alpha == 0 && Main.rand.Next(3) == 0) + if (projectile.alpha == 0 && Main.rand.NextBool(3)) { int num67 = Dust.NewDust(projectile.position - projectile.velocity * 3f, projectile.width, projectile.height, 260, 0f, 0f, 50, new Color(255, 136, 78, 150), 1.2f); Main.dust[num67].velocity *= 0.3f; diff --git a/Projectiles/Enemy/EarthRockBig.cs b/Projectiles/Enemy/EarthRockBig.cs index ff3f08db67..0cd20f3953 100644 --- a/Projectiles/Enemy/EarthRockBig.cs +++ b/Projectiles/Enemy/EarthRockBig.cs @@ -60,9 +60,9 @@ namespace CalamityMod.Projectiles.Enemy projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 15; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 8, 0f, 0f, 100, default(Color), 1.2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 8, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -70,10 +70,10 @@ namespace CalamityMod.Projectiles.Enemy } for (int num623 = 0; num623 < 30; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 1, 0f, 0f, 100, default(Color), 1.7f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 1, 0f, 0f, 100, default, 1.7f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 8, 0f, 0f, 100, default(Color), 1f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 8, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } for (int num625 = 0; num625 < 3; num625++) @@ -87,25 +87,25 @@ namespace CalamityMod.Projectiles.Enemy { scaleFactor10 = 1f; } - int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13AB6_cp_0 = Main.gore[num626]; expr_13AB6_cp_0.velocity.X = expr_13AB6_cp_0.velocity.X + 1f; Gore expr_13AD6_cp_0 = Main.gore[num626]; expr_13AD6_cp_0.velocity.Y = expr_13AD6_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13B79_cp_0 = Main.gore[num626]; expr_13B79_cp_0.velocity.X = expr_13B79_cp_0.velocity.X - 1f; Gore expr_13B99_cp_0 = Main.gore[num626]; expr_13B99_cp_0.velocity.Y = expr_13B99_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13C3C_cp_0 = Main.gore[num626]; expr_13C3C_cp_0.velocity.X = expr_13C3C_cp_0.velocity.X + 1f; Gore expr_13C5C_cp_0 = Main.gore[num626]; expr_13C5C_cp_0.velocity.Y = expr_13C5C_cp_0.velocity.Y - 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13CFF_cp_0 = Main.gore[num626]; expr_13CFF_cp_0.velocity.X = expr_13CFF_cp_0.velocity.X - 1f; diff --git a/Projectiles/Enemy/EarthRockSmall.cs b/Projectiles/Enemy/EarthRockSmall.cs index 253213c72a..e6e0b28543 100644 --- a/Projectiles/Enemy/EarthRockSmall.cs +++ b/Projectiles/Enemy/EarthRockSmall.cs @@ -39,9 +39,9 @@ namespace CalamityMod.Projectiles.Enemy projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 8, 0f, 0f, 100, default(Color), 1.2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 8, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -49,10 +49,10 @@ namespace CalamityMod.Projectiles.Enemy } for (int num623 = 0; num623 < 20; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 1, 0f, 0f, 100, default(Color), 1.7f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 1, 0f, 0f, 100, default, 1.7f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 8, 0f, 0f, 100, default(Color), 1f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 8, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } for (int num625 = 0; num625 < 3; num625++) @@ -66,25 +66,25 @@ namespace CalamityMod.Projectiles.Enemy { scaleFactor10 = 1f; } - int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13AB6_cp_0 = Main.gore[num626]; expr_13AB6_cp_0.velocity.X = expr_13AB6_cp_0.velocity.X + 1f; Gore expr_13AD6_cp_0 = Main.gore[num626]; expr_13AD6_cp_0.velocity.Y = expr_13AD6_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13B79_cp_0 = Main.gore[num626]; expr_13B79_cp_0.velocity.X = expr_13B79_cp_0.velocity.X - 1f; Gore expr_13B99_cp_0 = Main.gore[num626]; expr_13B99_cp_0.velocity.Y = expr_13B99_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13C3C_cp_0 = Main.gore[num626]; expr_13C3C_cp_0.velocity.X = expr_13C3C_cp_0.velocity.X + 1f; Gore expr_13C5C_cp_0 = Main.gore[num626]; expr_13C5C_cp_0.velocity.Y = expr_13C5C_cp_0.velocity.Y - 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13CFF_cp_0 = Main.gore[num626]; expr_13CFF_cp_0.velocity.X = expr_13CFF_cp_0.velocity.X - 1f; diff --git a/Projectiles/Enemy/FlameBurstHostile.cs b/Projectiles/Enemy/FlameBurstHostile.cs index c5a4825340..af3b5461a3 100644 --- a/Projectiles/Enemy/FlameBurstHostile.cs +++ b/Projectiles/Enemy/FlameBurstHostile.cs @@ -36,9 +36,9 @@ namespace CalamityMod.Projectiles.Enemy projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -46,10 +46,10 @@ namespace CalamityMod.Projectiles.Enemy } for (int num623 = 0; num623 < 20; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } count += 1f; @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Enemy { for (int num468 = 0; num468 < 5; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default(Color), 0.75f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 0.75f); Main.dust[num469].velocity *= 0f; } } diff --git a/Projectiles/Enemy/HorsWaterBlast.cs b/Projectiles/Enemy/HorsWaterBlast.cs index 06e84934a2..4d39bf3d5d 100644 --- a/Projectiles/Enemy/HorsWaterBlast.cs +++ b/Projectiles/Enemy/HorsWaterBlast.cs @@ -29,9 +29,9 @@ namespace CalamityMod.Projectiles.Enemy { for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Enemy Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0f) / 255f, ((255 - projectile.alpha) * 0f) / 255f, ((255 - projectile.alpha) * 0.35f) / 255f); for (int num457 = 0; num457 < 10; num457++) { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default(Color), 1.2f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default, 1.2f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Enemy num466 = num465 / num466; num463 *= num466; num464 *= num466; - int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default(Color), 1.2f); + int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default, 1.2f); Main.dust[num467].noGravity = true; Main.dust[num467].position.X = projectile.Center.X; Main.dust[num467].position.Y = projectile.Center.Y; diff --git a/Projectiles/Enemy/InkBomb.cs b/Projectiles/Enemy/InkBomb.cs index 3c15ec6d68..492e0ffa57 100644 --- a/Projectiles/Enemy/InkBomb.cs +++ b/Projectiles/Enemy/InkBomb.cs @@ -66,9 +66,9 @@ namespace CalamityMod.Projectiles.Enemy projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 54, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 54, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -76,10 +76,10 @@ namespace CalamityMod.Projectiles.Enemy } for (int num623 = 0; num623 < 15; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 109, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 109, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 109, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 109, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Enemy/LavaChunk.cs b/Projectiles/Enemy/LavaChunk.cs index 1ffadee103..59a6b62f50 100644 --- a/Projectiles/Enemy/LavaChunk.cs +++ b/Projectiles/Enemy/LavaChunk.cs @@ -54,11 +54,11 @@ namespace CalamityMod.Projectiles.Enemy { num248 = projectile.velocity.Y * 0.5f; } - int num249 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 6, 0f, 0f, 100, default(Color), projectile.scale); + int num249 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 6, 0f, 0f, 100, default, projectile.scale); Main.dust[num249].scale *= 2f + (float)Main.rand.Next(10) * 0.1f; Main.dust[num249].velocity *= 0.2f; Main.dust[num249].noGravity = true; - num249 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 31, 0f, 0f, 100, default(Color), projectile.scale * 0.5f); + num249 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 31, 0f, 0f, 100, default, projectile.scale * 0.5f); Main.dust[num249].fadeIn = 1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num249].velocity *= 0.05f; } diff --git a/Projectiles/Enemy/PufferExplosion.cs b/Projectiles/Enemy/PufferExplosion.cs index d7c2417bce..6f6b271a70 100644 --- a/Projectiles/Enemy/PufferExplosion.cs +++ b/Projectiles/Enemy/PufferExplosion.cs @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Enemy num466 = num465 / num466; num463 *= num466; num464 *= num466; - int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default(Color), 1.5f); + int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default, 1.5f); Main.dust[num467].noGravity = true; Main.dust[num467].position.X = projectile.Center.X; Main.dust[num467].position.Y = projectile.Center.Y; diff --git a/Projectiles/Enemy/StormMarkHostile.cs b/Projectiles/Enemy/StormMarkHostile.cs index 7e96225d2f..ec923f79db 100644 --- a/Projectiles/Enemy/StormMarkHostile.cs +++ b/Projectiles/Enemy/StormMarkHostile.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Enemy value81.X *= -1f; Vector2 value82 = new Vector2(2f, 10f); Vector2 position4 = projectile.Center + new Vector2(60f, 200f) * value81 * 0.5f + value82; - Dust dust34 = Main.dust[Dust.NewDust(position4, 0, 0, 16, 0f, 0f, 0, default(Color), 0.5f)]; + Dust dust34 = Main.dust[Dust.NewDust(position4, 0, 0, 16, 0f, 0f, 0, default, 0.5f)]; dust34.position = position4; dust34.customData = projectile.Center + value82; dust34.fadeIn = 1f; @@ -92,9 +92,9 @@ namespace CalamityMod.Projectiles.Enemy } for (int num1135 = 0; num1135 < 2; num1135++) { - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { - Vector2 value83 = Vector2.UnitY.RotatedBy((double)((float)num1135 * 3.14159274f), default(Vector2)).RotatedBy((double)projectile.rotation, default(Vector2)); + Vector2 value83 = Vector2.UnitY.RotatedBy((double)((float)num1135 * 3.14159274f), default).RotatedBy((double)projectile.rotation, default); Dust dust35 = Main.dust[Dust.NewDust(projectile.Center, 0, 0, 16, 0f, 0f, 225, newColor3, 1f)]; dust35.noGravity = true; dust35.noLight = true; @@ -105,9 +105,9 @@ namespace CalamityMod.Projectiles.Enemy } for (int num1136 = 0; num1136 < 2; num1136++) { - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { - Vector2 value84 = Vector2.UnitY.RotatedBy((double)((float)num1136 * 3.14159274f), default(Vector2)); + Vector2 value84 = Vector2.UnitY.RotatedBy((double)((float)num1136 * 3.14159274f), default); Dust dust36 = Main.dust[Dust.NewDust(projectile.Center, 0, 0, 16, 0f, 0f, 225, newColor3, 1.5f)]; dust36.noGravity = true; dust36.noLight = true; diff --git a/Projectiles/Enemy/SulphuricAcidCannon.cs b/Projectiles/Enemy/SulphuricAcidCannon.cs index 5621af7a1b..89c31124d4 100644 --- a/Projectiles/Enemy/SulphuricAcidCannon.cs +++ b/Projectiles/Enemy/SulphuricAcidCannon.cs @@ -117,7 +117,7 @@ namespace CalamityMod.Projectiles.Enemy int num3; for (int num246 = 0; num246 < 25; num246 = num3 + 1) { - int num247 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 31, 0f, 0f, 0, default(Color), 1f); + int num247 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 31, 0f, 0f, 0, default, 1f); Main.dust[num247].position = (Main.dust[num247].position + projectile.position) / 2f; Main.dust[num247].velocity = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); Main.dust[num247].velocity.Normalize(); diff --git a/Projectiles/Enemy/TornadoHostile.cs b/Projectiles/Enemy/TornadoHostile.cs index 789ef5f400..0b25dd6df7 100644 --- a/Projectiles/Enemy/TornadoHostile.cs +++ b/Projectiles/Enemy/TornadoHostile.cs @@ -94,7 +94,7 @@ namespace CalamityMod.Projectiles.Enemy value77.X *= -1f; Vector2 value78 = new Vector2(6f, 10f); Vector2 position3 = vector146 + value74 * value77 * 0.5f + value78; - Dust dust33 = Main.dust[Dust.NewDust(position3, 0, 0, 16, 0f, 0f, 0, default(Color), 1.5f)]; + Dust dust33 = Main.dust[Dust.NewDust(position3, 0, 0, 16, 0f, 0f, 0, default, 1.5f)]; dust33.position = position3; dust33.customData = vector146 + value78; dust33.fadeIn = 1f; @@ -136,7 +136,7 @@ namespace CalamityMod.Projectiles.Enemy Microsoft.Xna.Framework.Rectangle rectangle9 = texture2D23.Frame(1, 1, 0, 0); Vector2 origin3 = rectangle9.Size() / 2f; float num233 = -0.06283186f * num229; - Vector2 spinningpoint2 = Vector2.UnitY.RotatedBy((double)(num229 * 0.1f), default(Vector2)); + Vector2 spinningpoint2 = Vector2.UnitY.RotatedBy((double)(num229 * 0.1f), default); float num234 = 0f; float num235 = 5.1f; Microsoft.Xna.Framework.Color value34 = new Microsoft.Xna.Framework.Color(225, 225, 225); @@ -146,7 +146,7 @@ namespace CalamityMod.Projectiles.Enemy float num237 = num234 / vector33.Y; float num238 = num234 * 6.28318548f / -20f; float num239 = num237 - 0.15f; - Vector2 vector34 = spinningpoint2.RotatedBy((double)num238, default(Vector2)); + Vector2 vector34 = spinningpoint2.RotatedBy((double)num238, default); Vector2 value35 = new Vector2(0f, num237 + 1f); value35.X = value35.Y * num232; Microsoft.Xna.Framework.Color color39 = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.Transparent, value34, num237 * 2f); diff --git a/Projectiles/Enemy/ToxicMinnowCloud.cs b/Projectiles/Enemy/ToxicMinnowCloud.cs index 0daa1a11c8..c1c9a974af 100644 --- a/Projectiles/Enemy/ToxicMinnowCloud.cs +++ b/Projectiles/Enemy/ToxicMinnowCloud.cs @@ -37,15 +37,15 @@ namespace CalamityMod.Projectiles.Enemy { projectile.frame = 0; } - if(Main.rand.Next(2) == 0) + if(Main.rand.NextBool(2)) { projectile.velocity *= 0.95f; } - else if(Main.rand.Next(2) == 0) + else if(Main.rand.NextBool(2)) { projectile.velocity *= 0.90f; } - else if(Main.rand.Next(2) == 0) + else if(Main.rand.NextBool(2)) { projectile.velocity *= 0.85f; } diff --git a/Projectiles/Healing/AtaxiaHealOrb.cs b/Projectiles/Healing/AtaxiaHealOrb.cs index 8adfbc79b1..84ca1c35d0 100644 --- a/Projectiles/Healing/AtaxiaHealOrb.cs +++ b/Projectiles/Healing/AtaxiaHealOrb.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Healing { float num498 = projectile.velocity.X * 0.2f * (float)num497; float num499 = -(projectile.velocity.Y * 0.2f) * (float)num497; - int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default(Color), 2f); + int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, 2f); Main.dust[num500].noGravity = true; Main.dust[num500].velocity *= 0f; Dust expr_154F9_cp_0 = Main.dust[num500]; diff --git a/Projectiles/Healing/BurntSienna.cs b/Projectiles/Healing/BurntSienna.cs index 737f399df4..7df7e9586f 100644 --- a/Projectiles/Healing/BurntSienna.cs +++ b/Projectiles/Healing/BurntSienna.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Healing { float num498 = projectile.velocity.X * 0.2f * (float)num497; float num499 = -(projectile.velocity.Y * 0.2f) * (float)num497; - int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default(Color), 1f); + int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 1f); Main.dust[num500].noGravity = true; Main.dust[num500].velocity *= 0f; Dust expr_154F9_cp_0 = Main.dust[num500]; diff --git a/Projectiles/Healing/EarthHealOrb.cs b/Projectiles/Healing/EarthHealOrb.cs index b771af9704..d6ca46d0f6 100644 --- a/Projectiles/Healing/EarthHealOrb.cs +++ b/Projectiles/Healing/EarthHealOrb.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Healing { float num498 = projectile.velocity.X * 0.2f * (float)num497; float num499 = -(projectile.velocity.Y * 0.2f) * (float)num497; - int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 74, 0f, 0f, 100, default(Color), 1f); + int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 74, 0f, 0f, 100, default, 1f); Main.dust[num500].noGravity = true; Main.dust[num500].velocity *= 0f; Dust expr_154F9_cp_0 = Main.dust[num500]; diff --git a/Projectiles/Healing/EssenceFlame.cs b/Projectiles/Healing/EssenceFlame.cs index f8c3a7253a..a56bdaa6b2 100644 --- a/Projectiles/Healing/EssenceFlame.cs +++ b/Projectiles/Healing/EssenceFlame.cs @@ -78,9 +78,9 @@ namespace CalamityMod.Projectiles.Healing projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -88,10 +88,10 @@ namespace CalamityMod.Projectiles.Healing } for (int num623 = 0; num623 < 15; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Healing/FungalHeal.cs b/Projectiles/Healing/FungalHeal.cs index 4ce0b12f1e..8840096152 100644 --- a/Projectiles/Healing/FungalHeal.cs +++ b/Projectiles/Healing/FungalHeal.cs @@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Healing projectile.velocity.Y = (projectile.velocity.Y * 9f + num490) / 16f; float num494 = projectile.velocity.X * 0.334f; float num495 = -(projectile.velocity.Y * 0.334f); - int num496 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 100, default(Color), 0.5f); + int num496 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 100, default, 0.5f); Main.dust[num496].noGravity = true; Main.dust[num496].velocity *= 0f; Dust expr_153E2_cp_0 = Main.dust[num496]; @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Healing expr_15401_cp_0.position.Y = expr_15401_cp_0.position.Y - num495; float num498 = projectile.velocity.X * 0.2f; float num499 = -(projectile.velocity.Y * 0.2f); - int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 100, default(Color), 0.7f); + int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 100, default, 0.7f); Main.dust[num500].noGravity = true; Main.dust[num500].velocity *= 0f; Dust expr_154F9_cp_0 = Main.dust[num500]; diff --git a/Projectiles/Healing/GodSlayerHealOrb.cs b/Projectiles/Healing/GodSlayerHealOrb.cs index 0a51b59b9b..6834e48b2c 100644 --- a/Projectiles/Healing/GodSlayerHealOrb.cs +++ b/Projectiles/Healing/GodSlayerHealOrb.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Healing { float num498 = projectile.velocity.X * 0.2f * (float)num497; float num499 = -(projectile.velocity.Y * 0.2f) * (float)num497; - int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 2f); + int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num500].noGravity = true; Main.dust[num500].velocity *= 0f; Dust expr_154F9_cp_0 = Main.dust[num500]; diff --git a/Projectiles/Healing/PhoenixHeal.cs b/Projectiles/Healing/PhoenixHeal.cs index 9be40f4490..e7627e572d 100644 --- a/Projectiles/Healing/PhoenixHeal.cs +++ b/Projectiles/Healing/PhoenixHeal.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Healing { float num498 = projectile.velocity.X * 0.2f * (float)num497; float num499 = -(projectile.velocity.Y * 0.2f) * (float)num497; - int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 1f); + int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1f); Main.dust[num500].noGravity = true; Main.dust[num500].velocity *= 0f; Dust expr_154F9_cp_0 = Main.dust[num500]; diff --git a/Projectiles/Healing/RoyalHeal.cs b/Projectiles/Healing/RoyalHeal.cs index bd9f04a842..97e6309dec 100644 --- a/Projectiles/Healing/RoyalHeal.cs +++ b/Projectiles/Healing/RoyalHeal.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Healing { float num494 = projectile.velocity.X * 0.334f * (float)num493; float num495 = -(projectile.velocity.Y * 0.334f) * (float)num493; - int num496 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 20, 0f, 0f, 100, default(Color), 1.1f); + int num496 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 20, 0f, 0f, 100, default, 1.1f); Main.dust[num496].noGravity = true; Main.dust[num496].velocity *= 0f; Dust expr_153E2_cp_0 = Main.dust[num496]; @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Healing { float num498 = projectile.velocity.X * 0.2f * (float)num497; float num499 = -(projectile.velocity.Y * 0.2f) * (float)num497; - int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 20, 0f, 0f, 100, default(Color), 1.3f); + int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 20, 0f, 0f, 100, default, 1.3f); Main.dust[num500].noGravity = true; Main.dust[num500].velocity *= 0f; Dust expr_154F9_cp_0 = Main.dust[num500]; diff --git a/Projectiles/Healing/Terracotta.cs b/Projectiles/Healing/Terracotta.cs index 58de5bdd27..1051415af8 100644 --- a/Projectiles/Healing/Terracotta.cs +++ b/Projectiles/Healing/Terracotta.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Healing { float num498 = projectile.velocity.X * 0.2f * (float)num497; float num499 = -(projectile.velocity.Y * 0.2f) * (float)num497; - int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default(Color), 1f); + int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 1f); Main.dust[num500].noGravity = true; Main.dust[num500].velocity *= 0f; Dust expr_154F9_cp_0 = Main.dust[num500]; @@ -66,9 +66,9 @@ namespace CalamityMod.Projectiles.Healing { for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Healing/TransfusionTrail.cs b/Projectiles/Healing/TransfusionTrail.cs index e2a3b2cd46..e624cfac69 100644 --- a/Projectiles/Healing/TransfusionTrail.cs +++ b/Projectiles/Healing/TransfusionTrail.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Healing { float num494 = projectile.velocity.X * 0.334f * (float)num493; float num495 = -(projectile.velocity.Y * 0.334f) * (float)num493; - int num496 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 183, 0f, 0f, 100, default(Color), 0.7f); + int num496 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 183, 0f, 0f, 100, default, 0.7f); Main.dust[num496].noGravity = true; Main.dust[num496].velocity *= 0f; Dust expr_153E2_cp_0 = Main.dust[num496]; @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Healing { float num498 = projectile.velocity.X * 0.2f * (float)num497; float num499 = -(projectile.velocity.Y * 0.2f) * (float)num497; - int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 183, 0f, 0f, 100, default(Color), 0.9f); + int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 183, 0f, 0f, 100, default, 0.9f); Main.dust[num500].noGravity = true; Main.dust[num500].velocity *= 0f; Dust expr_154F9_cp_0 = Main.dust[num500]; diff --git a/Projectiles/Healing/XerocHealOrb.cs b/Projectiles/Healing/XerocHealOrb.cs index b33152d17b..45450440a2 100644 --- a/Projectiles/Healing/XerocHealOrb.cs +++ b/Projectiles/Healing/XerocHealOrb.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Healing { float num498 = projectile.velocity.X * 0.2f * (float)num497; float num499 = -(projectile.velocity.Y * 0.2f) * (float)num497; - int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 58, 0f, 0f, 100, default(Color), 2f); + int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 58, 0f, 0f, 100, default, 2f); Main.dust[num500].noGravity = true; Main.dust[num500].velocity *= 0f; Dust expr_154F9_cp_0 = Main.dust[num500]; diff --git a/Projectiles/Magic/AbyssBall.cs b/Projectiles/Magic/AbyssBall.cs index d9ef4c885b..89c684c14a 100644 --- a/Projectiles/Magic/AbyssBall.cs +++ b/Projectiles/Magic/AbyssBall.cs @@ -41,9 +41,9 @@ namespace CalamityMod.Projectiles.Magic projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 30; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 1.2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -51,10 +51,10 @@ namespace CalamityMod.Projectiles.Magic } for (int num623 = 0; num623 < 60; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 1.7f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1.7f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 1f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } projectile.maxPenetrate = -1; diff --git a/Projectiles/Magic/Ancient.cs b/Projectiles/Magic/Ancient.cs index a720c08162..666af2af55 100644 --- a/Projectiles/Magic/Ancient.cs +++ b/Projectiles/Magic/Ancient.cs @@ -70,8 +70,8 @@ namespace CalamityMod.Projectiles.Magic int num297 = 32; for (int num298 = 0; num298 < 2; num298++) { - int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1f); - if (Main.rand.Next(2) == 0) + int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); + if (Main.rand.NextBool(2)) { Main.dust[num299].noGravity = true; Main.dust[num299].scale *= 2f; @@ -92,8 +92,8 @@ namespace CalamityMod.Projectiles.Magic } for (int num298 = 0; num298 < 2; num298++) { - int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1f); - if (Main.rand.Next(3) == 0) + int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); + if (Main.rand.NextBool(3)) { Main.dust[num299].noGravity = true; Main.dust[num299].scale *= 4f; diff --git a/Projectiles/Magic/Ancient2.cs b/Projectiles/Magic/Ancient2.cs index babb17455b..4208424d1d 100644 --- a/Projectiles/Magic/Ancient2.cs +++ b/Projectiles/Magic/Ancient2.cs @@ -51,8 +51,8 @@ namespace CalamityMod.Projectiles.Magic int num297 = 32; for (int num298 = 0; num298 < 2; num298++) { - int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1f); - if (Main.rand.Next(2) == 0) + int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); + if (Main.rand.NextBool(2)) { Main.dust[num299].noGravity = true; Main.dust[num299].scale *= 1.5f; @@ -69,8 +69,8 @@ namespace CalamityMod.Projectiles.Magic } for (int num298 = 0; num298 < 2; num298++) { - int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1f); - if (Main.rand.Next(3) == 0) + int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); + if (Main.rand.NextBool(3)) { Main.dust[num299].noGravity = true; Main.dust[num299].scale *= 3f; diff --git a/Projectiles/Magic/ApothChloro.cs b/Projectiles/Magic/ApothChloro.cs index 805a6a2e17..a56beff0d6 100644 --- a/Projectiles/Magic/ApothChloro.cs +++ b/Projectiles/Magic/ApothChloro.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Magic Lighting.AddLight(projectile.Center, 0.4f, 0.2f, 0.4f); for (int i = 0; i < 5; i++) { - Dust dust4 = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 242, projectile.velocity.X, projectile.velocity.Y, 100, default(Color), 1f)]; + Dust dust4 = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 242, projectile.velocity.X, projectile.velocity.Y, 100, default, 1f)]; dust4.velocity = Vector2.Zero; dust4.position -= projectile.velocity / 5f * (float)i; dust4.noGravity = true; diff --git a/Projectiles/Magic/ApothJaws.cs b/Projectiles/Magic/ApothJaws.cs index 6edc38888a..c5050f5cdf 100644 --- a/Projectiles/Magic/ApothJaws.cs +++ b/Projectiles/Magic/ApothJaws.cs @@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Magic target.AddBuff(mod.BuffType("GodSlayerInferno"), 600, true); target.AddBuff(mod.BuffType("DemonFlames"), 600, true); target.AddBuff(mod.BuffType("ArmorCrunch"), 600, true); - if (Main.rand.Next(30) == 0) + if (Main.rand.NextBool(30)) { target.AddBuff(mod.BuffType("ExoFreeze"), 120, true); } diff --git a/Projectiles/Magic/ApothMark.cs b/Projectiles/Magic/ApothMark.cs index 95df92171f..9fd0810adf 100644 --- a/Projectiles/Magic/ApothMark.cs +++ b/Projectiles/Magic/ApothMark.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Magic target.AddBuff(mod.BuffType("GodSlayerInferno"), 600, true); target.AddBuff(mod.BuffType("DemonFlames"), 600, true); target.AddBuff(mod.BuffType("ArmorCrunch"), 600, true); - if (Main.rand.Next(30) == 0) + if (Main.rand.NextBool(30)) { target.AddBuff(mod.BuffType("ExoFreeze"), 120, true); } diff --git a/Projectiles/Magic/Asteroid.cs b/Projectiles/Magic/Asteroid.cs index fb67069be7..f624518866 100644 --- a/Projectiles/Magic/Asteroid.cs +++ b/Projectiles/Magic/Asteroid.cs @@ -38,21 +38,21 @@ namespace CalamityMod.Projectiles.Magic projectile.scale = projectile.ai[1]; projectile.rotation += projectile.velocity.X * 2f; Vector2 position = projectile.Center + Vector2.Normalize(projectile.velocity) * 10f; - Dust dust20 = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 107, 0f, 0f, 0, default(Color), 1f)]; + Dust dust20 = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 107, 0f, 0f, 0, default, 1f)]; dust20.position = position; - dust20.velocity = projectile.velocity.RotatedBy(1.5707963705062866, default(Vector2)) * 0.33f + projectile.velocity / 4f; - dust20.position += projectile.velocity.RotatedBy(1.5707963705062866, default(Vector2)); + dust20.velocity = projectile.velocity.RotatedBy(1.5707963705062866, default) * 0.33f + projectile.velocity / 4f; + dust20.position += projectile.velocity.RotatedBy(1.5707963705062866, default); dust20.fadeIn = 0.5f; dust20.noGravity = true; - dust20 = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 107, 0f, 0f, 0, default(Color), 1f)]; + dust20 = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 107, 0f, 0f, 0, default, 1f)]; dust20.position = position; - dust20.velocity = projectile.velocity.RotatedBy(-1.5707963705062866, default(Vector2)) * 0.33f + projectile.velocity / 4f; - dust20.position += projectile.velocity.RotatedBy(-1.5707963705062866, default(Vector2)); + dust20.velocity = projectile.velocity.RotatedBy(-1.5707963705062866, default) * 0.33f + projectile.velocity / 4f; + dust20.position += projectile.velocity.RotatedBy(-1.5707963705062866, default); dust20.fadeIn = 0.5f; dust20.noGravity = true; for (int num189 = 0; num189 < 1; num189++) { - int num190 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 0, default(Color), 1f); + int num190 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 0, default, 1f); Main.dust[num190].velocity *= 0.5f; Main.dust[num190].scale *= 1.3f; Main.dust[num190].fadeIn = 1f; @@ -71,20 +71,20 @@ namespace CalamityMod.Projectiles.Magic projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num336 = 0; num336 < 4; num336++) { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 1.5f); + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 1.5f); } for (int num337 = 0; num337 < 16; num337++) { - int num338 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, default(Color), 2.5f); + int num338 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, default, 2.5f); Main.dust[num338].noGravity = true; Main.dust[num338].velocity *= 3f; - num338 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, default(Color), 1.5f); + num338 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, default, 1.5f); Main.dust[num338].velocity *= 2f; Main.dust[num338].noGravity = true; } for (int num339 = 0; num339 < 2; num339++) { - int num340 = Gore.NewGore(projectile.position + new Vector2((float)(projectile.width * Main.rand.Next(100)) / 100f, (float)(projectile.height * Main.rand.Next(100)) / 100f) - Vector2.One * 10f, default(Vector2), Main.rand.Next(61, 64), 1f); + int num340 = Gore.NewGore(projectile.position + new Vector2((float)(projectile.width * Main.rand.Next(100)) / 100f, (float)(projectile.height * Main.rand.Next(100)) / 100f) - Vector2.One * 10f, default, Main.rand.Next(61, 64), 1f); Main.gore[num340].velocity *= 0.3f; Gore expr_B4D2_cp_0 = Main.gore[num340]; expr_B4D2_cp_0.velocity.X = expr_B4D2_cp_0.velocity.X + (float)Main.rand.Next(-10, 11) * 0.05f; @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Magic 259, 158 }); - int num343 = Dust.NewDust(projectile.position, projectile.width, projectile.height, num342, 2.5f * (float)projectile.direction, -2.5f, 0, default(Color), 1f); + int num343 = Dust.NewDust(projectile.position, projectile.width, projectile.height, num342, 2.5f * (float)projectile.direction, -2.5f, 0, default, 1f); Main.dust[num343].alpha = 200; Main.dust[num343].velocity *= 2.4f; Main.dust[num343].scale += Main.rand.NextFloat(); diff --git a/Projectiles/Magic/AsteroidMolten.cs b/Projectiles/Magic/AsteroidMolten.cs index f48704fd7b..874590a686 100644 --- a/Projectiles/Magic/AsteroidMolten.cs +++ b/Projectiles/Magic/AsteroidMolten.cs @@ -40,14 +40,14 @@ namespace CalamityMod.Projectiles.Magic Vector2 position = projectile.Center + Vector2.Normalize(projectile.velocity) * 10f; Dust dust20 = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 0, new Color(255, Main.DiscoG, 0), 1f)]; dust20.position = position; - dust20.velocity = projectile.velocity.RotatedBy(1.5707963705062866, default(Vector2)) * 0.33f + projectile.velocity / 4f; - dust20.position += projectile.velocity.RotatedBy(1.5707963705062866, default(Vector2)); + dust20.velocity = projectile.velocity.RotatedBy(1.5707963705062866, default) * 0.33f + projectile.velocity / 4f; + dust20.position += projectile.velocity.RotatedBy(1.5707963705062866, default); dust20.fadeIn = 0.5f; dust20.noGravity = true; dust20 = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 0, new Color(255, Main.DiscoG, 0), 1f)]; dust20.position = position; - dust20.velocity = projectile.velocity.RotatedBy(-1.5707963705062866, default(Vector2)) * 0.33f + projectile.velocity / 4f; - dust20.position += projectile.velocity.RotatedBy(-1.5707963705062866, default(Vector2)); + dust20.velocity = projectile.velocity.RotatedBy(-1.5707963705062866, default) * 0.33f + projectile.velocity / 4f; + dust20.position += projectile.velocity.RotatedBy(-1.5707963705062866, default); dust20.fadeIn = 0.5f; dust20.noGravity = true; for (int num189 = 0; num189 < 1; num189++) @@ -84,7 +84,7 @@ namespace CalamityMod.Projectiles.Magic } for (int num339 = 0; num339 < 2; num339++) { - int num340 = Gore.NewGore(projectile.position + new Vector2((float)(projectile.width * Main.rand.Next(100)) / 100f, (float)(projectile.height * Main.rand.Next(100)) / 100f) - Vector2.One * 10f, default(Vector2), Main.rand.Next(61, 64), 1f); + int num340 = Gore.NewGore(projectile.position + new Vector2((float)(projectile.width * Main.rand.Next(100)) / 100f, (float)(projectile.height * Main.rand.Next(100)) / 100f) - Vector2.One * 10f, default, Main.rand.Next(61, 64), 1f); Main.gore[num340].velocity *= 0.3f; Gore expr_B4D2_cp_0 = Main.gore[num340]; expr_B4D2_cp_0.velocity.X = expr_B4D2_cp_0.velocity.X + (float)Main.rand.Next(-10, 11) * 0.05f; diff --git a/Projectiles/Magic/AstralCrystal.cs b/Projectiles/Magic/AstralCrystal.cs index 474e4d35b4..71b2fc7b48 100644 --- a/Projectiles/Magic/AstralCrystal.cs +++ b/Projectiles/Magic/AstralCrystal.cs @@ -120,7 +120,7 @@ namespace CalamityMod.Projectiles.Magic d1.customData = d2.customData = 0.035f; //Astral chunk dust - if (Main.rand.Next(30) == 0) + if (Main.rand.NextBool(30)) { Dust dust = Dust.NewDustPerfect(projectile.Center, mod.DustType("AstralChunk")); dust.velocity *= 0.3f; diff --git a/Projectiles/Magic/AstralStarMagic.cs b/Projectiles/Magic/AstralStarMagic.cs index 937a8ea9c9..43b30a186f 100644 --- a/Projectiles/Magic/AstralStarMagic.cs +++ b/Projectiles/Magic/AstralStarMagic.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Magic if (projectile.soundDelay == 0) { projectile.soundDelay = 20 + Main.rand.Next(40); - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9); } @@ -57,14 +57,14 @@ namespace CalamityMod.Projectiles.Magic } projectile.localAI[0] += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.01f * (float)projectile.direction; projectile.rotation += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.01f * (float)projectile.direction; - if (Main.rand.Next(16) == 0) + if (Main.rand.NextBool(16)) { - Vector2 value3 = Vector2.UnitX.RotatedByRandom(1.5707963705062866).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)); - int num59 = Dust.NewDust(projectile.position, projectile.width, projectile.height, mod.DustType("AstralOrange"), projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default(Color), 1.2f); + Vector2 value3 = Vector2.UnitX.RotatedByRandom(1.5707963705062866).RotatedBy((double)projectile.velocity.ToRotation(), default); + int num59 = Dust.NewDust(projectile.position, projectile.width, projectile.height, mod.DustType("AstralOrange"), projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default, 1.2f); Main.dust[num59].velocity = value3 * 0.66f; Main.dust[num59].position = projectile.Center + value3 * 12f; } - if (Main.rand.Next(48) == 0) + if (Main.rand.NextBool(48)) { int num60 = Gore.NewGore(projectile.Center, new Vector2(projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f), 16, 1f); Main.gore[num60].velocity *= 0.66f; @@ -73,11 +73,11 @@ namespace CalamityMod.Projectiles.Magic if (projectile.ai[1] == 1f) { projectile.light = 0.9f; - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { - Dust.NewDust(projectile.position, projectile.width, projectile.height, mod.DustType("AstralOrange"), projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default(Color), 1.2f); + Dust.NewDust(projectile.position, projectile.width, projectile.height, mod.DustType("AstralOrange"), projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default, 1.2f); } - if (Main.rand.Next(20) == 0) + if (Main.rand.NextBool(20)) { Gore.NewGore(projectile.position, new Vector2(projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f), Main.rand.Next(16, 18), 1f); } @@ -110,9 +110,9 @@ namespace CalamityMod.Projectiles.Magic projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 1.2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -120,10 +120,10 @@ namespace CalamityMod.Projectiles.Magic } for (int num623 = 0; num623 < 5; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 1.7f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 1.7f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 1f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } for (int num480 = 0; num480 < 3; num480++) diff --git a/Projectiles/Magic/AtlantisSpear.cs b/Projectiles/Magic/AtlantisSpear.cs index 892d0f23d4..6fb3a16911 100644 --- a/Projectiles/Magic/AtlantisSpear.cs +++ b/Projectiles/Magic/AtlantisSpear.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Magic { for (int num55 = 0; num55 < 8; num55++) { - int num56 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 206, projectile.velocity.X * 0.005f, projectile.velocity.Y * 0.005f, 200, default(Color), 1f); + int num56 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 206, projectile.velocity.X * 0.005f, projectile.velocity.Y * 0.005f, 200, default, 1f); Main.dust[num56].noGravity = true; Main.dust[num56].velocity *= 0.5f; } @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Magic projectile.Kill(); } } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 206, projectile.velocity.X * 0.005f, projectile.velocity.Y * 0.005f); } diff --git a/Projectiles/Magic/AtlantisSpear2.cs b/Projectiles/Magic/AtlantisSpear2.cs index 0864133e59..742a092117 100644 --- a/Projectiles/Magic/AtlantisSpear2.cs +++ b/Projectiles/Magic/AtlantisSpear2.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Magic { for (int num55 = 0; num55 < 8; num55++) { - int num56 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 206, projectile.velocity.X * 0.005f, projectile.velocity.Y * 0.005f, 200, default(Color), 1f); + int num56 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 206, projectile.velocity.X * 0.005f, projectile.velocity.Y * 0.005f, 200, default, 1f); Main.dust[num56].noGravity = true; Main.dust[num56].velocity *= 0.5f; } @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Magic projectile.Kill(); } } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 206, projectile.velocity.X * 0.005f, projectile.velocity.Y * 0.005f); } diff --git a/Projectiles/Magic/AuraRain.cs b/Projectiles/Magic/AuraRain.cs index dc234d2db2..776f59f09d 100644 --- a/Projectiles/Magic/AuraRain.cs +++ b/Projectiles/Magic/AuraRain.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - Dust dust4 = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 14, projectile.velocity.X, projectile.velocity.Y, 100, default(Color), 1f)]; + Dust dust4 = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 14, projectile.velocity.X, projectile.velocity.Y, 100, default, 1f)]; dust4.velocity = Vector2.Zero; dust4.position -= projectile.velocity / 5f; dust4.noGravity = true; diff --git a/Projectiles/Magic/BigBeamofDeath.cs b/Projectiles/Magic/BigBeamofDeath.cs index f439cd6845..27a759f39a 100644 --- a/Projectiles/Magic/BigBeamofDeath.cs +++ b/Projectiles/Magic/BigBeamofDeath.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Magic vector33 -= projectile.velocity * ((float)num447 * 0.25f); projectile.alpha = 255; int num249 = 206; - int num448 = Dust.NewDust(vector33, 1, 1, num249, 0f, 0f, 0, default(Color), 3f); + int num448 = Dust.NewDust(vector33, 1, 1, num249, 0f, 0f, 0, default, 3f); Main.dust[num448].position = vector33; Main.dust[num448].velocity *= 0.1f; } diff --git a/Projectiles/Magic/BigBeamofDeath2.cs b/Projectiles/Magic/BigBeamofDeath2.cs index d1302e256c..ee4eaee749 100644 --- a/Projectiles/Magic/BigBeamofDeath2.cs +++ b/Projectiles/Magic/BigBeamofDeath2.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Magic vector33 -= projectile.velocity * ((float)num447 * 0.25f); projectile.alpha = 255; int num249 = 206; - int num448 = Dust.NewDust(vector33, 1, 1, num249, 0f, 0f, 0, default(Color), 3f); + int num448 = Dust.NewDust(vector33, 1, 1, num249, 0f, 0f, 0, default, 3f); Main.dust[num448].position = vector33; Main.dust[num448].velocity *= 0.1f; } diff --git a/Projectiles/Magic/BlackAnurian.cs b/Projectiles/Magic/BlackAnurian.cs index b82c81c123..c34ca1aba0 100644 --- a/Projectiles/Magic/BlackAnurian.cs +++ b/Projectiles/Magic/BlackAnurian.cs @@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Magic int num3; for (int num246 = 0; num246 < 25; num246 = num3 + 1) { - int num247 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 14, 0f, 0f, 0, default(Color), 1f); + int num247 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 14, 0f, 0f, 0, default, 1f); Main.dust[num247].position = (Main.dust[num247].position + projectile.position) / 2f; Main.dust[num247].velocity = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); Main.dust[num247].velocity.Normalize(); diff --git a/Projectiles/Magic/BloodBeam.cs b/Projectiles/Magic/BloodBeam.cs index 85455174d3..9d79666aa3 100644 --- a/Projectiles/Magic/BloodBeam.cs +++ b/Projectiles/Magic/BloodBeam.cs @@ -43,8 +43,8 @@ namespace CalamityMod.Projectiles.Magic } projectile.ai[0] += 1f; int num297 = 5; - int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1f); - if (Main.rand.Next(3) == 0) + int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); + if (Main.rand.NextBool(3)) { Main.dust[num299].noGravity = true; Main.dust[num299].scale *= 3.5f; diff --git a/Projectiles/Magic/BloodBlast.cs b/Projectiles/Magic/BloodBlast.cs index 16cbcea54b..448c14c7d7 100644 --- a/Projectiles/Magic/BloodBlast.cs +++ b/Projectiles/Magic/BloodBlast.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Magic float num93 = projectile.velocity.X / 3f * (float)num92; float num94 = projectile.velocity.Y / 3f * (float)num92; int num95 = 4; - int num96 = Dust.NewDust(new Vector2(projectile.position.X + (float)num95, projectile.position.Y + (float)num95), projectile.width - num95 * 2, projectile.height - num95 * 2, 5, 0f, 0f, 100, default(Color), 1.2f); + int num96 = Dust.NewDust(new Vector2(projectile.position.X + (float)num95, projectile.position.Y + (float)num95), projectile.width - num95 * 2, projectile.height - num95 * 2, 5, 0f, 0f, 100, default, 1.2f); Main.dust[num96].noGravity = true; Main.dust[num96].velocity *= 0.1f; Main.dust[num96].velocity += projectile.velocity * 0.1f; @@ -42,10 +42,10 @@ namespace CalamityMod.Projectiles.Magic Dust expr_4815_cp_0 = Main.dust[num96]; expr_4815_cp_0.position.Y = expr_4815_cp_0.position.Y - num94; } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int num97 = 4; - int num98 = Dust.NewDust(new Vector2(projectile.position.X + (float)num97, projectile.position.Y + (float)num97), projectile.width - num97 * 2, projectile.height - num97 * 2, 5, 0f, 0f, 100, default(Color), 0.6f); + int num98 = Dust.NewDust(new Vector2(projectile.position.X + (float)num97, projectile.position.Y + (float)num97), projectile.width - num97 * 2, projectile.height - num97 * 2, 5, 0f, 0f, 100, default, 0.6f); Main.dust[num98].velocity *= 0.25f; Main.dust[num98].velocity += projectile.velocity * 0.5f; } diff --git a/Projectiles/Magic/BloodBolt.cs b/Projectiles/Magic/BloodBolt.cs index 2fbeeed097..ea3d382dbe 100644 --- a/Projectiles/Magic/BloodBolt.cs +++ b/Projectiles/Magic/BloodBolt.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Magic Vector2 vector33 = projectile.position; vector33 -= projectile.velocity * ((float)num447 * 0.25f); projectile.alpha = 255; - int num448 = Dust.NewDust(vector33, 1, 1, 235, 0f, 0f, 0, default(Color), 1.25f); + int num448 = Dust.NewDust(vector33, 1, 1, 235, 0f, 0f, 0, default, 1.25f); Main.dust[num448].position = vector33; Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f; Main.dust[num448].velocity *= 0.2f; diff --git a/Projectiles/Magic/BloodRay.cs b/Projectiles/Magic/BloodRay.cs index a67666a562..4449501eb1 100644 --- a/Projectiles/Magic/BloodRay.cs +++ b/Projectiles/Magic/BloodRay.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Magic Vector2 vector33 = projectile.position; vector33 -= projectile.velocity * ((float)num447 * 0.25f); projectile.alpha = 255; - int num448 = Dust.NewDust(vector33, 1, 1, 235, 0f, 0f, 0, default(Color), 1.5f); + int num448 = Dust.NewDust(vector33, 1, 1, 235, 0f, 0f, 0, default, 1.5f); Main.dust[num448].position = vector33; Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f; Main.dust[num448].velocity *= 0.2f; diff --git a/Projectiles/Magic/BlueBubble.cs b/Projectiles/Magic/BlueBubble.cs index 195f6a8d67..dd260a5900 100644 --- a/Projectiles/Magic/BlueBubble.cs +++ b/Projectiles/Magic/BlueBubble.cs @@ -98,7 +98,7 @@ namespace CalamityMod.Projectiles.Magic int num190 = Main.rand.Next(5, 9); for (int num191 = 0; num191 < num190; num191++) { - int num192 = Dust.NewDust(projectile.Center, 0, 0, 206, 0f, 0f, 100, default(Color), 1.4f); + int num192 = Dust.NewDust(projectile.Center, 0, 0, 206, 0f, 0f, 100, default, 1.4f); Main.dust[num192].velocity *= 0.8f; Main.dust[num192].position = Vector2.Lerp(Main.dust[num192].position, projectile.Center, 0.5f); Main.dust[num192].noGravity = true; diff --git a/Projectiles/Magic/BrimstoneBeam.cs b/Projectiles/Magic/BrimstoneBeam.cs index 1a11d34664..fbb234b7c5 100644 --- a/Projectiles/Magic/BrimstoneBeam.cs +++ b/Projectiles/Magic/BrimstoneBeam.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Magic vector33 -= projectile.velocity * ((float)num447 * 0.25f); projectile.alpha = 255; int num249 = 235; - int num448 = Dust.NewDust(vector33, 1, 1, num249, 0f, 0f, 0, default(Color), 1.5f); + int num448 = Dust.NewDust(vector33, 1, 1, num249, 0f, 0f, 0, default, 1.5f); Main.dust[num448].position = vector33; Main.dust[num448].velocity *= 0.1f; Main.dust[num448].noGravity = true; diff --git a/Projectiles/Magic/BrimstoneBeam2.cs b/Projectiles/Magic/BrimstoneBeam2.cs index 71a7e29302..bf3555fd88 100644 --- a/Projectiles/Magic/BrimstoneBeam2.cs +++ b/Projectiles/Magic/BrimstoneBeam2.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Magic vector33 -= projectile.velocity * ((float)num447 * 0.25f); projectile.alpha = 255; int num249 = 235; - int num448 = Dust.NewDust(vector33, 1, 1, num249, 0f, 0f, 0, default(Color), 1.5f); + int num448 = Dust.NewDust(vector33, 1, 1, num249, 0f, 0f, 0, default, 1.5f); Main.dust[num448].position = vector33; Main.dust[num448].velocity *= 0.1f; Main.dust[num448].noGravity = true; diff --git a/Projectiles/Magic/BrimstoneBeam3.cs b/Projectiles/Magic/BrimstoneBeam3.cs index 67a6bf634f..3306e8ebb5 100644 --- a/Projectiles/Magic/BrimstoneBeam3.cs +++ b/Projectiles/Magic/BrimstoneBeam3.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Magic vector33 -= projectile.velocity * ((float)num447 * 0.25f); projectile.alpha = 255; int num249 = 235; - int num448 = Dust.NewDust(vector33, 1, 1, num249, 0f, 0f, 0, default(Color), 1.5f); + int num448 = Dust.NewDust(vector33, 1, 1, num249, 0f, 0f, 0, default, 1.5f); Main.dust[num448].position = vector33; Main.dust[num448].velocity *= 0.1f; Main.dust[num448].noGravity = true; diff --git a/Projectiles/Magic/BrimstoneBeam4.cs b/Projectiles/Magic/BrimstoneBeam4.cs index ac5d18e4d5..da044dd82e 100644 --- a/Projectiles/Magic/BrimstoneBeam4.cs +++ b/Projectiles/Magic/BrimstoneBeam4.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Magic vector33 -= projectile.velocity * ((float)num447 * 0.25f); projectile.alpha = 255; int num249 = 235; - int num448 = Dust.NewDust(vector33, 1, 1, num249, 0f, 0f, 0, default(Color), 1.5f); + int num448 = Dust.NewDust(vector33, 1, 1, num249, 0f, 0f, 0, default, 1.5f); Main.dust[num448].position = vector33; Main.dust[num448].velocity *= 0.1f; Main.dust[num448].noGravity = true; diff --git a/Projectiles/Magic/BrimstoneBeam5.cs b/Projectiles/Magic/BrimstoneBeam5.cs index e2c7dc814d..e5c228c7a0 100644 --- a/Projectiles/Magic/BrimstoneBeam5.cs +++ b/Projectiles/Magic/BrimstoneBeam5.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Magic vector33 -= projectile.velocity * ((float)num447 * 0.25f); projectile.alpha = 255; int num249 = 235; - int num448 = Dust.NewDust(vector33, 1, 1, num249, 0f, 0f, 0, default(Color), 1.5f); + int num448 = Dust.NewDust(vector33, 1, 1, num249, 0f, 0f, 0, default, 1.5f); Main.dust[num448].position = vector33; Main.dust[num448].velocity *= 0.1f; Main.dust[num448].noGravity = true; diff --git a/Projectiles/Magic/BrimstoneFireball.cs b/Projectiles/Magic/BrimstoneFireball.cs index 4fe45472c8..c1495c1f37 100644 --- a/Projectiles/Magic/BrimstoneFireball.cs +++ b/Projectiles/Magic/BrimstoneFireball.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Magic { for (int num468 = 0; num468 < 5; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default(Color), 2f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default, 2f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Magic/BrimstoneHellfireballFriendly.cs b/Projectiles/Magic/BrimstoneHellfireballFriendly.cs index 1f878f895b..2f596befe5 100644 --- a/Projectiles/Magic/BrimstoneHellfireballFriendly.cs +++ b/Projectiles/Magic/BrimstoneHellfireballFriendly.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Magic } for (int num457 = 0; num457 < 3; num457++) { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default(Color), 1.5f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default, 1.5f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; diff --git a/Projectiles/Magic/BrimstoneHellfireballFriendly2.cs b/Projectiles/Magic/BrimstoneHellfireballFriendly2.cs index 6c81abcaa3..906c3b3e17 100644 --- a/Projectiles/Magic/BrimstoneHellfireballFriendly2.cs +++ b/Projectiles/Magic/BrimstoneHellfireballFriendly2.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Magic } for (int num457 = 0; num457 < 5; num457++) { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default(Color), 0.6f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default, 0.6f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; diff --git a/Projectiles/Magic/BrimstoneHomer.cs b/Projectiles/Magic/BrimstoneHomer.cs index 52d233565e..7fbb7b4129 100644 --- a/Projectiles/Magic/BrimstoneHomer.cs +++ b/Projectiles/Magic/BrimstoneHomer.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Magic { for (int num468 = 0; num468 < 2; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default(Color), 1f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default, 1f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Magic/BrimstoneTentacle.cs b/Projectiles/Magic/BrimstoneTentacle.cs index 08c011bf34..ce073e2f85 100644 --- a/Projectiles/Magic/BrimstoneTentacle.cs +++ b/Projectiles/Magic/BrimstoneTentacle.cs @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Magic int num897 = 0; while ((float)num897 < projectile.scale * 10f) { - int num898 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, projectile.velocity.X, projectile.velocity.Y, 100, default(Color), 1.5f); + int num898 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, projectile.velocity.X, projectile.velocity.Y, 100, default, 1.5f); Main.dust[num898].position = (Main.dust[num898].position + projectile.Center) / 2f; Main.dust[num898].noGravity = true; Main.dust[num898].velocity *= 0.1f; diff --git a/Projectiles/Magic/ClimaxBeam.cs b/Projectiles/Magic/ClimaxBeam.cs index 7dd702b70d..e5cbdfc14a 100644 --- a/Projectiles/Magic/ClimaxBeam.cs +++ b/Projectiles/Magic/ClimaxBeam.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Magic Vector2 vector33 = projectile.position; vector33 -= projectile.velocity * ((float)num447 * 0.25f); projectile.alpha = 255; - int num448 = Dust.NewDust(vector33, 1, 1, 206, 0f, 0f, 0, default(Color), 1.25f); + int num448 = Dust.NewDust(vector33, 1, 1, 206, 0f, 0f, 0, default, 1.25f); Main.dust[num448].position = vector33; Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f; Main.dust[num448].velocity *= 0.2f; diff --git a/Projectiles/Magic/CosmicTentacle.cs b/Projectiles/Magic/CosmicTentacle.cs index d0ed2ce699..5d585dcfc5 100644 --- a/Projectiles/Magic/CosmicTentacle.cs +++ b/Projectiles/Magic/CosmicTentacle.cs @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Magic int num897 = 0; while ((float)num897 < projectile.scale * 10f) { - int num898 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 58, projectile.velocity.X, projectile.velocity.Y, 100, default(Color), 1.1f); + int num898 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 58, projectile.velocity.X, projectile.velocity.Y, 100, default, 1.1f); Main.dust[num898].position = (Main.dust[num898].position + projectile.Center) / 2f; Main.dust[num898].noGravity = true; Main.dust[num898].velocity *= 0.1f; diff --git a/Projectiles/Magic/CryoBlast.cs b/Projectiles/Magic/CryoBlast.cs index 30d9be421f..ff098a4a35 100644 --- a/Projectiles/Magic/CryoBlast.cs +++ b/Projectiles/Magic/CryoBlast.cs @@ -38,10 +38,10 @@ namespace CalamityMod.Projectiles.Magic { for (int num468 = 0; num468 < 3; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 66, 0f, 0f, 100, default(Color), projectile.scale); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 66, 0f, 0f, 100, default, projectile.scale); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; - int num470 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 185, 0f, 0f, 100, default(Color), projectile.scale); + int num470 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 185, 0f, 0f, 100, default, projectile.scale); Main.dust[num470].noGravity = true; Main.dust[num470].velocity *= 0f; } diff --git a/Projectiles/Magic/DemonicPitchfork.cs b/Projectiles/Magic/DemonicPitchfork.cs index f3d8d8bb17..074b2607d7 100644 --- a/Projectiles/Magic/DemonicPitchfork.cs +++ b/Projectiles/Magic/DemonicPitchfork.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Magic { num307 = 173; } - int num308 = Dust.NewDust(new Vector2(projectile.position.X - projectile.velocity.X * 4f + 2f, projectile.position.Y + 2f - projectile.velocity.Y * 4f), 8, 8, num307, 0f, 0f, 100, default(Color), 1.25f); + int num308 = Dust.NewDust(new Vector2(projectile.position.X - projectile.velocity.X * 4f + 2f, projectile.position.Y + 2f - projectile.velocity.Y * 4f), 8, 8, num307, 0f, 0f, 100, default, 1.25f); Main.dust[num308].velocity *= 0.1f; } } diff --git a/Projectiles/Magic/DustProjectile.cs b/Projectiles/Magic/DustProjectile.cs index 683003549f..daaa1790f3 100644 --- a/Projectiles/Magic/DustProjectile.cs +++ b/Projectiles/Magic/DustProjectile.cs @@ -50,8 +50,8 @@ namespace CalamityMod.Projectiles.Magic int num297 = 32; for (int num298 = 0; num298 < 2; num298++) { - int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1f); - if (Main.rand.Next(3) == 0) + int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); + if (Main.rand.NextBool(3)) { Main.dust[num299].noGravity = true; Main.dust[num299].scale *= 4f; @@ -72,8 +72,8 @@ namespace CalamityMod.Projectiles.Magic } for (int num298 = 0; num298 < 2; num298++) { - int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1f); - if (Main.rand.Next(3) == 0) + int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); + if (Main.rand.NextBool(3)) { Main.dust[num299].noGravity = true; Main.dust[num299].scale *= 5f; diff --git a/Projectiles/Magic/EldritchTentacle.cs b/Projectiles/Magic/EldritchTentacle.cs index d830b9323d..fbdf16b818 100644 --- a/Projectiles/Magic/EldritchTentacle.cs +++ b/Projectiles/Magic/EldritchTentacle.cs @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Magic int num897 = 0; while ((float)num897 < projectile.scale * 10f) { - int num898 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, projectile.velocity.X, projectile.velocity.Y, 100, default(Color), 1.1f); + int num898 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, projectile.velocity.X, projectile.velocity.Y, 100, default, 1.1f); Main.dust[num898].position = (Main.dust[num898].position + projectile.Center) / 2f; Main.dust[num898].noGravity = true; Main.dust[num898].velocity *= 0.1f; diff --git a/Projectiles/Magic/EvergladeSprayProjectile.cs b/Projectiles/Magic/EvergladeSprayProjectile.cs index 99abe29514..b518becd1a 100644 --- a/Projectiles/Magic/EvergladeSprayProjectile.cs +++ b/Projectiles/Magic/EvergladeSprayProjectile.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Magic float num152 = projectile.velocity.X / 3f * (float)num151; float num153 = projectile.velocity.Y / 3f * (float)num151; int num154 = 14; - int num155 = Dust.NewDust(new Vector2(projectile.position.X + (float)num154, projectile.position.Y + (float)num154), projectile.width - num154 * 2, projectile.height - num154 * 2, 157, 0f, 0f, 100, default(Color), 1f); + int num155 = Dust.NewDust(new Vector2(projectile.position.X + (float)num154, projectile.position.Y + (float)num154), projectile.width - num154 * 2, projectile.height - num154 * 2, 157, 0f, 0f, 100, default, 1f); Main.dust[num155].noGravity = true; Main.dust[num155].velocity *= 0.1f; Main.dust[num155].velocity += projectile.velocity * 0.5f; @@ -52,10 +52,10 @@ namespace CalamityMod.Projectiles.Magic Dust expr_6A1F_cp_0 = Main.dust[num155]; expr_6A1F_cp_0.position.Y = expr_6A1F_cp_0.position.Y - num153; } - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { int num156 = 16; - int num157 = Dust.NewDust(new Vector2(projectile.position.X + (float)num156, projectile.position.Y + (float)num156), projectile.width - num156 * 2, projectile.height - num156 * 2, 157, 0f, 0f, 100, default(Color), 0.5f); + int num157 = Dust.NewDust(new Vector2(projectile.position.X + (float)num156, projectile.position.Y + (float)num156), projectile.width - num156 * 2, projectile.height - num156 * 2, 157, 0f, 0f, 100, default, 0.5f); Main.dust[num157].velocity *= 0.25f; Main.dust[num157].velocity += projectile.velocity * 0.5f; } diff --git a/Projectiles/Magic/FabBolt.cs b/Projectiles/Magic/FabBolt.cs index f2abceef4d..9f21dec669 100644 --- a/Projectiles/Magic/FabBolt.cs +++ b/Projectiles/Magic/FabBolt.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Magic Vector2 vector33 = projectile.position; vector33 -= projectile.velocity * ((float)num447 * 0.25f); projectile.alpha = 255; - int num448 = Dust.NewDust(vector33, 1, 1, 234, 0f, 0f, 0, default(Color), 1.25f); + int num448 = Dust.NewDust(vector33, 1, 1, 234, 0f, 0f, 0, default, 1.25f); Main.dust[num448].noGravity = true; Main.dust[num448].position = vector33; Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f; diff --git a/Projectiles/Magic/FabRay.cs b/Projectiles/Magic/FabRay.cs index 8460143195..8ef4e35a62 100644 --- a/Projectiles/Magic/FabRay.cs +++ b/Projectiles/Magic/FabRay.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Magic Vector2 vector33 = projectile.position; vector33 -= projectile.velocity * ((float)num447 * 0.25f); projectile.alpha = 255; - int num448 = Dust.NewDust(vector33, 1, 1, 234, 0f, 0f, 0, default(Color), 1.25f); + int num448 = Dust.NewDust(vector33, 1, 1, 234, 0f, 0f, 0, default, 1.25f); Main.dust[num448].noGravity = true; Main.dust[num448].position = vector33; Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f; diff --git a/Projectiles/Magic/FatesReveal.cs b/Projectiles/Magic/FatesReveal.cs index aff5937d9c..cd3c6591d7 100644 --- a/Projectiles/Magic/FatesReveal.cs +++ b/Projectiles/Magic/FatesReveal.cs @@ -74,8 +74,8 @@ namespace CalamityMod.Projectiles.Magic { return; } - Dust dust13 = Main.dust[Dust.NewDust(projectile.Center, 0, 0, 60, 0f, -2f, 0, default(Color), 1f)]; - dust13.position = projectile.Center + Vector2.UnitY.RotatedBy((double)(num953 * 6.28318548f / 3f + projectile.ai[1]), default(Vector2)) * 10f; + Dust dust13 = Main.dust[Dust.NewDust(projectile.Center, 0, 0, 60, 0f, -2f, 0, default, 1f)]; + dust13.position = projectile.Center + Vector2.UnitY.RotatedBy((double)(num953 * 6.28318548f / 3f + projectile.ai[1]), default) * 10f; dust13.noGravity = true; dust13.velocity = projectile.DirectionFrom(dust13.position); dust13.scale = num951; @@ -91,7 +91,7 @@ namespace CalamityMod.Projectiles.Magic projectile.damage = 800; for (int num955 = 0; num955 < 10; num955 = num3 + 1) { - Dust dust13 = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 60, 0f, -2f, 0, default(Color), 1f)]; + Dust dust13 = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 60, 0f, -2f, 0, default, 1f)]; dust13.noGravity = true; if (dust13.position != projectile.Center) { @@ -142,13 +142,13 @@ namespace CalamityMod.Projectiles.Magic int num3; for (int num122 = 0; num122 < 3; num122 = num3 + 1) { - int num123 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default(Color), 1.5f); + int num123 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default, 1.5f); Main.dust[num123].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; num3 = num122; } for (int num124 = 0; num124 < 10; num124 = num3 + 1) { - int num125 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 0, default(Color), 2.5f); + int num125 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 0, default, 2.5f); Main.dust[num125].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; Main.dust[num125].noGravity = true; Dust dust = Main.dust[num125]; @@ -157,8 +157,8 @@ namespace CalamityMod.Projectiles.Magic } for (int num126 = 0; num126 < 5; num126 = num3 + 1) { - int num127 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 0, default(Color), 1.5f); - Main.dust[num127].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)) * (float)projectile.width / 2f; + int num127 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 0, default, 1.5f); + Main.dust[num127].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default) * (float)projectile.width / 2f; Main.dust[num127].noGravity = true; Dust dust = Main.dust[num127]; dust.velocity *= 2f; diff --git a/Projectiles/Magic/FlameBeamTip.cs b/Projectiles/Magic/FlameBeamTip.cs index 46dd15c07b..0a19ae665f 100644 --- a/Projectiles/Magic/FlameBeamTip.cs +++ b/Projectiles/Magic/FlameBeamTip.cs @@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Magic { for (int num55 = 0; num55 < 10; num55++) { - int num56 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 60, projectile.velocity.X * 0.01f, projectile.velocity.Y * 0.01f, 200, default(Color), 2f); + int num56 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 60, projectile.velocity.X * 0.01f, projectile.velocity.Y * 0.01f, 200, default, 2f); Main.dust[num56].noGravity = true; } } diff --git a/Projectiles/Magic/FlameBeamTip2.cs b/Projectiles/Magic/FlameBeamTip2.cs index 9e5f2f04d5..8167c20b1e 100644 --- a/Projectiles/Magic/FlameBeamTip2.cs +++ b/Projectiles/Magic/FlameBeamTip2.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Magic { for (int num55 = 0; num55 < 10; num55++) { - int num56 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 60, projectile.velocity.X * 0.01f, projectile.velocity.Y * 0.01f, 200, default(Color), 2f); + int num56 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 60, projectile.velocity.X * 0.01f, projectile.velocity.Y * 0.01f, 200, default, 2f); Main.dust[num56].noGravity = true; } } diff --git a/Projectiles/Magic/FlamePillar.cs b/Projectiles/Magic/FlamePillar.cs index f57596d3e7..c49f495a7d 100644 --- a/Projectiles/Magic/FlamePillar.cs +++ b/Projectiles/Magic/FlamePillar.cs @@ -49,12 +49,12 @@ namespace CalamityMod.Projectiles.Magic } projectile.ai[0] += 1f; int num297 = 127; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { for (int num298 = 0; num298 < 1; num298++) { - int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1f); - if (Main.rand.Next(3) == 0) + int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); + if (Main.rand.NextBool(3)) { Main.dust[num299].noGravity = true; Main.dust[num299].scale *= 3f; diff --git a/Projectiles/Magic/FlamingPumpkin.cs b/Projectiles/Magic/FlamingPumpkin.cs index d5e93fc3a6..695d59e94d 100644 --- a/Projectiles/Magic/FlamingPumpkin.cs +++ b/Projectiles/Magic/FlamingPumpkin.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 64, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Magic/FlareBoltProjectile.cs b/Projectiles/Magic/FlareBoltProjectile.cs index 0938f50be4..942eb54a01 100644 --- a/Projectiles/Magic/FlareBoltProjectile.cs +++ b/Projectiles/Magic/FlareBoltProjectile.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Magic float num93 = projectile.velocity.X / 3f * (float)num92; float num94 = projectile.velocity.Y / 3f * (float)num92; int num95 = 4; - int num96 = Dust.NewDust(new Vector2(projectile.position.X + (float)num95, projectile.position.Y + (float)num95), projectile.width - num95 * 2, projectile.height - num95 * 2, 174, 0f, 0f, 100, default(Color), 1.2f); + int num96 = Dust.NewDust(new Vector2(projectile.position.X + (float)num95, projectile.position.Y + (float)num95), projectile.width - num95 * 2, projectile.height - num95 * 2, 174, 0f, 0f, 100, default, 1.2f); Main.dust[num96].noGravity = true; Main.dust[num96].velocity *= 0.1f; Main.dust[num96].velocity += projectile.velocity * 0.1f; @@ -40,10 +40,10 @@ namespace CalamityMod.Projectiles.Magic Dust expr_4815_cp_0 = Main.dust[num96]; expr_4815_cp_0.position.Y = expr_4815_cp_0.position.Y - num94; } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int num97 = 4; - int num98 = Dust.NewDust(new Vector2(projectile.position.X + (float)num97, projectile.position.Y + (float)num97), projectile.width - num97 * 2, projectile.height - num97 * 2, 174, 0f, 0f, 100, default(Color), 0.6f); + int num98 = Dust.NewDust(new Vector2(projectile.position.X + (float)num97, projectile.position.Y + (float)num97), projectile.width - num97 * 2, projectile.height - num97 * 2, 174, 0f, 0f, 100, default, 0.6f); Main.dust[num98].velocity *= 0.25f; Main.dust[num98].velocity += projectile.velocity * 0.5f; } diff --git a/Projectiles/Magic/ForbiddenAxeBlade.cs b/Projectiles/Magic/ForbiddenAxeBlade.cs index 0246fb1d10..ef7c4101fa 100644 --- a/Projectiles/Magic/ForbiddenAxeBlade.cs +++ b/Projectiles/Magic/ForbiddenAxeBlade.cs @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Magic { projectile.ai[1] = 0f; } - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 159, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f); } diff --git a/Projectiles/Magic/ForbiddenSunProjectile.cs b/Projectiles/Magic/ForbiddenSunProjectile.cs index f2250d9074..516e360a92 100644 --- a/Projectiles/Magic/ForbiddenSunProjectile.cs +++ b/Projectiles/Magic/ForbiddenSunProjectile.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Magic } for (int num457 = 0; num457 < 5; num457++) { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 55, 0f, 0f, 100, default(Color), 1.2f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 55, 0f, 0f, 100, default, 1.2f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; diff --git a/Projectiles/Magic/ForbiddenSunburst.cs b/Projectiles/Magic/ForbiddenSunburst.cs index 272a058dc8..98371bc0ff 100644 --- a/Projectiles/Magic/ForbiddenSunburst.cs +++ b/Projectiles/Magic/ForbiddenSunburst.cs @@ -81,7 +81,7 @@ namespace CalamityMod.Projectiles.Magic num466 = num465 / num466; num463 *= num466; num464 *= num466; - int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 55, 0f, 0f, 100, default(Color), 2.5f); + int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 55, 0f, 0f, 100, default, 2.5f); Main.dust[num467].noGravity = true; Main.dust[num467].position.X = projectile.Center.X; Main.dust[num467].position.Y = projectile.Center.Y; diff --git a/Projectiles/Magic/FrigidflashBoltProjectile.cs b/Projectiles/Magic/FrigidflashBoltProjectile.cs index 1e080059c0..68535f304e 100644 --- a/Projectiles/Magic/FrigidflashBoltProjectile.cs +++ b/Projectiles/Magic/FrigidflashBoltProjectile.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Magic float num93 = projectile.velocity.X / 3f * (float)num92; float num94 = projectile.velocity.Y / 3f * (float)num92; int num95 = 4; - int num96 = Dust.NewDust(new Vector2(projectile.position.X + (float)num95, projectile.position.Y + (float)num95), projectile.width - num95 * 2, projectile.height - num95 * 2, 174, 0f, 0f, 100, default(Color), 1.2f); + int num96 = Dust.NewDust(new Vector2(projectile.position.X + (float)num95, projectile.position.Y + (float)num95), projectile.width - num95 * 2, projectile.height - num95 * 2, 174, 0f, 0f, 100, default, 1.2f); Main.dust[num96].noGravity = true; Main.dust[num96].velocity *= 0.1f; Main.dust[num96].velocity += projectile.velocity * 0.1f; @@ -41,10 +41,10 @@ namespace CalamityMod.Projectiles.Magic Dust expr_4815_cp_0 = Main.dust[num96]; expr_4815_cp_0.position.Y = expr_4815_cp_0.position.Y - num94; } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int num97 = 4; - int num98 = Dust.NewDust(new Vector2(projectile.position.X + (float)num97, projectile.position.Y + (float)num97), projectile.width - num97 * 2, projectile.height - num97 * 2, 174, 0f, 0f, 100, default(Color), 0.6f); + int num98 = Dust.NewDust(new Vector2(projectile.position.X + (float)num97, projectile.position.Y + (float)num97), projectile.width - num97 * 2, projectile.height - num97 * 2, 174, 0f, 0f, 100, default, 0.6f); Main.dust[num98].velocity *= 0.25f; Main.dust[num98].velocity += projectile.velocity * 0.5f; } @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Magic float num99 = projectile.velocity.X / 3f * (float)num105; float num100 = projectile.velocity.Y / 3f * (float)num105; int num101 = 4; - int num102 = Dust.NewDust(new Vector2(projectile.position.X + (float)num101, projectile.position.Y + (float)num101), projectile.width - num101 * 2, projectile.height - num101 * 2, 92, 0f, 0f, 100, default(Color), 1.2f); + int num102 = Dust.NewDust(new Vector2(projectile.position.X + (float)num101, projectile.position.Y + (float)num101), projectile.width - num101 * 2, projectile.height - num101 * 2, 92, 0f, 0f, 100, default, 1.2f); Main.dust[num102].noGravity = true; Main.dust[num102].velocity *= 0.1f; Main.dust[num102].velocity += projectile.velocity * 0.1f; @@ -62,10 +62,10 @@ namespace CalamityMod.Projectiles.Magic Dust expr_4815_cp_0 = Main.dust[num102]; expr_4815_cp_0.position.Y = expr_4815_cp_0.position.Y - num100; } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int num103 = 4; - int num104 = Dust.NewDust(new Vector2(projectile.position.X + (float)num103, projectile.position.Y + (float)num103), projectile.width - num103 * 2, projectile.height - num103 * 2, 92, 0f, 0f, 100, default(Color), 0.6f); + int num104 = Dust.NewDust(new Vector2(projectile.position.X + (float)num103, projectile.position.Y + (float)num103), projectile.width - num103 * 2, projectile.height - num103 * 2, 92, 0f, 0f, 100, default, 0.6f); Main.dust[num104].velocity *= 0.25f; Main.dust[num104].velocity += projectile.velocity * 0.5f; } diff --git a/Projectiles/Magic/FrostBoltProjectile.cs b/Projectiles/Magic/FrostBoltProjectile.cs index 6aa5ecb99e..05af1c3a78 100644 --- a/Projectiles/Magic/FrostBoltProjectile.cs +++ b/Projectiles/Magic/FrostBoltProjectile.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Magic float num99 = projectile.velocity.X / 3f * (float)num105; float num100 = projectile.velocity.Y / 3f * (float)num105; int num101 = 4; - int num102 = Dust.NewDust(new Vector2(projectile.position.X + (float)num101, projectile.position.Y + (float)num101), projectile.width - num101 * 2, projectile.height - num101 * 2, 92, 0f, 0f, 100, default(Color), 1.2f); + int num102 = Dust.NewDust(new Vector2(projectile.position.X + (float)num101, projectile.position.Y + (float)num101), projectile.width - num101 * 2, projectile.height - num101 * 2, 92, 0f, 0f, 100, default, 1.2f); Main.dust[num102].noGravity = true; Main.dust[num102].velocity *= 0.1f; Main.dust[num102].velocity += projectile.velocity * 0.1f; @@ -40,10 +40,10 @@ namespace CalamityMod.Projectiles.Magic Dust expr_4815_cp_0 = Main.dust[num102]; expr_4815_cp_0.position.Y = expr_4815_cp_0.position.Y - num100; } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int num103 = 4; - int num104 = Dust.NewDust(new Vector2(projectile.position.X + (float)num103, projectile.position.Y + (float)num103), projectile.width - num103 * 2, projectile.height - num103 * 2, 92, 0f, 0f, 100, default(Color), 0.6f); + int num104 = Dust.NewDust(new Vector2(projectile.position.X + (float)num103, projectile.position.Y + (float)num103), projectile.width - num103 * 2, projectile.height - num103 * 2, 92, 0f, 0f, 100, default, 0.6f); Main.dust[num104].velocity *= 0.25f; Main.dust[num104].velocity += projectile.velocity * 0.5f; } diff --git a/Projectiles/Magic/GammaLaser.cs b/Projectiles/Magic/GammaLaser.cs index 5716de822e..ed8851df0a 100644 --- a/Projectiles/Magic/GammaLaser.cs +++ b/Projectiles/Magic/GammaLaser.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Magic { Lighting.AddLight(projectile.Center, 0.1f, 0.35f, 0f); projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) - 1.57f; - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 74, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f); } diff --git a/Projectiles/Magic/GhastlyBlast.cs b/Projectiles/Magic/GhastlyBlast.cs index d9922931f9..3e67b1870b 100644 --- a/Projectiles/Magic/GhastlyBlast.cs +++ b/Projectiles/Magic/GhastlyBlast.cs @@ -50,15 +50,15 @@ namespace CalamityMod.Projectiles.Magic if (num1013 == 0) { projectile.rotation -= 0.104719758f; - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Vector2 vector140 = Vector2.UnitY.RotatedByRandom(6.2831854820251465); - Dust dust28 = Main.dust[Dust.NewDust(projectile.Center - vector140 * 30f, 0, 0, 60, 0f, 0f, 0, default(Color), 1f)]; + Dust dust28 = Main.dust[Dust.NewDust(projectile.Center - vector140 * 30f, 0, 0, 60, 0f, 0f, 0, default, 1f)]; dust28.noGravity = true; dust28.position = projectile.Center - vector140 * (float)Main.rand.Next(10, 21); - dust28.velocity = vector140.RotatedBy(1.5707963705062866, default(Vector2)) * 6f; + dust28.velocity = vector140.RotatedBy(1.5707963705062866, default) * 6f; dust28.scale = 0.5f + Main.rand.NextFloat(); dust28.fadeIn = 0.5f; dust28.customData = projectile; @@ -66,10 +66,10 @@ namespace CalamityMod.Projectiles.Magic else { Vector2 vector141 = Vector2.UnitY.RotatedByRandom(6.2831854820251465); - Dust dust29 = Main.dust[Dust.NewDust(projectile.Center - vector141 * 30f, 0, 0, 60, 0f, 0f, 0, default(Color), 1f)]; + Dust dust29 = Main.dust[Dust.NewDust(projectile.Center - vector141 * 30f, 0, 0, 60, 0f, 0f, 0, default, 1f)]; dust29.noGravity = true; dust29.position = projectile.Center - vector141 * 30f; - dust29.velocity = vector141.RotatedBy(-1.5707963705062866, default(Vector2)) * 3f; + dust29.velocity = vector141.RotatedBy(-1.5707963705062866, default) * 3f; dust29.scale = 0.5f + Main.rand.NextFloat(); dust29.fadeIn = 0.5f; dust29.customData = projectile; @@ -98,21 +98,21 @@ namespace CalamityMod.Projectiles.Magic int num3; for (int num1014 = 0; num1014 < 1; num1014 = num3 + 1) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Vector2 vector142 = Vector2.UnitY.RotatedByRandom(6.2831854820251465); - Dust dust30 = Main.dust[Dust.NewDust(projectile.Center - vector142 * 30f, 0, 0, 60, 0f, 0f, 0, default(Color), 1f)]; + Dust dust30 = Main.dust[Dust.NewDust(projectile.Center - vector142 * 30f, 0, 0, 60, 0f, 0f, 0, default, 1f)]; dust30.noGravity = true; dust30.position = projectile.Center - vector142 * (float)Main.rand.Next(10, 21); - dust30.velocity = vector142.RotatedBy(1.5707963705062866, default(Vector2)) * 6f; + dust30.velocity = vector142.RotatedBy(1.5707963705062866, default) * 6f; dust30.scale = 0.9f + Main.rand.NextFloat(); dust30.fadeIn = 0.5f; dust30.customData = projectile; vector142 = Vector2.UnitY.RotatedByRandom(6.2831854820251465); - dust30 = Main.dust[Dust.NewDust(projectile.Center - vector142 * 30f, 0, 0, 60, 0f, 0f, 0, default(Color), 1f)]; + dust30 = Main.dust[Dust.NewDust(projectile.Center - vector142 * 30f, 0, 0, 60, 0f, 0f, 0, default, 1f)]; dust30.noGravity = true; dust30.position = projectile.Center - vector142 * (float)Main.rand.Next(10, 21); - dust30.velocity = vector142.RotatedBy(1.5707963705062866, default(Vector2)) * 6f; + dust30.velocity = vector142.RotatedBy(1.5707963705062866, default) * 6f; dust30.scale = 0.9f + Main.rand.NextFloat(); dust30.fadeIn = 0.5f; dust30.customData = projectile; @@ -121,10 +121,10 @@ namespace CalamityMod.Projectiles.Magic else { Vector2 vector143 = Vector2.UnitY.RotatedByRandom(6.2831854820251465); - Dust dust31 = Main.dust[Dust.NewDust(projectile.Center - vector143 * 30f, 0, 0, 60, 0f, 0f, 0, default(Color), 1f)]; + Dust dust31 = Main.dust[Dust.NewDust(projectile.Center - vector143 * 30f, 0, 0, 60, 0f, 0f, 0, default, 1f)]; dust31.noGravity = true; dust31.position = projectile.Center - vector143 * (float)Main.rand.Next(20, 31); - dust31.velocity = vector143.RotatedBy(-1.5707963705062866, default(Vector2)) * 5f; + dust31.velocity = vector143.RotatedBy(-1.5707963705062866, default) * 5f; dust31.scale = 0.9f + Main.rand.NextFloat(); dust31.fadeIn = 0.5f; dust31.customData = projectile; @@ -232,18 +232,18 @@ namespace CalamityMod.Projectiles.Magic int num3; for (int num95 = 0; num95 < 4; num95 = num3 + 1) { - int num96 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default(Color), 1.5f); + int num96 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default, 1.5f); Main.dust[num96].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; num3 = num95; } for (int num97 = 0; num97 < 30; num97 = num3 + 1) { - int num98 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 200, default(Color), 3.7f); + int num98 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 200, default, 3.7f); Main.dust[num98].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; Main.dust[num98].noGravity = true; Dust dust = Main.dust[num98]; dust.velocity *= 3f; - num98 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default(Color), 1.5f); + num98 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default, 1.5f); Main.dust[num98].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; dust = Main.dust[num98]; dust.velocity *= 2f; @@ -254,8 +254,8 @@ namespace CalamityMod.Projectiles.Magic } for (int num99 = 0; num99 < 10; num99 = num3 + 1) { - int num100 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 0, default(Color), 2.7f); - Main.dust[num100].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)) * (float)projectile.width / 2f; + int num100 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 0, default, 2.7f); + Main.dust[num100].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default) * (float)projectile.width / 2f; Main.dust[num100].noGravity = true; Dust dust = Main.dust[num100]; dust.velocity *= 3f; @@ -263,8 +263,8 @@ namespace CalamityMod.Projectiles.Magic } for (int num101 = 0; num101 < 10; num101 = num3 + 1) { - int num102 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 0, default(Color), 1.5f); - Main.dust[num102].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)) * (float)projectile.width / 2f; + int num102 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 0, default, 1.5f); + Main.dust[num102].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default) * (float)projectile.width / 2f; Main.dust[num102].noGravity = true; Dust dust = Main.dust[num102]; dust.velocity *= 3f; diff --git a/Projectiles/Magic/GhastlyExplosion.cs b/Projectiles/Magic/GhastlyExplosion.cs index 1e1f3ff66a..9ab53c5ed5 100644 --- a/Projectiles/Magic/GhastlyExplosion.cs +++ b/Projectiles/Magic/GhastlyExplosion.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Magic int num328 = (int)projectile.ai[0]; for (int num329 = 0; num329 < 3; num329 = num3 + 1) { - int num330 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, projectile.velocity.X, projectile.velocity.Y, num328, default(Color), 1.2f); + int num330 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, projectile.velocity.X, projectile.velocity.Y, num328, default, 1.2f); Main.dust[num330].position = (Main.dust[num330].position + projectile.Center) / 2f; Main.dust[num330].noGravity = true; Dust dust = Main.dust[num330]; @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Magic } for (int num331 = 0; num331 < 2; num331 = num3 + 1) { - int num330 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, projectile.velocity.X, projectile.velocity.Y, num328, default(Color), 0.4f); + int num330 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, projectile.velocity.X, projectile.velocity.Y, num328, default, 0.4f); if (num331 == 0) { Main.dust[num330].position = (Main.dust[num330].position + projectile.Center * 5f) / 6f; @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Magic int num3; for (int num116 = 0; num116 < 20; num116 = num3 + 1) { - int num117 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, (int)projectile.ai[0], projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); + int num117 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, (int)projectile.ai[0], projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default, 0.5f); Dust dust; Main.dust[num117].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; Main.dust[num117].noGravity = true; diff --git a/Projectiles/Magic/GhastlyExplosionShard.cs b/Projectiles/Magic/GhastlyExplosionShard.cs index 2fc33a5885..8f0525b26a 100644 --- a/Projectiles/Magic/GhastlyExplosionShard.cs +++ b/Projectiles/Magic/GhastlyExplosionShard.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Magic projectile.velocity.X = projectile.velocity.X * 0.98f; for (int num334 = 0; num334 < 2; num334 = num3 + 1) { - int num335 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num332, projectile.velocity.X, projectile.velocity.Y, 50, default(Color), 1.1f); + int num335 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num332, projectile.velocity.X, projectile.velocity.Y, 50, default, 1.1f); Main.dust[num335].position = (Main.dust[num335].position + projectile.Center) / 2f; Main.dust[num335].noGravity = true; Dust dust = Main.dust[num335]; @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Magic } for (int num336 = 0; num336 < 1; num336 = num3 + 1) { - int num335 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num332, projectile.velocity.X, projectile.velocity.Y, 50, default(Color), 0.6f); + int num335 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num332, projectile.velocity.X, projectile.velocity.Y, 50, default, 0.6f); Main.dust[num335].position = (Main.dust[num335].position + projectile.Center * 5f) / 6f; Dust dust = Main.dust[num335]; dust.velocity *= 0.1f; @@ -68,7 +68,7 @@ namespace CalamityMod.Projectiles.Magic int num3; for (int num114 = 0; num114 < 10; num114 = num3 + 1) { - int num115 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, (int)projectile.ai[0], projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); + int num115 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, (int)projectile.ai[0], projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default, 0.5f); Dust dust; Main.dust[num115].scale = 1f + (float)Main.rand.Next(-10, 11) * 0.01f; Main.dust[num115].noGravity = true; diff --git a/Projectiles/Magic/GhastlySubBlast.cs b/Projectiles/Magic/GhastlySubBlast.cs index dc4e44244f..8196a9e2cd 100644 --- a/Projectiles/Magic/GhastlySubBlast.cs +++ b/Projectiles/Magic/GhastlySubBlast.cs @@ -78,9 +78,9 @@ namespace CalamityMod.Projectiles.Magic projectile.velocity *= 6f / projectile.velocity.Length(); } } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { - int num1028 = Dust.NewDust(projectile.Center, 8, 8, 60, 0f, 0f, 0, default(Color), 1f); + int num1028 = Dust.NewDust(projectile.Center, 8, 8, 60, 0f, 0f, 0, default, 1f); Main.dust[num1028].position = projectile.Center; Main.dust[num1028].velocity = projectile.velocity; Main.dust[num1028].noGravity = true; @@ -101,7 +101,7 @@ namespace CalamityMod.Projectiles.Magic int num3; for (int num114 = 0; num114 < 10; num114 = num3 + 1) { - int num115 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, (int)projectile.ai[0], projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); + int num115 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, (int)projectile.ai[0], projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default, 0.5f); Dust dust; Main.dust[num115].scale = 1f + (float)Main.rand.Next(-10, 11) * 0.01f; Main.dust[num115].noGravity = true; diff --git a/Projectiles/Magic/GraniteEnergy.cs b/Projectiles/Magic/GraniteEnergy.cs index 91c334413e..f288b92cd7 100644 --- a/Projectiles/Magic/GraniteEnergy.cs +++ b/Projectiles/Magic/GraniteEnergy.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Magic projectile.localAI[0] += 1f; if (projectile.localAI[0] > 4f) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 229, 0f, 0f, 100, default(Color), 0.6f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 229, 0f, 0f, 100, default, 0.6f); Main.dust[num469].velocity *= 0f; } float num472 = projectile.Center.X; diff --git a/Projectiles/Magic/GranitePulse.cs b/Projectiles/Magic/GranitePulse.cs index de601a0a18..618c52f025 100644 --- a/Projectiles/Magic/GranitePulse.cs +++ b/Projectiles/Magic/GranitePulse.cs @@ -77,9 +77,9 @@ namespace CalamityMod.Projectiles.Magic projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 229, 0f, 0f, 100, default(Color), 0.5f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 229, 0f, 0f, 100, default, 0.5f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -87,10 +87,10 @@ namespace CalamityMod.Projectiles.Magic } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 206, 0f, 0f, 100, default(Color), 1f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 206, 0f, 0f, 100, default, 1f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 206, 0f, 0f, 100, default(Color), 0.5f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 206, 0f, 0f, 100, default, 0.5f); Main.dust[num624].velocity *= 2f; } count += 1f; @@ -107,9 +107,9 @@ namespace CalamityMod.Projectiles.Magic projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 229, 0f, 0f, 100, default(Color), 0.5f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 229, 0f, 0f, 100, default, 0.5f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -117,10 +117,10 @@ namespace CalamityMod.Projectiles.Magic } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 206, 0f, 0f, 100, default(Color), 1f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 206, 0f, 0f, 100, default, 1f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 206, 0f, 0f, 100, default(Color), 0.5f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 206, 0f, 0f, 100, default, 0.5f); Main.dust[num624].velocity *= 2f; } pulse = 50; diff --git a/Projectiles/Magic/HeliumFlashBlast.cs b/Projectiles/Magic/HeliumFlashBlast.cs index 5187d00726..6b8dd3705a 100644 --- a/Projectiles/Magic/HeliumFlashBlast.cs +++ b/Projectiles/Magic/HeliumFlashBlast.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Magic int dustCount = (int)projectile.localAI[1]; for (int i = 0; i < dustCount; ++i) { - int dustType = Main.rand.Next(3) == 0 ? 262 : 87; + int dustType = Main.rand.NextBool(3) ? 262 : 87; float scale = Main.rand.NextFloat(2.0f, 2.5f); float randX = Main.rand.NextFloat(-30f, 30f); float randY = Main.rand.NextFloat(-30f, 30f); diff --git a/Projectiles/Magic/HellfireExplosionFriendly.cs b/Projectiles/Magic/HellfireExplosionFriendly.cs index 166d81a19c..3c5fad4ce7 100644 --- a/Projectiles/Magic/HellfireExplosionFriendly.cs +++ b/Projectiles/Magic/HellfireExplosionFriendly.cs @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Magic num466 = num465 / num466; num463 *= num466; num464 *= num466; - int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default(Color), 1.5f); + int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default, 1.5f); Main.dust[num467].noGravity = true; Main.dust[num467].position.X = projectile.Center.X; Main.dust[num467].position.Y = projectile.Center.Y; diff --git a/Projectiles/Magic/HellfireExplosionFriendly2.cs b/Projectiles/Magic/HellfireExplosionFriendly2.cs index 3544925dfe..e87a250e52 100644 --- a/Projectiles/Magic/HellfireExplosionFriendly2.cs +++ b/Projectiles/Magic/HellfireExplosionFriendly2.cs @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Magic num466 = num465 / num466; num463 *= num466; num464 *= num466; - int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default(Color), 0.75f); + int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default, 0.75f); Main.dust[num467].noGravity = true; Main.dust[num467].position.X = projectile.Center.X; Main.dust[num467].position.Y = projectile.Center.Y; diff --git a/Projectiles/Magic/HolyFlame.cs b/Projectiles/Magic/HolyFlame.cs index 5e39848b3d..cd130fa03b 100644 --- a/Projectiles/Magic/HolyFlame.cs +++ b/Projectiles/Magic/HolyFlame.cs @@ -55,9 +55,9 @@ namespace CalamityMod.Projectiles.Magic projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -65,10 +65,10 @@ namespace CalamityMod.Projectiles.Magic } for (int num623 = 0; num623 < 35; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 247, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 247, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Magic/HolyLaser.cs b/Projectiles/Magic/HolyLaser.cs index 0da6b4e7ee..5070b9ee04 100644 --- a/Projectiles/Magic/HolyLaser.cs +++ b/Projectiles/Magic/HolyLaser.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Magic { num249 = 246; } - int num448 = Dust.NewDust(vector33, 1, 1, num249, 0f, 0f, 0, default(Color), 0.25f); + int num448 = Dust.NewDust(vector33, 1, 1, num249, 0f, 0f, 0, default, 0.25f); Main.dust[num448].position = vector33; Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f; Main.dust[num448].velocity *= 0.2f; diff --git a/Projectiles/Magic/IceCluster.cs b/Projectiles/Magic/IceCluster.cs index cecb640c02..5bb539ee3b 100644 --- a/Projectiles/Magic/IceCluster.cs +++ b/Projectiles/Magic/IceCluster.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Magic { return; } - if (projectile.ai[0] % 30f == 0f && Main.netMode != 1) + if (projectile.ai[0] % 30f == 0f && Main.netMode != NetmodeID.MultiplayerClient) { Vector2 vector80 = projectile.rotation.ToRotationVector2(); Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vector80.X, vector80.Y, mod.ProjectileType("IceCluster"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); @@ -84,12 +84,12 @@ namespace CalamityMod.Projectiles.Magic { return; } - Vector2 value47 = new Vector2(0f, -720f).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)); + Vector2 value47 = new Vector2(0f, -720f).RotatedBy((double)projectile.velocity.ToRotation(), default); float scaleFactor8 = projectile.ai[0] % 45f / 45f; Vector2 spinningpoint = value47 * scaleFactor8; for (int num844 = 0; num844 < 6; num844++) { - Vector2 vector81 = projectile.Center + spinningpoint.RotatedBy((double)((float)num844 * 6.28318548f / 6f), default(Vector2)); + Vector2 vector81 = projectile.Center + spinningpoint.RotatedBy((double)((float)num844 * 6.28318548f / 6f), default); Lighting.AddLight(vector81, 0.3f, 0.75f, 0.9f); for (int num845 = 0; num845 < 2; num845++) { diff --git a/Projectiles/Magic/IceSpike.cs b/Projectiles/Magic/IceSpike.cs index c3739730e1..fed6c9416a 100644 --- a/Projectiles/Magic/IceSpike.cs +++ b/Projectiles/Magic/IceSpike.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Magic { projectile.rotation += 0.5f; projectile.localAI[0] += 1f; - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 67, 0f, 0f, 100, default(Color), 1f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 67, 0f, 0f, 100, default, 1f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; float num472 = projectile.Center.X; diff --git a/Projectiles/Magic/InfernadoFriendly.cs b/Projectiles/Magic/InfernadoFriendly.cs index f447a66fd2..da9dbc41ec 100644 --- a/Projectiles/Magic/InfernadoFriendly.cs +++ b/Projectiles/Magic/InfernadoFriendly.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Magic float num615 = 2.5f; int num616 = 320; int num617 = 88; - if (Main.rand.Next(25) == 0) + if (Main.rand.NextBool(25)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 244, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Magic/InfernadoMarkFriendly.cs b/Projectiles/Magic/InfernadoMarkFriendly.cs index 8df4fb6d9e..99b0019c30 100644 --- a/Projectiles/Magic/InfernadoMarkFriendly.cs +++ b/Projectiles/Magic/InfernadoMarkFriendly.cs @@ -37,9 +37,9 @@ namespace CalamityMod.Projectiles.Magic for (int num627 = 0; num627 < num626; num627++) { Vector2 vector45 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector45 = vector45.RotatedBy((double)(num627 - (num626 / 2 - 1)) * 3.1415926535897931 / (double)((float)num626), default(Vector2)) + projectile.Center; + vector45 = vector45.RotatedBy((double)(num627 - (num626 / 2 - 1)) * 3.1415926535897931 / (double)((float)num626), default) + projectile.Center; Vector2 value15 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); - int num628 = Dust.NewDust(vector45 + value15, 0, 0, 244, value15.X * 2f, value15.Y * 2f, 100, default(Color), 1.4f); + int num628 = Dust.NewDust(vector45 + value15, 0, 0, 244, value15.X * 2f, value15.Y * 2f, 100, default, 1.4f); Main.dust[num628].noGravity = true; Main.dust[num628].noLight = true; Main.dust[num628].velocity /= 4f; @@ -95,9 +95,9 @@ namespace CalamityMod.Projectiles.Magic for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 244, vector7.X * 2f, vector7.Y * 2f, 100, default(Color), 1.4f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 244, vector7.X * 2f, vector7.Y * 2f, 100, default, 1.4f); Main.dust[num228].noGravity = true; Main.dust[num228].noLight = true; Main.dust[num228].velocity = vector7; diff --git a/Projectiles/Magic/InfernalBlade.cs b/Projectiles/Magic/InfernalBlade.cs index 5499fbdd0a..d3fc13dfa7 100644 --- a/Projectiles/Magic/InfernalBlade.cs +++ b/Projectiles/Magic/InfernalBlade.cs @@ -42,9 +42,9 @@ namespace CalamityMod.Projectiles.Magic while ((float)num99 < num98) { Vector2 vector11 = Vector2.UnitX * 0f; - vector11 += -Vector2.UnitY.RotatedBy((double)((float)num99 * (6.28318548f / num98)), default(Vector2)) * new Vector2(1f, 4f); - vector11 = vector11.RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)); - int num100 = Dust.NewDust(projectile.Center, 0, 0, 182, 0f, 0f, 0, default(Color), 1f); + vector11 += -Vector2.UnitY.RotatedBy((double)((float)num99 * (6.28318548f / num98)), default) * new Vector2(1f, 4f); + vector11 = vector11.RotatedBy((double)projectile.velocity.ToRotation(), default); + int num100 = Dust.NewDust(projectile.Center, 0, 0, 182, 0f, 0f, 0, default, 1f); Main.dust[num100].scale = 1.5f; Main.dust[num100].noGravity = true; Main.dust[num100].position = projectile.Center + vector11; @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Magic int num487 = Main.rand.Next(4, 10); for (int num488 = 0; num488 < num487; num488++) { - int num489 = Dust.NewDust(projectile.Center, 0, 0, 182, 0f, 0f, 100, default(Color), 1f); + int num489 = Dust.NewDust(projectile.Center, 0, 0, 182, 0f, 0f, 100, default, 1f); Main.dust[num489].velocity *= 1.6f; Dust expr_FEDF_cp_0 = Main.dust[num489]; expr_FEDF_cp_0.velocity.Y = expr_FEDF_cp_0.velocity.Y - 1f; diff --git a/Projectiles/Magic/InfernalBlade2.cs b/Projectiles/Magic/InfernalBlade2.cs index b6a6bad370..6d4a294b4b 100644 --- a/Projectiles/Magic/InfernalBlade2.cs +++ b/Projectiles/Magic/InfernalBlade2.cs @@ -41,9 +41,9 @@ namespace CalamityMod.Projectiles.Magic while ((float)num99 < num98) { Vector2 vector11 = Vector2.UnitX * 0f; - vector11 += -Vector2.UnitY.RotatedBy((double)((float)num99 * (6.28318548f / num98)), default(Vector2)) * new Vector2(1f, 4f); - vector11 = vector11.RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)); - int num100 = Dust.NewDust(projectile.Center, 0, 0, 182, 0f, 0f, 0, default(Color), 1f); + vector11 += -Vector2.UnitY.RotatedBy((double)((float)num99 * (6.28318548f / num98)), default) * new Vector2(1f, 4f); + vector11 = vector11.RotatedBy((double)projectile.velocity.ToRotation(), default); + int num100 = Dust.NewDust(projectile.Center, 0, 0, 182, 0f, 0f, 0, default, 1f); Main.dust[num100].scale = 1.5f; Main.dust[num100].noGravity = true; Main.dust[num100].position = projectile.Center + vector11; @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Magic int num487 = Main.rand.Next(4, 10); for (int num488 = 0; num488 < num487; num488++) { - int num489 = Dust.NewDust(projectile.Center, 0, 0, 182, 0f, 0f, 100, default(Color), 1f); + int num489 = Dust.NewDust(projectile.Center, 0, 0, 182, 0f, 0f, 100, default, 1f); Main.dust[num489].velocity *= 1.6f; Dust expr_FEDF_cp_0 = Main.dust[num489]; expr_FEDF_cp_0.velocity.Y = expr_FEDF_cp_0.velocity.Y - 1f; diff --git a/Projectiles/Magic/IonBlast.cs b/Projectiles/Magic/IonBlast.cs index b1f1d8d87c..b56856e2bc 100644 --- a/Projectiles/Magic/IonBlast.cs +++ b/Projectiles/Magic/IonBlast.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Projectiles.Magic int num212 = Main.rand.Next(15, 30); for (int num213 = 0; num213 < num212; num213++) { - int num214 = Dust.NewDust(projectile.Center - projectile.velocity / 2f, 0, 0, 130, 0f, 0f, 100, default(Color), 1f); + int num214 = Dust.NewDust(projectile.Center - projectile.velocity / 2f, 0, 0, 130, 0f, 0f, 100, default, 1f); Main.dust[num214].velocity *= 2f; Main.dust[num214].noGravity = true; } diff --git a/Projectiles/Magic/LiquidBlade.cs b/Projectiles/Magic/LiquidBlade.cs index 7120b7b030..d5635de02e 100644 --- a/Projectiles/Magic/LiquidBlade.cs +++ b/Projectiles/Magic/LiquidBlade.cs @@ -43,8 +43,8 @@ namespace CalamityMod.Projectiles.Magic while ((float)num99 < num98) { Vector2 vector11 = Vector2.UnitX * 0f; - vector11 += -Vector2.UnitY.RotatedBy((double)((float)num99 * (6.28318548f / num98)), default(Vector2)) * new Vector2(1f, 4f); - vector11 = vector11.RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)); + vector11 += -Vector2.UnitY.RotatedBy((double)((float)num99 * (6.28318548f / num98)), default) * new Vector2(1f, 4f); + vector11 = vector11.RotatedBy((double)projectile.velocity.ToRotation(), default); int num100 = Dust.NewDust(projectile.Center, 0, 0, 66, 0f, 0f, 0, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1f); Main.dust[num100].scale = 1.5f; Main.dust[num100].noGravity = true; diff --git a/Projectiles/Magic/LiquidBlade2.cs b/Projectiles/Magic/LiquidBlade2.cs index c60fa12dd0..7b3157c7cf 100644 --- a/Projectiles/Magic/LiquidBlade2.cs +++ b/Projectiles/Magic/LiquidBlade2.cs @@ -42,8 +42,8 @@ namespace CalamityMod.Projectiles.Magic while ((float)num99 < num98) { Vector2 vector11 = Vector2.UnitX * 0f; - vector11 += -Vector2.UnitY.RotatedBy((double)((float)num99 * (6.28318548f / num98)), default(Vector2)) * new Vector2(1f, 4f); - vector11 = vector11.RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)); + vector11 += -Vector2.UnitY.RotatedBy((double)((float)num99 * (6.28318548f / num98)), default) * new Vector2(1f, 4f); + vector11 = vector11.RotatedBy((double)projectile.velocity.ToRotation(), default); int num100 = Dust.NewDust(projectile.Center, 0, 0, 66, 0f, 0f, 0, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1f); Main.dust[num100].scale = 1.5f; Main.dust[num100].noGravity = true; diff --git a/Projectiles/Magic/MagicNebulaShot.cs b/Projectiles/Magic/MagicNebulaShot.cs index f679b10a40..fc5b61e6e2 100644 --- a/Projectiles/Magic/MagicNebulaShot.cs +++ b/Projectiles/Magic/MagicNebulaShot.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Magic Lighting.AddLight(projectile.Center, 0.4f, 0.2f, 0.4f); for (int num121 = 0; num121 < 5; num121++) { - Dust dust4 = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, (Main.rand.Next(3) == 0 ? 56 : 242), projectile.velocity.X, projectile.velocity.Y, 100, default(Color), 1f)]; + Dust dust4 = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, (Main.rand.NextBool(3) ? 56 : 242), projectile.velocity.X, projectile.velocity.Y, 100, default, 1f)]; dust4.velocity = Vector2.Zero; dust4.position -= projectile.velocity / 5f * (float)num121; dust4.noGravity = true; diff --git a/Projectiles/Magic/MagnaBlast.cs b/Projectiles/Magic/MagnaBlast.cs index cc7ce012cd..d764f2bbc0 100644 --- a/Projectiles/Magic/MagnaBlast.cs +++ b/Projectiles/Magic/MagnaBlast.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Magic { for (int num468 = 0; num468 < 3; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 59, 0f, 0f, 100, default(Color), projectile.scale); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 59, 0f, 0f, 100, default, projectile.scale); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Magic/MagneticBeam.cs b/Projectiles/Magic/MagneticBeam.cs index 140a4d3d3c..7959b2d155 100644 --- a/Projectiles/Magic/MagneticBeam.cs +++ b/Projectiles/Magic/MagneticBeam.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Magic Vector2 vector33 = projectile.position; vector33 -= projectile.velocity * ((float)num447 * 0.25f); projectile.alpha = 255; - int num448 = Dust.NewDust(vector33, 1, 1, 173, 0f, 0f, 0, default(Color), 1.25f); + int num448 = Dust.NewDust(vector33, 1, 1, 173, 0f, 0f, 0, default, 1.25f); Main.dust[num448].position = vector33; Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f; Main.dust[num448].velocity *= 0.2f; diff --git a/Projectiles/Magic/MagnusBeam.cs b/Projectiles/Magic/MagnusBeam.cs index 1d0280e35a..f2921a24ae 100644 --- a/Projectiles/Magic/MagnusBeam.cs +++ b/Projectiles/Magic/MagnusBeam.cs @@ -121,58 +121,58 @@ namespace CalamityMod.Projectiles.Magic for (int num41 = 0; num41 < 2; num41++) { Vector2 value8 = Vector2.UnitX * -30f; - value8 = -Vector2.UnitY.RotatedBy((double)(projectile.localAI[0] * 0.1308997f + (float)num41 * 3.14159274f), default(Vector2)) * value7 - projectile.rotation.ToRotationVector2() * 10f; - int num42 = Dust.NewDust(projectile.Center, 0, 0, num34, 0f, 0f, 160, default(Color), 1f); + value8 = -Vector2.UnitY.RotatedBy((double)(projectile.localAI[0] * 0.1308997f + (float)num41 * 3.14159274f), default) * value7 - projectile.rotation.ToRotationVector2() * 10f; + int num42 = Dust.NewDust(projectile.Center, 0, 0, num34, 0f, 0f, 160, default, 1f); Main.dust[num42].scale = num31; Main.dust[num42].noGravity = true; Main.dust[num42].position = projectile.Center + value8 + projectile.velocity * 2f; Main.dust[num42].velocity = Vector2.Normalize(projectile.Center + projectile.velocity * 2f * 8f - Main.dust[num42].position) * 2f + projectile.velocity * 2f; } } - if (Main.rand.Next(12) == 0) + if (Main.rand.NextBool(12)) { for (int num43 = 0; num43 < 1; num43++) { - Vector2 value9 = -Vector2.UnitX.RotatedByRandom(0.19634954631328583).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)); - int num44 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 234, 0f, 0f, 100, default(Color), 1f); + Vector2 value9 = -Vector2.UnitX.RotatedByRandom(0.19634954631328583).RotatedBy((double)projectile.velocity.ToRotation(), default); + int num44 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 234, 0f, 0f, 100, default, 1f); Main.dust[num44].velocity *= 0.1f; Main.dust[num44].position = projectile.Center + value9 * (float)projectile.width / 2f + projectile.velocity * 2f; Main.dust[num44].fadeIn = 0.9f; } } - if (Main.rand.Next(64) == 0) + if (Main.rand.NextBool(64)) { for (int num45 = 0; num45 < 1; num45++) { - Vector2 value10 = -Vector2.UnitX.RotatedByRandom(0.39269909262657166).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)); - int num46 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 234, 0f, 0f, 155, default(Color), 0.8f); + Vector2 value10 = -Vector2.UnitX.RotatedByRandom(0.39269909262657166).RotatedBy((double)projectile.velocity.ToRotation(), default); + int num46 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 234, 0f, 0f, 155, default, 0.8f); Main.dust[num46].velocity *= 0.3f; Main.dust[num46].position = projectile.Center + value10 * (float)projectile.width / 2f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num46].fadeIn = 1.4f; } } } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { for (int num47 = 0; num47 < 2; num47++) { - Vector2 value11 = -Vector2.UnitX.RotatedByRandom(0.78539818525314331).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)); - int num48 = Dust.NewDust(projectile.position, projectile.width, projectile.height, num33, 0f, 0f, 0, default(Color), 1.2f); + Vector2 value11 = -Vector2.UnitX.RotatedByRandom(0.78539818525314331).RotatedBy((double)projectile.velocity.ToRotation(), default); + int num48 = Dust.NewDust(projectile.position, projectile.width, projectile.height, num33, 0f, 0f, 0, default, 1.2f); Main.dust[num48].velocity *= 0.3f; Main.dust[num48].noGravity = true; Main.dust[num48].position = projectile.Center + value11 * (float)projectile.width / 2f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num48].fadeIn = 1.4f; } } } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { - Vector2 value13 = -Vector2.UnitX.RotatedByRandom(0.19634954631328583).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)); - int num50 = Dust.NewDust(projectile.position, projectile.width, projectile.height, num34, 0f, 0f, 100, default(Color), 1f); + Vector2 value13 = -Vector2.UnitX.RotatedByRandom(0.19634954631328583).RotatedBy((double)projectile.velocity.ToRotation(), default); + int num50 = Dust.NewDust(projectile.position, projectile.width, projectile.height, num34, 0f, 0f, 100, default, 1f); Main.dust[num50].velocity *= 0.3f; Main.dust[num50].position = projectile.Center + value13 * (float)projectile.width / 2f; Main.dust[num50].fadeIn = 1.2f; @@ -183,15 +183,15 @@ namespace CalamityMod.Projectiles.Magic for (int num151 = 0; num151 < 3; num151++) { int num154 = 14; - int num155 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num154 * 2, projectile.height - num154 * 2, 263, 0f, 0f, 100, default(Color), 1.35f); + int num155 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num154 * 2, projectile.height - num154 * 2, 263, 0f, 0f, 100, default, 1.35f); Main.dust[num155].noGravity = true; Main.dust[num155].velocity *= 0.1f; Main.dust[num155].velocity += projectile.velocity * 0.5f; } - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { int num156 = 16; - int num157 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num156 * 2, projectile.height - num156 * 2, 263, 0f, 0f, 100, default(Color), 1f); + int num157 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num156 * 2, projectile.height - num156 * 2, 263, 0f, 0f, 100, default, 1f); Main.dust[num157].velocity *= 0.25f; Main.dust[num157].noGravity = true; Main.dust[num157].velocity += projectile.velocity * 0.5f; @@ -256,14 +256,14 @@ namespace CalamityMod.Projectiles.Magic 206, 181 }); - int num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num47, 0f, 0f, 200, default(Color), num50); + int num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num47, 0f, 0f, 200, default, num50); Main.dust[num54].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; Main.dust[num54].noGravity = true; Dust dust = Main.dust[num54]; dust.velocity *= 3f; dust = Main.dust[num54]; dust.velocity += value4 * Main.rand.NextFloat(); - num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num48, 0f, 0f, 100, default(Color), num51); + num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num48, 0f, 0f, 100, default, num51); Main.dust[num54].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; dust = Main.dust[num54]; dust.velocity *= 2f; @@ -276,8 +276,8 @@ namespace CalamityMod.Projectiles.Magic } for (int num55 = 0; num55 < 20; num55 = num3 + 1) { - int num56 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num49, 0f, 0f, 0, default(Color), num52); - Main.dust[num56].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)) * (float)projectile.width / 3f; + int num56 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num49, 0f, 0f, 0, default, num52); + Main.dust[num56].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default) * (float)projectile.width / 3f; Main.dust[num56].noGravity = true; Dust dust = Main.dust[num56]; dust.velocity *= 0.5f; diff --git a/Projectiles/Magic/NightBolt.cs b/Projectiles/Magic/NightBolt.cs index d299b38d77..e682367cc0 100644 --- a/Projectiles/Magic/NightBolt.cs +++ b/Projectiles/Magic/NightBolt.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Magic Vector2 vector33 = projectile.position; vector33 -= projectile.velocity * ((float)num447 * 0.25f); projectile.alpha = 255; - int num448 = Dust.NewDust(vector33, 1, 1, 27, 0f, 0f, 0, default(Color), 1.25f); + int num448 = Dust.NewDust(vector33, 1, 1, 27, 0f, 0f, 0, default, 1.25f); Main.dust[num448].position = vector33; Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f; Main.dust[num448].velocity *= 0.2f; diff --git a/Projectiles/Magic/NightRay.cs b/Projectiles/Magic/NightRay.cs index 6da1c787a3..56c1fd3ac0 100644 --- a/Projectiles/Magic/NightRay.cs +++ b/Projectiles/Magic/NightRay.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Magic Vector2 vector33 = projectile.position; vector33 -= projectile.velocity * ((float)num447 * 0.25f); projectile.alpha = 255; - int num448 = Dust.NewDust(vector33, 1, 1, 27, 0f, 0f, 0, default(Color), 1.25f); + int num448 = Dust.NewDust(vector33, 1, 1, 27, 0f, 0f, 0, default, 1.25f); Main.dust[num448].position = vector33; Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f; Main.dust[num448].velocity *= 0.2f; diff --git a/Projectiles/Magic/ParticleBeamofDoom.cs b/Projectiles/Magic/ParticleBeamofDoom.cs index 4e0fe1795b..3609aa412b 100644 --- a/Projectiles/Magic/ParticleBeamofDoom.cs +++ b/Projectiles/Magic/ParticleBeamofDoom.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Magic vector33 -= projectile.velocity * ((float)num447 * 0.25f); projectile.alpha = 255; int num249 = 206; - int num448 = Dust.NewDust(vector33, 1, 1, num249, 0f, 0f, 0, default(Color), 2.5f); + int num448 = Dust.NewDust(vector33, 1, 1, num249, 0f, 0f, 0, default, 2.5f); Main.dust[num448].position = vector33; Main.dust[num448].velocity *= 0.1f; } diff --git a/Projectiles/Magic/PhantasmalFury.cs b/Projectiles/Magic/PhantasmalFury.cs index 8701d88995..80ee3c403c 100644 --- a/Projectiles/Magic/PhantasmalFury.cs +++ b/Projectiles/Magic/PhantasmalFury.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Magic Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.25f) / 255f, ((255 - projectile.alpha) * 0.25f) / 255f, ((255 - projectile.alpha) * 0.25f) / 255f); for (int num457 = 0; num457 < 5; num457++) { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 175, 0f, 0f, 100, default(Color), 2f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 175, 0f, 0f, 100, default, 2f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Magic Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 43); for (int j = 0; j <= 10; j++) { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 175, 0f, 0f, 100, default(Color), 1f); + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 175, 0f, 0f, 100, default, 1f); } float spread = 30f * 0.0174f; double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y)- spread/2; diff --git a/Projectiles/Magic/Phantom.cs b/Projectiles/Magic/Phantom.cs index abb9ceb317..8a8ec7b5da 100644 --- a/Projectiles/Magic/Phantom.cs +++ b/Projectiles/Magic/Phantom.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Magic Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.2f) / 255f, ((255 - projectile.alpha) * 0.2f) / 255f, ((255 - projectile.alpha) * 0.2f) / 255f); for (int num457 = 0; num457 < 5; num457++) { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 175, 0f, 0f, 100, default(Color), 1f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 175, 0f, 0f, 100, default, 1f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; diff --git a/Projectiles/Magic/PlagueFang.cs b/Projectiles/Magic/PlagueFang.cs index a2d9044ab7..07b8b57316 100644 --- a/Projectiles/Magic/PlagueFang.cs +++ b/Projectiles/Magic/PlagueFang.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 163, 0f, 0f); Main.dust[dust].velocity *= 0f; @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Magic Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 27); for (int num301 = 0; num301 < 15; num301++) { - int num302 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 163, 0f, 0f, 100, default(Color), 1.2f); + int num302 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 163, 0f, 0f, 100, default, 1.2f); Main.dust[num302].noGravity = true; Main.dust[num302].velocity *= 1.2f; Main.dust[num302].velocity -= projectile.oldVelocity * 0.3f; diff --git a/Projectiles/Magic/PlasmaBolt.cs b/Projectiles/Magic/PlasmaBolt.cs index 5bcd65afd5..62aad4a616 100644 --- a/Projectiles/Magic/PlasmaBolt.cs +++ b/Projectiles/Magic/PlasmaBolt.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Magic { for (int num121 = 0; num121 < 5; num121++) { - Dust dust = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 107, projectile.velocity.X, projectile.velocity.Y, 100, default(Color), 1f)]; + Dust dust = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 107, projectile.velocity.X, projectile.velocity.Y, 100, default, 1f)]; dust.velocity = Vector2.Zero; dust.position -= projectile.velocity / 5f * (float)num121; dust.noGravity = true; diff --git a/Projectiles/Magic/PlasmaRay.cs b/Projectiles/Magic/PlasmaRay.cs index 637fbb0c8d..ae5ad63796 100644 --- a/Projectiles/Magic/PlasmaRay.cs +++ b/Projectiles/Magic/PlasmaRay.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Magic Vector2 vector33 = projectile.position; vector33 -= projectile.velocity * ((float)num447 * 0.25f); projectile.alpha = 255; - int num448 = Dust.NewDust(vector33, 1, 1, 173, 0f, 0f, 0, default(Color), 0.75f); + int num448 = Dust.NewDust(vector33, 1, 1, 173, 0f, 0f, 0, default, 0.75f); Main.dust[num448].position = vector33; Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f; Main.dust[num448].velocity *= 0.2f; diff --git a/Projectiles/Magic/PlasmaRay2.cs b/Projectiles/Magic/PlasmaRay2.cs index ba514a5c92..1531a4e424 100644 --- a/Projectiles/Magic/PlasmaRay2.cs +++ b/Projectiles/Magic/PlasmaRay2.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Magic Vector2 vector33 = projectile.position; vector33 -= projectile.velocity * ((float)num447 * 0.25f); projectile.alpha = 255; - int num448 = Dust.NewDust(vector33, 1, 1, 173, 0f, 0f, 0, default(Color), 0.25f); + int num448 = Dust.NewDust(vector33, 1, 1, 173, 0f, 0f, 0, default, 0.25f); Main.dust[num448].position = vector33; Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f; Main.dust[num448].velocity *= 0.2f; diff --git a/Projectiles/Magic/PlasmaShot.cs b/Projectiles/Magic/PlasmaShot.cs index 587b2c32a4..144d2b5f8d 100644 --- a/Projectiles/Magic/PlasmaShot.cs +++ b/Projectiles/Magic/PlasmaShot.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Magic { for (int num121 = 0; num121 < 10; num121++) { - Dust dust = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 107, projectile.velocity.X, projectile.velocity.Y, 100, default(Color), 1f)]; + Dust dust = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 107, projectile.velocity.X, projectile.velocity.Y, 100, default, 1f)]; dust.velocity = Vector2.Zero; dust.position -= projectile.velocity / 5f * (float)num121; dust.noGravity = true; diff --git a/Projectiles/Magic/Purge.cs b/Projectiles/Magic/Purge.cs index 893c0f14c1..18fc76daab 100644 --- a/Projectiles/Magic/Purge.cs +++ b/Projectiles/Magic/Purge.cs @@ -64,11 +64,11 @@ namespace CalamityMod.Projectiles.Magic if (projectile.ai[1] == 1f && projectile.ai[0] != 1f) { Vector2 vector2 = Vector2.UnitX * 24f; - vector2 = vector2.RotatedBy((double)(projectile.rotation - 1.57079637f), default(Vector2)); + vector2 = vector2.RotatedBy((double)(projectile.rotation - 1.57079637f), default); Vector2 value = projectile.Center + vector2; for (int i = 0; i < 2; i++) { - int num5 = Dust.NewDust(value - Vector2.One * 8f, 16, 16, 107, projectile.velocity.X / 2f, projectile.velocity.Y / 2f, 100, default(Color), 1f); + int num5 = Dust.NewDust(value - Vector2.One * 8f, 16, 16, 107, projectile.velocity.X / 2f, projectile.velocity.Y / 2f, 100, default, 1f); Main.dust[num5].velocity *= 0.66f; Main.dust[num5].noGravity = true; Main.dust[num5].scale = 1.4f; @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Magic { value2 = projectile.Center + new Vector2((float)Main.rand.Next(-num7, num7 + 1), (float)Main.rand.Next(-num7, num7 + 1)); Vector2 spinningpoint = Vector2.Normalize(projectile.velocity) * scaleFactor2; - spinningpoint = spinningpoint.RotatedBy(Main.rand.NextDouble() * 0.19634954631328583 - 0.098174773156642914, default(Vector2)); + spinningpoint = spinningpoint.RotatedBy(Main.rand.NextDouble() * 0.19634954631328583 - 0.098174773156642914, default); if (float.IsNaN(spinningpoint.X) || float.IsNaN(spinningpoint.Y)) { spinningpoint = -Vector2.UnitY; diff --git a/Projectiles/Magic/PurgeLaser.cs b/Projectiles/Magic/PurgeLaser.cs index ce83651755..3aded30bb5 100644 --- a/Projectiles/Magic/PurgeLaser.cs +++ b/Projectiles/Magic/PurgeLaser.cs @@ -98,7 +98,7 @@ namespace CalamityMod.Projectiles.Magic int num212 = Main.rand.Next(3, 7); for (int num213 = 0; num213 < num212; num213++) { - int num214 = Dust.NewDust(projectile.Center - projectile.velocity / 2f, 0, 0, 107, 0f, 0f, 100, default(Color), 2.1f); + int num214 = Dust.NewDust(projectile.Center - projectile.velocity / 2f, 0, 0, 107, 0f, 0f, 100, default, 2.1f); Main.dust[num214].velocity *= 2f; Main.dust[num214].noGravity = true; } diff --git a/Projectiles/Magic/RougeSlashLarge.cs b/Projectiles/Magic/RougeSlashLarge.cs index 0aa6fde58b..bc9a4dcaa7 100644 --- a/Projectiles/Magic/RougeSlashLarge.cs +++ b/Projectiles/Magic/RougeSlashLarge.cs @@ -60,9 +60,9 @@ namespace CalamityMod.Projectiles.Magic for (int l = 0; l < 12; l++) { Vector2 vector3 = Vector2.UnitX * (float)(-(float)projectile.width) / 2f; - vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default(Vector2)) * new Vector2(8f, 16f); - vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default(Vector2)); - int num9 = Dust.NewDust(projectile.Center, 0, 0, 60, 0f, 0f, 160, default(Color), 1f); + vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default) * new Vector2(8f, 16f); + vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default); + int num9 = Dust.NewDust(projectile.Center, 0, 0, 60, 0f, 0f, 160, default, 1f); Main.dust[num9].scale = 1.1f; Main.dust[num9].noGravity = true; Main.dust[num9].position = projectile.Center + vector3; diff --git a/Projectiles/Magic/RougeSlashMedium.cs b/Projectiles/Magic/RougeSlashMedium.cs index 57e88ab961..1251d0059a 100644 --- a/Projectiles/Magic/RougeSlashMedium.cs +++ b/Projectiles/Magic/RougeSlashMedium.cs @@ -60,9 +60,9 @@ namespace CalamityMod.Projectiles.Magic for (int l = 0; l < 12; l++) { Vector2 vector3 = Vector2.UnitX * (float)(-(float)projectile.width) / 2f; - vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default(Vector2)) * new Vector2(8f, 16f); - vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default(Vector2)); - int num9 = Dust.NewDust(projectile.Center, 0, 0, 60, 0f, 0f, 160, default(Color), 1f); + vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default) * new Vector2(8f, 16f); + vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default); + int num9 = Dust.NewDust(projectile.Center, 0, 0, 60, 0f, 0f, 160, default, 1f); Main.dust[num9].scale = 1.1f; Main.dust[num9].noGravity = true; Main.dust[num9].position = projectile.Center + vector3; diff --git a/Projectiles/Magic/RougeSlashSmall.cs b/Projectiles/Magic/RougeSlashSmall.cs index 05c065f1b0..642646eb4c 100644 --- a/Projectiles/Magic/RougeSlashSmall.cs +++ b/Projectiles/Magic/RougeSlashSmall.cs @@ -60,9 +60,9 @@ namespace CalamityMod.Projectiles.Magic for (int l = 0; l < 12; l++) { Vector2 vector3 = Vector2.UnitX * (float)(-(float)projectile.width) / 2f; - vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default(Vector2)) * new Vector2(8f, 16f); - vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default(Vector2)); - int num9 = Dust.NewDust(projectile.Center, 0, 0, 60, 0f, 0f, 160, default(Color), 1f); + vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default) * new Vector2(8f, 16f); + vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default); + int num9 = Dust.NewDust(projectile.Center, 0, 0, 60, 0f, 0f, 160, default, 1f); Main.dust[num9].scale = 1.1f; Main.dust[num9].noGravity = true; Main.dust[num9].position = projectile.Center + vector3; diff --git a/Projectiles/Magic/SHPExplosion.cs b/Projectiles/Magic/SHPExplosion.cs index 9d19dc3ab6..3d136ac19d 100644 --- a/Projectiles/Magic/SHPExplosion.cs +++ b/Projectiles/Magic/SHPExplosion.cs @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Magic { randomDust = 187; } - int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, randomDust, 0f, 0f, 100, default(Color), 2f); + int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, randomDust, 0f, 0f, 100, default, 2f); Main.dust[num467].noGravity = true; Main.dust[num467].position.X = projectile.Center.X; Main.dust[num467].position.Y = projectile.Center.Y; diff --git a/Projectiles/Magic/SHPL.cs b/Projectiles/Magic/SHPL.cs index d97bf5adcd..8eb14f2cc9 100644 --- a/Projectiles/Magic/SHPL.cs +++ b/Projectiles/Magic/SHPL.cs @@ -112,7 +112,7 @@ namespace CalamityMod.Projectiles.Magic { randomDust = 187; } - int num214 = Dust.NewDust(projectile.Center - projectile.velocity / 2f, 0, 0, randomDust, 0f, 0f, 100, default(Color), 2.1f); + int num214 = Dust.NewDust(projectile.Center - projectile.velocity / 2f, 0, 0, randomDust, 0f, 0f, 100, default, 2.1f); Main.dust[num214].velocity *= 2f; Main.dust[num214].noGravity = true; } diff --git a/Projectiles/Magic/SanguineFlare.cs b/Projectiles/Magic/SanguineFlare.cs index 3b9bfcb28d..0c62048e44 100644 --- a/Projectiles/Magic/SanguineFlare.cs +++ b/Projectiles/Magic/SanguineFlare.cs @@ -66,9 +66,9 @@ namespace CalamityMod.Projectiles.Magic projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 3; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default(Color), 1.2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -76,10 +76,10 @@ namespace CalamityMod.Projectiles.Magic } for (int num623 = 0; num623 < 6; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default(Color), 1.7f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default, 1.7f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default(Color), 1f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Magic/ShadecrystalProjectile.cs b/Projectiles/Magic/ShadecrystalProjectile.cs index ebc54e6c82..6ba42475ce 100644 --- a/Projectiles/Magic/ShadecrystalProjectile.cs +++ b/Projectiles/Magic/ShadecrystalProjectile.cs @@ -29,9 +29,9 @@ namespace CalamityMod.Projectiles.Magic Lighting.AddLight(projectile.Center, 0.15f, 0f, 0.15f); projectile.rotation += projectile.velocity.X * 0.2f; projectile.ai[1] += 1f; - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { - int num300 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 70, 0f, 0f, 0, default(Color), 1f); + int num300 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 70, 0f, 0f, 0, default, 1f); Main.dust[num300].noGravity = true; Main.dust[num300].velocity *= 0.2f; Main.dust[num300].scale *= 0.8f; diff --git a/Projectiles/Magic/Shaderain.cs b/Projectiles/Magic/Shaderain.cs index f6053db084..8d1e1bba0a 100644 --- a/Projectiles/Magic/Shaderain.cs +++ b/Projectiles/Magic/Shaderain.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Magic public override void Kill(int timeLeft) { - int num310 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + (float)projectile.height - 2f), 2, 2, 14, 0f, 0f, 0, default(Color), 1f); + int num310 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + (float)projectile.height - 2f), 2, 2, 14, 0f, 0f, 0, default, 1f); Dust expr_A0A0_cp_0 = Main.dust[num310]; expr_A0A0_cp_0.position.X = expr_A0A0_cp_0.position.X - 2f; Main.dust[num310].alpha = 38; diff --git a/Projectiles/Magic/Shadowbolt.cs b/Projectiles/Magic/Shadowbolt.cs index cbcf9ec62f..b31e15b968 100644 --- a/Projectiles/Magic/Shadowbolt.cs +++ b/Projectiles/Magic/Shadowbolt.cs @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Magic Vector2 vector33 = projectile.position; vector33 -= projectile.velocity * ((float)num447 * 0.25f); projectile.alpha = 255; - int num448 = Dust.NewDust(vector33, 1, 1, 173, 0f, 0f, 0, default(Color), 1f); + int num448 = Dust.NewDust(vector33, 1, 1, 173, 0f, 0f, 0, default, 1f); Main.dust[num448].position = vector33; Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f; Main.dust[num448].velocity *= 0.2f; diff --git a/Projectiles/Magic/ShiftingSands.cs b/Projectiles/Magic/ShiftingSands.cs index 569861864c..f94f7b47ef 100644 --- a/Projectiles/Magic/ShiftingSands.cs +++ b/Projectiles/Magic/ShiftingSands.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Magic projectile.soundDelay = 10; Main.PlaySound(SoundID.Item20, projectile.position); } - int num114 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 85, 0f, 0f, 100, default(Color), 2f); + int num114 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 85, 0f, 0f, 100, default, 2f); Dust dust = Main.dust[num114]; dust.velocity *= 0.3f; Main.dust[num114].position.X = projectile.position.X + (float)(projectile.width / 2) + 4f + (float)Main.rand.Next(-4, 5); @@ -144,9 +144,9 @@ namespace CalamityMod.Projectiles.Magic for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 85, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default(Color), 1.2f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 85, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default, 1.2f); Main.dust[num228].noGravity = true; Main.dust[num228].noLight = true; Main.dust[num228].velocity = vector7; diff --git a/Projectiles/Magic/Snowflake.cs b/Projectiles/Magic/Snowflake.cs index 5e7cfb7403..8b2a13d1ec 100644 --- a/Projectiles/Magic/Snowflake.cs +++ b/Projectiles/Magic/Snowflake.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { projectile.rotation += 0.15f; - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 67, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Magic/SolarBeam2.cs b/Projectiles/Magic/SolarBeam2.cs index ed75fdd9c6..69e4071df6 100644 --- a/Projectiles/Magic/SolarBeam2.cs +++ b/Projectiles/Magic/SolarBeam2.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Magic Vector2 vector33 = projectile.position; vector33 -= projectile.velocity * ((float)num447 * 0.25f); projectile.alpha = 255; - int num448 = Dust.NewDust(vector33, 1, 1, 246, 0f, 0f, 0, default(Color), 1f); + int num448 = Dust.NewDust(vector33, 1, 1, 246, 0f, 0f, 0, default, 1f); Main.dust[num448].position = vector33; Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f; Main.dust[num448].velocity *= 0.2f; diff --git a/Projectiles/Magic/SoulPiercer.cs b/Projectiles/Magic/SoulPiercer.cs index 5cb842bb90..396c784c5b 100644 --- a/Projectiles/Magic/SoulPiercer.cs +++ b/Projectiles/Magic/SoulPiercer.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Magic Vector2 vector33 = projectile.position; vector33 -= projectile.velocity * ((float)num447 * 0.25f); projectile.alpha = 255; - int num448 = Dust.NewDust(vector33, 1, 1, 173, 0f, 0f, 0, default(Color), 0.5f); + int num448 = Dust.NewDust(vector33, 1, 1, 173, 0f, 0f, 0, default, 0.5f); Main.dust[num448].position = vector33; Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.007f; Main.dust[num448].velocity *= 0.2f; diff --git a/Projectiles/Magic/SoulPiercerBolt.cs b/Projectiles/Magic/SoulPiercerBolt.cs index 39c63a1bdc..8ca3b6554d 100644 --- a/Projectiles/Magic/SoulPiercerBolt.cs +++ b/Projectiles/Magic/SoulPiercerBolt.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Magic Vector2 vector33 = projectile.position; vector33 -= projectile.velocity * ((float)num447 * 0.25f); projectile.alpha = 255; - int num448 = Dust.NewDust(vector33, 1, 1, 173, 0f, 0f, 0, default(Color), 0.5f); + int num448 = Dust.NewDust(vector33, 1, 1, 173, 0f, 0f, 0, default, 0.5f); Main.dust[num448].position = vector33; Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.007f; Main.dust[num448].velocity *= 0.2f; diff --git a/Projectiles/Magic/SpiritFlameCurse.cs b/Projectiles/Magic/SpiritFlameCurse.cs index 73dcad2158..bdf34f80f8 100644 --- a/Projectiles/Magic/SpiritFlameCurse.cs +++ b/Projectiles/Magic/SpiritFlameCurse.cs @@ -56,9 +56,9 @@ namespace CalamityMod.Projectiles.Magic projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 160, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 160, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -66,10 +66,10 @@ namespace CalamityMod.Projectiles.Magic } for (int num623 = 0; num623 < 35; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 160, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 160, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 160, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 160, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } projectile.maxPenetrate = -1; diff --git a/Projectiles/Magic/Starblast.cs b/Projectiles/Magic/Starblast.cs index cc1e4e88d0..7bb82e214a 100644 --- a/Projectiles/Magic/Starblast.cs +++ b/Projectiles/Magic/Starblast.cs @@ -45,18 +45,18 @@ namespace CalamityMod.Projectiles.Magic { projectile.Kill(); } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { - int num193 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 180, 0f, 0f, 100, default(Color), 1f); + int num193 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 180, 0f, 0f, 100, default, 1f); Main.dust[num193].position = projectile.Center; Main.dust[num193].scale += (float)Main.rand.Next(50) * 0.01f; Main.dust[num193].noGravity = true; Dust expr_835F_cp_0 = Main.dust[num193]; expr_835F_cp_0.velocity.Y = expr_835F_cp_0.velocity.Y - 2f; } - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) { - int num194 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 176, 0f, 0f, 100, default(Color), 1f); + int num194 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 176, 0f, 0f, 100, default, 1f); Main.dust[num194].position = projectile.Center; Main.dust[num194].scale += 0.3f + (float)Main.rand.Next(50) * 0.01f; Main.dust[num194].noGravity = true; diff --git a/Projectiles/Magic/StickyFeather.cs b/Projectiles/Magic/StickyFeather.cs index 503a102e84..3870e39f08 100644 --- a/Projectiles/Magic/StickyFeather.cs +++ b/Projectiles/Magic/StickyFeather.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 206, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } @@ -46,9 +46,9 @@ namespace CalamityMod.Projectiles.Magic projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 15; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 206, 0f, 0f, 100, default(Color), 1.2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 206, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -56,10 +56,10 @@ namespace CalamityMod.Projectiles.Magic } for (int num623 = 0; num623 < 30; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 206, 0f, 0f, 100, default(Color), 1.7f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 206, 0f, 0f, 100, default, 1.7f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 206, 0f, 0f, 100, default(Color), 1f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 206, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Magic/SupremeDustFlakProjectile.cs b/Projectiles/Magic/SupremeDustFlakProjectile.cs index 482269add3..e43b5fb082 100644 --- a/Projectiles/Magic/SupremeDustFlakProjectile.cs +++ b/Projectiles/Magic/SupremeDustFlakProjectile.cs @@ -46,8 +46,8 @@ namespace CalamityMod.Projectiles.Magic int num297 = 32; for (int num298 = 0; num298 < 2; num298++) { - int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1f); - if (Main.rand.Next(3) == 0) + int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); + if (Main.rand.NextBool(3)) { Main.dust[num299].noGravity = false; Main.dust[num299].scale *= 1f; @@ -68,8 +68,8 @@ namespace CalamityMod.Projectiles.Magic } for (int num298 = 0; num298 < 2; num298++) { - int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1f); - if (Main.rand.Next(3) == 0) + int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); + if (Main.rand.NextBool(3)) { Main.dust[num299].noGravity = false; Main.dust[num299].scale *= 1.5f; diff --git a/Projectiles/Magic/SupremeDustProjectile.cs b/Projectiles/Magic/SupremeDustProjectile.cs index 0f168f9e7a..7431d876a5 100644 --- a/Projectiles/Magic/SupremeDustProjectile.cs +++ b/Projectiles/Magic/SupremeDustProjectile.cs @@ -44,8 +44,8 @@ namespace CalamityMod.Projectiles.Magic } projectile.ai[0] += 1f; int num297 = 32; - int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1f); - if (Main.rand.Next(3) == 0) + int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); + if (Main.rand.NextBool(3)) { Main.dust[num299].noGravity = true; Main.dust[num299].scale *= 4f; @@ -63,8 +63,8 @@ namespace CalamityMod.Projectiles.Magic Dust expr_DC94_cp_0 = Main.dust[num299]; expr_DC94_cp_0.velocity.Y = expr_DC94_cp_0.velocity.Y * 1.2f; Main.dust[num299].scale *= num296; - int num399 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1f); - if (Main.rand.Next(3) == 0) + int num399 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); + if (Main.rand.NextBool(3)) { Main.dust[num399].noGravity = true; Main.dust[num399].scale *= 6f; diff --git a/Projectiles/Magic/T1000.cs b/Projectiles/Magic/T1000.cs index 31158fe171..07ef34ac6d 100644 --- a/Projectiles/Magic/T1000.cs +++ b/Projectiles/Magic/T1000.cs @@ -64,7 +64,7 @@ namespace CalamityMod.Projectiles.Magic if (projectile.ai[1] == 1f && projectile.ai[0] != 1f) { Vector2 vector2 = Vector2.UnitX * 24f; - vector2 = vector2.RotatedBy((double)(projectile.rotation - 1.57079637f), default(Vector2)); + vector2 = vector2.RotatedBy((double)(projectile.rotation - 1.57079637f), default); Vector2 value = projectile.Center + vector2; for (int i = 0; i < 2; i++) { @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Magic { value2 = projectile.Center + new Vector2((float)Main.rand.Next(-num7, num7 + 1), (float)Main.rand.Next(-num7, num7 + 1)); Vector2 spinningpoint = Vector2.Normalize(projectile.velocity) * scaleFactor2; - spinningpoint = spinningpoint.RotatedBy(Main.rand.NextDouble() * 0.19634954631328583 - 0.098174773156642914, default(Vector2)); + spinningpoint = spinningpoint.RotatedBy(Main.rand.NextDouble() * 0.19634954631328583 - 0.098174773156642914, default); if (float.IsNaN(spinningpoint.X) || float.IsNaN(spinningpoint.Y)) { spinningpoint = -Vector2.UnitY; diff --git a/Projectiles/Magic/TearsofHeavenProjectile.cs b/Projectiles/Magic/TearsofHeavenProjectile.cs index 133dbc6796..9587106297 100644 --- a/Projectiles/Magic/TearsofHeavenProjectile.cs +++ b/Projectiles/Magic/TearsofHeavenProjectile.cs @@ -32,19 +32,19 @@ namespace CalamityMod.Projectiles.Magic { for (int num468 = 0; num468 < 3; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 175, 0f, 0f, 100, default(Color), 1f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 175, 0f, 0f, 100, default, 1f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } for (int num92 = 0; num92 < 3; num92++) { - int num96 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 174, 0f, 0f, 100, default(Color), 1f); + int num96 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 174, 0f, 0f, 100, default, 1f); Main.dust[num96].noGravity = true; Main.dust[num96].velocity *= 0f; } for (int num105 = 0; num105 < 3; num105++) { - int num102 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 92, 0f, 0f, 100, default(Color), 1f); + int num102 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 92, 0f, 0f, 100, default, 1f); Main.dust[num102].noGravity = true; Main.dust[num102].velocity *= 0f; } diff --git a/Projectiles/Magic/TerraBolt.cs b/Projectiles/Magic/TerraBolt.cs index 8fd63695f7..df1ad341cc 100644 --- a/Projectiles/Magic/TerraBolt.cs +++ b/Projectiles/Magic/TerraBolt.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Magic Vector2 vector33 = projectile.position; vector33 -= projectile.velocity * ((float)num447 * 0.25f); projectile.alpha = 255; - int num448 = Dust.NewDust(vector33, 1, 1, 107, 0f, 0f, 0, default(Color), 1.25f); + int num448 = Dust.NewDust(vector33, 1, 1, 107, 0f, 0f, 0, default, 1.25f); Main.dust[num448].position = vector33; Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f; Main.dust[num448].velocity *= 0.2f; diff --git a/Projectiles/Magic/TerraBolt2.cs b/Projectiles/Magic/TerraBolt2.cs index deed1b6042..ce38a0cff5 100644 --- a/Projectiles/Magic/TerraBolt2.cs +++ b/Projectiles/Magic/TerraBolt2.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Magic Vector2 vector33 = projectile.position; vector33 -= projectile.velocity * ((float)num447 * 0.25f); projectile.alpha = 255; - int num448 = Dust.NewDust(vector33, 1, 1, 107, 0f, 0f, 0, default(Color), 1.25f); + int num448 = Dust.NewDust(vector33, 1, 1, 107, 0f, 0f, 0, default, 1.25f); Main.dust[num448].position = vector33; Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f; Main.dust[num448].velocity *= 0.2f; diff --git a/Projectiles/Magic/TerraRay.cs b/Projectiles/Magic/TerraRay.cs index ebed19a5e2..8334890cfd 100644 --- a/Projectiles/Magic/TerraRay.cs +++ b/Projectiles/Magic/TerraRay.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Magic Vector2 vector33 = projectile.position; vector33 -= projectile.velocity * ((float)num447 * 0.25f); projectile.alpha = 255; - int num448 = Dust.NewDust(vector33, 1, 1, 107, 0f, 0f, 0, default(Color), 1.25f); + int num448 = Dust.NewDust(vector33, 1, 1, 107, 0f, 0f, 0, default, 1.25f); Main.dust[num448].position = vector33; Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f; Main.dust[num448].velocity *= 0.2f; diff --git a/Projectiles/Magic/ThunderstormShot.cs b/Projectiles/Magic/ThunderstormShot.cs index 631a80857d..813cb74625 100644 --- a/Projectiles/Magic/ThunderstormShot.cs +++ b/Projectiles/Magic/ThunderstormShot.cs @@ -31,12 +31,12 @@ namespace CalamityMod.Projectiles.Magic { for (int num121 = 0; num121 < 5; num121++) { - Dust dust = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 107, projectile.velocity.X, projectile.velocity.Y, 100, default(Color), 1f)]; + Dust dust = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 107, projectile.velocity.X, projectile.velocity.Y, 100, default, 1f)]; dust.velocity = Vector2.Zero; dust.position -= projectile.velocity / 5f * (float)num121; dust.noGravity = true; dust.noLight = true; - Dust dust2 = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 229, projectile.velocity.X, projectile.velocity.Y, 100, default(Color), 1f)]; + Dust dust2 = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 229, projectile.velocity.X, projectile.velocity.Y, 100, default, 1f)]; dust2.velocity = Vector2.Zero; dust2.position -= projectile.velocity / 5f * (float)num121; dust2.noGravity = true; @@ -71,9 +71,9 @@ namespace CalamityMod.Projectiles.Magic for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 1f; //0.75 - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 229, vector7.X, vector7.Y, 100, default(Color), 1.2f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 229, vector7.X, vector7.Y, 100, default, 1.2f); Main.dust[num228].noGravity = true; Main.dust[num228].noLight = true; Main.dust[num228].velocity = vector7; @@ -81,9 +81,9 @@ namespace CalamityMod.Projectiles.Magic for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 107, vector7.X, vector7.Y, 100, default(Color), 1.2f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 107, vector7.X, vector7.Y, 100, default, 1.2f); Main.dust[num228].noGravity = true; Main.dust[num228].noLight = true; Main.dust[num228].velocity = vector7; diff --git a/Projectiles/Magic/ThunderstormShotSplit.cs b/Projectiles/Magic/ThunderstormShotSplit.cs index 338a6decdd..faa23ecf34 100644 --- a/Projectiles/Magic/ThunderstormShotSplit.cs +++ b/Projectiles/Magic/ThunderstormShotSplit.cs @@ -35,12 +35,12 @@ namespace CalamityMod.Projectiles.Magic { for (int num121 = 0; num121 < 5; num121++) { - Dust dust = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 107, projectile.velocity.X, projectile.velocity.Y, 100, default(Color), 0.5f)]; + Dust dust = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 107, projectile.velocity.X, projectile.velocity.Y, 100, default, 0.5f)]; dust.velocity = Vector2.Zero; dust.position -= projectile.velocity / 5f * (float)num121; dust.noGravity = true; dust.noLight = true; - Dust dust2 = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 229, projectile.velocity.X, projectile.velocity.Y, 100, default(Color), 0.5f)]; + Dust dust2 = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 229, projectile.velocity.X, projectile.velocity.Y, 100, default, 0.5f)]; dust2.velocity = Vector2.Zero; dust2.position -= projectile.velocity / 5f * (float)num121; dust2.noGravity = true; @@ -60,9 +60,9 @@ namespace CalamityMod.Projectiles.Magic for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; //0.75 - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 229, vector7.X, vector7.Y, 100, default(Color), 0.6f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 229, vector7.X, vector7.Y, 100, default, 0.6f); Main.dust[num228].noGravity = true; Main.dust[num228].noLight = true; Main.dust[num228].velocity = vector7; @@ -70,9 +70,9 @@ namespace CalamityMod.Projectiles.Magic for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.5f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 107, vector7.X, vector7.Y, 100, default(Color), 0.6f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 107, vector7.X, vector7.Y, 100, default, 0.6f); Main.dust[num228].noGravity = true; Main.dust[num228].noLight = true; Main.dust[num228].velocity = vector7; diff --git a/Projectiles/Magic/TradewindsProjectile.cs b/Projectiles/Magic/TradewindsProjectile.cs index 46c4887c4d..899c150c4c 100644 --- a/Projectiles/Magic/TradewindsProjectile.cs +++ b/Projectiles/Magic/TradewindsProjectile.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 64, 0f, 0f); } diff --git a/Projectiles/Magic/UberBubble.cs b/Projectiles/Magic/UberBubble.cs index c0c5e21f4c..4e41d3e362 100644 --- a/Projectiles/Magic/UberBubble.cs +++ b/Projectiles/Magic/UberBubble.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Magic int num190 = Main.rand.Next(4, 6); for (int num191 = 0; num191 < num190; num191++) { - int num192 = Dust.NewDust(projectile.Center, 0, 0, 171, 0f, 0f, 100, default(Color), 1.4f); + int num192 = Dust.NewDust(projectile.Center, 0, 0, 171, 0f, 0f, 100, default, 1.4f); Main.dust[num192].velocity *= 0.8f; Main.dust[num192].position = Vector2.Lerp(Main.dust[num192].position, projectile.Center, 0.5f); Main.dust[num192].noGravity = true; diff --git a/Projectiles/Magic/Vehemence.cs b/Projectiles/Magic/Vehemence.cs index 323ff6fcf4..24040d365c 100644 --- a/Projectiles/Magic/Vehemence.cs +++ b/Projectiles/Magic/Vehemence.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Magic Lighting.AddLight(projectile.Center, 0.45f, 0f, 0.45f); for (int num457 = 0; num457 < 2; num457++) { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 65, 0f, 0f, 100, default(Color), 2f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 65, 0f, 0f, 100, default, 2f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0.15f; Main.dust[num458].velocity += projectile.velocity * 0.1f; @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Magic Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 74); for (int j = 0; j <= 25; j++) { - int num459 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 65, 0f, 0f, 100, default(Color), 1f); + int num459 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 65, 0f, 0f, 100, default, 1f); Main.dust[num459].noGravity = true; Main.dust[num459].velocity *= 0.1f; } diff --git a/Projectiles/Magic/VenusianBolt.cs b/Projectiles/Magic/VenusianBolt.cs index a8bc510df4..358cdf28cf 100644 --- a/Projectiles/Magic/VenusianBolt.cs +++ b/Projectiles/Magic/VenusianBolt.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Magic } for (int num457 = 0; num457 < 5; num457++) { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 55, 0f, 0f, 100, default(Color), 1.2f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 55, 0f, 0f, 100, default, 1.2f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; diff --git a/Projectiles/Magic/VenusianExplosion.cs b/Projectiles/Magic/VenusianExplosion.cs index 07b3f45a7f..e00125d38f 100644 --- a/Projectiles/Magic/VenusianExplosion.cs +++ b/Projectiles/Magic/VenusianExplosion.cs @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Magic num466 = num465 / num466; num463 *= num466; num464 *= num466; - int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 55, 0f, 0f, 100, default(Color), 2.5f); + int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 55, 0f, 0f, 100, default, 2.5f); Main.dust[num467].noGravity = true; Main.dust[num467].position.X = projectile.Center.X; Main.dust[num467].position.Y = projectile.Center.Y; diff --git a/Projectiles/Magic/VenusianFlame.cs b/Projectiles/Magic/VenusianFlame.cs index 6f38d847fb..0ef49a21ad 100644 --- a/Projectiles/Magic/VenusianFlame.cs +++ b/Projectiles/Magic/VenusianFlame.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Magic projectile.ai[1] = 1f; Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 13); } - int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 55, 0f, 0f, 100, default(Color), 1f); + int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 55, 0f, 0f, 100, default, 1f); Dust expr_8976_cp_0 = Main.dust[num199]; expr_8976_cp_0.position.X = expr_8976_cp_0.position.X - 2f; Dust expr_8994_cp_0 = Main.dust[num199]; @@ -68,9 +68,9 @@ namespace CalamityMod.Projectiles.Magic Main.dust[num199].noGravity = true; Dust expr_89E7_cp_0 = Main.dust[num199]; expr_89E7_cp_0.velocity.Y = expr_89E7_cp_0.velocity.Y - 2f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { - int num200 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 55, 0f, 0f, 100, default(Color), 1f); + int num200 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 55, 0f, 0f, 100, default, 1f); Dust expr_8A4E_cp_0 = Main.dust[num200]; expr_8A4E_cp_0.position.X = expr_8A4E_cp_0.position.X - 2f; Dust expr_8A6C_cp_0 = Main.dust[num200]; diff --git a/Projectiles/Magic/Viscera.cs b/Projectiles/Magic/Viscera.cs index fc5799b4e3..a1a7e86563 100644 --- a/Projectiles/Magic/Viscera.cs +++ b/Projectiles/Magic/Viscera.cs @@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.Magic Vector2 vector33 = projectile.position; vector33 -= projectile.velocity * ((float)num447 * 0.25f); projectile.alpha = 255; - int num448 = Dust.NewDust(vector33, 1, 1, 5, 0f, 0f, 0, default(Color), 1f); + int num448 = Dust.NewDust(vector33, 1, 1, 5, 0f, 0f, 0, default, 1f); Main.dust[num448].position = vector33; Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f; Main.dust[num448].velocity *= 0.2f; diff --git a/Projectiles/Magic/VividBolt.cs b/Projectiles/Magic/VividBolt.cs index e0fb72be2e..c11cffe8d5 100644 --- a/Projectiles/Magic/VividBolt.cs +++ b/Projectiles/Magic/VividBolt.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Magic for (int num41 = 0; num41 < 2; num41++) { Vector2 value8 = Vector2.UnitX * -12f; - value8 = -Vector2.UnitY.RotatedBy((double)(projectile.ai[0] * 0.1308997f + (float)num41 * 3.14159274f), default(Vector2)) * value7 - projectile.rotation.ToRotationVector2() * 10f; + value8 = -Vector2.UnitY.RotatedBy((double)(projectile.ai[0] * 0.1308997f + (float)num41 * 3.14159274f), default) * value7 - projectile.rotation.ToRotationVector2() * 10f; int num42 = Dust.NewDust(projectile.Center, 0, 0, 66, 0f, 0f, 160, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1f); Main.dust[num42].scale = 0.33f; Main.dust[num42].noGravity = true; diff --git a/Projectiles/Magic/VividClarity.cs b/Projectiles/Magic/VividClarity.cs index 788e34d39f..5b923c5e1a 100644 --- a/Projectiles/Magic/VividClarity.cs +++ b/Projectiles/Magic/VividClarity.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Magic for (int num41 = 0; num41 < 2; num41++) { Vector2 value8 = Vector2.UnitX * -12f; - value8 = -Vector2.UnitY.RotatedBy((double)(projectile.ai[0] * 0.1308997f + (float)num41 * 3.14159274f), default(Vector2)) * value7 - projectile.rotation.ToRotationVector2() * 10f; + value8 = -Vector2.UnitY.RotatedBy((double)(projectile.ai[0] * 0.1308997f + (float)num41 * 3.14159274f), default) * value7 - projectile.rotation.ToRotationVector2() * 10f; int num42 = Dust.NewDust(projectile.Center, 0, 0, 66, 0f, 0f, 160, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1f); Main.dust[num42].scale = 0.75f; Main.dust[num42].noGravity = true; diff --git a/Projectiles/Magic/Vortex.cs b/Projectiles/Magic/Vortex.cs index fed5563ba7..3157a96a8a 100644 --- a/Projectiles/Magic/Vortex.cs +++ b/Projectiles/Magic/Vortex.cs @@ -35,13 +35,13 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { projectile.localAI[1] += 1f; - if (projectile.localAI[1] > 10f && Main.rand.Next(3) == 0) + if (projectile.localAI[1] > 10f && Main.rand.NextBool(3)) { int num713 = 5; for (int num714 = 0; num714 < num713; num714++) { Vector2 vector58 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width, (float)projectile.height) / 2f; - vector58 = vector58.RotatedBy((double)(num714 - (num713 / 2 - 1)) * 3.1415926535897931 / (double)((float)num713), default(Vector2)) + projectile.Center; + vector58 = vector58.RotatedBy((double)(num714 - (num713 / 2 - 1)) * 3.1415926535897931 / (double)((float)num713), default) + projectile.Center; Vector2 value25 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); int num715 = Dust.NewDust(vector58 + value25, 0, 0, 66, value25.X * 2f, value25.Y * 2f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 0.7f); Main.dust[num715].noGravity = true; @@ -127,7 +127,7 @@ namespace CalamityMod.Projectiles.Magic { num726 += 6.2831853071795862; } - projectile.velocity = projectile.velocity.RotatedBy(num726 * 0.10000000149011612, default(Vector2)); + projectile.velocity = projectile.velocity.RotatedBy(num726 * 0.10000000149011612, default); } float num727 = projectile.velocity.Length(); projectile.velocity.Normalize(); diff --git a/Projectiles/Magic/WaterStream.cs b/Projectiles/Magic/WaterStream.cs index 213a85b39f..30eb77d50f 100644 --- a/Projectiles/Magic/WaterStream.cs +++ b/Projectiles/Magic/WaterStream.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Magic Dust expr_6A1F_cp_0 = Main.dust[num155]; expr_6A1F_cp_0.position.Y = expr_6A1F_cp_0.position.Y - num153; } - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { int num156 = 16; int num157 = Dust.NewDust(new Vector2(projectile.position.X + (float)num156, projectile.position.Y + (float)num156), projectile.width - num156 * 2, projectile.height - num156 * 2, 14, 0f, 0f, 100, new Color(0, 255, 255), 0.5f); diff --git a/Projectiles/Magic/WaterStream2.cs b/Projectiles/Magic/WaterStream2.cs index b90f39e975..d1e8dfa0ea 100644 --- a/Projectiles/Magic/WaterStream2.cs +++ b/Projectiles/Magic/WaterStream2.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Magic float num152 = projectile.velocity.X / 3f * (float)num151; float num153 = projectile.velocity.Y / 3f * (float)num151; int num154 = 14; - int num155 = Dust.NewDust(new Vector2(projectile.position.X + (float)num154, projectile.position.Y + (float)num154), projectile.width - num154 * 2, projectile.height - num154 * 2, 33, 0f, 0f, 100, default(Color), 1f); + int num155 = Dust.NewDust(new Vector2(projectile.position.X + (float)num154, projectile.position.Y + (float)num154), projectile.width - num154 * 2, projectile.height - num154 * 2, 33, 0f, 0f, 100, default, 1f); Main.dust[num155].noGravity = true; Main.dust[num155].velocity *= 0.1f; Main.dust[num155].velocity += projectile.velocity * 0.5f; @@ -51,10 +51,10 @@ namespace CalamityMod.Projectiles.Magic Dust expr_6A1F_cp_0 = Main.dust[num155]; expr_6A1F_cp_0.position.Y = expr_6A1F_cp_0.position.Y - num153; } - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { int num156 = 16; - int num157 = Dust.NewDust(new Vector2(projectile.position.X + (float)num156, projectile.position.Y + (float)num156), projectile.width - num156 * 2, projectile.height - num156 * 2, 33, 0f, 0f, 100, default(Color), 0.5f); + int num157 = Dust.NewDust(new Vector2(projectile.position.X + (float)num156, projectile.position.Y + (float)num156), projectile.width - num156 * 2, projectile.height - num156 * 2, 33, 0f, 0f, 100, default, 0.5f); Main.dust[num157].velocity *= 0.25f; Main.dust[num157].velocity += projectile.velocity * 0.5f; return; diff --git a/Projectiles/Magic/WhiteFlame.cs b/Projectiles/Magic/WhiteFlame.cs index 8e6dfb0e06..e58a49e8e0 100644 --- a/Projectiles/Magic/WhiteFlame.cs +++ b/Projectiles/Magic/WhiteFlame.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Magic Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0.5f) / 255f); for (int num457 = 0; num457 < 5; num457++) { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 91, 0f, 0f, 100, default(Color), 1f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 91, 0f, 0f, 100, default, 1f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; diff --git a/Projectiles/Magic/WhiteFlame2.cs b/Projectiles/Magic/WhiteFlame2.cs index 411e13aa59..a88fc939e7 100644 --- a/Projectiles/Magic/WhiteFlame2.cs +++ b/Projectiles/Magic/WhiteFlame2.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Magic Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0.5f) / 255f); for (int num457 = 0; num457 < 5; num457++) { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 91, 0f, 0f, 100, default(Color), 0.5f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 91, 0f, 0f, 100, default, 0.5f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; diff --git a/Projectiles/Magic/WintersFury.cs b/Projectiles/Magic/WintersFury.cs index 2ba9437e04..05bedef007 100644 --- a/Projectiles/Magic/WintersFury.cs +++ b/Projectiles/Magic/WintersFury.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Magic { for (int num468 = 0; num468 < 3; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 67, 0f, 0f, 100, default(Color), 0.75f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 67, 0f, 0f, 100, default, 0.75f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Magic/WulfrumBolt.cs b/Projectiles/Magic/WulfrumBolt.cs index 8ddbbae699..df6fe58d10 100644 --- a/Projectiles/Magic/WulfrumBolt.cs +++ b/Projectiles/Magic/WulfrumBolt.cs @@ -28,15 +28,15 @@ namespace CalamityMod.Projectiles.Magic for (int num151 = 0; num151 < 3; num151++) { int num154 = 14; - int num155 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num154 * 2, projectile.height - num154 * 2, 61, 0f, 0f, 100, default(Color), 3f); + int num155 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num154 * 2, projectile.height - num154 * 2, 61, 0f, 0f, 100, default, 3f); Main.dust[num155].noGravity = true; Main.dust[num155].velocity *= 0.1f; Main.dust[num155].velocity += projectile.velocity * 0.5f; } - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { int num156 = 16; - int num157 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num156 * 2, projectile.height - num156 * 2, 61, 0f, 0f, 100, default(Color), 2.25f); + int num157 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num156 * 2, projectile.height - num156 * 2, 61, 0f, 0f, 100, default, 2.25f); Main.dust[num157].velocity *= 0.25f; Main.dust[num157].velocity += projectile.velocity * 0.5f; return; diff --git a/Projectiles/Magic/YharimsCrystal.cs b/Projectiles/Magic/YharimsCrystal.cs index 21c3028586..1db4b20494 100644 --- a/Projectiles/Magic/YharimsCrystal.cs +++ b/Projectiles/Magic/YharimsCrystal.cs @@ -186,7 +186,7 @@ namespace CalamityMod.Projectiles.Magic } for (float num218 = 0f; num218 < 4f; num218 += 1f) { - Main.spriteBatch.Draw(texture2D14, vector27 + Vector2.UnitY.RotatedBy((double)(num218 * 6.28318548f / 4f), default(Vector2)) * scaleFactor2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y7, texture2D14.Width, num215)), projectile.GetAlpha(color25).MultiplyRGBA(new Microsoft.Xna.Framework.Color(255, 255, 255, 0)) * 0.03f, projectile.rotation, new Vector2((float)texture2D14.Width / 2f, (float)num215 / 2f), projectile.scale, spriteEffects, 0f); + Main.spriteBatch.Draw(texture2D14, vector27 + Vector2.UnitY.RotatedBy((double)(num218 * 6.28318548f / 4f), default) * scaleFactor2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y7, texture2D14.Width, num215)), projectile.GetAlpha(color25).MultiplyRGBA(new Microsoft.Xna.Framework.Color(255, 255, 255, 0)) * 0.03f, projectile.rotation, new Vector2((float)texture2D14.Width / 2f, (float)num215 / 2f), projectile.scale, spriteEffects, 0f); } return false; } diff --git a/Projectiles/Magic/YharimsCrystalBeam.cs b/Projectiles/Magic/YharimsCrystalBeam.cs index a00ef29735..9c3a98626f 100644 --- a/Projectiles/Magic/YharimsCrystalBeam.cs +++ b/Projectiles/Magic/YharimsCrystalBeam.cs @@ -155,12 +155,12 @@ namespace CalamityMod.Projectiles.Magic scaleFactor6 = -2f; } float num814 = (projectile2.ai[0] + num810 * num813) / (num813 * 6f) * 6.28318548f; - num811 = Vector2.UnitY.RotatedBy((double)num814, default(Vector2)).Y * 0.5235988f * num812; - value37 = (Vector2.UnitY.RotatedBy((double)num814, default(Vector2)) * new Vector2(4f, y)).RotatedBy((double)projectile2.velocity.ToRotation(), default(Vector2)); + num811 = Vector2.UnitY.RotatedBy((double)num814, default).Y * 0.5235988f * num812; + value37 = (Vector2.UnitY.RotatedBy((double)num814, default) * new Vector2(4f, y)).RotatedBy((double)projectile2.velocity.ToRotation(), default); projectile.position = projectile2.Center + value36 * 16f - projectile.Size / 2f + new Vector2(0f, -Main.projectile[(int)projectile.ai[1]].gfxOffY); projectile.position += projectile2.velocity.ToRotation().ToRotationVector2() * scaleFactor6; projectile.position += value37; - projectile.velocity = Vector2.Normalize(projectile2.velocity).RotatedBy((double)num811, default(Vector2)); + projectile.velocity = Vector2.Normalize(projectile2.velocity).RotatedBy((double)num811, default); projectile.scale = 1.8f * (1f - num812); projectile.damage = projectile2.damage; if (projectile2.ai[0] >= 180f) @@ -227,9 +227,9 @@ namespace CalamityMod.Projectiles.Magic float hue = (x + Main.rand.NextFloat() * 0.4f) % 1f; Main.dust[num846].color = Color.Lerp(color, Main.hslToRgb(2.55f, hue, 0.53f), projectile.scale / 1.4f); } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { - Vector2 value42 = projectile.velocity.RotatedBy(1.5707963705062866, default(Vector2)) * ((float)Main.rand.NextDouble() - 0.5f) * (float)projectile.width; + Vector2 value42 = projectile.velocity.RotatedBy(1.5707963705062866, default) * ((float)Main.rand.NextDouble() - 0.5f) * (float)projectile.width; int num847 = Dust.NewDust(vector80 + value42 - Vector2.One * 4f, 8, 8, 244, 0f, 0f, 100, new Color(255, Main.DiscoG, 53), 5f); Main.dust[num847].velocity *= 0.5f; Main.dust[num847].velocity.Y = -Math.Abs(Main.dust[num847].velocity.Y); @@ -238,9 +238,9 @@ namespace CalamityMod.Projectiles.Magic float value43 = 0.1f * (float)Math.Sin((double)(Main.GlobalTime * 20f)); Vector2 size = new Vector2(projectile.velocity.Length() * projectile.localAI[1], (float)projectile.width * projectile.scale); float num848 = projectile.velocity.ToRotation(); - if (Main.netMode != 2) + if (Main.netMode != NetmodeID.Server) { - ((WaterShaderData)Filters.Scene["WaterDistortion"].GetShader()).QueueRipple(projectile.position + new Vector2(size.X * 0.5f, 0f).RotatedBy((double)num848, default(Vector2)), new Color(0.5f, 0.1f * (float)Math.Sign(value43) + 0.5f, 0f, 1f) * Math.Abs(value43), size, RippleShape.Square, num848); + ((WaterShaderData)Filters.Scene["WaterDistortion"].GetShader()).QueueRipple(projectile.position + new Vector2(size.X * 0.5f, 0f).RotatedBy((double)num848, default), new Color(0.5f, 0.1f * (float)Math.Sign(value43) + 0.5f, 0f, 1f) * Math.Abs(value43), size, RippleShape.Square, num848); } Utils.PlotTileLine(projectile.Center, projectile.Center + projectile.velocity * projectile.localAI[1], (float)projectile.width * projectile.scale, new Utils.PerLinePoint(DelegateMethods.CastLight)); return; diff --git a/Projectiles/Melee/AccretionDisk2Melee.cs b/Projectiles/Melee/AccretionDisk2Melee.cs index 1bcf346dfe..bb384f7de1 100644 --- a/Projectiles/Melee/AccretionDisk2Melee.cs +++ b/Projectiles/Melee/AccretionDisk2Melee.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { int num250 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 66, (float)(projectile.direction * 2), 0f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 0.5f); Main.dust[num250].noGravity = true; diff --git a/Projectiles/Melee/AccretionDiskMelee.cs b/Projectiles/Melee/AccretionDiskMelee.cs index f0e5a9c619..a78b0c591e 100644 --- a/Projectiles/Melee/AccretionDiskMelee.cs +++ b/Projectiles/Melee/AccretionDiskMelee.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { for (int num468 = 0; num468 < 1; num468++) { @@ -84,7 +84,7 @@ namespace CalamityMod.Projectiles.Melee num440 = num437 / num440; num438 *= num440; num439 *= num440; - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { if (projectile.owner == Main.myPlayer) { diff --git a/Projectiles/Melee/AegisFlame.cs b/Projectiles/Melee/AegisFlame.cs index 6044caf11b..76503bd36a 100644 --- a/Projectiles/Melee/AegisFlame.cs +++ b/Projectiles/Melee/AegisFlame.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Melee Main.dust[num199].noGravity = true; Dust expr_89E7_cp_0 = Main.dust[num199]; expr_89E7_cp_0.velocity.Y = expr_89E7_cp_0.velocity.Y - 2f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { int num200 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 246, 0f, 0f, 100, new Color(255, Main.DiscoG, 53), 1f); Dust expr_8A4E_cp_0 = Main.dust[num200]; diff --git a/Projectiles/Melee/BalefulHarvesterProjectile.cs b/Projectiles/Melee/BalefulHarvesterProjectile.cs index b9f8a465b7..f3739cb898 100644 --- a/Projectiles/Melee/BalefulHarvesterProjectile.cs +++ b/Projectiles/Melee/BalefulHarvesterProjectile.cs @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Melee Main.PlaySound(SoundID.Item8, projectile.position); for (int num124 = 0; num124 < 10; num124++) { - int num125 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, (Main.rand.Next(2) == 0 ? 5 : 6), projectile.velocity.X, projectile.velocity.Y, 0, default(Color), 2f); + int num125 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, (Main.rand.NextBool(2) ? 5 : 6), projectile.velocity.X, projectile.velocity.Y, 0, default, 2f); Main.dust[num125].noGravity = true; Main.dust[num125].velocity = projectile.Center - Main.dust[num125].position; Main.dust[num125].velocity.Normalize(); @@ -91,7 +91,7 @@ namespace CalamityMod.Projectiles.Melee { for (int num157 = 0; num157 < 2; num157++) { - int num158 = Dust.NewDust(new Vector2(projectile.position.X + 4f, projectile.position.Y + 4f), projectile.width - 8, projectile.height - 8, (Main.rand.Next(2) == 0 ? 5 : 6), projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 2f); + int num158 = Dust.NewDust(new Vector2(projectile.position.X + 4f, projectile.position.Y + 4f), projectile.width - 8, projectile.height - 8, (Main.rand.NextBool(2) ? 5 : 6), projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 2f); Main.dust[num158].position -= projectile.velocity * 2f; Main.dust[num158].noGravity = true; Dust expr_7A4A_cp_0_cp_0 = Main.dust[num158]; @@ -118,9 +118,9 @@ namespace CalamityMod.Projectiles.Melee Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 27); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -128,10 +128,10 @@ namespace CalamityMod.Projectiles.Melee } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Melee/BallOFugu.cs b/Projectiles/Melee/BallOFugu.cs index f3096ff96f..ab30531831 100644 --- a/Projectiles/Melee/BallOFugu.cs +++ b/Projectiles/Melee/BallOFugu.cs @@ -91,7 +91,7 @@ namespace CalamityMod.Projectiles.Melee Vector2 vector63 = vector62 * -1f; vector63.Normalize(); vector63 *= (float)Main.rand.Next(45, 65) * 0.1f; - vector63 = vector63.RotatedBy((Main.rand.NextDouble() - 0.5) * 1.5707963705062866, default(Vector2)); + vector63 = vector63.RotatedBy((Main.rand.NextDouble() - 0.5) * 1.5707963705062866, default); Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vector63.X, vector63.Y, mod.ProjectileType("UrchinSpikeFugu"), (int)((double)projectile.damage * 0.6), projectile.knockBack * 0.2f, projectile.owner, -10f, 0f); } } diff --git a/Projectiles/Melee/BansheeHookBoom.cs b/Projectiles/Melee/BansheeHookBoom.cs index c248a32f53..187f9dcc28 100644 --- a/Projectiles/Melee/BansheeHookBoom.cs +++ b/Projectiles/Melee/BansheeHookBoom.cs @@ -45,16 +45,16 @@ namespace CalamityMod.Projectiles.Melee projectile.Damage(); for (int num1000 = 0; num1000 < 2; num1000++) { - int num1001 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default(Color), 1.5f); + int num1001 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default, 1.5f); Main.dust[num1001].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; } for (int num1002 = 0; num1002 < 5; num1002++) { - int num1003 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 200, default(Color), 2.7f); + int num1003 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 200, default, 2.7f); Main.dust[num1003].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; Main.dust[num1003].noGravity = true; Main.dust[num1003].velocity *= 3f; - num1003 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default(Color), 1.5f); + num1003 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default, 1.5f); Main.dust[num1003].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; Main.dust[num1003].velocity *= 2f; Main.dust[num1003].noGravity = true; @@ -62,15 +62,15 @@ namespace CalamityMod.Projectiles.Melee } for (int num1004 = 0; num1004 < 2; num1004++) { - int num1005 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 0, default(Color), 2.7f); - Main.dust[num1005].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)) * (float)projectile.width / 2f; + int num1005 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 0, default, 2.7f); + Main.dust[num1005].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default) * (float)projectile.width / 2f; Main.dust[num1005].noGravity = true; Main.dust[num1005].velocity *= 3f; } for (int num1006 = 0; num1006 < 5; num1006++) { - int num1007 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 180, 0f, 0f, 0, default(Color), 1.5f); - Main.dust[num1007].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)) * (float)projectile.width / 2f; + int num1007 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 180, 0f, 0f, 0, default, 1.5f); + Main.dust[num1007].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default) * (float)projectile.width / 2f; Main.dust[num1007].noGravity = true; Main.dust[num1007].velocity *= 3f; } diff --git a/Projectiles/Melee/BiomeOrb.cs b/Projectiles/Melee/BiomeOrb.cs index 7a502bfdd9..2d84ca59bb 100644 --- a/Projectiles/Melee/BiomeOrb.cs +++ b/Projectiles/Melee/BiomeOrb.cs @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Melee } for (int num457 = 0; num457 < 5; num457++) { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default(Color), 1.2f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 1.2f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; diff --git a/Projectiles/Melee/Blood.cs b/Projectiles/Melee/Blood.cs index 20ec448e10..23faca0997 100644 --- a/Projectiles/Melee/Blood.cs +++ b/Projectiles/Melee/Blood.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Melee { for (int num468 = 0; num468 < 2; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, 0f, 0f, 100, default(Color), 1f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, 0f, 0f, 100, default, 1f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Melee/Blood2.cs b/Projectiles/Melee/Blood2.cs index 98b8b4c45c..7f7c8e8779 100644 --- a/Projectiles/Melee/Blood2.cs +++ b/Projectiles/Melee/Blood2.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Melee { for (int num468 = 0; num468 < 2; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, 0f, 0f, 100, default(Color), 1f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, 0f, 0f, 100, default, 1f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Melee/BloodBall.cs b/Projectiles/Melee/BloodBall.cs index bb5c9c6e2a..ee3a96b5d6 100644 --- a/Projectiles/Melee/BloodBall.cs +++ b/Projectiles/Melee/BloodBall.cs @@ -109,15 +109,15 @@ namespace CalamityMod.Projectiles.Melee projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num648 = 0; num648 < 20; num648++) { - int num649 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, 0f, 0f, 100, default(Color), 1.5f); + int num649 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, 0f, 0f, 100, default, 1.5f); Main.dust[num649].velocity *= 1.4f; } for (int num650 = 0; num650 < 10; num650++) { - int num651 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, 0f, 0f, 100, default(Color), 2.5f); + int num651 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, 0f, 0f, 100, default, 2.5f); Main.dust[num651].noGravity = true; Main.dust[num651].velocity *= 5f; - num651 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, 0f, 0f, 100, default(Color), 1.5f); + num651 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, 0f, 0f, 100, default, 1.5f); Main.dust[num651].velocity *= 3f; } } diff --git a/Projectiles/Melee/BloodScythe.cs b/Projectiles/Melee/BloodScythe.cs index 9b3df53af8..b3386dfa13 100644 --- a/Projectiles/Melee/BloodScythe.cs +++ b/Projectiles/Melee/BloodScythe.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Melee projectile.velocity *= 1.05f; } projectile.rotation += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.1f; - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 5, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Melee/BlueAura.cs b/Projectiles/Melee/BlueAura.cs index 92373d78d3..8de9bf7c4b 100644 --- a/Projectiles/Melee/BlueAura.cs +++ b/Projectiles/Melee/BlueAura.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Melee { for (int num468 = 0; num468 < 3; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 15, 0f, 0f, 100, default(Color), 1.3f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 15, 0f, 0f, 100, default, 1.3f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Melee/Brimblast.cs b/Projectiles/Melee/Brimblast.cs index 8be1ee5062..104e1b2a06 100644 --- a/Projectiles/Melee/Brimblast.cs +++ b/Projectiles/Melee/Brimblast.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Melee projectile.velocity.Y = projectile.velocity.Y + 0.2f; } projectile.rotation += projectile.velocity.X * 0.1f; - int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 235, 0f, 0f, 100, default(Color), 1f); + int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 235, 0f, 0f, 100, default, 1f); Dust expr_8976_cp_0 = Main.dust[num199]; expr_8976_cp_0.position.X = expr_8976_cp_0.position.X - 2f; Dust expr_8994_cp_0 = Main.dust[num199]; @@ -60,9 +60,9 @@ namespace CalamityMod.Projectiles.Melee Main.dust[num199].noGravity = true; Dust expr_89E7_cp_0 = Main.dust[num199]; expr_89E7_cp_0.velocity.Y = expr_89E7_cp_0.velocity.Y - 4f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { - int num200 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 235, 0f, 0f, 100, default(Color), 1f); + int num200 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 235, 0f, 0f, 100, default, 1f); Dust expr_8A4E_cp_0 = Main.dust[num200]; expr_8A4E_cp_0.position.X = expr_8A4E_cp_0.position.X - 2f; Dust expr_8A6C_cp_0 = Main.dust[num200]; diff --git a/Projectiles/Melee/BrimlanceHellfireExplosion.cs b/Projectiles/Melee/BrimlanceHellfireExplosion.cs index 84f6453cdf..1173337346 100644 --- a/Projectiles/Melee/BrimlanceHellfireExplosion.cs +++ b/Projectiles/Melee/BrimlanceHellfireExplosion.cs @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Melee num466 = num465 / num466; num463 *= num466; num464 *= num466; - int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default(Color), 1.5f); + int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default, 1.5f); Main.dust[num467].noGravity = true; Main.dust[num467].position.X = projectile.Center.X; Main.dust[num467].position.Y = projectile.Center.Y; diff --git a/Projectiles/Melee/BrimlanceStandingFire.cs b/Projectiles/Melee/BrimlanceStandingFire.cs index 4659d84b30..7cd5d71d38 100644 --- a/Projectiles/Melee/BrimlanceStandingFire.cs +++ b/Projectiles/Melee/BrimlanceStandingFire.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Melee projectile.ai[1] = 1f; Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 13); } - int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 235, 0f, 0f, 100, default(Color), 1f); + int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 235, 0f, 0f, 100, default, 1f); Dust expr_8976_cp_0 = Main.dust[num199]; expr_8976_cp_0.position.X = expr_8976_cp_0.position.X - 2f; Dust expr_8994_cp_0 = Main.dust[num199]; @@ -65,9 +65,9 @@ namespace CalamityMod.Projectiles.Melee Main.dust[num199].noGravity = true; Dust expr_89E7_cp_0 = Main.dust[num199]; expr_89E7_cp_0.velocity.Y = expr_89E7_cp_0.velocity.Y - 2f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { - int num200 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 235, 0f, 0f, 100, default(Color), 1f); + int num200 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 235, 0f, 0f, 100, default, 1f); Dust expr_8A4E_cp_0 = Main.dust[num200]; expr_8A4E_cp_0.position.X = expr_8A4E_cp_0.position.X - 2f; Dust expr_8A6C_cp_0 = Main.dust[num200]; diff --git a/Projectiles/Melee/Brimlash.cs b/Projectiles/Melee/Brimlash.cs index 89fc1cea65..30ca157b22 100644 --- a/Projectiles/Melee/Brimlash.cs +++ b/Projectiles/Melee/Brimlash.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Melee } for (int num457 = 0; num457 < 3; num457++) { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default(Color), 1.5f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default, 1.5f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; diff --git a/Projectiles/Melee/Brimlash2.cs b/Projectiles/Melee/Brimlash2.cs index b8d519a59e..13d4fc6d0b 100644 --- a/Projectiles/Melee/Brimlash2.cs +++ b/Projectiles/Melee/Brimlash2.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Melee } for (int num457 = 0; num457 < 2; num457++) { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default(Color), 1.5f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default, 1.5f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; diff --git a/Projectiles/Melee/BrimstoneBoom.cs b/Projectiles/Melee/BrimstoneBoom.cs index 8dd0119000..bdacde1332 100644 --- a/Projectiles/Melee/BrimstoneBoom.cs +++ b/Projectiles/Melee/BrimstoneBoom.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Melee num466 = num465 / num466; num463 *= num466; num464 *= num466; - int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default(Color), 1f); + int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default, 1f); Main.dust[num467].noGravity = true; Main.dust[num467].position.X = projectile.Center.X; Main.dust[num467].position.Y = projectile.Center.Y; diff --git a/Projectiles/Melee/BrimstoneLaserFriendly.cs b/Projectiles/Melee/BrimstoneLaserFriendly.cs index c8fb577116..bc1179cade 100644 --- a/Projectiles/Melee/BrimstoneLaserFriendly.cs +++ b/Projectiles/Melee/BrimstoneLaserFriendly.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Melee projectile.velocity.Y *= 1.05f; projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; projectile.velocity.Y += projectile.ai[0]; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 235, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Melee/BrinySpout.cs b/Projectiles/Melee/BrinySpout.cs index b3fcaf80dc..bafeb542f9 100644 --- a/Projectiles/Melee/BrinySpout.cs +++ b/Projectiles/Melee/BrinySpout.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Melee float num615 = 1.5f; int num616 = 150; int num617 = 42; - if (Main.rand.Next(15) == 0) + if (Main.rand.NextBool(15)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 187, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 100, new Color(53, Main.DiscoG, 255)); } diff --git a/Projectiles/Melee/BrinyTyphoonBubble.cs b/Projectiles/Melee/BrinyTyphoonBubble.cs index a1f1c3fcd0..d60160fdf6 100644 --- a/Projectiles/Melee/BrinyTyphoonBubble.cs +++ b/Projectiles/Melee/BrinyTyphoonBubble.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Melee for (int num627 = 0; num627 < num626; num627++) { Vector2 vector45 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector45 = vector45.RotatedBy((double)(num627 - (num626 / 2 - 1)) * 3.1415926535897931 / (double)((float)num626), default(Vector2)) + projectile.Center; + vector45 = vector45.RotatedBy((double)(num627 - (num626 / 2 - 1)) * 3.1415926535897931 / (double)((float)num626), default) + projectile.Center; Vector2 value15 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); int num628 = Dust.NewDust(vector45 + value15, 0, 0, 187, value15.X * 2f, value15.Y * 2f, 100, new Color(53, Main.DiscoG, 255), 1.4f); Main.dust[num628].noGravity = true; @@ -100,7 +100,7 @@ namespace CalamityMod.Projectiles.Melee for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 187, vector7.X * 2f, vector7.Y * 2f, 100, new Color(53, Main.DiscoG, 255), 1.4f); Main.dust[num228].noGravity = true; diff --git a/Projectiles/Melee/BurningMeteor.cs b/Projectiles/Melee/BurningMeteor.cs index 024efa3dbf..7020a7282b 100644 --- a/Projectiles/Melee/BurningMeteor.cs +++ b/Projectiles/Melee/BurningMeteor.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Melee if (projectile.soundDelay == 0) { projectile.soundDelay = 20 + Main.rand.Next(40); - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); } @@ -53,9 +53,9 @@ namespace CalamityMod.Projectiles.Melee for (int l = 0; l < 12; l++) { Vector2 vector3 = Vector2.UnitX * (float)(-(float)projectile.width) / 2f; - vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default(Vector2)) * new Vector2(8f, 16f); - vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default(Vector2)); - int num9 = Dust.NewDust(projectile.Center, 0, 0, 244, 0f, 0f, 160, default(Color), 1f); + vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default) * new Vector2(8f, 16f); + vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default); + int num9 = Dust.NewDust(projectile.Center, 0, 0, 244, 0f, 0f, 160, default, 1f); Main.dust[num9].scale = 1.1f; Main.dust[num9].noGravity = true; Main.dust[num9].position = projectile.Center + vector3; @@ -74,23 +74,23 @@ namespace CalamityMod.Projectiles.Melee projectile.alpha = num58; } projectile.rotation = projectile.velocity.ToRotation() - 1.57079637f; - if (Main.rand.Next(36) == 0) + if (Main.rand.NextBool(36)) { - Vector2 value3 = Vector2.UnitX.RotatedByRandom(1.5707963705062866).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)); - int num59 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default(Color), 1.2f); + Vector2 value3 = Vector2.UnitX.RotatedByRandom(1.5707963705062866).RotatedBy((double)projectile.velocity.ToRotation(), default); + int num59 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default, 1.2f); Main.dust[num59].velocity = value3 * 0.66f; Main.dust[num59].position = projectile.Center + value3 * 12f; } if (projectile.ai[1] == 1f) { projectile.light = 0.9f; - if (Main.rand.Next(30) == 0) + if (Main.rand.NextBool(30)) { - Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default(Color), 1.2f); + Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default, 1.2f); } - if (Main.rand.Next(60) == 0) + if (Main.rand.NextBool(60)) { - Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, projectile.velocity.X * 1.5f, projectile.velocity.Y * 1.5f, 150, default(Color), 2f); + Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, projectile.velocity.X * 1.5f, projectile.velocity.Y * 1.5f, 150, default, 2f); } } Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.75f) / 255f, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0f) / 255f); diff --git a/Projectiles/Melee/CalamityAura.cs b/Projectiles/Melee/CalamityAura.cs index a9881b7e7c..8b530f0fb2 100644 --- a/Projectiles/Melee/CalamityAura.cs +++ b/Projectiles/Melee/CalamityAura.cs @@ -27,15 +27,15 @@ namespace CalamityMod.Projectiles.Melee for (int num151 = 0; num151 < 3; num151++) { int num154 = 14; - int num155 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num154 * 2, projectile.height - num154 * 2, 73, 0f, 0f, 100, default(Color), 1.35f); + int num155 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num154 * 2, projectile.height - num154 * 2, 73, 0f, 0f, 100, default, 1.35f); Main.dust[num155].noGravity = true; Main.dust[num155].velocity *= 0.1f; Main.dust[num155].velocity += projectile.velocity * 0.5f; } - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { int num156 = 16; - int num157 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num156 * 2, projectile.height - num156 * 2, 73, 0f, 0f, 100, default(Color), 1f); + int num157 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num156 * 2, projectile.height - num156 * 2, 73, 0f, 0f, 100, default, 1f); Main.dust[num157].velocity *= 0.25f; Main.dust[num157].noGravity = true; Main.dust[num157].velocity += projectile.velocity * 0.5f; @@ -67,14 +67,14 @@ namespace CalamityMod.Projectiles.Melee int num3; for (int num53 = 0; num53 < 40; num53 = num3 + 1) { - int num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 73, 0f, 0f, 200, default(Color), num50); + int num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 73, 0f, 0f, 200, default, num50); Main.dust[num54].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; Main.dust[num54].noGravity = true; Dust dust = Main.dust[num54]; dust.velocity *= 3f; dust = Main.dust[num54]; dust.velocity += value4 * Main.rand.NextFloat(); - num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 73, 0f, 0f, 100, default(Color), num51); + num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 73, 0f, 0f, 100, default, num51); Main.dust[num54].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; dust = Main.dust[num54]; dust.velocity *= 2f; @@ -87,8 +87,8 @@ namespace CalamityMod.Projectiles.Melee } for (int num55 = 0; num55 < 20; num55 = num3 + 1) { - int num56 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 73, 0f, 0f, 0, default(Color), num52); - Main.dust[num56].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)) * (float)projectile.width / 3f; + int num56 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 73, 0f, 0f, 0, default, num52); + Main.dust[num56].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default) * (float)projectile.width / 3f; Main.dust[num56].noGravity = true; Dust dust = Main.dust[num56]; dust.velocity *= 0.5f; diff --git a/Projectiles/Melee/CalamityAuraType2.cs b/Projectiles/Melee/CalamityAuraType2.cs index 941cc3ed4b..eeede10057 100644 --- a/Projectiles/Melee/CalamityAuraType2.cs +++ b/Projectiles/Melee/CalamityAuraType2.cs @@ -27,15 +27,15 @@ namespace CalamityMod.Projectiles.Melee for (int num151 = 0; num151 < 3; num151++) { int num154 = 14; - int num155 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num154 * 2, projectile.height - num154 * 2, 56, 0f, 0f, 100, default(Color), 1.35f); + int num155 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num154 * 2, projectile.height - num154 * 2, 56, 0f, 0f, 100, default, 1.35f); Main.dust[num155].noGravity = true; Main.dust[num155].velocity *= 0.1f; Main.dust[num155].velocity += projectile.velocity * 0.5f; } - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { int num156 = 16; - int num157 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num156 * 2, projectile.height - num156 * 2, 56, 0f, 0f, 100, default(Color), 1f); + int num157 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num156 * 2, projectile.height - num156 * 2, 56, 0f, 0f, 100, default, 1f); Main.dust[num157].velocity *= 0.25f; Main.dust[num157].noGravity = true; Main.dust[num157].velocity += projectile.velocity * 0.5f; @@ -67,14 +67,14 @@ namespace CalamityMod.Projectiles.Melee int num3; for (int num53 = 0; num53 < 40; num53 = num3 + 1) { - int num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 200, default(Color), num50); + int num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 200, default, num50); Main.dust[num54].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; Main.dust[num54].noGravity = true; Dust dust = Main.dust[num54]; dust.velocity *= 3f; dust = Main.dust[num54]; dust.velocity += value4 * Main.rand.NextFloat(); - num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 100, default(Color), num51); + num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 100, default, num51); Main.dust[num54].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; dust = Main.dust[num54]; dust.velocity *= 2f; @@ -87,8 +87,8 @@ namespace CalamityMod.Projectiles.Melee } for (int num55 = 0; num55 < 20; num55 = num3 + 1) { - int num56 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 0, default(Color), num52); - Main.dust[num56].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)) * (float)projectile.width / 3f; + int num56 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 0, default, num52); + Main.dust[num56].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default) * (float)projectile.width / 3f; Main.dust[num56].noGravity = true; Dust dust = Main.dust[num56]; dust.velocity *= 0.5f; diff --git a/Projectiles/Melee/CalamityAuraType3.cs b/Projectiles/Melee/CalamityAuraType3.cs index 3054457f38..e6170c3166 100644 --- a/Projectiles/Melee/CalamityAuraType3.cs +++ b/Projectiles/Melee/CalamityAuraType3.cs @@ -27,15 +27,15 @@ namespace CalamityMod.Projectiles.Melee for (int num151 = 0; num151 < 3; num151++) { int num154 = 14; - int num155 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num154 * 2, projectile.height - num154 * 2, 57, 0f, 0f, 100, default(Color), 1.35f); + int num155 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num154 * 2, projectile.height - num154 * 2, 57, 0f, 0f, 100, default, 1.35f); Main.dust[num155].noGravity = true; Main.dust[num155].velocity *= 0.1f; Main.dust[num155].velocity += projectile.velocity * 0.5f; } - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { int num156 = 16; - int num157 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num156 * 2, projectile.height - num156 * 2, 57, 0f, 0f, 100, default(Color), 1f); + int num157 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num156 * 2, projectile.height - num156 * 2, 57, 0f, 0f, 100, default, 1f); Main.dust[num157].velocity *= 0.25f; Main.dust[num157].noGravity = true; Main.dust[num157].velocity += projectile.velocity * 0.5f; @@ -67,14 +67,14 @@ namespace CalamityMod.Projectiles.Melee int num3; for (int num53 = 0; num53 < 40; num53 = num3 + 1) { - int num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 57, 0f, 0f, 200, default(Color), num50); + int num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 57, 0f, 0f, 200, default, num50); Main.dust[num54].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; Main.dust[num54].noGravity = true; Dust dust = Main.dust[num54]; dust.velocity *= 3f; dust = Main.dust[num54]; dust.velocity += value4 * Main.rand.NextFloat(); - num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 57, 0f, 0f, 100, default(Color), num51); + num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 57, 0f, 0f, 100, default, num51); Main.dust[num54].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; dust = Main.dust[num54]; dust.velocity *= 2f; @@ -87,8 +87,8 @@ namespace CalamityMod.Projectiles.Melee } for (int num55 = 0; num55 < 20; num55 = num3 + 1) { - int num56 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 57, 0f, 0f, 0, default(Color), num52); - Main.dust[num56].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)) * (float)projectile.width / 3f; + int num56 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 57, 0f, 0f, 0, default, num52); + Main.dust[num56].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default) * (float)projectile.width / 3f; Main.dust[num56].noGravity = true; Dust dust = Main.dust[num56]; dust.velocity *= 0.5f; diff --git a/Projectiles/Melee/ChaosFlameLarge.cs b/Projectiles/Melee/ChaosFlameLarge.cs index 682b1c4db2..52f3043725 100644 --- a/Projectiles/Melee/ChaosFlameLarge.cs +++ b/Projectiles/Melee/ChaosFlameLarge.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Melee { projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; Lighting.AddLight(projectile.Center, 0.4f, 0f, 0f); - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { int num469 = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 174, 0f, 0f); Main.dust[num469].noGravity = true; diff --git a/Projectiles/Melee/ChaosFlameMedium.cs b/Projectiles/Melee/ChaosFlameMedium.cs index cb8a1f3a9e..d830c0f6a3 100644 --- a/Projectiles/Melee/ChaosFlameMedium.cs +++ b/Projectiles/Melee/ChaosFlameMedium.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Melee { projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; Lighting.AddLight(projectile.Center, 0.4f, 0f, 0f); - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { int num469 = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 174, 0f, 0f); Main.dust[num469].noGravity = true; diff --git a/Projectiles/Melee/ChaosFlameSmall.cs b/Projectiles/Melee/ChaosFlameSmall.cs index e1b009f6d0..af6d08a9ea 100644 --- a/Projectiles/Melee/ChaosFlameSmall.cs +++ b/Projectiles/Melee/ChaosFlameSmall.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Melee { projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; Lighting.AddLight(projectile.Center, 0.4f, 0f, 0f); - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { int num469 = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 174, 0f, 0f); Main.dust[num469].noGravity = true; diff --git a/Projectiles/Melee/CosmicBolt.cs b/Projectiles/Melee/CosmicBolt.cs index 1c07c8eff6..62d9b2be97 100644 --- a/Projectiles/Melee/CosmicBolt.cs +++ b/Projectiles/Melee/CosmicBolt.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Melee Vector2 vector30 = projectile.position; vector30 -= projectile.velocity * ((float)num441 * 0.25f); projectile.alpha = 255; - int num442 = Dust.NewDust(vector30, 1, 1, 107, 0f, 0f, 0, default(Color), 1.3f); + int num442 = Dust.NewDust(vector30, 1, 1, 107, 0f, 0f, 0, default, 1.3f); Main.dust[num442].position = vector30; Dust expr_13A3E_cp_0 = Main.dust[num442]; expr_13A3E_cp_0.position.X = expr_13A3E_cp_0.position.X + (float)(projectile.width / 2); diff --git a/Projectiles/Melee/CosmicDischarge.cs b/Projectiles/Melee/CosmicDischarge.cs index cbf2a7312e..6fc88f0c0d 100644 --- a/Projectiles/Melee/CosmicDischarge.cs +++ b/Projectiles/Melee/CosmicDischarge.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Melee { vector17.Y *= -1f; } - vector17 = vector17.RotatedBy((double)projectile.localAI[0], default(Vector2)); + vector17 = vector17.RotatedBy((double)projectile.localAI[0], default); projectile.ai[0] += 1f; if (projectile.ai[0] < 30f) { @@ -104,7 +104,7 @@ namespace CalamityMod.Projectiles.Melee int num53 = 0; while ((float)num53 < num52) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Vector2 position = projectile.position + projectile.velocity + projectile.velocity * ((float)num53 / num52); Dust dust2 = Main.dust[Dust.NewDust(position, projectile.width, projectile.height, 187, 0f, 0f, 100, new Color(150, Main.DiscoG, 255), 1f)]; @@ -222,7 +222,7 @@ namespace CalamityMod.Projectiles.Melee { Player player = Main.player[projectile.owner]; target.AddBuff(BuffID.Frostburn, 300); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { target.AddBuff(mod.BuffType("GlacialState"), 120); } diff --git a/Projectiles/Melee/CosmicIceBurst.cs b/Projectiles/Melee/CosmicIceBurst.cs index 2454706c9c..32adfdb6d9 100644 --- a/Projectiles/Melee/CosmicIceBurst.cs +++ b/Projectiles/Melee/CosmicIceBurst.cs @@ -79,14 +79,14 @@ namespace CalamityMod.Projectiles.Melee for (int num1004 = 0; num1004 < 5; num1004++) { int num1005 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 67, 0f, 0f, 0, new Color(150, Main.DiscoG, 255), 2.7f); - Main.dust[num1005].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)) * (float)projectile.width / 2f; + Main.dust[num1005].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default) * (float)projectile.width / 2f; Main.dust[num1005].noGravity = true; Main.dust[num1005].velocity *= 3f; } for (int num1006 = 0; num1006 < 10; num1006++) { int num1007 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 187, 0f, 0f, 0, new Color(150, Main.DiscoG, 255), 1.5f); - Main.dust[num1007].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)) * (float)projectile.width / 2f; + Main.dust[num1007].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default) * (float)projectile.width / 2f; Main.dust[num1007].noGravity = true; Main.dust[num1007].velocity *= 3f; } diff --git a/Projectiles/Melee/CosmicOrb.cs b/Projectiles/Melee/CosmicOrb.cs index 05f488e518..6bd4b43bf4 100644 --- a/Projectiles/Melee/CosmicOrb.cs +++ b/Projectiles/Melee/CosmicOrb.cs @@ -106,7 +106,7 @@ namespace CalamityMod.Projectiles.Melee for (int num191 = 0; num191 < 10; num191 = num3 + 1) { int num192 = (int)(10f * projectile.scale); - int num193 = Dust.NewDust(projectile.Center - Vector2.One * (float)num192, num192 * 2, num192 * 2, 107, 0f, 0f, 0, default(Color), 1f); + int num193 = Dust.NewDust(projectile.Center - Vector2.One * (float)num192, num192 * 2, num192 * 2, 107, 0f, 0f, 0, default, 1f); Dust dust20 = Main.dust[num193]; Vector2 value8 = Vector2.Normalize(dust20.position - projectile.Center); dust20.position = projectile.Center + value8 * (float)num192 * projectile.scale; diff --git a/Projectiles/Melee/CosmicSpiritBomb1.cs b/Projectiles/Melee/CosmicSpiritBomb1.cs index 39bf4af8cb..75e51fe311 100644 --- a/Projectiles/Melee/CosmicSpiritBomb1.cs +++ b/Projectiles/Melee/CosmicSpiritBomb1.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Melee { for (int num468 = 0; num468 < 5; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 15, 0f, 0f, 100, default(Color), 1.5f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 15, 0f, 0f, 100, default, 1.5f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Melee/CosmicSpiritBomb2.cs b/Projectiles/Melee/CosmicSpiritBomb2.cs index 18c962b389..c4fad26010 100644 --- a/Projectiles/Melee/CosmicSpiritBomb2.cs +++ b/Projectiles/Melee/CosmicSpiritBomb2.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Melee { for (int num468 = 0; num468 < 5; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 73, 0f, 0f, 100, default(Color), 1.5f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 73, 0f, 0f, 100, default, 1.5f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Melee/CosmicSpiritBomb3.cs b/Projectiles/Melee/CosmicSpiritBomb3.cs index dcff0f91c9..3de4d88d64 100644 --- a/Projectiles/Melee/CosmicSpiritBomb3.cs +++ b/Projectiles/Melee/CosmicSpiritBomb3.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Melee { for (int num468 = 0; num468 < 5; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 1.5f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1.5f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Melee/CrystalDust.cs b/Projectiles/Melee/CrystalDust.cs index 0829662b9e..368c44784f 100644 --- a/Projectiles/Melee/CrystalDust.cs +++ b/Projectiles/Melee/CrystalDust.cs @@ -2,6 +2,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.GameContent.Achievements; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee @@ -45,7 +46,7 @@ namespace CalamityMod.Projectiles.Melee } for (int num468 = 0; num468 < 5; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num307, 0f, 0f, 100, default(Color), 2f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num307, 0f, 0f, 100, default, 2f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } @@ -88,7 +89,7 @@ namespace CalamityMod.Projectiles.Melee if (Main.tile[num824, num825] != null && Main.tile[num824, num825].active()) { WorldGen.KillTile(num824, num825, false, false, false); - if (!Main.tile[num824, num825].active() && Main.netMode != 0) + if (!Main.tile[num824, num825].active() && Main.netMode != NetmodeID.SinglePlayer) { NetMessage.SendData(17, -1, -1, null, 0, (float)num824, (float)num825, 0f, 0, 0, 0); } @@ -97,7 +98,7 @@ namespace CalamityMod.Projectiles.Melee } } AchievementsHelper.CurrentlyMining = false; - if (Main.netMode != 0) + if (Main.netMode != NetmodeID.SinglePlayer) { NetMessage.SendData(29, -1, -1, null, projectile.identity, (float)projectile.owner, 0f, 0f, 0, 0, 0); } diff --git a/Projectiles/Melee/DNA.cs b/Projectiles/Melee/DNA.cs index e3510f34f8..5338a7ac40 100644 --- a/Projectiles/Melee/DNA.cs +++ b/Projectiles/Melee/DNA.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Melee { for (int num55 = 0; num55 < 8; num55++) { - int num56 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 234, projectile.velocity.X * 0.005f, projectile.velocity.Y * 0.005f, 200, default(Color), 1f); + int num56 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 234, projectile.velocity.X * 0.005f, projectile.velocity.Y * 0.005f, 200, default, 1f); Main.dust[num56].noGravity = true; Main.dust[num56].velocity *= 0.5f; } @@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.Melee projectile.Kill(); } } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 234, projectile.velocity.X * 0.005f, projectile.velocity.Y * 0.005f); } diff --git a/Projectiles/Melee/DNA2.cs b/Projectiles/Melee/DNA2.cs index 9e975c1c49..df38cdd764 100644 --- a/Projectiles/Melee/DNA2.cs +++ b/Projectiles/Melee/DNA2.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Melee { for (int num55 = 0; num55 < 8; num55++) { - int num56 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 234, projectile.velocity.X * 0.005f, projectile.velocity.Y * 0.005f, 200, default(Color), 1f); + int num56 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 234, projectile.velocity.X * 0.005f, projectile.velocity.Y * 0.005f, 200, default, 1f); Main.dust[num56].noGravity = true; Main.dust[num56].velocity *= 0.5f; } @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Melee projectile.Kill(); } } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 234, projectile.velocity.X * 0.005f, projectile.velocity.Y * 0.005f); } diff --git a/Projectiles/Melee/DarkBall.cs b/Projectiles/Melee/DarkBall.cs index 1c090c89e9..ca8c54b17c 100644 --- a/Projectiles/Melee/DarkBall.cs +++ b/Projectiles/Melee/DarkBall.cs @@ -110,15 +110,15 @@ namespace CalamityMod.Projectiles.Melee projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num648 = 0; num648 < 20; num648++) { - int num649 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 14, 0f, 0f, 100, default(Color), 1.5f); + int num649 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 14, 0f, 0f, 100, default, 1.5f); Main.dust[num649].velocity *= 1.4f; } for (int num650 = 0; num650 < 10; num650++) { - int num651 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 14, 0f, 0f, 100, default(Color), 2.5f); + int num651 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 14, 0f, 0f, 100, default, 2.5f); Main.dust[num651].noGravity = true; Main.dust[num651].velocity *= 5f; - num651 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 14, 0f, 0f, 100, default(Color), 1.5f); + num651 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 14, 0f, 0f, 100, default, 1.5f); Main.dust[num651].velocity *= 3f; } } diff --git a/Projectiles/Melee/DemonBlast.cs b/Projectiles/Melee/DemonBlast.cs index 8f2c426d51..7b0c74d39d 100644 --- a/Projectiles/Melee/DemonBlast.cs +++ b/Projectiles/Melee/DemonBlast.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Melee return; } bool flag5 = WorldGen.SolidTile(Framing.GetTileSafely((int)projectile.position.X / 16, (int)projectile.position.Y / 16)); - Dust dust6 = Main.dust[Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 0, default(Color), 1f)]; + Dust dust6 = Main.dust[Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 0, default, 1f)]; dust6.position = projectile.Center; dust6.velocity = Vector2.Zero; dust6.noGravity = true; @@ -102,18 +102,18 @@ namespace CalamityMod.Projectiles.Melee bool flag = WorldGen.SolidTile(Framing.GetTileSafely((int)projectile.position.X / 16, (int)projectile.position.Y / 16)); for (int m = 0; m < 4; m++) { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 1.5f); + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1.5f); } for (int n = 0; n < 4; n++) { - int num10 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 0, default(Color), 2.5f); + int num10 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 0, default, 2.5f); Main.dust[num10].noGravity = true; Main.dust[num10].velocity *= 3f; if (flag) { Main.dust[num10].noLight = true; } - num10 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 1.5f); + num10 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1.5f); Main.dust[num10].velocity *= 2f; Main.dust[num10].noGravity = true; if (flag) diff --git a/Projectiles/Melee/DemonBlastType2.cs b/Projectiles/Melee/DemonBlastType2.cs index 3a6de7089e..8ff8d315f3 100644 --- a/Projectiles/Melee/DemonBlastType2.cs +++ b/Projectiles/Melee/DemonBlastType2.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Melee return; } bool flag5 = WorldGen.SolidTile(Framing.GetTileSafely((int)projectile.position.X / 16, (int)projectile.position.Y / 16)); - Dust dust6 = Main.dust[Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 0, default(Color), 1f)]; + Dust dust6 = Main.dust[Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 0, default, 1f)]; dust6.position = projectile.Center; dust6.velocity = Vector2.Zero; dust6.noGravity = true; @@ -101,18 +101,18 @@ namespace CalamityMod.Projectiles.Melee bool flag = WorldGen.SolidTile(Framing.GetTileSafely((int)projectile.position.X / 16, (int)projectile.position.Y / 16)); for (int m = 0; m < 4; m++) { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default(Color), 1.5f); + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default, 1.5f); } for (int n = 0; n < 4; n++) { - int num10 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 0, default(Color), 2.5f); + int num10 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 0, default, 2.5f); Main.dust[num10].noGravity = true; Main.dust[num10].velocity *= 3f; if (flag) { Main.dust[num10].noLight = true; } - num10 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default(Color), 1.5f); + num10 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default, 1.5f); Main.dust[num10].velocity *= 2f; Main.dust[num10].noGravity = true; if (flag) diff --git a/Projectiles/Melee/DemonBlastType3.cs b/Projectiles/Melee/DemonBlastType3.cs index 5b6654f781..b675aac00f 100644 --- a/Projectiles/Melee/DemonBlastType3.cs +++ b/Projectiles/Melee/DemonBlastType3.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Melee return; } bool flag5 = WorldGen.SolidTile(Framing.GetTileSafely((int)projectile.position.X / 16, (int)projectile.position.Y / 16)); - Dust dust6 = Main.dust[Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 172, 0f, 0f, 0, default(Color), 1f)]; + Dust dust6 = Main.dust[Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 172, 0f, 0f, 0, default, 1f)]; dust6.position = projectile.Center; dust6.velocity = Vector2.Zero; dust6.noGravity = true; @@ -101,18 +101,18 @@ namespace CalamityMod.Projectiles.Melee bool flag = WorldGen.SolidTile(Framing.GetTileSafely((int)projectile.position.X / 16, (int)projectile.position.Y / 16)); for (int m = 0; m < 4; m++) { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 172, 0f, 0f, 100, default(Color), 1.5f); + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 172, 0f, 0f, 100, default, 1.5f); } for (int n = 0; n < 4; n++) { - int num10 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 172, 0f, 0f, 0, default(Color), 2.5f); + int num10 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 172, 0f, 0f, 0, default, 2.5f); Main.dust[num10].noGravity = true; Main.dust[num10].velocity *= 3f; if (flag) { Main.dust[num10].noLight = true; } - num10 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 172, 0f, 0f, 100, default(Color), 1.5f); + num10 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 172, 0f, 0f, 100, default, 1.5f); Main.dust[num10].velocity *= 2f; Main.dust[num10].noGravity = true; if (flag) diff --git a/Projectiles/Melee/DepthOrb.cs b/Projectiles/Melee/DepthOrb.cs index cc457b4066..41052dd469 100644 --- a/Projectiles/Melee/DepthOrb.cs +++ b/Projectiles/Melee/DepthOrb.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { Lighting.AddLight(projectile.Center, 0f, 0f, 0.5f); - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default(Color), 0.6f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default, 0.6f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Melee num466 = num465 / num466; num463 *= num466; num464 *= num466; - int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default(Color), 1.2f); + int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default, 1.2f); Main.dust[num467].noGravity = true; Main.dust[num467].position.X = projectile.Center.X; Main.dust[num467].position.Y = projectile.Center.Y; diff --git a/Projectiles/Melee/DepthOrb2.cs b/Projectiles/Melee/DepthOrb2.cs index c39df1eaef..47f2f3b26a 100644 --- a/Projectiles/Melee/DepthOrb2.cs +++ b/Projectiles/Melee/DepthOrb2.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { Lighting.AddLight(projectile.Center, 0f, 0f, 0.5f); - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default(Color), 0.4f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default, 0.4f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; @@ -100,7 +100,7 @@ namespace CalamityMod.Projectiles.Melee num466 = num465 / num466; num463 *= num466; num464 *= num466; - int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default(Color), 1.2f); + int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default, 1.2f); Main.dust[num467].noGravity = true; Main.dust[num467].position.X = projectile.Center.X; Main.dust[num467].position.Y = projectile.Center.Y; diff --git a/Projectiles/Melee/DragonRage.cs b/Projectiles/Melee/DragonRage.cs index 1cca36d6f0..0a32652303 100644 --- a/Projectiles/Melee/DragonRage.cs +++ b/Projectiles/Melee/DragonRage.cs @@ -69,9 +69,9 @@ namespace CalamityMod.Projectiles.Melee projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 6; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -79,10 +79,10 @@ namespace CalamityMod.Projectiles.Melee } for (int num623 = 0; num623 < 9; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } for (int num625 = 0; num625 < 2; num625++) @@ -96,25 +96,25 @@ namespace CalamityMod.Projectiles.Melee { scaleFactor10 = 1f; } - int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13AB6_cp_0 = Main.gore[num626]; expr_13AB6_cp_0.velocity.X = expr_13AB6_cp_0.velocity.X + 1f; Gore expr_13AD6_cp_0 = Main.gore[num626]; expr_13AD6_cp_0.velocity.Y = expr_13AD6_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13B79_cp_0 = Main.gore[num626]; expr_13B79_cp_0.velocity.X = expr_13B79_cp_0.velocity.X - 1f; Gore expr_13B99_cp_0 = Main.gore[num626]; expr_13B99_cp_0.velocity.Y = expr_13B99_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13C3C_cp_0 = Main.gore[num626]; expr_13C3C_cp_0.velocity.X = expr_13C3C_cp_0.velocity.X + 1f; Gore expr_13C5C_cp_0 = Main.gore[num626]; expr_13C5C_cp_0.velocity.Y = expr_13C5C_cp_0.velocity.Y - 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13CFF_cp_0 = Main.gore[num626]; expr_13CFF_cp_0.velocity.X = expr_13CFF_cp_0.velocity.X - 1f; diff --git a/Projectiles/Melee/Earth.cs b/Projectiles/Melee/Earth.cs index c5a3637a05..972328d90b 100644 --- a/Projectiles/Melee/Earth.cs +++ b/Projectiles/Melee/Earth.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Melee if (projectile.soundDelay == 0) { projectile.soundDelay = 20 + Main.rand.Next(40); - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9); } @@ -69,14 +69,14 @@ namespace CalamityMod.Projectiles.Melee { dustChoice = 244; } - if (Main.rand.Next(16) == 0) + if (Main.rand.NextBool(16)) { - Vector2 value3 = Vector2.UnitX.RotatedByRandom(1.5707963705062866).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)); - int num59 = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustChoice, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default(Color), 1.2f); + Vector2 value3 = Vector2.UnitX.RotatedByRandom(1.5707963705062866).RotatedBy((double)projectile.velocity.ToRotation(), default); + int num59 = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustChoice, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default, 1.2f); Main.dust[num59].velocity = value3 * 0.66f; Main.dust[num59].position = projectile.Center + value3 * 12f; } - if (Main.rand.Next(48) == 0) + if (Main.rand.NextBool(48)) { int num60 = Gore.NewGore(projectile.Center, new Vector2(projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f), 16, 1f); Main.gore[num60].velocity *= 0.66f; @@ -85,11 +85,11 @@ namespace CalamityMod.Projectiles.Melee if (projectile.ai[1] == 1f) { projectile.light = 0.9f; - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { - Dust.NewDust(projectile.position, projectile.width, projectile.height, dustChoice, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default(Color), 1.2f); + Dust.NewDust(projectile.position, projectile.width, projectile.height, dustChoice, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default, 1.2f); } - if (Main.rand.Next(20) == 0) + if (Main.rand.NextBool(20)) { Gore.NewGore(projectile.position, new Vector2(projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f), Main.rand.Next(16, 18), 1f); } diff --git a/Projectiles/Melee/Earth2.cs b/Projectiles/Melee/Earth2.cs index 33986b78e9..abf7dc71bd 100644 --- a/Projectiles/Melee/Earth2.cs +++ b/Projectiles/Melee/Earth2.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Melee if (projectile.soundDelay == 0) { projectile.soundDelay = 20 + Main.rand.Next(40); - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9); } @@ -55,14 +55,14 @@ namespace CalamityMod.Projectiles.Melee } projectile.localAI[0] += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.01f * (float)projectile.direction; projectile.rotation = projectile.velocity.ToRotation() - 1.57079637f; - if (Main.rand.Next(16) == 0) + if (Main.rand.NextBool(16)) { - Vector2 value3 = Vector2.UnitX.RotatedByRandom(1.5707963705062866).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)); - int num59 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 229, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default(Color), 1.2f); + Vector2 value3 = Vector2.UnitX.RotatedByRandom(1.5707963705062866).RotatedBy((double)projectile.velocity.ToRotation(), default); + int num59 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 229, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default, 1.2f); Main.dust[num59].velocity = value3 * 0.66f; Main.dust[num59].position = projectile.Center + value3 * 12f; } - if (Main.rand.Next(48) == 0) + if (Main.rand.NextBool(48)) { int num60 = Gore.NewGore(projectile.Center, new Vector2(projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f), 16, 1f); Main.gore[num60].velocity *= 0.66f; @@ -71,11 +71,11 @@ namespace CalamityMod.Projectiles.Melee if (projectile.ai[1] == 1f) { projectile.light = 0.9f; - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { - Dust.NewDust(projectile.position, projectile.width, projectile.height, 229, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default(Color), 1.2f); + Dust.NewDust(projectile.position, projectile.width, projectile.height, 229, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default, 1.2f); } - if (Main.rand.Next(20) == 0) + if (Main.rand.NextBool(20)) { Gore.NewGore(projectile.position, new Vector2(projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f), Main.rand.Next(16, 18), 1f); } diff --git a/Projectiles/Melee/Earth3.cs b/Projectiles/Melee/Earth3.cs index 3fb5a9a661..32cad209ba 100644 --- a/Projectiles/Melee/Earth3.cs +++ b/Projectiles/Melee/Earth3.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Melee if (projectile.soundDelay == 0) { projectile.soundDelay = 20 + Main.rand.Next(40); - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9); } @@ -55,14 +55,14 @@ namespace CalamityMod.Projectiles.Melee } projectile.localAI[0] += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.01f * (float)projectile.direction; projectile.rotation = projectile.velocity.ToRotation() - 1.57079637f; - if (Main.rand.Next(16) == 0) + if (Main.rand.NextBool(16)) { - Vector2 value3 = Vector2.UnitX.RotatedByRandom(1.5707963705062866).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)); - int num59 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default(Color), 1.2f); + Vector2 value3 = Vector2.UnitX.RotatedByRandom(1.5707963705062866).RotatedBy((double)projectile.velocity.ToRotation(), default); + int num59 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default, 1.2f); Main.dust[num59].velocity = value3 * 0.66f; Main.dust[num59].position = projectile.Center + value3 * 12f; } - if (Main.rand.Next(48) == 0) + if (Main.rand.NextBool(48)) { int num60 = Gore.NewGore(projectile.Center, new Vector2(projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f), 16, 1f); Main.gore[num60].velocity *= 0.66f; @@ -71,11 +71,11 @@ namespace CalamityMod.Projectiles.Melee if (projectile.ai[1] == 1f) { projectile.light = 0.9f; - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { - Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default(Color), 1.2f); + Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default, 1.2f); } - if (Main.rand.Next(20) == 0) + if (Main.rand.NextBool(20)) { Gore.NewGore(projectile.position, new Vector2(projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f), Main.rand.Next(16, 18), 1f); } @@ -94,9 +94,9 @@ namespace CalamityMod.Projectiles.Melee projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -104,10 +104,10 @@ namespace CalamityMod.Projectiles.Melee } for (int num623 = 0; num623 < 35; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } for (int num625 = 0; num625 < 3; num625++) @@ -121,25 +121,25 @@ namespace CalamityMod.Projectiles.Melee { scaleFactor10 = 1f; } - int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13AB6_cp_0 = Main.gore[num626]; expr_13AB6_cp_0.velocity.X = expr_13AB6_cp_0.velocity.X + 1f; Gore expr_13AD6_cp_0 = Main.gore[num626]; expr_13AD6_cp_0.velocity.Y = expr_13AD6_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13B79_cp_0 = Main.gore[num626]; expr_13B79_cp_0.velocity.X = expr_13B79_cp_0.velocity.X - 1f; Gore expr_13B99_cp_0 = Main.gore[num626]; expr_13B99_cp_0.velocity.Y = expr_13B99_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13C3C_cp_0 = Main.gore[num626]; expr_13C3C_cp_0.velocity.X = expr_13C3C_cp_0.velocity.X + 1f; Gore expr_13C5C_cp_0 = Main.gore[num626]; expr_13C5C_cp_0.velocity.Y = expr_13C5C_cp_0.velocity.Y - 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13CFF_cp_0 = Main.gore[num626]; expr_13CFF_cp_0.velocity.X = expr_13CFF_cp_0.velocity.X - 1f; diff --git a/Projectiles/Melee/Earth4.cs b/Projectiles/Melee/Earth4.cs index 1139aeedf3..86e46fac19 100644 --- a/Projectiles/Melee/Earth4.cs +++ b/Projectiles/Melee/Earth4.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Melee if (projectile.soundDelay == 0) { projectile.soundDelay = 20 + Main.rand.Next(40); - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9); } @@ -55,14 +55,14 @@ namespace CalamityMod.Projectiles.Melee } projectile.localAI[0] += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.01f * (float)projectile.direction; projectile.rotation = projectile.velocity.ToRotation() - 1.57079637f; - if (Main.rand.Next(16) == 0) + if (Main.rand.NextBool(16)) { - Vector2 value3 = Vector2.UnitX.RotatedByRandom(1.5707963705062866).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)); - int num59 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 74, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default(Color), 1.2f); + Vector2 value3 = Vector2.UnitX.RotatedByRandom(1.5707963705062866).RotatedBy((double)projectile.velocity.ToRotation(), default); + int num59 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 74, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default, 1.2f); Main.dust[num59].velocity = value3 * 0.66f; Main.dust[num59].position = projectile.Center + value3 * 12f; } - if (Main.rand.Next(48) == 0) + if (Main.rand.NextBool(48)) { int num60 = Gore.NewGore(projectile.Center, new Vector2(projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f), 16, 1f); Main.gore[num60].velocity *= 0.66f; @@ -71,11 +71,11 @@ namespace CalamityMod.Projectiles.Melee if (projectile.ai[1] == 1f) { projectile.light = 0.9f; - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { - Dust.NewDust(projectile.position, projectile.width, projectile.height, 74, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default(Color), 1.2f); + Dust.NewDust(projectile.position, projectile.width, projectile.height, 74, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default, 1.2f); } - if (Main.rand.Next(20) == 0) + if (Main.rand.NextBool(20)) { Gore.NewGore(projectile.position, new Vector2(projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f), Main.rand.Next(16, 18), 1f); } diff --git a/Projectiles/Melee/EradicatorMeleeProjectile.cs b/Projectiles/Melee/EradicatorMeleeProjectile.cs index 18a0a2592d..9302107bef 100644 --- a/Projectiles/Melee/EradicatorMeleeProjectile.cs +++ b/Projectiles/Melee/EradicatorMeleeProjectile.cs @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Melee num440 = num437 / num440; num438 *= num440; num439 *= num440; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { if (projectile.owner == Main.myPlayer) { diff --git a/Projectiles/Melee/EssenceBeam.cs b/Projectiles/Melee/EssenceBeam.cs index 519672571e..5ecb336623 100644 --- a/Projectiles/Melee/EssenceBeam.cs +++ b/Projectiles/Melee/EssenceBeam.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Melee Vector2 vector33 = projectile.position; vector33 -= projectile.velocity * ((float)num447 * 0.25f); projectile.alpha = 255; - int num448 = Dust.NewDust(vector33, 1, 1, 173, 0f, 0f, 0, default(Color), 1f); + int num448 = Dust.NewDust(vector33, 1, 1, 173, 0f, 0f, 0, default, 1f); Main.dust[num448].position = vector33; Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f; Main.dust[num448].velocity *= 0.2f; diff --git a/Projectiles/Melee/EssenceBurst.cs b/Projectiles/Melee/EssenceBurst.cs index 9bfc23cd09..49fa1ddacf 100644 --- a/Projectiles/Melee/EssenceBurst.cs +++ b/Projectiles/Melee/EssenceBurst.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Melee { for (int num468 = 0; num468 < 5; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 2f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Melee/EssenceFlame2.cs b/Projectiles/Melee/EssenceFlame2.cs index 44c45b24ee..0b60eae718 100644 --- a/Projectiles/Melee/EssenceFlame2.cs +++ b/Projectiles/Melee/EssenceFlame2.cs @@ -85,9 +85,9 @@ namespace CalamityMod.Projectiles.Melee projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -95,10 +95,10 @@ namespace CalamityMod.Projectiles.Melee } for (int num623 = 0; num623 < 15; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Melee/EssenceScythe.cs b/Projectiles/Melee/EssenceScythe.cs index fb374cf36d..2ea97f652d 100644 --- a/Projectiles/Melee/EssenceScythe.cs +++ b/Projectiles/Melee/EssenceScythe.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0f) / 255f, ((255 - projectile.alpha) * 0.65f) / 255f); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 173, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Melee/Excelsus.cs b/Projectiles/Melee/Excelsus.cs index f3cccc4174..8f038c1e98 100644 --- a/Projectiles/Melee/Excelsus.cs +++ b/Projectiles/Melee/Excelsus.cs @@ -39,9 +39,9 @@ namespace CalamityMod.Projectiles.Melee projectile.velocity *= 0.98f; } projectile.rotation += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.02f; - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, (Main.rand.Next(3) == 0 ? 56 : 242), projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, (Main.rand.NextBool(3) ? 56 : 242), projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } } @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Melee public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) { - Color color = default(Color); + Color color = default; if (projectile.timeLeft < 85) { byte b2 = (byte)(projectile.timeLeft * 3); diff --git a/Projectiles/Melee/ExcelsusBlue.cs b/Projectiles/Melee/ExcelsusBlue.cs index a6a085d4ba..07391c1730 100644 --- a/Projectiles/Melee/ExcelsusBlue.cs +++ b/Projectiles/Melee/ExcelsusBlue.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Melee projectile.velocity *= 0.98f; } projectile.rotation += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.02f; - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 56, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Melee public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) { - Color color = default(Color); + Color color = default; if (projectile.timeLeft < 85) { byte b2 = (byte)(projectile.timeLeft * 3); diff --git a/Projectiles/Melee/ExcelsusPink.cs b/Projectiles/Melee/ExcelsusPink.cs index 3f52bd1b5e..1001510826 100644 --- a/Projectiles/Melee/ExcelsusPink.cs +++ b/Projectiles/Melee/ExcelsusPink.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Melee projectile.velocity *= 0.98f; } projectile.rotation += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.02f; - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 242, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Melee public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) { - Color color = default(Color); + Color color = default; if (projectile.timeLeft < 85) { byte b2 = (byte)(projectile.timeLeft * 3); diff --git a/Projectiles/Melee/Exobeam.cs b/Projectiles/Melee/Exobeam.cs index e5e1b11ad1..7313fe5866 100644 --- a/Projectiles/Melee/Exobeam.cs +++ b/Projectiles/Melee/Exobeam.cs @@ -46,8 +46,8 @@ namespace CalamityMod.Projectiles.Melee for (int l = 0; l < 12; l++) { Vector2 vector3 = Vector2.UnitX * (float)(-(float)projectile.width) / 2f; - vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default(Vector2)) * new Vector2(8f, 16f); - vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default(Vector2)); + vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default) * new Vector2(8f, 16f); + vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default); int num9 = Dust.NewDust(projectile.Center, 0, 0, 107, 0f, 0f, 160, new Color(0, 255, 255), 1f); Main.dust[num9].scale = 1.1f; Main.dust[num9].noGravity = true; diff --git a/Projectiles/Melee/Feather.cs b/Projectiles/Melee/Feather.cs index c873ff8ef2..26d8250242 100644 --- a/Projectiles/Melee/Feather.cs +++ b/Projectiles/Melee/Feather.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Melee int num3; for (int num611 = 0; num611 < 10; num611 = num3 + 1) { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 42, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 1f); + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 42, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default, 1f); num3 = num611; } } diff --git a/Projectiles/Melee/FlameScytheProjectileMelee.cs b/Projectiles/Melee/FlameScytheProjectileMelee.cs index 57c9a97375..e7e2d6d764 100644 --- a/Projectiles/Melee/FlameScytheProjectileMelee.cs +++ b/Projectiles/Melee/FlameScytheProjectileMelee.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { Lighting.AddLight(projectile.Center, 0.25f, 0.15f, 0f); - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 127, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Melee/Flarefrost.cs b/Projectiles/Melee/Flarefrost.cs index 4fbe612f34..54b130f876 100644 --- a/Projectiles/Melee/Flarefrost.cs +++ b/Projectiles/Melee/Flarefrost.cs @@ -40,13 +40,13 @@ namespace CalamityMod.Projectiles.Melee { int dustType = (num41 == 0 ? 67 : 174); Vector2 value8 = Vector2.UnitX * -12f; - value8 = -Vector2.UnitY.RotatedBy((double)(projectile.localAI[0] * 0.1308997f + (float)num41 * 3.14159274f), default(Vector2)) * value7; - int num42 = Dust.NewDust(projectile.Center, 0, 0, dustType, 0f, 0f, 160, default(Color), 1f); + value8 = -Vector2.UnitY.RotatedBy((double)(projectile.localAI[0] * 0.1308997f + (float)num41 * 3.14159274f), default) * value7; + int num42 = Dust.NewDust(projectile.Center, 0, 0, dustType, 0f, 0f, 160, default, 1f); Main.dust[num42].scale = (dustType == 67 ? 1.5f : 1f); Main.dust[num42].noGravity = true; Main.dust[num42].position = projectile.Center + value8; Main.dust[num42].velocity = projectile.velocity; - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default(Color), 0.8f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 0.8f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0f; } diff --git a/Projectiles/Melee/FossilSpike.cs b/Projectiles/Melee/FossilSpike.cs index 08309dc304..4596f510af 100644 --- a/Projectiles/Melee/FossilSpike.cs +++ b/Projectiles/Melee/FossilSpike.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 32, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Melee/GalacticaComet.cs b/Projectiles/Melee/GalacticaComet.cs index 1f27d35e65..77e4ec9a5c 100644 --- a/Projectiles/Melee/GalacticaComet.cs +++ b/Projectiles/Melee/GalacticaComet.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Melee if (projectile.soundDelay == 0) { projectile.soundDelay = 20 + Main.rand.Next(40); - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9); } @@ -53,9 +53,9 @@ namespace CalamityMod.Projectiles.Melee for (int l = 0; l < 12; l++) { Vector2 vector3 = Vector2.UnitX * (float)(-(float)projectile.width) / 2f; - vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default(Vector2)) * new Vector2(8f, 16f); - vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default(Vector2)); - int num9 = Dust.NewDust(projectile.Center, 0, 0, (Main.rand.Next(2) == 0 ? 164 : 229), 0f, 0f, 160, default(Color), 1f); + vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default) * new Vector2(8f, 16f); + vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default); + int num9 = Dust.NewDust(projectile.Center, 0, 0, (Main.rand.NextBool(2) ? 164 : 229), 0f, 0f, 160, default, 1f); Main.dust[num9].scale = 1.1f; Main.dust[num9].noGravity = true; Main.dust[num9].position = projectile.Center + vector3; @@ -74,14 +74,14 @@ namespace CalamityMod.Projectiles.Melee projectile.alpha = num58; } projectile.rotation = projectile.velocity.ToRotation() - 1.57079637f; - if (Main.rand.Next(16) == 0) + if (Main.rand.NextBool(16)) { - Vector2 value3 = Vector2.UnitX.RotatedByRandom(1.5707963705062866).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)); - int num59 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 164, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default(Color), 1.2f); + Vector2 value3 = Vector2.UnitX.RotatedByRandom(1.5707963705062866).RotatedBy((double)projectile.velocity.ToRotation(), default); + int num59 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 164, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default, 1.2f); Main.dust[num59].velocity = value3 * 0.66f; Main.dust[num59].position = projectile.Center + value3 * 12f; } - if (Main.rand.Next(48) == 0) + if (Main.rand.NextBool(48)) { int num60 = Gore.NewGore(projectile.Center, new Vector2(projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f), 16, 1f); Main.gore[num60].velocity *= 0.66f; @@ -90,11 +90,11 @@ namespace CalamityMod.Projectiles.Melee if (projectile.ai[1] == 1f) { projectile.light = 0.5f; - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { - Dust.NewDust(projectile.position, projectile.width, projectile.height, 229, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default(Color), 1.2f); + Dust.NewDust(projectile.position, projectile.width, projectile.height, 229, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default, 1.2f); } - if (Main.rand.Next(20) == 0) + if (Main.rand.NextBool(20)) { Gore.NewGore(projectile.position, new Vector2(projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f), Main.rand.Next(16, 18), 1f); } @@ -121,14 +121,14 @@ namespace CalamityMod.Projectiles.Melee projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num193 = 0; num193 < 4; num193++) { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 164, 0f, 0f, 50, default(Color), 1.5f); + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 164, 0f, 0f, 50, default, 1.5f); } for (int num194 = 0; num194 < 20; num194++) { - int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 229, 0f, 0f, 0, default(Color), 2.5f); + int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 229, 0f, 0f, 0, default, 2.5f); Main.dust[num195].noGravity = true; Main.dust[num195].velocity *= 3f; - num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 229, 0f, 0f, 50, default(Color), 1.5f); + num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 229, 0f, 0f, 50, default, 1.5f); Main.dust[num195].velocity *= 2f; Main.dust[num195].noGravity = true; } diff --git a/Projectiles/Melee/Galaxia.cs b/Projectiles/Melee/Galaxia.cs index cda6059b38..1654c58354 100644 --- a/Projectiles/Melee/Galaxia.cs +++ b/Projectiles/Melee/Galaxia.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Melee if (projectile.soundDelay == 0) { projectile.soundDelay = 20 + Main.rand.Next(40); - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9); } @@ -53,15 +53,15 @@ namespace CalamityMod.Projectiles.Melee } projectile.localAI[0] += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.01f * (float)projectile.direction; projectile.rotation += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.01f * (float)projectile.direction; - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { - Vector2 value3 = Vector2.UnitX.RotatedByRandom(1.5707963705062866).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)); + Vector2 value3 = Vector2.UnitX.RotatedByRandom(1.5707963705062866).RotatedBy((double)projectile.velocity.ToRotation(), default); int num59 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 66, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1.2f); Main.dust[num59].noGravity = true; Main.dust[num59].velocity = value3 * 0.66f; Main.dust[num59].position = projectile.Center + value3 * 12f; } - if (Main.rand.Next(24) == 0) + if (Main.rand.NextBool(24)) { int num60 = Gore.NewGore(projectile.Center, new Vector2(projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f), 16, 1f); Main.gore[num60].velocity *= 0.66f; @@ -70,12 +70,12 @@ namespace CalamityMod.Projectiles.Melee if (projectile.ai[1] == 1f) { projectile.light = 0.9f; - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int num59 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 66, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1.2f); Main.dust[num59].noGravity = true; } - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { Gore.NewGore(projectile.position, new Vector2(projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f), Main.rand.Next(16, 18), 1f); } diff --git a/Projectiles/Melee/Galaxia2.cs b/Projectiles/Melee/Galaxia2.cs index 1795cd0d87..0c5e4fa64d 100644 --- a/Projectiles/Melee/Galaxia2.cs +++ b/Projectiles/Melee/Galaxia2.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Melee if (projectile.soundDelay == 0) { projectile.soundDelay = 20 + Main.rand.Next(40); - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9); } @@ -52,15 +52,15 @@ namespace CalamityMod.Projectiles.Melee } projectile.localAI[0] += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.01f * (float)projectile.direction; projectile.rotation += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.01f * (float)projectile.direction; - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { - Vector2 value3 = Vector2.UnitX.RotatedByRandom(1.5707963705062866).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)); + Vector2 value3 = Vector2.UnitX.RotatedByRandom(1.5707963705062866).RotatedBy((double)projectile.velocity.ToRotation(), default); int num59 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 66, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1.2f); Main.dust[num59].velocity = value3 * 0.66f; Main.dust[num59].noGravity = true; Main.dust[num59].position = projectile.Center + value3 * 12f; } - if (Main.rand.Next(24) == 0) + if (Main.rand.NextBool(24)) { int num60 = Gore.NewGore(projectile.Center, new Vector2(projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f), 16, 1f); Main.gore[num60].velocity *= 0.66f; @@ -69,12 +69,12 @@ namespace CalamityMod.Projectiles.Melee if (projectile.ai[1] == 1f) { projectile.light = 0.9f; - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int num59 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 66, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1.2f); Main.dust[num59].noGravity = true; } - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { Gore.NewGore(projectile.position, new Vector2(projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f), Main.rand.Next(16, 18), 1f); } diff --git a/Projectiles/Melee/GalaxyBlast.cs b/Projectiles/Melee/GalaxyBlast.cs index bd24dab176..f1310900b9 100644 --- a/Projectiles/Melee/GalaxyBlast.cs +++ b/Projectiles/Melee/GalaxyBlast.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Melee return; } bool flag5 = WorldGen.SolidTile(Framing.GetTileSafely((int)projectile.position.X / 16, (int)projectile.position.Y / 16)); - Dust dust6 = Main.dust[Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 73, 0f, 0f, 0, default(Color), 1f)]; + Dust dust6 = Main.dust[Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 73, 0f, 0f, 0, default, 1f)]; dust6.position = projectile.Center; dust6.velocity = Vector2.Zero; dust6.noGravity = true; @@ -102,18 +102,18 @@ namespace CalamityMod.Projectiles.Melee bool flag = WorldGen.SolidTile(Framing.GetTileSafely((int)projectile.position.X / 16, (int)projectile.position.Y / 16)); for (int m = 0; m < 4; m++) { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 73, 0f, 0f, 100, default(Color), 1.5f); + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 73, 0f, 0f, 100, default, 1.5f); } for (int n = 0; n < 4; n++) { - int num10 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 73, 0f, 0f, 0, default(Color), 2.5f); + int num10 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 73, 0f, 0f, 0, default, 2.5f); Main.dust[num10].noGravity = true; Main.dust[num10].velocity *= 3f; if (flag) { Main.dust[num10].noLight = true; } - num10 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 73, 0f, 0f, 100, default(Color), 1.5f); + num10 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 73, 0f, 0f, 100, default, 1.5f); Main.dust[num10].velocity *= 2f; Main.dust[num10].noGravity = true; if (flag) diff --git a/Projectiles/Melee/GalaxyBlastType2.cs b/Projectiles/Melee/GalaxyBlastType2.cs index ffc69d187d..2bc5a0f31d 100644 --- a/Projectiles/Melee/GalaxyBlastType2.cs +++ b/Projectiles/Melee/GalaxyBlastType2.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Melee return; } bool flag5 = WorldGen.SolidTile(Framing.GetTileSafely((int)projectile.position.X / 16, (int)projectile.position.Y / 16)); - Dust dust6 = Main.dust[Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 0, default(Color), 1f)]; + Dust dust6 = Main.dust[Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 0, default, 1f)]; dust6.position = projectile.Center; dust6.velocity = Vector2.Zero; dust6.noGravity = true; @@ -102,18 +102,18 @@ namespace CalamityMod.Projectiles.Melee bool flag = WorldGen.SolidTile(Framing.GetTileSafely((int)projectile.position.X / 16, (int)projectile.position.Y / 16)); for (int m = 0; m < 4; m++) { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 100, default(Color), 1.5f); + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 100, default, 1.5f); } for (int n = 0; n < 4; n++) { - int num10 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 0, default(Color), 2.5f); + int num10 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 0, default, 2.5f); Main.dust[num10].noGravity = true; Main.dust[num10].velocity *= 3f; if (flag) { Main.dust[num10].noLight = true; } - num10 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 100, default(Color), 1.5f); + num10 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 100, default, 1.5f); Main.dust[num10].velocity *= 2f; Main.dust[num10].noGravity = true; if (flag) diff --git a/Projectiles/Melee/GalaxyBlastType3.cs b/Projectiles/Melee/GalaxyBlastType3.cs index 8403fa8f69..8df3191ccf 100644 --- a/Projectiles/Melee/GalaxyBlastType3.cs +++ b/Projectiles/Melee/GalaxyBlastType3.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Melee return; } bool flag5 = WorldGen.SolidTile(Framing.GetTileSafely((int)projectile.position.X / 16, (int)projectile.position.Y / 16)); - Dust dust6 = Main.dust[Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 57, 0f, 0f, 0, default(Color), 1f)]; + Dust dust6 = Main.dust[Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 57, 0f, 0f, 0, default, 1f)]; dust6.position = projectile.Center; dust6.velocity = Vector2.Zero; dust6.noGravity = true; @@ -102,18 +102,18 @@ namespace CalamityMod.Projectiles.Melee bool flag = WorldGen.SolidTile(Framing.GetTileSafely((int)projectile.position.X / 16, (int)projectile.position.Y / 16)); for (int m = 0; m < 4; m++) { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 57, 0f, 0f, 100, default(Color), 1.5f); + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 57, 0f, 0f, 100, default, 1.5f); } for (int n = 0; n < 4; n++) { - int num10 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 57, 0f, 0f, 0, default(Color), 2.5f); + int num10 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 57, 0f, 0f, 0, default, 2.5f); Main.dust[num10].noGravity = true; Main.dust[num10].velocity *= 3f; if (flag) { Main.dust[num10].noLight = true; } - num10 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 57, 0f, 0f, 100, default(Color), 1.5f); + num10 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 57, 0f, 0f, 100, default, 1.5f); Main.dust[num10].velocity *= 2f; Main.dust[num10].noGravity = true; if (flag) diff --git a/Projectiles/Melee/GelWave.cs b/Projectiles/Melee/GelWave.cs index 451f01b9fa..9aa9d3d590 100644 --- a/Projectiles/Melee/GelWave.cs +++ b/Projectiles/Melee/GelWave.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Melee Lighting.AddLight(projectile.Center, 0f, 0.2f, 0.4f); projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; projectile.velocity.Y += projectile.ai[0]; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 20, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Melee/GhastlySoulLarge.cs b/Projectiles/Melee/GhastlySoulLarge.cs index 6bfcb7d330..3dd21b0389 100644 --- a/Projectiles/Melee/GhastlySoulLarge.cs +++ b/Projectiles/Melee/GhastlySoulLarge.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Melee { projectile.frame = 0; } - int num822 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 173, 0f, 0f, 0, default(Color), 1f); + int num822 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 173, 0f, 0f, 0, default, 1f); Dust dust = Main.dust[num822]; dust.velocity *= 0.1f; Main.dust[num822].scale = 1.3f; @@ -141,9 +141,9 @@ namespace CalamityMod.Projectiles.Melee for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 173, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default(Color), 2f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 173, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default, 2f); Main.dust[num228].noGravity = true; Main.dust[num228].noLight = true; Main.dust[num228].velocity = vector7; diff --git a/Projectiles/Melee/GhastlySoulMedium.cs b/Projectiles/Melee/GhastlySoulMedium.cs index 44d2935945..21e70e9bc4 100644 --- a/Projectiles/Melee/GhastlySoulMedium.cs +++ b/Projectiles/Melee/GhastlySoulMedium.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Melee { projectile.frame = 0; } - int num822 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 173, 0f, 0f, 0, default(Color), 1f); + int num822 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 173, 0f, 0f, 0, default, 1f); Dust dust = Main.dust[num822]; dust.velocity *= 0.1f; Main.dust[num822].scale = 1.3f; @@ -141,9 +141,9 @@ namespace CalamityMod.Projectiles.Melee for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 173, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default(Color), 2f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 173, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default, 2f); Main.dust[num228].noGravity = true; Main.dust[num228].noLight = true; Main.dust[num228].velocity = vector7; diff --git a/Projectiles/Melee/GhastlySoulSmall.cs b/Projectiles/Melee/GhastlySoulSmall.cs index 207dd9fead..16579bfa5f 100644 --- a/Projectiles/Melee/GhastlySoulSmall.cs +++ b/Projectiles/Melee/GhastlySoulSmall.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Melee { projectile.frame = 0; } - int num822 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 173, 0f, 0f, 0, default(Color), 1f); + int num822 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 173, 0f, 0f, 0, default, 1f); Dust dust = Main.dust[num822]; dust.velocity *= 0.1f; Main.dust[num822].scale = 1.3f; @@ -140,9 +140,9 @@ namespace CalamityMod.Projectiles.Melee for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 173, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default(Color), 2f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 173, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default, 2f); Main.dust[num228].noGravity = true; Main.dust[num228].noLight = true; Main.dust[num228].velocity = vector7; diff --git a/Projectiles/Melee/GreenBall.cs b/Projectiles/Melee/GreenBall.cs index e4cd05ed14..bc9fa4d5dd 100644 --- a/Projectiles/Melee/GreenBall.cs +++ b/Projectiles/Melee/GreenBall.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Melee { for (int num468 = 0; num468 < 5; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, default(Color), 1.5f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, default, 1.5f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Melee/GreenWater.cs b/Projectiles/Melee/GreenWater.cs index 4548a0d116..a9b1f2546b 100644 --- a/Projectiles/Melee/GreenWater.cs +++ b/Projectiles/Melee/GreenWater.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Melee } for (int num457 = 0; num457 < 5; num457++) { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, randomDust, 0f, 0f, 100, default(Color), 1.2f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, randomDust, 0f, 0f, 100, default, 1.2f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Melee } for (int lol = 0; lol < 5; lol++) { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, randomDust, 0f, 0f, 100, default(Color), 1.2f); + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, randomDust, 0f, 0f, 100, default, 1.2f); } } diff --git a/Projectiles/Melee/HellionSpike.cs b/Projectiles/Melee/HellionSpike.cs index ff5e9eaae9..099d06aade 100644 --- a/Projectiles/Melee/HellionSpike.cs +++ b/Projectiles/Melee/HellionSpike.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { Lighting.AddLight(projectile.Center, 0f, 0.25f, 0f); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 44, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Melee target.AddBuff(BuffID.Venom, 300); if (crit) { - float xPos = (Main.rand.Next(2) == 0 ? projectile.position.X + 800 : projectile.position.X - 800); + float xPos = (Main.rand.NextBool(2) ? projectile.position.X + 800 : projectile.position.X - 800); Vector2 vector2 = new Vector2(xPos, projectile.position.Y - Main.rand.Next(600, 801)); float num80 = xPos; float speedX = (float)target.position.X - vector2.X; diff --git a/Projectiles/Melee/HolyColliderHolyFire.cs b/Projectiles/Melee/HolyColliderHolyFire.cs index 04e1fd01d9..d44f31caac 100644 --- a/Projectiles/Melee/HolyColliderHolyFire.cs +++ b/Projectiles/Melee/HolyColliderHolyFire.cs @@ -81,8 +81,8 @@ namespace CalamityMod.Projectiles.Melee projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); - if (Main.rand.Next(2) == 0) + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -90,9 +90,9 @@ namespace CalamityMod.Projectiles.Melee } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); } } } diff --git a/Projectiles/Melee/IceBombFriendly.cs b/Projectiles/Melee/IceBombFriendly.cs index efbc309148..a60653b4fb 100644 --- a/Projectiles/Melee/IceBombFriendly.cs +++ b/Projectiles/Melee/IceBombFriendly.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Melee { projectile.velocity.X *= 0.985f; projectile.velocity.Y *= 0.985f; - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 67, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Melee/Iceberg.cs b/Projectiles/Melee/Iceberg.cs index 4ddc6d1405..a4243593ed 100644 --- a/Projectiles/Melee/Iceberg.cs +++ b/Projectiles/Melee/Iceberg.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { projectile.rotation += 0.5f; - int dust = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 67, 0f, 0f, 100, default(Color), 1f); + int dust = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 67, 0f, 0f, 100, default, 1f); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 0f; } diff --git a/Projectiles/Melee/Icebreaker.cs b/Projectiles/Melee/Icebreaker.cs index 14d9b294eb..aba7682ceb 100644 --- a/Projectiles/Melee/Icebreaker.cs +++ b/Projectiles/Melee/Icebreaker.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 67, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Melee/Judgement.cs b/Projectiles/Melee/Judgement.cs index 62294b2aa6..9c3f4e5745 100644 --- a/Projectiles/Melee/Judgement.cs +++ b/Projectiles/Melee/Judgement.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Melee Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0.5f) / 255f); for (int num457 = 0; num457 < 2; num457++) { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 91, 0f, 0f, 100, default(Color), 1.25f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 91, 0f, 0f, 100, default, 1.25f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; diff --git a/Projectiles/Melee/Leech.cs b/Projectiles/Melee/Leech.cs index 46c9cb8a6b..4491bf35c6 100644 --- a/Projectiles/Melee/Leech.cs +++ b/Projectiles/Melee/Leech.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Melee { for (int num468 = 0; num468 < 2; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 14, 0f, 0f, 100, default(Color), 1f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 14, 0f, 0f, 100, default, 1f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Melee/MangroveChakramProjectileMelee.cs b/Projectiles/Melee/MangroveChakramProjectileMelee.cs index 9bb0ccdfb2..22124b3e1f 100644 --- a/Projectiles/Melee/MangroveChakramProjectileMelee.cs +++ b/Projectiles/Melee/MangroveChakramProjectileMelee.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { Lighting.AddLight(projectile.Center, 0f, 0.25f, 0f); - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 44, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Melee/MarianaProjectile.cs b/Projectiles/Melee/MarianaProjectile.cs index 5c9975d6e2..1424b1dc82 100644 --- a/Projectiles/Melee/MarianaProjectile.cs +++ b/Projectiles/Melee/MarianaProjectile.cs @@ -44,9 +44,9 @@ namespace CalamityMod.Projectiles.Melee for (int l = 0; l < 12; l++) { Vector2 vector3 = Vector2.UnitX * (float)(-(float)projectile.width) / 2f; - vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default(Vector2)) * new Vector2(8f, 16f); - vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default(Vector2)); - int num9 = Dust.NewDust(projectile.Center, 0, 0, 221, 0f, 0f, 160, default(Color), 1f); + vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default) * new Vector2(8f, 16f); + vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default); + int num9 = Dust.NewDust(projectile.Center, 0, 0, 221, 0f, 0f, 160, default, 1f); Main.dust[num9].scale = 1.1f; Main.dust[num9].noGravity = true; Main.dust[num9].position = projectile.Center + vector3; diff --git a/Projectiles/Melee/Mourningstar.cs b/Projectiles/Melee/Mourningstar.cs index f6dd234725..12fd41e1f4 100644 --- a/Projectiles/Melee/Mourningstar.cs +++ b/Projectiles/Melee/Mourningstar.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Melee { vector17.Y *= -1f; } - vector17 = vector17.RotatedBy((double)projectile.localAI[0], default(Vector2)); + vector17 = vector17.RotatedBy((double)projectile.localAI[0], default); projectile.ai[0] += 1f; if (projectile.ai[0] < 30f) { @@ -104,7 +104,7 @@ namespace CalamityMod.Projectiles.Melee int num53 = 0; while ((float)num53 < num52) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Vector2 position = projectile.position + projectile.velocity + projectile.velocity * ((float)num53 / num52); Dust dust2 = Main.dust[Dust.NewDust(position, projectile.width, projectile.height, 246, 0f, 0f, 100, new Color(255, 200, 0), 1f)]; diff --git a/Projectiles/Melee/Murasama.cs b/Projectiles/Melee/Murasama.cs index b7bf2ce144..24046f7ff8 100644 --- a/Projectiles/Melee/Murasama.cs +++ b/Projectiles/Melee/Murasama.cs @@ -76,9 +76,9 @@ namespace CalamityMod.Projectiles.Melee } Vector2 vector14 = projectile.Center + projectile.velocity * 3f; Lighting.AddLight(vector14, 3f, 0.2f, 0.2f); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { - int num30 = Dust.NewDust(vector14 - projectile.Size / 2f, projectile.width, projectile.height, 235, projectile.velocity.X, projectile.velocity.Y, 100, default(Color), 2f); + int num30 = Dust.NewDust(vector14 - projectile.Size / 2f, projectile.width, projectile.height, 235, projectile.velocity.X, projectile.velocity.Y, 100, default, 2f); Main.dust[num30].noGravity = true; Main.dust[num30].position -= projectile.velocity; } diff --git a/Projectiles/Melee/Nebudust.cs b/Projectiles/Melee/Nebudust.cs index 49953d16f2..4ab544704f 100644 --- a/Projectiles/Melee/Nebudust.cs +++ b/Projectiles/Melee/Nebudust.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Melee num466 = num465 / num466; num463 *= num466; num464 *= num466; - int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 269, 0f, 0f, 100, default(Color), 1f); + int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 269, 0f, 0f, 100, default, 1f); Main.dust[num467].noGravity = true; Main.dust[num467].position.X = projectile.Center.X; Main.dust[num467].position.Y = projectile.Center.Y; diff --git a/Projectiles/Melee/Nebulash.cs b/Projectiles/Melee/Nebulash.cs index 8cd5ef9a80..f0325f00ba 100644 --- a/Projectiles/Melee/Nebulash.cs +++ b/Projectiles/Melee/Nebulash.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Melee { vector17.Y *= -1f; } - vector17 = vector17.RotatedBy((double)projectile.localAI[0], default(Vector2)); + vector17 = vector17.RotatedBy((double)projectile.localAI[0], default); projectile.ai[0] += 1f; if (projectile.ai[0] < 30f) { @@ -104,7 +104,7 @@ namespace CalamityMod.Projectiles.Melee int num53 = 0; while ((float)num53 < num52) { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Vector2 position = projectile.position + projectile.velocity + projectile.velocity * ((float)num53 / num52); Dust dust2 = Main.dust[Dust.NewDust(position, projectile.width, projectile.height, 173, 0f, 0f, 100, new Color(255, 200, 0), 1f)]; diff --git a/Projectiles/Melee/NeptuneOrb.cs b/Projectiles/Melee/NeptuneOrb.cs index 906b581e6a..4f0d21ee79 100644 --- a/Projectiles/Melee/NeptuneOrb.cs +++ b/Projectiles/Melee/NeptuneOrb.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Melee } addSprayTimer = 20; } - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default(Color), 0.4f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default, 0.4f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; @@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles.Melee num466 = num465 / num466; num463 *= num466; num464 *= num466; - int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default(Color), 1.2f); + int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default, 1.2f); Main.dust[num467].noGravity = true; Main.dust[num467].position.X = projectile.Center.X; Main.dust[num467].position.Y = projectile.Center.Y; diff --git a/Projectiles/Melee/NightStabber.cs b/Projectiles/Melee/NightStabber.cs index 8d8374364a..b08bab3a1f 100644 --- a/Projectiles/Melee/NightStabber.cs +++ b/Projectiles/Melee/NightStabber.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Melee { for (int num468 = 0; num468 < 2; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 14, 0f, 0f, 100, default(Color), 1f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 14, 0f, 0f, 100, default, 1f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Melee/Oathblade.cs b/Projectiles/Melee/Oathblade.cs index fd404798b9..ab2ea1c4a1 100644 --- a/Projectiles/Melee/Oathblade.cs +++ b/Projectiles/Melee/Oathblade.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { Lighting.AddLight(projectile.Center, 0.35f, 0f, 0.35f); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 173, projectile.velocity.X * 0.25f, projectile.velocity.Y * 0.25f); } diff --git a/Projectiles/Melee/OceanBeam.cs b/Projectiles/Melee/OceanBeam.cs index 16b0837f6a..2fd531fe72 100644 --- a/Projectiles/Melee/OceanBeam.cs +++ b/Projectiles/Melee/OceanBeam.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Melee float num93 = projectile.velocity.X / 3f * (float)num92; float num94 = projectile.velocity.Y / 3f * (float)num92; int num95 = 4; - int num96 = Dust.NewDust(new Vector2(projectile.position.X + (float)num95, projectile.position.Y + (float)num95), projectile.width - num95 * 2, projectile.height - num95 * 2, 56, 0f, 0f, 100, default(Color), 1.2f); + int num96 = Dust.NewDust(new Vector2(projectile.position.X + (float)num95, projectile.position.Y + (float)num95), projectile.width - num95 * 2, projectile.height - num95 * 2, 56, 0f, 0f, 100, default, 1.2f); Main.dust[num96].noGravity = true; Main.dust[num96].velocity *= 0.25f; Main.dust[num96].velocity += projectile.velocity * 0.1f; @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Melee float num99 = projectile.velocity.X / 3f * (float)num105; float num100 = projectile.velocity.Y / 3f * (float)num105; int num101 = 4; - int num102 = Dust.NewDust(new Vector2(projectile.position.X + (float)num101, projectile.position.Y + (float)num101), projectile.width - num101 * 2, projectile.height - num101 * 2, 245, 0f, 0f, 100, default(Color), 1.2f); + int num102 = Dust.NewDust(new Vector2(projectile.position.X + (float)num101, projectile.position.Y + (float)num101), projectile.width - num101 * 2, projectile.height - num101 * 2, 245, 0f, 0f, 100, default, 1.2f); Main.dust[num102].noGravity = true; Main.dust[num102].velocity *= 0.1f; Main.dust[num102].velocity += projectile.velocity * 0.25f; diff --git a/Projectiles/Melee/OmegaBiomeOrb.cs b/Projectiles/Melee/OmegaBiomeOrb.cs index ec6dc17027..692d1f616a 100644 --- a/Projectiles/Melee/OmegaBiomeOrb.cs +++ b/Projectiles/Melee/OmegaBiomeOrb.cs @@ -109,7 +109,7 @@ namespace CalamityMod.Projectiles.Melee } for (int num457 = 0; num457 < 5; num457++) { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default(Color), 1.2f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 1.2f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; diff --git a/Projectiles/Melee/PlagueBeeDust.cs b/Projectiles/Melee/PlagueBeeDust.cs index ee26cb92d1..3684d80b4b 100644 --- a/Projectiles/Melee/PlagueBeeDust.cs +++ b/Projectiles/Melee/PlagueBeeDust.cs @@ -55,8 +55,8 @@ namespace CalamityMod.Projectiles.Melee int num297 = 89; for (int num298 = 0; num298 < 2; num298++) { - int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1f); - if (Main.rand.Next(3) == 0) + int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); + if (Main.rand.NextBool(3)) { Main.dust[num299].noGravity = true; Main.dust[num299].scale *= 2.5f; diff --git a/Projectiles/Melee/PlagueDust.cs b/Projectiles/Melee/PlagueDust.cs index e9d9c6bf65..eff9f548c9 100644 --- a/Projectiles/Melee/PlagueDust.cs +++ b/Projectiles/Melee/PlagueDust.cs @@ -46,8 +46,8 @@ namespace CalamityMod.Projectiles.Melee int num297 = 89; for (int num298 = 0; num298 < 2; num298++) { - int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1f); - if (Main.rand.Next(3) == 0) + int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); + if (Main.rand.NextBool(3)) { Main.dust[num299].noGravity = true; Main.dust[num299].scale *= 2.5f; diff --git a/Projectiles/Melee/PlagueSeeker.cs b/Projectiles/Melee/PlagueSeeker.cs index ff52dd2667..b3e51e302f 100644 --- a/Projectiles/Melee/PlagueSeeker.cs +++ b/Projectiles/Melee/PlagueSeeker.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Melee { for (int num468 = 0; num468 < 3; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, default(Color), 0.75f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, default, 0.75f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Melee/PlasmaBall.cs b/Projectiles/Melee/PlasmaBall.cs index c8780d7ed7..a2d358407f 100644 --- a/Projectiles/Melee/PlasmaBall.cs +++ b/Projectiles/Melee/PlasmaBall.cs @@ -37,15 +37,15 @@ namespace CalamityMod.Projectiles.Melee for (int num41 = 0; num41 < 2; num41++) { Vector2 value8 = Vector2.UnitX * -15f; - value8 = -Vector2.UnitY.RotatedBy((double)(projectile.localAI[0] * 0.1308997f + (float)num41 * 3.14159274f), default(Vector2)) * value7; - int num42 = Dust.NewDust(projectile.Center, 0, 0, 27, 0f, 0f, 160, default(Color), 1f); + value8 = -Vector2.UnitY.RotatedBy((double)(projectile.localAI[0] * 0.1308997f + (float)num41 * 3.14159274f), default) * value7; + int num42 = Dust.NewDust(projectile.Center, 0, 0, 27, 0f, 0f, 160, default, 1f); Main.dust[num42].scale = 1f; Main.dust[num42].noGravity = true; Main.dust[num42].position = projectile.Center + value8; Main.dust[num42].velocity = projectile.velocity; } } - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 27, 0f, 0f, 100, default(Color), 0.8f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 27, 0f, 0f, 100, default, 0.8f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0f; float num472 = projectile.Center.X; diff --git a/Projectiles/Melee/ProfanedSword.cs b/Projectiles/Melee/ProfanedSword.cs index 3733bd9a07..65db89b2f3 100644 --- a/Projectiles/Melee/ProfanedSword.cs +++ b/Projectiles/Melee/ProfanedSword.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 2.355f; - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 235, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Melee/RedBall.cs b/Projectiles/Melee/RedBall.cs index 343844490a..b9b5e08532 100644 --- a/Projectiles/Melee/RedBall.cs +++ b/Projectiles/Melee/RedBall.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Melee { for (int num468 = 0; num468 < 5; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 90, 0f, 0f, 100, default(Color), 1.5f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 90, 0f, 0f, 100, default, 1.5f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Melee/RoyalKnifeMelee.cs b/Projectiles/Melee/RoyalKnifeMelee.cs index d898f2244b..1a4d9eb210 100644 --- a/Projectiles/Melee/RoyalKnifeMelee.cs +++ b/Projectiles/Melee/RoyalKnifeMelee.cs @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Melee projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f; projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f; } - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 20, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } @@ -86,7 +86,7 @@ namespace CalamityMod.Projectiles.Melee { for (int num303 = 0; num303 < 3; num303++) { - int num304 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 20, 0f, 0f, 100, default(Color), 0.8f); + int num304 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 20, 0f, 0f, 100, default, 0.8f); Main.dust[num304].noGravity = true; Main.dust[num304].velocity *= 1.2f; Main.dust[num304].velocity -= projectile.oldVelocity * 0.3f; diff --git a/Projectiles/Melee/SandFire.cs b/Projectiles/Melee/SandFire.cs index 2e95a88da1..844d465f7c 100644 --- a/Projectiles/Melee/SandFire.cs +++ b/Projectiles/Melee/SandFire.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Melee { for (int num468 = 0; num468 < 5; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 159, 0f, 0f, 100, default(Color), 0.5f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 159, 0f, 0f, 100, default, 0.5f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Melee/ScourgeoftheCosmos.cs b/Projectiles/Melee/ScourgeoftheCosmos.cs index 2fa48603c7..0197a0548c 100644 --- a/Projectiles/Melee/ScourgeoftheCosmos.cs +++ b/Projectiles/Melee/ScourgeoftheCosmos.cs @@ -42,10 +42,10 @@ namespace CalamityMod.Projectiles.Melee int num3; for (int num20 = 0; num20 < 2; num20 = num3 + 1) { - int dustType = (Main.rand.Next(3) == 0 ? 56 : 242); + int dustType = (Main.rand.NextBool(3) ? 56 : 242); float num21 = projectile.velocity.X / 4f * (float)num20; float num22 = projectile.velocity.Y / 4f * (float)num20; - int num23 = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 0, default(Color), 1f); + int num23 = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 0, default, 1f); Main.dust[num23].position.X = projectile.Center.X - num21; Main.dust[num23].position.Y = projectile.Center.Y - num22; Dust dust = Main.dust[num23]; @@ -99,7 +99,7 @@ namespace CalamityMod.Projectiles.Melee if (projectile.owner == Main.myPlayer) { int num626 = 1; - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { num626++; } @@ -131,8 +131,8 @@ namespace CalamityMod.Projectiles.Melee int num3; for (int num622 = 0; num622 < 10; num622 = num3 + 1) { - int dustType = (Main.rand.Next(3) == 0 ? 56 : 242); - int num623 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 0, default(Color), 1f); + int dustType = (Main.rand.NextBool(3) ? 56 : 242); + int num623 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 0, default, 1f); Dust dust = Main.dust[num623]; dust.scale *= 1.1f; Main.dust[num623].noGravity = true; @@ -140,8 +140,8 @@ namespace CalamityMod.Projectiles.Melee } for (int num624 = 0; num624 < 15; num624 = num3 + 1) { - int dustType = (Main.rand.Next(3) == 0 ? 56 : 242); - int num625 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 0, default(Color), 1f); + int dustType = (Main.rand.NextBool(3) ? 56 : 242); + int num625 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 0, default, 1f); Dust dust = Main.dust[num625]; dust.velocity *= 2.5f; dust = Main.dust[num625]; @@ -152,7 +152,7 @@ namespace CalamityMod.Projectiles.Melee if (projectile.owner == Main.myPlayer) { int num626 = 3; - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { num626++; } diff --git a/Projectiles/Melee/ScourgeoftheCosmosMini.cs b/Projectiles/Melee/ScourgeoftheCosmosMini.cs index 111b102db9..798aef1835 100644 --- a/Projectiles/Melee/ScourgeoftheCosmosMini.cs +++ b/Projectiles/Melee/ScourgeoftheCosmosMini.cs @@ -60,10 +60,10 @@ namespace CalamityMod.Projectiles.Melee int num3; for (int num369 = 0; num369 < 1; num369 = num3 + 1) { - int dustType = (Main.rand.Next(3) == 0 ? 56 : 242); + int dustType = (Main.rand.NextBool(3) ? 56 : 242); float num370 = projectile.velocity.X / 3f * (float)num369; float num371 = projectile.velocity.Y / 3f * (float)num369; - int num372 = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 0, default(Color), 1f); + int num372 = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 0, default, 1f); Main.dust[num372].position.X = projectile.Center.X - num370; Main.dust[num372].position.Y = projectile.Center.Y - num371; Dust dust = Main.dust[num372]; diff --git a/Projectiles/Melee/ShortBeam.cs b/Projectiles/Melee/ShortBeam.cs index f806b67a5b..efdce9e6aa 100644 --- a/Projectiles/Melee/ShortBeam.cs +++ b/Projectiles/Melee/ShortBeam.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Melee { Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.2f) / 255f, 0f, ((255 - projectile.alpha) * 0.2f) / 255f); projectile.velocity.Y += projectile.ai[0]; - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 73, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Melee/ShortNightBeam.cs b/Projectiles/Melee/ShortNightBeam.cs index f5416d59b0..aaeca978f4 100644 --- a/Projectiles/Melee/ShortNightBeam.cs +++ b/Projectiles/Melee/ShortNightBeam.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Melee { Lighting.AddLight(projectile.Center, 0f, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0.1f) / 255f); projectile.velocity.Y += projectile.ai[0]; - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 21, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Melee/ShortTerraBeam.cs b/Projectiles/Melee/ShortTerraBeam.cs index 775095595b..7de34f3645 100644 --- a/Projectiles/Melee/ShortTerraBeam.cs +++ b/Projectiles/Melee/ShortTerraBeam.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { Lighting.AddLight(projectile.Center, 0f, ((255 - projectile.alpha) * 0.75f) / 255f, 0f); - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 107, projectile.velocity.X, projectile.velocity.Y); } @@ -54,11 +54,11 @@ namespace CalamityMod.Projectiles.Melee { float num796 = projectile.oldVelocity.X * (30f / (float)num795); float num797 = projectile.oldVelocity.Y * (30f / (float)num795); - int num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 107, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default(Color), 1.8f); + int num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 107, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default, 1.8f); Main.dust[num798].noGravity = true; Dust dust = Main.dust[num798]; dust.velocity *= 0.5f; - num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 107, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default(Color), 1.4f); + num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 107, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default, 1.4f); dust = Main.dust[num798]; dust.velocity *= 0.05f; num3 = num795; diff --git a/Projectiles/Melee/SolarFlare.cs b/Projectiles/Melee/SolarFlare.cs index 63e46b0bb0..8d085b23c4 100644 --- a/Projectiles/Melee/SolarFlare.cs +++ b/Projectiles/Melee/SolarFlare.cs @@ -101,9 +101,9 @@ namespace CalamityMod.Projectiles.Melee projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 159, 0f, 0f, 100, default(Color), 0.5f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 159, 0f, 0f, 100, default, 0.5f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -111,10 +111,10 @@ namespace CalamityMod.Projectiles.Melee } for (int num623 = 0; num623 < 35; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 32, 0f, 0f, 100, default(Color), 1f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 32, 0f, 0f, 100, default, 1f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 159, 0f, 0f, 100, default(Color), 0.5f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 159, 0f, 0f, 100, default, 0.5f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Melee/SolsticeBeam.cs b/Projectiles/Melee/SolsticeBeam.cs index 9942066172..fcbfdfb871 100644 --- a/Projectiles/Melee/SolsticeBeam.cs +++ b/Projectiles/Melee/SolsticeBeam.cs @@ -90,7 +90,7 @@ namespace CalamityMod.Projectiles.Melee }); break; } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, projectile.velocity.X * 0.05f, projectile.velocity.Y * 0.05f); Main.dust[dust].noGravity = true; @@ -180,11 +180,11 @@ namespace CalamityMod.Projectiles.Melee { float num796 = projectile.oldVelocity.X * (30f / (float)num795); float num797 = projectile.oldVelocity.Y * (30f / (float)num795); - int num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, dustType, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default(Color), 1.8f); + int num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, dustType, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default, 1.8f); Main.dust[num798].noGravity = true; Dust dust = Main.dust[num798]; dust.velocity *= 0.5f; - num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, dustType, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default(Color), 1.4f); + num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, dustType, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default, 1.4f); dust = Main.dust[num798]; dust.velocity *= 0.05f; num3 = num795; diff --git a/Projectiles/Melee/SoulScythe.cs b/Projectiles/Melee/SoulScythe.cs index 5b9a375c98..52e1bf99ea 100644 --- a/Projectiles/Melee/SoulScythe.cs +++ b/Projectiles/Melee/SoulScythe.cs @@ -55,9 +55,9 @@ namespace CalamityMod.Projectiles.Melee projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 30; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -65,10 +65,10 @@ namespace CalamityMod.Projectiles.Melee } for (int num623 = 0; num623 < 50; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Melee/Spark.cs b/Projectiles/Melee/Spark.cs index 1726bb8997..4e84debaed 100644 --- a/Projectiles/Melee/Spark.cs +++ b/Projectiles/Melee/Spark.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Melee projectile.velocity.Y = projectile.velocity.Y + 0.2f; } projectile.rotation += projectile.velocity.X * 0.1f; - int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 206, 0f, 0f, 100, default(Color), 1f); + int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 206, 0f, 0f, 100, default, 1f); Dust expr_8976_cp_0 = Main.dust[num199]; expr_8976_cp_0.position.X = expr_8976_cp_0.position.X - 2f; Dust expr_8994_cp_0 = Main.dust[num199]; @@ -62,9 +62,9 @@ namespace CalamityMod.Projectiles.Melee Main.dust[num199].noGravity = true; Dust expr_89E7_cp_0 = Main.dust[num199]; expr_89E7_cp_0.velocity.Y = expr_89E7_cp_0.velocity.Y - 2f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { - int num200 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 206, 0f, 0f, 100, default(Color), 1f); + int num200 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 206, 0f, 0f, 100, default, 1f); Dust expr_8A4E_cp_0 = Main.dust[num200]; expr_8A4E_cp_0.position.X = expr_8A4E_cp_0.position.X - 2f; Dust expr_8A6C_cp_0 = Main.dust[num200]; diff --git a/Projectiles/Melee/SpatialSpear.cs b/Projectiles/Melee/SpatialSpear.cs index 5744dd878e..fb81241619 100644 --- a/Projectiles/Melee/SpatialSpear.cs +++ b/Projectiles/Melee/SpatialSpear.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Melee projectile.localAI[1] = 0f; } } - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 107, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f); } @@ -106,11 +106,11 @@ namespace CalamityMod.Projectiles.Melee { float num796 = projectile.oldVelocity.X * (30f / (float)num795); float num797 = projectile.oldVelocity.Y * (30f / (float)num795); - int num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 107, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default(Color), 1.8f); + int num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 107, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default, 1.8f); Main.dust[num798].noGravity = true; Dust dust = Main.dust[num798]; dust.velocity *= 0.5f; - num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 107, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default(Color), 1.4f); + num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 107, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default, 1.4f); dust = Main.dust[num798]; dust.velocity *= 0.05f; num3 = num795; diff --git a/Projectiles/Melee/SpatialSpear2.cs b/Projectiles/Melee/SpatialSpear2.cs index e95013cffc..35990ee98e 100644 --- a/Projectiles/Melee/SpatialSpear2.cs +++ b/Projectiles/Melee/SpatialSpear2.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Melee projectile.localAI[1] = 0f; } } - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 56, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f); } @@ -93,11 +93,11 @@ namespace CalamityMod.Projectiles.Melee { float num796 = projectile.oldVelocity.X * (30f / (float)num795); float num797 = projectile.oldVelocity.Y * (30f / (float)num795); - int num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 56, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default(Color), 1.8f); + int num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 56, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default, 1.8f); Main.dust[num798].noGravity = true; Dust dust = Main.dust[num798]; dust.velocity *= 0.5f; - num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 56, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default(Color), 1.4f); + num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 56, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default, 1.4f); dust = Main.dust[num798]; dust.velocity *= 0.05f; num3 = num795; diff --git a/Projectiles/Melee/SpatialSpear3.cs b/Projectiles/Melee/SpatialSpear3.cs index 2283171da3..78ebff6702 100644 --- a/Projectiles/Melee/SpatialSpear3.cs +++ b/Projectiles/Melee/SpatialSpear3.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Melee projectile.localAI[1] = 0f; } } - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 73, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f); } @@ -91,11 +91,11 @@ namespace CalamityMod.Projectiles.Melee { float num796 = projectile.oldVelocity.X * (30f / (float)num795); float num797 = projectile.oldVelocity.Y * (30f / (float)num795); - int num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 73, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default(Color), 1.8f); + int num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 73, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default, 1.8f); Main.dust[num798].noGravity = true; Dust dust = Main.dust[num798]; dust.velocity *= 0.5f; - num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 73, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default(Color), 1.4f); + num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 73, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default, 1.4f); dust = Main.dust[num798]; dust.velocity *= 0.05f; num3 = num795; diff --git a/Projectiles/Melee/SpatialSpear4.cs b/Projectiles/Melee/SpatialSpear4.cs index d4ab93425d..b7db6982bb 100644 --- a/Projectiles/Melee/SpatialSpear4.cs +++ b/Projectiles/Melee/SpatialSpear4.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Melee projectile.localAI[1] = 0f; } } - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 244, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f); } @@ -76,11 +76,11 @@ namespace CalamityMod.Projectiles.Melee { float num796 = projectile.oldVelocity.X * (30f / (float)num795); float num797 = projectile.oldVelocity.Y * (30f / (float)num795); - int num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 244, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default(Color), 1.8f); + int num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 244, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default, 1.8f); Main.dust[num798].noGravity = true; Dust dust = Main.dust[num798]; dust.velocity *= 0.5f; - num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 244, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default(Color), 1.4f); + num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 244, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default, 1.4f); dust = Main.dust[num798]; dust.velocity *= 0.05f; num3 = num795; diff --git a/Projectiles/Melee/Spears/AstralPike.cs b/Projectiles/Melee/Spears/AstralPike.cs index 5def9f3d9d..92dcdbe712 100644 --- a/Projectiles/Melee/Spears/AstralPike.cs +++ b/Projectiles/Melee/Spears/AstralPike.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.position.X = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - (float)(projectile.width / 2); projectile.position.Y = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - (float)(projectile.height / 2); projectile.position += projectile.velocity * projectile.ai[0]; - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, mod.DustType("AstralOrange"), projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Melee.Spears { for (int i = 0; i < 3; i++) { - float xPos = (Main.rand.Next(2) == 0 ? projectile.position.X + 800 : projectile.position.X - 800); + float xPos = (Main.rand.NextBool(2) ? projectile.position.X + 800 : projectile.position.X - 800); Vector2 vector2 = new Vector2(xPos, projectile.position.Y - Main.rand.Next(-800, 801)); float num80 = xPos; float speedX = (float)target.position.X - vector2.X; diff --git a/Projectiles/Melee/Spears/BansheeHook.cs b/Projectiles/Melee/Spears/BansheeHook.cs index 7e957a28a0..98a2829f5d 100644 --- a/Projectiles/Melee/Spears/BansheeHook.cs +++ b/Projectiles/Melee/Spears/BansheeHook.cs @@ -69,9 +69,9 @@ namespace CalamityMod.Projectiles.Melee.Spears float num3 = projectile.velocity.ToRotation(); float num4 = projectile.velocity.Length(); float num5 = 22f; - Vector2 spinningpoint = new Vector2(1f, 0f).RotatedBy((double)(3.14159274f + num2 * 6.28318548f), default(Vector2)) * new Vector2(num4, projectile.ai[0]); - projectile.position += spinningpoint.RotatedBy((double)num3, default(Vector2)) + new Vector2(num4 + num5, 0f).RotatedBy((double)num3, default(Vector2)); - Vector2 destination = vector + spinningpoint.RotatedBy((double)num3, default(Vector2)) + new Vector2(num4 + num5 + 40f, 0f).RotatedBy((double)num3, default(Vector2)); + Vector2 spinningpoint = new Vector2(1f, 0f).RotatedBy((double)(3.14159274f + num2 * 6.28318548f), default) * new Vector2(num4, projectile.ai[0]); + projectile.position += spinningpoint.RotatedBy((double)num3, default) + new Vector2(num4 + num5, 0f).RotatedBy((double)num3, default); + Vector2 destination = vector + spinningpoint.RotatedBy((double)num3, default) + new Vector2(num4 + num5 + 40f, 0f).RotatedBy((double)num3, default); projectile.rotation = player.AngleTo(destination) + ((float)(Math.PI * 0.25)) * (float)player.direction; //or this if (projectile.spriteDirection == -1) { @@ -84,9 +84,9 @@ namespace CalamityMod.Projectiles.Melee.Spears int num7 = 0; while ((float)num7 < num6) { - Dust dust = Dust.NewDustDirect(projectile.Center, 14, 14, 60, 0f, 0f, 110, default(Color), 1f); + Dust dust = Dust.NewDustDirect(projectile.Center, 14, 14, 60, 0f, 0f, 110, default, 1f); dust.velocity = player.DirectionTo(dust.position) * 2f; - dust.position = projectile.Center + vector2.RotatedBy((double)(num2 * 6.28318548f * 2f + (float)num7 / num6 * 6.28318548f), default(Vector2)) * 10f; + dust.position = projectile.Center + vector2.RotatedBy((double)(num2 * 6.28318548f * 2f + (float)num7 / num6 * 6.28318548f), default) * 10f; dust.scale = 1f + 0.6f * Main.rand.NextFloat(); dust.velocity += vector2 * 3f; dust.noGravity = true; @@ -94,9 +94,9 @@ namespace CalamityMod.Projectiles.Melee.Spears } for (int i = 0; i < 1; i++) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { - Dust dust2 = Dust.NewDustDirect(projectile.Center, 20, 20, 60, 0f, 0f, 110, default(Color), 1f); + Dust dust2 = Dust.NewDustDirect(projectile.Center, 20, 20, 60, 0f, 0f, 110, default, 1f); dust2.velocity = player.DirectionTo(dust2.position) * 2f; dust2.position = projectile.Center + value * -110f; dust2.scale = 0.45f + 0.4f * Main.rand.NextFloat(); diff --git a/Projectiles/Melee/Spears/Brimlance.cs b/Projectiles/Melee/Spears/Brimlance.cs index 5f4ba96746..c60edd2aeb 100644 --- a/Projectiles/Melee/Spears/Brimlance.cs +++ b/Projectiles/Melee/Spears/Brimlance.cs @@ -37,9 +37,9 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.position.X = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - (float)(projectile.width / 2); projectile.position.Y = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - (float)(projectile.height / 2); projectile.position += projectile.velocity * projectile.ai[0]; - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { - int num = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 235, (float)(projectile.direction * 2), 0f, 150, default(Color), 1f); + int num = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 235, (float)(projectile.direction * 2), 0f, 150, default, 1f); Main.dust[num].noGravity = true; } if (projectile.ai[0] == 0f) diff --git a/Projectiles/Melee/Spears/DiseasedPike.cs b/Projectiles/Melee/Spears/DiseasedPike.cs index 0dfa812158..110a1161c9 100644 --- a/Projectiles/Melee/Spears/DiseasedPike.cs +++ b/Projectiles/Melee/Spears/DiseasedPike.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.position.X = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - (float)(projectile.width / 2); projectile.position.Y = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - (float)(projectile.height / 2); projectile.position += projectile.velocity * projectile.ai[0]; - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 107, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Melee/Spears/EarthenPike.cs b/Projectiles/Melee/Spears/EarthenPike.cs index f62e4a5280..2e09aa3c58 100644 --- a/Projectiles/Melee/Spears/EarthenPike.cs +++ b/Projectiles/Melee/Spears/EarthenPike.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.position.X = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - (float)(projectile.width / 2); projectile.position.Y = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - (float)(projectile.height / 2); projectile.position += projectile.velocity * projectile.ai[0]; - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 32, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Melee/Spears/ExsanguinationLanceProjectile.cs b/Projectiles/Melee/Spears/ExsanguinationLanceProjectile.cs index 2a58d6e27a..51fa02a96a 100644 --- a/Projectiles/Melee/Spears/ExsanguinationLanceProjectile.cs +++ b/Projectiles/Melee/Spears/ExsanguinationLanceProjectile.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.position.X = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - (float)(projectile.width / 2); projectile.position.Y = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - (float)(projectile.height / 2); projectile.position += projectile.velocity * projectile.ai[0]; - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 127, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } @@ -82,7 +82,7 @@ namespace CalamityMod.Projectiles.Melee.Spears { for (int i = 0; i < 2; i++) { - float xPos = (Main.rand.Next(2) == 0 ? projectile.position.X + 800 : projectile.position.X - 800); + float xPos = (Main.rand.NextBool(2) ? projectile.position.X + 800 : projectile.position.X - 800); Vector2 vector2 = new Vector2(xPos, projectile.position.Y - Main.rand.Next(-800, 801)); float num80 = xPos; float speedX = (float)target.position.X - vector2.X; diff --git a/Projectiles/Melee/Spears/GildedProboscis.cs b/Projectiles/Melee/Spears/GildedProboscis.cs index 30a745a361..ae1c18b957 100644 --- a/Projectiles/Melee/Spears/GildedProboscis.cs +++ b/Projectiles/Melee/Spears/GildedProboscis.cs @@ -40,9 +40,9 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.position.X = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - (float)(projectile.width / 2); projectile.position.Y = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - (float)(projectile.height / 2); projectile.position += projectile.velocity * projectile.ai[0]; - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { - int num = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 60, (float)(projectile.direction * 2), 0f, 150, default(Color), 1f); + int num = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 60, (float)(projectile.direction * 2), 0f, 150, default, 1f); Main.dust[num].noGravity = true; } if (projectile.ai[0] == 0f) diff --git a/Projectiles/Melee/Spears/GoldplumeSpearProjectile.cs b/Projectiles/Melee/Spears/GoldplumeSpearProjectile.cs index 30967f22df..7cdb739e62 100644 --- a/Projectiles/Melee/Spears/GoldplumeSpearProjectile.cs +++ b/Projectiles/Melee/Spears/GoldplumeSpearProjectile.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.position.X = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - (float)(projectile.width / 2); projectile.position.Y = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - (float)(projectile.height / 2); projectile.position += projectile.velocity * projectile.ai[0]; - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 59, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Melee/Spears/HeartRapierProjectile.cs b/Projectiles/Melee/Spears/HeartRapierProjectile.cs index 9fdd55358e..ee611a57ae 100644 --- a/Projectiles/Melee/Spears/HeartRapierProjectile.cs +++ b/Projectiles/Melee/Spears/HeartRapierProjectile.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.position.X = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - (float)(projectile.width / 2); projectile.position.Y = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - (float)(projectile.height / 2); projectile.position += projectile.velocity * projectile.ai[0]; - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 12, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Melee/Spears/HellionFlowerSpearProjectile.cs b/Projectiles/Melee/Spears/HellionFlowerSpearProjectile.cs index 32ee6743dc..b918d6ca2e 100644 --- a/Projectiles/Melee/Spears/HellionFlowerSpearProjectile.cs +++ b/Projectiles/Melee/Spears/HellionFlowerSpearProjectile.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.position.X = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - (float)(projectile.width / 2); projectile.position.Y = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - (float)(projectile.height / 2); projectile.position += projectile.velocity * projectile.ai[0]; - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 44, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Melee.Spears target.AddBuff(BuffID.Venom, 300); if (crit) { - float xPos = (Main.rand.Next(2) == 0 ? projectile.position.X + 800 : projectile.position.X - 800); + float xPos = (Main.rand.NextBool(2) ? projectile.position.X + 800 : projectile.position.X - 800); Vector2 vector2 = new Vector2(xPos, projectile.position.Y - Main.rand.Next(600, 801)); float num80 = xPos; float speedX = (float)target.position.X - vector2.X; diff --git a/Projectiles/Melee/Spears/SausageMaker.cs b/Projectiles/Melee/Spears/SausageMaker.cs index 24498bcd02..63c916102a 100644 --- a/Projectiles/Melee/Spears/SausageMaker.cs +++ b/Projectiles/Melee/Spears/SausageMaker.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.position.X = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - (float)(projectile.width / 2); projectile.position.Y = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - (float)(projectile.height / 2); projectile.position += projectile.velocity * projectile.ai[0]; - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 5, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Melee/Spears/SpatialLanceProjectile.cs b/Projectiles/Melee/Spears/SpatialLanceProjectile.cs index ebbf447b5e..6817a43d1c 100644 --- a/Projectiles/Melee/Spears/SpatialLanceProjectile.cs +++ b/Projectiles/Melee/Spears/SpatialLanceProjectile.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.position.X = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - (float)(projectile.width / 2); projectile.position.Y = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - (float)(projectile.height / 2); projectile.position += projectile.velocity * projectile.ai[0]; - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int num = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 66, (float)(projectile.direction * 2), 0f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1f); Main.dust[num].noGravity = true; diff --git a/Projectiles/Melee/Spears/StarnightLanceProjectile.cs b/Projectiles/Melee/Spears/StarnightLanceProjectile.cs index ae8dcd426d..69816cdf75 100644 --- a/Projectiles/Melee/Spears/StarnightLanceProjectile.cs +++ b/Projectiles/Melee/Spears/StarnightLanceProjectile.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.position.X = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - (float)(projectile.width / 2); projectile.position.Y = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - (float)(projectile.height / 2); projectile.position += projectile.velocity * projectile.ai[0]; - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 29, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Melee/Spears/StreamGouge.cs b/Projectiles/Melee/Spears/StreamGouge.cs index f78ae90be9..39029967ee 100644 --- a/Projectiles/Melee/Spears/StreamGouge.cs +++ b/Projectiles/Melee/Spears/StreamGouge.cs @@ -38,9 +38,9 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.position.X = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - (float)(projectile.width / 2); projectile.position.Y = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - (float)(projectile.height / 2); projectile.position += projectile.velocity * projectile.ai[0]; - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { - int num = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 173, (float)(projectile.direction * 2), 0f, 150, default(Color), 1f); + int num = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 173, (float)(projectile.direction * 2), 0f, 150, default, 1f); Main.dust[num].noGravity = true; } if (projectile.ai[0] == 0f) diff --git a/Projectiles/Melee/Spears/TerraLanceProjectile.cs b/Projectiles/Melee/Spears/TerraLanceProjectile.cs index 9503179abf..e6f1a2181b 100644 --- a/Projectiles/Melee/Spears/TerraLanceProjectile.cs +++ b/Projectiles/Melee/Spears/TerraLanceProjectile.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.position.X = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - (float)(projectile.width / 2); projectile.position.Y = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - (float)(projectile.height / 2); projectile.position += projectile.velocity * projectile.ai[0]; - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 107, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f); } diff --git a/Projectiles/Melee/StarnightBeam.cs b/Projectiles/Melee/StarnightBeam.cs index 356954c86d..cb2ad88e10 100644 --- a/Projectiles/Melee/StarnightBeam.cs +++ b/Projectiles/Melee/StarnightBeam.cs @@ -46,11 +46,11 @@ namespace CalamityMod.Projectiles.Melee { float num796 = projectile.oldVelocity.X * (30f / (float)num795); float num797 = projectile.oldVelocity.Y * (30f / (float)num795); - int num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 73, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default(Color), 1.8f); + int num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 73, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default, 1.8f); Main.dust[num798].noGravity = true; Dust dust = Main.dust[num798]; dust.velocity *= 0.5f; - num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 73, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default(Color), 1.4f); + num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 73, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default, 1.4f); dust = Main.dust[num798]; dust.velocity *= 0.05f; num3 = num795; diff --git a/Projectiles/Melee/StormMark.cs b/Projectiles/Melee/StormMark.cs index 8b38633522..d602d9032f 100644 --- a/Projectiles/Melee/StormMark.cs +++ b/Projectiles/Melee/StormMark.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Melee value81.X *= -1f; Vector2 value82 = new Vector2(2f, 10f); Vector2 position4 = projectile.Center + new Vector2(60f, 200f) * value81 * 0.5f + value82; - Dust dust34 = Main.dust[Dust.NewDust(position4, 0, 0, 187, 0f, 0f, 0, default(Color), 0.5f)]; + Dust dust34 = Main.dust[Dust.NewDust(position4, 0, 0, 187, 0f, 0f, 0, default, 0.5f)]; dust34.position = position4; dust34.customData = projectile.Center + value82; dust34.fadeIn = 1f; @@ -95,9 +95,9 @@ namespace CalamityMod.Projectiles.Melee } for (int num1135 = 0; num1135 < 2; num1135++) { - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { - Vector2 value83 = Vector2.UnitY.RotatedBy((double)((float)num1135 * 3.14159274f), default(Vector2)).RotatedBy((double)projectile.rotation, default(Vector2)); + Vector2 value83 = Vector2.UnitY.RotatedBy((double)((float)num1135 * 3.14159274f), default).RotatedBy((double)projectile.rotation, default); Dust dust35 = Main.dust[Dust.NewDust(projectile.Center, 0, 0, 187, 0f, 0f, 225, newColor3, 1f)]; dust35.noGravity = true; dust35.noLight = true; @@ -108,9 +108,9 @@ namespace CalamityMod.Projectiles.Melee } for (int num1136 = 0; num1136 < 2; num1136++) { - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { - Vector2 value84 = Vector2.UnitY.RotatedBy((double)((float)num1136 * 3.14159274f), default(Vector2)); + Vector2 value84 = Vector2.UnitY.RotatedBy((double)((float)num1136 * 3.14159274f), default); Dust dust36 = Main.dust[Dust.NewDust(projectile.Center, 0, 0, 187, 0f, 0f, 225, newColor3, 1.5f)]; dust36.noGravity = true; dust36.noLight = true; diff --git a/Projectiles/Melee/TemporalFloeSwordProjectile.cs b/Projectiles/Melee/TemporalFloeSwordProjectile.cs index 408cb6da24..5827ed62cd 100644 --- a/Projectiles/Melee/TemporalFloeSwordProjectile.cs +++ b/Projectiles/Melee/TemporalFloeSwordProjectile.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { Lighting.AddLight(projectile.Center, 0f, ((255 - projectile.alpha) * 0.05f) / 255f, ((255 - projectile.alpha) * 0.35f) / 255f); - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 56, 0f, 0f); } @@ -53,11 +53,11 @@ namespace CalamityMod.Projectiles.Melee { float num796 = projectile.oldVelocity.X * (30f / (float)num795); float num797 = projectile.oldVelocity.Y * (30f / (float)num795); - int num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 56, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default(Color), 1.8f); + int num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 56, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default, 1.8f); Main.dust[num798].noGravity = true; Dust dust = Main.dust[num798]; dust.velocity *= 0.5f; - num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 56, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default(Color), 1.4f); + num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 56, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default, 1.4f); dust = Main.dust[num798]; dust.velocity *= 0.05f; num3 = num795; @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { target.AddBuff(mod.BuffType("GlacialState"), 120); } diff --git a/Projectiles/Melee/TerraBall.cs b/Projectiles/Melee/TerraBall.cs index 12179dbf0f..2d95eb6355 100644 --- a/Projectiles/Melee/TerraBall.cs +++ b/Projectiles/Melee/TerraBall.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 74, 0f, 0f, 100, default(Color), 2f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 74, 0f, 0f, 100, default, 2f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; float num472 = projectile.Center.X; diff --git a/Projectiles/Melee/TerraEdgeBeam.cs b/Projectiles/Melee/TerraEdgeBeam.cs index efb9964381..69ef044c2e 100644 --- a/Projectiles/Melee/TerraEdgeBeam.cs +++ b/Projectiles/Melee/TerraEdgeBeam.cs @@ -47,11 +47,11 @@ namespace CalamityMod.Projectiles.Melee { float num796 = projectile.oldVelocity.X * (30f / (float)num795); float num797 = projectile.oldVelocity.Y * (30f / (float)num795); - int num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 107, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default(Color), 1.8f); + int num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 107, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default, 1.8f); Main.dust[num798].noGravity = true; Dust dust = Main.dust[num798]; dust.velocity *= 0.5f; - num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 107, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default(Color), 1.4f); + num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 107, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default, 1.4f); dust = Main.dust[num798]; dust.velocity *= 0.05f; num3 = num795; diff --git a/Projectiles/Melee/TerraSpear.cs b/Projectiles/Melee/TerraSpear.cs index 0141353dfe..72f8685caf 100644 --- a/Projectiles/Melee/TerraSpear.cs +++ b/Projectiles/Melee/TerraSpear.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Melee projectile.localAI[1] = 0f; } } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 107, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f); } @@ -63,11 +63,11 @@ namespace CalamityMod.Projectiles.Melee { float num796 = projectile.oldVelocity.X * (30f / (float)num795); float num797 = projectile.oldVelocity.Y * (30f / (float)num795); - int num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 107, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default(Color), 1.8f); + int num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 107, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default, 1.8f); Main.dust[num798].noGravity = true; Dust dust = Main.dust[num798]; dust.velocity *= 0.5f; - num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 107, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default(Color), 1.4f); + num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 107, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default, 1.4f); dust = Main.dust[num798]; dust.velocity *= 0.05f; num3 = num795; diff --git a/Projectiles/Melee/TerracottaExplosion.cs b/Projectiles/Melee/TerracottaExplosion.cs index 218dc4a1a5..47a73fcaac 100644 --- a/Projectiles/Melee/TerracottaExplosion.cs +++ b/Projectiles/Melee/TerracottaExplosion.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Melee num466 = num465 / num466; num463 *= num466; num464 *= num466; - int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default(Color), 1.5f); + int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 1.5f); Main.dust[num467].noGravity = true; Main.dust[num467].position.X = projectile.Center.X; Main.dust[num467].position.Y = projectile.Center.Y; diff --git a/Projectiles/Melee/TerratomereProjectile.cs b/Projectiles/Melee/TerratomereProjectile.cs index 14d63f198e..29e00550ae 100644 --- a/Projectiles/Melee/TerratomereProjectile.cs +++ b/Projectiles/Melee/TerratomereProjectile.cs @@ -86,11 +86,11 @@ namespace CalamityMod.Projectiles.Melee { float num796 = projectile.oldVelocity.X * (30f / (float)num795); float num797 = projectile.oldVelocity.Y * (30f / (float)num795); - int num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 107, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default(Color), 1.8f); + int num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 107, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default, 1.8f); Main.dust[num798].noGravity = true; Dust dust = Main.dust[num798]; dust.velocity *= 0.5f; - num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 107, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default(Color), 1.4f); + num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 107, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default, 1.4f); dust = Main.dust[num798]; dust.velocity *= 0.05f; num3 = num795; diff --git a/Projectiles/Melee/TerrorBeam.cs b/Projectiles/Melee/TerrorBeam.cs index ecf074d514..3892717ec0 100644 --- a/Projectiles/Melee/TerrorBeam.cs +++ b/Projectiles/Melee/TerrorBeam.cs @@ -101,14 +101,14 @@ namespace CalamityMod.Projectiles.Melee projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num193 = 0; num193 < 6; num193++) { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default(Color), 1.5f); + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default, 1.5f); } for (int num194 = 0; num194 < 60; num194++) { - int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 0, default(Color), 2.5f); + int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 0, default, 2.5f); Main.dust[num195].noGravity = true; Main.dust[num195].velocity *= 3f; - num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default(Color), 1.5f); + num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default, 1.5f); Main.dust[num195].velocity *= 2f; Main.dust[num195].noGravity = true; } diff --git a/Projectiles/Melee/TerrorBoom.cs b/Projectiles/Melee/TerrorBoom.cs index 4c264b9bad..7e0605cc94 100644 --- a/Projectiles/Melee/TerrorBoom.cs +++ b/Projectiles/Melee/TerrorBoom.cs @@ -34,14 +34,14 @@ namespace CalamityMod.Projectiles.Melee projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num193 = 0; num193 < 6; num193++) { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default(Color), 1.5f); + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default, 1.5f); } for (int num194 = 0; num194 < 60; num194++) { - int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 0, default(Color), 2.5f); + int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 0, default, 2.5f); Main.dust[num195].noGravity = true; Main.dust[num195].velocity *= 3f; - num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default(Color), 1.5f); + num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default, 1.5f); Main.dust[num195].velocity *= 2f; Main.dust[num195].noGravity = true; } diff --git a/Projectiles/Melee/TinyFlare.cs b/Projectiles/Melee/TinyFlare.cs index b601f6cad3..235ec5cdb4 100644 --- a/Projectiles/Melee/TinyFlare.cs +++ b/Projectiles/Melee/TinyFlare.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Melee { for (int num468 = 0; num468 < 3; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 174, 0f, 0f, 100, default(Color), 0.75f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 174, 0f, 0f, 100, default, 0.75f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Melee/Tornado.cs b/Projectiles/Melee/Tornado.cs index edcd13c447..f5caef8d9c 100644 --- a/Projectiles/Melee/Tornado.cs +++ b/Projectiles/Melee/Tornado.cs @@ -160,7 +160,7 @@ namespace CalamityMod.Projectiles.Melee Microsoft.Xna.Framework.Rectangle rectangle9 = texture2D23.Frame(1, 1, 0, 0); Vector2 origin3 = rectangle9.Size() / 2f; float num233 = -0.06283186f * num229; - Vector2 spinningpoint2 = Vector2.UnitY.RotatedBy((double)(num229 * 0.1f), default(Vector2)); + Vector2 spinningpoint2 = Vector2.UnitY.RotatedBy((double)(num229 * 0.1f), default); float num234 = 0f; float num235 = 5.1f; Microsoft.Xna.Framework.Color value34 = new Microsoft.Xna.Framework.Color(225, 225, 225); @@ -170,7 +170,7 @@ namespace CalamityMod.Projectiles.Melee float num237 = num234 / vector33.Y; float num238 = num234 * 6.28318548f / -20f; float num239 = num237 - 0.15f; - Vector2 vector34 = spinningpoint2.RotatedBy((double)num238, default(Vector2)); + Vector2 vector34 = spinningpoint2.RotatedBy((double)num238, default); Vector2 value35 = new Vector2(0f, num237 + 1f); value35.X = value35.Y * num232; Microsoft.Xna.Framework.Color color39 = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.Transparent, value34, num237 * 2f); diff --git a/Projectiles/Melee/TriactisOPHammerMelee.cs b/Projectiles/Melee/TriactisOPHammerMelee.cs index 1507d207f5..48d7561b53 100644 --- a/Projectiles/Melee/TriactisOPHammerMelee.cs +++ b/Projectiles/Melee/TriactisOPHammerMelee.cs @@ -126,9 +126,9 @@ namespace CalamityMod.Projectiles.Melee projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.Next(2) == 0 ? 89 : 229, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -136,10 +136,10 @@ namespace CalamityMod.Projectiles.Melee } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.Next(2) == 0 ? 89 : 229, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.Next(2) == 0 ? 89 : 229, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Melee/TrueBiomeOrb.cs b/Projectiles/Melee/TrueBiomeOrb.cs index 4292bba00f..14a47a4fe4 100644 --- a/Projectiles/Melee/TrueBiomeOrb.cs +++ b/Projectiles/Melee/TrueBiomeOrb.cs @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Melee } for (int num457 = 0; num457 < 10; num457++) { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default(Color), 1.2f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 1.2f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; diff --git a/Projectiles/Melee/TrueCausticEdgeProjectile.cs b/Projectiles/Melee/TrueCausticEdgeProjectile.cs index c51e4433b4..767fab9ddf 100644 --- a/Projectiles/Melee/TrueCausticEdgeProjectile.cs +++ b/Projectiles/Melee/TrueCausticEdgeProjectile.cs @@ -79,11 +79,11 @@ namespace CalamityMod.Projectiles.Melee { float num796 = projectile.oldVelocity.X * (30f / (float)num795); float num797 = projectile.oldVelocity.Y * (30f / (float)num795); - int num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 44, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default(Color), 1.8f); + int num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 44, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default, 1.8f); Main.dust[num798].noGravity = true; Dust dust = Main.dust[num798]; dust.velocity *= 0.5f; - num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 44, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default(Color), 1.4f); + num798 = Dust.NewDust(new Vector2(projectile.oldPosition.X - num796, projectile.oldPosition.Y - num797), 8, 8, 44, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, default, 1.4f); dust = Main.dust[num798]; dust.velocity *= 0.05f; num3 = num795; diff --git a/Projectiles/Melee/Tumbleweed.cs b/Projectiles/Melee/Tumbleweed.cs index a30f9ad5a3..b91de5838b 100644 --- a/Projectiles/Melee/Tumbleweed.cs +++ b/Projectiles/Melee/Tumbleweed.cs @@ -141,9 +141,9 @@ namespace CalamityMod.Projectiles.Melee Main.PlaySound(4, (int)projectile.position.X, (int)projectile.position.Y, 15); for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 32, 0f, 0f, 100, default(Color), 1.2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 32, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -151,10 +151,10 @@ namespace CalamityMod.Projectiles.Melee } for (int num623 = 0; num623 < 30; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 85, 0f, 0f, 100, default(Color), 1.7f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 85, 0f, 0f, 100, default, 1.7f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 85, 0f, 0f, 100, default(Color), 1f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 85, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } if (projectile.owner == Main.myPlayer) diff --git a/Projectiles/Melee/TumbleweedRolling.cs b/Projectiles/Melee/TumbleweedRolling.cs index 5a78d1561a..0d5545dddb 100644 --- a/Projectiles/Melee/TumbleweedRolling.cs +++ b/Projectiles/Melee/TumbleweedRolling.cs @@ -51,9 +51,9 @@ namespace CalamityMod.Projectiles.Melee Main.PlaySound(4, (int)projectile.position.X, (int)projectile.position.Y, 15); for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 32, 0f, 0f, 100, default(Color), 1.2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 32, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -61,10 +61,10 @@ namespace CalamityMod.Projectiles.Melee } for (int num623 = 0; num623 < 30; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 85, 0f, 0f, 100, default(Color), 1.7f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 85, 0f, 0f, 100, default, 1.7f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 85, 0f, 0f, 100, default(Color), 1f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 85, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Melee/TyphonsGreedStaff.cs b/Projectiles/Melee/TyphonsGreedStaff.cs index bc22527dd7..a2aba9871c 100644 --- a/Projectiles/Melee/TyphonsGreedStaff.cs +++ b/Projectiles/Melee/TyphonsGreedStaff.cs @@ -90,10 +90,10 @@ namespace CalamityMod.Projectiles.Melee value2 = (num12 + ((num9 == -1) ? 3.14159274f : 0f)).ToRotationVector2() * (projectile.ai[0] / num) * scaleFactor; Vector2 value3 = projectile.Center + (num12 + ((num9 == -1) ? 3.14159274f : 0f)).ToRotationVector2() * 30f; Vector2 vector2 = num12.ToRotationVector2(); - Vector2 value4 = vector2.RotatedBy((double)(1.57079637f * (float)projectile.spriteDirection), default(Vector2)); - if (Main.rand.Next(2) == 0) + Vector2 value4 = vector2.RotatedBy((double)(1.57079637f * (float)projectile.spriteDirection), default); + if (Main.rand.NextBool(2)) { - Dust dust3 = Dust.NewDustDirect(value3 - new Vector2(5f), 10, 10, 33, player.velocity.X, player.velocity.Y, 150, default(Color), 1f); + Dust dust3 = Dust.NewDustDirect(value3 - new Vector2(5f), 10, 10, 33, player.velocity.X, player.velocity.Y, 150, default, 1f); dust3.velocity = projectile.DirectionTo(dust3.position) * 0.1f + dust3.velocity * 0.1f; } for (int j = 0; j < 4; j++) @@ -116,13 +116,13 @@ namespace CalamityMod.Projectiles.Melee } if (Main.rand.Next(6) != 0) { - Dust dust4 = Dust.NewDustDirect(projectile.position, 0, 0, 186, 0f, 0f, 100, default(Color), 1f); + Dust dust4 = Dust.NewDustDirect(projectile.position, 0, 0, 186, 0f, 0f, 100, default, 1f); dust4.position = projectile.Center + vector2 * (60f + Main.rand.NextFloat() * 20f) * scaleFactor3; dust4.velocity = value4 * (4f + 4f * Main.rand.NextFloat()) * scaleFactor3 * scaleFactor2; dust4.noGravity = true; dust4.noLight = true; dust4.scale = 0.5f; - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { dust4.noGravity = false; } @@ -141,7 +141,7 @@ namespace CalamityMod.Projectiles.Melee if (projectile.localAI[0] >= 12f) { projectile.localAI[0] = 0f; - float xPos = (Main.rand.Next(2) == 0 ? projectile.position.X + 800f : projectile.position.X - 800f); + float xPos = (Main.rand.NextBool(2) ? projectile.position.X + 800f : projectile.position.X - 800f); Vector2 vector20 = new Vector2(xPos, projectile.position.Y + (float)Main.rand.Next(-800, 801)); float num80 = xPos; float speedX = (float)player.position.X - vector20.X; diff --git a/Projectiles/Melee/UltimusCleaverDust.cs b/Projectiles/Melee/UltimusCleaverDust.cs index 95ad5e60e5..eb6c84e8b5 100644 --- a/Projectiles/Melee/UltimusCleaverDust.cs +++ b/Projectiles/Melee/UltimusCleaverDust.cs @@ -64,7 +64,7 @@ namespace CalamityMod.Projectiles.Melee Main.dust[num199].noGravity = true; Dust expr_89E7_cp_0 = Main.dust[num199]; expr_89E7_cp_0.velocity.Y = expr_89E7_cp_0.velocity.Y - 2f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { int num200 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 246, 0f, 0f, 100, new Color(255, Main.DiscoG, 53), 1f); Dust expr_8A4E_cp_0 = Main.dust[num200]; diff --git a/Projectiles/Melee/Whirlpool.cs b/Projectiles/Melee/Whirlpool.cs index 57726cdc00..1c229b593f 100644 --- a/Projectiles/Melee/Whirlpool.cs +++ b/Projectiles/Melee/Whirlpool.cs @@ -32,9 +32,9 @@ namespace CalamityMod.Projectiles.Melee for (int num627 = 0; num627 < num626; num627++) { Vector2 vector45 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector45 = vector45.RotatedBy((double)(num627 - (num626 / 2 - 1)) * 3.1415926535897931 / (double)((float)num626), default(Vector2)) + projectile.Center; + vector45 = vector45.RotatedBy((double)(num627 - (num626 / 2 - 1)) * 3.1415926535897931 / (double)((float)num626), default) + projectile.Center; Vector2 value15 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); - int num628 = Dust.NewDust(vector45 + value15, 0, 0, 172, value15.X * 2f, value15.Y * 2f, 100, default(Color), projectile.scale); + int num628 = Dust.NewDust(vector45 + value15, 0, 0, 172, value15.X * 2f, value15.Y * 2f, 100, default, projectile.scale); Main.dust[num628].noGravity = true; Main.dust[num628].noLight = true; Main.dust[num628].velocity /= 4f; @@ -77,9 +77,9 @@ namespace CalamityMod.Projectiles.Melee for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 172, vector7.X * 2f, vector7.Y * 2f, 100, default(Color), 1.4f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 172, vector7.X * 2f, vector7.Y * 2f, 100, default, 1.4f); Main.dust[num228].noGravity = true; Main.dust[num228].noLight = true; Main.dust[num228].velocity = vector7; diff --git a/Projectiles/Melee/WhiteOrb.cs b/Projectiles/Melee/WhiteOrb.cs index 6e951c3347..8d9510d821 100644 --- a/Projectiles/Melee/WhiteOrb.cs +++ b/Projectiles/Melee/WhiteOrb.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Melee Lighting.AddLight(projectile.Center, 0.2f, 0.2f, 0.2f); for (int num457 = 0; num457 < 2; num457++) { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 91, 0f, 0f, 100, default(Color), 1.25f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 91, 0f, 0f, 100, default, 1.25f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; diff --git a/Projectiles/Melee/Whiterain.cs b/Projectiles/Melee/Whiterain.cs index 8fa391d8a2..d5c1dab247 100644 --- a/Projectiles/Melee/Whiterain.cs +++ b/Projectiles/Melee/Whiterain.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Melee Lighting.AddLight(projectile.Center, 0.2f, 0.2f, 0.2f); for (int num457 = 0; num457 < 2; num457++) { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 91, 0f, 0f, 100, default(Color), 1.25f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 91, 0f, 0f, 100, default, 1.25f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; diff --git a/Projectiles/Melee/Yoyos/AzathothProjectile.cs b/Projectiles/Melee/Yoyos/AzathothProjectile.cs index e9c7763b3f..6b464cf3cb 100644 --- a/Projectiles/Melee/Yoyos/AzathothProjectile.cs +++ b/Projectiles/Melee/Yoyos/AzathothProjectile.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void AI() { - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) { if (projectile.owner == Main.myPlayer) { diff --git a/Projectiles/Melee/Yoyos/ChaotrixProjectile.cs b/Projectiles/Melee/Yoyos/ChaotrixProjectile.cs index 9eaf4483e3..5d5baf2566 100644 --- a/Projectiles/Melee/Yoyos/ChaotrixProjectile.cs +++ b/Projectiles/Melee/Yoyos/ChaotrixProjectile.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void AI() { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 127, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Melee/Yoyos/LaceratorProjectile.cs b/Projectiles/Melee/Yoyos/LaceratorProjectile.cs index 33ecd002c8..2e1a790f74 100644 --- a/Projectiles/Melee/Yoyos/LaceratorProjectile.cs +++ b/Projectiles/Melee/Yoyos/LaceratorProjectile.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos return; } Player player = Main.player[projectile.owner]; - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { player.statLife += 1; player.HealEffect(1); diff --git a/Projectiles/Melee/Yoyos/QuagmireProjectile.cs b/Projectiles/Melee/Yoyos/QuagmireProjectile.cs index 4322c5ef87..29984d9120 100644 --- a/Projectiles/Melee/Yoyos/QuagmireProjectile.cs +++ b/Projectiles/Melee/Yoyos/QuagmireProjectile.cs @@ -26,28 +26,28 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void AI() { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 44, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } if (projectile.owner == Main.myPlayer) { int proj = 0; - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, projectile.velocity.X * 0.35f, projectile.velocity.Y * 0.35f, 569, (int)((double)projectile.damage * 0.5), projectile.knockBack, projectile.owner, 0f, 0f); Main.projectile[proj].GetGlobalProjectile(mod).forceMelee = true; Main.projectile[proj].usesLocalNPCImmunity = true; Main.projectile[proj].localNPCHitCooldown = 30; } - if (Main.rand.Next(30) == 0) + if (Main.rand.NextBool(30)) { proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, projectile.velocity.X * 0.25f, projectile.velocity.Y * 0.25f, 570, (int)((double)projectile.damage * 0.6), projectile.knockBack, projectile.owner, 0f, 0f); Main.projectile[proj].GetGlobalProjectile(mod).forceMelee = true; Main.projectile[proj].usesLocalNPCImmunity = true; Main.projectile[proj].localNPCHitCooldown = 30; } - if (Main.rand.Next(50) == 0) + if (Main.rand.NextBool(50)) { proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, projectile.velocity.X * 0.15f, projectile.velocity.Y * 0.15f, 571, (int)((double)projectile.damage * 0.7), projectile.knockBack, projectile.owner, 0f, 0f); Main.projectile[proj].GetGlobalProjectile(mod).forceMelee = true; diff --git a/Projectiles/Melee/Yoyos/ShimmersparkProjectile.cs b/Projectiles/Melee/Yoyos/ShimmersparkProjectile.cs index ca5d25b3f2..5efe8a671f 100644 --- a/Projectiles/Melee/Yoyos/ShimmersparkProjectile.cs +++ b/Projectiles/Melee/Yoyos/ShimmersparkProjectile.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void AI() { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 73, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } @@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos num440 = num437 / num440; num438 *= num440; num439 *= num440; - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { if (projectile.owner == Main.myPlayer) { diff --git a/Projectiles/Melee/Yoyos/SolarFlareYoyo.cs b/Projectiles/Melee/Yoyos/SolarFlareYoyo.cs index 041869d93e..7fe79731a8 100644 --- a/Projectiles/Melee/Yoyos/SolarFlareYoyo.cs +++ b/Projectiles/Melee/Yoyos/SolarFlareYoyo.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void AI() { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 244, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Melee/Yoyos/VerdantProjectile.cs b/Projectiles/Melee/Yoyos/VerdantProjectile.cs index a165864f9c..f7fdda6b10 100644 --- a/Projectiles/Melee/Yoyos/VerdantProjectile.cs +++ b/Projectiles/Melee/Yoyos/VerdantProjectile.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos { projectile.velocity.X *= 1.01f; projectile.velocity.Y *= 1.01f; - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 75, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } @@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos num440 = num437 / num440; num438 *= num440; num439 *= num440; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { if (projectile.owner == Main.myPlayer) { diff --git a/Projectiles/Melee/Yoyos/YinYo.cs b/Projectiles/Melee/Yoyos/YinYo.cs index 4aa7f65f7a..78a6eb1e50 100644 --- a/Projectiles/Melee/Yoyos/YinYo.cs +++ b/Projectiles/Melee/Yoyos/YinYo.cs @@ -68,7 +68,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos num440 = num437 / num440; num438 *= num440; num439 *= num440; - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) { int choice = Main.rand.Next(2); if (projectile.owner == Main.myPlayer) diff --git a/Projectiles/Patreon/DarkSpark.cs b/Projectiles/Patreon/DarkSpark.cs index 1cdd1d899e..8be1911481 100644 --- a/Projectiles/Patreon/DarkSpark.cs +++ b/Projectiles/Patreon/DarkSpark.cs @@ -212,7 +212,7 @@ namespace CalamityMod.Projectiles.Patreon } for (float num218 = 0f; num218 < 4f; num218 += 1f) { - Main.spriteBatch.Draw(texture2D14, vector27 + Vector2.UnitY.RotatedBy((double)(num218 * 6.28318548f / 4f), default(Vector2)) * scaleFactor2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y7, texture2D14.Width, num215)), projectile.GetAlpha(color25).MultiplyRGBA(new Microsoft.Xna.Framework.Color(255, 255, 255, 0)) * 0.03f, projectile.rotation, new Vector2((float)texture2D14.Width / 2f, (float)num215 / 2f), projectile.scale, spriteEffects, 0f); + Main.spriteBatch.Draw(texture2D14, vector27 + Vector2.UnitY.RotatedBy((double)(num218 * 6.28318548f / 4f), default) * scaleFactor2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y7, texture2D14.Width, num215)), projectile.GetAlpha(color25).MultiplyRGBA(new Microsoft.Xna.Framework.Color(255, 255, 255, 0)) * 0.03f, projectile.rotation, new Vector2((float)texture2D14.Width / 2f, (float)num215 / 2f), projectile.scale, spriteEffects, 0f); } return false; } diff --git a/Projectiles/Patreon/DarkSparkBeam.cs b/Projectiles/Patreon/DarkSparkBeam.cs index 5eaba22b75..eee98246bb 100644 --- a/Projectiles/Patreon/DarkSparkBeam.cs +++ b/Projectiles/Patreon/DarkSparkBeam.cs @@ -119,12 +119,12 @@ namespace CalamityMod.Projectiles.Patreon scaleFactor6 = -7f; //-2, inverted } float num814 = (projectile2.ai[0] + num810 * num813) / (num813 * 6f) * 6.28318548f; - num811 = Vector2.UnitY.RotatedBy((double)num814, default(Vector2)).Y * 0.5235988f * num812; - value37 = (Vector2.UnitY.RotatedBy((double)num814, default(Vector2)) * new Vector2(4f, y)).RotatedBy((double)projectile2.velocity.ToRotation(), default(Vector2)); + num811 = Vector2.UnitY.RotatedBy((double)num814, default).Y * 0.5235988f * num812; + value37 = (Vector2.UnitY.RotatedBy((double)num814, default) * new Vector2(4f, y)).RotatedBy((double)projectile2.velocity.ToRotation(), default); projectile.position = projectile2.Center + value36 * 16f - projectile.Size / 2f + new Vector2(0f, -Main.projectile[(int)projectile.ai[1]].gfxOffY); projectile.position += projectile2.velocity.ToRotation().ToRotationVector2() * scaleFactor6; projectile.position += value37; - projectile.velocity = Vector2.Normalize(projectile2.velocity).RotatedBy((double)num811, default(Vector2)); + projectile.velocity = Vector2.Normalize(projectile2.velocity).RotatedBy((double)num811, default); projectile.scale = 1.5f * (1.5f - num812); projectile.damage = projectile2.damage; double damageMult = 1.0 + (double)(projectile2.ai[0] * 0.0015f); //1 to 2.0 (1400 * x) @@ -193,9 +193,9 @@ namespace CalamityMod.Projectiles.Patreon } Main.dust[num846].color = color; } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { - Vector2 value42 = projectile.velocity.RotatedBy(1.5707963705062866, default(Vector2)) * ((float)Main.rand.NextDouble() - 0.5f) * (float)projectile.width; + Vector2 value42 = projectile.velocity.RotatedBy(1.5707963705062866, default) * ((float)Main.rand.NextDouble() - 0.5f) * (float)projectile.width; int num847 = Dust.NewDust(vector80 + value42 - Vector2.One * 4f, 8, 8, 267, 0f, 0f, 100, color, 5f); Main.dust[num847].velocity *= 0.5f; Main.dust[num847].noGravity = true; @@ -205,9 +205,9 @@ namespace CalamityMod.Projectiles.Patreon float value43 = 0.1f * (float)Math.Sin((double)(Main.GlobalTime * 20f)); Vector2 size = new Vector2(projectile.velocity.Length() * projectile.localAI[1], (float)projectile.width * projectile.scale); float num848 = projectile.velocity.ToRotation(); - if (Main.netMode != 2) + if (Main.netMode != NetmodeID.Server) { - ((WaterShaderData)Filters.Scene["WaterDistortion"].GetShader()).QueueRipple(projectile.position + new Vector2(size.X * 0.5f, 0f).RotatedBy((double)num848, default(Vector2)), color, size, RippleShape.Square, num848); + ((WaterShaderData)Filters.Scene["WaterDistortion"].GetShader()).QueueRipple(projectile.position + new Vector2(size.X * 0.5f, 0f).RotatedBy((double)num848, default), color, size, RippleShape.Square, num848); } Utils.PlotTileLine(projectile.Center, projectile.Center + projectile.velocity * projectile.localAI[1], (float)projectile.width * projectile.scale, new Utils.PerLinePoint(DelegateMethods.CastLight)); return; diff --git a/Projectiles/Patreon/DeepSeaDumbbellWeight.cs b/Projectiles/Patreon/DeepSeaDumbbellWeight.cs index 9fb8b31a7e..d8f8bbb1b1 100644 --- a/Projectiles/Patreon/DeepSeaDumbbellWeight.cs +++ b/Projectiles/Patreon/DeepSeaDumbbellWeight.cs @@ -48,9 +48,9 @@ namespace CalamityMod.Projectiles.Patreon for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.25f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 33, vector7.X, vector7.Y, 100, default(Color), 1f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 33, vector7.X, vector7.Y, 100, default, 1f); Main.dust[num228].noGravity = true; Main.dust[num228].velocity = vector7; } diff --git a/Projectiles/Patreon/DevilsSunrise.cs b/Projectiles/Patreon/DevilsSunrise.cs index 27ee35938f..3aa2ceb3e2 100644 --- a/Projectiles/Patreon/DevilsSunrise.cs +++ b/Projectiles/Patreon/DevilsSunrise.cs @@ -87,7 +87,7 @@ namespace CalamityMod.Projectiles.Patreon Vector2 vector14 = projectile.Center + projectile.velocity * 3f; Lighting.AddLight(vector14, (float)((double)red * 0.001), 0.1f, 0.1f); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dust = Dust.NewDust(vector14 - projectile.Size / 2f, projectile.width, projectile.height, 66, projectile.velocity.X, projectile.velocity.Y, 100, new Color(red, greenAndBlue, greenAndBlue), 1f); Main.dust[dust].noGravity = true; diff --git a/Projectiles/Patreon/DevilsSunriseCyclone.cs b/Projectiles/Patreon/DevilsSunriseCyclone.cs index 1f0941e912..43256e6f57 100644 --- a/Projectiles/Patreon/DevilsSunriseCyclone.cs +++ b/Projectiles/Patreon/DevilsSunriseCyclone.cs @@ -213,7 +213,7 @@ namespace CalamityMod.Projectiles.Patreon for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 66, vector7.X, vector7.Y, 100, new Color(red, greenAndBlue, greenAndBlue), 1f); Main.dust[num228].noGravity = true; diff --git a/Projectiles/Patreon/DraconicSpark.cs b/Projectiles/Patreon/DraconicSpark.cs index 3b772b38ed..d4e76027d4 100644 --- a/Projectiles/Patreon/DraconicSpark.cs +++ b/Projectiles/Patreon/DraconicSpark.cs @@ -111,7 +111,7 @@ namespace CalamityMod.Projectiles.Patreon if(Main.rand.Next(3) != 0) { float scale = Main.rand.NextFloat(0.6f, 1.2f); - int idx = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustID, 0f, 0f, 100, default(Color), scale); + int idx = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustID, 0f, 0f, 100, default, scale); Main.dust[idx].noGravity = true; Main.dust[idx].velocity += projectile.velocity * 0.1f; } diff --git a/Projectiles/Patreon/DragonPowFlail.cs b/Projectiles/Patreon/DragonPowFlail.cs index f3c9e97a8c..20943d7163 100644 --- a/Projectiles/Patreon/DragonPowFlail.cs +++ b/Projectiles/Patreon/DragonPowFlail.cs @@ -106,7 +106,7 @@ namespace CalamityMod.Projectiles.Patreon int numDust = 5; for (int i = 0; i < numDust; ++i) { - int dustType = (Main.rand.Next(3) == 0) ? 246 : 244; + int dustType = (Main.rand.NextBool(3)) ? 246 : 244; float scale = 0.8f + Main.rand.NextFloat(0.6f); int idx = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType); Main.dust[idx].noGravity = true; diff --git a/Projectiles/Patreon/HandheldTankShell.cs b/Projectiles/Patreon/HandheldTankShell.cs index 11fcddd9b2..6aa09e9c7b 100644 --- a/Projectiles/Patreon/HandheldTankShell.cs +++ b/Projectiles/Patreon/HandheldTankShell.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Patreon for (int i = 0; i < 5; ++i) { pos -= projectile.velocity * ((float)i * 0.25f); - int idx = Dust.NewDust(pos, 1, 1, 158, 0f, 0f, 0, default(Color), 1f); + int idx = Dust.NewDust(pos, 1, 1, 158, 0f, 0f, 0, default, 1f); Main.dust[idx].noGravity = true; Main.dust[idx].position = pos; Main.dust[idx].scale = (float)Main.rand.Next(70, 110) * 0.013f; @@ -70,7 +70,7 @@ namespace CalamityMod.Projectiles.Patreon float scale = Main.rand.NextFloat(0.5f, 1.6f); // Actually spawn the smoke - int idx = Dust.NewDust(pos, 1, 1, dustID, dustVel.X, dustVel.Y, 0, default(Color), scale); + int idx = Dust.NewDust(pos, 1, 1, dustID, dustVel.X, dustVel.Y, 0, default, scale); Main.dust[idx].noGravity = true; Main.dust[idx].position = pos; } @@ -103,9 +103,9 @@ namespace CalamityMod.Projectiles.Patreon Vector2 corner = new Vector2(projectile.position.X, projectile.position.Y); for (int i = 0; i < 40; i++) { - int idx = Dust.NewDust(corner, projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); + int idx = Dust.NewDust(corner, projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[idx].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[idx].scale = 0.5f; Main.dust[idx].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -113,10 +113,10 @@ namespace CalamityMod.Projectiles.Patreon } for (int i = 0; i < 70; i++) { - int idx = Dust.NewDust(corner, projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 3f); + int idx = Dust.NewDust(corner, projectile.width, projectile.height, 6, 0f, 0f, 100, default, 3f); Main.dust[idx].noGravity = true; Main.dust[idx].velocity *= 5f; - idx = Dust.NewDust(corner, projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 2f); + idx = Dust.NewDust(corner, projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[idx].velocity *= 2f; } @@ -133,22 +133,22 @@ namespace CalamityMod.Projectiles.Patreon { smokeScale = 1f; } - int idx = Gore.NewGore(goreVec, default(Vector2), Main.rand.Next(61, 64), 1f); + int idx = Gore.NewGore(goreVec, default, Main.rand.Next(61, 64), 1f); Main.gore[idx].velocity *= smokeScale; Main.gore[idx].velocity.X += 1f; Main.gore[idx].velocity.Y += 1f; - idx = Gore.NewGore(goreVec, default(Vector2), Main.rand.Next(61, 64), 1f); + idx = Gore.NewGore(goreVec, default, Main.rand.Next(61, 64), 1f); Main.gore[idx].velocity *= smokeScale; Main.gore[idx].velocity.X -= 1f; Main.gore[idx].velocity.Y += 1f; - idx = Gore.NewGore(goreVec, default(Vector2), Main.rand.Next(61, 64), 1f); + idx = Gore.NewGore(goreVec, default, Main.rand.Next(61, 64), 1f); Main.gore[idx].velocity *= smokeScale; Main.gore[idx].velocity.X += 1f; Main.gore[idx].velocity.Y -= 1f; - idx = Gore.NewGore(goreVec, default(Vector2), Main.rand.Next(61, 64), 1f); + idx = Gore.NewGore(goreVec, default, Main.rand.Next(61, 64), 1f); Main.gore[idx].velocity *= smokeScale; Main.gore[idx].velocity.X -= 1f; Main.gore[idx].velocity.Y -= 1f; diff --git a/Projectiles/Patreon/IlluminatedBullet.cs b/Projectiles/Patreon/IlluminatedBullet.cs index f4ebbc1901..e175588a3a 100644 --- a/Projectiles/Patreon/IlluminatedBullet.cs +++ b/Projectiles/Patreon/IlluminatedBullet.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Patreon projectile.alpha = 0; // Once projectile is visible, spawn trailing sparkles - if (projectile.timeLeft <= 298 && Main.rand.Next(5) == 0) + if (projectile.timeLeft <= 298 && Main.rand.NextBool(5)) { int idx = Dust.NewDust(projectile.Center, 1, 1, 228, 0f, 0f); Main.dust[idx].noGravity = true; diff --git a/Projectiles/Patreon/KarasawaShot.cs b/Projectiles/Patreon/KarasawaShot.cs index 62e45339c0..f488f80c0f 100644 --- a/Projectiles/Patreon/KarasawaShot.cs +++ b/Projectiles/Patreon/KarasawaShot.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Patreon Vector2 vector33 = projectile.position; vector33 -= projectile.velocity * ((float)num447 * 0.25f); projectile.alpha = 255; - int num448 = Dust.NewDust(vector33, 1, 1, dustTypeOnTimer, 0f, 0f, 0, default(Color), 1f); + int num448 = Dust.NewDust(vector33, 1, 1, dustTypeOnTimer, 0f, 0f, 0, default, 1f); Main.dust[num448].noGravity = true; Main.dust[num448].position = vector33; Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f; @@ -68,8 +68,8 @@ namespace CalamityMod.Projectiles.Patreon { int dustType = (num41 == 0 ? dust1 : dust2); Vector2 value8 = Vector2.UnitX * -12f; - value8 = -Vector2.UnitY.RotatedBy((double)(projectile.ai[0] * 0.1308997f + (float)num41 * 3.14159274f), default(Vector2)) * value7 * 1.5f; - int num42 = Dust.NewDust(projectile.Center, 0, 0, dustType, 0f, 0f, 160, default(Color), 1f); + value8 = -Vector2.UnitY.RotatedBy((double)(projectile.ai[0] * 0.1308997f + (float)num41 * 3.14159274f), default) * value7 * 1.5f; + int num42 = Dust.NewDust(projectile.Center, 0, 0, dustType, 0f, 0f, 160, default, 1f); Main.dust[num42].scale = 0.75f; Main.dust[num42].noGravity = true; Main.dust[num42].position = projectile.Center + value8; @@ -89,9 +89,9 @@ namespace CalamityMod.Projectiles.Patreon Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(projectile.velocity.ToRotation()); dustVel = dustVel.RotatedBy(-angleRandom); dustVel = dustVel.RotatedByRandom(2.0f * angleRandom); - int randomDustType = (Main.rand.Next(2) == 0 ? dust1 : dust2); + int randomDustType = (Main.rand.NextBool(2) ? dust1 : dust2); - int num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, randomDustType, dustVel.X, dustVel.Y, 200, default(Color), 1.7f); + int num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, randomDustType, dustVel.X, dustVel.Y, 200, default, 1.7f); Main.dust[num54].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; Main.dust[num54].noGravity = true; @@ -99,7 +99,7 @@ namespace CalamityMod.Projectiles.Patreon dust.velocity *= (randomDustType == dust2 ? 2f : 4f); dust = Main.dust[num54]; - num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, randomDustType, dustVel.X, dustVel.Y, 100, default(Color), 0.8f); + num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, randomDustType, dustVel.X, dustVel.Y, 100, default, 0.8f); Main.dust[num54].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; dust = Main.dust[num54]; @@ -119,10 +119,10 @@ namespace CalamityMod.Projectiles.Patreon Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(projectile.velocity.ToRotation()); dustVel = dustVel.RotatedBy(-angleRandom); dustVel = dustVel.RotatedByRandom(2.0f * angleRandom); - int randomDustType = (Main.rand.Next(2) == 0 ? dust1 : dust2); + int randomDustType = (Main.rand.NextBool(2) ? dust1 : dust2); - int num56 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, randomDustType, dustVel.X, dustVel.Y, 0, default(Color), 2f); - Main.dust[num56].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)) * (float)projectile.width / 3f; + int num56 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, randomDustType, dustVel.X, dustVel.Y, 0, default, 2f); + Main.dust[num56].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default) * (float)projectile.width / 3f; Main.dust[num56].noGravity = true; Dust dust = Main.dust[num56]; @@ -160,16 +160,16 @@ namespace CalamityMod.Projectiles.Patreon for (int num227 = 0; num227 < num226; num227++) // 108 dusts { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.3f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, (Main.rand.Next(2) == 0 ? dust1 : dust2), vector7.X * 0.3f, vector7.Y * 0.3f, 100, default(Color), 2f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, (Main.rand.NextBool(2) ? dust1 : dust2), vector7.X * 0.3f, vector7.Y * 0.3f, 100, default, 2f); Main.dust[num228].noGravity = true; - int num229 = Dust.NewDust(vector6 + vector7, 0, 0, (Main.rand.Next(2) == 0 ? dust1 : dust2), vector7.X * 0.2f, vector7.Y * 0.2f, 100, default(Color), 2f); + int num229 = Dust.NewDust(vector6 + vector7, 0, 0, (Main.rand.NextBool(2) ? dust1 : dust2), vector7.X * 0.2f, vector7.Y * 0.2f, 100, default, 2f); Main.dust[num229].noGravity = true; - int num230 = Dust.NewDust(vector6 + vector7, 0, 0, (Main.rand.Next(2) == 0 ? dust1 : dust2), vector7.X * 0.1f, vector7.Y * 0.1f, 100, default(Color), 2f); + int num230 = Dust.NewDust(vector6 + vector7, 0, 0, (Main.rand.NextBool(2) ? dust1 : dust2), vector7.X * 0.1f, vector7.Y * 0.1f, 100, default, 2f); Main.dust[num230].noGravity = true; } diff --git a/Projectiles/Patreon/KelvinCatalyst.cs b/Projectiles/Patreon/KelvinCatalyst.cs index d74bf7b048..d7a3f5eec8 100644 --- a/Projectiles/Patreon/KelvinCatalyst.cs +++ b/Projectiles/Patreon/KelvinCatalyst.cs @@ -114,7 +114,7 @@ namespace CalamityMod.Projectiles.Patreon } } - int dust = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 67, 0f, 0f, 100, default(Color), 1f); + int dust = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 67, 0f, 0f, 100, default, 1f); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 0f; diff --git a/Projectiles/Patreon/KelvinCatalystStar.cs b/Projectiles/Patreon/KelvinCatalystStar.cs index b9b371a317..dd5f49f696 100644 --- a/Projectiles/Patreon/KelvinCatalystStar.cs +++ b/Projectiles/Patreon/KelvinCatalystStar.cs @@ -78,9 +78,9 @@ namespace CalamityMod.Projectiles.Patreon Lighting.AddLight(projectile.Center, (Main.DiscoR * 0.075f) / 255f, (Main.DiscoR * 0.1f) / 255f, (Main.DiscoR * 0.125f) / 255f); - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) { - int dust = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 67, 0f, 0f, 100, default(Color), 0.4f); + int dust = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 67, 0f, 0f, 100, default, 0.4f); Main.dust[dust].velocity *= 0.3f; Main.dust[dust].noGravity = true; } @@ -110,9 +110,9 @@ namespace CalamityMod.Projectiles.Patreon for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 67, vector7.X * 0.5f, vector7.Y * 0.5f, 100, default(Color), 0.75f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 67, vector7.X * 0.5f, vector7.Y * 0.5f, 100, default, 0.75f); Main.dust[num228].noGravity = true; } projectile.Damage(); diff --git a/Projectiles/Patreon/LightBall.cs b/Projectiles/Patreon/LightBall.cs index 3b7d5aa36d..6d046cd4aa 100644 --- a/Projectiles/Patreon/LightBall.cs +++ b/Projectiles/Patreon/LightBall.cs @@ -47,9 +47,9 @@ namespace CalamityMod.Projectiles.Patreon Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("LightBallExplosion"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 1.2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -57,10 +57,10 @@ namespace CalamityMod.Projectiles.Patreon } for (int num623 = 0; num623 < 20; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 1.7f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1.7f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 1f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Patreon/LightBead.cs b/Projectiles/Patreon/LightBead.cs index 41991e6af7..b13ac7c96f 100644 --- a/Projectiles/Patreon/LightBead.cs +++ b/Projectiles/Patreon/LightBead.cs @@ -29,9 +29,9 @@ namespace CalamityMod.Projectiles.Patreon Lighting.AddLight(projectile.Center, 0.5f, 0.5f, 0.5f); projectile.rotation += projectile.velocity.X * 0.2f; projectile.ai[1] += 1f; - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { - int num300 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 0, default(Color), 1f); + int num300 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 0, default, 1f); Main.dust[num300].noGravity = true; Main.dust[num300].velocity *= 0.5f; Main.dust[num300].scale *= 0.9f; diff --git a/Projectiles/Patreon/MadAlchemistsCocktailAlt.cs b/Projectiles/Patreon/MadAlchemistsCocktailAlt.cs index 37e1ba9b51..dd499cc894 100644 --- a/Projectiles/Patreon/MadAlchemistsCocktailAlt.cs +++ b/Projectiles/Patreon/MadAlchemistsCocktailAlt.cs @@ -75,19 +75,19 @@ namespace CalamityMod.Projectiles.Patreon int num3; for (int num53 = 0; num53 < 40; num53 = num3 + 1) { - int num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 200, default(Color), num52); + int num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 200, default, num52); Main.dust[num54].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; Main.dust[num54].noGravity = true; Dust dust = Main.dust[num54]; dust.velocity *= 4f; dust = Main.dust[num54]; dust.velocity += value4 * Main.rand.NextFloat(); - num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 174, 0f, 0f, 100, default(Color), num51); + num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 174, 0f, 0f, 100, default, num51); Main.dust[num54].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; dust = Main.dust[num54]; dust.velocity *= 3f; Main.dust[num54].noGravity = true; - num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 229, 0f, 0f, 100, default(Color), num51); + num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 229, 0f, 0f, 100, default, num51); Main.dust[num54].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; dust = Main.dust[num54]; dust.velocity *= 2f; @@ -100,8 +100,8 @@ namespace CalamityMod.Projectiles.Patreon } for (int num55 = 0; num55 < 20; num55 = num3 + 1) { - int num56 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 206, 0f, 0f, 0, default(Color), num52); - Main.dust[num56].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)) * (float)projectile.width / 3f; + int num56 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 206, 0f, 0f, 0, default, num52); + Main.dust[num56].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default) * (float)projectile.width / 3f; Main.dust[num56].noGravity = true; Dust dust = Main.dust[num56]; dust.velocity *= 0.5f; diff --git a/Projectiles/Patreon/MadAlchemistsCocktailRed.cs b/Projectiles/Patreon/MadAlchemistsCocktailRed.cs index 9dff22ed85..537a692dad 100644 --- a/Projectiles/Patreon/MadAlchemistsCocktailRed.cs +++ b/Projectiles/Patreon/MadAlchemistsCocktailRed.cs @@ -63,14 +63,14 @@ namespace CalamityMod.Projectiles.Patreon int num3; for (int num53 = 0; num53 < 60; num53 = num3 + 1) { - int num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 174, 0f, 0f, 200, default(Color), num50); + int num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 174, 0f, 0f, 200, default, num50); Main.dust[num54].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; Main.dust[num54].noGravity = true; Dust dust = Main.dust[num54]; dust.velocity *= 8f; dust = Main.dust[num54]; dust.velocity += value4 * Main.rand.NextFloat(); - num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 174, 0f, 0f, 100, default(Color), num51); + num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 174, 0f, 0f, 100, default, num51); Main.dust[num54].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; dust = Main.dust[num54]; dust.velocity *= 6f; @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Patreon Main.dust[num54].color = Color.Crimson * 0.5f; dust = Main.dust[num54]; dust.velocity += value4 * Main.rand.NextFloat(); - num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 174, 0f, 0f, 100, default(Color), num51); + num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 174, 0f, 0f, 100, default, num51); Main.dust[num54].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; dust = Main.dust[num54]; dust.velocity *= 4f; @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Patreon Main.dust[num54].color = Color.Crimson * 0.5f; dust = Main.dust[num54]; dust.velocity += value4 * Main.rand.NextFloat(); - num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 174, 0f, 0f, 100, default(Color), num51); + num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 174, 0f, 0f, 100, default, num51); Main.dust[num54].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; dust = Main.dust[num54]; dust.velocity *= 2f; @@ -101,8 +101,8 @@ namespace CalamityMod.Projectiles.Patreon } for (int num55 = 0; num55 < 30; num55 = num3 + 1) { - int num56 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 174, 0f, 0f, 0, default(Color), num52); - Main.dust[num56].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)) * (float)projectile.width / 3f; + int num56 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 174, 0f, 0f, 0, default, num52); + Main.dust[num56].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default) * (float)projectile.width / 3f; Main.dust[num56].noGravity = true; Dust dust = Main.dust[num56]; dust.velocity *= 0.5f; diff --git a/Projectiles/Patreon/MadAlchemistsCocktailShrapnel.cs b/Projectiles/Patreon/MadAlchemistsCocktailShrapnel.cs index f4bf92d6a6..f5723daeb6 100644 --- a/Projectiles/Patreon/MadAlchemistsCocktailShrapnel.cs +++ b/Projectiles/Patreon/MadAlchemistsCocktailShrapnel.cs @@ -39,14 +39,14 @@ namespace CalamityMod.Projectiles.Patreon for (int num41 = 0; num41 < 2; num41++) { Vector2 value8 = Vector2.UnitX * -15f; - value8 = -Vector2.UnitY.RotatedBy((double)(projectile.localAI[0] * 0.1308997f + (float)num41 * 3.14159274f), default(Vector2)) * value7 * 0.75f; - int num42 = Dust.NewDust(projectile.Center, 0, 0, 173, 0f, 0f, 160, default(Color), 0.75f); + value8 = -Vector2.UnitY.RotatedBy((double)(projectile.localAI[0] * 0.1308997f + (float)num41 * 3.14159274f), default) * value7 * 0.75f; + int num42 = Dust.NewDust(projectile.Center, 0, 0, 173, 0f, 0f, 160, default, 0.75f); Main.dust[num42].noGravity = true; Main.dust[num42].position = projectile.Center + value8; Main.dust[num42].velocity = projectile.velocity; } } - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 1f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0f; float num472 = projectile.Center.X; diff --git a/Projectiles/Patreon/MourningSkull.cs b/Projectiles/Patreon/MourningSkull.cs index 34932a7f08..acb86aa2c1 100644 --- a/Projectiles/Patreon/MourningSkull.cs +++ b/Projectiles/Patreon/MourningSkull.cs @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Patreon } int num564 = 8; - int num565 = Dust.NewDust(new Vector2(projectile.position.X + (float)num564, projectile.position.Y + (float)num564), projectile.width - num564 * 2, projectile.height - num564 * 2, (Main.rand.Next(2) == 0 ? 5 : 6), 0f, 0f, 0, default(Color), 1f); + int num565 = Dust.NewDust(new Vector2(projectile.position.X + (float)num564, projectile.position.Y + (float)num564), projectile.width - num564 * 2, projectile.height - num564 * 2, (Main.rand.NextBool(2) ? 5 : 6), 0f, 0f, 0, default, 1f); Dust dust = Main.dust[num565]; dust.velocity *= 0.5f; dust = Main.dust[num565]; @@ -135,9 +135,9 @@ namespace CalamityMod.Projectiles.Patreon Main.PlaySound(SoundID.Item10, projectile.position); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -145,10 +145,10 @@ namespace CalamityMod.Projectiles.Patreon } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Patreon/NadirSpear.cs b/Projectiles/Patreon/NadirSpear.cs index 1884eda3b5..221f026775 100644 --- a/Projectiles/Patreon/NadirSpear.cs +++ b/Projectiles/Patreon/NadirSpear.cs @@ -109,7 +109,7 @@ namespace CalamityMod.Projectiles.Patreon int movingDust = 3; for (int i = 0; i < movingDust; ++i) { - int dustID = Main.rand.Next(4) == 0 ? 27 : 118; + int dustID = Main.rand.NextBool(4) ? 27 : 118; Vector2 corner = 0.5f * projectile.position + 0.5f * projectile.Center; int idx = Dust.NewDust(corner, projectile.width / 2, projectile.height / 2, dustID); diff --git a/Projectiles/Patreon/OracleYoyo.cs b/Projectiles/Patreon/OracleYoyo.cs index 12a079b56d..dd930d311f 100644 --- a/Projectiles/Patreon/OracleYoyo.cs +++ b/Projectiles/Patreon/OracleYoyo.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Patreon // Produces golden dust constantly while in flight. This lights the yoyo. if (Main.rand.NextBool()) { - int dustType = (Main.rand.Next(3) == 0) ? 244 : 246; + int dustType = (Main.rand.NextBool(3)) ? 244 : 246; float scale = 0.8f + Main.rand.NextFloat(0.6f); int idx = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType); Main.dust[idx].noGravity = true; @@ -134,7 +134,7 @@ namespace CalamityMod.Projectiles.Patreon } // Rarely, draw some "arcs" which are lines of dust to the edge - if (Main.rand.Next(30) == 0) + if (Main.rand.NextBool(30)) { int numArcs = 3; float arcDustDensity = 0.6f; @@ -192,7 +192,7 @@ namespace CalamityMod.Projectiles.Patreon bool crit = Main.rand.Next(100) <= owner.meleeCrit + 4; target.StrikeNPC(finalDamage, 0f, 0, crit, false, false); - if (Main.netMode != 0) + if (Main.netMode != NetmodeID.SinglePlayer) NetMessage.SendData(28, -1, -1, null, i, finalDamage, 0f, 0f, crit ? 1 : 0, 0, 0); } } diff --git a/Projectiles/Patreon/Orbacle.cs b/Projectiles/Patreon/Orbacle.cs index 5033b3fd2b..c41769636e 100644 --- a/Projectiles/Patreon/Orbacle.cs +++ b/Projectiles/Patreon/Orbacle.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Patreon public override void AI() { // Produces golden dust while in flight - int dustType = (Main.rand.Next(3) == 0) ? 244 : 246; + int dustType = (Main.rand.NextBool(3)) ? 244 : 246; float scale = 0.8f + Main.rand.NextFloat(0.6f); int idx = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType); Main.dust[idx].noGravity = true; diff --git a/Projectiles/Patreon/PerforaMini.cs b/Projectiles/Patreon/PerforaMini.cs index a4d346eb8a..edc2e75913 100644 --- a/Projectiles/Patreon/PerforaMini.cs +++ b/Projectiles/Patreon/PerforaMini.cs @@ -145,10 +145,10 @@ namespace CalamityMod.Projectiles.Patreon } //Dust - if (Main.rand.Next(50) == 0) + if (Main.rand.NextBool(50)) { - int d1 = Dust.NewDust(projectile.Center, projectile.width, projectile.height, 5, 0f, 0f, 100, default(Color), 1.5f); - int d2 = Dust.NewDust(projectile.Center, projectile.width, projectile.height, 170, 0f, 0f, 170, default(Color), 0.5f); + int d1 = Dust.NewDust(projectile.Center, projectile.width, projectile.height, 5, 0f, 0f, 100, default, 1.5f); + int d2 = Dust.NewDust(projectile.Center, projectile.width, projectile.height, 170, 0f, 0f, 170, default, 0.5f); Main.dust[d2].noLight = true; Main.dust[d1].position = projectile.Center; Main.dust[d2].position = projectile.Center; diff --git a/Projectiles/Patreon/PinkButterfly.cs b/Projectiles/Patreon/PinkButterfly.cs index 4adbe558e3..e0c2e3c161 100644 --- a/Projectiles/Patreon/PinkButterfly.cs +++ b/Projectiles/Patreon/PinkButterfly.cs @@ -43,9 +43,9 @@ namespace CalamityMod.Projectiles.Patreon for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.5f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 73, vector7.X, vector7.Y, 100, default(Color), 1.1f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 73, vector7.X, vector7.Y, 100, default, 1.1f); Main.dust[num228].noGravity = true; } projectile.localAI[0] += 1f; diff --git a/Projectiles/Patreon/PlagueBee.cs b/Projectiles/Patreon/PlagueBee.cs index f681eeba07..4c97d18762 100644 --- a/Projectiles/Patreon/PlagueBee.cs +++ b/Projectiles/Patreon/PlagueBee.cs @@ -148,7 +148,7 @@ namespace CalamityMod.Projectiles.Patreon int num3; for (int num418 = 0; num418 < 3; num418 = num3 + 1) { - int num419 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 89, projectile.velocity.X, projectile.velocity.Y, 50, default(Color), 1f); + int num419 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 89, projectile.velocity.X, projectile.velocity.Y, 50, default, 1f); Main.dust[num419].noGravity = true; Main.dust[num419].scale = 1f; num3 = num418; diff --git a/Projectiles/Patreon/Plaguenade.cs b/Projectiles/Patreon/Plaguenade.cs index eea5afeabb..a5b8913a79 100644 --- a/Projectiles/Patreon/Plaguenade.cs +++ b/Projectiles/Patreon/Plaguenade.cs @@ -90,9 +90,9 @@ namespace CalamityMod.Projectiles.Patreon projectile.Damage(); for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -100,10 +100,10 @@ namespace CalamityMod.Projectiles.Patreon } for (int num623 = 0; num623 < 30; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } for (int num625 = 0; num625 < 3; num625++) @@ -117,25 +117,25 @@ namespace CalamityMod.Projectiles.Patreon { scaleFactor10 = 1f; } - int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13AB6_cp_0 = Main.gore[num626]; expr_13AB6_cp_0.velocity.X = expr_13AB6_cp_0.velocity.X + 1f; Gore expr_13AD6_cp_0 = Main.gore[num626]; expr_13AD6_cp_0.velocity.Y = expr_13AD6_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13B79_cp_0 = Main.gore[num626]; expr_13B79_cp_0.velocity.X = expr_13B79_cp_0.velocity.X - 1f; Gore expr_13B99_cp_0 = Main.gore[num626]; expr_13B99_cp_0.velocity.Y = expr_13B99_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13C3C_cp_0 = Main.gore[num626]; expr_13C3C_cp_0.velocity.X = expr_13C3C_cp_0.velocity.X + 1f; Gore expr_13C5C_cp_0 = Main.gore[num626]; expr_13C5C_cp_0.velocity.Y = expr_13C5C_cp_0.velocity.Y - 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13CFF_cp_0 = Main.gore[num626]; expr_13CFF_cp_0.velocity.X = expr_13CFF_cp_0.velocity.X - 1f; diff --git a/Projectiles/Patreon/PurpleButterfly.cs b/Projectiles/Patreon/PurpleButterfly.cs index 977b75fa4c..90fcfee241 100644 --- a/Projectiles/Patreon/PurpleButterfly.cs +++ b/Projectiles/Patreon/PurpleButterfly.cs @@ -45,9 +45,9 @@ namespace CalamityMod.Projectiles.Patreon for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.5f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 173, vector7.X, vector7.Y, 100, default(Color), 1.8f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 173, vector7.X, vector7.Y, 100, default, 1.8f); Main.dust[num228].noGravity = true; } dust--; diff --git a/Projectiles/Patreon/Rox1.cs b/Projectiles/Patreon/Rox1.cs index a9f58109f8..765483eb42 100644 --- a/Projectiles/Patreon/Rox1.cs +++ b/Projectiles/Patreon/Rox1.cs @@ -30,9 +30,9 @@ namespace CalamityMod.Projectiles.Patreon projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; projectile.spriteDirection = projectile.direction; //Dust trail - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { - Dust.NewDust(projectile.position, projectile.width, projectile.height, 191, projectile.velocity.X * 0.4f, projectile.velocity.Y * 0.4f, 160, default(Color), 0.7f); + Dust.NewDust(projectile.position, projectile.width, projectile.height, 191, projectile.velocity.X * 0.4f, projectile.velocity.Y * 0.4f, 160, default, 0.7f); } } @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Patreon { for (int i = 0; i < 8; i++) { - Dust.NewDust(projectile.position, projectile.width, projectile.height, 191, -projectile.velocity.X * 0.4f, -projectile.velocity.Y * 0.4f, 120, default(Color), 1.2f); + Dust.NewDust(projectile.position, projectile.width, projectile.height, 191, -projectile.velocity.X * 0.4f, -projectile.velocity.Y * 0.4f, 120, default, 1.2f); } Main.PlaySound(0, projectile.position); projectile.Kill(); diff --git a/Projectiles/Patreon/RoxSlam.cs b/Projectiles/Patreon/RoxSlam.cs index 87f62f462b..a209a72a67 100644 --- a/Projectiles/Patreon/RoxSlam.cs +++ b/Projectiles/Patreon/RoxSlam.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Patreon for (int dustexplode = 0; dustexplode < 360; dustexplode++) { Vector2 dustd = new Vector2(17f, 17f).RotatedBy(MathHelper.ToRadians(dustexplode)); - int d = Dust.NewDust(projectile.Center, projectile.width, projectile.height, 51, dustd.X, dustd.Y, 100, default(Color), 3f); + int d = Dust.NewDust(projectile.Center, projectile.width, projectile.height, 51, dustd.X, dustd.Y, 100, default, 3f); Main.dust[d].noGravity = true; Main.dust[d].position = projectile.Center; } diff --git a/Projectiles/Patreon/SakuraBullet.cs b/Projectiles/Patreon/SakuraBullet.cs index cba0d017e3..6e60941c76 100644 --- a/Projectiles/Patreon/SakuraBullet.cs +++ b/Projectiles/Patreon/SakuraBullet.cs @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Patreon projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f; } - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 73, 0f, 0f, 100, default(Color), 0.6f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 73, 0f, 0f, 100, default, 0.6f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; @@ -82,16 +82,16 @@ namespace CalamityMod.Projectiles.Patreon public override void Kill(int timeLeft) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 25); - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 73, 0f, 0f, 100, default(Color), 1f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 73, 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 0.5f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; } - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 73, 0f, 0f, 100, default(Color), 1.4f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 73, 0f, 0f, 100, default, 1.4f); Main.dust[num624].noGravity = true; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 73, 0f, 0f, 100, default(Color), 0.8f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 73, 0f, 0f, 100, default, 0.8f); } } } diff --git a/Projectiles/Patreon/ThePackMinissile.cs b/Projectiles/Patreon/ThePackMinissile.cs index 6609a6fc23..5e3b129472 100644 --- a/Projectiles/Patreon/ThePackMinissile.cs +++ b/Projectiles/Patreon/ThePackMinissile.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Patreon Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); for (int i = 0; i < 10; i++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 255, 0f, 0f, 0, default(Color), 1f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 255, 0f, 0f, 0, default, 1f); } } diff --git a/Projectiles/Patreon/ThePackMissile.cs b/Projectiles/Patreon/ThePackMissile.cs index bd4713c16d..05cdaa344b 100644 --- a/Projectiles/Patreon/ThePackMissile.cs +++ b/Projectiles/Patreon/ThePackMissile.cs @@ -108,9 +108,9 @@ namespace CalamityMod.Projectiles.Patreon projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 255, 0f, 0f, 0, default(Color), 1.5f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 255, 0f, 0f, 0, default, 1.5f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -118,10 +118,10 @@ namespace CalamityMod.Projectiles.Patreon } for (int num623 = 0; num623 < 60; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 255, 0f, 0f, 0, default(Color), 2f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 255, 0f, 0f, 0, default, 2f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 255, 0f, 0f, 0, default(Color), 1.5f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 255, 0f, 0f, 0, default, 1.5f); Main.dust[num624].velocity *= 2f; } projectile.Damage(); diff --git a/Projectiles/Patreon/TimeBolt.cs b/Projectiles/Patreon/TimeBolt.cs index 4a835383eb..8938a54044 100644 --- a/Projectiles/Patreon/TimeBolt.cs +++ b/Projectiles/Patreon/TimeBolt.cs @@ -60,8 +60,8 @@ namespace CalamityMod.Projectiles.Patreon Vector2 center = projectile.Center; Vector2 vector74 = new Vector2(-4f, 4f); vector74 += new Vector2(-4f, 4f); - vector74 = vector74.RotatedBy((double)projectile.rotation, default(Vector2)); - int dust = Dust.NewDust(center + vector74 + Vector2.One * -4f, 8, 8, dustType, 0f, 0f, 100, default(Color), 1f); + vector74 = vector74.RotatedBy((double)projectile.rotation, default); + int dust = Dust.NewDust(center + vector74 + Vector2.One * -4f, 8, 8, dustType, 0f, 0f, 100, default, 1f); Dust dust2 = Main.dust[dust]; dust2.velocity *= 0.1f; if (Main.rand.Next(6) != 0) @@ -146,7 +146,7 @@ namespace CalamityMod.Projectiles.Patreon projectile.Kill(); } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dustType = Utils.SelectRandom(Main.rand, new int[] { @@ -156,8 +156,8 @@ namespace CalamityMod.Projectiles.Patreon Vector2 center = projectile.Center; Vector2 vector75 = new Vector2(-4f, 4f); vector75 += new Vector2(-4f, 4f); - vector75 = vector75.RotatedBy((double)projectile.rotation, default(Vector2)); - int dust = Dust.NewDust(center + vector75 + Vector2.One * -4f, 8, 8, dustType, 0f, 0f, 100, default(Color), 0.6f); + vector75 = vector75.RotatedBy((double)projectile.rotation, default); + int dust = Dust.NewDust(center + vector75 + Vector2.One * -4f, 8, 8, dustType, 0f, 0f, 100, default, 0.6f); Dust dust2 = Main.dust[dust]; dust2.velocity *= 0.1f; dust2.noGravity = true; @@ -198,8 +198,8 @@ namespace CalamityMod.Projectiles.Patreon Vector2 center = projectile.Center; Vector2 vector76 = new Vector2(-4f, 4f); vector76 += new Vector2(-4f, 4f); - vector76 = vector76.RotatedBy((double)projectile.rotation, default(Vector2)); - int dust = Dust.NewDust(center + vector76 + Vector2.One * -4f, 8, 8, dustType, 0f, 0f, 100, default(Color), 0.6f); + vector76 = vector76.RotatedBy((double)projectile.rotation, default); + int dust = Dust.NewDust(center + vector76 + Vector2.One * -4f, 8, 8, dustType, 0f, 0f, 100, default, 0.6f); Dust dust2 = Main.dust[dust]; dust2.velocity *= 0.1f; dust2.noGravity = true; diff --git a/Projectiles/Patreon/VoidEssence.cs b/Projectiles/Patreon/VoidEssence.cs index e54301673f..b279f1f379 100644 --- a/Projectiles/Patreon/VoidEssence.cs +++ b/Projectiles/Patreon/VoidEssence.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Patreon int trailDust = 1; for (int i = 0; i < trailDust; ++i) { - int dustID = Main.rand.Next(8) == 0 ? 66 : 143; + int dustID = Main.rand.NextBool(8) ? 66 : 143; int idx = Dust.NewDust(projectile.position - projectile.velocity, projectile.width, projectile.height, dustID); Main.dust[idx].noGravity = true; diff --git a/Projectiles/Patreon/VoidTentacle.cs b/Projectiles/Patreon/VoidTentacle.cs index 5ede12bcce..0c78dc87f5 100644 --- a/Projectiles/Patreon/VoidTentacle.cs +++ b/Projectiles/Patreon/VoidTentacle.cs @@ -74,8 +74,8 @@ namespace CalamityMod.Projectiles.Patreon int i = 0; while (i < projectile.scale * 4f) { - int dustID = Main.rand.Next(5) == 0 ? 199 : 175; - int idx = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustID, projectile.velocity.X, projectile.velocity.Y, 100, default(Color), 1.1f); + int dustID = Main.rand.NextBool(5) ? 199 : 175; + int idx = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustID, projectile.velocity.X, projectile.velocity.Y, 100, default, 1.1f); Main.dust[idx].position = (Main.dust[idx].position + projectile.Center) / 2f; Main.dust[idx].noGravity = true; Main.dust[idx].velocity *= 0.1f; diff --git a/Projectiles/Patreon/YateveoBloom.cs b/Projectiles/Patreon/YateveoBloom.cs index f3fa91681c..ef5eb51de8 100644 --- a/Projectiles/Patreon/YateveoBloom.cs +++ b/Projectiles/Patreon/YateveoBloom.cs @@ -125,7 +125,7 @@ namespace CalamityMod.Projectiles.Patreon } } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dustType = Main.rand.Next(5); switch (dustType) diff --git a/Projectiles/Patreon/YateveoBloomSpear.cs b/Projectiles/Patreon/YateveoBloomSpear.cs index b7d6bbe9f7..c7d32250fa 100644 --- a/Projectiles/Patreon/YateveoBloomSpear.cs +++ b/Projectiles/Patreon/YateveoBloomSpear.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Patreon projectile.position.Y = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - (float)(projectile.height / 2); projectile.position += projectile.velocity * projectile.ai[0]; - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { int dustType = Main.rand.Next(5); switch (dustType) diff --git a/Projectiles/Permafrost/ArcticBearPaw.cs b/Projectiles/Permafrost/ArcticBearPaw.cs index 8478030e81..dccf943e51 100644 --- a/Projectiles/Permafrost/ArcticBearPaw.cs +++ b/Projectiles/Permafrost/ArcticBearPaw.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Permafrost target.AddBuff(BuffID.Frostburn, 480); target.AddBuff(mod.BuffType("GlacialState"), 60); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) target.AddBuff(BuffID.Confused, Main.rand.Next(60, 240)); } diff --git a/Projectiles/Permafrost/DarkIce.cs b/Projectiles/Permafrost/DarkIce.cs index 2aca565abf..c4a5b33713 100644 --- a/Projectiles/Permafrost/DarkIce.cs +++ b/Projectiles/Permafrost/DarkIce.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Permafrost } //make pretty dust - int index2 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 172, projectile.velocity.X, projectile.velocity.Y, 0, default(Color), 1.25f); + int index2 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 172, projectile.velocity.X, projectile.velocity.Y, 0, default, 1.25f); Main.dust[index2].noGravity = true; } @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Permafrost Main.PlaySound(SoundID.Item27, projectile.position); for (int i = 0; i < 30; i++) { - int index2 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 172, 0f, 0f, 0, default(Color), Main.rand.NextFloat(1f, 2f)); + int index2 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 172, 0f, 0f, 0, default, Main.rand.NextFloat(1f, 2f)); Main.dust[index2].noGravity = true; Main.dust[index2].velocity *= 4f; } diff --git a/Projectiles/Permafrost/DarkIceZero.cs b/Projectiles/Permafrost/DarkIceZero.cs index de18456d47..0f03284fa5 100644 --- a/Projectiles/Permafrost/DarkIceZero.cs +++ b/Projectiles/Permafrost/DarkIceZero.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Permafrost } //make pretty dust - int index2 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 172, projectile.velocity.X, projectile.velocity.Y, 0, default(Color), 1.25f); + int index2 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 172, projectile.velocity.X, projectile.velocity.Y, 0, default, 1.25f); Main.dust[index2].noGravity = true; } @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Permafrost Main.PlaySound(SoundID.Item27, projectile.position); for (int i = 0; i < 30; i++) { - int index2 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 172, 0f, 0f, 0, default(Color), Main.rand.NextFloat(1f, 2f)); + int index2 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 172, 0f, 0f, 0, default, Main.rand.NextFloat(1f, 2f)); Main.dust[index2].noGravity = true; Main.dust[index2].velocity *= 4f; } diff --git a/Projectiles/Permafrost/IcicleArrow.cs b/Projectiles/Permafrost/IcicleArrow.cs index 8a55f64074..ebab417060 100644 --- a/Projectiles/Permafrost/IcicleArrow.cs +++ b/Projectiles/Permafrost/IcicleArrow.cs @@ -28,9 +28,9 @@ namespace CalamityMod.Projectiles.Permafrost public override void AI() { //icicle dust - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { - int index2 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 68, projectile.velocity.X, projectile.velocity.Y, 0, default(Color), 1.1f); + int index2 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 68, projectile.velocity.X, projectile.velocity.Y, 0, default, 1.1f); Main.dust[index2].noGravity = true; } } diff --git a/Projectiles/Permafrost/IcyBullet.cs b/Projectiles/Permafrost/IcyBullet.cs index 2e96328116..68eec3c080 100644 --- a/Projectiles/Permafrost/IcyBullet.cs +++ b/Projectiles/Permafrost/IcyBullet.cs @@ -30,9 +30,9 @@ namespace CalamityMod.Projectiles.Permafrost public override void AI() { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { - int index2 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 88, projectile.velocity.X, projectile.velocity.Y, 0, default(Color), 1f); + int index2 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 88, projectile.velocity.X, projectile.velocity.Y, 0, default, 1f); Main.dust[index2].noGravity = true; } } diff --git a/Projectiles/Pets/Brimling.cs b/Projectiles/Pets/Brimling.cs index b02e0b47a2..2c0a1f7142 100644 --- a/Projectiles/Pets/Brimling.cs +++ b/Projectiles/Pets/Brimling.cs @@ -64,7 +64,7 @@ namespace CalamityMod.Projectiles.Pets projectile.position.Y = projectile.position.Y + num19; for (int k = 0; k < 10; k++) { - Dust.NewDust(projectile.position, projectile.width, projectile.height, 235, 0, -1f, 0, default(Color), 1f); + Dust.NewDust(projectile.position, projectile.width, projectile.height, 235, 0, -1f, 0, default, 1f); } } diff --git a/Projectiles/Pets/ChibiiDoggo.cs b/Projectiles/Pets/ChibiiDoggo.cs index f6ede5e269..d6bd06847a 100644 --- a/Projectiles/Pets/ChibiiDoggo.cs +++ b/Projectiles/Pets/ChibiiDoggo.cs @@ -151,7 +151,7 @@ namespace CalamityMod.Projectiles.Pets for (int i = 0; i < 77; i++) //loop to make lots of dust { - int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 182, projectile.velocity.X * 0.7f, projectile.velocity.Y * 0.7f, 100, default(Color), 2.5f); + int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 182, projectile.velocity.X * 0.7f, projectile.velocity.Y * 0.7f, 100, default, 2.5f); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 1.5f; @@ -214,9 +214,9 @@ namespace CalamityMod.Projectiles.Pets if ((double) notlocalai1 > (double) Main.rand.Next(30, 120) && !player.immune && player.velocity.X == 0 && player.velocity.Y == 0) { - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { int style = 5 + Main.rand.Next(5); Main.PlaySound(SoundID.Meowmere, (int) projectile.position.X, (int) projectile.position.Y, style, 4f, 0.0f); //nya @@ -235,7 +235,7 @@ namespace CalamityMod.Projectiles.Pets player.immune = false; player.immuneTime = 0; - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) SpawnDoggo(); } projectile.netUpdate = true; diff --git a/Projectiles/Pets/ChibiiDoggoFly.cs b/Projectiles/Pets/ChibiiDoggoFly.cs index 04c9dab231..de8eeb3db4 100644 --- a/Projectiles/Pets/ChibiiDoggoFly.cs +++ b/Projectiles/Pets/ChibiiDoggoFly.cs @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Pets public override void AI() { - if (Main.player[projectile.owner].GetModPlayer(mod).chibii) + if (Main.player[projectile.owner].GetCalamityPlayer().chibii) projectile.timeLeft = 2; int byUuid = (int) projectile.ai[0]; //contains identity of parent projectile in main.projectile array diff --git a/Projectiles/Pets/DannyDevito.cs b/Projectiles/Pets/DannyDevito.cs index dda14b7b17..4c786fffde 100644 --- a/Projectiles/Pets/DannyDevito.cs +++ b/Projectiles/Pets/DannyDevito.cs @@ -279,7 +279,7 @@ namespace CalamityMod.Projectiles.Pets Recipe.FindRecipes(); return; } - Main.player[projectile.owner].GetModPlayer(mod).trashManChest = projectile.type; + Main.player[projectile.owner].GetCalamityPlayer().trashManChest = projectile.type; Main.player[projectile.owner].chest = -2; Main.player[projectile.owner].chestX = (int)(projectile.Center.X / 16f); Main.player[projectile.owner].chestY = (int)(projectile.Center.Y / 16f); diff --git a/Projectiles/Pets/Kendra.cs b/Projectiles/Pets/Kendra.cs index afa4a45b6a..10d4ce69aa 100644 --- a/Projectiles/Pets/Kendra.cs +++ b/Projectiles/Pets/Kendra.cs @@ -197,7 +197,7 @@ namespace CalamityMod.Projectiles.Pets idleTimer = 0; } idleBarkTimer++; - if (idleBarkTimer > 1080 && Main.rand.Next(2) == 0) + if (idleBarkTimer > 1080 && Main.rand.NextBool(2)) { Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/KendraBark"), (int)projectile.position.X, (int)projectile.position.Y); chosenIdle = 3; diff --git a/Projectiles/Ranged/AccelerationBullet.cs b/Projectiles/Ranged/AccelerationBullet.cs index f815c51a3c..4b217c8842 100644 --- a/Projectiles/Ranged/AccelerationBullet.cs +++ b/Projectiles/Ranged/AccelerationBullet.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Ranged { float x2 = projectile.position.X - projectile.velocity.X / 10f * (float)num136; float y2 = projectile.position.Y - projectile.velocity.Y / 10f * (float)num136; - int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 91, 0f, 0f, 0, default(Color), 0.5f); + int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 91, 0f, 0f, 0, default, 0.5f); Main.dust[num137].alpha = projectile.alpha; Main.dust[num137].position.X = x2; Main.dust[num137].position.Y = y2; diff --git a/Projectiles/Ranged/AcidBullet.cs b/Projectiles/Ranged/AcidBullet.cs index fdfa51f107..57ef3753c2 100644 --- a/Projectiles/Ranged/AcidBullet.cs +++ b/Projectiles/Ranged/AcidBullet.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Ranged { float x2 = projectile.position.X - projectile.velocity.X / 10f * (float)num136; float y2 = projectile.position.Y - projectile.velocity.Y / 10f * (float)num136; - int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 107, 0f, 0f, 0, default(Color), 0.5f); + int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 107, 0f, 0f, 0, default, 0.5f); Main.dust[num137].alpha = projectile.alpha; Main.dust[num137].position.X = x2; Main.dust[num137].position.Y = y2; diff --git a/Projectiles/Ranged/AquaBlast.cs b/Projectiles/Ranged/AquaBlast.cs index 6b845c52bf..6174294c29 100644 --- a/Projectiles/Ranged/AquaBlast.cs +++ b/Projectiles/Ranged/AquaBlast.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Ranged Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0f) / 255f, ((255 - projectile.alpha) * 0f) / 255f, ((255 - projectile.alpha) * 0.75f) / 255f); for (int num457 = 0; num457 < 5; num457++) { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default(Color), 1f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default, 1f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Ranged { for (int lol = 0; lol < 10; lol++) { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default(Color), 1f); + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default, 1f); } } } diff --git a/Projectiles/Ranged/AquaBlastToxic.cs b/Projectiles/Ranged/AquaBlastToxic.cs index 74e04035f5..ebff22df79 100644 --- a/Projectiles/Ranged/AquaBlastToxic.cs +++ b/Projectiles/Ranged/AquaBlastToxic.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Ranged Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0f) / 255f, ((255 - projectile.alpha) * 0.35f) / 255f, ((255 - projectile.alpha) * 0.4f) / 255f); for (int num457 = 0; num457 < 5; num457++) { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default(Color), 1f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default, 1f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Ranged { for (int lol = 0; lol < 10; lol++) { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default(Color), 1f); + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default, 1f); } } diff --git a/Projectiles/Ranged/Archerfish.cs b/Projectiles/Ranged/Archerfish.cs index 959d767c18..d78603c6ed 100644 --- a/Projectiles/Ranged/Archerfish.cs +++ b/Projectiles/Ranged/Archerfish.cs @@ -40,19 +40,19 @@ namespace CalamityMod.Projectiles.Ranged float num588 = projectile.velocity.X / 6f * (float)num587; float num589 = projectile.velocity.Y / 6f * (float)num587; int num590 = 6; - int num591 = Dust.NewDust(new Vector2(projectile.position.X + (float)num590, projectile.position.Y + (float)num590), projectile.width - num590 * 2, projectile.height - num590 * 2, 211, 0f, 0f, 75, default(Color), 1.2f); + int num591 = Dust.NewDust(new Vector2(projectile.position.X + (float)num590, projectile.position.Y + (float)num590), projectile.width - num590 * 2, projectile.height - num590 * 2, 211, 0f, 0f, 75, default, 1.2f); Dust dust; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { dust = Main.dust[num591]; dust.alpha += 25; } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { dust = Main.dust[num591]; dust.alpha += 25; } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { dust = Main.dust[num591]; dust.alpha += 25; @@ -71,10 +71,10 @@ namespace CalamityMod.Projectiles.Ranged dust.velocity *= 0.2f; num3 = num587; } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { int num592 = 6; - int num593 = Dust.NewDust(new Vector2(projectile.position.X + (float)num592, projectile.position.Y + (float)num592), projectile.width - num592 * 2, projectile.height - num592 * 2, 211, 0f, 0f, 75, default(Color), 0.65f); + int num593 = Dust.NewDust(new Vector2(projectile.position.X + (float)num592, projectile.position.Y + (float)num592), projectile.width - num592 * 2, projectile.height - num592 * 2, 211, 0f, 0f, 75, default, 0.65f); Dust dust = Main.dust[num593]; dust.velocity *= 0.5f; dust = Main.dust[num593]; @@ -90,24 +90,24 @@ namespace CalamityMod.Projectiles.Ranged int num3; for (int num362 = 0; num362 < 100; num362 = num3 + 1) { - int num363 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 211, 0f, 0f, 75, default(Color), 1.2f); + int num363 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 211, 0f, 0f, 75, default, 1.2f); Dust dust; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { dust = Main.dust[num363]; dust.alpha += 25; } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { dust = Main.dust[num363]; dust.alpha += 25; } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { dust = Main.dust[num363]; dust.alpha += 25; } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num363].scale = 0.6f; } diff --git a/Projectiles/Ranged/ArcticArrow.cs b/Projectiles/Ranged/ArcticArrow.cs index a7d0741e2d..37e066f0b8 100644 --- a/Projectiles/Ranged/ArcticArrow.cs +++ b/Projectiles/Ranged/ArcticArrow.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 67, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } @@ -51,9 +51,9 @@ namespace CalamityMod.Projectiles.Ranged projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 67, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 67, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/AstralRound.cs b/Projectiles/Ranged/AstralRound.cs index 7b28a92094..b05ef086e2 100644 --- a/Projectiles/Ranged/AstralRound.cs +++ b/Projectiles/Ranged/AstralRound.cs @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Ranged } float x2 = projectile.position.X - projectile.velocity.X / 10f * (float)num136; float y2 = projectile.position.Y - projectile.velocity.Y / 10f * (float)num136; - int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, randomDust, 0f, 0f, 0, default(Color), 1.5f); + int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, randomDust, 0f, 0f, 0, default, 1.5f); Main.dust[num137].position.X = x2; Main.dust[num137].position.Y = y2; Main.dust[num137].velocity *= 0f; diff --git a/Projectiles/Ranged/AstrealArrow.cs b/Projectiles/Ranged/AstrealArrow.cs index f881e5513b..50ad9921ed 100644 --- a/Projectiles/Ranged/AstrealArrow.cs +++ b/Projectiles/Ranged/AstrealArrow.cs @@ -78,13 +78,13 @@ namespace CalamityMod.Projectiles.Ranged projectile.velocity.X = -10f; projectile.velocity.Y = 0f; } - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 173, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } if (flameTimer <= 0) { - float xPos = (Main.rand.Next(2) == 0 ? projectile.position.X + 800 : projectile.position.X - 800); + float xPos = (Main.rand.NextBool(2) ? projectile.position.X + 800 : projectile.position.X - 800); Vector2 vector2 = new Vector2(xPos, projectile.position.Y + Main.rand.Next(-800, 801)); float num80 = xPos; float speedX = (float)projectile.position.X - vector2.X; diff --git a/Projectiles/Ranged/AstrealFlame.cs b/Projectiles/Ranged/AstrealFlame.cs index 13fc03d0fc..80142d9e63 100644 --- a/Projectiles/Ranged/AstrealFlame.cs +++ b/Projectiles/Ranged/AstrealFlame.cs @@ -83,9 +83,9 @@ namespace CalamityMod.Projectiles.Ranged projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -93,10 +93,10 @@ namespace CalamityMod.Projectiles.Ranged } for (int num623 = 0; num623 < 15; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Ranged/BeeRPG.cs b/Projectiles/Ranged/BeeRPG.cs index a08cff3ffd..fc50fd8f9c 100644 --- a/Projectiles/Ranged/BeeRPG.cs +++ b/Projectiles/Ranged/BeeRPG.cs @@ -35,11 +35,11 @@ namespace CalamityMod.Projectiles.Ranged num247 = projectile.velocity.X * 0.5f; num248 = projectile.velocity.Y * 0.5f; } - int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 6, 0f, 0f, 100, default(Color), 1f); + int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 6, 0f, 0f, 100, default, 1f); Main.dust[num249].scale *= 2f + (float)Main.rand.Next(10) * 0.1f; Main.dust[num249].velocity *= 0.2f; Main.dust[num249].noGravity = true; - num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 31, 0f, 0f, 100, default(Color), 0.5f); + num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 31, 0f, 0f, 100, default, 0.5f); Main.dust[num249].fadeIn = 1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num249].velocity *= 0.05f; } @@ -48,18 +48,18 @@ namespace CalamityMod.Projectiles.Ranged { projectile.velocity *= 2f; } - else if (Main.rand.Next(2) == 0) + else if (Main.rand.NextBool(2)) { - int num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 1f); + int num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 1f); Main.dust[num252].scale = 0.1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].fadeIn = 1.5f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].noGravity = true; - Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2)).RotatedBy((double)projectile.rotation, default(Vector2)) * 1.1f; + Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2)).RotatedBy((double)projectile.rotation, default) * 1.1f; Main.rand.Next(2); - num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 1f); + num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 1f); Main.dust[num252].scale = 1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].noGravity = true; - Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2 - 6)).RotatedBy((double)projectile.rotation, default(Vector2)) * 1.1f; + Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2 - 6)).RotatedBy((double)projectile.rotation, default) * 1.1f; } projectile.ai[0] += 1f; projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; @@ -94,7 +94,7 @@ namespace CalamityMod.Projectiles.Ranged int num516 = 12; for (int num517 = 0; num517 < num516; num517++) { - if (num517 % 2 != 1 || Main.rand.Next(3) == 0) + if (num517 % 2 != 1 || Main.rand.NextBool(3)) { Vector2 value20 = projectile.position; Vector2 value21 = projectile.oldVelocity; @@ -120,9 +120,9 @@ namespace CalamityMod.Projectiles.Ranged projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -130,10 +130,10 @@ namespace CalamityMod.Projectiles.Ranged } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } for (int num625 = 0; num625 < 2; num625++) @@ -147,25 +147,25 @@ namespace CalamityMod.Projectiles.Ranged { scaleFactor10 = 1f; } - int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13AB6_cp_0 = Main.gore[num626]; expr_13AB6_cp_0.velocity.X = expr_13AB6_cp_0.velocity.X + 1f; Gore expr_13AD6_cp_0 = Main.gore[num626]; expr_13AD6_cp_0.velocity.Y = expr_13AD6_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13B79_cp_0 = Main.gore[num626]; expr_13B79_cp_0.velocity.X = expr_13B79_cp_0.velocity.X - 1f; Gore expr_13B99_cp_0 = Main.gore[num626]; expr_13B99_cp_0.velocity.Y = expr_13B99_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13C3C_cp_0 = Main.gore[num626]; expr_13C3C_cp_0.velocity.X = expr_13C3C_cp_0.velocity.X + 1f; Gore expr_13C5C_cp_0 = Main.gore[num626]; expr_13C5C_cp_0.velocity.Y = expr_13C5C_cp_0.velocity.Y - 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13CFF_cp_0 = Main.gore[num626]; expr_13CFF_cp_0.velocity.X = expr_13CFF_cp_0.velocity.X - 1f; diff --git a/Projectiles/Ranged/BigNuke.cs b/Projectiles/Ranged/BigNuke.cs index 523f8df5c4..f9388eb5d7 100644 --- a/Projectiles/Ranged/BigNuke.cs +++ b/Projectiles/Ranged/BigNuke.cs @@ -36,11 +36,11 @@ namespace CalamityMod.Projectiles.Ranged num247 = projectile.velocity.X * 0.5f; num248 = projectile.velocity.Y * 0.5f; } - int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 6, 0f, 0f, 100, default(Color), 1f); + int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 6, 0f, 0f, 100, default, 1f); Main.dust[num249].scale *= 2f + (float)Main.rand.Next(10) * 0.1f; Main.dust[num249].velocity *= 0.2f; Main.dust[num249].noGravity = true; - num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 31, 0f, 0f, 100, default(Color), 0.5f); + num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 31, 0f, 0f, 100, default, 0.5f); Main.dust[num249].fadeIn = 1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num249].velocity *= 0.05f; } @@ -102,9 +102,9 @@ namespace CalamityMod.Projectiles.Ranged projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 90; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -112,10 +112,10 @@ namespace CalamityMod.Projectiles.Ranged } for (int num623 = 0; num623 < 180; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } for (int num625 = 0; num625 < 9; num625++) @@ -129,25 +129,25 @@ namespace CalamityMod.Projectiles.Ranged { scaleFactor10 = 1f; } - int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13AB6_cp_0 = Main.gore[num626]; expr_13AB6_cp_0.velocity.X = expr_13AB6_cp_0.velocity.X + 1f; Gore expr_13AD6_cp_0 = Main.gore[num626]; expr_13AD6_cp_0.velocity.Y = expr_13AD6_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13B79_cp_0 = Main.gore[num626]; expr_13B79_cp_0.velocity.X = expr_13B79_cp_0.velocity.X - 1f; Gore expr_13B99_cp_0 = Main.gore[num626]; expr_13B99_cp_0.velocity.Y = expr_13B99_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13C3C_cp_0 = Main.gore[num626]; expr_13C3C_cp_0.velocity.X = expr_13C3C_cp_0.velocity.X + 1f; Gore expr_13C5C_cp_0 = Main.gore[num626]; expr_13C5C_cp_0.velocity.Y = expr_13C5C_cp_0.velocity.Y - 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13CFF_cp_0 = Main.gore[num626]; expr_13CFF_cp_0.velocity.X = expr_13CFF_cp_0.velocity.X - 1f; diff --git a/Projectiles/Ranged/BloodClotFriendly.cs b/Projectiles/Ranged/BloodClotFriendly.cs index 25bd4eb36c..5a90f35921 100644 --- a/Projectiles/Ranged/BloodClotFriendly.cs +++ b/Projectiles/Ranged/BloodClotFriendly.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Ranged { for (int num468 = 0; num468 < 3; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, 0f, 0f, 100, default(Color), 2f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, 0f, 0f, 100, default, 2f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Ranged/BloodfireArrow.cs b/Projectiles/Ranged/BloodfireArrow.cs index 89a5093020..1092811618 100644 --- a/Projectiles/Ranged/BloodfireArrow.cs +++ b/Projectiles/Ranged/BloodfireArrow.cs @@ -44,9 +44,9 @@ namespace CalamityMod.Projectiles.Ranged for (int l = 0; l < 12; l++) { Vector2 vector3 = Vector2.UnitX * (float)(-(float)projectile.width) / 2f; - vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default(Vector2)) * new Vector2(8f, 16f); - vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default(Vector2)); - int num9 = Dust.NewDust(projectile.Center, 0, 0, 235, 0f, 0f, 160, default(Color), 1f); + vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default) * new Vector2(8f, 16f); + vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default); + int num9 = Dust.NewDust(projectile.Center, 0, 0, 235, 0f, 0f, 160, default, 1f); Main.dust[num9].scale = 1.1f; Main.dust[num9].noGravity = true; Main.dust[num9].position = projectile.Center + vector3; @@ -66,9 +66,9 @@ namespace CalamityMod.Projectiles.Ranged projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 0.5f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Ranged return; } Player player = Main.player[projectile.owner]; - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { player.statLife += 1; player.HealEffect(1); diff --git a/Projectiles/Ranged/BloodfireBullet.cs b/Projectiles/Ranged/BloodfireBullet.cs index a7097072a9..37637f6c7e 100644 --- a/Projectiles/Ranged/BloodfireBullet.cs +++ b/Projectiles/Ranged/BloodfireBullet.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Ranged return; } Player player = Main.player[projectile.owner]; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { player.statLife += 1; player.HealEffect(1); diff --git a/Projectiles/Ranged/BloodflareSoul.cs b/Projectiles/Ranged/BloodflareSoul.cs index 1ae3639471..1fe4538e0e 100644 --- a/Projectiles/Ranged/BloodflareSoul.cs +++ b/Projectiles/Ranged/BloodflareSoul.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Ranged { projectile.frame = 0; } - int num822 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 60, 0f, 0f, 0, default(Color), 1f); + int num822 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 60, 0f, 0f, 0, default, 1f); Dust dust = Main.dust[num822]; dust.velocity *= 0.1f; Main.dust[num822].scale = 1.3f; @@ -137,9 +137,9 @@ namespace CalamityMod.Projectiles.Ranged for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 60, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default(Color), 2f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 60, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default, 2f); Main.dust[num228].noGravity = true; Main.dust[num228].noLight = true; Main.dust[num228].velocity = vector7; diff --git a/Projectiles/Ranged/Bolt.cs b/Projectiles/Ranged/Bolt.cs index 926286ef1c..10645997ee 100644 --- a/Projectiles/Ranged/Bolt.cs +++ b/Projectiles/Ranged/Bolt.cs @@ -41,9 +41,9 @@ namespace CalamityMod.Projectiles.Ranged for (int l = 0; l < 12; l++) { Vector2 vector3 = Vector2.UnitX * (float)(-(float)projectile.width) / 2f; - vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default(Vector2)) * new Vector2(8f, 16f); - vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default(Vector2)); - int num9 = Dust.NewDust(projectile.Center, 0, 0, 221, 0f, 0f, 160, default(Color), 1f); + vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default) * new Vector2(8f, 16f); + vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default); + int num9 = Dust.NewDust(projectile.Center, 0, 0, 221, 0f, 0f, 160, default, 1f); Main.dust[num9].scale = 1.1f; Main.dust[num9].noGravity = true; Main.dust[num9].position = projectile.Center + vector3; diff --git a/Projectiles/Ranged/BoltArrow.cs b/Projectiles/Ranged/BoltArrow.cs index 34477254f5..191ebfd590 100644 --- a/Projectiles/Ranged/BoltArrow.cs +++ b/Projectiles/Ranged/BoltArrow.cs @@ -32,9 +32,9 @@ namespace CalamityMod.Projectiles.Ranged for (int l = 0; l < 12; l++) { Vector2 vector3 = Vector2.UnitX * (float)(-(float)projectile.width) / 2f; - vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default(Vector2)) * new Vector2(8f, 16f); - vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default(Vector2)); - int num9 = Dust.NewDust(projectile.Center, 0, 0, 221, 0f, 0f, 160, default(Color), 1f); + vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default) * new Vector2(8f, 16f); + vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default); + int num9 = Dust.NewDust(projectile.Center, 0, 0, 221, 0f, 0f, 160, default, 1f); Main.dust[num9].scale = 1.1f; Main.dust[num9].noGravity = true; Main.dust[num9].position = projectile.Center + vector3; @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Ranged int num212 = Main.rand.Next(10, 20); for (int num213 = 0; num213 < num212; num213++) { - int num214 = Dust.NewDust(projectile.Center - projectile.velocity / 2f, 0, 0, 135, 0f, 0f, 100, default(Color), 2f); + int num214 = Dust.NewDust(projectile.Center - projectile.velocity / 2f, 0, 0, 135, 0f, 0f, 100, default, 2f); Main.dust[num214].velocity *= 2f; Main.dust[num214].noGravity = true; } diff --git a/Projectiles/Ranged/BrimstoneBallFriendly.cs b/Projectiles/Ranged/BrimstoneBallFriendly.cs index 9b7bfb7c55..2b00b3a992 100644 --- a/Projectiles/Ranged/BrimstoneBallFriendly.cs +++ b/Projectiles/Ranged/BrimstoneBallFriendly.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Ranged { for (int num468 = 0; num468 < 5; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default(Color), 2f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default, 2f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Ranged/BrimstoneBolt.cs b/Projectiles/Ranged/BrimstoneBolt.cs index cf68b60d30..46bc3b74f8 100644 --- a/Projectiles/Ranged/BrimstoneBolt.cs +++ b/Projectiles/Ranged/BrimstoneBolt.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Ranged Lighting.AddLight(projectile.Center, 0.7f, 0f, 0f); for (int num121 = 0; num121 < 5; num121++) { - Dust dust4 = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 235, projectile.velocity.X, projectile.velocity.Y, 100, default(Color), 1f)]; + Dust dust4 = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 235, projectile.velocity.X, projectile.velocity.Y, 100, default, 1f)]; dust4.velocity = Vector2.Zero; dust4.position -= projectile.velocity / 5f * (float)num121; dust4.noGravity = true; diff --git a/Projectiles/Ranged/BrimstoneFireFriendly.cs b/Projectiles/Ranged/BrimstoneFireFriendly.cs index aa4d0dd051..2874deb754 100644 --- a/Projectiles/Ranged/BrimstoneFireFriendly.cs +++ b/Projectiles/Ranged/BrimstoneFireFriendly.cs @@ -47,12 +47,12 @@ namespace CalamityMod.Projectiles.Ranged } projectile.ai[0] += 1f; int num297 = 235; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { for (int num298 = 0; num298 < 1; num298++) { - int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1f); - if (Main.rand.Next(3) == 0) + int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); + if (Main.rand.NextBool(3)) { Main.dust[num299].noGravity = true; Main.dust[num299].scale *= 3f; diff --git a/Projectiles/Ranged/ChargedBlast3.cs b/Projectiles/Ranged/ChargedBlast3.cs index 59944d2b14..7d58d6f5ac 100644 --- a/Projectiles/Ranged/ChargedBlast3.cs +++ b/Projectiles/Ranged/ChargedBlast3.cs @@ -106,9 +106,9 @@ namespace CalamityMod.Projectiles.Ranged projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 160, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 160, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -116,10 +116,10 @@ namespace CalamityMod.Projectiles.Ranged } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 160, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 160, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 160, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 160, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } projectile.penetrate--; @@ -155,9 +155,9 @@ namespace CalamityMod.Projectiles.Ranged projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 160, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 160, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -165,10 +165,10 @@ namespace CalamityMod.Projectiles.Ranged } for (int num623 = 0; num623 < 20; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 160, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 160, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 160, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 160, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } @@ -186,9 +186,9 @@ namespace CalamityMod.Projectiles.Ranged projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 160, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 160, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -196,10 +196,10 @@ namespace CalamityMod.Projectiles.Ranged } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 160, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 160, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 160, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 160, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Ranged/Chicken.cs b/Projectiles/Ranged/Chicken.cs index 3c1a4809b6..2d7e99e9dd 100644 --- a/Projectiles/Ranged/Chicken.cs +++ b/Projectiles/Ranged/Chicken.cs @@ -47,11 +47,11 @@ namespace CalamityMod.Projectiles.Ranged num247 = projectile.velocity.X * 0.5f; num248 = projectile.velocity.Y * 0.5f; } - int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 6, 0f, 0f, 100, default(Color), 1f); + int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 6, 0f, 0f, 100, default, 1f); Main.dust[num249].scale *= 2f + (float)Main.rand.Next(10) * 0.1f; Main.dust[num249].velocity *= 0.2f; Main.dust[num249].noGravity = true; - num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 244, 0f, 0f, 100, default(Color), 0.5f); + num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 244, 0f, 0f, 100, default, 0.5f); Main.dust[num249].fadeIn = 1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num249].velocity *= 0.05f; } @@ -59,18 +59,18 @@ namespace CalamityMod.Projectiles.Ranged { projectile.velocity *= 1.1f; } - else if (Main.rand.Next(2) == 0) + else if (Main.rand.NextBool(2)) { - int num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 1f); + int num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1f); Main.dust[num252].scale = 0.1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].fadeIn = 1.5f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].noGravity = true; - Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2)).RotatedBy((double)projectile.rotation, default(Vector2)) * 1.1f; + Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2)).RotatedBy((double)projectile.rotation, default) * 1.1f; Main.rand.Next(2); - num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 1f); + num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 1f); Main.dust[num252].scale = 1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].noGravity = true; - Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2 - 6)).RotatedBy((double)projectile.rotation, default(Vector2)) * 1.1f; + Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2 - 6)).RotatedBy((double)projectile.rotation, default) * 1.1f; } } projectile.ai[0] += 1f; @@ -100,9 +100,9 @@ namespace CalamityMod.Projectiles.Ranged projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -110,10 +110,10 @@ namespace CalamityMod.Projectiles.Ranged } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Ranged/ChickenExplosion.cs b/Projectiles/Ranged/ChickenExplosion.cs index c38644a002..71bedf2541 100644 --- a/Projectiles/Ranged/ChickenExplosion.cs +++ b/Projectiles/Ranged/ChickenExplosion.cs @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Ranged num466 = num465 / num466; num463 *= num466; num464 *= num466; - int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2.5f); + int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2.5f); Main.dust[num467].noGravity = true; Main.dust[num467].position.X = projectile.Center.X; Main.dust[num467].position.Y = projectile.Center.Y; diff --git a/Projectiles/Ranged/Contagion.cs b/Projectiles/Ranged/Contagion.cs index 793b840232..74ad39d5d5 100644 --- a/Projectiles/Ranged/Contagion.cs +++ b/Projectiles/Ranged/Contagion.cs @@ -74,11 +74,11 @@ namespace CalamityMod.Projectiles.Ranged if (projectile.ai[1] == 1f && projectile.ai[0] != 1f) { Vector2 vector2 = Vector2.UnitX * 24f; - vector2 = vector2.RotatedBy((double)(projectile.rotation - 1.57079637f), default(Vector2)); + vector2 = vector2.RotatedBy((double)(projectile.rotation - 1.57079637f), default); Vector2 value = projectile.Center + vector2; for (int i = 0; i < 2; i++) { - int num5 = Dust.NewDust(value - Vector2.One * 8f, 16, 16, 44, projectile.velocity.X / 2f, projectile.velocity.Y / 2f, 100, default(Color), 0.25f); + int num5 = Dust.NewDust(value - Vector2.One * 8f, 16, 16, 44, projectile.velocity.X / 2f, projectile.velocity.Y / 2f, 100, default, 0.25f); Main.dust[num5].velocity *= 0.66f; Main.dust[num5].noGravity = true; Main.dust[num5].scale = 1.4f; @@ -112,7 +112,7 @@ namespace CalamityMod.Projectiles.Ranged int num7 = 7; value2 = projectile.Center + new Vector2((float)Main.rand.Next(-num7, num7 + 1), (float)Main.rand.Next(-num7, num7 + 1)); Vector2 spinningpoint = Vector2.Normalize(projectile.velocity) * scaleFactor2; - spinningpoint = spinningpoint.RotatedBy(Main.rand.NextDouble() * 0.19634954631328583 - 0.098174773156642914, default(Vector2)); + spinningpoint = spinningpoint.RotatedBy(Main.rand.NextDouble() * 0.19634954631328583 - 0.098174773156642914, default); if (float.IsNaN(spinningpoint.X) || float.IsNaN(spinningpoint.Y)) { spinningpoint = -Vector2.UnitY; diff --git a/Projectiles/Ranged/ContagionBall.cs b/Projectiles/Ranged/ContagionBall.cs index d9ddc75770..c42c190109 100644 --- a/Projectiles/Ranged/ContagionBall.cs +++ b/Projectiles/Ranged/ContagionBall.cs @@ -31,9 +31,9 @@ namespace CalamityMod.Projectiles.Ranged projectile.height = 60; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 44, 0f, 0f, 100, default(Color), 0.15f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 44, 0f, 0f, 100, default, 0.15f); Main.dust[num622].velocity *= 1.2f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; } diff --git a/Projectiles/Ranged/CorossiveFlames.cs b/Projectiles/Ranged/CorossiveFlames.cs index b3cdd94152..9d4e2cb9cb 100644 --- a/Projectiles/Ranged/CorossiveFlames.cs +++ b/Projectiles/Ranged/CorossiveFlames.cs @@ -47,12 +47,12 @@ namespace CalamityMod.Projectiles.Ranged } projectile.ai[0] += 1f; int num297 = 89; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { for (int num298 = 0; num298 < 1; num298++) { - int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1f); - if (Main.rand.Next(3) == 0) + int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); + if (Main.rand.NextBool(3)) { Main.dust[num299].noGravity = true; Main.dust[num299].scale *= 2.5f; @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Ranged Dust expr_DC0F_cp_0 = Main.dust[num299]; expr_DC0F_cp_0.velocity.Y = expr_DC0F_cp_0.velocity.Y * 2f; } - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) { Main.dust[num299].noGravity = true; Main.dust[num299].scale *= 3f; diff --git a/Projectiles/Ranged/CosmicFire.cs b/Projectiles/Ranged/CosmicFire.cs index 87bc8a8fa8..1ebf01555f 100644 --- a/Projectiles/Ranged/CosmicFire.cs +++ b/Projectiles/Ranged/CosmicFire.cs @@ -52,12 +52,12 @@ namespace CalamityMod.Projectiles.Ranged } projectile.ai[0] += 1f; int num297 = 58; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { for (int num298 = 0; num298 < 1; num298++) { - int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1f); - if (Main.rand.Next(3) == 0) + int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); + if (Main.rand.NextBool(3)) { Main.dust[num299].noGravity = true; Main.dust[num299].scale *= 3f; diff --git a/Projectiles/Ranged/DaemonsFlameArrow.cs b/Projectiles/Ranged/DaemonsFlameArrow.cs index 07fdf27402..1beada01b7 100644 --- a/Projectiles/Ranged/DaemonsFlameArrow.cs +++ b/Projectiles/Ranged/DaemonsFlameArrow.cs @@ -39,15 +39,15 @@ namespace CalamityMod.Projectiles.Ranged for (int num151 = 0; num151 < 3; num151++) { int num154 = 14; - int num155 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num154 * 2, projectile.height - num154 * 2, 60, 0f, 0f, 100, default(Color), 3f); + int num155 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num154 * 2, projectile.height - num154 * 2, 60, 0f, 0f, 100, default, 3f); Main.dust[num155].noGravity = true; Main.dust[num155].velocity *= 0.1f; Main.dust[num155].velocity += projectile.velocity * 0.5f; } - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { int num156 = 16; - int num157 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num156 * 2, projectile.height - num156 * 2, 60, 0f, 0f, 100, default(Color), 2.25f); + int num157 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num156 * 2, projectile.height - num156 * 2, 60, 0f, 0f, 100, default, 2.25f); Main.dust[num157].velocity *= 0.25f; Main.dust[num157].velocity += projectile.velocity * 0.5f; } @@ -64,9 +64,9 @@ namespace CalamityMod.Projectiles.Ranged projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default(Color), 1.2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -74,10 +74,10 @@ namespace CalamityMod.Projectiles.Ranged } for (int num623 = 0; num623 < 20; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default(Color), 1.7f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default, 1.7f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default(Color), 1f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Ranged/DragonBurst.cs b/Projectiles/Ranged/DragonBurst.cs index 8ee67c0eda..13c1eed2de 100644 --- a/Projectiles/Ranged/DragonBurst.cs +++ b/Projectiles/Ranged/DragonBurst.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Ranged float num93 = projectile.velocity.X / 3f * (float)num92; float num94 = projectile.velocity.Y / 3f * (float)num92; int num95 = 4; - int num96 = Dust.NewDust(new Vector2(projectile.position.X + (float)num95, projectile.position.Y + (float)num95), projectile.width - num95 * 2, projectile.height - num95 * 2, 127, 0f, 0f, 100, default(Color), 2f); + int num96 = Dust.NewDust(new Vector2(projectile.position.X + (float)num95, projectile.position.Y + (float)num95), projectile.width - num95 * 2, projectile.height - num95 * 2, 127, 0f, 0f, 100, default, 2f); Main.dust[num96].noGravity = true; Main.dust[num96].velocity *= 0.1f; Main.dust[num96].velocity += projectile.velocity * 0.1f; @@ -43,10 +43,10 @@ namespace CalamityMod.Projectiles.Ranged Dust expr_4815_cp_0 = Main.dust[num96]; expr_4815_cp_0.position.Y = expr_4815_cp_0.position.Y - num94; } - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { int num97 = 4; - int num98 = Dust.NewDust(new Vector2(projectile.position.X + (float)num97, projectile.position.Y + (float)num97), projectile.width - num97 * 2, projectile.height - num97 * 2, 127, 0f, 0f, 100, default(Color), 0.6f); + int num98 = Dust.NewDust(new Vector2(projectile.position.X + (float)num97, projectile.position.Y + (float)num97), projectile.width - num97 * 2, projectile.height - num97 * 2, 127, 0f, 0f, 100, default, 0.6f); Main.dust[num98].velocity *= 0.25f; Main.dust[num98].velocity += projectile.velocity * 0.5f; } diff --git a/Projectiles/Ranged/Drataliornus.cs b/Projectiles/Ranged/Drataliornus.cs index 9b30dd0bad..80277445b0 100644 --- a/Projectiles/Ranged/Drataliornus.cs +++ b/Projectiles/Ranged/Drataliornus.cs @@ -55,9 +55,9 @@ namespace CalamityMod.Projectiles.Ranged for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * 9f; - vector6 = vector6.RotatedBy(((num227 - (num226 / 2 - 1)) * 6.28318548f / num226), default(Vector2)) + player.Center; + vector6 = vector6.RotatedBy(((num227 - (num226 / 2 - 1)) * 6.28318548f / num226), default) + player.Center; Vector2 vector7 = vector6 - player.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 127, 0f, 0f, 0, default(Color), 4f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 127, 0f, 0f, 0, default, 4f); Main.dust[num228].noGravity = true; Main.dust[num228].velocity = vector7; } @@ -115,7 +115,7 @@ namespace CalamityMod.Projectiles.Ranged float ai0 = 0f; if (projectile.ai[0] < 0f) //if fully spun up { - if (Main.rand.Next(3) == 0) //chance to shoot homing + if (Main.rand.NextBool(3)) //chance to shoot homing { ai0 = 2f; speed /= 2f; diff --git a/Projectiles/Ranged/DrataliornusFlame.cs b/Projectiles/Ranged/DrataliornusFlame.cs index eceefa3c2a..a23e331f0b 100644 --- a/Projectiles/Ranged/DrataliornusFlame.cs +++ b/Projectiles/Ranged/DrataliornusFlame.cs @@ -148,7 +148,7 @@ namespace CalamityMod.Projectiles.Ranged } } - int d = Dust.NewDust(projectile.position, projectile.width, projectile.height, 127, projectile.velocity.X, projectile.velocity.Y, 0, default(Color), 1.5f + Main.rand.NextFloat()); + int d = Dust.NewDust(projectile.position, projectile.width, projectile.height, 127, projectile.velocity.X, projectile.velocity.Y, 0, default, 1.5f + Main.rand.NextFloat()); Main.dust[d].noGravity = true; Lighting.AddLight(projectile.Center, 255f / 255f, 154f / 255f, 58f / 255f); @@ -196,23 +196,23 @@ namespace CalamityMod.Projectiles.Ranged for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * modifier; - vector6 = vector6.RotatedBy(((num227 - (num226 / 2 - 1)) * 6.28318548f / num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy(((num227 - (num226 / 2 - 1)) * 6.28318548f / num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 174, 0f, 0f, 45, default(Color), 2f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 174, 0f, 0f, 45, default, 2f); Main.dust[num228].noGravity = true; Main.dust[num228].velocity = vector7; } for (int num193 = 0; num193 < 4; num193++) { - Dust.NewDust(projectile.position, projectile.width, projectile.height, 174, 0f, 0f, 50, default(Color), 1.5f); + Dust.NewDust(projectile.position, projectile.width, projectile.height, 174, 0f, 0f, 50, default, 1.5f); - int num195 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 174, 0f, 0f, 50, default(Color), 1f); + int num195 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 174, 0f, 0f, 50, default, 1f); Main.dust[num195].noGravity = true; Main.dust[num195].velocity *= 2f; } for (int num194 = 0; num194 < 12; num194++) { - int num195 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 127, 0f, 0f, 0, default(Color), 3f); + int num195 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 127, 0f, 0f, 0, default, 3f); Main.dust[num195].noGravity = true; Main.dust[num195].velocity *= 3f; } diff --git a/Projectiles/Ranged/ElysianArrow.cs b/Projectiles/Ranged/ElysianArrow.cs index e6db039363..e3cd17150a 100644 --- a/Projectiles/Ranged/ElysianArrow.cs +++ b/Projectiles/Ranged/ElysianArrow.cs @@ -57,9 +57,9 @@ namespace CalamityMod.Projectiles.Ranged projectile.Damage(); for (int num621 = 0; num621 < 2; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -67,10 +67,10 @@ namespace CalamityMod.Projectiles.Ranged } for (int num623 = 0; num623 < 6; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } for (int num625 = 0; num625 < 3; num625++) @@ -84,25 +84,25 @@ namespace CalamityMod.Projectiles.Ranged { scaleFactor10 = 1f; } - int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13AB6_cp_0 = Main.gore[num626]; expr_13AB6_cp_0.velocity.X = expr_13AB6_cp_0.velocity.X + 1f; Gore expr_13AD6_cp_0 = Main.gore[num626]; expr_13AD6_cp_0.velocity.Y = expr_13AD6_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13B79_cp_0 = Main.gore[num626]; expr_13B79_cp_0.velocity.X = expr_13B79_cp_0.velocity.X - 1f; Gore expr_13B99_cp_0 = Main.gore[num626]; expr_13B99_cp_0.velocity.Y = expr_13B99_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13C3C_cp_0 = Main.gore[num626]; expr_13C3C_cp_0.velocity.X = expr_13C3C_cp_0.velocity.X + 1f; Gore expr_13C5C_cp_0 = Main.gore[num626]; expr_13C5C_cp_0.velocity.Y = expr_13C5C_cp_0.velocity.Y - 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13CFF_cp_0 = Main.gore[num626]; expr_13CFF_cp_0.velocity.X = expr_13CFF_cp_0.velocity.X - 1f; diff --git a/Projectiles/Ranged/EnhancedNanoRound.cs b/Projectiles/Ranged/EnhancedNanoRound.cs index 1698008f31..51629d125f 100644 --- a/Projectiles/Ranged/EnhancedNanoRound.cs +++ b/Projectiles/Ranged/EnhancedNanoRound.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Ranged { float x2 = projectile.position.X - projectile.velocity.X / 10f * (float)num136; float y2 = projectile.position.Y - projectile.velocity.Y / 10f * (float)num136; - int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 229, 0f, 0f, 0, default(Color), 0.5f); + int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 229, 0f, 0f, 0, default, 0.5f); Main.dust[num137].alpha = projectile.alpha; Main.dust[num137].position.X = x2; Main.dust[num137].position.Y = y2; @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Ranged int num212 = Main.rand.Next(5, 10); for (int num213 = 0; num213 < num212; num213++) { - int num214 = Dust.NewDust(projectile.Center - projectile.velocity / 2f, 0, 0, 229, 0f, 0f, 100, default(Color), 2f); + int num214 = Dust.NewDust(projectile.Center - projectile.velocity / 2f, 0, 0, 229, 0f, 0f, 100, default, 2f); Main.dust[num214].velocity *= 2f; Main.dust[num214].noGravity = true; } diff --git a/Projectiles/Ranged/EssenceFire.cs b/Projectiles/Ranged/EssenceFire.cs index 1f367e0196..6157ac93ba 100644 --- a/Projectiles/Ranged/EssenceFire.cs +++ b/Projectiles/Ranged/EssenceFire.cs @@ -51,12 +51,12 @@ namespace CalamityMod.Projectiles.Ranged } projectile.ai[0] += 1f; int num297 = 173; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { for (int num298 = 0; num298 < 1; num298++) { - int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1f); - if (Main.rand.Next(3) == 0) + int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); + if (Main.rand.NextBool(3)) { Main.dust[num299].noGravity = true; Main.dust[num299].scale *= 3f; diff --git a/Projectiles/Ranged/ExoFire.cs b/Projectiles/Ranged/ExoFire.cs index c398204589..2ad96de396 100644 --- a/Projectiles/Ranged/ExoFire.cs +++ b/Projectiles/Ranged/ExoFire.cs @@ -35,12 +35,12 @@ namespace CalamityMod.Projectiles.Ranged float speedY = 1f; if (!speedXChoice) { - speedX = (Main.rand.Next(2) == 0 ? 1.03f : 0.97f); + speedX = (Main.rand.NextBool(2) ? 1.03f : 0.97f); speedXChoice = true; } if (!speedYChoice) { - speedY = (Main.rand.Next(2) == 0 ? 1.03f : 0.97f); + speedY = (Main.rand.NextBool(2) ? 1.03f : 0.97f); speedYChoice = true; } projectile.velocity.X *= speedX; @@ -61,17 +61,17 @@ namespace CalamityMod.Projectiles.Ranged num296 = 0.75f; } projectile.ai[0] += 1f; - int num297 = (Main.rand.Next(2) == 0 ? 107 : 234); - if (Main.rand.Next(4) == 0) + int num297 = (Main.rand.NextBool(2) ? 107 : 234); + if (Main.rand.NextBool(4)) { num297 = 269; } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { for (int num298 = 0; num298 < 2; num298++) { - int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 0.6f); - if (Main.rand.Next(3) == 0) + int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 0.6f); + if (Main.rand.NextBool(3)) { Main.dust[num299].scale *= 1.5f; Dust expr_DBEF_cp_0 = Main.dust[num299]; diff --git a/Projectiles/Ranged/ExoMark.cs b/Projectiles/Ranged/ExoMark.cs index 1871d45f6c..1b8385a7e3 100644 --- a/Projectiles/Ranged/ExoMark.cs +++ b/Projectiles/Ranged/ExoMark.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Ranged value81.X *= -1f; Vector2 value82 = new Vector2(2f, 10f); Vector2 position4 = projectile.Center + new Vector2(60f, 200f) * value81 * 0.5f + value82; - Dust dust34 = Main.dust[Dust.NewDust(position4, 0, 0, 107, 0f, 0f, 0, default(Color), 0.5f)]; + Dust dust34 = Main.dust[Dust.NewDust(position4, 0, 0, 107, 0f, 0f, 0, default, 0.5f)]; dust34.position = position4; dust34.customData = projectile.Center + value82; dust34.fadeIn = 1f; @@ -94,9 +94,9 @@ namespace CalamityMod.Projectiles.Ranged } for (int num1135 = 0; num1135 < 2; num1135++) { - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { - Vector2 value83 = Vector2.UnitY.RotatedBy((double)((float)num1135 * 3.14159274f), default(Vector2)).RotatedBy((double)projectile.rotation, default(Vector2)); + Vector2 value83 = Vector2.UnitY.RotatedBy((double)((float)num1135 * 3.14159274f), default).RotatedBy((double)projectile.rotation, default); Dust dust35 = Main.dust[Dust.NewDust(projectile.Center, 0, 0, 107, 0f, 0f, 225, newColor3, 1f)]; dust35.noGravity = true; dust35.noLight = true; @@ -107,9 +107,9 @@ namespace CalamityMod.Projectiles.Ranged } for (int num1136 = 0; num1136 < 2; num1136++) { - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { - Vector2 value84 = Vector2.UnitY.RotatedBy((double)((float)num1136 * 3.14159274f), default(Vector2)); + Vector2 value84 = Vector2.UnitY.RotatedBy((double)((float)num1136 * 3.14159274f), default); Dust dust36 = Main.dust[Dust.NewDust(projectile.Center, 0, 0, 107, 0f, 0f, 225, newColor3, 1.5f)]; dust36.noGravity = true; dust36.noLight = true; diff --git a/Projectiles/Ranged/ExoTornado.cs b/Projectiles/Ranged/ExoTornado.cs index 66abe745c6..2a5223cc92 100644 --- a/Projectiles/Ranged/ExoTornado.cs +++ b/Projectiles/Ranged/ExoTornado.cs @@ -119,7 +119,7 @@ namespace CalamityMod.Projectiles.Ranged Microsoft.Xna.Framework.Rectangle rectangle9 = texture2D23.Frame(1, 1, 0, 0); Vector2 origin3 = rectangle9.Size() / 2f; float num233 = -0.06283186f * num229; - Vector2 spinningpoint2 = Vector2.UnitY.RotatedBy((double)(num229 * 0.1f), default(Vector2)); + Vector2 spinningpoint2 = Vector2.UnitY.RotatedBy((double)(num229 * 0.1f), default); float num234 = 0f; float num235 = 5.1f; Microsoft.Xna.Framework.Color value34 = new Microsoft.Xna.Framework.Color(0, 250, 0); @@ -129,7 +129,7 @@ namespace CalamityMod.Projectiles.Ranged float num237 = num234 / vector33.Y; float num238 = num234 * 6.28318548f / -20f; float num239 = num237 - 0.15f; - Vector2 vector34 = spinningpoint2.RotatedBy((double)num238, default(Vector2)); + Vector2 vector34 = spinningpoint2.RotatedBy((double)num238, default); Vector2 value35 = new Vector2(0f, num237 + 1f); value35.X = value35.Y * num232; Microsoft.Xna.Framework.Color color39 = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.Transparent, value34, num237 * 2f); diff --git a/Projectiles/Ranged/ExplodingStake.cs b/Projectiles/Ranged/ExplodingStake.cs index 1cda58472b..d0bacb7ed2 100644 --- a/Projectiles/Ranged/ExplodingStake.cs +++ b/Projectiles/Ranged/ExplodingStake.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 6, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height, ItemID.Stake); } diff --git a/Projectiles/Ranged/ExplosiveShellBullet.cs b/Projectiles/Ranged/ExplosiveShellBullet.cs index ec53354e69..b0260c89b4 100644 --- a/Projectiles/Ranged/ExplosiveShellBullet.cs +++ b/Projectiles/Ranged/ExplosiveShellBullet.cs @@ -50,14 +50,14 @@ namespace CalamityMod.Projectiles.Ranged projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num193 = 0; num193 < 2; num193++) { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 1.5f); + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 1.5f); } for (int num194 = 0; num194 < 20; num194++) { - int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 0, default(Color), 2.5f); + int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 0, default, 2.5f); Main.dust[num195].noGravity = true; Main.dust[num195].velocity *= 3f; - num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 1.5f); + num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 1.5f); Main.dust[num195].velocity *= 2f; Main.dust[num195].noGravity = true; } diff --git a/Projectiles/Ranged/FeatherLarge.cs b/Projectiles/Ranged/FeatherLarge.cs index 29a6e3c654..cf46450219 100644 --- a/Projectiles/Ranged/FeatherLarge.cs +++ b/Projectiles/Ranged/FeatherLarge.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Ranged int num3; for (int num611 = 0; num611 < 10; num611 = num3 + 1) { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 42, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 1f); + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 42, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default, 1f); num3 = num611; } } diff --git a/Projectiles/Ranged/FishronRPG.cs b/Projectiles/Ranged/FishronRPG.cs index 6fa465d928..785d15b09e 100644 --- a/Projectiles/Ranged/FishronRPG.cs +++ b/Projectiles/Ranged/FishronRPG.cs @@ -28,9 +28,9 @@ namespace CalamityMod.Projectiles.Ranged { for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -66,11 +66,11 @@ namespace CalamityMod.Projectiles.Ranged num247 = projectile.velocity.X * 0.5f; num248 = projectile.velocity.Y * 0.5f; } - int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 33, 0f, 0f, 100, default(Color), 1f); + int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 33, 0f, 0f, 100, default, 1f); Main.dust[num249].scale *= 2f + (float)Main.rand.Next(10) * 0.1f; Main.dust[num249].velocity *= 0.2f; Main.dust[num249].noGravity = true; - num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 33, 0f, 0f, 100, default(Color), 0.5f); + num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 33, 0f, 0f, 100, default, 0.5f); Main.dust[num249].fadeIn = 1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num249].velocity *= 0.05f; } @@ -130,9 +130,9 @@ namespace CalamityMod.Projectiles.Ranged projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -140,10 +140,10 @@ namespace CalamityMod.Projectiles.Ranged } for (int num623 = 0; num623 < 20; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Ranged/FlamingStake.cs b/Projectiles/Ranged/FlamingStake.cs index 582a2a0c96..dad9fb5104 100644 --- a/Projectiles/Ranged/FlamingStake.cs +++ b/Projectiles/Ranged/FlamingStake.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 6, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height, ItemID.Stake); } diff --git a/Projectiles/Ranged/FlareBat.cs b/Projectiles/Ranged/FlareBat.cs index e49a1a6e08..8060c60f5f 100644 --- a/Projectiles/Ranged/FlareBat.cs +++ b/Projectiles/Ranged/FlareBat.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.velocity *= 1.02f; } } - int num192 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, 0f, 0f, 0, default(Color), 1f); + int num192 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, 0f, 0f, 0, default, 1f); Main.dust[num192].noGravity = true; Main.dust[num192].velocity *= 0.2f; Main.dust[num192].position = (Main.dust[num192].position + projectile.Center) / 2f; diff --git a/Projectiles/Ranged/Flash.cs b/Projectiles/Ranged/Flash.cs index 9b68f26fc4..3ff8711053 100644 --- a/Projectiles/Ranged/Flash.cs +++ b/Projectiles/Ranged/Flash.cs @@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.Ranged num466 = num465 / num466; num463 *= num466; num464 *= num466; - int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 264, 0f, 0f, 100, default(Color), 2f); + int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 264, 0f, 0f, 100, default, 2f); Main.dust[num467].noGravity = true; Main.dust[num467].position.X = projectile.Center.X; Main.dust[num467].position.Y = projectile.Center.Y; diff --git a/Projectiles/Ranged/FlashBullet.cs b/Projectiles/Ranged/FlashBullet.cs index 9acaf4720c..7bae0f32e3 100644 --- a/Projectiles/Ranged/FlashBullet.cs +++ b/Projectiles/Ranged/FlashBullet.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Ranged { float x2 = projectile.position.X - projectile.velocity.X / 10f * (float)num136; float y2 = projectile.position.Y - projectile.velocity.Y / 10f * (float)num136; - int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 264, 0f, 0f, 0, default(Color), 0.5f); + int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 264, 0f, 0f, 0, default, 0.5f); Main.dust[num137].alpha = projectile.alpha; Main.dust[num137].position.X = x2; Main.dust[num137].position.Y = y2; diff --git a/Projectiles/Ranged/FrostsparkBullet.cs b/Projectiles/Ranged/FrostsparkBullet.cs index 6ae0412b3b..4f41aef0c0 100644 --- a/Projectiles/Ranged/FrostsparkBullet.cs +++ b/Projectiles/Ranged/FrostsparkBullet.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Ranged { dustType = 6; } - int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, dustType, 0f, 0f, 0, default(Color), 0.5f); + int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, dustType, 0f, 0f, 0, default, 0.5f); Main.dust[num137].alpha = projectile.alpha; Main.dust[num137].position.X = x2; Main.dust[num137].position.Y = y2; @@ -92,7 +92,7 @@ namespace CalamityMod.Projectiles.Ranged { dustType = 6; } - int num214 = Dust.NewDust(projectile.Center - projectile.velocity / 2f, 0, 0, dustType, 0f, 0f, 100, default(Color), 2f); + int num214 = Dust.NewDust(projectile.Center - projectile.velocity / 2f, 0, 0, dustType, 0f, 0f, 100, default, 2f); Main.dust[num214].velocity *= 2f; Main.dust[num214].noGravity = true; } diff --git a/Projectiles/Ranged/FungiOrb.cs b/Projectiles/Ranged/FungiOrb.cs index 194aa2c07b..58b1b2760f 100644 --- a/Projectiles/Ranged/FungiOrb.cs +++ b/Projectiles/Ranged/FungiOrb.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Ranged { for (int num468 = 0; num468 < 3; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 100, default(Color), 1f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 100, default, 1f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Ranged/FungiOrb2.cs b/Projectiles/Ranged/FungiOrb2.cs index 409aa97793..fb3b020047 100644 --- a/Projectiles/Ranged/FungiOrb2.cs +++ b/Projectiles/Ranged/FungiOrb2.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Ranged { for (int num468 = 0; num468 < 3; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 100, default(Color), 1f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 100, default, 1f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Ranged/GoliathRocket.cs b/Projectiles/Ranged/GoliathRocket.cs index 37c0b1e9e2..f20c84d0b1 100644 --- a/Projectiles/Ranged/GoliathRocket.cs +++ b/Projectiles/Ranged/GoliathRocket.cs @@ -51,11 +51,11 @@ namespace CalamityMod.Projectiles.Ranged num247 = projectile.velocity.X * 0.5f; num248 = projectile.velocity.Y * 0.5f; } - int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 6, 0f, 0f, 100, default(Color), 1f); + int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 6, 0f, 0f, 100, default, 1f); Main.dust[num249].scale *= 2f + (float)Main.rand.Next(10) * 0.1f; Main.dust[num249].velocity *= 0.2f; Main.dust[num249].noGravity = true; - num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 31, 0f, 0f, 100, default(Color), 0.5f); + num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 31, 0f, 0f, 100, default, 0.5f); Main.dust[num249].fadeIn = 1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num249].velocity *= 0.05f; } @@ -64,18 +64,18 @@ namespace CalamityMod.Projectiles.Ranged { projectile.velocity *= 1.1f; } - else if (Main.rand.Next(2) == 0) + else if (Main.rand.NextBool(2)) { - int num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 1f); + int num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 1f); Main.dust[num252].scale = 0.1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].fadeIn = 1.5f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].noGravity = true; - Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2)).RotatedBy((double)projectile.rotation, default(Vector2)) * 1.1f; + Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2)).RotatedBy((double)projectile.rotation, default) * 1.1f; Main.rand.Next(2); - num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 1f); + num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 1f); Main.dust[num252].scale = 1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].noGravity = true; - Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2 - 6)).RotatedBy((double)projectile.rotation, default(Vector2)) * 1.1f; + Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2 - 6)).RotatedBy((double)projectile.rotation, default) * 1.1f; } } projectile.ai[0] += 1f; @@ -111,7 +111,7 @@ namespace CalamityMod.Projectiles.Ranged int num516 = 2; for (int num517 = 0; num517 < num516; num517++) { - if (num517 % 2 != 1 || Main.rand.Next(3) == 0) + if (num517 % 2 != 1 || Main.rand.NextBool(3)) { Vector2 value20 = projectile.position; Vector2 value21 = projectile.oldVelocity; @@ -137,9 +137,9 @@ namespace CalamityMod.Projectiles.Ranged projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -147,10 +147,10 @@ namespace CalamityMod.Projectiles.Ranged } for (int num623 = 0; num623 < 30; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } for (int num625 = 0; num625 < 3; num625++) @@ -164,25 +164,25 @@ namespace CalamityMod.Projectiles.Ranged { scaleFactor10 = 1f; } - int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13AB6_cp_0 = Main.gore[num626]; expr_13AB6_cp_0.velocity.X = expr_13AB6_cp_0.velocity.X + 1f; Gore expr_13AD6_cp_0 = Main.gore[num626]; expr_13AD6_cp_0.velocity.Y = expr_13AD6_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13B79_cp_0 = Main.gore[num626]; expr_13B79_cp_0.velocity.X = expr_13B79_cp_0.velocity.X - 1f; Gore expr_13B99_cp_0 = Main.gore[num626]; expr_13B99_cp_0.velocity.Y = expr_13B99_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13C3C_cp_0 = Main.gore[num626]; expr_13C3C_cp_0.velocity.X = expr_13C3C_cp_0.velocity.X + 1f; Gore expr_13C5C_cp_0 = Main.gore[num626]; expr_13C5C_cp_0.velocity.Y = expr_13C5C_cp_0.velocity.Y - 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13CFF_cp_0 = Main.gore[num626]; expr_13CFF_cp_0.velocity.X = expr_13CFF_cp_0.velocity.X - 1f; diff --git a/Projectiles/Ranged/HiveBomb.cs b/Projectiles/Ranged/HiveBomb.cs index 4901926e23..a6b10c6107 100644 --- a/Projectiles/Ranged/HiveBomb.cs +++ b/Projectiles/Ranged/HiveBomb.cs @@ -51,11 +51,11 @@ namespace CalamityMod.Projectiles.Ranged num247 = projectile.velocity.X * 0.5f; num248 = projectile.velocity.Y * 0.5f; } - int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 6, 0f, 0f, 100, default(Color), 1f); + int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 6, 0f, 0f, 100, default, 1f); Main.dust[num249].scale *= 2f + (float)Main.rand.Next(10) * 0.1f; Main.dust[num249].velocity *= 0.2f; Main.dust[num249].noGravity = true; - num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 31, 0f, 0f, 100, default(Color), 0.5f); + num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 31, 0f, 0f, 100, default, 0.5f); Main.dust[num249].fadeIn = 1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num249].velocity *= 0.05f; } @@ -64,18 +64,18 @@ namespace CalamityMod.Projectiles.Ranged { projectile.velocity *= 1.1f; } - else if (Main.rand.Next(2) == 0) + else if (Main.rand.NextBool(2)) { - int num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 1f); + int num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 1f); Main.dust[num252].scale = 0.1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].fadeIn = 1.5f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].noGravity = true; - Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2)).RotatedBy((double)projectile.rotation, default(Vector2)) * 1.1f; + Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2)).RotatedBy((double)projectile.rotation, default) * 1.1f; Main.rand.Next(2); - num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 1f); + num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 1f); Main.dust[num252].scale = 1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].noGravity = true; - Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2 - 6)).RotatedBy((double)projectile.rotation, default(Vector2)) * 1.1f; + Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2 - 6)).RotatedBy((double)projectile.rotation, default) * 1.1f; } } projectile.ai[0] += 1f; @@ -111,7 +111,7 @@ namespace CalamityMod.Projectiles.Ranged int num516 = 6; for (int num517 = 0; num517 < num516; num517++) { - if (num517 % 2 != 1 || Main.rand.Next(3) == 0) + if (num517 % 2 != 1 || Main.rand.NextBool(3)) { Vector2 value20 = projectile.position; Vector2 value21 = projectile.oldVelocity; @@ -137,9 +137,9 @@ namespace CalamityMod.Projectiles.Ranged projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -147,10 +147,10 @@ namespace CalamityMod.Projectiles.Ranged } for (int num623 = 0; num623 < 30; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } for (int num625 = 0; num625 < 3; num625++) @@ -164,25 +164,25 @@ namespace CalamityMod.Projectiles.Ranged { scaleFactor10 = 1f; } - int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13AB6_cp_0 = Main.gore[num626]; expr_13AB6_cp_0.velocity.X = expr_13AB6_cp_0.velocity.X + 1f; Gore expr_13AD6_cp_0 = Main.gore[num626]; expr_13AD6_cp_0.velocity.Y = expr_13AD6_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13B79_cp_0 = Main.gore[num626]; expr_13B79_cp_0.velocity.X = expr_13B79_cp_0.velocity.X - 1f; Gore expr_13B99_cp_0 = Main.gore[num626]; expr_13B99_cp_0.velocity.Y = expr_13B99_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13C3C_cp_0 = Main.gore[num626]; expr_13C3C_cp_0.velocity.X = expr_13C3C_cp_0.velocity.X + 1f; Gore expr_13C5C_cp_0 = Main.gore[num626]; expr_13C5C_cp_0.velocity.Y = expr_13C5C_cp_0.velocity.Y - 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13CFF_cp_0 = Main.gore[num626]; expr_13CFF_cp_0.velocity.X = expr_13CFF_cp_0.velocity.X - 1f; diff --git a/Projectiles/Ranged/HiveMissile.cs b/Projectiles/Ranged/HiveMissile.cs index c8d7f2347a..fa6acd53b3 100644 --- a/Projectiles/Ranged/HiveMissile.cs +++ b/Projectiles/Ranged/HiveMissile.cs @@ -52,11 +52,11 @@ namespace CalamityMod.Projectiles.Ranged num247 = projectile.velocity.X * 0.5f; num248 = projectile.velocity.Y * 0.5f; } - int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 6, 0f, 0f, 100, default(Color), 1f); + int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 6, 0f, 0f, 100, default, 1f); Main.dust[num249].scale *= 2f + (float)Main.rand.Next(10) * 0.1f; Main.dust[num249].velocity *= 0.2f; Main.dust[num249].noGravity = true; - num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 31, 0f, 0f, 100, default(Color), 0.5f); + num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 31, 0f, 0f, 100, default, 0.5f); Main.dust[num249].fadeIn = 1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num249].velocity *= 0.05f; } @@ -65,18 +65,18 @@ namespace CalamityMod.Projectiles.Ranged { projectile.velocity *= 1.5f; } - else if (Main.rand.Next(2) == 0) + else if (Main.rand.NextBool(2)) { - int num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 1f); + int num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 1f); Main.dust[num252].scale = 0.1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].fadeIn = 1.5f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].noGravity = true; - Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2)).RotatedBy((double)projectile.rotation, default(Vector2)) * 1.1f; + Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2)).RotatedBy((double)projectile.rotation, default) * 1.1f; Main.rand.Next(2); - num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 1f); + num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 1f); Main.dust[num252].scale = 1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].noGravity = true; - Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2 - 6)).RotatedBy((double)projectile.rotation, default(Vector2)) * 1.1f; + Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2 - 6)).RotatedBy((double)projectile.rotation, default) * 1.1f; } } projectile.ai[0] += 1f; @@ -112,7 +112,7 @@ namespace CalamityMod.Projectiles.Ranged int num516 = 3; for (int num517 = 0; num517 < num516; num517++) { - if (num517 % 2 != 1 || Main.rand.Next(3) == 0) + if (num517 % 2 != 1 || Main.rand.NextBool(3)) { Vector2 value20 = projectile.position; Vector2 value21 = projectile.oldVelocity; @@ -138,9 +138,9 @@ namespace CalamityMod.Projectiles.Ranged projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 90, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 90, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -148,10 +148,10 @@ namespace CalamityMod.Projectiles.Ranged } for (int num623 = 0; num623 < 30; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 90, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 90, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 90, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 90, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } for (int num625 = 0; num625 < 3; num625++) @@ -165,25 +165,25 @@ namespace CalamityMod.Projectiles.Ranged { scaleFactor10 = 1f; } - int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13AB6_cp_0 = Main.gore[num626]; expr_13AB6_cp_0.velocity.X = expr_13AB6_cp_0.velocity.X + 1f; Gore expr_13AD6_cp_0 = Main.gore[num626]; expr_13AD6_cp_0.velocity.Y = expr_13AD6_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13B79_cp_0 = Main.gore[num626]; expr_13B79_cp_0.velocity.X = expr_13B79_cp_0.velocity.X - 1f; Gore expr_13B99_cp_0 = Main.gore[num626]; expr_13B99_cp_0.velocity.Y = expr_13B99_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13C3C_cp_0 = Main.gore[num626]; expr_13C3C_cp_0.velocity.X = expr_13C3C_cp_0.velocity.X + 1f; Gore expr_13C5C_cp_0 = Main.gore[num626]; expr_13C5C_cp_0.velocity.Y = expr_13C5C_cp_0.velocity.Y - 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13CFF_cp_0 = Main.gore[num626]; expr_13CFF_cp_0.velocity.X = expr_13CFF_cp_0.velocity.X - 1f; diff --git a/Projectiles/Ranged/HolyFireBullet.cs b/Projectiles/Ranged/HolyFireBullet.cs index c0e37e8bd6..b13449867b 100644 --- a/Projectiles/Ranged/HolyFireBullet.cs +++ b/Projectiles/Ranged/HolyFireBullet.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Ranged float num93 = projectile.velocity.X / 3f * (float)num92; float num94 = projectile.velocity.Y / 3f * (float)num92; int num95 = 4; - int num96 = Dust.NewDust(new Vector2(projectile.position.X + (float)num95, projectile.position.Y + (float)num95), projectile.width - num95 * 2, projectile.height - num95 * 2, 244, 0f, 0f, 100, default(Color), 2f); + int num96 = Dust.NewDust(new Vector2(projectile.position.X + (float)num95, projectile.position.Y + (float)num95), projectile.width - num95 * 2, projectile.height - num95 * 2, 244, 0f, 0f, 100, default, 2f); Main.dust[num96].noGravity = true; Main.dust[num96].velocity *= 0.1f; Main.dust[num96].velocity += projectile.velocity * 0.1f; @@ -46,10 +46,10 @@ namespace CalamityMod.Projectiles.Ranged Dust expr_4815_cp_0 = Main.dust[num96]; expr_4815_cp_0.position.Y = expr_4815_cp_0.position.Y - num94; } - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { int num97 = 4; - int num98 = Dust.NewDust(new Vector2(projectile.position.X + (float)num97, projectile.position.Y + (float)num97), projectile.width - num97 * 2, projectile.height - num97 * 2, 244, 0f, 0f, 100, default(Color), 0.6f); + int num98 = Dust.NewDust(new Vector2(projectile.position.X + (float)num97, projectile.position.Y + (float)num97), projectile.width - num97 * 2, projectile.height - num97 * 2, 244, 0f, 0f, 100, default, 0.6f); Main.dust[num98].velocity *= 0.25f; Main.dust[num98].velocity += projectile.velocity * 0.5f; } diff --git a/Projectiles/Ranged/HyperiusBullet.cs b/Projectiles/Ranged/HyperiusBullet.cs index ca59ac1f63..7ffc19aa5f 100644 --- a/Projectiles/Ranged/HyperiusBullet.cs +++ b/Projectiles/Ranged/HyperiusBullet.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Ranged { float x2 = projectile.position.X - projectile.velocity.X / 10f * (float)num136; float y2 = projectile.position.Y - projectile.velocity.Y / 10f * (float)num136; - int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 235, 0f, 0f, 0, default(Color), 0.75f); + int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 235, 0f, 0f, 0, default, 0.75f); Main.dust[num137].alpha = projectile.alpha; Main.dust[num137].position.X = x2; Main.dust[num137].position.Y = y2; @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - float xPos = (Main.rand.Next(2) == 0 ? projectile.position.X + 800 : projectile.position.X - 800); + float xPos = (Main.rand.NextBool(2) ? projectile.position.X + 800 : projectile.position.X - 800); Vector2 vector2 = new Vector2(xPos, projectile.position.Y + Main.rand.Next(-800, 801)); float num80 = xPos; float speedX = (float)target.position.X - vector2.X; diff --git a/Projectiles/Ranged/LunarBolt.cs b/Projectiles/Ranged/LunarBolt.cs index 5256bd346e..de42e0b8a7 100644 --- a/Projectiles/Ranged/LunarBolt.cs +++ b/Projectiles/Ranged/LunarBolt.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Ranged { float x = projectile.position.X - projectile.velocity.X / 10f * (float)num134; float y = projectile.position.Y - projectile.velocity.Y / 10f * (float)num134; - int num135 = Dust.NewDust(new Vector2(x, y), 1, 1, 15, 0f, 0f, 0, default(Color), 0.4f); + int num135 = Dust.NewDust(new Vector2(x, y), 1, 1, 15, 0f, 0f, 0, default, 0.4f); Main.dust[num135].alpha = projectile.alpha; Main.dust[num135].position.X = x; Main.dust[num135].position.Y = y; diff --git a/Projectiles/Ranged/LunarBolt2.cs b/Projectiles/Ranged/LunarBolt2.cs index f11828dee1..5b646e5df2 100644 --- a/Projectiles/Ranged/LunarBolt2.cs +++ b/Projectiles/Ranged/LunarBolt2.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Ranged { float x = projectile.position.X - projectile.velocity.X / 10f * (float)num134; float y = projectile.position.Y - projectile.velocity.Y / 10f * (float)num134; - int num135 = Dust.NewDust(new Vector2(x, y), 1, 1, 107, 0f, 0f, 0, default(Color), 0.2f); + int num135 = Dust.NewDust(new Vector2(x, y), 1, 1, 107, 0f, 0f, 0, default, 0.2f); Main.dust[num135].alpha = projectile.alpha; Main.dust[num135].position.X = x; Main.dust[num135].position.Y = y; diff --git a/Projectiles/Ranged/MeowFire.cs b/Projectiles/Ranged/MeowFire.cs index 26f2ea2d4f..5d17c7c441 100644 --- a/Projectiles/Ranged/MeowFire.cs +++ b/Projectiles/Ranged/MeowFire.cs @@ -45,8 +45,8 @@ namespace CalamityMod.Projectiles.Ranged int num297 = 56; for (int num298 = 0; num298 < 2; num298++) { - int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1f); - if (Main.rand.Next(3) == 0) + int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); + if (Main.rand.NextBool(3)) { Main.dust[num299].noGravity = true; Main.dust[num299].scale *= 1.75f; @@ -90,9 +90,9 @@ namespace CalamityMod.Projectiles.Ranged projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 100, default(Color), 1f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -100,10 +100,10 @@ namespace CalamityMod.Projectiles.Ranged } for (int num623 = 0; num623 < 20; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 100, default(Color), 1.5f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 100, default, 1.5f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 100, default(Color), 1f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } target.AddBuff(BuffID.Frostburn, 180); diff --git a/Projectiles/Ranged/MeowFire2.cs b/Projectiles/Ranged/MeowFire2.cs index a87a62166b..87462efbf2 100644 --- a/Projectiles/Ranged/MeowFire2.cs +++ b/Projectiles/Ranged/MeowFire2.cs @@ -45,8 +45,8 @@ namespace CalamityMod.Projectiles.Ranged int num297 = 73; for (int num298 = 0; num298 < 2; num298++) { - int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1f); - if (Main.rand.Next(3) == 0) + int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); + if (Main.rand.NextBool(3)) { Main.dust[num299].noGravity = true; Main.dust[num299].scale *= 1.75f; @@ -90,9 +90,9 @@ namespace CalamityMod.Projectiles.Ranged projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 73, 0f, 0f, 100, default(Color), 1f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 73, 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -100,10 +100,10 @@ namespace CalamityMod.Projectiles.Ranged } for (int num623 = 0; num623 < 20; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 73, 0f, 0f, 100, default(Color), 1.5f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 73, 0f, 0f, 100, default, 1.5f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 73, 0f, 0f, 100, default(Color), 1f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 73, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } target.AddBuff(BuffID.OnFire, 180); diff --git a/Projectiles/Ranged/MiniRocket.cs b/Projectiles/Ranged/MiniRocket.cs index 07b61bf7c9..d557c107ca 100644 --- a/Projectiles/Ranged/MiniRocket.cs +++ b/Projectiles/Ranged/MiniRocket.cs @@ -51,11 +51,11 @@ namespace CalamityMod.Projectiles.Ranged num247 = projectile.velocity.X * 0.5f; num248 = projectile.velocity.Y * 0.5f; } - int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 6, 0f, 0f, 100, default(Color), 1f); + int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 6, 0f, 0f, 100, default, 1f); Main.dust[num249].scale *= 2f + (float)Main.rand.Next(10) * 0.1f; Main.dust[num249].velocity *= 0.2f; Main.dust[num249].noGravity = true; - num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 31, 0f, 0f, 100, default(Color), 0.5f); + num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 31, 0f, 0f, 100, default, 0.5f); Main.dust[num249].fadeIn = 1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num249].velocity *= 0.05f; } @@ -112,9 +112,9 @@ namespace CalamityMod.Projectiles.Ranged projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -122,10 +122,10 @@ namespace CalamityMod.Projectiles.Ranged } for (int num623 = 0; num623 < 30; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } for (int num625 = 0; num625 < 3; num625++) @@ -139,25 +139,25 @@ namespace CalamityMod.Projectiles.Ranged { scaleFactor10 = 1f; } - int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13AB6_cp_0 = Main.gore[num626]; expr_13AB6_cp_0.velocity.X = expr_13AB6_cp_0.velocity.X + 1f; Gore expr_13AD6_cp_0 = Main.gore[num626]; expr_13AD6_cp_0.velocity.Y = expr_13AD6_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13B79_cp_0 = Main.gore[num626]; expr_13B79_cp_0.velocity.X = expr_13B79_cp_0.velocity.X - 1f; Gore expr_13B99_cp_0 = Main.gore[num626]; expr_13B99_cp_0.velocity.Y = expr_13B99_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13C3C_cp_0 = Main.gore[num626]; expr_13C3C_cp_0.velocity.X = expr_13C3C_cp_0.velocity.X + 1f; Gore expr_13C5C_cp_0 = Main.gore[num626]; expr_13C5C_cp_0.velocity.Y = expr_13C5C_cp_0.velocity.Y - 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13CFF_cp_0 = Main.gore[num626]; expr_13CFF_cp_0.velocity.X = expr_13CFF_cp_0.velocity.X - 1f; diff --git a/Projectiles/Ranged/MistArrow.cs b/Projectiles/Ranged/MistArrow.cs index 899f993913..97ff510f2e 100644 --- a/Projectiles/Ranged/MistArrow.cs +++ b/Projectiles/Ranged/MistArrow.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Ranged { for (int num468 = 0; num468 < 5; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 67, 0f, 0f, 100, default(Color), 1.5f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 67, 0f, 0f, 100, default, 1.5f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Ranged/MortarRound.cs b/Projectiles/Ranged/MortarRound.cs index dbb5fc7b5d..b2eccd4718 100644 --- a/Projectiles/Ranged/MortarRound.cs +++ b/Projectiles/Ranged/MortarRound.cs @@ -3,6 +3,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.GameContent.Achievements; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged @@ -53,11 +54,11 @@ namespace CalamityMod.Projectiles.Ranged num247 = projectile.velocity.X * 0.5f; num248 = projectile.velocity.Y * 0.5f; } - int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 6, 0f, 0f, 100, default(Color), 1f); + int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 6, 0f, 0f, 100, default, 1f); Main.dust[num249].scale *= 2f + (float)Main.rand.Next(10) * 0.1f; Main.dust[num249].velocity *= 0.2f; Main.dust[num249].noGravity = true; - num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 31, 0f, 0f, 100, default(Color), 0.5f); + num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 31, 0f, 0f, 100, default, 0.5f); Main.dust[num249].fadeIn = 1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num249].velocity *= 0.05f; } @@ -81,9 +82,9 @@ namespace CalamityMod.Projectiles.Ranged Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -91,10 +92,10 @@ namespace CalamityMod.Projectiles.Ranged } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } for (int num625 = 0; num625 < 3; num625++) @@ -108,25 +109,25 @@ namespace CalamityMod.Projectiles.Ranged { scaleFactor10 = 1f; } - int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13AB6_cp_0 = Main.gore[num626]; expr_13AB6_cp_0.velocity.X = expr_13AB6_cp_0.velocity.X + 1f; Gore expr_13AD6_cp_0 = Main.gore[num626]; expr_13AD6_cp_0.velocity.Y = expr_13AD6_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13B79_cp_0 = Main.gore[num626]; expr_13B79_cp_0.velocity.X = expr_13B79_cp_0.velocity.X - 1f; Gore expr_13B99_cp_0 = Main.gore[num626]; expr_13B99_cp_0.velocity.Y = expr_13B99_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13C3C_cp_0 = Main.gore[num626]; expr_13C3C_cp_0.velocity.X = expr_13C3C_cp_0.velocity.X + 1f; Gore expr_13C5C_cp_0 = Main.gore[num626]; expr_13C5C_cp_0.velocity.Y = expr_13C5C_cp_0.velocity.Y - 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13CFF_cp_0 = Main.gore[num626]; expr_13CFF_cp_0.velocity.X = expr_13CFF_cp_0.velocity.X - 1f; @@ -184,7 +185,7 @@ namespace CalamityMod.Projectiles.Ranged if (Main.tile[num824, num825] != null && Main.tile[num824, num825].active() && Main.tile[num824, num825].type != (ushort)mod.TileType("AbyssGravel")) { WorldGen.KillTile(num824, num825, false, false, false); - if (!Main.tile[num824, num825].active() && Main.netMode != 0) + if (!Main.tile[num824, num825].active() && Main.netMode != NetmodeID.SinglePlayer) { NetMessage.SendData(17, -1, -1, null, 0, (float)num824, (float)num825, 0f, 0, 0, 0); } @@ -196,7 +197,7 @@ namespace CalamityMod.Projectiles.Ranged if (Main.tile[num829, num830] != null && Main.tile[num829, num830].wall > 0 && Main.tile[num829, num830].wall != (byte)mod.WallType("AbyssGravelWall") && flag3) { WorldGen.KillWall(num829, num830, false); - if (Main.tile[num829, num830].wall == 0 && Main.netMode != 0) + if (Main.tile[num829, num830].wall == 0 && Main.netMode != NetmodeID.SinglePlayer) { NetMessage.SendData(17, -1, -1, null, 2, (float)num829, (float)num830, 0f, 0, 0, 0); } @@ -207,14 +208,14 @@ namespace CalamityMod.Projectiles.Ranged } } AchievementsHelper.CurrentlyMining = false; - if (Main.netMode != 0) + if (Main.netMode != NetmodeID.SinglePlayer) { NetMessage.SendData(29, -1, -1, null, projectile.identity, (float)projectile.owner, 0f, 0f, 0, 0, 0); } if (!projectile.noDropItem) { int num831 = -1; - if (Main.netMode == 1 && num831 >= 0) + if (Main.netMode == NetmodeID.MultiplayerClient && num831 >= 0) { NetMessage.SendData(21, -1, -1, null, num831, 1f, 0f, 0f, 0, 0, 0); } diff --git a/Projectiles/Ranged/Nanomachine.cs b/Projectiles/Ranged/Nanomachine.cs index 296ff16e3d..b3588eaf09 100644 --- a/Projectiles/Ranged/Nanomachine.cs +++ b/Projectiles/Ranged/Nanomachine.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Ranged { float x2 = projectile.position.X - projectile.velocity.X / 10f * (float)num136; float y2 = projectile.position.Y - projectile.velocity.Y / 10f * (float)num136; - int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 229, 0f, 0f, 0, default(Color), 0.5f); + int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 229, 0f, 0f, 0, default, 0.5f); Main.dust[num137].alpha = projectile.alpha; Main.dust[num137].position.X = x2; Main.dust[num137].position.Y = y2; diff --git a/Projectiles/Ranged/NapalmArrow.cs b/Projectiles/Ranged/NapalmArrow.cs index bbaadba978..4ea1ed2531 100644 --- a/Projectiles/Ranged/NapalmArrow.cs +++ b/Projectiles/Ranged/NapalmArrow.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 6, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } @@ -44,9 +44,9 @@ namespace CalamityMod.Projectiles.Ranged projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -54,10 +54,10 @@ namespace CalamityMod.Projectiles.Ranged } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } for (int num625 = 0; num625 < 3; num625++) @@ -71,25 +71,25 @@ namespace CalamityMod.Projectiles.Ranged { scaleFactor10 = 1f; } - int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13AB6_cp_0 = Main.gore[num626]; expr_13AB6_cp_0.velocity.X = expr_13AB6_cp_0.velocity.X + 1f; Gore expr_13AD6_cp_0 = Main.gore[num626]; expr_13AD6_cp_0.velocity.Y = expr_13AD6_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13B79_cp_0 = Main.gore[num626]; expr_13B79_cp_0.velocity.X = expr_13B79_cp_0.velocity.X - 1f; Gore expr_13B99_cp_0 = Main.gore[num626]; expr_13B99_cp_0.velocity.Y = expr_13B99_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13C3C_cp_0 = Main.gore[num626]; expr_13C3C_cp_0.velocity.X = expr_13C3C_cp_0.velocity.X + 1f; Gore expr_13C5C_cp_0 = Main.gore[num626]; expr_13C5C_cp_0.velocity.Y = expr_13C5C_cp_0.velocity.Y - 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13CFF_cp_0 = Main.gore[num626]; expr_13CFF_cp_0.velocity.X = expr_13CFF_cp_0.velocity.X - 1f; diff --git a/Projectiles/Ranged/NebulaShot.cs b/Projectiles/Ranged/NebulaShot.cs index 9eb1c7a2cc..b9c9f7bd65 100644 --- a/Projectiles/Ranged/NebulaShot.cs +++ b/Projectiles/Ranged/NebulaShot.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Ranged Lighting.AddLight(projectile.Center, 0.4f, 0.2f, 0.4f); for (int num121 = 0; num121 < 5; num121++) { - Dust dust4 = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, (Main.rand.Next(3) == 0 ? 56 : 242), projectile.velocity.X, projectile.velocity.Y, 100, default(Color), 1f)]; + Dust dust4 = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, (Main.rand.NextBool(3) ? 56 : 242), projectile.velocity.X, projectile.velocity.Y, 100, default, 1f)]; dust4.velocity = Vector2.Zero; dust4.position -= projectile.velocity / 5f * (float)num121; dust4.noGravity = true; diff --git a/Projectiles/Ranged/Needler.cs b/Projectiles/Ranged/Needler.cs index 9a8b032898..deedce8fe2 100644 --- a/Projectiles/Ranged/Needler.cs +++ b/Projectiles/Ranged/Needler.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Ranged { for (int num468 = 0; num468 < 2; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 46, 0f, 0f, 100, default(Color), 0.75f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 46, 0f, 0f, 100, default, 0.75f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 46, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/Norfleet.cs b/Projectiles/Ranged/Norfleet.cs index bec8e6ad76..b8dc5d28b0 100644 --- a/Projectiles/Ranged/Norfleet.cs +++ b/Projectiles/Ranged/Norfleet.cs @@ -46,9 +46,9 @@ namespace CalamityMod.Projectiles.Ranged for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * 9f; - vector6 = vector6.RotatedBy(((num227 - (num226 / 2 - 1)) * 6.28318548f / num226), default(Vector2)) + player.Center; + vector6 = vector6.RotatedBy(((num227 - (num226 / 2 - 1)) * 6.28318548f / num226), default) + player.Center; Vector2 vector7 = vector6 - player.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, (Main.rand.Next(2) == 0 ? 221 : 244), 0f, 0f, 0, default(Color), 4f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, (Main.rand.NextBool(2) ? 221 : 244), 0f, 0f, 0, default, 4f); Main.dust[num228].noGravity = true; Main.dust[num228].velocity = vector7; } diff --git a/Projectiles/Ranged/NorfleetComet.cs b/Projectiles/Ranged/NorfleetComet.cs index 5e8cf21ff4..edddea946c 100644 --- a/Projectiles/Ranged/NorfleetComet.cs +++ b/Projectiles/Ranged/NorfleetComet.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Ranged if (projectile.soundDelay == 0) { projectile.soundDelay = 20 + Main.rand.Next(40); - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9); } @@ -53,9 +53,9 @@ namespace CalamityMod.Projectiles.Ranged for (int l = 0; l < 12; l++) { Vector2 vector3 = Vector2.UnitX * (float)(-(float)projectile.width) / 2f; - vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default(Vector2)) * new Vector2(8f, 16f); - vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default(Vector2)); - int num9 = Dust.NewDust(projectile.Center, 0, 0, (Main.rand.Next(2) == 0 ? 221 : 244), 0f, 0f, 160, default(Color), 1f); + vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default) * new Vector2(8f, 16f); + vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default); + int num9 = Dust.NewDust(projectile.Center, 0, 0, (Main.rand.NextBool(2) ? 221 : 244), 0f, 0f, 160, default, 1f); Main.dust[num9].scale = 1.1f; Main.dust[num9].noGravity = true; Main.dust[num9].position = projectile.Center + vector3; @@ -74,19 +74,19 @@ namespace CalamityMod.Projectiles.Ranged projectile.alpha = num58; } projectile.rotation = projectile.velocity.ToRotation() - 1.57079637f; - if (Main.rand.Next(16) == 0) + if (Main.rand.NextBool(16)) { - Vector2 value3 = Vector2.UnitX.RotatedByRandom(1.5707963705062866).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)); - int num59 = Dust.NewDust(projectile.position, projectile.width, projectile.height, (Main.rand.Next(2) == 0 ? 221 : 244), projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default(Color), 1.2f); + Vector2 value3 = Vector2.UnitX.RotatedByRandom(1.5707963705062866).RotatedBy((double)projectile.velocity.ToRotation(), default); + int num59 = Dust.NewDust(projectile.position, projectile.width, projectile.height, (Main.rand.NextBool(2) ? 221 : 244), projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default, 1.2f); Main.dust[num59].velocity = value3 * 0.66f; Main.dust[num59].position = projectile.Center + value3 * 12f; } if (projectile.ai[1] == 1f) { projectile.light = 0.5f; - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { - Dust.NewDust(projectile.position, projectile.width, projectile.height, (Main.rand.Next(2) == 0 ? 221 : 244), projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default(Color), 1.2f); + Dust.NewDust(projectile.position, projectile.width, projectile.height, (Main.rand.NextBool(2) ? 221 : 244), projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default, 1.2f); } } } @@ -109,14 +109,14 @@ namespace CalamityMod.Projectiles.Ranged projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num193 = 0; num193 < 4; num193++) { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, (Main.rand.Next(2) == 0 ? 221 : 244), 0f, 0f, 50, default(Color), 1.5f); + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, (Main.rand.NextBool(2) ? 221 : 244), 0f, 0f, 50, default, 1.5f); } for (int num194 = 0; num194 < 20; num194++) { - int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, (Main.rand.Next(2) == 0 ? 221 : 244), 0f, 0f, 0, default(Color), 2.5f); + int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, (Main.rand.NextBool(2) ? 221 : 244), 0f, 0f, 0, default, 2.5f); Main.dust[num195].noGravity = true; Main.dust[num195].velocity *= 3f; - num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, (Main.rand.Next(2) == 0 ? 221 : 244), 0f, 0f, 50, default(Color), 1.5f); + num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, (Main.rand.NextBool(2) ? 221 : 244), 0f, 0f, 50, default, 1.5f); Main.dust[num195].velocity *= 2f; Main.dust[num195].noGravity = true; } diff --git a/Projectiles/Ranged/NorfleetExplosion.cs b/Projectiles/Ranged/NorfleetExplosion.cs index 92307a2250..25b8c6d7a7 100644 --- a/Projectiles/Ranged/NorfleetExplosion.cs +++ b/Projectiles/Ranged/NorfleetExplosion.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Projectiles.Ranged num466 = num465 / num466; num463 *= num466; num464 *= num466; - int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, (Main.rand.Next(2) == 0 ? 221 : 244), 0f, 0f, 100, default(Color), 2f); + int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, (Main.rand.NextBool(2) ? 221 : 244), 0f, 0f, 100, default, 2f); Main.dust[num467].noGravity = true; Main.dust[num467].position.X = projectile.Center.X; Main.dust[num467].position.Y = projectile.Center.Y; diff --git a/Projectiles/Ranged/Nuke.cs b/Projectiles/Ranged/Nuke.cs index 13a4ab41c6..cdbbd614fd 100644 --- a/Projectiles/Ranged/Nuke.cs +++ b/Projectiles/Ranged/Nuke.cs @@ -61,11 +61,11 @@ namespace CalamityMod.Projectiles.Ranged num247 = projectile.velocity.X * 0.5f; num248 = projectile.velocity.Y * 0.5f; } - int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 244, 0f, 0f, 100, default(Color), 1f); + int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 244, 0f, 0f, 100, default, 1f); Main.dust[num249].scale *= 2f + (float)Main.rand.Next(10) * 0.1f; Main.dust[num249].velocity *= 0.2f; Main.dust[num249].noGravity = true; - num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 244, 0f, 0f, 100, default(Color), 0.5f); + num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 244, 0f, 0f, 100, default, 0.5f); Main.dust[num249].fadeIn = 1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num249].velocity *= 0.05f; } @@ -122,9 +122,9 @@ namespace CalamityMod.Projectiles.Ranged projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -132,10 +132,10 @@ namespace CalamityMod.Projectiles.Ranged } for (int num623 = 0; num623 < 60; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } for (int num625 = 0; num625 < 10; num625++) @@ -149,25 +149,25 @@ namespace CalamityMod.Projectiles.Ranged { scaleFactor10 = 1f; } - int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13AB6_cp_0 = Main.gore[num626]; expr_13AB6_cp_0.velocity.X = expr_13AB6_cp_0.velocity.X + 1f; Gore expr_13AD6_cp_0 = Main.gore[num626]; expr_13AD6_cp_0.velocity.Y = expr_13AD6_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13B79_cp_0 = Main.gore[num626]; expr_13B79_cp_0.velocity.X = expr_13B79_cp_0.velocity.X - 1f; Gore expr_13B99_cp_0 = Main.gore[num626]; expr_13B99_cp_0.velocity.Y = expr_13B99_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13C3C_cp_0 = Main.gore[num626]; expr_13C3C_cp_0.velocity.X = expr_13C3C_cp_0.velocity.X + 1f; Gore expr_13C5C_cp_0 = Main.gore[num626]; expr_13C5C_cp_0.velocity.Y = expr_13C5C_cp_0.velocity.Y - 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13CFF_cp_0 = Main.gore[num626]; expr_13CFF_cp_0.velocity.X = expr_13CFF_cp_0.velocity.X - 1f; diff --git a/Projectiles/Ranged/NullShot.cs b/Projectiles/Ranged/NullShot.cs index 311b737d53..398d8c0bcc 100644 --- a/Projectiles/Ranged/NullShot.cs +++ b/Projectiles/Ranged/NullShot.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Ranged { float x = projectile.position.X - projectile.velocity.X / 10f * (float)num134; float y = projectile.position.Y - projectile.velocity.Y / 10f * (float)num134; - int num135 = Dust.NewDust(new Vector2(x, y), 1, 1, 160, 0f, 0f, 0, default(Color), 2f); + int num135 = Dust.NewDust(new Vector2(x, y), 1, 1, 160, 0f, 0f, 0, default, 2f); Main.dust[num135].alpha = projectile.alpha; Main.dust[num135].position.X = x; Main.dust[num135].position.Y = y; diff --git a/Projectiles/Ranged/NullShot2.cs b/Projectiles/Ranged/NullShot2.cs index b987efd6e3..bb248ac080 100644 --- a/Projectiles/Ranged/NullShot2.cs +++ b/Projectiles/Ranged/NullShot2.cs @@ -89,7 +89,7 @@ namespace CalamityMod.Projectiles.Ranged } else { - target.velocity.X = (Main.rand.Next(2) == 0 ? 30f : -30f); + target.velocity.X = (Main.rand.NextBool(2) ? 30f : -30f); } } } diff --git a/Projectiles/Ranged/OMGWTH.cs b/Projectiles/Ranged/OMGWTH.cs index b0dffcb624..50b0d01404 100644 --- a/Projectiles/Ranged/OMGWTH.cs +++ b/Projectiles/Ranged/OMGWTH.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Ranged { float x2 = projectile.position.X - projectile.velocity.X / 10f * (float)num136; float y2 = projectile.position.Y - projectile.velocity.Y / 10f * (float)num136; - int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 235, 0f, 0f, 0, default(Color), 0.75f); + int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 235, 0f, 0f, 0, default, 0.75f); Main.dust[num137].alpha = projectile.alpha; Main.dust[num137].position.X = x2; Main.dust[num137].position.Y = y2; diff --git a/Projectiles/Ranged/OnyxSharkBomb.cs b/Projectiles/Ranged/OnyxSharkBomb.cs index 47772d3b5f..375146987e 100644 --- a/Projectiles/Ranged/OnyxSharkBomb.cs +++ b/Projectiles/Ranged/OnyxSharkBomb.cs @@ -40,11 +40,11 @@ namespace CalamityMod.Projectiles.Ranged num247 = projectile.velocity.X * 0.5f; num248 = projectile.velocity.Y * 0.5f; } - int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 109, 0f, 0f, 100, default(Color), 0.5f); + int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 109, 0f, 0f, 100, default, 0.5f); Main.dust[num249].scale *= 2f + (float)Main.rand.Next(10) * 0.1f; Main.dust[num249].velocity *= 0.2f; Main.dust[num249].noGravity = true; - num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 159, 0f, 0f, 100, default(Color), 0.25f); + num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 159, 0f, 0f, 100, default, 0.25f); Main.dust[num249].fadeIn = 1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num249].velocity *= 0.05f; } diff --git a/Projectiles/Ranged/OrangeExoArrow.cs b/Projectiles/Ranged/OrangeExoArrow.cs index eb2892ab0b..d224e94890 100644 --- a/Projectiles/Ranged/OrangeExoArrow.cs +++ b/Projectiles/Ranged/OrangeExoArrow.cs @@ -118,23 +118,23 @@ namespace CalamityMod.Projectiles.Ranged for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 55, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default(Color), 2f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 55, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default, 2f); Main.dust[num228].noGravity = true; Main.dust[num228].noLight = true; Main.dust[num228].velocity = vector7; } for (int num193 = 0; num193 < 2; num193++) { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 55, 0f, 0f, 50, default(Color), 1f); + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 55, 0f, 0f, 50, default, 1f); } for (int num194 = 0; num194 < 20; num194++) { - int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 55, 0f, 0f, 0, default(Color), 1.5f); + int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 55, 0f, 0f, 0, default, 1.5f); Main.dust[num195].noGravity = true; Main.dust[num195].velocity *= 3f; - num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 55, 0f, 0f, 50, default(Color), 1f); + num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 55, 0f, 0f, 50, default, 1f); Main.dust[num195].velocity *= 2f; Main.dust[num195].noGravity = true; } diff --git a/Projectiles/Ranged/PlagueArrow.cs b/Projectiles/Ranged/PlagueArrow.cs index 9513c91c11..601d517da0 100644 --- a/Projectiles/Ranged/PlagueArrow.cs +++ b/Projectiles/Ranged/PlagueArrow.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Ranged int num516 = 6; for (int num517 = 0; num517 < num516; num517++) { - if (num517 % 2 != 1 || Main.rand.Next(3) == 0) + if (num517 % 2 != 1 || Main.rand.NextBool(3)) { Vector2 value20 = projectile.position; Vector2 value21 = projectile.oldVelocity; diff --git a/Projectiles/Ranged/PlagueExplosionFriendly.cs b/Projectiles/Ranged/PlagueExplosionFriendly.cs index 99e1a8ddcf..5d8bb2090a 100644 --- a/Projectiles/Ranged/PlagueExplosionFriendly.cs +++ b/Projectiles/Ranged/PlagueExplosionFriendly.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Ranged num466 = num465 / num466; num463 *= num466; num464 *= num466; - int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default(Color), 0.5f); + int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default, 0.5f); Main.dust[num467].noGravity = true; Main.dust[num467].position.X = projectile.Center.X; Main.dust[num467].position.Y = projectile.Center.Y; diff --git a/Projectiles/Ranged/PlasmaBlast.cs b/Projectiles/Ranged/PlasmaBlast.cs index 5a46b5ad28..290357e83f 100644 --- a/Projectiles/Ranged/PlasmaBlast.cs +++ b/Projectiles/Ranged/PlasmaBlast.cs @@ -47,9 +47,9 @@ namespace CalamityMod.Projectiles.Ranged for (int l = 0; l < 12; l++) { Vector2 vector3 = Vector2.UnitX * (float)(-(float)projectile.width) / 2f; - vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default(Vector2)) * new Vector2(8f, 16f); - vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default(Vector2)); - int num9 = Dust.NewDust(projectile.Center, 0, 0, 221, 0f, 0f, 160, default(Color), 1f); + vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default) * new Vector2(8f, 16f); + vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default); + int num9 = Dust.NewDust(projectile.Center, 0, 0, 221, 0f, 0f, 160, default, 1f); Main.dust[num9].scale = 1.1f; Main.dust[num9].noGravity = true; Main.dust[num9].position = projectile.Center + vector3; @@ -68,14 +68,14 @@ namespace CalamityMod.Projectiles.Ranged projectile.alpha = num58; } projectile.rotation = projectile.velocity.ToRotation() - 1.57079637f; - if (Main.rand.Next(16) == 0) + if (Main.rand.NextBool(16)) { - Vector2 value3 = Vector2.UnitX.RotatedByRandom(1.5707963705062866).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)); - int num59 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 221, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default(Color), 1.2f); + Vector2 value3 = Vector2.UnitX.RotatedByRandom(1.5707963705062866).RotatedBy((double)projectile.velocity.ToRotation(), default); + int num59 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 221, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default, 1.2f); Main.dust[num59].velocity = value3 * 0.66f; Main.dust[num59].position = projectile.Center + value3 * 12f; } - if (Main.rand.Next(48) == 0) + if (Main.rand.NextBool(48)) { int num60 = Gore.NewGore(projectile.Center, new Vector2(projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f), 16, 1f); Main.gore[num60].velocity *= 0.66f; @@ -84,11 +84,11 @@ namespace CalamityMod.Projectiles.Ranged if (projectile.ai[1] == 1f) { projectile.light = 0.9f; - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { - Dust.NewDust(projectile.position, projectile.width, projectile.height, 221, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default(Color), 1.2f); + Dust.NewDust(projectile.position, projectile.width, projectile.height, 221, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default, 1.2f); } - if (Main.rand.Next(20) == 0) + if (Main.rand.NextBool(20)) { Gore.NewGore(projectile.position, new Vector2(projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f), Main.rand.Next(16, 18), 1f); } diff --git a/Projectiles/Ranged/PlasmaExplosion.cs b/Projectiles/Ranged/PlasmaExplosion.cs index 5192f8e5e2..7b31d17bf4 100644 --- a/Projectiles/Ranged/PlasmaExplosion.cs +++ b/Projectiles/Ranged/PlasmaExplosion.cs @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Ranged num463 *= num466; num464 *= num466; int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, - (projectile.ai[1] == 1f ? 173 : 221), 0f, 0f, 100, default(Color), 2f); + (projectile.ai[1] == 1f ? 173 : 221), 0f, 0f, 100, default, 2f); Main.dust[num467].noGravity = true; Main.dust[num467].position.X = projectile.Center.X; Main.dust[num467].position.Y = projectile.Center.Y; diff --git a/Projectiles/Ranged/ProBolt.cs b/Projectiles/Ranged/ProBolt.cs index f327a26b1e..705699b6fe 100644 --- a/Projectiles/Ranged/ProBolt.cs +++ b/Projectiles/Ranged/ProBolt.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Ranged { float x = projectile.position.X - projectile.velocity.X / 10f * (float)num134; float y = projectile.position.Y - projectile.velocity.Y / 10f * (float)num134; - int num135 = Dust.NewDust(new Vector2(x, y), 1, 1, 160, 0f, 0f, 0, default(Color), 1.25f); + int num135 = Dust.NewDust(new Vector2(x, y), 1, 1, 160, 0f, 0f, 0, default, 1.25f); Main.dust[num135].alpha = projectile.alpha; Main.dust[num135].position.X = x; Main.dust[num135].position.Y = y; diff --git a/Projectiles/Ranged/RealmRavagerBullet.cs b/Projectiles/Ranged/RealmRavagerBullet.cs index 101dcac592..ab82d44bff 100644 --- a/Projectiles/Ranged/RealmRavagerBullet.cs +++ b/Projectiles/Ranged/RealmRavagerBullet.cs @@ -35,14 +35,14 @@ namespace CalamityMod.Projectiles.Ranged projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num193 = 0; num193 < 2; num193++) { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 1.5f); + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 1.5f); } for (int num194 = 0; num194 < 20; num194++) { - int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 0, default(Color), 2.5f); + int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 0, default, 2.5f); Main.dust[num195].noGravity = true; Main.dust[num195].velocity *= 3f; - num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 1.5f); + num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 1.5f); Main.dust[num195].velocity *= 2f; Main.dust[num195].noGravity = true; } diff --git a/Projectiles/Ranged/RubberMortarRound.cs b/Projectiles/Ranged/RubberMortarRound.cs index 112f882976..2cb3886755 100644 --- a/Projectiles/Ranged/RubberMortarRound.cs +++ b/Projectiles/Ranged/RubberMortarRound.cs @@ -3,6 +3,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.GameContent.Achievements; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged @@ -53,11 +54,11 @@ namespace CalamityMod.Projectiles.Ranged num247 = projectile.velocity.X * 0.5f; num248 = projectile.velocity.Y * 0.5f; } - int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 6, 0f, 0f, 100, default(Color), 1f); + int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 6, 0f, 0f, 100, default, 1f); Main.dust[num249].scale *= 2f + (float)Main.rand.Next(10) * 0.1f; Main.dust[num249].velocity *= 0.2f; Main.dust[num249].noGravity = true; - num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 31, 0f, 0f, 100, default(Color), 0.5f); + num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 31, 0f, 0f, 100, default, 0.5f); Main.dust[num249].fadeIn = 1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num249].velocity *= 0.05f; } @@ -77,9 +78,9 @@ namespace CalamityMod.Projectiles.Ranged Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -87,10 +88,10 @@ namespace CalamityMod.Projectiles.Ranged } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } for (int num625 = 0; num625 < 3; num625++) @@ -104,25 +105,25 @@ namespace CalamityMod.Projectiles.Ranged { scaleFactor10 = 1f; } - int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13AB6_cp_0 = Main.gore[num626]; expr_13AB6_cp_0.velocity.X = expr_13AB6_cp_0.velocity.X + 1f; Gore expr_13AD6_cp_0 = Main.gore[num626]; expr_13AD6_cp_0.velocity.Y = expr_13AD6_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13B79_cp_0 = Main.gore[num626]; expr_13B79_cp_0.velocity.X = expr_13B79_cp_0.velocity.X - 1f; Gore expr_13B99_cp_0 = Main.gore[num626]; expr_13B99_cp_0.velocity.Y = expr_13B99_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13C3C_cp_0 = Main.gore[num626]; expr_13C3C_cp_0.velocity.X = expr_13C3C_cp_0.velocity.X + 1f; Gore expr_13C5C_cp_0 = Main.gore[num626]; expr_13C5C_cp_0.velocity.Y = expr_13C5C_cp_0.velocity.Y - 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13CFF_cp_0 = Main.gore[num626]; expr_13CFF_cp_0.velocity.X = expr_13CFF_cp_0.velocity.X - 1f; @@ -180,7 +181,7 @@ namespace CalamityMod.Projectiles.Ranged if (Main.tile[num824, num825] != null && Main.tile[num824, num825].active() && Main.tile[num824, num825].type != (ushort)mod.TileType("AbyssGravel")) { WorldGen.KillTile(num824, num825, false, false, false); - if (!Main.tile[num824, num825].active() && Main.netMode != 0) + if (!Main.tile[num824, num825].active() && Main.netMode != NetmodeID.SinglePlayer) { NetMessage.SendData(17, -1, -1, null, 0, (float)num824, (float)num825, 0f, 0, 0, 0); } @@ -192,7 +193,7 @@ namespace CalamityMod.Projectiles.Ranged if (Main.tile[num829, num830] != null && Main.tile[num829, num830].wall > 0 && Main.tile[num829, num830].wall != (byte)mod.WallType("AbyssGravelWall") && flag3) { WorldGen.KillWall(num829, num830, false); - if (Main.tile[num829, num830].wall == 0 && Main.netMode != 0) + if (Main.tile[num829, num830].wall == 0 && Main.netMode != NetmodeID.SinglePlayer) { NetMessage.SendData(17, -1, -1, null, 2, (float)num829, (float)num830, 0f, 0, 0, 0); } @@ -203,14 +204,14 @@ namespace CalamityMod.Projectiles.Ranged } } AchievementsHelper.CurrentlyMining = false; - if (Main.netMode != 0) + if (Main.netMode != NetmodeID.SinglePlayer) { NetMessage.SendData(29, -1, -1, null, projectile.identity, (float)projectile.owner, 0f, 0f, 0, 0, 0); } if (!projectile.noDropItem) { int num831 = -1; - if (Main.netMode == 1 && num831 >= 0) + if (Main.netMode == NetmodeID.MultiplayerClient && num831 >= 0) { NetMessage.SendData(21, -1, -1, null, num831, 1f, 0f, 0f, 0, 0, 0); } @@ -243,9 +244,9 @@ namespace CalamityMod.Projectiles.Ranged Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -253,10 +254,10 @@ namespace CalamityMod.Projectiles.Ranged } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } for (int num625 = 0; num625 < 3; num625++) @@ -270,25 +271,25 @@ namespace CalamityMod.Projectiles.Ranged { scaleFactor10 = 1f; } - int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13AB6_cp_0 = Main.gore[num626]; expr_13AB6_cp_0.velocity.X = expr_13AB6_cp_0.velocity.X + 1f; Gore expr_13AD6_cp_0 = Main.gore[num626]; expr_13AD6_cp_0.velocity.Y = expr_13AD6_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13B79_cp_0 = Main.gore[num626]; expr_13B79_cp_0.velocity.X = expr_13B79_cp_0.velocity.X - 1f; Gore expr_13B99_cp_0 = Main.gore[num626]; expr_13B99_cp_0.velocity.Y = expr_13B99_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13C3C_cp_0 = Main.gore[num626]; expr_13C3C_cp_0.velocity.X = expr_13C3C_cp_0.velocity.X + 1f; Gore expr_13C5C_cp_0 = Main.gore[num626]; expr_13C5C_cp_0.velocity.Y = expr_13C5C_cp_0.velocity.Y - 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13CFF_cp_0 = Main.gore[num626]; expr_13CFF_cp_0.velocity.X = expr_13CFF_cp_0.velocity.X - 1f; @@ -346,7 +347,7 @@ namespace CalamityMod.Projectiles.Ranged if (Main.tile[num824, num825] != null && Main.tile[num824, num825].active()) { WorldGen.KillTile(num824, num825, false, false, false); - if (!Main.tile[num824, num825].active() && Main.netMode != 0) + if (!Main.tile[num824, num825].active() && Main.netMode != NetmodeID.SinglePlayer) { NetMessage.SendData(17, -1, -1, null, 0, (float)num824, (float)num825, 0f, 0, 0, 0); } @@ -358,7 +359,7 @@ namespace CalamityMod.Projectiles.Ranged if (Main.tile[num829, num830] != null && Main.tile[num829, num830].wall > 0 && flag3) { WorldGen.KillWall(num829, num830, false); - if (Main.tile[num829, num830].wall == 0 && Main.netMode != 0) + if (Main.tile[num829, num830].wall == 0 && Main.netMode != NetmodeID.SinglePlayer) { NetMessage.SendData(17, -1, -1, null, 2, (float)num829, (float)num830, 0f, 0, 0, 0); } @@ -369,14 +370,14 @@ namespace CalamityMod.Projectiles.Ranged } } AchievementsHelper.CurrentlyMining = false; - if (Main.netMode != 0) + if (Main.netMode != NetmodeID.SinglePlayer) { NetMessage.SendData(29, -1, -1, null, projectile.identity, (float)projectile.owner, 0f, 0f, 0, 0, 0); } if (!projectile.noDropItem) { int num831 = -1; - if (Main.netMode == 1 && num831 >= 0) + if (Main.netMode == NetmodeID.MultiplayerClient && num831 >= 0) { NetMessage.SendData(21, -1, -1, null, num831, 1f, 0f, 0f, 0, 0, 0); } diff --git a/Projectiles/Ranged/SandWater.cs b/Projectiles/Ranged/SandWater.cs index 03cbd65e4a..31034b6b5d 100644 --- a/Projectiles/Ranged/SandWater.cs +++ b/Projectiles/Ranged/SandWater.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Ranged Lighting.AddLight(projectile.Center, 0f, 0f, 0.5f); for (int num457 = 0; num457 < 10; num457++) { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default(Color), 0.9f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default, 0.9f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Ranged num466 = num465 / num466; num463 *= num466; num464 *= num466; - int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default(Color), 0.6f); + int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default, 0.6f); Main.dust[num467].noGravity = true; Main.dust[num467].position.X = projectile.Center.X; Main.dust[num467].position.Y = projectile.Center.Y; diff --git a/Projectiles/Ranged/SandstormBullet.cs b/Projectiles/Ranged/SandstormBullet.cs index 607fedd1f0..188a0572e9 100644 --- a/Projectiles/Ranged/SandstormBullet.cs +++ b/Projectiles/Ranged/SandstormBullet.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Ranged { projectile.alpha = 0; } - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 85, 0f, 0f, 100, default(Color), 1f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 85, 0f, 0f, 100, default, 1f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } @@ -57,9 +57,9 @@ namespace CalamityMod.Projectiles.Ranged for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 85, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default(Color), 1.2f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 85, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default, 1.2f); Main.dust[num228].noGravity = true; Main.dust[num228].noLight = true; Main.dust[num228].velocity = vector7; diff --git a/Projectiles/Ranged/SandyWaifuShark.cs b/Projectiles/Ranged/SandyWaifuShark.cs index 7f4c299401..95638b7d21 100644 --- a/Projectiles/Ranged/SandyWaifuShark.cs +++ b/Projectiles/Ranged/SandyWaifuShark.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.velocity *= 1.05f; } } - int num192 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 32, 0f, 0f, 0, default(Color), 0.5f); + int num192 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 32, 0f, 0f, 0, default, 0.5f); Main.dust[num192].noGravity = true; Main.dust[num192].velocity *= 0.2f; Main.dust[num192].position = (Main.dust[num192].position + projectile.Center) / 2f; diff --git a/Projectiles/Ranged/SeaDragonRocket.cs b/Projectiles/Ranged/SeaDragonRocket.cs index cea05420b8..f76028f841 100644 --- a/Projectiles/Ranged/SeaDragonRocket.cs +++ b/Projectiles/Ranged/SeaDragonRocket.cs @@ -28,9 +28,9 @@ namespace CalamityMod.Projectiles.Ranged { for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -66,11 +66,11 @@ namespace CalamityMod.Projectiles.Ranged num247 = projectile.velocity.X * 0.5f; num248 = projectile.velocity.Y * 0.5f; } - int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 6, 0f, 0f, 100, default(Color), 1f); + int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 6, 0f, 0f, 100, default, 1f); Main.dust[num249].scale *= 2f + (float)Main.rand.Next(10) * 0.1f; Main.dust[num249].velocity *= 0.2f; Main.dust[num249].noGravity = true; - num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 33, 0f, 0f, 100, default(Color), 0.5f); + num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 33, 0f, 0f, 100, default, 0.5f); Main.dust[num249].fadeIn = 1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num249].velocity *= 0.05f; } @@ -122,9 +122,9 @@ namespace CalamityMod.Projectiles.Ranged projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 15; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -132,10 +132,10 @@ namespace CalamityMod.Projectiles.Ranged } for (int num623 = 0; num623 < 25; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } int num251 = Main.rand.Next(2, 4); diff --git a/Projectiles/Ranged/ShadeFire.cs b/Projectiles/Ranged/ShadeFire.cs index 23768693bd..cb9d76e8ac 100644 --- a/Projectiles/Ranged/ShadeFire.cs +++ b/Projectiles/Ranged/ShadeFire.cs @@ -47,12 +47,12 @@ namespace CalamityMod.Projectiles.Ranged } projectile.ai[0] += 1f; int num297 = 14; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { for (int num298 = 0; num298 < 3; num298++) { - int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1f); - if (Main.rand.Next(3) == 0) + int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); + if (Main.rand.NextBool(3)) { Main.dust[num299].noGravity = true; Main.dust[num299].scale *= 1.75f; diff --git a/Projectiles/Ranged/Shockblast.cs b/Projectiles/Ranged/Shockblast.cs index 6ab2932c6f..24291bde53 100644 --- a/Projectiles/Ranged/Shockblast.cs +++ b/Projectiles/Ranged/Shockblast.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Ranged num466 = num465 / num466; num463 *= num466; num464 *= num466; - int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 185, 0f, 0f, 100, default(Color), 1f); + int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 185, 0f, 0f, 100, default, 1f); Main.dust[num467].noGravity = true; Main.dust[num467].position.X = projectile.Center.X; Main.dust[num467].position.Y = projectile.Center.Y; diff --git a/Projectiles/Ranged/ShockblastRound.cs b/Projectiles/Ranged/ShockblastRound.cs index 9b79784bf5..6c5bb10936 100644 --- a/Projectiles/Ranged/ShockblastRound.cs +++ b/Projectiles/Ranged/ShockblastRound.cs @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Ranged { float x2 = projectile.position.X - projectile.velocity.X / 10f * (float)num136; float y2 = projectile.position.Y - projectile.velocity.Y / 10f * (float)num136; - int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 185, 0f, 0f, 0, default(Color), 1f); + int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 185, 0f, 0f, 0, default, 1f); Main.dust[num137].alpha = projectile.alpha; Main.dust[num137].position.X = x2; Main.dust[num137].position.Y = y2; diff --git a/Projectiles/Ranged/Sickness.cs b/Projectiles/Ranged/Sickness.cs index e7467a9b26..eb54a2a115 100644 --- a/Projectiles/Ranged/Sickness.cs +++ b/Projectiles/Ranged/Sickness.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Ranged num466 = num465 / num466; num463 *= num466; num464 *= num466; - int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, default(Color), 0.5f); + int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, default, 0.5f); Main.dust[num467].noGravity = true; Main.dust[num467].position.X = projectile.Center.X; Main.dust[num467].position.Y = projectile.Center.Y; diff --git a/Projectiles/Ranged/SicknessRound.cs b/Projectiles/Ranged/SicknessRound.cs index 8f64d7bb30..d3ced00f43 100644 --- a/Projectiles/Ranged/SicknessRound.cs +++ b/Projectiles/Ranged/SicknessRound.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Ranged { float x2 = projectile.position.X - projectile.velocity.X / 10f * (float)num136; float y2 = projectile.position.Y - projectile.velocity.Y / 10f * (float)num136; - int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 107, 0f, 0f, 0, default(Color), 1f); + int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 107, 0f, 0f, 0, default, 1f); Main.dust[num137].alpha = projectile.alpha; Main.dust[num137].position.X = x2; Main.dust[num137].position.Y = y2; diff --git a/Projectiles/Ranged/SicknessRound2.cs b/Projectiles/Ranged/SicknessRound2.cs index 3bc52023d1..975967485f 100644 --- a/Projectiles/Ranged/SicknessRound2.cs +++ b/Projectiles/Ranged/SicknessRound2.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Ranged { float x2 = projectile.position.X - projectile.velocity.X / 10f * (float)num136; float y2 = projectile.position.Y - projectile.velocity.Y / 10f * (float)num136; - int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 107, 0f, 0f, 0, default(Color), 1f); + int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 107, 0f, 0f, 0, default, 1f); Main.dust[num137].alpha = projectile.alpha; Main.dust[num137].position.X = x2; Main.dust[num137].position.Y = y2; diff --git a/Projectiles/Ranged/SlagRound.cs b/Projectiles/Ranged/SlagRound.cs index 87be0173b3..9058da331b 100644 --- a/Projectiles/Ranged/SlagRound.cs +++ b/Projectiles/Ranged/SlagRound.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Ranged { for (int num468 = 0; num468 < 3; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 32, 0f, 0f, 100, default(Color), 1.25f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 32, 0f, 0f, 100, default, 1.25f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Ranged/SlimeBolt.cs b/Projectiles/Ranged/SlimeBolt.cs index 720bb240cb..7394ffa225 100644 --- a/Projectiles/Ranged/SlimeBolt.cs +++ b/Projectiles/Ranged/SlimeBolt.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.01f) / 255f, ((255 - projectile.alpha) * 0.05f) / 255f, ((255 - projectile.alpha) * 0.25f) / 255f); - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 20, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Ranged/Spyker.cs b/Projectiles/Ranged/Spyker.cs index b092b9e945..e15ee3a6ad 100644 --- a/Projectiles/Ranged/Spyker.cs +++ b/Projectiles/Ranged/Spyker.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Ranged { for (int num468 = 0; num468 < 2; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 46, 0f, 0f, 100, default(Color), 0.75f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 46, 0f, 0f, 100, default, 0.75f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } @@ -87,7 +87,7 @@ namespace CalamityMod.Projectiles.Ranged { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 46, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/StarfleetMK2.cs b/Projectiles/Ranged/StarfleetMK2.cs index 635c5af629..43b499b60a 100644 --- a/Projectiles/Ranged/StarfleetMK2.cs +++ b/Projectiles/Ranged/StarfleetMK2.cs @@ -47,9 +47,9 @@ namespace CalamityMod.Projectiles.Ranged for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * 9f; - vector6 = vector6.RotatedBy(((num227 - (num226 / 2 - 1)) * 6.28318548f / num226), default(Vector2)) + player.Center; + vector6 = vector6.RotatedBy(((num227 - (num226 / 2 - 1)) * 6.28318548f / num226), default) + player.Center; Vector2 vector7 = vector6 - player.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 221, 0f, 0f, 0, default(Color), 4f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 221, 0f, 0f, 0, default, 4f); Main.dust[num228].noGravity = true; Main.dust[num228].velocity = vector7; } diff --git a/Projectiles/Ranged/SulphuricAcidCannon2.cs b/Projectiles/Ranged/SulphuricAcidCannon2.cs index e011b985b6..836a7ffb26 100644 --- a/Projectiles/Ranged/SulphuricAcidCannon2.cs +++ b/Projectiles/Ranged/SulphuricAcidCannon2.cs @@ -268,7 +268,7 @@ namespace CalamityMod.Projectiles.Ranged int num3; for (int num246 = 0; num246 < 25; num246 = num3 + 1) { - int num247 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 31, 0f, 0f, 0, default(Color), 1f); + int num247 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 31, 0f, 0f, 0, default, 1f); Main.dust[num247].position = (Main.dust[num247].position + projectile.position) / 2f; Main.dust[num247].velocity = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); Main.dust[num247].velocity.Normalize(); diff --git a/Projectiles/Ranged/SuperballBullet.cs b/Projectiles/Ranged/SuperballBullet.cs index db41af40ac..c6b2f52ba9 100644 --- a/Projectiles/Ranged/SuperballBullet.cs +++ b/Projectiles/Ranged/SuperballBullet.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Ranged { float x2 = projectile.position.X - projectile.velocity.X / 10f * (float)num136; float y2 = projectile.position.Y - projectile.velocity.Y / 10f * (float)num136; - int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 87, 0f, 0f, 0, default(Color), 0.5f); + int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 87, 0f, 0f, 0, default, 0.5f); Main.dust[num137].alpha = projectile.alpha; Main.dust[num137].position.X = x2; Main.dust[num137].position.Y = y2; diff --git a/Projectiles/Ranged/TelluricGlare.cs b/Projectiles/Ranged/TelluricGlare.cs index 4045130064..f172fd22d9 100644 --- a/Projectiles/Ranged/TelluricGlare.cs +++ b/Projectiles/Ranged/TelluricGlare.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Ranged { for (int num468 = 0; num468 < 5; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 1.5f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1.5f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } @@ -51,9 +51,9 @@ namespace CalamityMod.Projectiles.Ranged projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -61,10 +61,10 @@ namespace CalamityMod.Projectiles.Ranged } for (int num623 = 0; num623 < 20; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Ranged/TerraArrow.cs b/Projectiles/Ranged/TerraArrow.cs index a09d79e8f2..a988f178b9 100644 --- a/Projectiles/Ranged/TerraArrow.cs +++ b/Projectiles/Ranged/TerraArrow.cs @@ -45,9 +45,9 @@ namespace CalamityMod.Projectiles.Ranged projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 3; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 1.2f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/TerraArrow2.cs b/Projectiles/Ranged/TerraArrow2.cs index 31672ca8b5..ad62dd8f70 100644 --- a/Projectiles/Ranged/TerraArrow2.cs +++ b/Projectiles/Ranged/TerraArrow2.cs @@ -76,8 +76,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 2; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, default(Color), 2f); - if (Main.rand.Next(2) == 0) + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, default, 2f); + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Ranged/TerraBallBow.cs b/Projectiles/Ranged/TerraBallBow.cs index a070b7b56a..4418852f7b 100644 --- a/Projectiles/Ranged/TerraBallBow.cs +++ b/Projectiles/Ranged/TerraBallBow.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Ranged dustType = 57; break; } - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default(Color), 2.2f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 2.2f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; @@ -112,14 +112,14 @@ namespace CalamityMod.Projectiles.Ranged int num3; for (int num53 = 0; num53 < 20; num53 = num3 + 1) { - int num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 200, default(Color), num50); + int num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 200, default, num50); Main.dust[num54].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; Main.dust[num54].noGravity = true; Dust dust = Main.dust[num54]; dust.velocity *= 3f; dust = Main.dust[num54]; dust.velocity += value4 * Main.rand.NextFloat(); - num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default(Color), num51); + num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, num51); Main.dust[num54].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; dust = Main.dust[num54]; dust.velocity *= 2f; @@ -131,8 +131,8 @@ namespace CalamityMod.Projectiles.Ranged } for (int num55 = 0; num55 < 10; num55 = num3 + 1) { - int num56 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 0, default(Color), num52); - Main.dust[num56].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)) * (float)projectile.width / 3f; + int num56 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 0, default, num52); + Main.dust[num56].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default) * (float)projectile.width / 3f; Main.dust[num56].noGravity = true; Dust dust = Main.dust[num56]; dust.velocity *= 0.5f; diff --git a/Projectiles/Ranged/TerraBullet.cs b/Projectiles/Ranged/TerraBullet.cs index e9ea3166d9..aac43558c9 100644 --- a/Projectiles/Ranged/TerraBullet.cs +++ b/Projectiles/Ranged/TerraBullet.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Ranged { float x2 = projectile.position.X - projectile.velocity.X / 10f * (float)num136; float y2 = projectile.position.Y - projectile.velocity.Y / 10f * (float)num136; - int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 74, 0f, 0f, 0, default(Color), 0.5f); + int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 74, 0f, 0f, 0, default, 0.5f); Main.dust[num137].alpha = projectile.alpha; Main.dust[num137].position.X = x2; Main.dust[num137].position.Y = y2; diff --git a/Projectiles/Ranged/TerraBulletSplit.cs b/Projectiles/Ranged/TerraBulletSplit.cs index 09e74c933d..44bea527d1 100644 --- a/Projectiles/Ranged/TerraBulletSplit.cs +++ b/Projectiles/Ranged/TerraBulletSplit.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Ranged { float x2 = projectile.position.X - projectile.velocity.X / 10f * (float)num136; float y2 = projectile.position.Y - projectile.velocity.Y / 10f * (float)num136; - int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 74, 0f, 0f, 0, default(Color), 0.5f); + int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 74, 0f, 0f, 0, default, 0.5f); Main.dust[num137].alpha = projectile.alpha; Main.dust[num137].position.X = x2; Main.dust[num137].position.Y = y2; diff --git a/Projectiles/Ranged/TerraFireGreen.cs b/Projectiles/Ranged/TerraFireGreen.cs index ae4c7e03e1..5891e6d6c8 100644 --- a/Projectiles/Ranged/TerraFireGreen.cs +++ b/Projectiles/Ranged/TerraFireGreen.cs @@ -48,12 +48,12 @@ namespace CalamityMod.Projectiles.Ranged } projectile.ai[0] += 1f; int num297 = 107; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { for (int num298 = 0; num298 < 3; num298++) { - int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 0.75f); - if (Main.rand.Next(3) == 0) + int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 0.75f); + if (Main.rand.NextBool(3)) { Main.dust[num299].noGravity = true; Main.dust[num299].scale *= 2f; diff --git a/Projectiles/Ranged/TerraFireGreen2.cs b/Projectiles/Ranged/TerraFireGreen2.cs index 42ce84eb92..41b83c11f4 100644 --- a/Projectiles/Ranged/TerraFireGreen2.cs +++ b/Projectiles/Ranged/TerraFireGreen2.cs @@ -46,12 +46,12 @@ namespace CalamityMod.Projectiles.Ranged } projectile.ai[0] += 1f; int num297 = 66; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { for (int num298 = 0; num298 < 2; num298++) { int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 0.75f); - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Main.dust[num299].noGravity = true; Main.dust[num299].scale *= 1.75f; diff --git a/Projectiles/Ranged/TitRail.cs b/Projectiles/Ranged/TitRail.cs index 6dc795f56c..92a9f9a14f 100644 --- a/Projectiles/Ranged/TitRail.cs +++ b/Projectiles/Ranged/TitRail.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Ranged Vector2 vector33 = projectile.position; vector33 -= projectile.velocity * ((float)num447 * 0.25f); projectile.alpha = 255; - int num448 = Dust.NewDust(vector33, 1, 1, 91, 0f, 0f, 0, default(Color), 1f); + int num448 = Dust.NewDust(vector33, 1, 1, 91, 0f, 0f, 0, default, 1f); Main.dust[num448].noGravity = true; Main.dust[num448].position = vector33; Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f; diff --git a/Projectiles/Ranged/TyphoonBubble.cs b/Projectiles/Ranged/TyphoonBubble.cs index 8c6528ad82..045a6427a0 100644 --- a/Projectiles/Ranged/TyphoonBubble.cs +++ b/Projectiles/Ranged/TyphoonBubble.cs @@ -38,9 +38,9 @@ namespace CalamityMod.Projectiles.Ranged for (int num627 = 0; num627 < num626; num627++) { Vector2 vector45 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector45 = vector45.RotatedBy((double)(num627 - (num626 / 2 - 1)) * 3.1415926535897931 / (double)((float)num626), default(Vector2)) + projectile.Center; + vector45 = vector45.RotatedBy((double)(num627 - (num626 / 2 - 1)) * 3.1415926535897931 / (double)((float)num626), default) + projectile.Center; Vector2 value15 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); - int num628 = Dust.NewDust(vector45 + value15, 0, 0, 172, value15.X * 2f, value15.Y * 2f, 100, default(Color), 1.4f); + int num628 = Dust.NewDust(vector45 + value15, 0, 0, 172, value15.X * 2f, value15.Y * 2f, 100, default, 1.4f); Main.dust[num628].noGravity = true; Main.dust[num628].noLight = true; Main.dust[num628].velocity /= 4f; @@ -99,9 +99,9 @@ namespace CalamityMod.Projectiles.Ranged for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 172, vector7.X * 2f, vector7.Y * 2f, 100, default(Color), 1.4f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 172, vector7.X * 2f, vector7.Y * 2f, 100, default, 1.4f); Main.dust[num228].noGravity = true; Main.dust[num228].noLight = true; Main.dust[num228].velocity = vector7; diff --git a/Projectiles/Ranged/VeriumBullet.cs b/Projectiles/Ranged/VeriumBullet.cs index 9709ae3e52..15e80f0cdc 100644 --- a/Projectiles/Ranged/VeriumBullet.cs +++ b/Projectiles/Ranged/VeriumBullet.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Ranged { float x2 = projectile.position.X - projectile.velocity.X / 10f * (float)num136; float y2 = projectile.position.Y - projectile.velocity.Y / 10f * (float)num136; - int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 182, 0f, 0f, 0, default(Color), 0.5f); + int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 182, 0f, 0f, 0, default, 0.5f); Main.dust[num137].alpha = projectile.alpha; Main.dust[num137].position.X = x2; Main.dust[num137].position.Y = y2; diff --git a/Projectiles/Ranged/Voidragon.cs b/Projectiles/Ranged/Voidragon.cs index 8ae08f16ed..fd91cea165 100644 --- a/Projectiles/Ranged/Voidragon.cs +++ b/Projectiles/Ranged/Voidragon.cs @@ -43,9 +43,9 @@ namespace CalamityMod.Projectiles.Ranged for (int l = 0; l < 12; l++) { Vector2 vector3 = Vector2.UnitX * (float)(-(float)projectile.width) / 2f; - vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default(Vector2)) * new Vector2(8f, 16f); - vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default(Vector2)); - int num9 = Dust.NewDust(projectile.Center, 0, 0, 173, 0f, 0f, 160, default(Color), 1f); + vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default) * new Vector2(8f, 16f); + vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default); + int num9 = Dust.NewDust(projectile.Center, 0, 0, 173, 0f, 0f, 160, default, 1f); Main.dust[num9].scale = 1.1f; Main.dust[num9].noGravity = true; Main.dust[num9].position = projectile.Center + vector3; @@ -64,14 +64,14 @@ namespace CalamityMod.Projectiles.Ranged projectile.alpha = num58; } projectile.rotation = projectile.velocity.ToRotation() - 1.57079637f; - if (Main.rand.Next(16) == 0) + if (Main.rand.NextBool(16)) { - Vector2 value3 = Vector2.UnitX.RotatedByRandom(1.5707963705062866).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)); - int num59 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 173, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default(Color), 1.2f); + Vector2 value3 = Vector2.UnitX.RotatedByRandom(1.5707963705062866).RotatedBy((double)projectile.velocity.ToRotation(), default); + int num59 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 173, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default, 1.2f); Main.dust[num59].velocity = value3 * 0.66f; Main.dust[num59].position = projectile.Center + value3 * 12f; } - if (Main.rand.Next(48) == 0) + if (Main.rand.NextBool(48)) { int num60 = Gore.NewGore(projectile.Center, new Vector2(projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f), 16, 1f); Main.gore[num60].velocity *= 0.66f; @@ -80,11 +80,11 @@ namespace CalamityMod.Projectiles.Ranged if (projectile.ai[1] == 1f) { projectile.light = 0.9f; - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { - Dust.NewDust(projectile.position, projectile.width, projectile.height, 173, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default(Color), 1.2f); + Dust.NewDust(projectile.position, projectile.width, projectile.height, 173, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default, 1.2f); } - if (Main.rand.Next(20) == 0) + if (Main.rand.NextBool(20)) { Gore.NewGore(projectile.position, new Vector2(projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f), Main.rand.Next(16, 18), 1f); } diff --git a/Projectiles/Rogue/AccretionDisk.cs b/Projectiles/Rogue/AccretionDisk.cs index 980ae4c998..81e9aeb1be 100644 --- a/Projectiles/Rogue/AccretionDisk.cs +++ b/Projectiles/Rogue/AccretionDisk.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { for (int num468 = 0; num468 < 1; num468++) { @@ -84,7 +84,7 @@ namespace CalamityMod.Projectiles.Rogue num440 = num437 / num440; num438 *= num440; num439 *= num440; - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { if (projectile.owner == Main.myPlayer) { diff --git a/Projectiles/Rogue/AccretionDisk2.cs b/Projectiles/Rogue/AccretionDisk2.cs index e518b343f7..bc9a4433f9 100644 --- a/Projectiles/Rogue/AccretionDisk2.cs +++ b/Projectiles/Rogue/AccretionDisk2.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { int num250 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 66, (float)(projectile.direction * 2), 0f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 0.5f); Main.dust[num250].noGravity = true; diff --git a/Projectiles/Rogue/AdamantiteThrowingAxeProjectile.cs b/Projectiles/Rogue/AdamantiteThrowingAxeProjectile.cs index 31e07c6461..04bf236111 100644 --- a/Projectiles/Rogue/AdamantiteThrowingAxeProjectile.cs +++ b/Projectiles/Rogue/AdamantiteThrowingAxeProjectile.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height, mod.ItemType("AdamantiteThrowingAxe")); } diff --git a/Projectiles/Rogue/BallisticPoisonBomb.cs b/Projectiles/Rogue/BallisticPoisonBomb.cs index c11412e0b6..c68391d014 100644 --- a/Projectiles/Rogue/BallisticPoisonBomb.cs +++ b/Projectiles/Rogue/BallisticPoisonBomb.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 14, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } @@ -138,9 +138,9 @@ namespace CalamityMod.Projectiles.Rogue projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 14, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 14, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -148,10 +148,10 @@ namespace CalamityMod.Projectiles.Rogue } for (int num623 = 0; num623 < 9; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } for (int num625 = 0; num625 < 3; num625++) @@ -165,25 +165,25 @@ namespace CalamityMod.Projectiles.Rogue { scaleFactor10 = 1f; } - int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13AB6_cp_0 = Main.gore[num626]; expr_13AB6_cp_0.velocity.X = expr_13AB6_cp_0.velocity.X + 1f; Gore expr_13AD6_cp_0 = Main.gore[num626]; expr_13AD6_cp_0.velocity.Y = expr_13AD6_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13B79_cp_0 = Main.gore[num626]; expr_13B79_cp_0.velocity.X = expr_13B79_cp_0.velocity.X - 1f; Gore expr_13B99_cp_0 = Main.gore[num626]; expr_13B99_cp_0.velocity.Y = expr_13B99_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13C3C_cp_0 = Main.gore[num626]; expr_13C3C_cp_0.velocity.X = expr_13C3C_cp_0.velocity.X + 1f; Gore expr_13C5C_cp_0 = Main.gore[num626]; expr_13C5C_cp_0.velocity.Y = expr_13C5C_cp_0.velocity.Y - 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13CFF_cp_0 = Main.gore[num626]; expr_13CFF_cp_0.velocity.X = expr_13CFF_cp_0.velocity.X - 1f; diff --git a/Projectiles/Rogue/BallisticPoisonBombSpike.cs b/Projectiles/Rogue/BallisticPoisonBombSpike.cs index 5287440f0f..05cd16d2d7 100644 --- a/Projectiles/Rogue/BallisticPoisonBombSpike.cs +++ b/Projectiles/Rogue/BallisticPoisonBombSpike.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.localAI[1] += 1f; if (projectile.localAI[1] > 4f) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 14, 0f, 0f, 100, default(Color), 0.75f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 14, 0f, 0f, 100, default, 0.75f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Rogue { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 14, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/BrackishWater.cs b/Projectiles/Rogue/BrackishWater.cs index 3dd6c1b69a..94d7c293d5 100644 --- a/Projectiles/Rogue/BrackishWater.cs +++ b/Projectiles/Rogue/BrackishWater.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Rogue } for (int num457 = 0; num457 < 3; num457++) { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, randomDust, 0f, 0f, 100, default(Color), 1.2f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, randomDust, 0f, 0f, 100, default, 1.2f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; diff --git a/Projectiles/Rogue/BrackishWaterBlast.cs b/Projectiles/Rogue/BrackishWaterBlast.cs index c764751bcc..ceb2f45e16 100644 --- a/Projectiles/Rogue/BrackishWaterBlast.cs +++ b/Projectiles/Rogue/BrackishWaterBlast.cs @@ -86,7 +86,7 @@ namespace CalamityMod.Projectiles.Rogue num466 = num465 / num466; num463 *= num466; num464 *= num466; - int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, randomDust, 0f, 0f, 100, default(Color), 0.5f); + int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, randomDust, 0f, 0f, 100, default, 0.5f); Main.dust[num467].noGravity = true; Main.dust[num467].position.X = projectile.Center.X; Main.dust[num467].position.Y = projectile.Center.Y; diff --git a/Projectiles/Rogue/CobaltKunaiProjectile.cs b/Projectiles/Rogue/CobaltKunaiProjectile.cs index 057fcd8962..b35b43f538 100644 --- a/Projectiles/Rogue/CobaltKunaiProjectile.cs +++ b/Projectiles/Rogue/CobaltKunaiProjectile.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height, mod.ItemType("CobaltKunai")); } diff --git a/Projectiles/Rogue/CraniumSmasher.cs b/Projectiles/Rogue/CraniumSmasher.cs index ef7a65f5cb..6e2b158d44 100644 --- a/Projectiles/Rogue/CraniumSmasher.cs +++ b/Projectiles/Rogue/CraniumSmasher.cs @@ -40,8 +40,8 @@ namespace CalamityMod.Projectiles.Rogue { for (int i = 0; i < 5; i++) { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 5, (projectile.oldVelocity.X / 2), (projectile.oldVelocity.Y / 2), 0, default(Color), 2f); - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 6, (projectile.oldVelocity.X / 2), (projectile.oldVelocity.Y / 2), 0, default(Color), 1f); + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 5, (projectile.oldVelocity.X / 2), (projectile.oldVelocity.Y / 2), 0, default, 2f); + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 6, (projectile.oldVelocity.X / 2), (projectile.oldVelocity.Y / 2), 0, default, 1f); } } diff --git a/Projectiles/Rogue/CraniumSmasherExplosive.cs b/Projectiles/Rogue/CraniumSmasherExplosive.cs index 2565426638..88fe9eed24 100644 --- a/Projectiles/Rogue/CraniumSmasherExplosive.cs +++ b/Projectiles/Rogue/CraniumSmasherExplosive.cs @@ -49,19 +49,19 @@ namespace CalamityMod.Projectiles.Rogue { scaleFactor10 = 1f; } - int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13AB6_cp_0 = Main.gore[num626]; expr_13AB6_cp_0.velocity.X = expr_13AB6_cp_0.velocity.X + 1f; Gore expr_13AD6_cp_0 = Main.gore[num626]; expr_13AD6_cp_0.velocity.Y = expr_13AD6_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13B79_cp_0 = Main.gore[num626]; expr_13B79_cp_0.velocity.X = expr_13B79_cp_0.velocity.X - 1f; Gore expr_13B99_cp_0 = Main.gore[num626]; expr_13B99_cp_0.velocity.Y = expr_13B99_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13C3C_cp_0 = Main.gore[num626]; expr_13C3C_cp_0.velocity.X = expr_13C3C_cp_0.velocity.X + 1f; @@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num194 = 0; num194 < 25; num194++) { - int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 135, 0f, 0f, 100, default(Color), 2f); + int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 135, 0f, 0f, 100, default, 2f); Main.dust[num195].noGravity = true; Main.dust[num195].velocity *= 0f; } diff --git a/Projectiles/Rogue/CrystalPiercerProjectile.cs b/Projectiles/Rogue/CrystalPiercerProjectile.cs index 762ff63a2a..2fed9b66ff 100644 --- a/Projectiles/Rogue/CrystalPiercerProjectile.cs +++ b/Projectiles/Rogue/CrystalPiercerProjectile.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 2.355f; - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 173, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f); } @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Rogue { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 173, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height, mod.ItemType("CrystalPiercer")); } diff --git a/Projectiles/Rogue/EmpyreanKnives.cs b/Projectiles/Rogue/EmpyreanKnives.cs index a8c5f163a5..77c465e455 100644 --- a/Projectiles/Rogue/EmpyreanKnives.cs +++ b/Projectiles/Rogue/EmpyreanKnives.cs @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f; projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f; } - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 58, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f); } @@ -119,7 +119,7 @@ namespace CalamityMod.Projectiles.Rogue { for (int num303 = 0; num303 < 3; num303++) { - int num304 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 58, 0f, 0f, 100, default(Color), 0.8f); + int num304 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 58, 0f, 0f, 100, default, 0.8f); Main.dust[num304].noGravity = true; Main.dust[num304].velocity *= 1.2f; Main.dust[num304].velocity -= projectile.oldVelocity * 0.3f; diff --git a/Projectiles/Rogue/EradicatorProjectile.cs b/Projectiles/Rogue/EradicatorProjectile.cs index a59878a318..b653e59273 100644 --- a/Projectiles/Rogue/EradicatorProjectile.cs +++ b/Projectiles/Rogue/EradicatorProjectile.cs @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Rogue num440 = num437 / num440; num438 *= num440; num439 *= num440; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { if (projectile.owner == Main.myPlayer) { diff --git a/Projectiles/Rogue/ExecutionersBlade.cs b/Projectiles/Rogue/ExecutionersBlade.cs index 7a6908a16f..5bb896b8bd 100644 --- a/Projectiles/Rogue/ExecutionersBlade.cs +++ b/Projectiles/Rogue/ExecutionersBlade.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { Lighting.AddLight(projectile.Center, 0.5f, 0f, 0.65f); - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 173, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } @@ -87,9 +87,9 @@ namespace CalamityMod.Projectiles.Rogue projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 3; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -97,10 +97,10 @@ namespace CalamityMod.Projectiles.Rogue } for (int num623 = 0; num623 < 5; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Rogue/FeatherKnifeProjectile.cs b/Projectiles/Rogue/FeatherKnifeProjectile.cs index b76b7ab832..84dbf49285 100644 --- a/Projectiles/Rogue/FeatherKnifeProjectile.cs +++ b/Projectiles/Rogue/FeatherKnifeProjectile.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height, mod.ItemType("FeatherKnife")); } diff --git a/Projectiles/Rogue/FlameScytheProjectile.cs b/Projectiles/Rogue/FlameScytheProjectile.cs index bfa9c152d9..69502c597f 100644 --- a/Projectiles/Rogue/FlameScytheProjectile.cs +++ b/Projectiles/Rogue/FlameScytheProjectile.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { Lighting.AddLight(projectile.Center, 0.25f, 0.15f, 0f); - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 127, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Rogue/GelDartProjectile.cs b/Projectiles/Rogue/GelDartProjectile.cs index cebd6f859a..05b2b63e80 100644 --- a/Projectiles/Rogue/GelDartProjectile.cs +++ b/Projectiles/Rogue/GelDartProjectile.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height, mod.ItemType("GelDart")); } diff --git a/Projectiles/Rogue/IceStarProjectile.cs b/Projectiles/Rogue/IceStarProjectile.cs index 06b991af09..c5cd4aad55 100644 --- a/Projectiles/Rogue/IceStarProjectile.cs +++ b/Projectiles/Rogue/IceStarProjectile.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { projectile.rotation += 0.5f; - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 67, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Rogue/IchorSpear.cs b/Projectiles/Rogue/IchorSpear.cs index bc43a4002b..5bd99fc14e 100644 --- a/Projectiles/Rogue/IchorSpear.cs +++ b/Projectiles/Rogue/IchorSpear.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 246, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Rogue/IchorSpear2.cs b/Projectiles/Rogue/IchorSpear2.cs index 6f06e0818a..216ba92003 100644 --- a/Projectiles/Rogue/IchorSpear2.cs +++ b/Projectiles/Rogue/IchorSpear2.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 246, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Rogue/Malachite.cs b/Projectiles/Rogue/Malachite.cs index 5735acbefa..82bf4ac8ab 100644 --- a/Projectiles/Rogue/Malachite.cs +++ b/Projectiles/Rogue/Malachite.cs @@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles.Rogue { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/MalachiteBolt.cs b/Projectiles/Rogue/MalachiteBolt.cs index 3e161ab616..b510ebda34 100644 --- a/Projectiles/Rogue/MalachiteBolt.cs +++ b/Projectiles/Rogue/MalachiteBolt.cs @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Rogue { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -107,7 +107,7 @@ namespace CalamityMod.Projectiles.Rogue { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Rogue/MangroveChakramProjectile.cs b/Projectiles/Rogue/MangroveChakramProjectile.cs index db45fc0419..1e1c9147ac 100644 --- a/Projectiles/Rogue/MangroveChakramProjectile.cs +++ b/Projectiles/Rogue/MangroveChakramProjectile.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { Lighting.AddLight(projectile.Center, 0f, 0.25f, 0f); - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 44, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Rogue/MeteorFist.cs b/Projectiles/Rogue/MeteorFist.cs index ba77ee8ff1..04877de9c6 100644 --- a/Projectiles/Rogue/MeteorFist.cs +++ b/Projectiles/Rogue/MeteorFist.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Rogue num247 = projectile.velocity.X * 0.5f; num248 = projectile.velocity.Y * 0.5f; } - int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 6, 0f, 0f, 100, default(Color), 0.5f); + int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 6, 0f, 0f, 100, default, 0.5f); Main.dust[num249].scale *= 2f + (float)Main.rand.Next(10) * 0.1f; Main.dust[num249].velocity *= 0.2f; Main.dust[num249].noGravity = true; @@ -61,18 +61,18 @@ namespace CalamityMod.Projectiles.Rogue { projectile.velocity *= 2f; } - else if (Main.rand.Next(2) == 0) + else if (Main.rand.NextBool(2)) { - int num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 0.5f); + int num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 0.5f); Main.dust[num252].scale = 0.1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].fadeIn = 1.5f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].noGravity = true; - Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2)).RotatedBy((double)projectile.rotation, default(Vector2)) * 1.1f; + Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2)).RotatedBy((double)projectile.rotation, default) * 1.1f; Main.rand.Next(2); - num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 0.5f); + num252 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 0.5f); Main.dust[num252].scale = 1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num252].noGravity = true; - Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2 - 6)).RotatedBy((double)projectile.rotation, default(Vector2)) * 1.1f; + Main.dust[num252].position = projectile.Center + new Vector2(0f, (float)(-(float)projectile.height / 2 - 6)).RotatedBy((double)projectile.rotation, default) * 1.1f; } } projectile.ai[0] += 1f; @@ -104,9 +104,9 @@ namespace CalamityMod.Projectiles.Rogue projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 1f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -114,10 +114,10 @@ namespace CalamityMod.Projectiles.Rogue } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 2f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 1f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } for (int num625 = 0; num625 < 3; num625++) @@ -131,25 +131,25 @@ namespace CalamityMod.Projectiles.Rogue { scaleFactor10 = 1f; } - int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 0.5f); + int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 0.5f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13AB6_cp_0 = Main.gore[num626]; expr_13AB6_cp_0.velocity.X = expr_13AB6_cp_0.velocity.X + 1f; Gore expr_13AD6_cp_0 = Main.gore[num626]; expr_13AD6_cp_0.velocity.Y = expr_13AD6_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 0.5f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 0.5f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13B79_cp_0 = Main.gore[num626]; expr_13B79_cp_0.velocity.X = expr_13B79_cp_0.velocity.X - 1f; Gore expr_13B99_cp_0 = Main.gore[num626]; expr_13B99_cp_0.velocity.Y = expr_13B99_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 0.5f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 0.5f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13C3C_cp_0 = Main.gore[num626]; expr_13C3C_cp_0.velocity.X = expr_13C3C_cp_0.velocity.X + 1f; Gore expr_13C5C_cp_0 = Main.gore[num626]; expr_13C5C_cp_0.velocity.Y = expr_13C5C_cp_0.velocity.Y - 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 0.5f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 0.5f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13CFF_cp_0 = Main.gore[num626]; expr_13CFF_cp_0.velocity.X = expr_13CFF_cp_0.velocity.X - 1f; diff --git a/Projectiles/Rogue/MoltenBlobThrown.cs b/Projectiles/Rogue/MoltenBlobThrown.cs index d4395d83c4..dbc9172e20 100644 --- a/Projectiles/Rogue/MoltenBlobThrown.cs +++ b/Projectiles/Rogue/MoltenBlobThrown.cs @@ -76,8 +76,8 @@ namespace CalamityMod.Projectiles.Rogue projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 3; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); - if (Main.rand.Next(2) == 0) + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -85,9 +85,9 @@ namespace CalamityMod.Projectiles.Rogue } for (int num623 = 0; num623 < 5; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); } } } diff --git a/Projectiles/Rogue/Mycoroot.cs b/Projectiles/Rogue/Mycoroot.cs index bcd18006e2..833af2e073 100644 --- a/Projectiles/Rogue/Mycoroot.cs +++ b/Projectiles/Rogue/Mycoroot.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 56, 0f, 0f); } diff --git a/Projectiles/Rogue/MythrilKnifeProjectile.cs b/Projectiles/Rogue/MythrilKnifeProjectile.cs index 551cd54290..d8a4c64d16 100644 --- a/Projectiles/Rogue/MythrilKnifeProjectile.cs +++ b/Projectiles/Rogue/MythrilKnifeProjectile.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height, mod.ItemType("MythrilKnife")); } diff --git a/Projectiles/Rogue/OrichalcumSpikedGemstoneProjectile.cs b/Projectiles/Rogue/OrichalcumSpikedGemstoneProjectile.cs index 6a5448c264..549e799237 100644 --- a/Projectiles/Rogue/OrichalcumSpikedGemstoneProjectile.cs +++ b/Projectiles/Rogue/OrichalcumSpikedGemstoneProjectile.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height, mod.ItemType("OrichalcumSpikedGemstone")); } diff --git a/Projectiles/Rogue/PalladiumJavelinProjectile.cs b/Projectiles/Rogue/PalladiumJavelinProjectile.cs index e0170013f1..659d16d25a 100644 --- a/Projectiles/Rogue/PalladiumJavelinProjectile.cs +++ b/Projectiles/Rogue/PalladiumJavelinProjectile.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height, mod.ItemType("PalladiumJavelin")); } diff --git a/Projectiles/Rogue/ProfanedTrident.cs b/Projectiles/Rogue/ProfanedTrident.cs index 8454d0031d..888a749f21 100644 --- a/Projectiles/Rogue/ProfanedTrident.cs +++ b/Projectiles/Rogue/ProfanedTrident.cs @@ -81,9 +81,9 @@ namespace CalamityMod.Projectiles.Rogue projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 1.2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -91,10 +91,10 @@ namespace CalamityMod.Projectiles.Rogue } for (int num623 = 0; num623 < 30; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 1.7f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1.7f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 1f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Rogue/RotBallProjectile.cs b/Projectiles/Rogue/RotBallProjectile.cs index 8d288a1051..003aa3bf92 100644 --- a/Projectiles/Rogue/RotBallProjectile.cs +++ b/Projectiles/Rogue/RotBallProjectile.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height, mod.ItemType("RotBall")); } diff --git a/Projectiles/Rogue/RoyalKnife.cs b/Projectiles/Rogue/RoyalKnife.cs index 773df16978..42609f3844 100644 --- a/Projectiles/Rogue/RoyalKnife.cs +++ b/Projectiles/Rogue/RoyalKnife.cs @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f; projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f; } - if (Main.rand.Next(6) == 0) + if (Main.rand.NextBool(6)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 20, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } @@ -86,7 +86,7 @@ namespace CalamityMod.Projectiles.Rogue { for (int num303 = 0; num303 < 3; num303++) { - int num304 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 20, 0f, 0f, 100, default(Color), 0.8f); + int num304 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 20, 0f, 0f, 100, default, 0.8f); Main.dust[num304].noGravity = true; Main.dust[num304].velocity *= 1.2f; Main.dust[num304].velocity -= projectile.oldVelocity * 0.3f; diff --git a/Projectiles/Rogue/ScarletBlast.cs b/Projectiles/Rogue/ScarletBlast.cs index 51f11a9527..7a421f69cf 100644 --- a/Projectiles/Rogue/ScarletBlast.cs +++ b/Projectiles/Rogue/ScarletBlast.cs @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Rogue num466 = num465 / num466; num463 *= num466; num464 *= num466; - int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 130, 0f, 0f, 100, default(Color), 1.25f); + int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 130, 0f, 0f, 100, default, 1.25f); Main.dust[num467].noGravity = true; Main.dust[num467].position.X = projectile.Center.X; Main.dust[num467].position.Y = projectile.Center.Y; diff --git a/Projectiles/Rogue/ShatteredExplosion.cs b/Projectiles/Rogue/ShatteredExplosion.cs index dcf7e0a937..7954a5eaaa 100644 --- a/Projectiles/Rogue/ShatteredExplosion.cs +++ b/Projectiles/Rogue/ShatteredExplosion.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Rogue { for (int i = 0; i < 5; i++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default(Color), 1.5f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 1.5f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Rogue/ShatteredSun.cs b/Projectiles/Rogue/ShatteredSun.cs index 0d0a8121b2..2ff0e44f23 100644 --- a/Projectiles/Rogue/ShatteredSun.cs +++ b/Projectiles/Rogue/ShatteredSun.cs @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Rogue Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); for (int k = 0; k < 5; k++) { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 246, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f, 0, default(Color), 1f); + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 246, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f, 0, default, 1f); } } } diff --git a/Projectiles/Rogue/ShatteredSun2.cs b/Projectiles/Rogue/ShatteredSun2.cs index 6f099c2367..29707b916a 100644 --- a/Projectiles/Rogue/ShatteredSun2.cs +++ b/Projectiles/Rogue/ShatteredSun2.cs @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Rogue Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); for (int k = 0; k < 5; k++) { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 246, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f, 0, default(Color), 1f); + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 246, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f, 0, default, 1f); } } } diff --git a/Projectiles/Rogue/ShatteredSun3.cs b/Projectiles/Rogue/ShatteredSun3.cs index 59e99efa46..1000a2ad5c 100644 --- a/Projectiles/Rogue/ShatteredSun3.cs +++ b/Projectiles/Rogue/ShatteredSun3.cs @@ -91,7 +91,7 @@ namespace CalamityMod.Projectiles.Rogue { for (int k = 0; k < 5; k++) { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 246, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f, 0, default(Color), 1f); + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 246, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f, 0, default, 1f); } } } diff --git a/Projectiles/Rogue/SpearofPaleolith.cs b/Projectiles/Rogue/SpearofPaleolith.cs index 7e34540d45..5fe9098d7c 100644 --- a/Projectiles/Rogue/SpearofPaleolith.cs +++ b/Projectiles/Rogue/SpearofPaleolith.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { shardRainTimer--; - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 159, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Rogue/TarragonThrowingDartProjectile.cs b/Projectiles/Rogue/TarragonThrowingDartProjectile.cs index dab1321a01..f572bec3b4 100644 --- a/Projectiles/Rogue/TarragonThrowingDartProjectile.cs +++ b/Projectiles/Rogue/TarragonThrowingDartProjectile.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 2.355f; - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 75, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height, mod.ItemType("TarragonThrowingDart")); } diff --git a/Projectiles/Rogue/TitaniumShurikenProjectile.cs b/Projectiles/Rogue/TitaniumShurikenProjectile.cs index 07e784c559..33a3cbc39b 100644 --- a/Projectiles/Rogue/TitaniumShurikenProjectile.cs +++ b/Projectiles/Rogue/TitaniumShurikenProjectile.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height, mod.ItemType("TitaniumShuriken")); } diff --git a/Projectiles/Rogue/ToothBallProjectile.cs b/Projectiles/Rogue/ToothBallProjectile.cs index 02942189da..26b4b1fee5 100644 --- a/Projectiles/Rogue/ToothBallProjectile.cs +++ b/Projectiles/Rogue/ToothBallProjectile.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height, mod.ItemType("ToothBall")); } diff --git a/Projectiles/Rogue/TriactisOPHammer.cs b/Projectiles/Rogue/TriactisOPHammer.cs index 8df0fce6cb..13b71067e8 100644 --- a/Projectiles/Rogue/TriactisOPHammer.cs +++ b/Projectiles/Rogue/TriactisOPHammer.cs @@ -126,9 +126,9 @@ namespace CalamityMod.Projectiles.Rogue projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.Next(2) == 0 ? 89 : 229, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -136,10 +136,10 @@ namespace CalamityMod.Projectiles.Rogue } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.Next(2) == 0 ? 89 : 229, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.Next(2) == 0 ? 89 : 229, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Rogue/UrchinStinger.cs b/Projectiles/Rogue/UrchinStinger.cs index 0a8cc2ce5d..fa74aee6dc 100644 --- a/Projectiles/Rogue/UrchinStinger.cs +++ b/Projectiles/Rogue/UrchinStinger.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height, mod.ItemType("UrchinStinger")); } diff --git a/Projectiles/Rogue/Valediction.cs b/Projectiles/Rogue/Valediction.cs index 941cd02b36..145ee9f235 100644 --- a/Projectiles/Rogue/Valediction.cs +++ b/Projectiles/Rogue/Valediction.cs @@ -164,9 +164,9 @@ namespace CalamityMod.Projectiles.Rogue projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -174,10 +174,10 @@ namespace CalamityMod.Projectiles.Rogue } for (int num623 = 0; num623 < 8; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Rogue/Valediction2.cs b/Projectiles/Rogue/Valediction2.cs index de4d06f8a5..2a7452244f 100644 --- a/Projectiles/Rogue/Valediction2.cs +++ b/Projectiles/Rogue/Valediction2.cs @@ -189,9 +189,9 @@ namespace CalamityMod.Projectiles.Rogue projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -199,10 +199,10 @@ namespace CalamityMod.Projectiles.Rogue } for (int num623 = 0; num623 < 8; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Rogue/WulfrumKnife.cs b/Projectiles/Rogue/WulfrumKnife.cs index 839b107bbc..410a7b0a03 100644 --- a/Projectiles/Rogue/WulfrumKnife.cs +++ b/Projectiles/Rogue/WulfrumKnife.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height, mod.ItemType("WulfrumKnife")); } diff --git a/Projectiles/Rogue/XerocPitchforkProjectile.cs b/Projectiles/Rogue/XerocPitchforkProjectile.cs index 19f8dba6fa..d06420366f 100644 --- a/Projectiles/Rogue/XerocPitchforkProjectile.cs +++ b/Projectiles/Rogue/XerocPitchforkProjectile.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 2.355f; - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 58, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Item.NewItem((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height, mod.ItemType("XerocPitchfork")); } diff --git a/Projectiles/Shrines/LuxorsGiftMagic.cs b/Projectiles/Shrines/LuxorsGiftMagic.cs index 5ccb2f230c..ee046f095e 100644 --- a/Projectiles/Shrines/LuxorsGiftMagic.cs +++ b/Projectiles/Shrines/LuxorsGiftMagic.cs @@ -58,9 +58,9 @@ namespace CalamityMod.Projectiles.Shrines for (int l = 0; l < 12; l++) { Vector2 vector3 = Vector2.UnitX * (float)(-(float)projectile.width) / 2f; - vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default(Vector2)) * new Vector2(8f, 16f); - vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default(Vector2)); - int num9 = Dust.NewDust(projectile.Center, 0, 0, 244, 0f, 0f, 160, default(Color), 1f); + vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default) * new Vector2(8f, 16f); + vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default); + int num9 = Dust.NewDust(projectile.Center, 0, 0, 244, 0f, 0f, 160, default, 1f); Main.dust[num9].scale = 1.1f; Main.dust[num9].noGravity = true; Main.dust[num9].position = projectile.Center + vector3; diff --git a/Projectiles/Shrines/LuxorsGiftMelee.cs b/Projectiles/Shrines/LuxorsGiftMelee.cs index ae9872816f..f156079a09 100644 --- a/Projectiles/Shrines/LuxorsGiftMelee.cs +++ b/Projectiles/Shrines/LuxorsGiftMelee.cs @@ -56,9 +56,9 @@ namespace CalamityMod.Projectiles.Shrines for (int l = 0; l < 12; l++) { Vector2 vector3 = Vector2.UnitX * (float)(-(float)projectile.width) / 2f; - vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default(Vector2)) * new Vector2(8f, 16f); - vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default(Vector2)); - int num9 = Dust.NewDust(projectile.Center, 0, 0, 235, 0f, 0f, 160, default(Color), 1f); + vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default) * new Vector2(8f, 16f); + vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default); + int num9 = Dust.NewDust(projectile.Center, 0, 0, 235, 0f, 0f, 160, default, 1f); Main.dust[num9].scale = 1.1f; Main.dust[num9].noGravity = true; Main.dust[num9].position = projectile.Center + vector3; @@ -85,9 +85,9 @@ namespace CalamityMod.Projectiles.Shrines for (int l = 0; l < 12; l++) { Vector2 vector3 = Vector2.UnitX * (float)(-(float)projectile.width) / 2f; - vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default(Vector2)) * new Vector2(8f, 16f); - vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default(Vector2)); - int num9 = Dust.NewDust(projectile.Center, 0, 0, 235, 0f, 0f, 160, default(Color), 1f); + vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default) * new Vector2(8f, 16f); + vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default); + int num9 = Dust.NewDust(projectile.Center, 0, 0, 235, 0f, 0f, 160, default, 1f); Main.dust[num9].scale = 1.1f; Main.dust[num9].noGravity = true; Main.dust[num9].position = projectile.Center + vector3; diff --git a/Projectiles/Shrines/LuxorsGiftRanged.cs b/Projectiles/Shrines/LuxorsGiftRanged.cs index 67fd9841d2..56a79bcc93 100644 --- a/Projectiles/Shrines/LuxorsGiftRanged.cs +++ b/Projectiles/Shrines/LuxorsGiftRanged.cs @@ -67,9 +67,9 @@ namespace CalamityMod.Projectiles.Shrines for (int l = 0; l < 12; l++) { Vector2 vector3 = Vector2.UnitX * (float)(-(float)projectile.width) / 2f; - vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default(Vector2)) * new Vector2(8f, 16f); - vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default(Vector2)); - int num9 = Dust.NewDust(projectile.Center, 0, 0, 135, 0f, 0f, 160, default(Color), 1f); + vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default) * new Vector2(8f, 16f); + vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default); + int num9 = Dust.NewDust(projectile.Center, 0, 0, 135, 0f, 0f, 160, default, 1f); Main.dust[num9].scale = 1.1f; Main.dust[num9].noGravity = true; Main.dust[num9].position = projectile.Center + vector3; @@ -89,7 +89,7 @@ namespace CalamityMod.Projectiles.Shrines int num212 = Main.rand.Next(10, 20); for (int num213 = 0; num213 < num212; num213++) { - int num214 = Dust.NewDust(projectile.Center - projectile.velocity / 2f, 0, 0, 135, 0f, 0f, 100, default(Color), 2f); + int num214 = Dust.NewDust(projectile.Center - projectile.velocity / 2f, 0, 0, 135, 0f, 0f, 100, default, 2f); Main.dust[num214].velocity *= 2f; Main.dust[num214].noGravity = true; } diff --git a/Projectiles/Shrines/LuxorsGiftRogue.cs b/Projectiles/Shrines/LuxorsGiftRogue.cs index 63d3950152..f390f35e48 100644 --- a/Projectiles/Shrines/LuxorsGiftRogue.cs +++ b/Projectiles/Shrines/LuxorsGiftRogue.cs @@ -60,9 +60,9 @@ namespace CalamityMod.Projectiles.Shrines for (int l = 0; l < 12; l++) { Vector2 vector3 = Vector2.UnitX * (float)(-(float)projectile.width) / 2f; - vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default(Vector2)) * new Vector2(8f, 16f); - vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default(Vector2)); - int num9 = Dust.NewDust(projectile.Center, 0, 0, 173, 0f, 0f, 160, default(Color), 1f); + vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default) * new Vector2(8f, 16f); + vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default); + int num9 = Dust.NewDust(projectile.Center, 0, 0, 173, 0f, 0f, 160, default, 1f); Main.dust[num9].scale = 1.1f; Main.dust[num9].noGravity = true; Main.dust[num9].position = projectile.Center + vector3; diff --git a/Projectiles/Shrines/LuxorsGiftSummon.cs b/Projectiles/Shrines/LuxorsGiftSummon.cs index 319554d822..7bf4f224cd 100644 --- a/Projectiles/Shrines/LuxorsGiftSummon.cs +++ b/Projectiles/Shrines/LuxorsGiftSummon.cs @@ -47,9 +47,9 @@ namespace CalamityMod.Projectiles.Shrines for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 107, vector7.X * 1.75f, vector7.Y * 1.75f, 100, default(Color), 1.1f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 107, vector7.X * 1.75f, vector7.Y * 1.75f, 100, default, 1.1f); Main.dust[num228].noGravity = true; Main.dust[num228].velocity = vector7; } diff --git a/Projectiles/Shrines/UnstableSpark.cs b/Projectiles/Shrines/UnstableSpark.cs index c97b97cc5d..714265c780 100644 --- a/Projectiles/Shrines/UnstableSpark.cs +++ b/Projectiles/Shrines/UnstableSpark.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Shrines projectile.velocity.Y = projectile.velocity.Y + 0.2f; } projectile.rotation += projectile.velocity.X * 0.1f; - int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 206, 0f, 0f, 100, default(Color), 0.5f); + int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 206, 0f, 0f, 100, default, 0.5f); Dust expr_8976_cp_0 = Main.dust[num199]; expr_8976_cp_0.position.X = expr_8976_cp_0.position.X - 2f; Dust expr_8994_cp_0 = Main.dust[num199]; @@ -61,9 +61,9 @@ namespace CalamityMod.Projectiles.Shrines Main.dust[num199].noGravity = true; Dust expr_89E7_cp_0 = Main.dust[num199]; expr_89E7_cp_0.velocity.Y = expr_89E7_cp_0.velocity.Y - 2f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { - int num200 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 206, 0f, 0f, 100, default(Color), 0.5f); + int num200 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 206, 0f, 0f, 100, default, 0.5f); Dust expr_8A4E_cp_0 = Main.dust[num200]; expr_8A4E_cp_0.position.X = expr_8A4E_cp_0.position.X - 2f; Dust expr_8A6C_cp_0 = Main.dust[num200]; diff --git a/Projectiles/Summon/AngryChicken.cs b/Projectiles/Summon/AngryChicken.cs index e8a3f03417..8b4092ed0d 100644 --- a/Projectiles/Summon/AngryChicken.cs +++ b/Projectiles/Summon/AngryChicken.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Summon int num501 = 100; for (int num502 = 0; num502 < num501; num502++) { - int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 244, 0f, 0f, 0, default(Color), 1f); + int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 244, 0f, 0f, 0, default, 1f); Main.dust[num503].velocity *= 2f; Main.dust[num503].scale *= 1.15f; } diff --git a/Projectiles/Summon/AquaticStar.cs b/Projectiles/Summon/AquaticStar.cs index fb0623a659..493f39541c 100644 --- a/Projectiles/Summon/AquaticStar.cs +++ b/Projectiles/Summon/AquaticStar.cs @@ -44,9 +44,9 @@ namespace CalamityMod.Projectiles.Summon for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 33, vector7.X * 1.1f, vector7.Y * 1.1f, 100, default(Color), 1.4f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 33, vector7.X * 1.1f, vector7.Y * 1.1f, 100, default, 1.4f); Main.dust[num228].noGravity = true; Main.dust[num228].noLight = true; Main.dust[num228].velocity = vector7; diff --git a/Projectiles/Summon/BigBustyRose.cs b/Projectiles/Summon/BigBustyRose.cs index bc7bc9c137..6acbf4518d 100644 --- a/Projectiles/Summon/BigBustyRose.cs +++ b/Projectiles/Summon/BigBustyRose.cs @@ -70,7 +70,7 @@ namespace CalamityMod.Projectiles.Summon int num501 = 50; for (int num502 = 0; num502 < num501; num502++) { - int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 235, 0f, 0f, 0, default(Color), 1f); + int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 235, 0f, 0f, 0, default, 1f); Main.dust[num503].velocity *= 2f; Main.dust[num503].scale *= 1.15f; } diff --git a/Projectiles/Summon/BloodClotMinion.cs b/Projectiles/Summon/BloodClotMinion.cs index 58ca8ca6ad..0034c088dd 100644 --- a/Projectiles/Summon/BloodClotMinion.cs +++ b/Projectiles/Summon/BloodClotMinion.cs @@ -43,9 +43,9 @@ namespace CalamityMod.Projectiles.Summon for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 5, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default(Color), 1.4f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 5, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default, 1.4f); Main.dust[num228].noGravity = true; Main.dust[num228].noLight = true; Main.dust[num228].velocity = vector7; @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Summon Main.player[projectile.owner].minionDamage); projectile.damage = damage2; } - int num1262 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 5, 0f, 0f, 0, default(Color), 1f); + int num1262 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 5, 0f, 0f, 0, default, 1f); Main.dust[num1262].velocity *= 0.1f; Main.dust[num1262].scale = 0.7f; Main.dust[num1262].noGravity = true; diff --git a/Projectiles/Summon/BrimstoneFireSummon.cs b/Projectiles/Summon/BrimstoneFireSummon.cs index 98c3a90d46..bc6f01ec11 100644 --- a/Projectiles/Summon/BrimstoneFireSummon.cs +++ b/Projectiles/Summon/BrimstoneFireSummon.cs @@ -44,12 +44,12 @@ namespace CalamityMod.Projectiles.Summon } projectile.ai[0] += 1f; int num297 = 235; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { for (int num298 = 0; num298 < 1; num298++) { - int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1f); - if (Main.rand.Next(3) == 0) + int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); + if (Main.rand.NextBool(3)) { Main.dust[num299].noGravity = true; Main.dust[num299].scale *= 3f; diff --git a/Projectiles/Summon/BrittleStar.cs b/Projectiles/Summon/BrittleStar.cs index 47d1d6e726..5067578a7e 100644 --- a/Projectiles/Summon/BrittleStar.cs +++ b/Projectiles/Summon/BrittleStar.cs @@ -44,9 +44,9 @@ namespace CalamityMod.Projectiles.Summon for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 33, vector7.X * 1.1f, vector7.Y * 1.1f, 100, default(Color), 1.4f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 33, vector7.X * 1.1f, vector7.Y * 1.1f, 100, default, 1.4f); Main.dust[num228].noGravity = true; Main.dust[num228].noLight = true; Main.dust[num228].velocity = vector7; diff --git a/Projectiles/Summon/Calamari.cs b/Projectiles/Summon/Calamari.cs index 99cf7da786..058dc57784 100644 --- a/Projectiles/Summon/Calamari.cs +++ b/Projectiles/Summon/Calamari.cs @@ -45,9 +45,9 @@ namespace CalamityMod.Projectiles.Summon for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 109, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default(Color), 1.4f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 109, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default, 1.4f); Main.dust[num228].noGravity = true; Main.dust[num228].noLight = true; Main.dust[num228].velocity = vector7; @@ -86,7 +86,7 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft = 2; } } - if (Main.rand.Next(600) == 0) + if (Main.rand.NextBool(600)) { Main.PlaySound(29, (int)projectile.position.X, (int)projectile.position.Y, 35); } @@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Summon if (projectile.ai[1] > 3f) { Main.PlaySound(29, (int)projectile.position.X, (int)projectile.position.Y, 34); - int num = Dust.NewDust(projectile.Center, 0, 0, 109, projectile.velocity.X, projectile.velocity.Y, 100, default(Color), 1.4f); + int num = Dust.NewDust(projectile.Center, 0, 0, 109, projectile.velocity.X, projectile.velocity.Y, 100, default, 1.4f); Main.dust[num].scale = 0.5f + (float)Main.rand.NextDouble() * 0.3f; Main.dust[num].velocity /= 2.5f; Main.dust[num].noGravity = true; diff --git a/Projectiles/Summon/CalamariInk.cs b/Projectiles/Summon/CalamariInk.cs index c3ea15f990..e3a8806bc2 100644 --- a/Projectiles/Summon/CalamariInk.cs +++ b/Projectiles/Summon/CalamariInk.cs @@ -100,9 +100,9 @@ namespace CalamityMod.Projectiles.Summon projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 54, 0f, 0f, 100, default(Color), 1f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 54, 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -110,10 +110,10 @@ namespace CalamityMod.Projectiles.Summon } for (int num623 = 0; num623 < 15; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 109, 0f, 0f, 100, default(Color), 1.5f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 109, 0f, 0f, 100, default, 1.5f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 109, 0f, 0f, 100, default(Color), 1f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 109, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Summon/Calamitamini.cs b/Projectiles/Summon/Calamitamini.cs index 6784c76274..b4563d5aac 100644 --- a/Projectiles/Summon/Calamitamini.cs +++ b/Projectiles/Summon/Calamitamini.cs @@ -43,9 +43,9 @@ namespace CalamityMod.Projectiles.Summon for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 235, vector7.X * 1.75f, vector7.Y * 1.75f, 100, default(Color), 1.1f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 235, vector7.X * 1.75f, vector7.Y * 1.75f, 100, default, 1.1f); Main.dust[num228].noGravity = true; Main.dust[num228].velocity = vector7; } diff --git a/Projectiles/Summon/Cataclymini.cs b/Projectiles/Summon/Cataclymini.cs index 09e92bd17c..11aed55756 100644 --- a/Projectiles/Summon/Cataclymini.cs +++ b/Projectiles/Summon/Cataclymini.cs @@ -43,9 +43,9 @@ namespace CalamityMod.Projectiles.Summon for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 235, vector7.X * 1.75f, vector7.Y * 1.75f, 100, default(Color), 1.1f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 235, vector7.X * 1.75f, vector7.Y * 1.75f, 100, default, 1.1f); Main.dust[num228].noGravity = true; Main.dust[num228].velocity = vector7; } diff --git a/Projectiles/Summon/Catastromini.cs b/Projectiles/Summon/Catastromini.cs index 9ade9f2806..5e36d7f423 100644 --- a/Projectiles/Summon/Catastromini.cs +++ b/Projectiles/Summon/Catastromini.cs @@ -43,9 +43,9 @@ namespace CalamityMod.Projectiles.Summon for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 235, vector7.X * 1.75f, vector7.Y * 1.75f, 100, default(Color), 1.1f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 235, vector7.X * 1.75f, vector7.Y * 1.75f, 100, default, 1.1f); Main.dust[num228].noGravity = true; Main.dust[num228].velocity = vector7; } diff --git a/Projectiles/Summon/ChaosFlame.cs b/Projectiles/Summon/ChaosFlame.cs index 52cf5c9725..d50c2f1abb 100644 --- a/Projectiles/Summon/ChaosFlame.cs +++ b/Projectiles/Summon/ChaosFlame.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Summon } for (int num457 = 0; num457 < 5; num457++) { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default(Color), 1.2f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, 1.2f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; diff --git a/Projectiles/Summon/ChaosSpirit.cs b/Projectiles/Summon/ChaosSpirit.cs index 11103c753c..5a04fd2249 100644 --- a/Projectiles/Summon/ChaosSpirit.cs +++ b/Projectiles/Summon/ChaosSpirit.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Summon int num501 = 50; for (int num502 = 0; num502 < num501; num502++) { - int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 127, 0f, 0f, 0, default(Color), 1f); + int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 127, 0f, 0f, 0, default, 1f); Main.dust[num503].velocity *= 2f; Main.dust[num503].scale *= 1.15f; } diff --git a/Projectiles/Summon/CloudyWaifu.cs b/Projectiles/Summon/CloudyWaifu.cs index 1bdae45ff2..ee69ec0818 100644 --- a/Projectiles/Summon/CloudyWaifu.cs +++ b/Projectiles/Summon/CloudyWaifu.cs @@ -70,7 +70,7 @@ namespace CalamityMod.Projectiles.Summon int num501 = 50; for (int num502 = 0; num502 < num501; num502++) { - int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 16, 0f, 0f, 0, default(Color), 1f); + int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 16, 0f, 0f, 0, default, 1f); Main.dust[num503].velocity *= 2f; Main.dust[num503].scale *= 1.15f; } diff --git a/Projectiles/Summon/Corroslime.cs b/Projectiles/Summon/Corroslime.cs index 42324d9b6e..0e853f6f0d 100644 --- a/Projectiles/Summon/Corroslime.cs +++ b/Projectiles/Summon/Corroslime.cs @@ -54,9 +54,9 @@ namespace CalamityMod.Projectiles.Summon for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 14, vector7.X * 1f, vector7.Y * 1f, 100, default(Color), 1.1f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 14, vector7.X * 1f, vector7.Y * 1f, 100, default, 1.1f); Main.dust[num228].noGravity = true; Main.dust[num228].noLight = true; Main.dust[num228].velocity = vector7; diff --git a/Projectiles/Summon/CosmicBlast.cs b/Projectiles/Summon/CosmicBlast.cs index 7c30c7a2ad..8af5e398c7 100644 --- a/Projectiles/Summon/CosmicBlast.cs +++ b/Projectiles/Summon/CosmicBlast.cs @@ -41,9 +41,9 @@ namespace CalamityMod.Projectiles.Summon { projectile.frame = 0; } - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { - Vector2 value3 = Vector2.UnitX.RotatedByRandom(1.5707963705062866).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)); + Vector2 value3 = Vector2.UnitX.RotatedByRandom(1.5707963705062866).RotatedBy((double)projectile.velocity.ToRotation(), default); int num59 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 66, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1.2f); Main.dust[num59].noGravity = true; Main.dust[num59].velocity = value3 * 0.66f; diff --git a/Projectiles/Summon/CosmicBlastBig.cs b/Projectiles/Summon/CosmicBlastBig.cs index c52e094ed8..c84bb44ba2 100644 --- a/Projectiles/Summon/CosmicBlastBig.cs +++ b/Projectiles/Summon/CosmicBlastBig.cs @@ -31,21 +31,21 @@ namespace CalamityMod.Projectiles.Summon if (projectile.soundDelay == 0) { projectile.soundDelay = 20 + Main.rand.Next(40); - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9); } } projectile.rotation += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.01f * (float)projectile.direction; - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { - Vector2 value3 = Vector2.UnitX.RotatedByRandom(1.5707963705062866).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)); + Vector2 value3 = Vector2.UnitX.RotatedByRandom(1.5707963705062866).RotatedBy((double)projectile.velocity.ToRotation(), default); int num59 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 66, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1.2f); Main.dust[num59].noGravity = true; Main.dust[num59].velocity = value3 * 0.66f; Main.dust[num59].position = projectile.Center + value3 * 12f; } - if (Main.rand.Next(24) == 0) + if (Main.rand.NextBool(24)) { int num60 = Gore.NewGore(projectile.Center, new Vector2(projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f), 16, 1f); Main.gore[num60].velocity *= 0.66f; @@ -53,12 +53,12 @@ namespace CalamityMod.Projectiles.Summon } if (projectile.ai[1] == 1f) { - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { int num59 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 66, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1.2f); Main.dust[num59].noGravity = true; } - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { Gore.NewGore(projectile.position, new Vector2(projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f), Main.rand.Next(16, 18), 1f); } diff --git a/Projectiles/Summon/Cosmilamp.cs b/Projectiles/Summon/Cosmilamp.cs index 13b0afcbab..cb4a796466 100644 --- a/Projectiles/Summon/Cosmilamp.cs +++ b/Projectiles/Summon/Cosmilamp.cs @@ -43,9 +43,9 @@ namespace CalamityMod.Projectiles.Summon for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 204, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default(Color), 1.4f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 204, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default, 1.4f); Main.dust[num228].noGravity = true; Main.dust[num228].noLight = true; Main.dust[num228].velocity = vector7; @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Summon float num395 = (float)Main.mouseTextColor / 200f - 0.35f; num395 *= 0.2f; projectile.scale = num395 + 0.95f; - int num1262 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 204, 0f, 0f, 0, default(Color), 1f); + int num1262 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 204, 0f, 0f, 0, default, 1f); Main.dust[num1262].velocity *= 0.1f; Main.dust[num1262].scale = 0.7f; Main.dust[num1262].noGravity = true; diff --git a/Projectiles/Summon/Crimslime.cs b/Projectiles/Summon/Crimslime.cs index 8be9a6d8fa..a109da9cff 100644 --- a/Projectiles/Summon/Crimslime.cs +++ b/Projectiles/Summon/Crimslime.cs @@ -54,9 +54,9 @@ namespace CalamityMod.Projectiles.Summon for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 5, vector7.X * 1f, vector7.Y * 1f, 100, default(Color), 1.1f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 5, vector7.X * 1f, vector7.Y * 1f, 100, default, 1.1f); Main.dust[num228].noGravity = true; Main.dust[num228].noLight = true; Main.dust[num228].velocity = vector7; diff --git a/Projectiles/Summon/DaedalusCrystal.cs b/Projectiles/Summon/DaedalusCrystal.cs index 451151c1e1..d9156eb460 100644 --- a/Projectiles/Summon/DaedalusCrystal.cs +++ b/Projectiles/Summon/DaedalusCrystal.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Summon int num501 = 50; for (int num502 = 0; num502 < num501; num502++) { - int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 173, 0f, 0f, 0, default(Color), 1f); + int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 173, 0f, 0f, 0, default, 1f); Main.dust[num503].velocity *= 2f; Main.dust[num503].scale *= 1.15f; } diff --git a/Projectiles/Summon/DaedalusCrystalShot.cs b/Projectiles/Summon/DaedalusCrystalShot.cs index c4c8f8af80..a340cb00ba 100644 --- a/Projectiles/Summon/DaedalusCrystalShot.cs +++ b/Projectiles/Summon/DaedalusCrystalShot.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Summon } for (int num457 = 0; num457 < 5; num457++) { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 1.2f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1.2f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; @@ -45,9 +45,9 @@ namespace CalamityMod.Projectiles.Summon Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 74); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 1.2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -55,10 +55,10 @@ namespace CalamityMod.Projectiles.Summon } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 1.7f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1.7f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 1f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Summon/DankCreeper.cs b/Projectiles/Summon/DankCreeper.cs index 3ceb0ce452..3ce489cba6 100644 --- a/Projectiles/Summon/DankCreeper.cs +++ b/Projectiles/Summon/DankCreeper.cs @@ -46,9 +46,9 @@ namespace CalamityMod.Projectiles.Summon for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 14, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default(Color), 1.4f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 14, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default, 1.4f); Main.dust[num228].noGravity = true; Main.dust[num228].noLight = true; Main.dust[num228].velocity = vector7; diff --git a/Projectiles/Summon/Dreadmine.cs b/Projectiles/Summon/Dreadmine.cs index 066da62e7b..b59e69780f 100644 --- a/Projectiles/Summon/Dreadmine.cs +++ b/Projectiles/Summon/Dreadmine.cs @@ -162,9 +162,9 @@ namespace CalamityMod.Projectiles.Summon projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -172,10 +172,10 @@ namespace CalamityMod.Projectiles.Summon } for (int num623 = 0; num623 < 30; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } for (int num625 = 0; num625 < 3; num625++) @@ -189,25 +189,25 @@ namespace CalamityMod.Projectiles.Summon { scaleFactor10 = 1f; } - int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13AB6_cp_0 = Main.gore[num626]; expr_13AB6_cp_0.velocity.X = expr_13AB6_cp_0.velocity.X + 1f; Gore expr_13AD6_cp_0 = Main.gore[num626]; expr_13AD6_cp_0.velocity.Y = expr_13AD6_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13B79_cp_0 = Main.gore[num626]; expr_13B79_cp_0.velocity.X = expr_13B79_cp_0.velocity.X - 1f; Gore expr_13B99_cp_0 = Main.gore[num626]; expr_13B99_cp_0.velocity.Y = expr_13B99_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13C3C_cp_0 = Main.gore[num626]; expr_13C3C_cp_0.velocity.X = expr_13C3C_cp_0.velocity.X + 1f; Gore expr_13C5C_cp_0 = Main.gore[num626]; expr_13C5C_cp_0.velocity.Y = expr_13C5C_cp_0.velocity.Y - 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13CFF_cp_0 = Main.gore[num626]; expr_13CFF_cp_0.velocity.X = expr_13CFF_cp_0.velocity.X - 1f; diff --git a/Projectiles/Summon/DreadmineTurret.cs b/Projectiles/Summon/DreadmineTurret.cs index 32547be494..138b725212 100644 --- a/Projectiles/Summon/DreadmineTurret.cs +++ b/Projectiles/Summon/DreadmineTurret.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Summon projectile.ai[0] = 0f; projectile.netUpdate = true; } - if (Main.rand.Next(15) == 0) + if (Main.rand.NextBool(15)) { int num = 0; for (int i = 0; i < 1000; i++) @@ -89,7 +89,7 @@ namespace CalamityMod.Projectiles.Summon int num6 = (int)center.X / 16; int num7 = (int)center.Y / 16; bool flag = false; - if (Main.rand.Next(3) == 0 && Main.tile[num6, num7] != null && Main.tile[num6, num7].wall > 0) + if (Main.rand.NextBool(3) && Main.tile[num6, num7] != null && Main.tile[num6, num7].wall > 0) { flag = true; } diff --git a/Projectiles/Summon/DrewsSandyWaifu.cs b/Projectiles/Summon/DrewsSandyWaifu.cs index 0668f2f62c..71c7942d6a 100644 --- a/Projectiles/Summon/DrewsSandyWaifu.cs +++ b/Projectiles/Summon/DrewsSandyWaifu.cs @@ -70,7 +70,7 @@ namespace CalamityMod.Projectiles.Summon int num501 = 50; for (int num502 = 0; num502 < num501; num502++) { - int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 32, 0f, 0f, 0, default(Color), 1f); + int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 32, 0f, 0f, 0, default, 1f); Main.dust[num503].velocity *= 2f; Main.dust[num503].scale *= 1.15f; } @@ -205,7 +205,7 @@ namespace CalamityMod.Projectiles.Summon for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 107, vector7.X * 1.5f, vector7.Y * 1.5f, 100, new Color(0, 200, 0), 1f); Main.dust[num228].noGravity = true; diff --git a/Projectiles/Summon/FlameBlast.cs b/Projectiles/Summon/FlameBlast.cs index 4f3271a5fd..6fc9eaaf3e 100644 --- a/Projectiles/Summon/FlameBlast.cs +++ b/Projectiles/Summon/FlameBlast.cs @@ -39,9 +39,9 @@ namespace CalamityMod.Projectiles.Summon projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -49,10 +49,10 @@ namespace CalamityMod.Projectiles.Summon } for (int num623 = 0; num623 < 20; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } count += 1f; @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Summon { for (int num468 = 0; num468 < 5; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 0.75f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 0.75f); Main.dust[num469].velocity *= 0f; } } diff --git a/Projectiles/Summon/FlameBurst.cs b/Projectiles/Summon/FlameBurst.cs index c680aad103..aca1bd05e9 100644 --- a/Projectiles/Summon/FlameBurst.cs +++ b/Projectiles/Summon/FlameBurst.cs @@ -39,9 +39,9 @@ namespace CalamityMod.Projectiles.Summon projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -49,10 +49,10 @@ namespace CalamityMod.Projectiles.Summon } for (int num623 = 0; num623 < 20; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } count += 1f; @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Summon { for (int num468 = 0; num468 < 5; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default(Color), 0.75f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 0.75f); Main.dust[num469].velocity *= 0f; } } diff --git a/Projectiles/Summon/FrostMistFriendly.cs b/Projectiles/Summon/FrostMistFriendly.cs index e50709167f..63fcb46065 100644 --- a/Projectiles/Summon/FrostMistFriendly.cs +++ b/Projectiles/Summon/FrostMistFriendly.cs @@ -43,9 +43,9 @@ namespace CalamityMod.Projectiles.Summon { for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 187, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 187, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/Summon/FungalClump.cs b/Projectiles/Summon/FungalClump.cs index e45199c3b6..de2bfc0015 100644 --- a/Projectiles/Summon/FungalClump.cs +++ b/Projectiles/Summon/FungalClump.cs @@ -62,9 +62,9 @@ namespace CalamityMod.Projectiles.Summon for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 56, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default(Color), 1.4f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 56, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default, 1.4f); Main.dust[num228].noGravity = true; Main.dust[num228].noLight = true; Main.dust[num228].velocity = vector7; @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Summon Main.player[projectile.owner].minionDamage); projectile.damage = damage2; } - if (Main.rand.Next(16) == 0) + if (Main.rand.NextBool(16)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 56, projectile.velocity.X * 0.05f, projectile.velocity.Y * 0.05f); } diff --git a/Projectiles/Summon/GhostFire.cs b/Projectiles/Summon/GhostFire.cs index 5d7de3300b..1c5d667afc 100644 --- a/Projectiles/Summon/GhostFire.cs +++ b/Projectiles/Summon/GhostFire.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Summon Vector2 vector33 = projectile.position; vector33 -= projectile.velocity * 0.25f; projectile.alpha = 255; - int num448 = Dust.NewDust(vector33, 1, 1, 180, 0f, 0f, 0, default(Color), 0.2f); + int num448 = Dust.NewDust(vector33, 1, 1, 180, 0f, 0f, 0, default, 0.2f); Main.dust[num448].position = vector33; Main.dust[num448].noGravity = true; Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f; diff --git a/Projectiles/Summon/GhostlyMine.cs b/Projectiles/Summon/GhostlyMine.cs index f2d0e7d66c..b462f19bc7 100644 --- a/Projectiles/Summon/GhostlyMine.cs +++ b/Projectiles/Summon/GhostlyMine.cs @@ -60,9 +60,9 @@ namespace CalamityMod.Projectiles.Summon { for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 180, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 180, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -70,10 +70,10 @@ namespace CalamityMod.Projectiles.Summon } for (int num623 = 0; num623 < 15; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 180, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 180, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 180, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 180, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } spawnDust = false; @@ -102,9 +102,9 @@ namespace CalamityMod.Projectiles.Summon projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 30; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 180, 0f, 0f, 100, default(Color), 1.2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 180, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -112,10 +112,10 @@ namespace CalamityMod.Projectiles.Summon } for (int num623 = 0; num623 < 60; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 180, 0f, 0f, 100, default(Color), 1.7f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 180, 0f, 0f, 100, default, 1.7f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 180, 0f, 0f, 100, default(Color), 1f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 180, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Summon/GigaFlareFriendly.cs b/Projectiles/Summon/GigaFlareFriendly.cs index c504b7c10e..b75c941c27 100644 --- a/Projectiles/Summon/GigaFlareFriendly.cs +++ b/Projectiles/Summon/GigaFlareFriendly.cs @@ -111,9 +111,9 @@ namespace CalamityMod.Projectiles.Summon projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -121,10 +121,10 @@ namespace CalamityMod.Projectiles.Summon } for (int num623 = 0; num623 < 35; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } for (int num625 = 0; num625 < 3; num625++) @@ -138,25 +138,25 @@ namespace CalamityMod.Projectiles.Summon { scaleFactor10 = 1f; } - int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13AB6_cp_0 = Main.gore[num626]; expr_13AB6_cp_0.velocity.X = expr_13AB6_cp_0.velocity.X + 1f; Gore expr_13AD6_cp_0 = Main.gore[num626]; expr_13AD6_cp_0.velocity.Y = expr_13AD6_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13B79_cp_0 = Main.gore[num626]; expr_13B79_cp_0.velocity.X = expr_13B79_cp_0.velocity.X - 1f; Gore expr_13B99_cp_0 = Main.gore[num626]; expr_13B99_cp_0.velocity.Y = expr_13B99_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13C3C_cp_0 = Main.gore[num626]; expr_13C3C_cp_0.velocity.X = expr_13C3C_cp_0.velocity.X + 1f; Gore expr_13C5C_cp_0 = Main.gore[num626]; expr_13C5C_cp_0.velocity.Y = expr_13C5C_cp_0.velocity.Y - 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13CFF_cp_0 = Main.gore[num626]; expr_13CFF_cp_0.velocity.X = expr_13CFF_cp_0.velocity.X - 1f; diff --git a/Projectiles/Summon/Herring.cs b/Projectiles/Summon/Herring.cs index 9ca904571f..78569f099f 100644 --- a/Projectiles/Summon/Herring.cs +++ b/Projectiles/Summon/Herring.cs @@ -45,9 +45,9 @@ namespace CalamityMod.Projectiles.Summon for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 33, vector7.X * 1.75f, vector7.Y * 1.75f, 100, default(Color), 1.1f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 33, vector7.X * 1.75f, vector7.Y * 1.75f, 100, default, 1.1f); Main.dust[num228].noGravity = true; Main.dust[num228].velocity = vector7; } diff --git a/Projectiles/Summon/IceClasper.cs b/Projectiles/Summon/IceClasper.cs index 55fd6803b6..2b3fc8c264 100644 --- a/Projectiles/Summon/IceClasper.cs +++ b/Projectiles/Summon/IceClasper.cs @@ -45,9 +45,9 @@ namespace CalamityMod.Projectiles.Summon for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 67, vector7.X * 1.75f, vector7.Y * 1.75f, 100, default(Color), 1.1f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 67, vector7.X * 1.75f, vector7.Y * 1.75f, 100, default, 1.1f); Main.dust[num228].noGravity = true; Main.dust[num228].velocity = vector7; } diff --git a/Projectiles/Summon/MechwormBody.cs b/Projectiles/Summon/MechwormBody.cs index 744ed2bd86..0a86fc2a38 100644 --- a/Projectiles/Summon/MechwormBody.cs +++ b/Projectiles/Summon/MechwormBody.cs @@ -101,7 +101,7 @@ namespace CalamityMod.Projectiles.Summon if (num1064 != projectile.rotation) { float num1068 = MathHelper.WrapAngle(num1064 - projectile.rotation); - vector134 = vector134.RotatedBy((double)(num1068 * 0.1f), default(Vector2)); + vector134 = vector134.RotatedBy((double)(num1068 * 0.1f), default); } projectile.rotation = vector134.ToRotation() + 1.57079637f; projectile.position = projectile.Center; diff --git a/Projectiles/Summon/MechwormBody2.cs b/Projectiles/Summon/MechwormBody2.cs index d147c4d423..bf1f8303f7 100644 --- a/Projectiles/Summon/MechwormBody2.cs +++ b/Projectiles/Summon/MechwormBody2.cs @@ -100,7 +100,7 @@ namespace CalamityMod.Projectiles.Summon if (num1064 != projectile.rotation) { float num1068 = MathHelper.WrapAngle(num1064 - projectile.rotation); - vector134 = vector134.RotatedBy((double)(num1068 * 0.1f), default(Vector2)); + vector134 = vector134.RotatedBy((double)(num1068 * 0.1f), default); } projectile.rotation = vector134.ToRotation() + 1.57079637f; projectile.position = projectile.Center; diff --git a/Projectiles/Summon/MechwormHead.cs b/Projectiles/Summon/MechwormHead.cs index 74864588e0..553ef3ce34 100644 --- a/Projectiles/Summon/MechwormHead.cs +++ b/Projectiles/Summon/MechwormHead.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Summon int num501 = 50; for (int num502 = 0; num502 < num501; num502++) { - int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 234, 0f, 0f, 0, default(Color), 1f); + int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 234, 0f, 0f, 0, default, 1f); Main.dust[num503].velocity *= 2f; Main.dust[num503].scale *= 1.15f; } diff --git a/Projectiles/Summon/MechwormTail.cs b/Projectiles/Summon/MechwormTail.cs index 64cac47916..6636888ed3 100644 --- a/Projectiles/Summon/MechwormTail.cs +++ b/Projectiles/Summon/MechwormTail.cs @@ -101,7 +101,7 @@ namespace CalamityMod.Projectiles.Summon if (num1064 != projectile.rotation) { float num1068 = MathHelper.WrapAngle(num1064 - projectile.rotation); - vector134 = vector134.RotatedBy((double)(num1068 * 0.1f), default(Vector2)); + vector134 = vector134.RotatedBy((double)(num1068 * 0.1f), default); } projectile.rotation = vector134.ToRotation() + 1.57079637f; projectile.position = projectile.Center; diff --git a/Projectiles/Summon/MiniSandShark.cs b/Projectiles/Summon/MiniSandShark.cs index 911723f01c..a68a2e151b 100644 --- a/Projectiles/Summon/MiniSandShark.cs +++ b/Projectiles/Summon/MiniSandShark.cs @@ -75,9 +75,9 @@ namespace CalamityMod.Projectiles.Summon for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 85, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default(Color), 1.2f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 85, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default, 1.2f); Main.dust[num228].noGravity = true; Main.dust[num228].noLight = true; Main.dust[num228].velocity = vector7; diff --git a/Projectiles/Summon/PhantomGuy.cs b/Projectiles/Summon/PhantomGuy.cs index 62b2427e83..1c894ffc88 100644 --- a/Projectiles/Summon/PhantomGuy.cs +++ b/Projectiles/Summon/PhantomGuy.cs @@ -41,9 +41,9 @@ namespace CalamityMod.Projectiles.Summon for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 180, vector7.X * 1.75f, vector7.Y * 1.75f, 100, default(Color), 1.1f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 180, vector7.X * 1.75f, vector7.Y * 1.75f, 100, default, 1.1f); Main.dust[num228].noGravity = true; Main.dust[num228].velocity = vector7; } diff --git a/Projectiles/Summon/PhoenixFireFriendly.cs b/Projectiles/Summon/PhoenixFireFriendly.cs index 880370a2fa..c8916abae2 100644 --- a/Projectiles/Summon/PhoenixFireFriendly.cs +++ b/Projectiles/Summon/PhoenixFireFriendly.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Summon { for (int num468 = 0; num468 < 5; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 1f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Summon/ProfanedEnergy.cs b/Projectiles/Summon/ProfanedEnergy.cs index e5affa7a9f..0bf9790671 100644 --- a/Projectiles/Summon/ProfanedEnergy.cs +++ b/Projectiles/Summon/ProfanedEnergy.cs @@ -47,9 +47,9 @@ namespace CalamityMod.Projectiles.Summon Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.Center.X, projectile.Center.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.Center.X, projectile.Center.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -57,10 +57,10 @@ namespace CalamityMod.Projectiles.Summon } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.Center.X, projectile.Center.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.Center.X, projectile.Center.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.Center.X, projectile.Center.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.Center.X, projectile.Center.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } count += 1f; diff --git a/Projectiles/Summon/ReaverOrb.cs b/Projectiles/Summon/ReaverOrb.cs index c77f20680b..4c0aa79dfd 100644 --- a/Projectiles/Summon/ReaverOrb.cs +++ b/Projectiles/Summon/ReaverOrb.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Summon int num501 = 50; for (int num502 = 0; num502 < num501; num502++) { - int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 157, 0f, 0f, 0, default(Color), 1f); + int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 157, 0f, 0f, 0, default, 1f); Main.dust[num503].velocity *= 2f; Main.dust[num503].scale *= 1.15f; } diff --git a/Projectiles/Summon/RedDevil.cs b/Projectiles/Summon/RedDevil.cs index dbe654d626..eff64f3c94 100644 --- a/Projectiles/Summon/RedDevil.cs +++ b/Projectiles/Summon/RedDevil.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Summon int num501 = 50; for (int num502 = 0; num502 < num501; num502++) { - int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 235, 0f, 0f, 0, default(Color), 1f); + int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 235, 0f, 0f, 0, default, 1f); Main.dust[num503].velocity *= 2f; Main.dust[num503].scale *= 1.15f; } diff --git a/Projectiles/Summon/SandMark.cs b/Projectiles/Summon/SandMark.cs index 53a1639d22..2b75f9a468 100644 --- a/Projectiles/Summon/SandMark.cs +++ b/Projectiles/Summon/SandMark.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Summon value81.X *= -1f; Vector2 value82 = new Vector2(2f, 10f); Vector2 position4 = projectile.Center + new Vector2(60f, 200f) * value81 * 0.5f + value82; - Dust dust34 = Main.dust[Dust.NewDust(position4, 0, 0, 269, 0f, 0f, 0, default(Color), 0.5f)]; + Dust dust34 = Main.dust[Dust.NewDust(position4, 0, 0, 269, 0f, 0f, 0, default, 0.5f)]; dust34.position = position4; dust34.customData = projectile.Center + value82; dust34.fadeIn = 1f; @@ -99,9 +99,9 @@ namespace CalamityMod.Projectiles.Summon } for (int num1135 = 0; num1135 < 2; num1135++) { - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { - Vector2 value83 = Vector2.UnitY.RotatedBy((double)((float)num1135 * 3.14159274f), default(Vector2)).RotatedBy((double)projectile.rotation, default(Vector2)); + Vector2 value83 = Vector2.UnitY.RotatedBy((double)((float)num1135 * 3.14159274f), default).RotatedBy((double)projectile.rotation, default); Dust dust35 = Main.dust[Dust.NewDust(projectile.Center, 0, 0, 269, 0f, 0f, 225, newColor3, 1f)]; dust35.noGravity = true; dust35.noLight = true; @@ -112,9 +112,9 @@ namespace CalamityMod.Projectiles.Summon } for (int num1136 = 0; num1136 < 2; num1136++) { - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { - Vector2 value84 = Vector2.UnitY.RotatedBy((double)((float)num1136 * 3.14159274f), default(Vector2)); + Vector2 value84 = Vector2.UnitY.RotatedBy((double)((float)num1136 * 3.14159274f), default); Dust dust36 = Main.dust[Dust.NewDust(projectile.Center, 0, 0, 269, 0f, 0f, 225, newColor3, 1.5f)]; dust36.noGravity = true; dust36.noLight = true; diff --git a/Projectiles/Summon/SandTornado.cs b/Projectiles/Summon/SandTornado.cs index 87ed4215c4..98869d3739 100644 --- a/Projectiles/Summon/SandTornado.cs +++ b/Projectiles/Summon/SandTornado.cs @@ -124,7 +124,7 @@ namespace CalamityMod.Projectiles.Summon Microsoft.Xna.Framework.Rectangle rectangle9 = texture2D23.Frame(1, 1, 0, 0); Vector2 origin3 = rectangle9.Size() / 2f; float num233 = -0.06283186f * num229; - Vector2 spinningpoint2 = Vector2.UnitY.RotatedBy((double)(num229 * 0.1f), default(Vector2)); + Vector2 spinningpoint2 = Vector2.UnitY.RotatedBy((double)(num229 * 0.1f), default); float num234 = 0f; float num235 = 5.1f; Microsoft.Xna.Framework.Color value34 = new Microsoft.Xna.Framework.Color(225, 225, 100); @@ -134,7 +134,7 @@ namespace CalamityMod.Projectiles.Summon float num237 = num234 / vector33.Y; float num238 = num234 * 6.28318548f / -20f; float num239 = num237 - 0.15f; - Vector2 vector34 = spinningpoint2.RotatedBy((double)num238, default(Vector2)); + Vector2 vector34 = spinningpoint2.RotatedBy((double)num238, default); Vector2 value35 = new Vector2(0f, num237 + 1f); value35.X = value35.Y * num232; Microsoft.Xna.Framework.Color color39 = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.Transparent, value34, num237 * 2f); diff --git a/Projectiles/Summon/Sandnado.cs b/Projectiles/Summon/Sandnado.cs index cd55382236..8e1e641698 100644 --- a/Projectiles/Summon/Sandnado.cs +++ b/Projectiles/Summon/Sandnado.cs @@ -45,9 +45,9 @@ namespace CalamityMod.Projectiles.Summon for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 85, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default(Color), 1.4f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 85, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default, 1.4f); Main.dust[num228].noGravity = true; Main.dust[num228].noLight = true; Main.dust[num228].velocity = vector7; @@ -244,9 +244,9 @@ namespace CalamityMod.Projectiles.Summon projectile.frameCounter = 0; } projectile.frame = projectile.frameCounter / num25; - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { - int num26 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 85, 0f, 0f, 100, default(Color), 2f); + int num26 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 85, 0f, 0f, 100, default, 2f); Main.dust[num26].velocity *= 0.3f; Main.dust[num26].noGravity = true; Main.dust[num26].noLight = true; diff --git a/Projectiles/Summon/SandyWaifu.cs b/Projectiles/Summon/SandyWaifu.cs index 87adbabc03..f7b34d3e15 100644 --- a/Projectiles/Summon/SandyWaifu.cs +++ b/Projectiles/Summon/SandyWaifu.cs @@ -70,7 +70,7 @@ namespace CalamityMod.Projectiles.Summon int num501 = 50; for (int num502 = 0; num502 < num501; num502++) { - int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 32, 0f, 0f, 0, default(Color), 1f); + int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 32, 0f, 0f, 0, default, 1f); Main.dust[num503].velocity *= 2f; Main.dust[num503].scale *= 1.15f; } diff --git a/Projectiles/Summon/SilvaCrystal.cs b/Projectiles/Summon/SilvaCrystal.cs index 340d53f1b8..f87b8aa5c4 100644 --- a/Projectiles/Summon/SilvaCrystal.cs +++ b/Projectiles/Summon/SilvaCrystal.cs @@ -91,7 +91,7 @@ namespace CalamityMod.Projectiles.Summon { projectile.direction = Main.player[projectile.owner].direction; } - if (projectile.alpha == 0 && Main.rand.Next(15) == 0) + if (projectile.alpha == 0 && Main.rand.NextBool(15)) { Dust dust34 = Main.dust[Dust.NewDust(projectile.Top, 0, 0, 267, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1f)]; dust34.velocity.X = 0f; @@ -225,7 +225,7 @@ namespace CalamityMod.Projectiles.Summon Vector2 arg_F8CE_0 = vector59; Vector2 arg_F8BE_0 = Vector2.UnitY; double arg_F8BE_1 = (double)(num286 * 1.57079637f); - Vector2 center = default(Vector2); + Vector2 center = default; arg_F907_0.Draw(arg_F907_1, arg_F8CE_0 + arg_F8BE_0.RotatedBy(arg_F8BE_1, center) * scaleFactor5, new Microsoft.Xna.Framework.Rectangle?(rectangle17), alpha5 * 0.2f, projectile.rotation, origin11, projectile.scale, SpriteEffects.None, 0f); } return false; diff --git a/Projectiles/Summon/SilvaCrystalExplosion.cs b/Projectiles/Summon/SilvaCrystalExplosion.cs index bedaa3bd1e..acfbbcbf1f 100644 --- a/Projectiles/Summon/SilvaCrystalExplosion.cs +++ b/Projectiles/Summon/SilvaCrystalExplosion.cs @@ -57,9 +57,9 @@ namespace CalamityMod.Projectiles.Summon int num3; for (int num979 = 0; num979 < 2; num979 = num3 + 1) { - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { - Vector2 value55 = Vector2.UnitY.RotatedBy((double)((float)num979 * 3.14159274f), default(Vector2)).RotatedBy((double)projectile.rotation, default(Vector2)); + Vector2 value55 = Vector2.UnitY.RotatedBy((double)((float)num979 * 3.14159274f), default).RotatedBy((double)projectile.rotation, default); Dust dust24 = Main.dust[Dust.NewDust(projectile.Center, 0, 0, 267, 0f, 0f, 225, newColor2, 1.5f)]; dust24.noGravity = true; dust24.noLight = true; @@ -71,9 +71,9 @@ namespace CalamityMod.Projectiles.Summon } for (int num980 = 0; num980 < 2; num980 = num3 + 1) { - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { - Vector2 value56 = Vector2.UnitY.RotatedBy((double)((float)num980 * 3.14159274f), default(Vector2)); + Vector2 value56 = Vector2.UnitY.RotatedBy((double)((float)num980 * 3.14159274f), default); Dust dust25 = Main.dust[Dust.NewDust(projectile.Center, 0, 0, 267, 0f, 0f, 225, newColor2, 1.5f)]; dust25.noGravity = true; dust25.noLight = true; @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Summon } num3 = num980; } - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { float scaleFactor13 = 1f + Main.rand.NextFloat() * 2f; float fadeIn = 1f + Main.rand.NextFloat(); @@ -171,7 +171,7 @@ namespace CalamityMod.Projectiles.Summon { int num71 = Dust.NewDust(projectile.Center, 0, 0, 267, 0f, 0f, 0, newColor, 1f); Main.dust[num71].position = projectile.Center; - Main.dust[num71].velocity = spinningpoint.RotatedBy((double)(6.28318548f * num70 / num69), default(Vector2)) * value5 * (0.8f + Main.rand.NextFloat() * 0.4f); + Main.dust[num71].velocity = spinningpoint.RotatedBy((double)(6.28318548f * num70 / num69), default) * value5 * (0.8f + Main.rand.NextFloat() * 0.4f); Main.dust[num71].noGravity = true; Main.dust[num71].scale = 2f; Main.dust[num71].fadeIn = Main.rand.NextFloat() * 2f; @@ -187,7 +187,7 @@ namespace CalamityMod.Projectiles.Summon { int num74 = Dust.NewDust(projectile.Center, 0, 0, 267, 0f, 0f, 0, newColor, 1f); Main.dust[num74].position = projectile.Center; - Main.dust[num74].velocity = spinningpoint.RotatedBy((double)(6.28318548f * num73 / num69), default(Vector2)) * value5 * (0.8f + Main.rand.NextFloat() * 0.4f); + Main.dust[num74].velocity = spinningpoint.RotatedBy((double)(6.28318548f * num73 / num69), default) * value5 * (0.8f + Main.rand.NextFloat() * 0.4f); Dust dust = Main.dust[num74]; dust.velocity *= Main.rand.NextFloat() * 0.8f; Main.dust[num74].noGravity = true; diff --git a/Projectiles/Summon/SirenLure.cs b/Projectiles/Summon/SirenLure.cs index 64291240d0..e660a7af95 100644 --- a/Projectiles/Summon/SirenLure.cs +++ b/Projectiles/Summon/SirenLure.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Summon int num501 = 50; for (int num502 = 0; num502 < num501; num502++) { - int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 33, 0f, 0f, 0, default(Color), 1f); + int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 33, 0f, 0f, 0, default, 1f); Main.dust[num503].velocity *= 2f; Main.dust[num503].scale *= 1.15f; } @@ -161,11 +161,11 @@ namespace CalamityMod.Projectiles.Summon projectile.spriteDirection = -1; } int projectileType = mod.ProjectileType("WaterSpearFriendly"); - if (Main.rand.Next(9) == 0) + if (Main.rand.NextBool(9)) { projectileType = mod.ProjectileType("FrostMistFriendly"); } - else if (Main.rand.Next(9) == 0) + else if (Main.rand.NextBool(9)) { projectileType = mod.ProjectileType("SirenSongFriendly"); } diff --git a/Projectiles/Summon/SlimeGod.cs b/Projectiles/Summon/SlimeGod.cs index 90275fa760..8ded49ecca 100644 --- a/Projectiles/Summon/SlimeGod.cs +++ b/Projectiles/Summon/SlimeGod.cs @@ -53,9 +53,9 @@ namespace CalamityMod.Projectiles.Summon for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 173, vector7.X * 1f, vector7.Y * 1f, 100, default(Color), 1.1f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 173, vector7.X * 1f, vector7.Y * 1f, 100, default, 1.1f); Main.dust[num228].noGravity = true; Main.dust[num228].noLight = true; Main.dust[num228].velocity = vector7; diff --git a/Projectiles/Summon/SlimeGodAlt.cs b/Projectiles/Summon/SlimeGodAlt.cs index 485e0dbef3..eed0bf34d0 100644 --- a/Projectiles/Summon/SlimeGodAlt.cs +++ b/Projectiles/Summon/SlimeGodAlt.cs @@ -53,9 +53,9 @@ namespace CalamityMod.Projectiles.Summon for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 5, vector7.X * 1f, vector7.Y * 1f, 100, default(Color), 1.1f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 5, vector7.X * 1f, vector7.Y * 1f, 100, default, 1.1f); Main.dust[num228].noGravity = true; Main.dust[num228].noLight = true; Main.dust[num228].velocity = vector7; diff --git a/Projectiles/Summon/SolarBeam.cs b/Projectiles/Summon/SolarBeam.cs index 4ff44b15af..2504bea378 100644 --- a/Projectiles/Summon/SolarBeam.cs +++ b/Projectiles/Summon/SolarBeam.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Summon Vector2 vector33 = projectile.position; vector33 -= projectile.velocity * ((float)num447 * 0.25f); projectile.alpha = 255; - int num448 = Dust.NewDust(vector33, 1, 1, 246, 0f, 0f, 0, default(Color), 1f); + int num448 = Dust.NewDust(vector33, 1, 1, 246, 0f, 0f, 0, default, 1f); Main.dust[num448].position = vector33; Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f; Main.dust[num448].velocity *= 0.2f; diff --git a/Projectiles/Summon/SolarGod.cs b/Projectiles/Summon/SolarGod.cs index 309edaedc7..101d655a52 100644 --- a/Projectiles/Summon/SolarGod.cs +++ b/Projectiles/Summon/SolarGod.cs @@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.Summon int num501 = 50; for (int num502 = 0; num502 < num501; num502++) { - int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 244, 0f, 0f, 0, default(Color), 1f); + int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 244, 0f, 0f, 0, default, 1f); Main.dust[num503].velocity *= 2f; Main.dust[num503].scale *= 1.15f; } diff --git a/Projectiles/Summon/SolarPixie.cs b/Projectiles/Summon/SolarPixie.cs index 953cfbce1b..f1c395fe51 100644 --- a/Projectiles/Summon/SolarPixie.cs +++ b/Projectiles/Summon/SolarPixie.cs @@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.Summon int num501 = 25; for (int num502 = 0; num502 < num501; num502++) { - int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 244, 0f, 0f, 0, default(Color), 1f); + int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 244, 0f, 0f, 0, default, 1f); Main.dust[num503].velocity *= 2f; Main.dust[num503].scale *= 1.15f; } diff --git a/Projectiles/Summon/StormMarkSummon.cs b/Projectiles/Summon/StormMarkSummon.cs index df56132f7c..7be16732f8 100644 --- a/Projectiles/Summon/StormMarkSummon.cs +++ b/Projectiles/Summon/StormMarkSummon.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Summon value81.X *= -1f; Vector2 value82 = new Vector2(2f, 10f); Vector2 position4 = projectile.Center + new Vector2(60f, 200f) * value81 * 0.5f + value82; - Dust dust34 = Main.dust[Dust.NewDust(position4, 0, 0, 16, 0f, 0f, 0, default(Color), 0.5f)]; + Dust dust34 = Main.dust[Dust.NewDust(position4, 0, 0, 16, 0f, 0f, 0, default, 0.5f)]; dust34.position = position4; dust34.customData = projectile.Center + value82; dust34.fadeIn = 1f; @@ -98,9 +98,9 @@ namespace CalamityMod.Projectiles.Summon } for (int num1135 = 0; num1135 < 2; num1135++) { - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { - Vector2 value83 = Vector2.UnitY.RotatedBy((double)((float)num1135 * 3.14159274f), default(Vector2)).RotatedBy((double)projectile.rotation, default(Vector2)); + Vector2 value83 = Vector2.UnitY.RotatedBy((double)((float)num1135 * 3.14159274f), default).RotatedBy((double)projectile.rotation, default); Dust dust35 = Main.dust[Dust.NewDust(projectile.Center, 0, 0, 16, 0f, 0f, 225, newColor3, 1f)]; dust35.noGravity = true; dust35.noLight = true; @@ -111,9 +111,9 @@ namespace CalamityMod.Projectiles.Summon } for (int num1136 = 0; num1136 < 2; num1136++) { - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { - Vector2 value84 = Vector2.UnitY.RotatedBy((double)((float)num1136 * 3.14159274f), default(Vector2)); + Vector2 value84 = Vector2.UnitY.RotatedBy((double)((float)num1136 * 3.14159274f), default); Dust dust36 = Main.dust[Dust.NewDust(projectile.Center, 0, 0, 16, 0f, 0f, 225, newColor3, 1.5f)]; dust36.noGravity = true; dust36.noLight = true; diff --git a/Projectiles/Summon/Urchin.cs b/Projectiles/Summon/Urchin.cs index e69fc30247..93e0c78930 100644 --- a/Projectiles/Summon/Urchin.cs +++ b/Projectiles/Summon/Urchin.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Summon int num501 = 50; for (int num502 = 0; num502 < num501; num502++) { - int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 179, 0f, 0f, 0, default(Color), 1f); + int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 179, 0f, 0f, 0, default, 1f); Main.dust[num503].velocity *= 2f; Main.dust[num503].scale *= 1.15f; } diff --git a/Projectiles/Summon/Valkyrie.cs b/Projectiles/Summon/Valkyrie.cs index 8ab1eb3477..abb16fab1b 100644 --- a/Projectiles/Summon/Valkyrie.cs +++ b/Projectiles/Summon/Valkyrie.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Summon int num501 = 30; for (int num502 = 0; num502 < num501; num502++) { - int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 59, 0f, 0f, 0, default(Color), 1f); + int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 59, 0f, 0f, 0, default, 1f); Main.dust[num503].velocity *= 2f; Main.dust[num503].scale *= 1.15f; } diff --git a/Projectiles/Summon/WaterSpearFriendly.cs b/Projectiles/Summon/WaterSpearFriendly.cs index a88b4da624..99f813c164 100644 --- a/Projectiles/Summon/WaterSpearFriendly.cs +++ b/Projectiles/Summon/WaterSpearFriendly.cs @@ -34,9 +34,9 @@ namespace CalamityMod.Projectiles.Summon { for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; diff --git a/Projectiles/SunkenSea/AquamarineBolt.cs b/Projectiles/SunkenSea/AquamarineBolt.cs index 82767902c1..b7e9348cce 100644 --- a/Projectiles/SunkenSea/AquamarineBolt.cs +++ b/Projectiles/SunkenSea/AquamarineBolt.cs @@ -28,15 +28,15 @@ namespace CalamityMod.Projectiles.SunkenSea for (int num151 = 0; num151 < 3; num151++) { int num154 = 14; - int num155 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num154 * 2, projectile.height - num154 * 2, 68, 0f, 0f, 100, default(Color), 1.5f); + int num155 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num154 * 2, projectile.height - num154 * 2, 68, 0f, 0f, 100, default, 1.5f); Main.dust[num155].noGravity = true; Main.dust[num155].velocity *= 0.1f; Main.dust[num155].velocity += projectile.velocity * 0.5f; } - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { int num156 = 16; - int num157 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num156 * 2, projectile.height - num156 * 2, 68, 0f, 0f, 100, default(Color), 1f); + int num157 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num156 * 2, projectile.height - num156 * 2, 68, 0f, 0f, 100, default, 1f); Main.dust[num157].velocity *= 0.25f; Main.dust[num157].velocity += projectile.velocity * 0.5f; } diff --git a/Projectiles/SunkenSea/ClamorRifleProj.cs b/Projectiles/SunkenSea/ClamorRifleProj.cs index e22a501be8..35584359c3 100644 --- a/Projectiles/SunkenSea/ClamorRifleProj.cs +++ b/Projectiles/SunkenSea/ClamorRifleProj.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.SunkenSea for (int num151 = 0; num151 < 3; num151++) { int num154 = 14; - int num155 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num154 * 2, projectile.height - num154 * 2, 68, 0f, 0f, 100, default(Color), 1f); + int num155 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num154 * 2, projectile.height - num154 * 2, 68, 0f, 0f, 100, default, 1f); Main.dust[num155].noGravity = true; Main.dust[num155].velocity *= 0.1f; Main.dust[num155].velocity += projectile.velocity * 0.5f; diff --git a/Projectiles/SunkenSea/ClamorRifleProjSplit.cs b/Projectiles/SunkenSea/ClamorRifleProjSplit.cs index 65a580aee8..8d4501c432 100644 --- a/Projectiles/SunkenSea/ClamorRifleProjSplit.cs +++ b/Projectiles/SunkenSea/ClamorRifleProjSplit.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.SunkenSea for (int num151 = 0; num151 < 3; num151++) { int num154 = 14; - int num155 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num154 * 2, projectile.height - num154 * 2, 68, 0f, 0f, 100, default(Color), 1f); + int num155 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num154 * 2, projectile.height - num154 * 2, 68, 0f, 0f, 100, default, 1f); Main.dust[num155].noGravity = true; Main.dust[num155].velocity *= 0.1f; Main.dust[num155].velocity += projectile.velocity * 0.5f; diff --git a/Projectiles/SunkenSea/CoralBubble.cs b/Projectiles/SunkenSea/CoralBubble.cs index ee77014c3d..9a50c7b27d 100644 --- a/Projectiles/SunkenSea/CoralBubble.cs +++ b/Projectiles/SunkenSea/CoralBubble.cs @@ -86,7 +86,7 @@ namespace CalamityMod.Projectiles.SunkenSea int num190 = Main.rand.Next(5, 9); for (int num191 = 0; num191 < num190; num191++) { - int num192 = Dust.NewDust(projectile.Center, 0, 0, 206, 0f, 0f, 100, default(Color), 1.4f); + int num192 = Dust.NewDust(projectile.Center, 0, 0, 206, 0f, 0f, 100, default, 1.4f); Main.dust[num192].velocity *= 0.8f; Main.dust[num192].position = Vector2.Lerp(Main.dust[num192].position, projectile.Center, 0.5f); Main.dust[num192].noGravity = true; diff --git a/Projectiles/SunkenSea/CoralBubbleSmall.cs b/Projectiles/SunkenSea/CoralBubbleSmall.cs index 1fbc3c0f4e..b0d03a7d83 100644 --- a/Projectiles/SunkenSea/CoralBubbleSmall.cs +++ b/Projectiles/SunkenSea/CoralBubbleSmall.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.SunkenSea int num190 = Main.rand.Next(5, 9); for (int num191 = 0; num191 < num190; num191++) { - int num192 = Dust.NewDust(projectile.Center, 0, 0, 206, 0f, 0f, 100, default(Color), 1.4f); + int num192 = Dust.NewDust(projectile.Center, 0, 0, 206, 0f, 0f, 100, default, 1.4f); Main.dust[num192].velocity *= 0.8f; Main.dust[num192].position = Vector2.Lerp(Main.dust[num192].position, projectile.Center, 0.5f); Main.dust[num192].noGravity = true; diff --git a/Projectiles/SunkenSea/EutrophicScimitarProj.cs b/Projectiles/SunkenSea/EutrophicScimitarProj.cs index 5e39620284..a936e90f37 100644 --- a/Projectiles/SunkenSea/EutrophicScimitarProj.cs +++ b/Projectiles/SunkenSea/EutrophicScimitarProj.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.SunkenSea { projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X); } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 226, projectile.velocity.X * 0.25f, projectile.velocity.Y * 0.25f, 0, new Color(255, 255, 255), 0.5f); } diff --git a/Projectiles/SunkenSea/EutrophicSpark.cs b/Projectiles/SunkenSea/EutrophicSpark.cs index fa39d3b031..2ba2da1515 100644 --- a/Projectiles/SunkenSea/EutrophicSpark.cs +++ b/Projectiles/SunkenSea/EutrophicSpark.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.SunkenSea projectile.velocity.Y = projectile.velocity.Y + 0.2f; } projectile.rotation += projectile.velocity.X * 0.1f; - int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 206, 0f, 0f, 100, default(Color), 1f); + int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 206, 0f, 0f, 100, default, 1f); Dust expr_8976_cp_0 = Main.dust[num199]; expr_8976_cp_0.position.X = expr_8976_cp_0.position.X - 2f; Dust expr_8994_cp_0 = Main.dust[num199]; @@ -62,9 +62,9 @@ namespace CalamityMod.Projectiles.SunkenSea Main.dust[num199].noGravity = true; Dust expr_89E7_cp_0 = Main.dust[num199]; expr_89E7_cp_0.velocity.Y = expr_89E7_cp_0.velocity.Y - 2f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { - int num200 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 206, 0f, 0f, 100, default(Color), 1f); + int num200 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 206, 0f, 0f, 100, default, 1f); Dust expr_8A4E_cp_0 = Main.dust[num200]; expr_8A4E_cp_0.position.X = expr_8A4E_cp_0.position.X - 2f; Dust expr_8A6C_cp_0 = Main.dust[num200]; diff --git a/Projectiles/SunkenSea/PearlBurst.cs b/Projectiles/SunkenSea/PearlBurst.cs index cbc552c19c..20f5e87305 100644 --- a/Projectiles/SunkenSea/PearlBurst.cs +++ b/Projectiles/SunkenSea/PearlBurst.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.SunkenSea public override void AI() { Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0f) / 255f, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0.5f) / 255f); - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 92, projectile.velocity.X * 0.25f, projectile.velocity.Y * 0.25f, 0, new Color(255, 255, 255), 0.7f); } @@ -66,9 +66,9 @@ namespace CalamityMod.Projectiles.SunkenSea for (int l = 0; l < 12; l++) { Vector2 vector3 = Vector2.UnitX * (float)(-(float)projectile.width) / 2f; - vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default(Vector2)) * new Vector2(8f, 16f); - vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default(Vector2)); - int num9 = Dust.NewDust(projectile.Center, 0, 0, 92, 0f, 0f, 160, default(Color), 1f); + vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default) * new Vector2(8f, 16f); + vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default); + int num9 = Dust.NewDust(projectile.Center, 0, 0, 92, 0f, 0f, 160, default, 1f); Main.dust[num9].scale = 1.1f; Main.dust[num9].noGravity = true; Main.dust[num9].position = projectile.Center + vector3; diff --git a/Projectiles/SunkenSea/PearlRain.cs b/Projectiles/SunkenSea/PearlRain.cs index b58042d6f6..ccf8e197f4 100644 --- a/Projectiles/SunkenSea/PearlRain.cs +++ b/Projectiles/SunkenSea/PearlRain.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.SunkenSea public override void AI() { Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0f) / 255f, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0.5f) / 255f); - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 92, projectile.velocity.X * 0.25f, projectile.velocity.Y * 0.25f, 0, new Color(255, 255, 255), 0.7f); } diff --git a/Projectiles/SunkenSea/PendantProjectile1.cs b/Projectiles/SunkenSea/PendantProjectile1.cs index b2d0c41136..606831233e 100644 --- a/Projectiles/SunkenSea/PendantProjectile1.cs +++ b/Projectiles/SunkenSea/PendantProjectile1.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.SunkenSea projectile.rotation += projectile.velocity.X * 1.25f; for (int num457 = 0; num457 < 5; num457++) { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 187, 0f, 0f, 100, default(Color), 0.6f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 187, 0f, 0f, 100, default, 0.6f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; diff --git a/Projectiles/SunkenSea/PendantProjectile2.cs b/Projectiles/SunkenSea/PendantProjectile2.cs index 56c1e54bd3..4d441dfa79 100644 --- a/Projectiles/SunkenSea/PendantProjectile2.cs +++ b/Projectiles/SunkenSea/PendantProjectile2.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.SunkenSea projectile.rotation += projectile.velocity.X * 1.25f; for (int num457 = 0; num457 < 5; num457++) { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 187, 0f, 0f, 100, default(Color), 0.6f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 187, 0f, 0f, 100, default, 0.6f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; diff --git a/Projectiles/SunkenSea/PendantProjectile3.cs b/Projectiles/SunkenSea/PendantProjectile3.cs index 538af7a52b..f3c783f416 100644 --- a/Projectiles/SunkenSea/PendantProjectile3.cs +++ b/Projectiles/SunkenSea/PendantProjectile3.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.SunkenSea projectile.rotation += projectile.velocity.X * 1.25f; for (int num457 = 0; num457 < 5; num457++) { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 187, 0f, 0f, 100, default(Color), 0.6f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 187, 0f, 0f, 100, default, 0.6f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; diff --git a/Projectiles/SunkenSea/SeafoamBomb.cs b/Projectiles/SunkenSea/SeafoamBomb.cs index 4da3ae582b..ee7202e1fa 100644 --- a/Projectiles/SunkenSea/SeafoamBomb.cs +++ b/Projectiles/SunkenSea/SeafoamBomb.cs @@ -43,19 +43,19 @@ namespace CalamityMod.Projectiles.SunkenSea { scaleFactor10 = 1f; } - int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13AB6_cp_0 = Main.gore[num626]; expr_13AB6_cp_0.velocity.X = expr_13AB6_cp_0.velocity.X + 1f; Gore expr_13AD6_cp_0 = Main.gore[num626]; expr_13AD6_cp_0.velocity.Y = expr_13AD6_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13B79_cp_0 = Main.gore[num626]; expr_13B79_cp_0.velocity.X = expr_13B79_cp_0.velocity.X - 1f; Gore expr_13B99_cp_0 = Main.gore[num626]; expr_13B99_cp_0.velocity.Y = expr_13B99_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13C3C_cp_0 = Main.gore[num626]; expr_13C3C_cp_0.velocity.X = expr_13C3C_cp_0.velocity.X + 1f; diff --git a/Projectiles/SunkenSea/SeafoamBubble.cs b/Projectiles/SunkenSea/SeafoamBubble.cs index 0cfe1523c9..61cf1a3b7d 100644 --- a/Projectiles/SunkenSea/SeafoamBubble.cs +++ b/Projectiles/SunkenSea/SeafoamBubble.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.SunkenSea int num3; for (int num246 = 0; num246 < 25; num246 = num3 + 1) { - int num247 = Dust.NewDust(projectile.Center, projectile.width, projectile.height, 154, 0f, 0f, 0, default(Color), 1f); + int num247 = Dust.NewDust(projectile.Center, projectile.width, projectile.height, 154, 0f, 0f, 0, default, 1f); Main.dust[num247].position = (Main.dust[num247].position + projectile.position) / 2f; Main.dust[num247].velocity = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); Main.dust[num247].velocity.Normalize(); diff --git a/Projectiles/SunkenSea/SeashineSwordProj.cs b/Projectiles/SunkenSea/SeashineSwordProj.cs index a3ddfd74ba..b90ee35b4b 100644 --- a/Projectiles/SunkenSea/SeashineSwordProj.cs +++ b/Projectiles/SunkenSea/SeashineSwordProj.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.SunkenSea public override void AI() { Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0f) / 255f, ((255 - projectile.alpha) * 0.25f) / 255f, ((255 - projectile.alpha) * 0.25f) / 255f); - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 187, projectile.velocity.X * 0.25f, projectile.velocity.Y * 0.25f, 0, new Color(255, 255, 255), 1.2f); } diff --git a/Projectiles/SunkenSea/SerpentineBody.cs b/Projectiles/SunkenSea/SerpentineBody.cs index 424abfe03f..8665e8bb0e 100644 --- a/Projectiles/SunkenSea/SerpentineBody.cs +++ b/Projectiles/SunkenSea/SerpentineBody.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.SunkenSea { for (int k = 0; k < 8; k++) { - int num114 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 68, 0f, 0f, 100, default(Color), 1.25f); + int num114 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 68, 0f, 0f, 100, default, 1.25f); Dust dust = Main.dust[num114]; dust.velocity *= 0.3f; Main.dust[num114].position.X = projectile.position.X + (float)(projectile.width / 2) + 4f + (float)Main.rand.Next(-4, 5); @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.SunkenSea if (num1064 != projectile.rotation) { float num1068 = MathHelper.WrapAngle(num1064 - projectile.rotation); - vector134 = vector134.RotatedBy((double)(num1068 * 0.1f), default(Vector2)); + vector134 = vector134.RotatedBy((double)(num1068 * 0.1f), default); } projectile.rotation = vector134.ToRotation() + 1.57079637f; projectile.position = projectile.Center; diff --git a/Projectiles/SunkenSea/SerpentineHead.cs b/Projectiles/SunkenSea/SerpentineHead.cs index 64b663cdab..01d0f9a156 100644 --- a/Projectiles/SunkenSea/SerpentineHead.cs +++ b/Projectiles/SunkenSea/SerpentineHead.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.SunkenSea { projectile.alpha = 0; } - int num114 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 68, 0f, 0f, 100, default(Color), 1.25f); + int num114 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 68, 0f, 0f, 100, default, 1.25f); Dust dust = Main.dust[num114]; dust.velocity *= 0.3f; Main.dust[num114].position.X = projectile.position.X + (float)(projectile.width / 2) + 4f + (float)Main.rand.Next(-4, 5); @@ -162,7 +162,7 @@ namespace CalamityMod.Projectiles.SunkenSea Main.PlaySound(SoundID.Item10, projectile.position); for (int k = 0; k < 8; k++) { - int num114 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 68, 0f, 0f, 100, default(Color), 1.25f); + int num114 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 68, 0f, 0f, 100, default, 1.25f); Dust dust = Main.dust[num114]; dust.velocity *= 0.3f; Main.dust[num114].position.X = projectile.position.X + (float)(projectile.width / 2) + 4f + (float)Main.rand.Next(-4, 5); diff --git a/Projectiles/SunkenSea/SerpentineTail.cs b/Projectiles/SunkenSea/SerpentineTail.cs index 951d616099..92f97bac9e 100644 --- a/Projectiles/SunkenSea/SerpentineTail.cs +++ b/Projectiles/SunkenSea/SerpentineTail.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.SunkenSea { for (int k = 0; k < 8; k++) { - int num114 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 68, 0f, 0f, 100, default(Color), 1.25f); + int num114 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 68, 0f, 0f, 100, default, 1.25f); Dust dust = Main.dust[num114]; dust.velocity *= 0.3f; Main.dust[num114].position.X = projectile.position.X + (float)(projectile.width / 2) + 4f + (float)Main.rand.Next(-4, 5); @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.SunkenSea if (num1064 != projectile.rotation) { float num1068 = MathHelper.WrapAngle(num1064 - projectile.rotation); - vector134 = vector134.RotatedBy((double)(num1068 * 0.1f), default(Vector2)); + vector134 = vector134.RotatedBy((double)(num1068 * 0.1f), default); } projectile.rotation = vector134.ToRotation() + 1.57079637f; projectile.position = projectile.Center; diff --git a/Projectiles/SunkenSea/Shellfish.cs b/Projectiles/SunkenSea/Shellfish.cs index 4608c17efd..bd927815c6 100644 --- a/Projectiles/SunkenSea/Shellfish.cs +++ b/Projectiles/SunkenSea/Shellfish.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.SunkenSea int num501 = 20; for (int num502 = 0; num502 < num501; num502++) { - int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 33, 0f, 0f, 0, default(Color), 1f); + int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 33, 0f, 0f, 0, default, 1f); Main.dust[num503].velocity *= 2f; Main.dust[num503].scale *= 1.15f; } diff --git a/Projectiles/Typeless/AstralFallingSand.cs b/Projectiles/Typeless/AstralFallingSand.cs index 4be189b4c4..2a0ea06f56 100644 --- a/Projectiles/Typeless/AstralFallingSand.cs +++ b/Projectiles/Typeless/AstralFallingSand.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Typeless public override void AI() { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { int i = Dust.NewDust(projectile.position, projectile.width, projectile.height, 108, 0f, projectile.velocity.Y * 0.5f); Main.dust[i].velocity.X *= 0.2f; diff --git a/Projectiles/Typeless/AstralStar.cs b/Projectiles/Typeless/AstralStar.cs index db73989c97..33ae445745 100644 --- a/Projectiles/Typeless/AstralStar.cs +++ b/Projectiles/Typeless/AstralStar.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Typeless if (projectile.soundDelay == 0) { projectile.soundDelay = 20 + Main.rand.Next(40); - if (Main.rand.Next(5) == 0) + if (Main.rand.NextBool(5)) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9); } @@ -60,14 +60,14 @@ namespace CalamityMod.Projectiles.Typeless } projectile.localAI[0] += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.01f * (float)projectile.direction; projectile.rotation += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.01f * (float)projectile.direction; - if (Main.rand.Next(16) == 0) + if (Main.rand.NextBool(16)) { - Vector2 value3 = Vector2.UnitX.RotatedByRandom(1.5707963705062866).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)); - int num59 = Dust.NewDust(projectile.position, projectile.width, projectile.height, mod.DustType("AstralOrange"), projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default(Color), 1.2f); + Vector2 value3 = Vector2.UnitX.RotatedByRandom(1.5707963705062866).RotatedBy((double)projectile.velocity.ToRotation(), default); + int num59 = Dust.NewDust(projectile.position, projectile.width, projectile.height, mod.DustType("AstralOrange"), projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default, 1.2f); Main.dust[num59].velocity = value3 * 0.66f; Main.dust[num59].position = projectile.Center + value3 * 12f; } - if (Main.rand.Next(48) == 0) + if (Main.rand.NextBool(48)) { int num60 = Gore.NewGore(projectile.Center, new Vector2(projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f), 16, 1f); Main.gore[num60].velocity *= 0.66f; @@ -76,11 +76,11 @@ namespace CalamityMod.Projectiles.Typeless if (projectile.ai[1] == 1f) { projectile.light = 0.9f; - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { - Dust.NewDust(projectile.position, projectile.width, projectile.height, mod.DustType("AstralOrange"), projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default(Color), 1.2f); + Dust.NewDust(projectile.position, projectile.width, projectile.height, mod.DustType("AstralOrange"), projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default, 1.2f); } - if (Main.rand.Next(20) == 0) + if (Main.rand.NextBool(20)) { Gore.NewGore(projectile.position, new Vector2(projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f), Main.rand.Next(16, 18), 1f); } @@ -107,9 +107,9 @@ namespace CalamityMod.Projectiles.Typeless projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 1.2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -117,10 +117,10 @@ namespace CalamityMod.Projectiles.Typeless } for (int num623 = 0; num623 < 5; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 1.7f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 1.7f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default(Color), 1f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, mod.DustType("AstralOrange"), 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } for (int num480 = 0; num480 < 3; num480++) diff --git a/Projectiles/Typeless/AtaxiaOrb.cs b/Projectiles/Typeless/AtaxiaOrb.cs index 7befa4bfcc..8253488854 100644 --- a/Projectiles/Typeless/AtaxiaOrb.cs +++ b/Projectiles/Typeless/AtaxiaOrb.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Typeless public override void AI() { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default(Color), 2f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, 2f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; float num472 = projectile.Center.X; diff --git a/Projectiles/Typeless/BloodBomb.cs b/Projectiles/Typeless/BloodBomb.cs index f7bb1ebe91..79dc38baa2 100644 --- a/Projectiles/Typeless/BloodBomb.cs +++ b/Projectiles/Typeless/BloodBomb.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Typeless } for (int num457 = 0; num457 < 3; num457++) { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, 0f, 0f, 100, default(Color), 1.2f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, 0f, 0f, 100, default, 1.2f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; diff --git a/Projectiles/Typeless/BloodBombExplosion.cs b/Projectiles/Typeless/BloodBombExplosion.cs index 53f9e80f15..2f4d36dfe4 100644 --- a/Projectiles/Typeless/BloodBombExplosion.cs +++ b/Projectiles/Typeless/BloodBombExplosion.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Typeless num466 = num465 / num466; num463 *= num466; num464 *= num466; - int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, 0f, 0f, 100, default(Color), 1.8f); + int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, 0f, 0f, 100, default, 1.8f); Main.dust[num467].noGravity = true; Main.dust[num467].position.X = projectile.Center.X; Main.dust[num467].position.Y = projectile.Center.Y; diff --git a/Projectiles/Typeless/ChaosBlaze.cs b/Projectiles/Typeless/ChaosBlaze.cs index a26fb91421..b912348af6 100644 --- a/Projectiles/Typeless/ChaosBlaze.cs +++ b/Projectiles/Typeless/ChaosBlaze.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Typeless num466 = num465 / num466; num463 *= num466; num464 *= num466; - int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default(Color), 1.5f); + int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, 1.5f); Main.dust[num467].noGravity = true; Main.dust[num467].position.X = projectile.Center.X; Main.dust[num467].position.Y = projectile.Center.Y; diff --git a/Projectiles/Typeless/ChaosFlare.cs b/Projectiles/Typeless/ChaosFlare.cs index fe82274e7e..c57b280c21 100644 --- a/Projectiles/Typeless/ChaosFlare.cs +++ b/Projectiles/Typeless/ChaosFlare.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Typeless } for (int num457 = 0; num457 < 6; num457++) { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default(Color), 1.2f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, 1.2f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; diff --git a/Projectiles/Typeless/ChaosFlare2.cs b/Projectiles/Typeless/ChaosFlare2.cs index 2e72e1d5f7..019e3ef845 100644 --- a/Projectiles/Typeless/ChaosFlare2.cs +++ b/Projectiles/Typeless/ChaosFlare2.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Typeless Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0.25f) / 255f, ((255 - projectile.alpha) * 0f) / 255f); for (int num457 = 0; num457 < 6; num457++) { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default(Color), 1.2f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, 1.2f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; diff --git a/Projectiles/Typeless/ChaosGeyser.cs b/Projectiles/Typeless/ChaosGeyser.cs index ba2b651ced..5176c9872d 100644 --- a/Projectiles/Typeless/ChaosGeyser.cs +++ b/Projectiles/Typeless/ChaosGeyser.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Typeless Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); } projectile.rotation += projectile.velocity.X * 0.1f; - int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 127, 0f, 0f, 100, default(Color), 1f); + int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 127, 0f, 0f, 100, default, 1f); Dust expr_8976_cp_0 = Main.dust[num199]; expr_8976_cp_0.position.X = expr_8976_cp_0.position.X - 2f; Dust expr_8994_cp_0 = Main.dust[num199]; @@ -67,9 +67,9 @@ namespace CalamityMod.Projectiles.Typeless Main.dust[num199].noGravity = true; Dust expr_89E7_cp_0 = Main.dust[num199]; expr_89E7_cp_0.velocity.Y = expr_89E7_cp_0.velocity.Y - 16f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { - int num200 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 127, 0f, 0f, 100, default(Color), 1f); + int num200 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 127, 0f, 0f, 100, default, 1f); Dust expr_8A4E_cp_0 = Main.dust[num200]; expr_8A4E_cp_0.position.X = expr_8A4E_cp_0.position.X - 2f; Dust expr_8A6C_cp_0 = Main.dust[num200]; diff --git a/Projectiles/Typeless/DragonDust.cs b/Projectiles/Typeless/DragonDust.cs index 0ee68633f5..e0debc6395 100644 --- a/Projectiles/Typeless/DragonDust.cs +++ b/Projectiles/Typeless/DragonDust.cs @@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Typeless num466 = num465 / num466; num463 *= num466; num464 *= num466; - int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 1.5f); + int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1.5f); Main.dust[num467].noGravity = true; Main.dust[num467].position.X = projectile.Center.X; Main.dust[num467].position.Y = projectile.Center.Y; diff --git a/Projectiles/Typeless/FabsolDust.cs b/Projectiles/Typeless/FabsolDust.cs index 4738464486..b37c854e52 100644 --- a/Projectiles/Typeless/FabsolDust.cs +++ b/Projectiles/Typeless/FabsolDust.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Typeless { for (int num468 = 0; num468 < 5; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 66, 0f, 0f, 100, default(Color), 0.5f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 66, 0f, 0f, 100, default, 0.5f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Typeless/FlareExplosion.cs b/Projectiles/Typeless/FlareExplosion.cs index 5396e6be56..902f75517e 100644 --- a/Projectiles/Typeless/FlareExplosion.cs +++ b/Projectiles/Typeless/FlareExplosion.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Typeless { for (int num468 = 0; num468 < 5; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 0.5f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 0.5f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Typeless/GalaxySmasherHammer.cs b/Projectiles/Typeless/GalaxySmasherHammer.cs index a8b7aec88c..c942a27e30 100644 --- a/Projectiles/Typeless/GalaxySmasherHammer.cs +++ b/Projectiles/Typeless/GalaxySmasherHammer.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Typeless int numDust = 2; for(int i = 0; i < numDust; ++i) { - int dustType = (Main.rand.Next(6) == 0) ? 112 : 173; + int dustType = (Main.rand.NextBool(6)) ? 112 : 173; float scale = 0.8f + Main.rand.NextFloat(0.6f); int idx = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType); Main.dust[idx].noGravity = true; diff --git a/Projectiles/Typeless/GhostlyBolt.cs b/Projectiles/Typeless/GhostlyBolt.cs index a7a8f9cba8..2e459d8a23 100644 --- a/Projectiles/Typeless/GhostlyBolt.cs +++ b/Projectiles/Typeless/GhostlyBolt.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Typeless Main.PlaySound(SoundID.Item8, projectile.position); for (int num151 = 0; num151 < 40; num151++) { - int num152 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 181, 0f, 0f, 100, default(Color), 1f); + int num152 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 181, 0f, 0f, 100, default, 1f); Main.dust[num152].velocity *= 3f; Main.dust[num152].velocity += projectile.velocity * 0.75f; Main.dust[num152].scale *= 1.2f; @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Typeless { for (int num153 = 0; num153 < 3; num153++) { - int num154 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 181, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1f); + int num154 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 181, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); Main.dust[num154].velocity *= 0.6f; Main.dust[num154].scale *= 1.4f; Main.dust[num154].noGravity = true; diff --git a/Projectiles/Typeless/GodKiller.cs b/Projectiles/Typeless/GodKiller.cs index dd54eaaac5..fb6b3f78b5 100644 --- a/Projectiles/Typeless/GodKiller.cs +++ b/Projectiles/Typeless/GodKiller.cs @@ -58,11 +58,11 @@ namespace CalamityMod.Projectiles.Typeless num247 = projectile.velocity.X * 0.5f; num248 = projectile.velocity.Y * 0.5f; } - int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 173, 0f, 0f, 100, default(Color), 1f); + int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 173, 0f, 0f, 100, default, 1f); Main.dust[num249].scale *= 1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num249].velocity *= 0.2f; Main.dust[num249].noGravity = true; - num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 199, 0f, 0f, 100, default(Color), 0.1f); + num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 199, 0f, 0f, 100, default, 0.1f); Main.dust[num249].fadeIn = 1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num249].velocity *= 0.05f; } @@ -114,9 +114,9 @@ namespace CalamityMod.Projectiles.Typeless projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 199, 0f, 0f, 100, default(Color), 1.5f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 199, 0f, 0f, 100, default, 1.5f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -124,10 +124,10 @@ namespace CalamityMod.Projectiles.Typeless } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 2f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 1.5f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1.5f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Typeless/GodSlayerBlaze.cs b/Projectiles/Typeless/GodSlayerBlaze.cs index 21d93359bd..1cd74e1453 100644 --- a/Projectiles/Typeless/GodSlayerBlaze.cs +++ b/Projectiles/Typeless/GodSlayerBlaze.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Typeless projectile.ai[0] += 4f; int num462 = 0; float scale = 0.7f; - int dustType = (Main.rand.Next(2) == 0 ? mod.DustType("AstralOrange") : mod.DustType("AstralBlue")); + int dustType = (Main.rand.NextBool(2) ? mod.DustType("AstralOrange") : mod.DustType("AstralBlue")); if (projectile.ai[1] == 0f) { scale = 1.5f; @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Typeless num466 = num465 / num466; num463 *= num466; num464 *= num466; - int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default(Color), scale); + int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, scale); if (dustType != 173) Main.dust[num467].color = new Color(255, 255, 255, 0); Main.dust[num467].noGravity = true; diff --git a/Projectiles/Typeless/GodSlayerOrb.cs b/Projectiles/Typeless/GodSlayerOrb.cs index 9f2bdb820c..f68f295aed 100644 --- a/Projectiles/Typeless/GodSlayerOrb.cs +++ b/Projectiles/Typeless/GodSlayerOrb.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Typeless public override void AI() { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 2f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; float num472 = projectile.Center.X; diff --git a/Projectiles/Typeless/GodSlayerPhantom.cs b/Projectiles/Typeless/GodSlayerPhantom.cs index eb611db859..0b2b3fa9db 100644 --- a/Projectiles/Typeless/GodSlayerPhantom.cs +++ b/Projectiles/Typeless/GodSlayerPhantom.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Typeless { projectile.frame = 0; } - int num822 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 173, 0f, 0f, 0, default(Color), 0.5f); + int num822 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 173, 0f, 0f, 0, default, 0.5f); Dust dust = Main.dust[num822]; dust.velocity *= 0.1f; Main.dust[num822].scale = 1.3f; @@ -139,9 +139,9 @@ namespace CalamityMod.Projectiles.Typeless for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 173, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default(Color), 0.5f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 173, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default, 0.5f); Main.dust[num228].noGravity = true; Main.dust[num228].noLight = true; Main.dust[num228].velocity = vector7; diff --git a/Projectiles/Typeless/GodSlayerShrapnel.cs b/Projectiles/Typeless/GodSlayerShrapnel.cs index 8b5146180c..d825e2d5b7 100644 --- a/Projectiles/Typeless/GodSlayerShrapnel.cs +++ b/Projectiles/Typeless/GodSlayerShrapnel.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Typeless projectile.ai[1] = 1f; Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 13); } - int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 0.5f); + int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 173, 0f, 0f, 100, default, 0.5f); Dust expr_8976_cp_0 = Main.dust[num199]; expr_8976_cp_0.position.X = expr_8976_cp_0.position.X - 2f; Dust expr_8994_cp_0 = Main.dust[num199]; @@ -64,9 +64,9 @@ namespace CalamityMod.Projectiles.Typeless Main.dust[num199].noGravity = true; Dust expr_89E7_cp_0 = Main.dust[num199]; expr_89E7_cp_0.velocity.Y = expr_89E7_cp_0.velocity.Y - 2f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { - int num200 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 0.5f); + int num200 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 173, 0f, 0f, 100, default, 0.5f); Dust expr_8A4E_cp_0 = Main.dust[num200]; expr_8A4E_cp_0.position.X = expr_8A4E_cp_0.position.X - 2f; Dust expr_8A6C_cp_0 = Main.dust[num200]; diff --git a/Projectiles/Typeless/GodSlayerShrapnelRound.cs b/Projectiles/Typeless/GodSlayerShrapnelRound.cs index f1f16312bc..a20791b0f7 100644 --- a/Projectiles/Typeless/GodSlayerShrapnelRound.cs +++ b/Projectiles/Typeless/GodSlayerShrapnelRound.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Typeless } for (int num457 = 0; num457 < 3; num457++) { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default(Color), 1.2f); + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1.2f); Main.dust[num458].noGravity = true; Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; diff --git a/Projectiles/Typeless/GoldenGun.cs b/Projectiles/Typeless/GoldenGun.cs index 2141bcad3a..44bac4e1bb 100644 --- a/Projectiles/Typeless/GoldenGun.cs +++ b/Projectiles/Typeless/GoldenGun.cs @@ -41,19 +41,19 @@ namespace CalamityMod.Projectiles.Typeless float num588 = projectile.velocity.X / 6f * (float)num587; float num589 = projectile.velocity.Y / 6f * (float)num587; int num590 = 6; - int num591 = Dust.NewDust(new Vector2(projectile.position.X + (float)num590, projectile.position.Y + (float)num590), projectile.width - num590 * 2, projectile.height - num590 * 2, 170, 0f, 0f, 75, default(Color), 1.2f); + int num591 = Dust.NewDust(new Vector2(projectile.position.X + (float)num590, projectile.position.Y + (float)num590), projectile.width - num590 * 2, projectile.height - num590 * 2, 170, 0f, 0f, 75, default, 1.2f); Dust dust; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { dust = Main.dust[num591]; dust.alpha += 25; } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { dust = Main.dust[num591]; dust.alpha += 25; } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { dust = Main.dust[num591]; dust.alpha += 25; @@ -72,10 +72,10 @@ namespace CalamityMod.Projectiles.Typeless dust.velocity *= 0.2f; num3 = num587; } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { int num592 = 6; - int num593 = Dust.NewDust(new Vector2(projectile.position.X + (float)num592, projectile.position.Y + (float)num592), projectile.width - num592 * 2, projectile.height - num592 * 2, 170, 0f, 0f, 75, default(Color), 0.65f); + int num593 = Dust.NewDust(new Vector2(projectile.position.X + (float)num592, projectile.position.Y + (float)num592), projectile.width - num592 * 2, projectile.height - num592 * 2, 170, 0f, 0f, 75, default, 0.65f); Dust dust = Main.dust[num593]; dust.velocity *= 0.5f; dust = Main.dust[num593]; @@ -91,24 +91,24 @@ namespace CalamityMod.Projectiles.Typeless int num3; for (int num362 = 0; num362 < 100; num362 = num3 + 1) { - int num363 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 170, 0f, 0f, 75, default(Color), 1.2f); + int num363 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 170, 0f, 0f, 75, default, 1.2f); Dust dust; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { dust = Main.dust[num363]; dust.alpha += 25; } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { dust = Main.dust[num363]; dust.alpha += 25; } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { dust = Main.dust[num363]; dust.alpha += 25; } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num363].scale = 0.6f; } diff --git a/Projectiles/Typeless/GrenadeRound.cs b/Projectiles/Typeless/GrenadeRound.cs index 1f1f51c340..3c7eaca334 100644 --- a/Projectiles/Typeless/GrenadeRound.cs +++ b/Projectiles/Typeless/GrenadeRound.cs @@ -52,11 +52,11 @@ namespace CalamityMod.Projectiles.Typeless num247 = projectile.velocity.X * 0.5f; num248 = projectile.velocity.Y * 0.5f; } - int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 6, 0f, 0f, 100, default(Color), 1f); + int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 6, 0f, 0f, 100, default, 1f); Main.dust[num249].scale *= 2f + (float)Main.rand.Next(10) * 0.1f; Main.dust[num249].velocity *= 0.2f; Main.dust[num249].noGravity = true; - num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 31, 0f, 0f, 100, default(Color), 0.5f); + num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 31, 0f, 0f, 100, default, 0.5f); Main.dust[num249].fadeIn = 1f + (float)Main.rand.Next(5) * 0.1f; Main.dust[num249].velocity *= 0.05f; } @@ -94,14 +94,14 @@ namespace CalamityMod.Projectiles.Typeless projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num193 = 0; num193 < 6; num193++) { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 1.5f); + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 1.5f); } for (int num194 = 0; num194 < 60; num194++) { - int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 0, default(Color), 2.5f); + int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 0, default, 2.5f); Main.dust[num195].noGravity = true; Main.dust[num195].velocity *= 3f; - num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 1.5f); + num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 1.5f); Main.dust[num195].velocity *= 2f; Main.dust[num195].noGravity = true; } diff --git a/Projectiles/Typeless/HolyEruption.cs b/Projectiles/Typeless/HolyEruption.cs index ad004b1fdd..6af4304768 100644 --- a/Projectiles/Typeless/HolyEruption.cs +++ b/Projectiles/Typeless/HolyEruption.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Typeless projectile.velocity.Y = projectile.velocity.Y + 0.2f; } projectile.rotation += projectile.velocity.X * 0.1f; - int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 1f); + int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1f); Dust expr_8976_cp_0 = Main.dust[num199]; expr_8976_cp_0.position.X = expr_8976_cp_0.position.X - 2f; Dust expr_8994_cp_0 = Main.dust[num199]; @@ -61,9 +61,9 @@ namespace CalamityMod.Projectiles.Typeless Main.dust[num199].noGravity = true; Dust expr_89E7_cp_0 = Main.dust[num199]; expr_89E7_cp_0.velocity.Y = expr_89E7_cp_0.velocity.Y - 16f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { - int num200 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 246, 0f, 0f, 100, default(Color), 1f); + int num200 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 246, 0f, 0f, 100, default, 1f); Dust expr_8A4E_cp_0 = Main.dust[num200]; expr_8A4E_cp_0.position.X = expr_8A4E_cp_0.position.X - 2f; Dust expr_8A6C_cp_0 = Main.dust[num200]; diff --git a/Projectiles/Typeless/HolyExplosion.cs b/Projectiles/Typeless/HolyExplosion.cs index c979a48279..5061521f98 100644 --- a/Projectiles/Typeless/HolyExplosion.cs +++ b/Projectiles/Typeless/HolyExplosion.cs @@ -33,9 +33,9 @@ namespace CalamityMod.Projectiles.Typeless projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -43,10 +43,10 @@ namespace CalamityMod.Projectiles.Typeless } for (int num623 = 0; num623 < 40; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Typeless/HolyExplosionSupreme.cs b/Projectiles/Typeless/HolyExplosionSupreme.cs index 7c48f2a54a..05cea609f3 100644 --- a/Projectiles/Typeless/HolyExplosionSupreme.cs +++ b/Projectiles/Typeless/HolyExplosionSupreme.cs @@ -35,9 +35,9 @@ namespace CalamityMod.Projectiles.Typeless projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 30; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -45,10 +45,10 @@ namespace CalamityMod.Projectiles.Typeless } for (int num623 = 0; num623 < 60; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Typeless/HolyFlameBomb.cs b/Projectiles/Typeless/HolyFlameBomb.cs index 391a653439..ea025702ae 100644 --- a/Projectiles/Typeless/HolyFlameBomb.cs +++ b/Projectiles/Typeless/HolyFlameBomb.cs @@ -54,9 +54,9 @@ namespace CalamityMod.Projectiles.Typeless projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -64,10 +64,10 @@ namespace CalamityMod.Projectiles.Typeless } for (int num623 = 0; num623 < 35; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Typeless/LunicBeam.cs b/Projectiles/Typeless/LunicBeam.cs index fa7b53c157..5db23053ea 100644 --- a/Projectiles/Typeless/LunicBeam.cs +++ b/Projectiles/Typeless/LunicBeam.cs @@ -121,58 +121,58 @@ namespace CalamityMod.Projectiles.Typeless for (int num41 = 0; num41 < 2; num41++) { Vector2 value8 = Vector2.UnitX * -30f; - value8 = -Vector2.UnitY.RotatedBy((double)(projectile.localAI[0] * 0.1308997f + (float)num41 * 3.14159274f), default(Vector2)) * value7 - projectile.rotation.ToRotationVector2() * 10f; - int num42 = Dust.NewDust(projectile.Center, 0, 0, num34, 0f, 0f, 160, default(Color), 1f); + value8 = -Vector2.UnitY.RotatedBy((double)(projectile.localAI[0] * 0.1308997f + (float)num41 * 3.14159274f), default) * value7 - projectile.rotation.ToRotationVector2() * 10f; + int num42 = Dust.NewDust(projectile.Center, 0, 0, num34, 0f, 0f, 160, default, 1f); Main.dust[num42].scale = num31; Main.dust[num42].noGravity = true; Main.dust[num42].position = projectile.Center + value8 + projectile.velocity * 2f; Main.dust[num42].velocity = Vector2.Normalize(projectile.Center + projectile.velocity * 2f * 8f - Main.dust[num42].position) * 2f + projectile.velocity * 2f; } } - if (Main.rand.Next(12) == 0) + if (Main.rand.NextBool(12)) { for (int num43 = 0; num43 < 1; num43++) { - Vector2 value9 = -Vector2.UnitX.RotatedByRandom(0.19634954631328583).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)); - int num44 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 1f); + Vector2 value9 = -Vector2.UnitX.RotatedByRandom(0.19634954631328583).RotatedBy((double)projectile.velocity.ToRotation(), default); + int num44 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 31, 0f, 0f, 100, default, 1f); Main.dust[num44].velocity *= 0.1f; Main.dust[num44].position = projectile.Center + value9 * (float)projectile.width / 2f + projectile.velocity * 2f; Main.dust[num44].fadeIn = 0.9f; } } - if (Main.rand.Next(64) == 0) + if (Main.rand.NextBool(64)) { for (int num45 = 0; num45 < 1; num45++) { - Vector2 value10 = -Vector2.UnitX.RotatedByRandom(0.39269909262657166).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)); - int num46 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 31, 0f, 0f, 155, default(Color), 0.8f); + Vector2 value10 = -Vector2.UnitX.RotatedByRandom(0.39269909262657166).RotatedBy((double)projectile.velocity.ToRotation(), default); + int num46 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 31, 0f, 0f, 155, default, 0.8f); Main.dust[num46].velocity *= 0.3f; Main.dust[num46].position = projectile.Center + value10 * (float)projectile.width / 2f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num46].fadeIn = 1.4f; } } } - if (Main.rand.Next(4) == 0) + if (Main.rand.NextBool(4)) { for (int num47 = 0; num47 < 2; num47++) { - Vector2 value11 = -Vector2.UnitX.RotatedByRandom(0.78539818525314331).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)); - int num48 = Dust.NewDust(projectile.position, projectile.width, projectile.height, num33, 0f, 0f, 0, default(Color), 1.2f); + Vector2 value11 = -Vector2.UnitX.RotatedByRandom(0.78539818525314331).RotatedBy((double)projectile.velocity.ToRotation(), default); + int num48 = Dust.NewDust(projectile.position, projectile.width, projectile.height, num33, 0f, 0f, 0, default, 1.2f); Main.dust[num48].velocity *= 0.3f; Main.dust[num48].noGravity = true; Main.dust[num48].position = projectile.Center + value11 * (float)projectile.width / 2f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num48].fadeIn = 1.4f; } } } - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { - Vector2 value13 = -Vector2.UnitX.RotatedByRandom(0.19634954631328583).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)); - int num50 = Dust.NewDust(projectile.position, projectile.width, projectile.height, num34, 0f, 0f, 100, default(Color), 1f); + Vector2 value13 = -Vector2.UnitX.RotatedByRandom(0.19634954631328583).RotatedBy((double)projectile.velocity.ToRotation(), default); + int num50 = Dust.NewDust(projectile.position, projectile.width, projectile.height, num34, 0f, 0f, 100, default, 1f); Main.dust[num50].velocity *= 0.3f; Main.dust[num50].position = projectile.Center + value13 * (float)projectile.width / 2f; Main.dust[num50].fadeIn = 1.2f; @@ -183,15 +183,15 @@ namespace CalamityMod.Projectiles.Typeless for (int num151 = 0; num151 < 3; num151++) { int num154 = 14; - int num155 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num154 * 2, projectile.height - num154 * 2, 259, 0f, 0f, 100, default(Color), 1.35f); + int num155 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num154 * 2, projectile.height - num154 * 2, 259, 0f, 0f, 100, default, 1.35f); Main.dust[num155].noGravity = true; Main.dust[num155].velocity *= 0.1f; Main.dust[num155].velocity += projectile.velocity * 0.5f; } - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { int num156 = 16; - int num157 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num156 * 2, projectile.height - num156 * 2, 259, 0f, 0f, 100, default(Color), 1f); + int num157 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num156 * 2, projectile.height - num156 * 2, 259, 0f, 0f, 100, default, 1f); Main.dust[num157].velocity *= 0.25f; Main.dust[num157].noGravity = true; Main.dust[num157].velocity += projectile.velocity * 0.5f; @@ -248,14 +248,14 @@ namespace CalamityMod.Projectiles.Typeless 262, 247 }); - int num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num47, 0f, 0f, 200, default(Color), num50); + int num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num47, 0f, 0f, 200, default, num50); Main.dust[num54].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; Main.dust[num54].noGravity = true; Dust dust = Main.dust[num54]; dust.velocity *= 3f; dust = Main.dust[num54]; dust.velocity += value4 * Main.rand.NextFloat(); - num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num48, 0f, 0f, 100, default(Color), num51); + num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num48, 0f, 0f, 100, default, num51); Main.dust[num54].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; dust = Main.dust[num54]; dust.velocity *= 2f; @@ -268,8 +268,8 @@ namespace CalamityMod.Projectiles.Typeless } for (int num55 = 0; num55 < 20; num55 = num3 + 1) { - int num56 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num49, 0f, 0f, 0, default(Color), num52); - Main.dust[num56].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)) * (float)projectile.width / 3f; + int num56 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num49, 0f, 0f, 0, default, num52); + Main.dust[num56].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default) * (float)projectile.width / 3f; Main.dust[num56].noGravity = true; Dust dust = Main.dust[num56]; dust.velocity *= 0.5f; diff --git a/Projectiles/Typeless/MarkRound.cs b/Projectiles/Typeless/MarkRound.cs index c2edfeee1e..54c87390bd 100644 --- a/Projectiles/Typeless/MarkRound.cs +++ b/Projectiles/Typeless/MarkRound.cs @@ -97,7 +97,7 @@ namespace CalamityMod.Projectiles.Typeless int num212 = Main.rand.Next(3, 7); for (int num213 = 0; num213 < num212; num213++) { - int num214 = Dust.NewDust(projectile.Center - projectile.velocity / 2f, 0, 0, 173, 0f, 0f, 100, default(Color), 2.1f); + int num214 = Dust.NewDust(projectile.Center - projectile.velocity / 2f, 0, 0, 173, 0f, 0f, 100, default, 2.1f); Main.dust[num214].velocity *= 2f; Main.dust[num214].noGravity = true; } diff --git a/Projectiles/Typeless/NanoblackMain.cs b/Projectiles/Typeless/NanoblackMain.cs index e8c2d4f85d..5daf2c16fe 100644 --- a/Projectiles/Typeless/NanoblackMain.cs +++ b/Projectiles/Typeless/NanoblackMain.cs @@ -48,9 +48,9 @@ namespace CalamityMod.Projectiles.Typeless projectile.ai[1] = GetBladeDelay(); // Produces electricity and green firework sparks constantly while in flight. - if (Main.rand.Next(3) == 0) + if (Main.rand.NextBool(3)) { - int dustType = (Main.rand.Next(5) == 0) ? 226 : 220; + int dustType = (Main.rand.NextBool(5)) ? 226 : 220; float scale = 0.8f + Main.rand.NextFloat(0.3f); float velocityMult = Main.rand.NextFloat(0.3f, 0.6f); int idx = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType); diff --git a/Projectiles/Typeless/Nanotech.cs b/Projectiles/Typeless/Nanotech.cs index 01cd05475e..b592c410c1 100644 --- a/Projectiles/Typeless/Nanotech.cs +++ b/Projectiles/Typeless/Nanotech.cs @@ -85,7 +85,7 @@ namespace CalamityMod.Projectiles.Typeless for (int num191 = 0; num191 < 2; num191 = num3 + 1) { int num192 = (int)(10f * projectile.scale); - int num193 = Dust.NewDust(projectile.Center - Vector2.One * (float)num192, num192 * 2, num192 * 2, 107, 0f, 0f, 0, default(Color), 1f); + int num193 = Dust.NewDust(projectile.Center - Vector2.One * (float)num192, num192 * 2, num192 * 2, 107, 0f, 0f, 0, default, 1f); Dust dust20 = Main.dust[num193]; Vector2 value8 = Vector2.Normalize(dust20.position - projectile.Center); dust20.position = projectile.Center + value8 * (float)num192 * projectile.scale; diff --git a/Projectiles/Typeless/PoisonousSeawater.cs b/Projectiles/Typeless/PoisonousSeawater.cs index 26df8ee0ad..9402f88e46 100644 --- a/Projectiles/Typeless/PoisonousSeawater.cs +++ b/Projectiles/Typeless/PoisonousSeawater.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Typeless } for (int num468 = 0; num468 < 2; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, randomDust, 0f, 0f, 100, default(Color), 1f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, randomDust, 0f, 0f, 100, default, 1f); if (randomDust == 89) { Main.dust[num469].scale *= 0.35f; diff --git a/Projectiles/Typeless/ReaverBlast.cs b/Projectiles/Typeless/ReaverBlast.cs index b250e85067..ed448d4f19 100644 --- a/Projectiles/Typeless/ReaverBlast.cs +++ b/Projectiles/Typeless/ReaverBlast.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Typeless num466 = num465 / num466; num463 *= num466; num464 *= num466; - int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 74, 0f, 0f, 100, default(Color), 1f); + int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 74, 0f, 0f, 100, default, 1f); Main.dust[num467].noGravity = true; Main.dust[num467].position.X = projectile.Center.X; Main.dust[num467].position.Y = projectile.Center.Y; diff --git a/Projectiles/Typeless/SkyFlareFriendly.cs b/Projectiles/Typeless/SkyFlareFriendly.cs index 8ffc58ab17..c9c35a8c6a 100644 --- a/Projectiles/Typeless/SkyFlareFriendly.cs +++ b/Projectiles/Typeless/SkyFlareFriendly.cs @@ -61,9 +61,9 @@ namespace CalamityMod.Projectiles.Typeless projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 4; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -71,10 +71,10 @@ namespace CalamityMod.Projectiles.Typeless } for (int num623 = 0; num623 < 12; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default(Color), 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } for (int num625 = 0; num625 < 3; num625++) @@ -88,25 +88,25 @@ namespace CalamityMod.Projectiles.Typeless { scaleFactor10 = 1f; } - int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13AB6_cp_0 = Main.gore[num626]; expr_13AB6_cp_0.velocity.X = expr_13AB6_cp_0.velocity.X + 1f; Gore expr_13AD6_cp_0 = Main.gore[num626]; expr_13AD6_cp_0.velocity.Y = expr_13AD6_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13B79_cp_0 = Main.gore[num626]; expr_13B79_cp_0.velocity.X = expr_13B79_cp_0.velocity.X - 1f; Gore expr_13B99_cp_0 = Main.gore[num626]; expr_13B99_cp_0.velocity.Y = expr_13B99_cp_0.velocity.Y + 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13C3C_cp_0 = Main.gore[num626]; expr_13C3C_cp_0.velocity.X = expr_13C3C_cp_0.velocity.X + 1f; Gore expr_13C5C_cp_0 = Main.gore[num626]; expr_13C5C_cp_0.velocity.Y = expr_13C5C_cp_0.velocity.Y - 1f; - num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); Main.gore[num626].velocity *= scaleFactor10; Gore expr_13CFF_cp_0 = Main.gore[num626]; expr_13CFF_cp_0.velocity.X = expr_13CFF_cp_0.velocity.X - 1f; diff --git a/Projectiles/Typeless/StandingFire.cs b/Projectiles/Typeless/StandingFire.cs index fe9eccde1c..5563db4a11 100644 --- a/Projectiles/Typeless/StandingFire.cs +++ b/Projectiles/Typeless/StandingFire.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Typeless projectile.ai[1] = 1f; Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 13); } - int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 235, 0f, 0f, 100, default(Color), 1f); + int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 235, 0f, 0f, 100, default, 1f); Dust expr_8976_cp_0 = Main.dust[num199]; expr_8976_cp_0.position.X = expr_8976_cp_0.position.X - 2f; Dust expr_8994_cp_0 = Main.dust[num199]; @@ -64,9 +64,9 @@ namespace CalamityMod.Projectiles.Typeless Main.dust[num199].noGravity = true; Dust expr_89E7_cp_0 = Main.dust[num199]; expr_89E7_cp_0.velocity.Y = expr_89E7_cp_0.velocity.Y - 2f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { - int num200 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 235, 0f, 0f, 100, default(Color), 1f); + int num200 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 235, 0f, 0f, 100, default, 1f); Dust expr_8A4E_cp_0 = Main.dust[num200]; expr_8A4E_cp_0.position.X = expr_8A4E_cp_0.position.X - 2f; Dust expr_8A6C_cp_0 = Main.dust[num200]; diff --git a/Projectiles/Typeless/StickyFeatherAero.cs b/Projectiles/Typeless/StickyFeatherAero.cs index b7dc5dc2ef..760e48abef 100644 --- a/Projectiles/Typeless/StickyFeatherAero.cs +++ b/Projectiles/Typeless/StickyFeatherAero.cs @@ -77,9 +77,9 @@ namespace CalamityMod.Projectiles.Typeless projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); for (int num621 = 0; num621 < 15; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 206, 0f, 0f, 100, default(Color), 1.2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 206, 0f, 0f, 100, default, 1.2f); Main.dust[num622].velocity *= 3f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; @@ -87,10 +87,10 @@ namespace CalamityMod.Projectiles.Typeless } for (int num623 = 0; num623 < 30; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 206, 0f, 0f, 100, default(Color), 1.7f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 206, 0f, 0f, 100, default, 1.7f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 206, 0f, 0f, 100, default(Color), 1f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 206, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } } diff --git a/Projectiles/Typeless/TarraEnergy.cs b/Projectiles/Typeless/TarraEnergy.cs index a053ba5a80..0db424b092 100644 --- a/Projectiles/Typeless/TarraEnergy.cs +++ b/Projectiles/Typeless/TarraEnergy.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Typeless { float x2 = projectile.position.X - projectile.velocity.X / 10f * (float)num136; float y2 = projectile.position.Y - projectile.velocity.Y / 10f * (float)num136; - int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 107, 0f, 0f, 0, default(Color), 1f); + int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 107, 0f, 0f, 0, default, 1f); Main.dust[num137].alpha = projectile.alpha; Main.dust[num137].position.X = x2; Main.dust[num137].position.Y = y2; diff --git a/Projectiles/Typeless/TheDeadlyMicrobeProjectile.cs b/Projectiles/Typeless/TheDeadlyMicrobeProjectile.cs index 56b162e85e..3d5da5a6ac 100644 --- a/Projectiles/Typeless/TheDeadlyMicrobeProjectile.cs +++ b/Projectiles/Typeless/TheDeadlyMicrobeProjectile.cs @@ -188,9 +188,9 @@ namespace CalamityMod.Projectiles.Typeless for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default(Vector2)) + projectile.Center; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 44, vector7.X, vector7.Y, 100, default(Color), 0.5f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 44, vector7.X, vector7.Y, 100, default, 0.5f); Main.dust[num228].noGravity = true; Main.dust[num228].noLight = true; Main.dust[num228].velocity = vector7; diff --git a/Projectiles/Typeless/XerocBlast.cs b/Projectiles/Typeless/XerocBlast.cs index 15bb30f4a1..fa74362c8f 100644 --- a/Projectiles/Typeless/XerocBlast.cs +++ b/Projectiles/Typeless/XerocBlast.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Typeless num466 = num465 / num466; num463 *= num466; num464 *= num466; - int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 58, 0f, 0f, 100, default(Color), 1f); + int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 58, 0f, 0f, 100, default, 1f); Main.dust[num467].noGravity = true; Main.dust[num467].position.X = projectile.Center.X; Main.dust[num467].position.Y = projectile.Center.Y; diff --git a/Projectiles/Typeless/XerocBubble.cs b/Projectiles/Typeless/XerocBubble.cs index 2b319d4d22..8c28d0bc8f 100644 --- a/Projectiles/Typeless/XerocBubble.cs +++ b/Projectiles/Typeless/XerocBubble.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Typeless { for (int num468 = 0; num468 < 1; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 58, 0f, 0f, 100, default(Color), 1f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 58, 0f, 0f, 100, default, 1f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Typeless/XerocFire.cs b/Projectiles/Typeless/XerocFire.cs index 81e961d238..eb0c88c7f8 100644 --- a/Projectiles/Typeless/XerocFire.cs +++ b/Projectiles/Typeless/XerocFire.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Typeless projectile.velocity.Y = projectile.velocity.Y + 0.2f; } projectile.rotation += projectile.velocity.X * 0.1f; - int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 58, 0f, 0f, 100, default(Color), 0.75f); + int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 58, 0f, 0f, 100, default, 0.75f); Dust expr_8976_cp_0 = Main.dust[num199]; expr_8976_cp_0.position.X = expr_8976_cp_0.position.X - 2f; Dust expr_8994_cp_0 = Main.dust[num199]; @@ -60,9 +60,9 @@ namespace CalamityMod.Projectiles.Typeless Main.dust[num199].noGravity = true; Dust expr_89E7_cp_0 = Main.dust[num199]; expr_89E7_cp_0.velocity.Y = expr_89E7_cp_0.velocity.Y - 2f; - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { - int num200 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 58, 0f, 0f, 100, default(Color), 0.75f); + int num200 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 58, 0f, 0f, 100, default, 0.75f); Dust expr_8A4E_cp_0 = Main.dust[num200]; expr_8A4E_cp_0.position.X = expr_8A4E_cp_0.position.X - 2f; Dust expr_8A6C_cp_0 = Main.dust[num200]; diff --git a/Projectiles/Typeless/XerocOrb.cs b/Projectiles/Typeless/XerocOrb.cs index f91d18503b..8f125a8fa0 100644 --- a/Projectiles/Typeless/XerocOrb.cs +++ b/Projectiles/Typeless/XerocOrb.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Typeless public override void AI() { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 58, 0f, 0f, 100, default(Color), 2f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 58, 0f, 0f, 100, default, 2f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; float num472 = projectile.Center.X; diff --git a/Projectiles/Typeless/XerocStar.cs b/Projectiles/Typeless/XerocStar.cs index b65f3704f2..25e48d35d4 100644 --- a/Projectiles/Typeless/XerocStar.cs +++ b/Projectiles/Typeless/XerocStar.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Typeless { for (int num468 = 0; num468 < 1; num468++) { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 58, 0f, 0f, 100, default(Color), 2f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 58, 0f, 0f, 100, default, 2f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Skies/AstralSky.cs b/Skies/AstralSky.cs index 0c2e5ed4b7..371dfdcd69 100644 --- a/Skies/AstralSky.cs +++ b/Skies/AstralSky.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Skies spriteBatch.Draw(CalamityMod.AstralSky, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Main.bgColor * opacity); //Terraria's conditions. - if (Main.netMode != 2) + if (Main.netMode != NetmodeID.Server) { for (int i = 0; i < Main.star.Length; i++) { diff --git a/Tiles/ArenaTile.cs b/Tiles/ArenaTile.cs index 0fbb0f4457..9cbaa95e43 100644 --- a/Tiles/ArenaTile.cs +++ b/Tiles/ArenaTile.cs @@ -1,5 +1,6 @@ using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Tiles @@ -33,7 +34,7 @@ namespace CalamityMod.Tiles if (!NPC.AnyNPCs(mod.NPCType("SupremeCalamitas"))) { WorldGen.KillTile(i, j, false, false, false); - if (!Main.tile[i, j].active() && Main.netMode != 0) + if (!Main.tile[i, j].active() && Main.netMode != NetmodeID.SinglePlayer) { NetMessage.SendData(17, -1, -1, null, 0, (float)i, (float)j, 0f, 0, 0, 0); } diff --git a/Tiles/Astral/AstralChestLocked.cs b/Tiles/Astral/AstralChestLocked.cs index 9b3aa5e6df..a21be630b5 100644 --- a/Tiles/Astral/AstralChestLocked.cs +++ b/Tiles/Astral/AstralChestLocked.cs @@ -128,7 +128,7 @@ namespace CalamityMod.Tiles.Astral } bool isLocked = IsLockedChest(left, top); - if (Main.netMode == 1 && !isLocked) + if (Main.netMode == NetmodeID.MultiplayerClient && !isLocked) { if (left == player.chestX && top == player.chestY && player.chest >= 0) { @@ -148,7 +148,7 @@ namespace CalamityMod.Tiles.Astral { if (Chest.Unlock(left, top)) { - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) NetMessage.SendData(MessageID.Unlock, -1, -1, null, player.whoAmI, 1f, (float)left, (float)top); } } diff --git a/Tiles/AstralBar.cs b/Tiles/AstralBar.cs index bd11d15061..ab2a0305f5 100644 --- a/Tiles/AstralBar.cs +++ b/Tiles/AstralBar.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Tiles public override bool CreateDust(int i, int j, ref int type) { - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { type = mod.DustType("AstralOrange"); } diff --git a/Tiles/AstralDesert/AstralSand.cs b/Tiles/AstralDesert/AstralSand.cs index 7e3befaff4..1838348006 100644 --- a/Tiles/AstralDesert/AstralSand.cs +++ b/Tiles/AstralDesert/AstralSand.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Tiles.AstralDesert public override bool HasWalkDust() { - return Main.rand.Next(3) == 0; + return Main.rand.NextBool(3); } public override void WalkDust(ref int dustType, ref bool makeDust, ref Color color) diff --git a/Tiles/CalamityGlobalTile.cs b/Tiles/CalamityGlobalTile.cs index 78479aa753..a857235596 100644 --- a/Tiles/CalamityGlobalTile.cs +++ b/Tiles/CalamityGlobalTile.cs @@ -106,7 +106,7 @@ namespace CalamityMod.Tiles //Draw Glow if (astralCactus) { - spriteBatch.Draw(CalamityMod.AstralCactusGlowTexture, new Vector2((float)(i * 16 - (int)Main.screenPosition.X), (float)(j * 16 - (int)Main.screenPosition.Y)) + zero, new Rectangle((int)frameX, (int)frameY, 16, 18), Color.White * 0.75f, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + spriteBatch.Draw(CalamityMod.AstralCactusGlowTexture, new Vector2((float)(i * 16 - (int)Main.screenPosition.X), (float)(j * 16 - (int)Main.screenPosition.Y)) + zero, new Rectangle((int)frameX, (int)frameY, 16, 18), Color.White * 0.75f, 0f, default, 1f, SpriteEffects.None, 0f); } return; } @@ -123,7 +123,7 @@ namespace CalamityMod.Tiles if (Main.tile[i + 1, j].type == mod.TileType("LumenylCrystals") || (Main.tile[i + 1, j].type == mod.TileType("SeaPrismCrystals") && CalamityWorld.downedDesertScourge)) { WorldGen.KillTile(i + 1, j, false, false, false); - if (!Main.tile[i + 1, j].active() && Main.netMode != 0) + if (!Main.tile[i + 1, j].active() && Main.netMode != NetmodeID.SinglePlayer) { NetMessage.SendData(17, -1, -1, null, 0, (float)i + 1, (float)j, 0f, 0, 0, 0); } @@ -137,7 +137,7 @@ namespace CalamityMod.Tiles if (Main.tile[i - 1, j].type == mod.TileType("LumenylCrystals") || (Main.tile[i - 1, j].type == mod.TileType("SeaPrismCrystals") && CalamityWorld.downedDesertScourge)) { WorldGen.KillTile(i - 1, j, false, false, false); - if (!Main.tile[i - 1, j].active() && Main.netMode != 0) + if (!Main.tile[i - 1, j].active() && Main.netMode != NetmodeID.SinglePlayer) { NetMessage.SendData(17, -1, -1, null, 0, (float)i - 1, (float)j, 0f, 0, 0, 0); } @@ -151,7 +151,7 @@ namespace CalamityMod.Tiles if (Main.tile[i, j + 1].type == mod.TileType("LumenylCrystals") || (Main.tile[i, j + 1].type == mod.TileType("SeaPrismCrystals") && CalamityWorld.downedDesertScourge)) { WorldGen.KillTile(i, j + 1, false, false, false); - if (!Main.tile[i, j + 1].active() && Main.netMode != 0) + if (!Main.tile[i, j + 1].active() && Main.netMode != NetmodeID.SinglePlayer) { NetMessage.SendData(17, -1, -1, null, 0, (float)i, (float)j + 1, 0f, 0, 0, 0); } @@ -165,7 +165,7 @@ namespace CalamityMod.Tiles if (Main.tile[i, j - 1].type == mod.TileType("LumenylCrystals") || (Main.tile[i, j - 1].type == mod.TileType("SeaPrismCrystals") && CalamityWorld.downedDesertScourge)) { WorldGen.KillTile(i, j - 1, false, false, false); - if (!Main.tile[i, j - 1].active() && Main.netMode != 0) + if (!Main.tile[i, j - 1].active() && Main.netMode != NetmodeID.SinglePlayer) { NetMessage.SendData(17, -1, -1, null, 0, (float)i, (float)j - 1, 0f, 0, 0, 0); } @@ -221,7 +221,7 @@ namespace CalamityMod.Tiles } if (abyssPosX && abyssPosY) { - if (Main.rand.Next(10) == 0) + if (Main.rand.NextBool(10)) { int expr_B64 = WorldGen.genRand.Next(15); if (expr_B64 == 0) @@ -318,11 +318,11 @@ namespace CalamityMod.Tiles if (num13 > 1000000f) { int num14 = (int)(num13 / 1000000f); - if (num14 > 50 && Main.rand.Next(2) == 0) + if (num14 > 50 && Main.rand.NextBool(2)) { num14 /= Main.rand.Next(3) + 1; } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { num14 /= Main.rand.Next(3) + 1; } @@ -332,11 +332,11 @@ namespace CalamityMod.Tiles else if (num13 > 10000f) { int num15 = (int)(num13 / 10000f); - if (num15 > 50 && Main.rand.Next(2) == 0) + if (num15 > 50 && Main.rand.NextBool(2)) { num15 /= Main.rand.Next(3) + 1; } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { num15 /= Main.rand.Next(3) + 1; } @@ -346,11 +346,11 @@ namespace CalamityMod.Tiles else if (num13 > 100f) { int num16 = (int)(num13 / 100f); - if (num16 > 50 && Main.rand.Next(2) == 0) + if (num16 > 50 && Main.rand.NextBool(2)) { num16 /= Main.rand.Next(3) + 1; } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { num16 /= Main.rand.Next(3) + 1; } @@ -360,11 +360,11 @@ namespace CalamityMod.Tiles else { int num17 = (int)num13; - if (num17 > 50 && Main.rand.Next(2) == 0) + if (num17 > 50 && Main.rand.NextBool(2)) { num17 /= Main.rand.Next(3) + 1; } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { num17 /= Main.rand.Next(4) + 1; } @@ -381,7 +381,7 @@ namespace CalamityMod.Tiles } else if (sulphurPosX) { - if (Main.rand.Next(15) == 0) + if (Main.rand.NextBool(15)) { int expr_B64 = WorldGen.genRand.Next(15); if (expr_B64 == 0) @@ -479,11 +479,11 @@ namespace CalamityMod.Tiles if (num13 > 1000000f) { int num14 = (int)(num13 / 1000000f); - if (num14 > 50 && Main.rand.Next(2) == 0) + if (num14 > 50 && Main.rand.NextBool(2)) { num14 /= Main.rand.Next(3) + 1; } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { num14 /= Main.rand.Next(3) + 1; } @@ -493,11 +493,11 @@ namespace CalamityMod.Tiles else if (num13 > 10000f) { int num15 = (int)(num13 / 10000f); - if (num15 > 50 && Main.rand.Next(2) == 0) + if (num15 > 50 && Main.rand.NextBool(2)) { num15 /= Main.rand.Next(3) + 1; } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { num15 /= Main.rand.Next(3) + 1; } @@ -507,11 +507,11 @@ namespace CalamityMod.Tiles else if (num13 > 100f) { int num16 = (int)(num13 / 100f); - if (num16 > 50 && Main.rand.Next(2) == 0) + if (num16 > 50 && Main.rand.NextBool(2)) { num16 /= Main.rand.Next(3) + 1; } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { num16 /= Main.rand.Next(3) + 1; } @@ -521,11 +521,11 @@ namespace CalamityMod.Tiles else { int num17 = (int)num13; - if (num17 > 50 && Main.rand.Next(2) == 0) + if (num17 > 50 && Main.rand.NextBool(2)) { num17 /= Main.rand.Next(3) + 1; } - if (Main.rand.Next(2) == 0) + if (Main.rand.NextBool(2)) { num17 /= Main.rand.Next(4) + 1; } diff --git a/Tiles/ChaoticOre.cs b/Tiles/ChaoticOre.cs index 127129a41d..940a84a174 100644 --- a/Tiles/ChaoticOre.cs +++ b/Tiles/ChaoticOre.cs @@ -37,14 +37,14 @@ namespace CalamityMod.Tiles { return; } - if (closer && Main.rand.Next(300) == 0) + if (closer && Main.rand.NextBool(300)) { int tileLocationY = j + 1; if (Main.tile[i, tileLocationY] != null) { if (!Main.tile[i, tileLocationY].active()) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { Projectile.NewProjectile((float)(i * 16 + 16), (float)(tileLocationY * 16 + 16), 0f, 0.1f, mod.ProjectileType("LavaChunk"), 25, 2f, Main.myPlayer, 0f, 0f); } diff --git a/Tiles/FurnitureAbyss/AbyssChest.cs b/Tiles/FurnitureAbyss/AbyssChest.cs index fec83cdeb0..9fa8a8244c 100644 --- a/Tiles/FurnitureAbyss/AbyssChest.cs +++ b/Tiles/FurnitureAbyss/AbyssChest.cs @@ -120,7 +120,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss NetMessage.SendData(33, -1, -1, NetworkText.FromLiteral(Main.chest[player.chest].name), player.chest, 1f, 0f, 0f, 0, 0, 0); player.editedChestName = false; } - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { if (left == player.chestX && top == player.chestY && player.chest >= 0) { diff --git a/Tiles/FurnitureAbyss/AbyssDresser.cs b/Tiles/FurnitureAbyss/AbyssDresser.cs index b6a1a18a11..3575dfe171 100644 --- a/Tiles/FurnitureAbyss/AbyssDresser.cs +++ b/Tiles/FurnitureAbyss/AbyssDresser.cs @@ -82,7 +82,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss NetMessage.SendData(33, -1, -1, NetworkText.FromLiteral(Main.chest[player.chest].name), player.chest, 1f, 0f, 0f, 0, 0, 0); player.editedChestName = false; } - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { if (left == player.chestX && top == player.chestY && player.chest != -1) { diff --git a/Tiles/FurnitureAncient/AncientDresser.cs b/Tiles/FurnitureAncient/AncientDresser.cs index 66c43e1478..2ed5a21089 100644 --- a/Tiles/FurnitureAncient/AncientDresser.cs +++ b/Tiles/FurnitureAncient/AncientDresser.cs @@ -82,7 +82,7 @@ namespace CalamityMod.Tiles.FurnitureAncient NetMessage.SendData(33, -1, -1, NetworkText.FromLiteral(Main.chest[player.chest].name), player.chest, 1f, 0f, 0f, 0, 0, 0); player.editedChestName = false; } - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { if (left == player.chestX && top == player.chestY && player.chest != -1) { diff --git a/Tiles/FurnitureAshen/AshenChest.cs b/Tiles/FurnitureAshen/AshenChest.cs index 2d17693616..d2b9276dc3 100644 --- a/Tiles/FurnitureAshen/AshenChest.cs +++ b/Tiles/FurnitureAshen/AshenChest.cs @@ -121,7 +121,7 @@ namespace CalamityMod.Tiles.FurnitureAshen NetMessage.SendData(33, -1, -1, NetworkText.FromLiteral(Main.chest[player.chest].name), player.chest, 1f, 0f, 0f, 0, 0, 0); player.editedChestName = false; } - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { if (left == player.chestX && top == player.chestY && player.chest >= 0) { diff --git a/Tiles/FurnitureAshen/AshenChestLocked.cs b/Tiles/FurnitureAshen/AshenChestLocked.cs index d4914855fd..3a2aab4883 100644 --- a/Tiles/FurnitureAshen/AshenChestLocked.cs +++ b/Tiles/FurnitureAshen/AshenChestLocked.cs @@ -122,7 +122,7 @@ namespace CalamityMod.Tiles.FurnitureAshen NetMessage.SendData(33, -1, -1, NetworkText.FromLiteral(Main.chest[player.chest].name), player.chest, 1f, 0f, 0f, 0, 0, 0); player.editedChestName = false; } - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { if (left == player.chestX && top == player.chestY && player.chest >= 0) { diff --git a/Tiles/FurnitureAshen/AshenDresser.cs b/Tiles/FurnitureAshen/AshenDresser.cs index bd44b45200..d9a3380a65 100644 --- a/Tiles/FurnitureAshen/AshenDresser.cs +++ b/Tiles/FurnitureAshen/AshenDresser.cs @@ -82,7 +82,7 @@ namespace CalamityMod.Tiles.FurnitureAshen NetMessage.SendData(33, -1, -1, NetworkText.FromLiteral(Main.chest[player.chest].name), player.chest, 1f, 0f, 0f, 0, 0, 0); player.editedChestName = false; } - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { if (left == player.chestX && top == player.chestY && player.chest != -1) { diff --git a/Tiles/FurnitureBotanic/BotanicChest.cs b/Tiles/FurnitureBotanic/BotanicChest.cs index 90242053ed..5032dfdef2 100644 --- a/Tiles/FurnitureBotanic/BotanicChest.cs +++ b/Tiles/FurnitureBotanic/BotanicChest.cs @@ -121,7 +121,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic NetMessage.SendData(33, -1, -1, NetworkText.FromLiteral(Main.chest[player.chest].name), player.chest, 1f, 0f, 0f, 0, 0, 0); player.editedChestName = false; } - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { if (left == player.chestX && top == player.chestY && player.chest >= 0) { diff --git a/Tiles/FurnitureBotanic/BotanicDresser.cs b/Tiles/FurnitureBotanic/BotanicDresser.cs index 5f54e414c2..4501b7e03b 100644 --- a/Tiles/FurnitureBotanic/BotanicDresser.cs +++ b/Tiles/FurnitureBotanic/BotanicDresser.cs @@ -83,7 +83,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic NetMessage.SendData(33, -1, -1, NetworkText.FromLiteral(Main.chest[player.chest].name), player.chest, 1f, 0f, 0f, 0, 0, 0); player.editedChestName = false; } - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { if (left == player.chestX && top == player.chestY && player.chest != -1) { diff --git a/Tiles/FurnitureCosmilite/CosmiliteChest.cs b/Tiles/FurnitureCosmilite/CosmiliteChest.cs index 032bb21cc3..a2f2867ff4 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteChest.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteChest.cs @@ -121,7 +121,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite NetMessage.SendData(33, -1, -1, NetworkText.FromLiteral(Main.chest[player.chest].name), player.chest, 1f, 0f, 0f, 0, 0, 0); player.editedChestName = false; } - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { if (left == player.chestX && top == player.chestY && player.chest >= 0) { diff --git a/Tiles/FurnitureCosmilite/CosmiliteDresser.cs b/Tiles/FurnitureCosmilite/CosmiliteDresser.cs index 7cce105add..b904ee8d4c 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteDresser.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteDresser.cs @@ -82,7 +82,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite NetMessage.SendData(33, -1, -1, NetworkText.FromLiteral(Main.chest[player.chest].name), player.chest, 1f, 0f, 0f, 0, 0, 0); player.editedChestName = false; } - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { if (left == player.chestX && top == player.chestY && player.chest != -1) { diff --git a/Tiles/FurnitureEutrophic/EutrophicChest.cs b/Tiles/FurnitureEutrophic/EutrophicChest.cs index 91bce35b8c..5720d3efab 100644 --- a/Tiles/FurnitureEutrophic/EutrophicChest.cs +++ b/Tiles/FurnitureEutrophic/EutrophicChest.cs @@ -120,7 +120,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic NetMessage.SendData(33, -1, -1, NetworkText.FromLiteral(Main.chest[player.chest].name), player.chest, 1f, 0f, 0f, 0, 0, 0); player.editedChestName = false; } - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { if (left == player.chestX && top == player.chestY && player.chest >= 0) { diff --git a/Tiles/FurnitureEutrophic/EutrophicDresser.cs b/Tiles/FurnitureEutrophic/EutrophicDresser.cs index b70385ccfe..41454aa99b 100644 --- a/Tiles/FurnitureEutrophic/EutrophicDresser.cs +++ b/Tiles/FurnitureEutrophic/EutrophicDresser.cs @@ -82,7 +82,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic NetMessage.SendData(33, -1, -1, NetworkText.FromLiteral(Main.chest[player.chest].name), player.chest, 1f, 0f, 0f, 0, 0, 0); player.editedChestName = false; } - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { if (left == player.chestX && top == player.chestY && player.chest != -1) { diff --git a/Tiles/FurnitureOccult/OccultChest.cs b/Tiles/FurnitureOccult/OccultChest.cs index e8a27074dd..413835a0a1 100644 --- a/Tiles/FurnitureOccult/OccultChest.cs +++ b/Tiles/FurnitureOccult/OccultChest.cs @@ -121,7 +121,7 @@ namespace CalamityMod.Tiles.FurnitureOccult NetMessage.SendData(33, -1, -1, NetworkText.FromLiteral(Main.chest[player.chest].name), player.chest, 1f, 0f, 0f, 0, 0, 0); player.editedChestName = false; } - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { if (left == player.chestX && top == player.chestY && player.chest >= 0) { diff --git a/Tiles/FurnitureOccult/OccultDresser.cs b/Tiles/FurnitureOccult/OccultDresser.cs index 3fb6a01894..86050a2f1d 100644 --- a/Tiles/FurnitureOccult/OccultDresser.cs +++ b/Tiles/FurnitureOccult/OccultDresser.cs @@ -83,7 +83,7 @@ namespace CalamityMod.Tiles.FurnitureOccult NetMessage.SendData(33, -1, -1, NetworkText.FromLiteral(Main.chest[player.chest].name), player.chest, 1f, 0f, 0f, 0, 0, 0); player.editedChestName = false; } - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { if (left == player.chestX && top == player.chestY && player.chest != -1) { diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateChest.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateChest.cs index 6c0bee73a5..df8916fb02 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateChest.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateChest.cs @@ -120,7 +120,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate NetMessage.SendData(33, -1, -1, NetworkText.FromLiteral(Main.chest[player.chest].name), player.chest, 1f, 0f, 0f, 0, 0, 0); player.editedChestName = false; } - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { if (left == player.chestX && top == player.chestY && player.chest >= 0) { diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateDresser.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateDresser.cs index 279e2ae16e..511b584e8b 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateDresser.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateDresser.cs @@ -86,7 +86,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate NetMessage.SendData(33, -1, -1, NetworkText.FromLiteral(Main.chest[player.chest].name), player.chest, 1f, 0f, 0f, 0, 0, 0); player.editedChestName = false; } - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { if (left == player.chestX && top == player.chestY && player.chest != -1) { diff --git a/Tiles/FurnitureProfaned/ProfanedChest.cs b/Tiles/FurnitureProfaned/ProfanedChest.cs index 7256be202a..4e607a55f7 100644 --- a/Tiles/FurnitureProfaned/ProfanedChest.cs +++ b/Tiles/FurnitureProfaned/ProfanedChest.cs @@ -121,7 +121,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned NetMessage.SendData(33, -1, -1, NetworkText.FromLiteral(Main.chest[player.chest].name), player.chest, 1f, 0f, 0f, 0, 0, 0); player.editedChestName = false; } - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { if (left == player.chestX && top == player.chestY && player.chest >= 0) { diff --git a/Tiles/FurnitureProfaned/ProfanedDresser.cs b/Tiles/FurnitureProfaned/ProfanedDresser.cs index aa91306fba..6f7074c242 100644 --- a/Tiles/FurnitureProfaned/ProfanedDresser.cs +++ b/Tiles/FurnitureProfaned/ProfanedDresser.cs @@ -87,7 +87,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned NetMessage.SendData(33, -1, -1, NetworkText.FromLiteral(Main.chest[player.chest].name), player.chest, 1f, 0f, 0f, 0, 0, 0); player.editedChestName = false; } - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { if (left == player.chestX && top == player.chestY && player.chest != -1) { diff --git a/Tiles/FurnitureSilva/SilvaChest.cs b/Tiles/FurnitureSilva/SilvaChest.cs index d1a28f3967..9d138576c0 100644 --- a/Tiles/FurnitureSilva/SilvaChest.cs +++ b/Tiles/FurnitureSilva/SilvaChest.cs @@ -121,7 +121,7 @@ namespace CalamityMod.Tiles.FurnitureSilva NetMessage.SendData(33, -1, -1, NetworkText.FromLiteral(Main.chest[player.chest].name), player.chest, 1f, 0f, 0f, 0, 0, 0); player.editedChestName = false; } - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { if (left == player.chestX && top == player.chestY && player.chest >= 0) { diff --git a/Tiles/FurnitureSilva/SilvaDresser.cs b/Tiles/FurnitureSilva/SilvaDresser.cs index 127ee96dcd..4c056f10d1 100644 --- a/Tiles/FurnitureSilva/SilvaDresser.cs +++ b/Tiles/FurnitureSilva/SilvaDresser.cs @@ -83,7 +83,7 @@ namespace CalamityMod.Tiles.FurnitureSilva NetMessage.SendData(33, -1, -1, NetworkText.FromLiteral(Main.chest[player.chest].name), player.chest, 1f, 0f, 0f, 0, 0, 0); player.editedChestName = false; } - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { if (left == player.chestX && top == player.chestY && player.chest != -1) { diff --git a/Tiles/FurnitureStatigel/StatigelChest.cs b/Tiles/FurnitureStatigel/StatigelChest.cs index c3c30028df..367a36c092 100644 --- a/Tiles/FurnitureStatigel/StatigelChest.cs +++ b/Tiles/FurnitureStatigel/StatigelChest.cs @@ -120,7 +120,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel NetMessage.SendData(33, -1, -1, NetworkText.FromLiteral(Main.chest[player.chest].name), player.chest, 1f, 0f, 0f, 0, 0, 0); player.editedChestName = false; } - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { if (left == player.chestX && top == player.chestY && player.chest >= 0) { diff --git a/Tiles/FurnitureStatigel/StatigelDresser.cs b/Tiles/FurnitureStatigel/StatigelDresser.cs index 1fd3022d7a..1da20d6bd7 100644 --- a/Tiles/FurnitureStatigel/StatigelDresser.cs +++ b/Tiles/FurnitureStatigel/StatigelDresser.cs @@ -81,7 +81,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel NetMessage.SendData(33, -1, -1, NetworkText.FromLiteral(Main.chest[player.chest].name), player.chest, 1f, 0f, 0f, 0, 0, 0); player.editedChestName = false; } - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { if (left == player.chestX && top == player.chestY && player.chest != -1) { diff --git a/Tiles/FurnitureStratus/StratusChest.cs b/Tiles/FurnitureStratus/StratusChest.cs index bd85b9bf75..715beeff87 100644 --- a/Tiles/FurnitureStratus/StratusChest.cs +++ b/Tiles/FurnitureStratus/StratusChest.cs @@ -121,7 +121,7 @@ namespace CalamityMod.Tiles.FurnitureStratus NetMessage.SendData(33, -1, -1, NetworkText.FromLiteral(Main.chest[player.chest].name), player.chest, 1f, 0f, 0f, 0, 0, 0); player.editedChestName = false; } - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { if (left == player.chestX && top == player.chestY && player.chest >= 0) { diff --git a/Tiles/FurnitureStratus/StratusDresser.cs b/Tiles/FurnitureStratus/StratusDresser.cs index 3b38dd2f4d..56965ec2f0 100644 --- a/Tiles/FurnitureStratus/StratusDresser.cs +++ b/Tiles/FurnitureStratus/StratusDresser.cs @@ -82,7 +82,7 @@ namespace CalamityMod.Tiles.FurnitureStratus NetMessage.SendData(33, -1, -1, NetworkText.FromLiteral(Main.chest[player.chest].name), player.chest, 1f, 0f, 0f, 0, 0, 0); player.editedChestName = false; } - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { if (left == player.chestX && top == player.chestY && player.chest != -1) { diff --git a/Tiles/FurnitureVoid/VoidChest.cs b/Tiles/FurnitureVoid/VoidChest.cs index 42b3a15d62..d4e0f5b3a9 100644 --- a/Tiles/FurnitureVoid/VoidChest.cs +++ b/Tiles/FurnitureVoid/VoidChest.cs @@ -120,7 +120,7 @@ namespace CalamityMod.Tiles.FurnitureVoid NetMessage.SendData(33, -1, -1, NetworkText.FromLiteral(Main.chest[player.chest].name), player.chest, 1f, 0f, 0f, 0, 0, 0); player.editedChestName = false; } - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { if (left == player.chestX && top == player.chestY && player.chest >= 0) { diff --git a/Tiles/FurnitureVoid/VoidDresser.cs b/Tiles/FurnitureVoid/VoidDresser.cs index 287c004c62..bcdebb9c1b 100644 --- a/Tiles/FurnitureVoid/VoidDresser.cs +++ b/Tiles/FurnitureVoid/VoidDresser.cs @@ -82,7 +82,7 @@ namespace CalamityMod.Tiles.FurnitureVoid NetMessage.SendData(33, -1, -1, NetworkText.FromLiteral(Main.chest[player.chest].name), player.chest, 1f, 0f, 0f, 0, 0, 0); player.editedChestName = false; } - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { if (left == player.chestX && top == player.chestY && player.chest != -1) { diff --git a/Tiles/PlantyMush.cs b/Tiles/PlantyMush.cs index 9b14238c71..81e551463f 100644 --- a/Tiles/PlantyMush.cs +++ b/Tiles/PlantyMush.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Tiles Main.tile[num53, num54].type = (ushort)mod.TileType("ViperVines"); Main.tile[num53, num54].active(true); WorldGen.SquareTileFrame(num53, num54, true); - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { NetMessage.SendTileSquare(-1, num53, num54, 3, TileChangeType.None); } diff --git a/Tiles/SulphurousSand.cs b/Tiles/SulphurousSand.cs index e93eed4020..4f6317c551 100644 --- a/Tiles/SulphurousSand.cs +++ b/Tiles/SulphurousSand.cs @@ -117,13 +117,13 @@ namespace CalamityMod.Tiles if (!Main.tile[i, tileLocationY].active()) { if (Main.tile[i, tileLocationY].liquid == 255 && Main.tile[i, tileLocationY - 1].liquid == 255 && - Main.tile[i, tileLocationY - 2].liquid == 255 && Main.netMode != 1) + Main.tile[i, tileLocationY - 2].liquid == 255 && Main.netMode != NetmodeID.MultiplayerClient) { Projectile.NewProjectile((float)(i * 16 + 16), (float)(tileLocationY * 16 + 16), 0f, -0.1f, mod.ProjectileType("SulphuricAcidCannon"), 0, 2f, Main.myPlayer, 0f, 0f); } if (i < 250 || i > Main.maxTilesX - 250) { - if (Main.rand.Next(400) == 0) + if (Main.rand.NextBool(400)) { if (Main.tile[i, tileLocationY].liquid == 255) { @@ -145,7 +145,7 @@ namespace CalamityMod.Tiles Main.tile[i, tileLocationY - 4].liquid == 255) { WorldGen.PlaceTile(i, tileLocationY, 81, true, false, -1, 0); - if (Main.netMode == 2 && Main.tile[i, tileLocationY].active()) + if (Main.netMode == NetmodeID.Server && Main.tile[i, tileLocationY].active()) { NetMessage.SendTileSquare(-1, i, tileLocationY, 1, TileChangeType.None); } @@ -169,7 +169,7 @@ namespace CalamityMod.Tiles if (num15 < num14) { WorldGen.PlaceTile(i, tileLocationY, 324, true, false, -1, Main.rand.Next(2)); - if (Main.netMode == 2 && Main.tile[i, tileLocationY].active()) + if (Main.netMode == NetmodeID.Server && Main.tile[i, tileLocationY].active()) { NetMessage.SendTileSquare(-1, i, tileLocationY, 1, TileChangeType.None); } diff --git a/Tiles/SunkenSea/BrainCoral.cs b/Tiles/SunkenSea/BrainCoral.cs index bddd27d828..e2512ecb84 100644 --- a/Tiles/SunkenSea/BrainCoral.cs +++ b/Tiles/SunkenSea/BrainCoral.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Tiles.SunkenSea { if (closer) { - if (Main.rand.Next(300) == 0) + if (Main.rand.NextBool(300)) { int tileLocationY = j - 1; if (Main.tile[i, tileLocationY] != null) @@ -40,7 +40,7 @@ namespace CalamityMod.Tiles.SunkenSea { if (Main.tile[i, tileLocationY].liquid == 255 && Main.tile[i, tileLocationY - 1].liquid == 255 && Main.tile[i, tileLocationY - 2].liquid == 255) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) Projectile.NewProjectile((float)(i * 16 + 16), (float)(tileLocationY * 16 + 16), 0f, -0.1f, mod.ProjectileType("CoralBubble"), 0, 0f, Main.myPlayer, 0f, 0f); } } diff --git a/Tiles/SunkenSea/Navystone.cs b/Tiles/SunkenSea/Navystone.cs index 05daf989de..a408dd4671 100644 --- a/Tiles/SunkenSea/Navystone.cs +++ b/Tiles/SunkenSea/Navystone.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Tiles.SunkenSea public override void RandomUpdate(int i, int j) { - if (Main.rand.Next(150) == 0) + if (Main.rand.NextBool(150)) { int random = WorldGen.genRand.Next(4); if (random == 0) @@ -85,7 +85,7 @@ namespace CalamityMod.Tiles.SunkenSea } Main.tile[i, j].frameX = (short)(WorldGen.genRand.Next(18) * 18); WorldGen.SquareTileFrame(i, j, true); - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { NetMessage.SendTileSquare(-1, i, j, 1, TileChangeType.None); } diff --git a/Tiles/SunkenSea/SeaPrism.cs b/Tiles/SunkenSea/SeaPrism.cs index 626e954c67..7bbe77eda7 100644 --- a/Tiles/SunkenSea/SeaPrism.cs +++ b/Tiles/SunkenSea/SeaPrism.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Tiles.SunkenSea public override void RandomUpdate(int i, int j) { - if (Main.rand.Next(50) == 0) + if (Main.rand.NextBool(50)) { int random = WorldGen.genRand.Next(4); if (random == 0) @@ -86,7 +86,7 @@ namespace CalamityMod.Tiles.SunkenSea } Main.tile[i, j].frameX = (short)(WorldGen.genRand.Next(18) * 18); WorldGen.SquareTileFrame(i, j, true); - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { NetMessage.SendTileSquare(-1, i, j, 1, TileChangeType.None); } diff --git a/Tiles/SunkenSea/SmallBrainCoral.cs b/Tiles/SunkenSea/SmallBrainCoral.cs index 11e1e78a97..38fd204828 100644 --- a/Tiles/SunkenSea/SmallBrainCoral.cs +++ b/Tiles/SunkenSea/SmallBrainCoral.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Tiles.SunkenSea { if (closer) { - if (Main.rand.Next(300) == 0) + if (Main.rand.NextBool(300)) { int tileLocationY = j - 1; if (Main.tile[i, tileLocationY] != null) @@ -40,7 +40,7 @@ namespace CalamityMod.Tiles.SunkenSea { if (Main.tile[i, tileLocationY].liquid == 255 && Main.tile[i, tileLocationY - 1].liquid == 255 && Main.tile[i, tileLocationY - 2].liquid == 255) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) Projectile.NewProjectile((float)(i * 16 + 16), (float)(tileLocationY * 16 + 16), 0f, -0.1f, mod.ProjectileType("CoralBubbleSmall"), 0, 1f, Main.myPlayer, 0f, 0f); } } diff --git a/Tiles/Tenebris.cs b/Tiles/Tenebris.cs index e48078b7a1..9cdc2710a0 100644 --- a/Tiles/Tenebris.cs +++ b/Tiles/Tenebris.cs @@ -74,7 +74,7 @@ namespace CalamityMod.Tiles { Main.tile[i, j].type = (ushort)mod.TileType("Tenebris"); WorldGen.SquareTileFrame(i, j, true); - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { NetMessage.SendTileSquare(-1, i, j, 1, TileChangeType.None); } diff --git a/Tiles/ViperVines.cs b/Tiles/ViperVines.cs index d529f0e522..97d81a243c 100644 --- a/Tiles/ViperVines.cs +++ b/Tiles/ViperVines.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Tiles if (Main.tile[i, j + 1].type == mod.TileType("ViperVines")) { WorldGen.KillTile(i, j + 1, false, false, false); - if (!Main.tile[i, j + 1].active() && Main.netMode != 0) + if (!Main.tile[i, j + 1].active() && Main.netMode != NetmodeID.SinglePlayer) { NetMessage.SendData(17, -1, -1, null, 0, (float)i, (float)j + 1, 0f, 0, 0, 0); } @@ -82,7 +82,7 @@ namespace CalamityMod.Tiles Main.tile[num53, num54].active(true); WorldGen.SquareTileFrame(num53, num54, true); WorldGen.SquareTileFrame(num53, num54 - 1, true); - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { NetMessage.SendTileSquare(-1, num53, num54, 3, TileChangeType.None); NetMessage.SendTileSquare(-1, num53, num54 - 1, 3, TileChangeType.None); diff --git a/Tiles/YellowCandle.cs b/Tiles/YellowCandle.cs index e04445ca46..8dc59f3505 100644 --- a/Tiles/YellowCandle.cs +++ b/Tiles/YellowCandle.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Tiles if (!player.dead && player.active) { player.AddBuff(mod.BuffType("YellowDamageCandle"), 20); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { for (int m = 0; m < 200; m++) { diff --git a/UI/AstralArcanumUI.cs b/UI/AstralArcanumUI.cs index ee0c113494..83464a0706 100644 --- a/UI/AstralArcanumUI.cs +++ b/UI/AstralArcanumUI.cs @@ -7,6 +7,7 @@ using Terraria.ModLoader; using CalamityMod.World; using CalamityMod.CalPlayer; +using Terraria.ID; namespace CalamityMod.UI { @@ -144,7 +145,7 @@ namespace CalamityMod.UI } Vector2 size = Main.fontMouseText.MeasureString(text); - Utils.DrawBorderStringFourWay(sb, Main.fontMouseText, text, CenterPoint.X - size.X / 2f, CenterPoint.Y + CircleOffset + CircleTextureSize / 2 + 4, Color.White, Color.Black, default(Vector2)); + Utils.DrawBorderStringFourWay(sb, Main.fontMouseText, text, CenterPoint.X - size.X / 2f, CenterPoint.Y + CircleOffset + CircleTextureSize / 2 + 4, Color.White, Color.Black, default); } public static void DoTeleportation(int circle) @@ -155,12 +156,12 @@ namespace CalamityMod.UI if (circle == 3) { - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { p.TeleportationPotion(); Main.PlaySound(2, (int)p.position.X, (int)p.position.Y, 6, 1f, 0f); } - else if (Main.netMode == 1) + else if (Main.netMode == NetmodeID.MultiplayerClient) { NetMessage.SendData(73, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); } diff --git a/UI/BossHealthBarManager.cs b/UI/BossHealthBarManager.cs index c5a5a7381d..2228be262a 100644 --- a/UI/BossHealthBarManager.cs +++ b/UI/BossHealthBarManager.cs @@ -1055,10 +1055,10 @@ namespace CalamityMod.UI continue; } - DynamicSpriteFontExtensionMethods.DrawString(sb, font, text, pos, border, 0f, default(Vector2), scale, SpriteEffects.None, 0f); + DynamicSpriteFontExtensionMethods.DrawString(sb, font, text, pos, border, 0f, default, scale, SpriteEffects.None, 0f); } } - DynamicSpriteFontExtensionMethods.DrawString(sb, font, text, position, main, 0f, default(Vector2), scale, SpriteEffects.None, 0f); + DynamicSpriteFontExtensionMethods.DrawString(sb, font, text, position, main, 0f, default, scale, SpriteEffects.None, 0f); } private bool IsEoW(int id) { diff --git a/World/CalamityWorld.cs b/World/CalamityWorld.cs index 616cf89fe7..cda9926b7d 100644 --- a/World/CalamityWorld.cs +++ b/World/CalamityWorld.cs @@ -711,11 +711,11 @@ namespace CalamityMod.World { string key = "Mods.CalamityMod.BossRushTierThreeEndText2"; Color messageColor = Color.LightCoral; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -724,11 +724,11 @@ namespace CalamityMod.World { string key = "Mods.CalamityMod.BossRushTierFourEndText2"; Color messageColor = Color.LightCoral; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -787,7 +787,7 @@ namespace CalamityMod.World } } } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { Main.PlaySound(SoundID.Roar, Main.player[closestPlayer].position, 0); switch (bossRushStage) @@ -959,7 +959,7 @@ namespace CalamityMod.World if (bossRushStage != 0) { bossRushStage = 0; - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { var netMessage = mod.GetPacket(); netMessage.Write((byte)CalamityModMessageType.BossRushStage); @@ -973,14 +973,14 @@ namespace CalamityMod.World if (DoGSecondStageCountdown > 0) //works { DoGSecondStageCountdown--; - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { var netMessage = mod.GetPacket(); netMessage.Write((byte)CalamityModMessageType.DoGCountdownSync); netMessage.Write(DoGSecondStageCountdown); netMessage.Send(); } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (DoGSecondStageCountdown == 21540) { @@ -1001,11 +1001,11 @@ namespace CalamityMod.World NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("DevourerofGodsHeadS")); string key = "Mods.CalamityMod.EdgyBossText10"; Color messageColor = Color.Cyan; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -1016,7 +1016,7 @@ namespace CalamityMod.World #endregion if (Main.player[closestPlayer].ZoneDungeon && !NPC.downedBoss3) { - if (!NPC.AnyNPCs(NPCID.DungeonGuardian) && Main.netMode != 1) + if (!NPC.AnyNPCs(NPCID.DungeonGuardian) && Main.netMode != NetmodeID.MultiplayerClient) NPC.SpawnOnPlayer(closestPlayer, NPCID.DungeonGuardian); //your hell is as vast as my bonergrin, pray your life ends quickly } if (Main.player[closestPlayer].ZoneRockLayerHeight && @@ -1057,7 +1057,7 @@ namespace CalamityMod.World int chance = (int)spawnRate; if (Main.rand.Next(chance) == 0) { - if (!NPC.AnyNPCs(mod.NPCType("ArmoredDiggerHead")) && Main.netMode != 1) + if (!NPC.AnyNPCs(mod.NPCType("ArmoredDiggerHead")) && Main.netMode != NetmodeID.MultiplayerClient) NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("ArmoredDiggerHead")); } } @@ -1066,10 +1066,10 @@ namespace CalamityMod.World { if (Main.player[closestPlayer].townNPCs >= 2f) { - if (Main.rand.Next(2000) == 0) + if (Main.rand.NextBool(2000)) { int steamGril = NPC.FindFirstNPC(NPCID.Steampunker); - if (steamGril == -1 && Main.netMode != 1) + if (steamGril == -1 && Main.netMode != NetmodeID.MultiplayerClient) NPC.SpawnOnPlayer(closestPlayer, NPCID.Steampunker); } } @@ -1078,19 +1078,19 @@ namespace CalamityMod.World { if (Main.player[closestPlayer].chaosState) { - if (!NPC.AnyNPCs(mod.NPCType("EidolonWyrmHeadHuge")) && Main.netMode != 1) + if (!NPC.AnyNPCs(mod.NPCType("EidolonWyrmHeadHuge")) && Main.netMode != NetmodeID.MultiplayerClient) NPC.SpawnOnPlayer(closestPlayer, mod.NPCType("EidolonWyrmHeadHuge")); } } - /*if (Main.rand.Next(100000000) == 0) + /*if (Main.rand.NextBool(100000000)) { string key = "Mods.CalamityMod.AprilFools"; Color messageColor = Color.Crimson; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } @@ -1100,7 +1100,7 @@ namespace CalamityMod.World { if (bossSpawnCountdown <= 0) //check for countdown being 0 { - if (Main.rand.Next(50000) == 0) + if (Main.rand.NextBool(50000)) { if (!NPC.downedBoss1 && bossType == 0) //only set countdown and boss type if conditions are met if (!Main.dayTime && (Main.player[closestPlayer].ZoneOverworldHeight || Main.player[closestPlayer].ZoneSkyHeight)) @@ -1261,7 +1261,7 @@ namespace CalamityMod.World } } } - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { var netMessage = mod.GetPacket(); netMessage.Write((byte)CalamityModMessageType.BossSpawnCountdownSync); @@ -1277,7 +1277,7 @@ namespace CalamityMod.World else { bossSpawnCountdown--; - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { var netMessage = mod.GetPacket(); netMessage.Write((byte)CalamityModMessageType.BossSpawnCountdownSync); @@ -1380,7 +1380,7 @@ namespace CalamityMod.World canSpawn = false; } - if (canSpawn && Main.netMode != 1) + if (canSpawn && Main.netMode != NetmodeID.MultiplayerClient) { if (bossType == NPCID.Spazmatism) NPC.SpawnOnPlayer(closestPlayer, NPCID.Retinazer); @@ -1400,7 +1400,7 @@ namespace CalamityMod.World NPC.SpawnOnPlayer(closestPlayer, bossType); } bossType = 0; - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { var netMessage = mod.GetPacket(); netMessage.Write((byte)CalamityModMessageType.BossTypeSync); @@ -1413,7 +1413,7 @@ namespace CalamityMod.World #endregion if (!NPC.downedBoss3 && revenge) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (Sandstorm.Happening) { @@ -1422,7 +1422,7 @@ namespace CalamityMod.World } } } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (revenge) { @@ -1455,11 +1455,11 @@ namespace CalamityMod.World { string key = "Mods.CalamityMod.BossSpawnText"; Color messageColor = Color.Crimson; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { Main.NewText(Language.GetTextValue(key), messageColor); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } diff --git a/World/SunkenSea.cs b/World/SunkenSea.cs index e39e331a58..3e50864db1 100644 --- a/World/SunkenSea.cs +++ b/World/SunkenSea.cs @@ -306,7 +306,7 @@ namespace CalamityMod.World int num = (int)(scale.X * (float)clusters.Width); int num2 = (int)(scale.Y * (float)clusters.Height); bool genCentalHole = true; - Rectangle rectangle = default(Rectangle); + Rectangle rectangle = default; int radius = (int)(((float)WorldGen.genRand.Next(24, 28)) * size); //Radius of the generated hole int diameter = radius * 2; Point point = new Point(WorldGen.UndergroundDesertLocation.Left + (WorldGen.UndergroundDesertLocation.Width / 2), diff --git a/World/WorldGenerationMethods.cs b/World/WorldGenerationMethods.cs index 4b32a3ffb0..7a1ca1a20e 100644 --- a/World/WorldGenerationMethods.cs +++ b/World/WorldGenerationMethods.cs @@ -236,7 +236,7 @@ namespace CalamityMod.World depthLimit = 0.14f; if (y > 1500) { depthLimit = 0.1f; if (y > 2100) { depthLimit = 0.07f; } } } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { for (int k = 0; k < (int)((double)(x * y) * frequency); k++) { @@ -341,7 +341,7 @@ namespace CalamityMod.World bool meteorDropped = true; // Clients in multiplayer don't drop meteors. - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) return; for (int i = 0; i < 255; i++) { @@ -425,9 +425,9 @@ namespace CalamityMod.World string key = "Mods.CalamityMod.AstralText"; Color messageColor = Color.Gold; - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) Main.NewText(Language.GetTextValue(key), messageColor); - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); break; } @@ -571,7 +571,7 @@ namespace CalamityMod.World { for (int num18 = j - num; num18 < j + num; num18++) { - if (num18 > j + WorldGen.genRand.Next(-3, 4) - 3 && Main.tile[num17, num18].active() && Main.rand.Next(10) == 0) + if (num18 > j + WorldGen.genRand.Next(-3, 4) - 3 && Main.tile[num17, num18].active() && Main.rand.NextBool(10)) { float num19 = (float)Math.Abs(i - num17); float num20 = (float)Math.Abs(j - num18); @@ -596,7 +596,7 @@ namespace CalamityMod.World { for (int num23 = j - num; num23 < j + num; num23++) { - if (num23 > j + WorldGen.genRand.Next(-2, 3) && Main.tile[num22, num23].active() && Main.rand.Next(20) == 0) + if (num23 > j + WorldGen.genRand.Next(-2, 3) && Main.tile[num22, num23].active() && Main.rand.NextBool(20)) { float num24 = (float)Math.Abs(i - num22); float num25 = (float)Math.Abs(j - num23); @@ -616,7 +616,7 @@ namespace CalamityMod.World } } } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { NetMessage.SendTileSquare(-1, i, j, 40, TileChangeType.None); if (CanAstralBiomeSpawn()) @@ -649,26 +649,25 @@ namespace CalamityMod.World { for (int y = (int)(origin.Y - verticalRadius * 0.4f) - 3; y <= origin.Y + verticalRadius + 3; y++) { - float dist; - if (CheckInEllipse(new Point(x, y), topFoci, bottomFoci, constant, center, out dist, y < origin.Y)) - { - //If we're in the outer blurPercent% of the ellipse - float percent = dist / constant; - float blurPercent = 0.98f; - if (percent > blurPercent) - { - float outerEdgePercent = (percent - blurPercent) / (1f - blurPercent); - if (Main.rand.NextFloat(1f) > outerEdgePercent) - { - ConvertToAstral(x, y); - } - } - else - { - ConvertToAstral(x, y); - } - } - } + if (CheckInEllipse(new Point(x, y), topFoci, bottomFoci, constant, center, out float dist, y < origin.Y)) + { + //If we're in the outer blurPercent% of the ellipse + float percent = dist / constant; + float blurPercent = 0.98f; + if (percent > blurPercent) + { + float outerEdgePercent = (percent - blurPercent) / (1f - blurPercent); + if (Main.rand.NextFloat(1f) > outerEdgePercent) + { + ConvertToAstral(x, y); + } + } + else + { + ConvertToAstral(x, y); + } + } + } } } @@ -911,11 +910,11 @@ namespace CalamityMod.World } if (tileframe) { - if (Main.netMode == 0) + if (Main.netMode == NetmodeID.SinglePlayer) { WorldGen.SquareTileFrame(x, y, true); } - else if (Main.netMode == 2) + else if (Main.netMode == NetmodeID.Server) { NetMessage.SendTileSquare(-1, x, y, 1); }