From 613aa4c334d36dd70b636705459a6f1fde4b3bfd Mon Sep 17 00:00:00 2001 From: Jofairden Date: Tue, 11 Jul 2017 17:23:13 +0200 Subject: [PATCH] Enforced coding style on project --- AlchemistItem.cs | 11 +- Angle.cs | 8 +- Buffs/AnnoyingDogBuff.cs | 2 +- Buffs/BruttyBuff.cs | 2 +- Buffs/EmeraldStoneBuff.cs | 2 +- Buffs/GoldenWhale.cs | 2 +- Buffs/GurdPetBuff.cs | 2 +- Buffs/LivingTombstoneBuff.cs | 2 +- Buffs/MudDollBuff.cs | 2 +- Buffs/NebulaJellyfishBuff.cs | 2 +- Buffs/SolarMeteorBuff.cs | 2 +- Buffs/StardustSquidBuff.cs | 2 +- Buffs/TremorBuffs.cs | 3 +- Buffs/VortexBeeBuff.cs | 2 +- Buffs/WarkeeBuff.cs | 2 +- Buffs/ZootalooBuff.cs | 2 +- Buffs/petGenie.cs | 7 +- CustomDrop.cs | 2 +- CustomWorldData.cs | 17 +- DungeonGenn/DungeonWorld.cs | 41 ++- Dusts/SoulofHopeDust.cs | 2 +- Dusts/SoulofTrustDust.cs | 2 +- Dusts/SoulofTruthDust.cs | 2 +- GItem.cs | 9 +- Gores/IceDroplet.cs | 10 +- Helper.cs | 46 ++-- Helper2.cs | 8 +- Ice/Dungeon/DungeonWallItem.cs | 2 +- Ice/IceChest.cs | 16 +- Ice/IceColl1.cs | 4 +- Ice/IceColl2.cs | 4 +- Ice/IceWallW.cs | 2 +- Ice/Items/FrostLance.cs | 2 +- Ice/Items/FrostLiquidFlaskPro.cs | 6 +- Ice/Items/FrozenPaxe.cs | 4 +- Ice/Items/Furniture/IceBathtubTile.cs | 2 +- Ice/Items/Furniture/IceBedTile.cs | 2 +- Ice/Items/Furniture/IceBookcaseTile.cs | 2 +- Ice/Items/Furniture/IceCandelabraTile.cs | 1 - Ice/Items/Furniture/IceChairTile.cs | 2 +- Ice/Items/Furniture/IceChandelierTile.cs | 2 +- Ice/Items/Furniture/IceChestTile.cs | 16 +- Ice/Items/Furniture/IceDoorClosed.cs | 2 +- Ice/Items/Furniture/IceDoorOpen.cs | 2 +- Ice/Items/Furniture/IceDresserTile.cs | 21 +- .../Furniture/IceGrandfatherClockTile.cs | 2 +- Ice/Items/Furniture/IceLampTile.cs | 2 +- Ice/Items/Furniture/IceLanternTile.cs | 2 +- Ice/Items/Furniture/IcePianoTile.cs | 2 +- Ice/Items/Furniture/IcePlatformTile.cs | 2 +- Ice/Items/Furniture/IceSinkTile.cs | 2 +- Ice/Items/Furniture/IceTableTile.cs | 2 +- Ice/Items/Furniture/IceWorkbenchTile.cs | 2 +- Ice/Items/GlacierArmchairTile.cs | 2 +- Ice/Items/GlacierKnives.cs | 8 +- Ice/Items/GlacierKnivesProj.cs | 11 +- Ice/Items/GlacierWoodBow.cs | 2 +- Ice/Items/Icoj.cs | 4 +- Ice/Mobs/ColdtrapChain.cs | 6 +- Ice/Mobs/Dot.cs | 6 +- Ice/Mobs/Frostbyte.cs | 12 +- Ice/Mobs/Glacier.cs | 8 +- Ice/Mobs/IceWolf.cs | 8 +- Ice/Mobs/WhiteHound.cs | 4 +- Ice/Mobs/WhiteWalker.cs | 8 +- Ice/Tree/TremorSapling.cs | 4 +- Ice/Tree/TremorTree.cs | 8 +- Invasion/ClockofTime.cs | 11 +- Invasion/CyberLaser.cs | 1 - Invasion/CyberLaserBat.cs | 2 +- Invasion/CyberWrathInvasion.cs | 5 +- Invasion/EndlessPain.cs | 2 +- Invasion/InvasionWorld.cs | 8 +- Invasion/InvisibleSoul.cs | 130 +++++---- Invasion/MiniSoul.cs | 7 +- Invasion/ParadoxBat.cs | 82 +++--- Invasion/ParadoxCohortMusicBoxTile.cs | 2 +- Invasion/ParadoxElement.cs | 1 - Invasion/ParadoxSun.cs | 48 ++-- Invasion/Relayx.cs | 3 +- Invasion/RelayxDragon.cs | 13 +- Invasion/RelayxDragonBig.cs | 13 +- Invasion/RelayxProj.cs | 11 +- Invasion/StrayStaff.cs | 2 +- Invasion/Titan.cs | 12 +- Invasion/TitanCrystal_.cs | 2 +- Invasion/Titan_.cs | 2 +- Invasion/Violeum.cs | 79 +++--- InvasionSky.cs | 4 +- Items/AbyssBreastplate.cs | 2 +- Items/AbyssGreaves.cs | 2 +- Items/AbyssHeadgear.cs | 6 +- Items/AdamantiteDisc.cs | 2 +- Items/AdamantiteHat.cs | 2 +- Items/AdamantiteHeader.cs | 2 +- Items/AdamantiteRifle.cs | 2 +- Items/AdamantiteStaff.cs | 2 +- Items/AdamantiteVisage.cs | 2 +- Items/AdvancedCircuit.cs | 2 +- Items/AlchemistFocus.cs | 2 +- Items/AlchemistGlove.cs | 2 +- Items/AlienBlaster.cs | 8 +- Items/AmethystBlade.cs | 2 +- Items/AmethystDrill.cs | 2 +- Items/AmplifiedEnchantmentSolution.cs | 4 +- Items/AncientClaymore.cs | 2 +- Items/AncientMosaic.cs | 2 +- Items/AncientSmasher.cs | 2 +- Items/AncientSolarWind.cs | 2 +- Items/AncientSunStaff.cs | 2 +- Items/AncientVisionStaff.cs | 2 +- Items/AndasCore.cs | 4 +- Items/AngelFlameSword.cs | 2 +- Items/AngelicTears.cs | 5 +- Items/AngeliteBar.cs | 5 +- Items/AngeliteOre.cs | 5 +- Items/AntiqueStave.cs | 6 +- Items/AntlionFury.cs | 2 +- Items/ArgiteBroadsword.cs | 4 +- Items/ArgiteHamaxe.cs | 4 +- Items/ArgiteHelmet.cs | 2 +- Items/ArgitePickaxe.cs | 4 +- Items/ArtifactEngine.cs | 2 +- Items/Awakening.cs | 2 +- Items/BadApple.cs | 2 +- Items/Banhammer.cs | 5 +- Items/BasicFlask.cs | 2 +- Items/BasicSprayer.cs | 4 +- Items/BeetleShield.cs | 2 +- Items/BestNightmare.cs | 5 +- Items/BigBottledSpirit.cs | 4 +- Items/BigHealingFlack.cs | 2 +- Items/BigManaFlask.cs | 2 +- Items/BigPoisonFlask.cs | 2 +- Items/BigVenomFlask.cs | 2 +- Items/BlackCauldron.cs | 1 - Items/BlackRose.cs | 2 +- Items/BladeofDarkness.cs | 2 +- Items/BloodCarnage.cs | 2 +- Items/BloodmoonPotion.cs | 2 +- Items/BloodyBow.cs | 4 +- Items/BlueCrossguardPhasesaber.cs | 2 +- Items/BlueSakura.cs | 2 +- Items/Bolter.cs | 2 +- Items/BoneGreaves.cs | 2 +- Items/BoneHelmet.cs | 2 +- Items/BoneRepeater.cs | 4 +- Items/BoneShell.cs | 2 +- Items/Bonecrusher.cs | 2 +- Items/BoomFlask.cs | 2 +- Items/Boonerang.cs | 2 +- Items/BottledGlue.cs | 2 +- Items/BottledSoulOfFlight.cs | 2 +- Items/BottledSoulOfFright.cs | 2 +- Items/BottledSoulOfLight.cs | 2 +- Items/BottledSoulOfMight.cs | 2 +- Items/BottledSoulOfMind.cs | 2 +- Items/BottledSoulOfNight.cs | 2 +- Items/BottledSoulOfSight.cs | 2 +- Items/BottledSpirit.cs | 2 +- Items/BouncingCasing.cs | 2 +- Items/Brainiac.cs | 2 +- Items/BrambleStaff.cs | 6 +- Items/BrassChainRepeater.cs | 6 +- Items/BrassChestplate.cs | 2 +- Items/BrassGlaive.cs | 6 +- Items/BrassGreaves.cs | 2 +- Items/BrassHammer.cs | 2 +- Items/BrassHeadgear.cs | 2 +- Items/BrassHelmet.cs | 2 +- Items/BrassMask.cs | 2 +- Items/BrassPickaxeAxe.cs | 2 +- Items/BrassRapier.cs | 6 +- Items/BrassStave.cs | 8 +- Items/BrutalliskCrystal.cs | 2 +- Items/BulbTorch.cs | 2 +- Items/BurningFlask.cs | 2 +- Items/Candent.cs | 2 +- Items/CandyBlaster.cs | 2 +- Items/Carrow.cs | 2 +- Items/ChainBow.cs | 2 +- Items/Chainjaw.cs | 2 +- Items/ChaosBreastplate.cs | 2 +- Items/ChaosWings.cs | 2 +- Items/Chemikaze.cs | 4 +- Items/ChemistHelmet.cs | 2 +- Items/ChlorophyteDeadshooter.cs | 2 +- Items/ChlorophyteHat.cs | 2 +- Items/ChlorophyteHeader.cs | 2 +- Items/ChlorophyteVisage.cs | 2 +- Items/ClusterFlask.cs | 2 +- Items/CobaltDisc.cs | 2 +- Items/CobaltHeader.cs | 2 +- Items/CobaltHeadgear.cs | 2 +- Items/CobaltRifle.cs | 2 +- Items/CobaltStaff.cs | 2 +- Items/CobaltVisage.cs | 2 +- Items/ColdMetalWings.cs | 2 +- Items/ColdTooth.cs | 3 +- Items/CollapsiumBar.cs | 5 +- Items/CollapsiumOre.cs | 5 +- Items/CopperShield.cs | 2 +- Items/CoralHelmet.cs | 2 +- Items/CorruptorGun.cs | 2 +- Items/CorruptorStaff.cs | 2 +- Items/CosmicAssaultRifle.cs | 2 +- Items/CosmicKrill.cs | 2 +- Items/CreeperStaff.cs | 2 +- Items/CrimtaneProtector.cs | 2 +- Items/CrossBlast.cs | 4 +- Items/Crossbow.cs | 2 +- Items/Crusher.cs | 4 +- Items/CrystalChainmer.cs | 2 +- Items/CrystalChestplate.cs | 2 +- Items/CrystalDrill.cs | 2 +- Items/CrystalFlask.cs | 2 +- Items/CrystalGreaves.cs | 2 +- Items/CrystalHelmet.cs | 2 +- Items/CrystalPickaxe.cs | 2 +- Items/CrystalWarhamaxe.cs | 2 +- Items/CrystalWhirlwind.cs | 2 +- Items/CursedCauldron.cs | 1 - Items/CursedKnife.cs | 4 +- Items/CursedPopcorn.cs | 2 +- Items/CyberCutter.cs | 3 +- Items/CyberStaff.cs | 2 +- Items/DangerBlade.cs | 7 +- Items/DarkAbsorber.cs | 2 +- Items/Darkhalis.cs | 2 +- Items/DarknessDust.cs | 2 +- Items/DeadFlower.cs | 2 +- Items/DeadHead.cs | 2 +- Items/DeadlyTreats.cs | 2 +- Items/DeathFormula.cs | 2 +- Items/Decayed.cs | 2 +- Items/DemoniteProtector.cs | 2 +- Items/DesertClaymore.cs | 4 +- Items/DesertCrown.cs | 2 +- Items/Destructor.cs | 2 +- Items/Devastator.cs | 2 +- Items/DiamondBlade.cs | 2 +- Items/DiamondDrill.cs | 2 +- Items/DivineClaymore.cs | 5 +- Items/DivineForge.cs | 5 +- Items/DivineGift.cs | 2 +- Items/DoomKey.cs | 2 +- Items/Doomstick.cs | 2 +- Items/DragonRafale.cs | 2 +- Items/DukeFlask.cs | 2 +- Items/EaterofWorld.cs | 2 +- Items/EdgeofFrostKing.cs | 2 +- Items/EmeraldBlade.cs | 2 +- Items/EmeraldDrill.cs | 2 +- Items/EmperorCrown.cs | 2 +- Items/EnchantedHealthBooster.cs | 2 +- Items/EnchantedHourglass.cs | 2 +- Items/EnchantedManaBooster.cs | 2 +- Items/EnchantmentSolution.cs | 4 +- Items/EternalAgony.cs | 3 +- Items/ExecutionerAxe.cs | 2 +- Items/ExtendedBoomFlask.cs | 6 +- Items/ExtendedBurningFlask.cs | 2 +- Items/ExtendedFreezeFlask.cs | 2 +- Items/EyeofInfinity.cs | 4 +- Items/Eyezor.cs | 2 +- Items/FeatherStorm.cs | 2 +- Items/FiercePaw.cs | 2 +- Items/FlamesofDespair.cs | 2 +- Items/FlamingTooth.cs | 3 +- Items/FlaskCore.cs | 2 +- Items/FleshWings.cs | 2 +- Items/FlowerofAntimony.cs | 2 +- Items/FreezeFlask.cs | 2 +- Items/FrostCrown.cs | 2 +- Items/FrostFreshness.cs | 2 +- Items/FrostbiteHelmet.cs | 2 +- Items/Frostbiter.cs | 8 +- Items/FrostbittenBall.cs | 3 +- Items/FrozenTurtleShield.cs | 2 +- Items/FungusBreastplate.cs | 2 +- Items/FungusBroadsword.cs | 2 +- Items/FungusGreaves.cs | 2 +- Items/FungusHelmet.cs | 2 +- Items/Galaxon.cs | 29 +- Items/GehennaStaff.cs | 7 +- Items/GenieLamp.cs | 4 +- Items/GhostlyHowl.cs | 24 +- Items/GlobalItems.cs | 2 +- Items/GlowingRod.cs | 2 +- Items/GoldFlask.cs | 2 +- Items/GoldShield.cs | 2 +- Items/GoldenCube.cs | 2 +- Items/GoldenDust.cs | 2 +- Items/GoldenMace.cs | 2 +- Items/GoldfishStaff.cs | 2 +- Items/GraniteHelmet.cs | 2 +- Items/GreenCrossguardPhasesaber.cs | 2 +- Items/GrossBow.cs | 2 +- Items/GuardianHammer.cs | 2 +- Items/GunslingerFocus.cs | 2 +- Items/GunslingerSoul.cs | 2 +- Items/Gurumaster.cs | 2 +- Items/HadesBreastplate.cs | 7 +- Items/HadesGreaves.cs | 7 +- Items/HadesHelmet.cs | 7 +- Items/HallowedHat.cs | 2 +- Items/HallowedHeader.cs | 2 +- Items/HallowedVisage.cs | 2 +- Items/HarpyChestplate.cs | 2 +- Items/HarpyHelmet.cs | 2 +- Items/HarpyHood.cs | 2 +- Items/HarpyLeggings.cs | 2 +- Items/HarpyMask.cs | 2 +- Items/HarvesterScythe.cs | 2 +- Items/HealthBooster.cs | 2 +- Items/HealthSupportFlask.cs | 2 +- Items/HeatCore.cs | 8 +- Items/HeavyBeamCannon.cs | 2 +- Items/HellStorm.cs | 7 +- Items/HeroPotion.cs | 7 +- Items/HeroShield.cs | 2 +- Items/HolyDust.cs | 2 +- Items/HolyShield.cs | 2 +- Items/HonestBlade.cs | 7 +- Items/HornedWarHammer.cs | 2 +- Items/HungryStaff.cs | 2 +- Items/HuskofDusk.cs | 2 +- Items/IceDrill.cs | 2 +- Items/IceSoul.cs | 2 +- Items/IchorKnife.cs | 4 +- Items/Igniter.cs | 2 +- Items/Incinerator.cs | 2 +- Items/Infector.cs | 2 +- Items/InfernalShield.cs | 4 +- Items/Infernality.cs | 2 +- Items/Inferno.cs | 5 +- Items/InfernoSkull.cs | 7 +- Items/InfernoSoul.cs | 5 +- Items/InspirationPotion.cs | 2 +- Items/InvaderStaff.cs | 2 +- Items/IronShield.cs | 2 +- Items/JellyfishStaff.cs | 2 +- Items/Jellyxir.cs | 2 +- Items/JungleWrath.cs | 2 +- Items/LasCannon.cs | 2 +- Items/LeadShield.cs | 2 +- Items/LeafBall.cs | 3 +- Items/LesserHealingFlack.cs | 2 +- Items/LesserManaFlask.cs | 2 +- Items/LesserPoisonFlask.cs | 2 +- Items/LesserVenomFlask.cs | 2 +- Items/LightningOrb.cs | 6 +- Items/LightningStaff.cs | 2 +- Items/LinearBurst.cs | 4 +- Items/LivingTombstone.cs | 2 +- Items/LivingWoodBreastplate.cs | 2 +- Items/LivingWoodGreaves.cs | 2 +- Items/LivingWoodMask.cs | 2 +- Items/LivingWoodThreepeater.cs | 2 +- Items/M29.cs | 2 +- Items/MagicalGreaves.cs | 2 +- Items/MagicalHat.cs | 2 +- Items/MagicalRobe.cs | 2 +- Items/MagiumRod.cs | 22 +- Items/MagmoniumHelmet.cs | 2 +- Items/MagmoniumWings.cs | 2 +- Items/ManaBooster.cs | 2 +- Items/ManaSupportFlask.cs | 2 +- Items/ManiacChainsaw.cs | 2 +- Items/MarbleBreastplate.cs | 4 +- Items/MarbleHelmet.cs | 4 +- Items/MarbleLeggings.cs | 4 +- Items/MartianCommunicator.cs | 2 +- Items/MartianSprayer.cs | 4 +- Items/MeatShield.cs | 2 +- Items/MechaSprayer.cs | 4 +- Items/MechanicalBrain.cs | 2 +- Items/Megalodon.cs | 2 +- Items/Megavolt.cs | 24 +- Items/MeteorBlade.cs | 2 +- Items/MeteorScepter.cs | 2 +- Items/MoltenHeart.cs | 2 +- Items/MoltenLance.cs | 4 +- Items/MoltenStaff.cs | 2 +- Items/MoonDustFlask.cs | 2 +- Items/MoonFlash.cs | 2 +- Items/MoonLash.cs | 2 +- Items/Motherboard.cs | 2 +- Items/MultidimensionalFragment.cs | 2 +- Items/MushroomCrystal.cs | 2 +- Items/MysteriousDrum.cs | 2 +- Items/MythrilDisc.cs | 2 +- Items/MythrilHeader.cs | 2 +- Items/MythrilMask.cs | 2 +- Items/MythrilRifle.cs | 2 +- Items/MythrilStaff.cs | 2 +- Items/MythrilVisage.cs | 2 +- Items/NanoBlade.cs | 2 +- Items/NanoDrill.cs | 2 +- Items/NanoHelmet.cs | 2 +- Items/NanoJackhammer.cs | 2 +- Items/NanoSaw.cs | 2 +- Items/Narsil.cs | 4 +- Items/NebulaBand.cs | 2 +- Items/NecromancerArmor.cs | 2 +- Items/NecromancerBelt.cs | 2 +- Items/NecromancerClaymore.cs | 2 +- Items/Necronomicon.cs | 2 +- Items/NightCore.cs | 2 +- Items/NightDusk.cs | 3 +- Items/NightFury.cs | 3 +- Items/NightingaleHood.cs | 2 +- Items/NightmareSprayer.cs | 4 +- Items/Nitro.cs | 2 +- Items/NorthStaff.cs | 2 +- Items/NovaBand.cs | 2 +- Items/NuclearStar.cs | 6 +- Items/Obscuritron.cs | 2 +- Items/ObsidianHeart.cs | 2 +- Items/ObsidianSaber.cs | 2 +- Items/OceanBate.cs | 2 +- Items/OmnikronBar.cs | 7 +- Items/OmnikronBreastplate.cs | 5 +- Items/OmnikronGreaves.cs | 5 +- Items/OmnikronHeadgear.cs | 5 +- Items/OmnikronHelmet.cs | 5 +- Items/OmnikronMask.cs | 6 +- Items/Opal.cs | 2 +- Items/OrichalcumDisc.cs | 2 +- Items/OrichalcumHeader.cs | 2 +- Items/OrichalcumHeadgear.cs | 2 +- Items/OrichalcumRifle.cs | 2 +- Items/OrichalcumStaff.cs | 2 +- Items/OrichalcumVisage.cs | 2 +- Items/PainWheel.cs | 3 +- Items/PalladiumDisc.cs | 2 +- Items/PalladiumHat.cs | 2 +- Items/PalladiumHeader.cs | 2 +- Items/PalladiumRifle.cs | 2 +- Items/PalladiumStaff.cs | 2 +- Items/PalladiumVisage.cs | 2 +- Items/Pandemonium.cs | 13 +- Items/ParatrooperShotgun.cs | 2 +- Items/ParaxydeAxe.cs | 4 +- Items/ParaxydeCleaver.cs | 4 +- Items/ParaxydeHammer.cs | 4 +- Items/ParaxydePickaxe.cs | 4 +- Items/ParaxydeShard.cs | 2 +- Items/ParaxydeStave.cs | 2 +- Items/ParaxydeStormbow.cs | 2 +- Items/PartyOver.cs | 2 +- Items/PatronoftheMind.cs | 2 +- Items/Permafrost.cs | 2 +- Items/PetalBand.cs | 2 +- Items/Phantablast.cs | 2 +- Items/PhantomFlask.cs | 2 +- Items/PhantomSoul.cs | 2 +- Items/PharaohBlade.cs | 2 +- Items/PhilosophersFlower.cs | 2 +- Items/PhoenixShotgun.cs | 2 +- Items/PirahnaStaff.cs | 2 +- Items/PixiePulse.cs | 2 +- Items/PixieinaJar.cs | 2 +- Items/PlagueBreastplate.cs | 2 +- Items/PlagueFlask.cs | 2 +- Items/PlagueGreaves.cs | 2 +- Items/PlagueHelmet.cs | 2 +- Items/PlaguedBow.cs | 2 +- Items/PlatinumShield.cs | 2 +- Items/PlazmaSword.cs | 2 +- Items/Poseidon.cs | 2 +- Items/PrizmaticSword.cs | 6 +- Items/PurpleCrossguardPhasesaber.cs | 2 +- Items/Pyro.cs | 2 +- Items/Quadratron.cs | 2 +- Items/QuetzalcoatlStave.cs | 2 +- Items/RainStaff.cs | 4 +- Items/RavenBreastplate.cs | 2 +- Items/RavenClaymore.cs | 2 +- Items/RavenGreaves.cs | 2 +- Items/RavenHeadgear.cs | 2 +- Items/RedCrossguardPhasesaber.cs | 2 +- Items/RedFeatherWings.cs | 2 +- Items/RedSteelBroadsword.cs | 2 +- Items/RedStorm.cs | 36 +-- Items/ReinforcedBurst.cs | 4 +- Items/RetributionofAbraxas.cs | 2 +- Items/Revolwar.cs | 5 +- Items/RichMahoganySeed.cs | 2 +- Items/RockClimberPotion.cs | 2 +- Items/RockStompers.cs | 2 +- Items/RoundBlast.cs | 4 +- Items/RoyalDaggers.cs | 24 +- Items/RoyalEgg.cs | 2 +- Items/RubyBlade.cs | 2 +- Items/RubyDrill.cs | 2 +- Items/RustySword.cs | 2 +- Items/SacredCross.cs | 2 +- Items/SacrificalPickaxe.cs | 2 +- Items/Sanctifier.cs | 2 +- Items/SapphireBlade.cs | 2 +- Items/SapphireDrill.cs | 2 +- Items/SavingPotion.cs | 2 +- Items/ScamperPotion.cs | 2 +- Items/ScarredReaper.cs | 2 +- Items/ScorpionStinger.cs | 2 +- Items/ScourgeofFlames.cs | 2 +- Items/ShadowMasterChestplate.cs | 2 +- Items/ShadowMasterHood.cs | 8 +- Items/ShadowMasterPants.cs | 2 +- Items/ShadowRelic.cs | 6 +- Items/ShadowStaff.cs | 2 +- Items/ShadowTooth.cs | 3 +- Items/ShadowWings.cs | 2 +- Items/SharkRage.cs | 2 +- Items/Sharkhalis.cs | 2 +- Items/ShiningAxe.cs | 2 +- Items/ShockwaveClaymore.cs | 2 +- Items/ShroomiteMechanicalBoots.cs | 2 +- Items/ShroomiteMinigun.cs | 2 +- Items/ShroomiteRocketLauncher.cs | 2 +- Items/SilverShield.cs | 2 +- Items/Skullheart.cs | 8 +- Items/SlimeFlail.cs | 3 +- Items/SnakeDevourer.cs | 2 +- Items/SnowShotgun.cs | 2 +- Items/SnowballChaingun.cs | 2 +- Items/SolarBand.cs | 2 +- Items/SorcererFocus.cs | 2 +- Items/SorcererSoul.cs | 2 +- Items/SoulEruption.cs | 2 +- Items/SoulofFight.cs | 2 +- Items/SoulofMind.cs | 2 +- Items/SparkingFlask.cs | 2 +- Items/SpectralBlade.cs | 1 - Items/SpectreNecklace.cs | 2 +- Items/SpectreTaroCards.cs | 2 +- Items/SpiderMeat.cs | 2 +- Items/SpineBlade.cs | 2 +- Items/Sporaxe.cs | 4 +- Items/SporeDust.cs | 2 +- Items/SquareBlast.cs | 4 +- Items/Squorb.cs | 2 +- Items/StarBlaster.cs | 2 +- Items/StarBound.cs | 24 +- Items/StarDrill.cs | 7 +- Items/StardustBand.cs | 2 +- Items/StarlightGlimmer.cs | 2 +- Items/StartrooperFlameburstPistol.cs | 2 +- Items/SteelBow.cs | 2 +- Items/StickyFlail.cs | 3 +- Items/StoneChestplate.cs | 2 +- Items/StoneHelmet.cs | 2 +- Items/StoneLeggings.cs | 2 +- Items/StoneofKnowledge.cs | 8 +- Items/StormBlade.cs | 2 +- Items/StormJelly.cs | 2 +- Items/Stormtron.cs | 2 +- Items/StrangeEgg.cs | 2 +- Items/Stynginator.cs | 2 +- Items/SummonerFocus.cs | 2 +- Items/SummonerSoul.cs | 2 +- Items/SuperBigCannon.cs | 2 +- Items/SuperHealingFlask.cs | 2 +- Items/SuperManaFlask.cs | 2 +- Items/Swordstorm.cs | 2 +- Items/TempleCannon.cs | 2 +- Items/TheArtifact.cs | 2 +- Items/TheBooger.cs | 3 +- Items/TheCadence.cs | 2 +- Items/TheCrescent.cs | 2 +- Items/TheGlorch.cs | 4 +- Items/TheTide.cs | 2 +- Items/TheUltimateBoomstick.cs | 2 +- Items/ThrowerFocus.cs | 2 +- Items/TikiArmor.cs | 2 +- Items/TinShield.cs | 2 +- Items/TitaniumDisc.cs | 2 +- Items/TitaniumHeader.cs | 2 +- Items/TitaniumHood.cs | 2 +- Items/TitaniumRifle.cs | 2 +- Items/TitaniumStaff.cs | 2 +- Items/TitaniumVisage.cs | 2 +- Items/TombRaider.cs | 2 +- Items/Toothpick.cs | 2 +- Items/TopazBlade.cs | 2 +- Items/TopazDrill.cs | 2 +- Items/ToxicClaymore.cs | 2 +- Items/ToxicFlask.cs | 2 +- Items/Transistor.cs | 2 +- Items/TrebleClef.cs | 3 +- Items/TremorItems.cs | 6 +- Items/TrueArachnophobia.cs | 2 +- Items/TrueBloodCarnage.cs | 2 +- Items/TrueEssense.cs | 5 +- Items/TrueHeroHood.cs | 5 +- Items/TrueHeroPants.cs | 5 +- Items/TrueHeroShirt.cs | 5 +- Items/TrueTerraBlade.cs | 2 +- Items/TungstenShield.cs | 2 +- Items/TurtleGreatsword.cs | 2 +- Items/TurtleShield.cs | 2 +- Items/TwilightKnife.cs | 2 +- "Items/Unpredictable\320\241ompass.cs" | 4 +- Items/UnstableCrystal.cs | 2 +- Items/Vindicator.cs | 2 +- Items/VineCape.cs | 2 +- Items/VineHood.cs | 2 +- Items/VinePants.cs | 2 +- Items/VoidKnife.cs | 2 +- Items/Volcannon.cs | 5 +- Items/VortexBand.cs | 2 +- Items/VulcanBlade.cs | 5 +- Items/VultureStaff.cs | 2 +- Items/VultureWings.cs | 2 +- Items/WallOfShadowsFlask.cs | 4 +- Items/WarpPad.cs | 5 +- Items/WarriorFocus.cs | 2 +- Items/WarriorSoul.cs | 2 +- Items/WartimeRocketLauncher.cs | 2 +- Items/WaterDeadShot.cs | 4 +- Items/WhiteCrossguardPhasesaber.cs | 2 +- Items/WhiteGoldHelmet.cs | 8 +- Items/WhiteMasterHood.cs | 12 +- Items/WhiteSakura.cs | 2 +- Items/WrathofWraith.cs | 2 +- Items/YellowCrossguardPhasesaber.cs | 2 +- Items/YinYangLance.cs | 2 +- Items/ZootalooEgg.cs | 2 +- MPlayer.cs | 44 +-- NPCDrops.cs | 4 +- NPCs/Abomination.cs | 9 +- NPCs/Agloomination.cs | 18 +- NPCs/Alchemaster.cs | 37 +-- NPCs/Alchemist.cs | 20 +- NPCs/AlphaWolf.cs | 14 +- NPCs/AncientCursedSkull.cs | 24 +- NPCs/AndasBoss/Andas.cs | 14 +- NPCs/AndasBoss/InfernoSkull.cs | 11 +- NPCs/AndasBoss/MoltenSpirit.cs | 46 ++-- NPCs/AndasBoss/SpiritFire.cs | 3 +- NPCs/AndasBoss/TrueAndas.cs | 14 +- NPCs/AndasBoss/UndeadWyrmHead.cs | 8 +- NPCs/AngerSoul.cs | 25 +- NPCs/ArabianMerchant.cs | 24 +- NPCs/ArchDemon.cs | 8 +- NPCs/Archer.cs | 20 +- NPCs/ArmoredJellyfish.cs | 15 +- NPCs/Astrofly.cs | 33 ++- NPCs/Atis.cs | 15 +- NPCs/Avenger.cs | 14 +- NPCs/BGiantSlime.cs | 23 +- NPCs/Banshee.cs | 26 +- NPCs/Barmadillo.cs | 17 +- NPCs/BetaWolf.cs | 14 +- NPCs/Bicholmere.cs | 15 +- NPCs/Blazer.cs | 10 +- NPCs/BloodmoonWarrior1.cs | 14 +- NPCs/BloodmoonWarrior2.cs | 14 +- NPCs/BloodmoonWarrior3.cs | 14 +- NPCs/BoneArcher.cs | 15 +- NPCs/BoneFish.cs | 13 +- NPCs/BoneFlyer.cs | 14 +- NPCs/Brutallisk.cs | 48 ++-- NPCs/BrutalliskSpawnMobs.cs | 1 + NPCs/Brute.cs | 15 +- NPCs/BucketheadZombie.cs | 14 +- NPCs/CaveGolem.cs | 15 +- NPCs/Chef.cs | 20 +- NPCs/Clamper.cs | 48 ++-- NPCs/Clamper2.cs | 4 +- NPCs/CloudSlime.cs | 28 +- NPCs/CogLord.cs | 159 +++++------ NPCs/CogLordArm.cs | 8 +- NPCs/CogLordArmSecond.cs | 8 +- NPCs/CogLordGun.cs | 10 +- NPCs/CogLordHand.cs | 8 +- NPCs/CogLordProbe.cs | 8 +- NPCs/ColossalTortoise.cs | 22 +- NPCs/CometHead.cs | 30 +- NPCs/ConjurerSkeleton.cs | 10 +- NPCs/CoreBug.cs | 18 +- NPCs/CoreSlime.cs | 18 +- NPCs/Coretaur.cs | 27 +- NPCs/CorruptedBicholmere.cs | 15 +- NPCs/CreatorofNightmares.cs | 16 +- NPCs/Crimer.cs | 10 +- NPCs/CrimsonBicholmere.cs | 15 +- NPCs/CyberKing.cs | 85 +++--- NPCs/Cybermite.cs | 2 +- NPCs/DarkDruid.cs | 14 +- NPCs/DarkDruidMinion.cs | 12 +- NPCs/DarkServant.cs | 19 +- NPCs/DarkSlime.cs | 13 +- NPCs/DeepwaterVilefish.cs | 15 +- NPCs/Deimos.cs | 28 +- NPCs/DesertMimic.cs | 8 +- NPCs/DesertMimicSummon.cs | 8 +- NPCs/DesertPrincess.cs | 40 ++- NPCs/DesertPrincess2.cs | 36 ++- NPCs/DevilishTortoise.cs | 28 +- NPCs/DevourerofPlanets.cs | 32 +-- NPCs/Dinictis.cs | 15 +- NPCs/DragonMini.cs | 8 +- NPCs/DragonSkull.cs | 32 +-- NPCs/Dragon_BodyB.cs | 4 +- NPCs/Dragon_HeadB.cs | 12 +- NPCs/Dranix.cs | 14 +- NPCs/DreadBeetle.cs | 12 +- NPCs/DungeonKeeper.cs | 15 +- NPCs/ElderObserver.cs | 35 +-- NPCs/Elf.cs | 18 +- NPCs/EliteBloodmoonWarrior.cs | 14 +- NPCs/EnragedBat.cs | 10 +- NPCs/EvilCorn.cs | 32 +-- NPCs/EvolvedZombie.cs | 20 +- NPCs/EvolvedZombie2.cs | 20 +- NPCs/EvolvedZombie3.cs | 20 +- NPCs/ExuberantHound.cs | 39 +-- NPCs/FallenWarrior1.cs | 15 +- NPCs/FallenWarrior2.cs | 15 +- NPCs/FallenWarrior3.cs | 15 +- NPCs/Farmer.cs | 21 +- NPCs/FatFlinx.cs | 25 +- NPCs/FireBeetle.cs | 22 +- NPCs/FlamingReaper.cs | 9 +- NPCs/Flayer.cs | 10 +- NPCs/FlyingJelly.cs | 16 +- NPCs/FlyingLeech.cs | 8 +- NPCs/ForestSpirit.cs | 11 +- NPCs/ForgeMaster.cs | 20 +- NPCs/FrostBeetle.cs | 22 +- NPCs/FrostKing.cs | 27 +- NPCs/FungusBeetle.cs | 69 +++-- NPCs/GGiantSlime.cs | 23 +- NPCs/Galasquid.cs | 9 +- NPCs/Geerd.cs | 18 +- NPCs/Gelateen.cs | 24 +- NPCs/GeneralSnowman.cs | 16 +- NPCs/GhostKnight.cs | 18 +- NPCs/GhostWarrior.cs | 10 +- NPCs/GiantCrab.cs | 14 +- NPCs/GiantGastropod.cs | 22 +- NPCs/GiantMeteorHead.cs | 28 +- NPCs/GloomySeer.cs | 20 +- NPCs/GoblinAssassin.cs | 90 +++--- NPCs/GoblinBomber.cs | 102 +++---- NPCs/GoblinStandardBearer.cs | 18 +- NPCs/GoblinStandardBearer_Balloon.cs | 22 +- NPCs/GogLordGog.cs | 10 +- NPCs/GoplitArcher.cs | 12 +- NPCs/GoplitOfficer.cs | 8 +- NPCs/GraniteBeetle.cs | 12 +- NPCs/GraniteBowman.cs | 12 +- NPCs/GrayRaven.cs | 11 +- NPCs/GreatFungusBug.cs | 12 +- NPCs/Grood.cs | 18 +- NPCs/Gurd.cs | 18 +- NPCs/HallowSlimer.cs | 12 +- NPCs/Hallower.cs | 22 +- NPCs/HappySoul.cs | 21 +- NPCs/HarpyWarrior.cs | 10 +- NPCs/HeadlessZombie.cs | 14 +- NPCs/HeaterOfWorldsBody.cs | 3 +- NPCs/HeaterOfWorldsHead.cs | 12 +- NPCs/HeavyZombie.cs | 14 +- NPCs/Hellgron.cs | 18 +- NPCs/Hellhound.cs | 39 +-- NPCs/HiveHeadZombie.cs | 10 +- NPCs/IceBlazer.cs | 22 +- NPCs/IceMotherSlime.cs | 18 +- NPCs/IndifferenceSoul.cs | 25 +- NPCs/InfectedZombie.cs | 8 +- NPCs/IronGiant.cs | 14 +- NPCs/JungleMimic.cs | 10 +- NPCs/JungleMimicSummon.cs | 10 +- NPCs/JungleSpirit.cs | 11 +- NPCs/Knight.cs | 20 +- NPCs/KnightZombie.cs | 14 +- NPCs/KnightZombieSword.cs | 12 +- NPCs/LadyMoon.cs | 20 +- NPCs/Leprechaun.cs | 12 +- NPCs/LihzahrdWarrior.cs | 15 +- NPCs/LittleMushroomBug.cs | 12 +- NPCs/Lizard.cs | 6 +- NPCs/Luminion.cs | 14 +- NPCs/MagiumFlyer.cs | 20 +- NPCs/MagiumKeeper.cs | 48 ++-- NPCs/MagiumSword.cs | 9 +- NPCs/MagmaLeechHead.cs | 8 +- NPCs/Magus.cs | 18 +- NPCs/MechanicalFirefly.cs | 10 +- NPCs/MeteoriteGolem.cs | 22 +- NPCs/MightyNimbus.cs | 17 +- NPCs/Minotaur.cs | 11 +- NPCs/Motherboard.cs | 63 +++-- NPCs/Mothership.cs | 17 +- NPCs/MushroomCreature.cs | 10 +- NPCs/Naga.cs | 8 +- NPCs/NightTerror.cs | 20 +- NPCs/NightWalker.cs | 18 +- NPCs/NorthWind.cs | 27 +- NPCs/Observer.cs | 35 +-- NPCs/OceanMimic.cs | 10 +- NPCs/OceanMimicSummon.cs | 8 +- NPCs/OmegaWolf.cs | 10 +- NPCs/Orc.cs | 14 +- NPCs/OrcChampion.cs | 18 +- NPCs/OrcSkeleton.cs | 11 +- NPCs/OrcWarrior.cs | 14 +- NPCs/PGiantSlime.cs | 23 +- NPCs/Parasprite.cs | 13 +- NPCs/Peepers.cs | 35 +-- NPCs/Phabor.cs | 35 +-- NPCs/Phantom.cs | 22 +- NPCs/PharaohCaster.cs | 10 +- NPCs/Phobos.cs | 28 +- NPCs/PixieQueen.cs | 257 +++++++++--------- NPCs/PixieQueenGuardian.cs | 14 +- NPCs/PlagueSoul.cs | 16 +- NPCs/Polaris.cs | 22 +- NPCs/PossessedHornet1.cs | 15 +- NPCs/PossessedHornet2.cs | 15 +- NPCs/PossessedHound.cs | 14 +- NPCs/Professor.cs | 20 +- NPCs/PyramidHead.cs | 14 +- NPCs/PyramidRider.cs | 14 +- NPCs/QuartzBeetle.cs | 15 +- NPCs/Quetzalcoatl.cs | 8 +- NPCs/RGiantSlime.cs | 25 +- NPCs/RichSlime.cs | 23 +- NPCs/Rogue.cs | 12 +- NPCs/RuinGhost1.cs | 2 +- NPCs/RuinGhost2.cs | 2 +- NPCs/SandThing.cs | 24 +- NPCs/ScaryBat.cs | 22 +- NPCs/Scavenger.cs | 10 +- NPCs/Screamer.cs | 11 +- NPCs/ShadowHand.cs | 6 +- NPCs/ShadowHandTwo.cs | 6 +- NPCs/ShadowRipper.cs | 32 +-- NPCs/ShadowSteed.cs | 6 +- NPCs/Shnoot.cs | 20 +- NPCs/Shroot.cs | 20 +- NPCs/Sighted.cs | 16 +- NPCs/SignalDron.cs | 22 +- NPCs/SkeletonKnight.cs | 10 +- NPCs/Skullker.cs | 18 +- NPCs/SnowBat.cs | 22 +- NPCs/SnowEater.cs | 50 ++-- NPCs/Snowcopter.cs | 10 +- NPCs/SnowmanBomber.cs | 16 +- NPCs/SnowmanWarrior.cs | 16 +- NPCs/Sorcerer.cs | 20 +- NPCs/SoulofHope.cs | 48 ++-- NPCs/SoulofTrust.cs | 55 ++-- NPCs/SoulofTruth.cs | 52 ++-- NPCs/SpaceWhale.cs | 132 +++++---- NPCs/SpaceWhaleMinion.cs | 24 +- NPCs/Spaceman.cs | 12 +- NPCs/SpiderMan.cs | 12 +- NPCs/SquidZombie.cs | 15 +- NPCs/Squoma.cs | 17 +- NPCs/Startrooper.cs | 20 +- NPCs/StormJellyfish.cs | 23 +- NPCs/SupremePossessedArmor.cs | 14 +- NPCs/TempleSlime.cs | 25 +- NPCs/TheAxeman.cs | 16 +- NPCs/TheDarkEmperor.cs | 16 +- NPCs/TheDarkEmperorTwo.cs | 85 +++--- NPCs/TheGirl.cs | 20 +- NPCs/TheThing.cs | 22 +- NPCs/Thief1.cs | 17 +- NPCs/Thief2.cs | 17 +- NPCs/Thief3.cs | 17 +- NPCs/ThinMan.cs | 14 +- NPCs/ThunderBones.cs | 13 +- NPCs/TikiSorcerer.cs | 12 +- NPCs/TikiSoul.cs | 8 +- NPCs/TikiTotem.cs | 148 +++++----- NPCs/TikiWarrior.cs | 12 +- NPCs/TremorGlobalNPC.cs | 10 +- NPCs/TremorNPC.cs | 15 +- NPCs/TwilightBat.cs | 20 +- NPCs/UndeadArchaeologist.cs | 10 +- NPCs/UndeadArchaeologist2.cs | 10 +- NPCs/UndeadMusketeer.cs | 14 +- NPCs/UndeadWarlock.cs | 15 +- NPCs/UndeadWarrior1.cs | 10 +- NPCs/UndeadWarrior2.cs | 10 +- NPCs/UndeadWarrior3.cs | 10 +- NPCs/UndeadWarrior4.cs | 10 +- NPCs/Undertaker.cs | 20 +- NPCs/WallOfShadow.cs | 52 ++-- NPCs/WallOfShadowEye.cs | 4 +- NPCs/Warlock.cs | 20 +- NPCs/Witch.cs | 20 +- NPCs/Woodling.cs | 14 +- NPCs/WoodlingWarrior.cs | 14 +- NPCs/Woody.cs | 9 +- NPCs/YGiantSlime.cs | 25 +- NPCs/Zarprite.cs | 9 +- NPCs/Zarprute.cs | 9 +- NPCs/Zootaloo.cs | 17 +- NPCs/ZootalooMatriarch.cs | 17 +- NPCs/npcVultureKing.cs | 14 +- NovaPillar/Deadling.cs | 16 +- NovaPillar/NovaAlchemist.cs | 44 +-- NovaPillar/NovaAlchemistC.cs | 26 +- NovaPillar/NovaAlchemistCloud.cs | 4 +- NovaPillar/NovaAlchemistProjectile.cs | 25 +- NovaPillar/NovaBat.cs | 8 +- NovaPillar/NovaBottle.cs | 6 +- NovaPillar/NovaBreastplate.cs | 2 +- NovaPillar/NovaCauldron.cs | 99 ++++--- NovaPillar/NovaCauldron_Fire.cs | 21 +- NovaPillar/NovaFlask.cs | 2 +- NovaPillar/NovaFlask_Proj.cs | 39 ++- NovaPillar/NovaFlask_ProjBall.cs | 54 ++-- NovaPillar/NovaFlask_ProjFire.cs | 38 +-- NovaPillar/NovaFlier.cs | 20 +- NovaPillar/NovaFlierProj.cs | 9 +- NovaPillar/NovaHandler.cs | 4 +- NovaPillar/NovaHelmet.cs | 2 +- NovaPillar/NovaLeggings.cs | 4 +- NovaPillar/NovaMonolith_Tile.cs | 4 +- NovaPillar/NovaPillar.cs | 43 ++- NovaPillar/NovaSky.cs | 54 ++-- NovaPillar/NovaSprayer.cs | 4 +- NovaPillar/Varki.cs | 34 +-- NovaPillar/Youwarkee.cs | 36 +-- NovaPillar/Youwarkee2.cs | 32 +-- PiggyBank.cs | 7 +- Projectiles/AdamantiteBolt.cs | 7 +- .../Alchemic/AlchemicBubbleZellarium.cs | 8 +- Projectiles/Alchemic/BasicFlaskPro.cs | 87 +++--- Projectiles/Alchemic/BigHealingFlackPro.cs | 87 +++--- Projectiles/Alchemic/BigManaFlaskPro.cs | 87 +++--- Projectiles/Alchemic/BigPoisonFlaskPro.cs | 87 +++--- Projectiles/Alchemic/BigVenomFlaskPro.cs | 87 +++--- Projectiles/Alchemic/Blasts/ClusterBlast.cs | 6 +- Projectiles/Alchemic/Blasts/HealingBlast.cs | 4 +- Projectiles/Alchemic/BoomFlaskPro.cs | 113 ++++---- Projectiles/Alchemic/BurningFlaskPro.cs | 87 +++--- Projectiles/Alchemic/Bursts/BoomSkull.cs | 32 +-- Projectiles/Alchemic/Bursts/BoomSkullburst.cs | 32 +-- Projectiles/Alchemic/Bursts/HealingBurst.cs | 4 +- Projectiles/Alchemic/Bursts/HealingSkull.cs | 4 +- .../Alchemic/Bursts/HealingSkullburst.cs | 4 +- Projectiles/Alchemic/ClusterFlaskPro.cs | 87 +++--- Projectiles/Alchemic/CrystalFlaskPro.cs | 87 +++--- Projectiles/Alchemic/DepressionFlaskPro.cs | 6 +- Projectiles/Alchemic/DukeFlaskPro.cs | 37 ++- Projectiles/Alchemic/ExtendedBoomFlaskPro.cs | 113 ++++---- .../Alchemic/ExtendedBurningFlaskPro.cs | 87 +++--- .../Alchemic/ExtendedFreezeFlaskPro.cs | 87 +++--- Projectiles/Alchemic/FreezeFlaskPro.cs | 87 +++--- Projectiles/Alchemic/GoldFlaskPro.cs | 87 +++--- Projectiles/Alchemic/HealingCloudPro.cs | 4 +- Projectiles/Alchemic/HealthSupportFlaskPro.cs | 10 +- Projectiles/Alchemic/LesserHealingFlackPro.cs | 87 +++--- Projectiles/Alchemic/LesserManaFlaskPro.cs | 87 +++--- Projectiles/Alchemic/LesserPoisonFlaskPro.cs | 87 +++--- Projectiles/Alchemic/LesserVenomFlaskPro.cs | 87 +++--- Projectiles/Alchemic/ManaSupportFlaskPro.cs | 10 +- Projectiles/Alchemic/MoonDustFlaskPro.cs | 87 +++--- Projectiles/Alchemic/PhantomFlaskPro.cs | 91 +++---- Projectiles/Alchemic/PlagueFlaskPro.cs | 91 +++---- Projectiles/Alchemic/SparkingFlaskPro.cs | 93 ++++--- Projectiles/Alchemic/SuperHealingFlaskPro.cs | 87 +++--- Projectiles/Alchemic/SuperManaFlaskPro.cs | 87 +++--- Projectiles/Alchemic/ToxicFlaskPro.cs | 39 ++- Projectiles/AlchemicBubble.cs | 8 +- Projectiles/AncientDaggerPro.cs | 32 +-- Projectiles/AncientFlailPro.cs | 16 +- Projectiles/AncientShield.cs | 24 +- Projectiles/AncientSolarWindPro.cs | 6 +- Projectiles/AncientSunExplosionPro.cs | 15 +- Projectiles/AncientSunPro.cs | 1 - Projectiles/AngelTearsPro.cs | 11 +- Projectiles/ArgiteSpherePro.cs | 14 +- Projectiles/BallChainPro.cs | 18 +- Projectiles/BerserkerPro.cs | 10 +- Projectiles/BestNightmarePro.cs | 7 +- Projectiles/BloodyArrow.cs | 14 +- Projectiles/BrainSmasherPro.cs | 22 +- Projectiles/BrainiacWavePro.cs | 17 +- Projectiles/BurningFist.cs | 32 +-- Projectiles/ChainedRocketPro.cs | 20 +- Projectiles/ChaosStarPro.cs | 16 +- Projectiles/ChargedArrowBoom.cs | 15 +- Projectiles/CobaltBolt.cs | 1 - Projectiles/CogLordLaser.cs | 8 +- Projectiles/CorfirePro.cs | 3 +- Projectiles/CthulhunadoPro.cs | 37 ++- Projectiles/CursedTwisterPro.cs | 2 +- Projectiles/CyberCutterPro.cs | 111 ++++---- Projectiles/CyberRingPro.cs | 3 +- Projectiles/CyclonePro.cs | 18 +- Projectiles/DangerBladePro.cs | 14 +- Projectiles/DarkBubblePro.cs | 14 +- Projectiles/DeadFlowerPro.cs | 15 +- Projectiles/DeathHooksPro.cs | 14 +- Projectiles/DesertClaymorePro.cs | 4 +- Projectiles/DesertSigil.cs | 1 - Projectiles/DiamondBeamPro.cs | 6 +- Projectiles/DissolverPro.cs | 3 +- Projectiles/DivineClaymorePro.cs | 18 +- Projectiles/DivineRingPro.cs | 16 +- Projectiles/DragonHead.cs | 16 +- Projectiles/Dukado.cs | 37 ++- Projectiles/EaterofDreamsPro.cs | 3 +- Projectiles/EruptPro.cs | 7 +- Projectiles/EternalAgonyPro.cs | 16 +- Projectiles/ExampleLaser.cs | 6 +- Projectiles/FlamesofDespairPro.cs | 28 +- Projectiles/FlowerofAntimony.cs | 1 - Projectiles/FrostbittenBallPro.cs | 16 +- Projectiles/FrostwindPro.cs | 37 ++- Projectiles/FungusBlueSword.cs | 6 +- Projectiles/FungusYellowSword.cs | 6 +- Projectiles/GalaxonPro.cs | 3 +- Projectiles/GhostlyExplosion.cs | 15 +- Projectiles/GoldFishPro.cs | 14 +- Projectiles/GoldenMacePro.cs | 2 +- Projectiles/GuardianHammerPro.cs | 3 +- Projectiles/Gurumaster.cs | 32 +-- Projectiles/HallowedSprayPro.cs | 3 +- Projectiles/HellStormArrow.cs | 13 +- Projectiles/HellStormProj.cs | 10 +- Projectiles/HolyJavelinPro.cs | 15 +- Projectiles/IceBullet.cs | 2 +- Projectiles/Igniter.cs | 15 +- Projectiles/InfernoPro.cs | 5 +- Projectiles/InfernoRift.cs | 32 +-- Projectiles/LeafBallPro.cs | 16 +- Projectiles/LightningTome.cs | 2 +- Projectiles/MagusBall.cs | 8 +- Projectiles/MagusBallF.cs | 8 +- Projectiles/ManiacChainsawPro.cs | 20 +- Projectiles/Minions/AntiqueStavePro.cs | 7 +- Projectiles/Minions/Bramble.cs | 7 +- Projectiles/Minions/HungryStaffPro.cs | 14 +- Projectiles/Minions/Hunter.cs | 14 +- Projectiles/Minions/ShadowStaffPro.cs | 14 +- Projectiles/MoltenWatcher.cs | 1 - Projectiles/MudShot.cs | 2 +- Projectiles/MythrilBolt.cs | 17 +- Projectiles/NanoDronPro.cs | 1 - Projectiles/NightFuryPro.cs | 16 +- Projectiles/NightmareBulletPro.cs | 2 +- Projectiles/OmnikronBeast.cs | 1 - Projectiles/OrichalcumBolt.cs | 1 - Projectiles/PainWheelPro.cs | 16 +- Projectiles/PaladinHammerPro.cs | 8 +- Projectiles/PalladiumBolt.cs | 15 +- Projectiles/PandemoniumBullet.cs | 2 +- Projectiles/ParaxydeKnifePro.cs | 14 +- Projectiles/PhantomSpear.cs | 15 +- Projectiles/PirahnaPro.cs | 14 +- Projectiles/PlagueFlaskEvil.cs | 6 +- Projectiles/PoisonJavelinPro.cs | 15 +- Projectiles/PumpkinPro.cs | 2 +- Projectiles/PurplePulsePro.cs | 7 +- Projectiles/RedPulsePro.cs | 7 +- Projectiles/RockminePro.cs | 32 +-- Projectiles/SacredCrossPro.cs | 15 +- Projectiles/Sand.cs | 3 +- Projectiles/SandstormMinion.cs | 9 +- Projectiles/SaturatedDaggerPro.cs | 14 +- Projectiles/ScorcherPro.cs | 6 +- Projectiles/ScorcherStar.cs | 16 +- Projectiles/ScorcherTwo.cs | 22 +- Projectiles/ShadowCutterPro.cs | 2 +- Projectiles/ShockwavePro.cs | 3 +- Projectiles/SlimeFlailPro.cs | 16 +- Projectiles/SparkingFlaskEvil.cs | 6 +- Projectiles/SparkingFlaskEvilTwo.cs | 6 +- Projectiles/SpearofJusticePro.cs | 15 +- Projectiles/SpectreTaroCard.cs | 2 +- Projectiles/SporeExplosion.cs | 15 +- Projectiles/StarNestPro.cs | 3 +- Projectiles/StarminePro.cs | 28 +- Projectiles/StickyFlailPro.cs | 16 +- Projectiles/SuperBigCannonPro.cs | 26 +- Projectiles/TheBoogerBallPro.cs | 1 - Projectiles/TheBoogerPro.cs | 18 +- Projectiles/TheCadenceProj.cs | 2 +- Projectiles/TheGhostClaymorePro.cs | 15 +- Projectiles/TikiSoulPro.cs | 8 +- Projectiles/TremorProjectiles.cs | 4 +- Projectiles/TrueBladeOne.cs | 6 +- Projectiles/TrueBladeThree.cs | 6 +- Projectiles/TrueBladeTwo.cs | 6 +- Projectiles/TrueBloodCarnage.cs | 2 +- Projectiles/TrueDeathSickleProj.cs | 6 +- Projectiles/TyphoonPro.cs | 37 ++- Projectiles/VindicatorProj.cs | 32 +-- Projectiles/VoidBladePro.cs | 18 +- Projectiles/VoidRingPro.cs | 16 +- Projectiles/VulcanBladePro.cs | 16 +- Projectiles/VulcanBladeRing.cs | 34 +-- Projectiles/VultureFeather.cs | 3 +- Projectiles/WallOfShadowsFlask_Proj.cs | 10 +- Projectiles/WhiteGoldDagger.cs | 14 +- Projectiles/WhiteGoldKnife.cs | 14 +- Projectiles/WraithWrathPro.cs | 15 +- Projectiles/ZootalooRodPro.cs | 1 - Projectiles/projClamperLaser.cs | 4 +- Projectiles/projDesertClaymore.cs | 4 +- Projectiles/projEyeofInfinity.cs | 7 +- Projectiles/projGenie.cs | 2 +- Projectiles/projManaDagger.cs | 2 +- Projectiles/projMotherboardLaser.cs | 4 +- Projectiles/projMotherboardSuperLaser.cs | 9 +- Projectiles/projSteampunkProbe.cs | 11 +- Projectiles/projVultureFeather.cs | 3 +- Tiles/AlchematorTile.cs | 2 +- Tiles/AlchemyStationTile.cs | 2 +- Tiles/AngeliteBarTile.cs | 2 +- Tiles/ArgiteBar.cs | 2 +- Tiles/Armchair.cs | 2 +- Tiles/BlizzardMusicBox.cs | 2 +- Tiles/BoneThrone.cs | 2 +- Tiles/BorealWoodArmchair.cs | 2 +- Tiles/Boss6MusicBox.cs | 2 +- Tiles/BrassBar.cs | 2 +- Tiles/BronzeBar.cs | 2 +- Tiles/BulbTorch.cs | 10 +- Tiles/CandyBarTile.cs | 2 +- Tiles/ChaosBar.cs | 2 +- Tiles/CogLordMusicBox.cs | 2 +- Tiles/CollapsiumBarTile.cs | 2 +- Tiles/CometiteBarTile.cs | 2 +- Tiles/Corn.cs | 4 +- Tiles/CreepyThrone.cs | 2 +- Tiles/CrimstoneBathtub.cs | 2 +- Tiles/CrimstoneBed.cs | 2 +- Tiles/CrimstoneBench.cs | 2 +- Tiles/CrimstoneBookcase.cs | 2 +- Tiles/CrimstoneChair.cs | 2 +- Tiles/CrimstoneChest.cs | 16 +- Tiles/CrimstoneDoorClosed.cs | 2 +- Tiles/CrimstoneDoorOpen.cs | 2 +- Tiles/CrimstoneDresser.cs | 23 +- Tiles/CrimstoneGrandfatherClock.cs | 2 +- Tiles/CrimstonePiano.cs | 2 +- Tiles/CrimstonePlatform.cs | 2 +- Tiles/CrimstoneSink.cs | 2 +- Tiles/CrimstoneTable.cs | 2 +- Tiles/CrimstoneWorkbench.cs | 2 +- Tiles/CyberKingMusicBox.cs | 2 +- Tiles/DivineForgeTile.cs | 2 +- Tiles/EbonstoneBathtub.cs | 2 +- Tiles/EbonstoneBed.cs | 2 +- Tiles/EbonstoneBench.cs | 2 +- Tiles/EbonstoneBookcase.cs | 2 +- Tiles/EbonstoneChair.cs | 2 +- Tiles/EbonstoneChest.cs | 16 +- Tiles/EbonstoneDoorClosed.cs | 2 +- Tiles/EbonstoneDoorOpen.cs | 2 +- Tiles/EbonstoneDresser.cs | 23 +- Tiles/EbonstoneGrandfatherClock.cs | 2 +- Tiles/EbonstonePiano.cs | 2 +- Tiles/EbonstonePlatform.cs | 2 +- Tiles/EbonstoneSink.cs | 2 +- Tiles/EbonstoneTable.cs | 2 +- Tiles/EbonstoneWorkbench.cs | 2 +- Tiles/EbonwoodArmchair.cs | 2 +- Tiles/EvershinyBar.cs | 2 +- Tiles/EvilCornMusicBox.cs | 2 +- Tiles/EyeMonolithTile.cs | 2 +- Tiles/FleshWorkstationTile.cs | 2 +- Tiles/FrostoneBarTile.cs | 2 +- Tiles/GlassDoorClosed.cs | 2 +- Tiles/GlassDoorOpen.cs | 2 +- Tiles/GloomstoneBathtub.cs | 2 +- Tiles/GloomstoneBed.cs | 2 +- Tiles/GloomstoneBench.cs | 2 +- Tiles/GloomstoneBookcase.cs | 2 +- Tiles/GloomstoneCandelabra.cs | 1 - Tiles/GloomstoneChair.cs | 2 +- Tiles/GloomstoneChandelier.cs | 2 +- Tiles/GloomstoneChest.cs | 16 +- Tiles/GloomstoneDoorClosed.cs | 2 +- Tiles/GloomstoneDoorOpen.cs | 2 +- Tiles/GloomstoneDresser.cs | 23 +- Tiles/GloomstoneGrandfatherClock.cs | 2 +- Tiles/GloomstoneLamp.cs | 2 +- Tiles/GloomstoneLantern.cs | 2 +- Tiles/GloomstonePiano.cs | 2 +- Tiles/GloomstonePlatform.cs | 2 +- Tiles/GloomstoneSink.cs | 2 +- Tiles/GloomstoneTable.cs | 2 +- Tiles/GloomstoneWorkbench.cs | 2 +- Tiles/GraniteMusicBox.cs | 2 +- Tiles/HardCometiteBarTile.cs | 2 +- Tiles/Ladder.cs | 2 +- Tiles/MagmoniumBar.cs | 2 +- Tiles/MinersLampTile.cs | 1 - Tiles/MonsterBanner.cs | 2 +- Tiles/NanoBar.cs | 2 +- Tiles/NightmareBarTile.cs | 2 +- Tiles/PalmWoodArmchair.cs | 2 +- Tiles/PearlwoodArmchair.cs | 2 +- Tiles/RedBrickChimney.cs | 2 +- Tiles/RedSteelBar.cs | 2 +- Tiles/RichMahoganyArmchair.cs | 2 +- Tiles/RuinAltar.cs | 6 +- Tiles/RuinChest.cs | 16 +- Tiles/RuneBarTile.cs | 2 +- Tiles/SandstoneBar.cs | 2 +- Tiles/SandstoneBathtub.cs | 2 +- Tiles/SandstoneBed.cs | 2 +- Tiles/SandstoneBench.cs | 2 +- Tiles/SandstoneBookcase.cs | 2 +- Tiles/SandstoneCandelabra.cs | 1 - Tiles/SandstoneChair.cs | 2 +- Tiles/SandstoneChandelier.cs | 2 +- Tiles/SandstoneChest.cs | 16 +- Tiles/SandstoneDoorClosed.cs | 2 +- Tiles/SandstoneDoorOpen.cs | 2 +- Tiles/SandstoneDresser.cs | 23 +- Tiles/SandstoneGrandfatherClock.cs | 2 +- Tiles/SandstoneLamp.cs | 2 +- Tiles/SandstoneLantern.cs | 2 +- Tiles/SandstonePiano.cs | 2 +- Tiles/SandstonePlatform.cs | 2 +- Tiles/SandstoneSink.cs | 2 +- Tiles/SandstoneTable.cs | 2 +- Tiles/SandstoneWorkbench.cs | 2 +- Tiles/Scarecrow.cs | 2 +- Tiles/ScaryDoorClosed.cs | 2 +- Tiles/ScaryDoorOpen.cs | 2 +- Tiles/ShadewoodArmchair.cs | 2 +- Tiles/SilkTentTile.cs | 2 +- Tiles/SlimeRainMusicBox.cs | 2 +- Tiles/StarBarTile.cs | 2 +- Tiles/StarvilTile.cs | 2 +- Tiles/SteelBar.cs | 2 +- Tiles/StoneBathtub.cs | 2 +- Tiles/StoneBed.cs | 2 +- Tiles/StoneBench.cs | 2 +- Tiles/StoneBookcase.cs | 2 +- Tiles/StoneChair.cs | 2 +- Tiles/StoneChest.cs | 16 +- Tiles/StoneDoorClosed.cs | 2 +- Tiles/StoneDoorOpen.cs | 2 +- Tiles/StoneDresser.cs | 23 +- Tiles/StoneGrandfatherClock.cs | 2 +- Tiles/StonePiano.cs | 2 +- Tiles/StonePlatform.cs | 2 +- Tiles/StoneSink.cs | 2 +- Tiles/StoneTable.cs | 2 +- Tiles/StoneWorkbench.cs | 2 +- Tiles/TentTile.cs | 2 +- Tiles/TikiTotemMusicBox.cs | 2 +- Tiles/TremorTiles.cs | 2 +- Tiles/TrinityMusicBox.cs | 2 +- Tiles/VoidBarTile.cs | 2 +- Tiles/WhiteGoldBarTile.cs | 2 +- Tremor.cs | 87 +++--- TremorPlayer.cs | 146 +++++----- TremorWorld.cs | 160 ++++++----- ZombieEvent/Buffs/HauntPetBuff.cs | 2 +- ZombieEvent/Items/BookofRevelations.cs | 2 +- ZombieEvent/Items/ChargedLamp.cs | 6 +- ZombieEvent/Items/CursedCleaver.cs | 2 +- ZombieEvent/Items/DeadBranch.cs | 2 +- ZombieEvent/Items/DeathHordeMusicBoxTile.cs | 2 +- ZombieEvent/Items/HauntHat.cs | 2 +- ZombieEvent/Items/IchorCleaver.cs | 2 +- ZombieEvent/Items/PoisonousPhylactery.cs | 4 +- ZombieEvent/Items/RupicideCannon.cs | 2 +- ZombieEvent/Items/RupicideClub.cs | 2 +- ZombieEvent/Items/RupicideRepeater.cs | 2 +- ZombieEvent/Items/RupicideStaff.cs | 2 +- ZombieEvent/Items/SpecterHood.cs | 6 +- ZombieEvent/Items/WickedRing.cs | 6 +- ZombieEvent/Mobs/Almagron.cs | 10 +- ZombieEvent/Mobs/Arsonist.cs | 12 +- ZombieEvent/Mobs/Corpse1.cs | 2 +- ZombieEvent/Mobs/Corpse2.cs | 2 +- ZombieEvent/Mobs/Cryptomage.cs | 6 +- ZombieEvent/Mobs/Dapperblook.cs | 12 +- ZombieEvent/Mobs/Deadling1.cs | 12 +- ZombieEvent/Mobs/Deadling2.cs | 12 +- ZombieEvent/Mobs/Deadling3.cs | 12 +- ZombieEvent/Mobs/DiceZombie.cs | 12 +- ZombieEvent/Mobs/Dopelganger.cs | 6 +- ZombieEvent/Mobs/FarmerZombie.cs | 8 +- ZombieEvent/Mobs/FatSack.cs | 12 +- ZombieEvent/Mobs/GhoulOfficer.cs | 6 +- ZombieEvent/Mobs/Painmaker.cs | 12 +- ZombieEvent/Mobs/PetrifiedZombie1.cs | 12 +- ZombieEvent/Mobs/PetrifiedZombie2.cs | 12 +- ZombieEvent/Mobs/PetrifiedZombie3.cs | 12 +- ZombieEvent/Mobs/Scourge.cs | 6 +- ZombieEvent/Mobs/SpearZombie.cs | 4 +- ZombieEvent/Mobs/SuperDapperblook.cs | 12 +- ZombieEvent/Mobs/SuperScourge.cs | 6 +- ZombieEvent/Mobs/SuperTheHaunt.cs | 12 +- ZombieEvent/Mobs/TheHaunt.cs | 12 +- ZombieEvent/Mobs/Zombat.cs | 11 +- ZombieEvent/Mobs/Zombeast.cs | 20 +- ZombieEvent/Mobs/Zombomber.cs | 8 +- ZombieEvent/Tiles/NecromaniacWorkbenchTile.cs | 4 +- ZombieEvent/Tiles/RupicideBar.cs | 2 +- ZombieEvent/ZWorld.cs | 8 +- ZombieEvent/ZombieEventI.cs | 5 +- ZombieEvent/ZombieSky.cs | 14 +- 1311 files changed, 6915 insertions(+), 7325 deletions(-) diff --git a/AlchemistItem.cs b/AlchemistItem.cs index 610727c4..d855e66e 100644 --- a/AlchemistItem.cs +++ b/AlchemistItem.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using System.Collections.Generic; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; @@ -7,24 +8,24 @@ namespace Tremor public abstract class AlchemistItem : ModItem { - public override void ModifyTooltips(System.Collections.Generic.List tooltips) + public override void ModifyTooltips(List tooltips) { for (int i = 0; i < tooltips.Count; ++i) { if (tooltips[i].Name == "Damage") { MPlayer mp = Main.LocalPlayer.GetModPlayer(mod); - tooltips[i].text = ((int)(item.damage * mp.alchemistDamage)).ToString() + " alchemic damage"; + tooltips[i].text = ((int)(item.damage * mp.alchemistDamage)) + " alchemic damage"; } if (tooltips[i].Name == "CritChance") { MPlayer mp = Main.LocalPlayer.GetModPlayer(mod); - tooltips[i].text = ((int)(item.crit + mp.alchemistCrit)).ToString() + "% critical strike chance"; + tooltips[i].text = (item.crit + mp.alchemistCrit) + "% critical strike chance"; } } MPlayer mp2 = Main.LocalPlayer.GetModPlayer(mod); - TooltipLine tip = new TooltipLine(mod, "Tremor:Tooltip", ((int)(item.crit + mp2.alchemistCrit)).ToString() + "% critical strike chance"); + TooltipLine tip = new TooltipLine(mod, "Tremor:Tooltip", (item.crit + mp2.alchemistCrit) + "% critical strike chance"); tooltips.Insert(2, tip); } diff --git a/Angle.cs b/Angle.cs index 752ee578..6a6ca204 100644 --- a/Angle.cs +++ b/Angle.cs @@ -36,18 +36,18 @@ public bool ClockwiseFrom(Angle other) { if (other.Value >= (float)Math.PI) { - return this.Value < other.Value && this.Value >= other.Opposite().Value; + return Value < other.Value && Value >= other.Opposite().Value; } - return this.Value < other.Value || this.Value >= other.Opposite().Value; + return Value < other.Value || Value >= other.Opposite().Value; } public bool Between(Angle cLimit, Angle ccLimit) { if (cLimit.Value < ccLimit.Value) { - return this.Value >= cLimit.Value && this.Value <= ccLimit.Value; + return Value >= cLimit.Value && Value <= ccLimit.Value; } - return this.Value >= cLimit.Value || this.Value <= ccLimit.Value; + return Value >= cLimit.Value || Value <= ccLimit.Value; } } } \ No newline at end of file diff --git a/Buffs/AnnoyingDogBuff.cs b/Buffs/AnnoyingDogBuff.cs index 09857e30..79529057 100644 --- a/Buffs/AnnoyingDogBuff.cs +++ b/Buffs/AnnoyingDogBuff.cs @@ -25,7 +25,7 @@ public override void Update(Player player, ref int buffIndex) } if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer) { - Projectile.NewProjectile(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2), 0f, 0f, mod.ProjectileType("AnnoyingDog"), 0, 0f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(player.position.X + player.width / 2, player.position.Y + player.height / 2, 0f, 0f, mod.ProjectileType("AnnoyingDog"), 0, 0f, player.whoAmI, 0f, 0f); } } } diff --git a/Buffs/BruttyBuff.cs b/Buffs/BruttyBuff.cs index 1f6b8d9f..da88e893 100644 --- a/Buffs/BruttyBuff.cs +++ b/Buffs/BruttyBuff.cs @@ -25,7 +25,7 @@ public override void Update(Player player, ref int buffIndex) } if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer) { - Projectile.NewProjectile(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2), 0f, 0f, mod.ProjectileType("Brutty"), 0, 0f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(player.position.X + player.width / 2, player.position.Y + player.height / 2, 0f, 0f, mod.ProjectileType("Brutty"), 0, 0f, player.whoAmI, 0f, 0f); } } } diff --git a/Buffs/EmeraldStoneBuff.cs b/Buffs/EmeraldStoneBuff.cs index d9051347..d3266d26 100644 --- a/Buffs/EmeraldStoneBuff.cs +++ b/Buffs/EmeraldStoneBuff.cs @@ -26,7 +26,7 @@ public override void Update(Player player, ref int buffIndex) } if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer) { - Projectile.NewProjectile(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2), 0f, 0f, mod.ProjectileType("Emeraldy"), 0, 0f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(player.position.X + player.width / 2, player.position.Y + player.height / 2, 0f, 0f, mod.ProjectileType("Emeraldy"), 0, 0f, player.whoAmI, 0f, 0f); } if ((player.controlDown && player.releaseDown)) { diff --git a/Buffs/GoldenWhale.cs b/Buffs/GoldenWhale.cs index a3720088..365f8125 100644 --- a/Buffs/GoldenWhale.cs +++ b/Buffs/GoldenWhale.cs @@ -27,7 +27,7 @@ public override void Update(Player player, ref int buffIndex) } if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer) { - Projectile.NewProjectile(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2), 0f, 0f, mod.ProjectileType("GoldenWhalePro"), 0, 0f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(player.position.X + player.width / 2, player.position.Y + player.height / 2, 0f, 0f, mod.ProjectileType("GoldenWhalePro"), 0, 0f, player.whoAmI, 0f, 0f); } } } diff --git a/Buffs/GurdPetBuff.cs b/Buffs/GurdPetBuff.cs index d93bb7ad..0e1f5f1a 100644 --- a/Buffs/GurdPetBuff.cs +++ b/Buffs/GurdPetBuff.cs @@ -26,7 +26,7 @@ public override void Update(Player player, ref int buffIndex) } if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer) { - Projectile.NewProjectile(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2), 0f, 0f, mod.ProjectileType("GurdPet"), 0, 0f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(player.position.X + player.width / 2, player.position.Y + player.height / 2, 0f, 0f, mod.ProjectileType("GurdPet"), 0, 0f, player.whoAmI, 0f, 0f); } } } diff --git a/Buffs/LivingTombstoneBuff.cs b/Buffs/LivingTombstoneBuff.cs index 709fb611..acd628d2 100644 --- a/Buffs/LivingTombstoneBuff.cs +++ b/Buffs/LivingTombstoneBuff.cs @@ -25,7 +25,7 @@ public override void Update(Player player, ref int buffIndex) } if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer) { - Projectile.NewProjectile(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2), 0f, 0f, mod.ProjectileType("LivingTombstonePro"), 0, 0f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(player.position.X + player.width / 2, player.position.Y + player.height / 2, 0f, 0f, mod.ProjectileType("LivingTombstonePro"), 0, 0f, player.whoAmI, 0f, 0f); } } } diff --git a/Buffs/MudDollBuff.cs b/Buffs/MudDollBuff.cs index 6a61031b..458dffa0 100644 --- a/Buffs/MudDollBuff.cs +++ b/Buffs/MudDollBuff.cs @@ -25,7 +25,7 @@ public override void Update(Player player, ref int buffIndex) } if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer) { - Projectile.NewProjectile(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2), 0f, 0f, mod.ProjectileType("MudDoll"), 0, 0f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(player.position.X + player.width / 2, player.position.Y + player.height / 2, 0f, 0f, mod.ProjectileType("MudDoll"), 0, 0f, player.whoAmI, 0f, 0f); } } } diff --git a/Buffs/NebulaJellyfishBuff.cs b/Buffs/NebulaJellyfishBuff.cs index 45cc4574..27b127ee 100644 --- a/Buffs/NebulaJellyfishBuff.cs +++ b/Buffs/NebulaJellyfishBuff.cs @@ -25,7 +25,7 @@ public override void Update(Player player, ref int buffIndex) } if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer) { - Projectile.NewProjectile(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2), 0f, 0f, mod.ProjectileType("NebulaJellyfish"), 0, 0f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(player.position.X + player.width / 2, player.position.Y + player.height / 2, 0f, 0f, mod.ProjectileType("NebulaJellyfish"), 0, 0f, player.whoAmI, 0f, 0f); } } } diff --git a/Buffs/SolarMeteorBuff.cs b/Buffs/SolarMeteorBuff.cs index 8697f63e..6e95b82d 100644 --- a/Buffs/SolarMeteorBuff.cs +++ b/Buffs/SolarMeteorBuff.cs @@ -25,7 +25,7 @@ public override void Update(Player player, ref int buffIndex) } if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer) { - Projectile.NewProjectile(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2), 0f, 0f, mod.ProjectileType("SolarMeteor"), 0, 0f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(player.position.X + player.width / 2, player.position.Y + player.height / 2, 0f, 0f, mod.ProjectileType("SolarMeteor"), 0, 0f, player.whoAmI, 0f, 0f); } } } diff --git a/Buffs/StardustSquidBuff.cs b/Buffs/StardustSquidBuff.cs index d5821cc0..ab320a06 100644 --- a/Buffs/StardustSquidBuff.cs +++ b/Buffs/StardustSquidBuff.cs @@ -25,7 +25,7 @@ public override void Update(Player player, ref int buffIndex) } if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer) { - Projectile.NewProjectile(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2), 0f, 0f, mod.ProjectileType("StardustSquid"), 0, 0f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(player.position.X + player.width / 2, player.position.Y + player.height / 2, 0f, 0f, mod.ProjectileType("StardustSquid"), 0, 0f, player.whoAmI, 0f, 0f); } } } diff --git a/Buffs/TremorBuffs.cs b/Buffs/TremorBuffs.cs index a3ec5f7f..542eb1f4 100644 --- a/Buffs/TremorBuffs.cs +++ b/Buffs/TremorBuffs.cs @@ -1,3 +1,4 @@ +using Terraria; using Terraria.ModLoader; namespace Tremor.Buffs @@ -5,7 +6,7 @@ namespace Tremor.Buffs public class TremorBuffs : GlobalBuff { - public override void Update(int type, Terraria.Player player, ref int buffIndex) + public override void Update(int type, Player player, ref int buffIndex) { if (player.FindBuffIndex(117) != -1) { diff --git a/Buffs/VortexBeeBuff.cs b/Buffs/VortexBeeBuff.cs index d9656c37..1ba87363 100644 --- a/Buffs/VortexBeeBuff.cs +++ b/Buffs/VortexBeeBuff.cs @@ -25,7 +25,7 @@ public override void Update(Player player, ref int buffIndex) } if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer) { - Projectile.NewProjectile(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2), 0f, 0f, mod.ProjectileType("VortexBee"), 0, 0f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(player.position.X + player.width / 2, player.position.Y + player.height / 2, 0f, 0f, mod.ProjectileType("VortexBee"), 0, 0f, player.whoAmI, 0f, 0f); } } } diff --git a/Buffs/WarkeeBuff.cs b/Buffs/WarkeeBuff.cs index afe63037..27bff3dd 100644 --- a/Buffs/WarkeeBuff.cs +++ b/Buffs/WarkeeBuff.cs @@ -25,7 +25,7 @@ public override void Update(Player player, ref int buffIndex) } if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer) { - Projectile.NewProjectile(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2), 0f, 0f, mod.ProjectileType("Warkee"), 0, 0f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(player.position.X + player.width / 2, player.position.Y + player.height / 2, 0f, 0f, mod.ProjectileType("Warkee"), 0, 0f, player.whoAmI, 0f, 0f); } } } diff --git a/Buffs/ZootalooBuff.cs b/Buffs/ZootalooBuff.cs index cb56320c..959dc3ea 100644 --- a/Buffs/ZootalooBuff.cs +++ b/Buffs/ZootalooBuff.cs @@ -25,7 +25,7 @@ public override void Update(Player player, ref int buffIndex) } if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer) { - Projectile.NewProjectile(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2), 0f, 0f, mod.ProjectileType("ZootalooPet"), 0, 0f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(player.position.X + player.width / 2, player.position.Y + player.height / 2, 0f, 0f, mod.ProjectileType("ZootalooPet"), 0, 0f, player.whoAmI, 0f, 0f); } } } diff --git a/Buffs/petGenie.cs b/Buffs/petGenie.cs index 93e2d81b..4339d7cd 100644 --- a/Buffs/petGenie.cs +++ b/Buffs/petGenie.cs @@ -1,4 +1,5 @@ -using Terraria; +using Microsoft.Xna.Framework; +using Terraria; using Terraria.ModLoader; namespace Tremor.Buffs @@ -11,7 +12,7 @@ public override void SetDefaults() { DisplayName.SetDefault("Genie"); Description.SetDefault("A Genie follows you and shows location of enemies"); - Main.buffNoTimeDisplay[this.Type] = true; + Main.buffNoTimeDisplay[Type] = true; } public override void Update(Player player, ref int buffIndex) @@ -20,7 +21,7 @@ public override void Update(Player player, ref int buffIndex) { if (npc.friendly || npc.lifeMax <= 5 || !npc.active || npc.Distance(player.position) > 750) continue; - Lighting.AddLight(npc.Center, new Microsoft.Xna.Framework.Vector3(0, 0, 1)); + Lighting.AddLight(npc.Center, new Vector3(0, 0, 1)); } if (MyDzhin == -1) MyDzhin = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, mod.ProjectileType("projGenie"), 0, 0, 0); diff --git a/CustomDrop.cs b/CustomDrop.cs index 72ef2975..47abde08 100644 --- a/CustomDrop.cs +++ b/CustomDrop.cs @@ -1,6 +1,6 @@ using Terraria; -using Terraria.ModLoader; using Terraria.ID; +using Terraria.ModLoader; namespace Tremor { diff --git a/CustomWorldData.cs b/CustomWorldData.cs index 0212a327..97137f76 100644 --- a/CustomWorldData.cs +++ b/CustomWorldData.cs @@ -1,6 +1,7 @@ using System; -using System.IO; using System.Collections.Generic; +using System.IO; +using System.Text; using Terraria; namespace Tremor @@ -13,7 +14,7 @@ public static class CustomWorldData public static Dictionary Switch = new Dictionary(); public static Dictionary String = new Dictionary(); - public static string WorldName { get { return Main.worldPathName.Split(new char[] { '/', '\\' })[Main.worldPathName.Split(new char[] { '/', '\\' }).Length - 1].Remove(Main.worldPathName.Split(new char[] { '/', '\\' })[Main.worldPathName.Split(new char[] { '/', '\\' }).Length - 1].Length - 4); } } + public static string WorldName => Main.worldPathName.Split('/', '\\')[Main.worldPathName.Split('/', '\\').Length - 1].Remove(Main.worldPathName.Split('/', '\\')[Main.worldPathName.Split('/', '\\').Length - 1].Length - 4); public static string LastLoadedWorld = ""; public static void SetNumber(string Key, float Value) @@ -82,7 +83,7 @@ public static void Save(bool Nu, bool Sw = false, bool St = false) { string FileName = Main.WorldPath + "\\" + WorldName + ".tnu"; FileStream FS = new FileStream(FileName, FileMode.Create); - StreamWriter SW = new StreamWriter(FS, System.Text.Encoding.Default); + StreamWriter SW = new StreamWriter(FS, Encoding.Default); foreach (string Key in Number.Keys) SW.WriteLine(Key + SpaceChar + Number[Key]); SW.Close(); @@ -92,7 +93,7 @@ public static void Save(bool Nu, bool Sw = false, bool St = false) { string FileName = Main.WorldPath + "\\" + WorldName + ".tsw"; FileStream FS = new FileStream(FileName, FileMode.Create); - StreamWriter SW = new StreamWriter(FS, System.Text.Encoding.Default); + StreamWriter SW = new StreamWriter(FS, Encoding.Default); foreach (string Key in Switch.Keys) SW.WriteLine(Key + SpaceChar + Switch[Key]); SW.Close(); @@ -102,7 +103,7 @@ public static void Save(bool Nu, bool Sw = false, bool St = false) { string FileName = Main.WorldPath + "\\" + WorldName + ".tst"; FileStream FS = new FileStream(FileName, FileMode.Create); - StreamWriter SW = new StreamWriter(FS, System.Text.Encoding.Default); + StreamWriter SW = new StreamWriter(FS, Encoding.Default); foreach (string Key in String.Keys) SW.WriteLine(Key + SpaceChar + String[Key]); SW.Close(); @@ -120,7 +121,7 @@ public static void Load(bool Nu, bool Sw = false, bool St = false) { string FileName = Main.WorldPath + "\\" + WorldName + ".tnu"; FileStream FS = new FileStream(FileName, FileMode.OpenOrCreate); - StreamReader SR = new StreamReader(FS, System.Text.Encoding.Default); + StreamReader SR = new StreamReader(FS, Encoding.Default); while (!SR.EndOfStream) { try @@ -137,7 +138,7 @@ public static void Load(bool Nu, bool Sw = false, bool St = false) { string FileName = Main.WorldPath + "\\" + WorldName + ".tsw"; FileStream FS = new FileStream(FileName, FileMode.OpenOrCreate); - StreamReader SR = new StreamReader(FS, System.Text.Encoding.Default); + StreamReader SR = new StreamReader(FS, Encoding.Default); while (!SR.EndOfStream) { try @@ -154,7 +155,7 @@ public static void Load(bool Nu, bool Sw = false, bool St = false) { string FileName = Main.WorldPath + "\\" + WorldName + ".tst"; FileStream FS = new FileStream(FileName, FileMode.OpenOrCreate); - StreamReader SR = new StreamReader(FS, System.Text.Encoding.Default); + StreamReader SR = new StreamReader(FS, Encoding.Default); while (!SR.EndOfStream) { try diff --git a/DungeonGenn/DungeonWorld.cs b/DungeonGenn/DungeonWorld.cs index 8129b30f..cc5c6281 100644 --- a/DungeonGenn/DungeonWorld.cs +++ b/DungeonGenn/DungeonWorld.cs @@ -1,8 +1,8 @@ using System.Collections.Generic; using Terraria; +using Terraria.GameContent.Generation; using Terraria.ModLoader; using Terraria.World.Generation; -using Terraria.GameContent.Generation; namespace Tremor.DungeonGenn { @@ -15,9 +15,9 @@ public class DungeonWorld : ModWorld static public bool showLog = false; static public Dungeon[] dungeon; - static public int spawnTileX = 0; - static public int spawnTileY = 0; - static public int rockLayerFat = 0; + static public int spawnTileX; + static public int spawnTileY; + static public int rockLayerFat; static public int lavaLayer = 0; static public int densityDivider; //public DungeonGen(ModBase modBase) : base(modBase){ } @@ -53,7 +53,7 @@ static public void SetVars() small = Main.maxTilesY < 1500; large = Main.maxTilesY > 2300; medium = !small && !large; - rockLayerFat = (int)Main.maxTilesY - (int)Main.rockLayer; + rockLayerFat = Main.maxTilesY - (int)Main.rockLayer; //if(small) densityDivider = 50; densityDivider = 35; //with old 32 = small-15, medium-36, large-63 @@ -212,7 +212,7 @@ public class Dungeon public Room[] room; public Room[] corridor; public Graph graph; - public int CorridorNum = 0; + public int CorridorNum; public bool isOk = true; @@ -728,7 +728,7 @@ public class Trait //for Mutate() public int mutateChance = 2; public int mutateLimit = 2; - public int mutated = 0; + public int mutated; //for Fix() public int maxHLimit = 40; @@ -877,17 +877,17 @@ public void Fix() public class Room { //{VARS - public int x = 0;//active part - public int y = 0;//active part - public int w = 0; - public int h = 0; + public int x;//active part + public int y;//active part + public int w; + public int h; public int wallState = 1; //0 full wall, 1 destroyed, 2 no wall public bool isTreasureRoom = false; public bool isSpawnRoom = false; public bool isCorridor = false; - public bool isDestroyed = false; - public bool isFake = false; - public bool isBridged = false; + public bool isDestroyed; + public bool isFake; + public bool isBridged; public bool isFlooded = false; public bool isAroundSand = false; public bool canConnectBetweenFloors = true; @@ -958,7 +958,7 @@ public int CouldBeDestroyedBy(int offsetX, int offsetY, int wallSize = 8) tileCount++; } } - return ((int)((float)destroyedTiles / (float)tileCount * 100)); + return ((int)(destroyedTiles / (float)tileCount * 100)); } public bool IsInRoom(int posX, int posY, int offsetX, int offsetY) { @@ -1330,7 +1330,6 @@ public static void AddPotsInCube(int x, int y, int w = 40, int h = 0, int maxQ = } //} } - return; } public void FillWithFurniture(int offsetX, int offsetY) { @@ -1407,7 +1406,7 @@ public class Graph public int room1; public int room2; - private int I = 0; + private int I; private Connection[] connection; public Graph(int roomNum) @@ -1457,7 +1456,7 @@ public class Connection { public int room1; public int room2; - public bool connected = false; + public bool connected; public void Connect(int r1, int r2) { room1 = r1; @@ -1489,10 +1488,10 @@ static public void PickRandom(Dungeon dungeon) public class ItemList { static public string[] lowTier = { - "IceKey", + "IceKey" }; static public string[] highTier = { - "Gold Coin", + "Gold Coin" }; } @@ -1516,7 +1515,7 @@ static public void Begin() break; } } - int[] itemsToPlaceInGlassChestsSecondary = new int[] { ModLoader.GetMod("Tremor").ItemType("IceKey"), 73 }; + int[] itemsToPlaceInGlassChestsSecondary = { ModLoader.GetMod("Tremor").ItemType("IceKey"), 73 }; int itemsToPlaceInGlassChestsSecondaryChoice = 0; if (isInDungeon) { diff --git a/Dusts/SoulofHopeDust.cs b/Dusts/SoulofHopeDust.cs index 88a4bf75..73a576b6 100644 --- a/Dusts/SoulofHopeDust.cs +++ b/Dusts/SoulofHopeDust.cs @@ -1,6 +1,6 @@ +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Dusts { diff --git a/Dusts/SoulofTrustDust.cs b/Dusts/SoulofTrustDust.cs index 7a1c17e0..0880c221 100644 --- a/Dusts/SoulofTrustDust.cs +++ b/Dusts/SoulofTrustDust.cs @@ -1,6 +1,6 @@ +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Dusts { diff --git a/Dusts/SoulofTruthDust.cs b/Dusts/SoulofTruthDust.cs index b57ed84f..61dc33d1 100644 --- a/Dusts/SoulofTruthDust.cs +++ b/Dusts/SoulofTruthDust.cs @@ -1,6 +1,6 @@ +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Dusts { diff --git a/GItem.cs b/GItem.cs index 72d0d2ef..ed334ed1 100644 --- a/GItem.cs +++ b/GItem.cs @@ -1,25 +1,26 @@  +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace Tremor { - public class GItem : GlobalItem + public class TremorGlobalItem : GlobalItem { public override void ModifyHitNPC(Item item, Player player, NPC target, ref int damage, ref float knockBack, ref bool crit) { // If the item we're using to damage someone/something is an AlchemistItem. - if (item.modItem != null && item.modItem is AlchemistItem) + if (item.modItem is AlchemistItem) { MPlayer mp = player.GetModPlayer(mod); // We want to multiply the damage we do by our alchemistDamage modifier. damage = (int)(damage * mp.alchemistDamage); } } - public override bool Shoot(Item item, Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + public override bool Shoot(Item item, Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { // Same for projectiles. - if (item.modItem != null && item.modItem is AlchemistItem) + if (item.modItem is AlchemistItem) { MPlayer mp = player.GetModPlayer(mod); damage = (int)(damage * mp.alchemistDamage); diff --git a/Gores/IceDroplet.cs b/Gores/IceDroplet.cs index 36501c2e..3cf93074 100644 --- a/Gores/IceDroplet.cs +++ b/Gores/IceDroplet.cs @@ -42,7 +42,7 @@ public override bool Update(Gore gore) { frameDuration = 24 + Main.rand.Next(96); } - if ((int)gore.frameCounter >= frameDuration) + if (gore.frameCounter >= frameDuration) { gore.frameCounter = 0; gore.frame += 1; @@ -57,7 +57,7 @@ public override bool Update(Gore gore) else if (gore.frame <= 6) { frameDuration = 8; - if ((int)gore.frameCounter >= frameDuration) + if (gore.frameCounter >= frameDuration) { gore.frameCounter = 0; gore.frame += 1; @@ -79,7 +79,7 @@ public override bool Update(Gore gore) { gore.velocity.Y = 12f; } - if ((int)gore.frameCounter >= frameDuration) + if (gore.frameCounter >= frameDuration) { gore.frameCounter = 0; gore.frame += 1; @@ -92,7 +92,7 @@ public override bool Update(Gore gore) else { gore.velocity.Y += 0.1f; - if ((int)gore.frameCounter >= frameDuration) + if (gore.frameCounter >= frameDuration) { gore.frameCounter = 0; gore.frame += 1; @@ -128,7 +128,7 @@ public override bool Update(Gore gore) if (Main.tile[tileX, tileY] != null && Main.tile[tileX, tileY].liquid > 0) { gore.velocity *= 0f; - gore.position.Y = tileY * 16 - (int)(Main.tile[tileX, tileY].liquid / 16); + gore.position.Y = tileY * 16 - Main.tile[tileX, tileY].liquid / 16; } } diff --git a/Helper.cs b/Helper.cs index ec5eff9d..af28b119 100644 --- a/Helper.cs +++ b/Helper.cs @@ -1,9 +1,9 @@ -using Terraria; -using Microsoft.Xna.Framework; -using System; -using System.Linq; +using System; using System.Collections.Generic; +using System.Linq; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using Terraria; namespace Tremor { @@ -26,7 +26,7 @@ public static Vector2 RandomPositin(Vector2 pos1, Vector2 pos2) return new Vector2(rnd.Next((int)pos1.X, (int)pos2.X) + 1, rnd.Next((int)pos1.Y, (int)pos2.Y) + 1); } - public static int GetNearestAlivePlayer(Terraria.NPC npc) + public static int GetNearestAlivePlayer(NPC npc) { float NearestPlayerDist = 4815162342f; int NearestPlayer = -1; @@ -177,8 +177,8 @@ public static Vector2 CenterPoint(Vector2 A, Vector2 B) public static Vector2 PolarPos(Vector2 Point, float Distance, float Angle, int XOffset = 0, int YOffset = 0) { Vector2 ReturnedValue = new Vector2(); - ReturnedValue.X = (Distance * (float)Math.Sin((double)Helper.RadtoGrad(Angle)) + Point.X) + XOffset; - ReturnedValue.Y = (Distance * (float)Math.Cos((double)Helper.RadtoGrad(Angle)) + Point.Y) + YOffset; + ReturnedValue.X = (Distance * (float)Math.Sin(RadtoGrad(Angle)) + Point.X) + XOffset; + ReturnedValue.Y = (Distance * (float)Math.Cos(RadtoGrad(Angle)) + Point.Y) + YOffset; return ReturnedValue; } @@ -212,32 +212,32 @@ public static float DistortFloat(float Float, float Percent) DistortNumber *= 10; Counter++; } - return Float + (((float)(Main.rand.Next(0, (int)DistortNumber + 1)) / (float)(Math.Pow(10, Counter))) * ((Main.rand.Next(2) == 0) ? -1 : 1)); + return Float + ((Main.rand.Next(0, (int)DistortNumber + 1) / (float)(Math.Pow(10, Counter))) * ((Main.rand.Next(2) == 0) ? -1 : 1)); } public static void Explode(int index, int sizeX, int sizeY, ExtraAction visualAction = null) { - Terraria.Projectile projectile = Main.projectile[index]; + Projectile projectile = Main.projectile[index]; if (!projectile.active) { return; } projectile.tileCollide = false; projectile.alpha = 255; - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.position.X = projectile.position.X + projectile.width / 2; + projectile.position.Y = projectile.position.Y + projectile.height / 2; projectile.width = sizeX; projectile.height = sizeY; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.position.X = projectile.position.X - projectile.width / 2; + projectile.position.Y = projectile.position.Y - projectile.height / 2; projectile.Damage(); Main.projectileIdentity[projectile.owner, projectile.identity] = -1; - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); - projectile.width = (int)((float)sizeX / 5.8f); - projectile.height = (int)((float)sizeY / 5.8f); - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.position.X = projectile.position.X + projectile.width / 2; + projectile.position.Y = projectile.position.Y + projectile.height / 2; + projectile.width = (int)(sizeX / 5.8f); + projectile.height = (int)(sizeY / 5.8f); + projectile.position.X = projectile.position.X - projectile.width / 2; + projectile.position.Y = projectile.position.Y - projectile.height / 2; if (visualAction == null) { for (int i = 0; i < 30; i++) @@ -292,11 +292,11 @@ public static void Explode(int index, int sizeX, int sizeY, ExtraAction visualAc public static void DrawAroundOrigin(int index, Color lightColor) { - Terraria.Projectile projectile = Main.projectile[index]; + Projectile projectile = Main.projectile[index]; Texture2D texture2D = Main.projectileTexture[projectile.type]; - Vector2 origin = new Vector2((float)texture2D.Width * 0.5f, (float)(texture2D.Height / Main.projFrames[projectile.type]) * 0.5f); + Vector2 origin = new Vector2(texture2D.Width * 0.5f, texture2D.Height / Main.projFrames[projectile.type] * 0.5f); SpriteEffects effects = (projectile.direction == -1) ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - Main.spriteBatch.Draw(texture2D, projectile.Center - Main.screenPosition, new Rectangle?(Utils.Frame(texture2D, 1, Main.projFrames[projectile.type], 0, projectile.frame)), lightColor, projectile.rotation, origin, projectile.scale, effects, 0f); + Main.spriteBatch.Draw(texture2D, projectile.Center - Main.screenPosition, texture2D.Frame(1, Main.projFrames[projectile.type], 0, projectile.frame), lightColor, projectile.rotation, origin, projectile.scale, effects, 0f); } public static void DropItem(Rectangle Area, params Drop[] Drops) @@ -310,7 +310,7 @@ public static void DropItem(Rectangle Area, params Drop[] Drops) Sh.Add(drop); }); Drop DroppedItem = Sh[Main.rand.Next(Sh.Count)]; - Item.NewItem((int)Area.X, (int)Area.Y, Area.Height, Area.Width, DroppedItem.Item, DroppedItem.Count); + Item.NewItem(Area.X, Area.Y, Area.Height, Area.Width, DroppedItem.Item, DroppedItem.Count); } } diff --git a/Helper2.cs b/Helper2.cs index e93aff5e..c6d0daa0 100644 --- a/Helper2.cs +++ b/Helper2.cs @@ -1,12 +1,12 @@ -using Terraria; -using System; +using System; using Microsoft.Xna.Framework; +using Terraria; namespace Tremor { public static class Helper2 { - public static int GetNearestPlayer(Terraria.NPC npc) + public static int GetNearestPlayer(NPC npc) { float NearestPlayerDist = 4815162342f; int NearestPlayer = -1; @@ -21,7 +21,7 @@ public static int GetNearestPlayer(Terraria.NPC npc) return NearestPlayer; } - public static int GetNearestAlivePlayer(Terraria.NPC npc) + public static int GetNearestAlivePlayer(NPC npc) { float NearestPlayerDist = 4815162342f; int NearestPlayer = -1; diff --git a/Ice/Dungeon/DungeonWallItem.cs b/Ice/Dungeon/DungeonWallItem.cs index 57a7deb6..b4594a36 100644 --- a/Ice/Dungeon/DungeonWallItem.cs +++ b/Ice/Dungeon/DungeonWallItem.cs @@ -1,5 +1,5 @@ -using Terraria.ModLoader; using Terraria.ID; +using Terraria.ModLoader; namespace Tremor.Ice.Dungeon { diff --git a/Ice/IceChest.cs b/Ice/IceChest.cs index f079b0bd..0afd32e8 100644 --- a/Ice/IceChest.cs +++ b/Ice/IceChest.cs @@ -1,4 +1,3 @@ -using System; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -22,10 +21,10 @@ public override void SetDefaults() Main.tileValue[Type] = 500; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.newTile.Origin = new Point16(0, 1); - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 18 }; - TileObjectData.newTile.HookCheck = new PlacementHook(new Func(Chest.FindEmptyChest), -1, 0, true); - TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(new Func(Chest.AfterPlacement_Hook), -1, 0, false); - TileObjectData.newTile.AnchorInvalidTiles = new int[] { 127 }; + TileObjectData.newTile.CoordinateHeights = new[] { 16, 18 }; + TileObjectData.newTile.HookCheck = new PlacementHook(Chest.FindEmptyChest, -1, 0, true); + TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(Chest.AfterPlacement_Hook, -1, 0, false); + TileObjectData.newTile.AnchorInvalidTiles = new[] { 127 }; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.LavaDeath = false; TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); @@ -55,10 +54,7 @@ public string MapChestName(string name, int i, int j) { return name; } - else - { - return name + ": " + Main.chest[chest].name; - } + return name + ": " + Main.chest[chest].name; } public override void NumDust(int i, int j, bool fail, ref int num) @@ -150,7 +146,7 @@ public override void RightClick(int i, int j) } else { - NetMessage.SendData(31, -1, -1, null, left, (float)top, 0f, 0f, 0, 0, 0); + NetMessage.SendData(31, -1, -1, null, left, top, 0f, 0f, 0, 0, 0); Main.stackSplit = 600; } } diff --git a/Ice/IceColl1.cs b/Ice/IceColl1.cs index 1278e6e6..dd7a5edb 100644 --- a/Ice/IceColl1.cs +++ b/Ice/IceColl1.cs @@ -1,8 +1,8 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.Enums; using Terraria.ModLoader; using Terraria.ObjectData; -using Terraria.Enums; namespace Tremor.Ice { @@ -39,7 +39,7 @@ public override void SetDefaults() dustType = 3; TileObjectData.newTile.LavaPlacement = LiquidPlacement.NotAllowed; TileObjectData.newTile.CopyFrom(TileObjectData.StyleAlch); - TileObjectData.newTile.AnchorValidTiles = new int[] + TileObjectData.newTile.AnchorValidTiles = new[] { mod.TileType("IceBlock") }; diff --git a/Ice/IceColl2.cs b/Ice/IceColl2.cs index df9fd5a1..8bf28158 100644 --- a/Ice/IceColl2.cs +++ b/Ice/IceColl2.cs @@ -1,8 +1,8 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.Enums; using Terraria.ModLoader; using Terraria.ObjectData; -using Terraria.Enums; namespace Tremor.Ice { @@ -38,7 +38,7 @@ public override void SetDefaults() Main.tileWaterDeath[Type] = false; TileObjectData.newTile.LavaPlacement = LiquidPlacement.NotAllowed; TileObjectData.newTile.CopyFrom(TileObjectData.StyleAlch); - TileObjectData.newTile.AnchorValidTiles = new int[] + TileObjectData.newTile.AnchorValidTiles = new[] { mod.TileType("IceBlock") }; diff --git a/Ice/IceWallW.cs b/Ice/IceWallW.cs index 96457590..2236736e 100644 --- a/Ice/IceWallW.cs +++ b/Ice/IceWallW.cs @@ -1,5 +1,5 @@ -using Terraria.ModLoader; using Terraria.ID; +using Terraria.ModLoader; namespace Tremor.Ice { diff --git a/Ice/Items/FrostLance.cs b/Ice/Items/FrostLance.cs index 598495d8..870422b1 100644 --- a/Ice/Items/FrostLance.cs +++ b/Ice/Items/FrostLance.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Ice.Items diff --git a/Ice/Items/FrostLiquidFlaskPro.cs b/Ice/Items/FrostLiquidFlaskPro.cs index 139421f1..a1b13329 100644 --- a/Ice/Items/FrostLiquidFlaskPro.cs +++ b/Ice/Items/FrostLiquidFlaskPro.cs @@ -36,10 +36,10 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(6, 20); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, 118, projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, 118, projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } diff --git a/Ice/Items/FrozenPaxe.cs b/Ice/Items/FrozenPaxe.cs index 699a8892..58bf7fef 100644 --- a/Ice/Items/FrozenPaxe.cs +++ b/Ice/Items/FrozenPaxe.cs @@ -1,7 +1,7 @@ -using Terraria.ID; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Ice.Items { diff --git a/Ice/Items/Furniture/IceBathtubTile.cs b/Ice/Items/Furniture/IceBathtubTile.cs index d19d403b..8f224691 100644 --- a/Ice/Items/Furniture/IceBathtubTile.cs +++ b/Ice/Items/Furniture/IceBathtubTile.cs @@ -13,7 +13,7 @@ public override void SetDefaults() Main.tileFrameImportant[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style4x2); //this style already takes care of direction for us - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); AddMapEntry(new Color(87, 144, 165)); diff --git a/Ice/Items/Furniture/IceBedTile.cs b/Ice/Items/Furniture/IceBedTile.cs index d97caa21..26e5c863 100644 --- a/Ice/Items/Furniture/IceBedTile.cs +++ b/Ice/Items/Furniture/IceBedTile.cs @@ -13,7 +13,7 @@ public override void SetDefaults() Main.tileFrameImportant[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style4x2); //this style already takes care of direction for us - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16 }; TileObjectData.addTile(Type); AddMapEntry(new Color(87, 144, 165)); adjTiles = new int[] { TileID.Beds }; diff --git a/Ice/Items/Furniture/IceBookcaseTile.cs b/Ice/Items/Furniture/IceBookcaseTile.cs index c2eb5919..bf93248c 100644 --- a/Ice/Items/Furniture/IceBookcaseTile.cs +++ b/Ice/Items/Furniture/IceBookcaseTile.cs @@ -16,7 +16,7 @@ public override void SetDefaults() Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4); - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16, 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); AddMapEntry(new Color(87, 144, 165)); diff --git a/Ice/Items/Furniture/IceCandelabraTile.cs b/Ice/Items/Furniture/IceCandelabraTile.cs index e523a8d5..f760286c 100644 --- a/Ice/Items/Furniture/IceCandelabraTile.cs +++ b/Ice/Items/Furniture/IceCandelabraTile.cs @@ -4,7 +4,6 @@ using Terraria.ModLoader; using Terraria.ObjectData; - namespace Tremor.Ice.Items.Furniture { public class IceCandelabraTile : ModTile diff --git a/Ice/Items/Furniture/IceChairTile.cs b/Ice/Items/Furniture/IceChairTile.cs index 8d7b104d..7140e98d 100644 --- a/Ice/Items/Furniture/IceChairTile.cs +++ b/Ice/Items/Furniture/IceChairTile.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileNoAttach[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2); - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16 }; TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; TileObjectData.newTile.StyleWrapLimit = 2; //not really necessary but allows me to add more subtypes of chairs below the example chair texture TileObjectData.newTile.StyleMultiplier = 2; //same as above diff --git a/Ice/Items/Furniture/IceChandelierTile.cs b/Ice/Items/Furniture/IceChandelierTile.cs index c04569c0..0a2f2041 100644 --- a/Ice/Items/Furniture/IceChandelierTile.cs +++ b/Ice/Items/Furniture/IceChandelierTile.cs @@ -16,7 +16,7 @@ public override void SetDefaults() TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2Top); TileObjectData.newTile.Height = 3; TileObjectData.newTile.Width = 3; - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16, 16 }; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 111; TileObjectData.addTile(Type); diff --git a/Ice/Items/Furniture/IceChestTile.cs b/Ice/Items/Furniture/IceChestTile.cs index 0da189e0..ae2a3bc4 100644 --- a/Ice/Items/Furniture/IceChestTile.cs +++ b/Ice/Items/Furniture/IceChestTile.cs @@ -1,4 +1,3 @@ -using System; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -22,10 +21,10 @@ public override void SetDefaults() Main.tileValue[Type] = 500; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.newTile.Origin = new Point16(0, 1); - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 18 }; - TileObjectData.newTile.HookCheck = new PlacementHook(new Func(Chest.FindEmptyChest), -1, 0, true); - TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(new Func(Chest.AfterPlacement_Hook), -1, 0, false); - TileObjectData.newTile.AnchorInvalidTiles = new int[] { 127 }; + TileObjectData.newTile.CoordinateHeights = new[] { 16, 18 }; + TileObjectData.newTile.HookCheck = new PlacementHook(Chest.FindEmptyChest, -1, 0, true); + TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(Chest.AfterPlacement_Hook, -1, 0, false); + TileObjectData.newTile.AnchorInvalidTiles = new[] { 127 }; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.LavaDeath = false; TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); @@ -56,10 +55,7 @@ public string MapChestName(string name, int i, int j) { return name; } - else - { - return name + ": " + Main.chest[chest].name; - } + return name + ": " + Main.chest[chest].name; } public override void NumDust(int i, int j, bool fail, ref int num) @@ -116,7 +112,7 @@ public override void RightClick(int i, int j) } else { - NetMessage.SendData(31, -1, -1, null, left, (float)top, 0f, 0f, 0, 0, 0); + NetMessage.SendData(31, -1, -1, null, left, top, 0f, 0f, 0, 0, 0); Main.stackSplit = 600; } } diff --git a/Ice/Items/Furniture/IceDoorClosed.cs b/Ice/Items/Furniture/IceDoorClosed.cs index 04d89170..6ec307e3 100644 --- a/Ice/Items/Furniture/IceDoorClosed.cs +++ b/Ice/Items/Furniture/IceDoorClosed.cs @@ -24,7 +24,7 @@ public override void SetDefaults() TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile, TileObjectData.newTile.Width, 0); TileObjectData.newTile.UsesCustomCanPlace = true; TileObjectData.newTile.LavaDeath = true; - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16, 16 }; TileObjectData.newTile.CoordinateWidth = 16; TileObjectData.newTile.CoordinatePadding = 2; TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); diff --git a/Ice/Items/Furniture/IceDoorOpen.cs b/Ice/Items/Furniture/IceDoorOpen.cs index ed50f051..16fd8175 100644 --- a/Ice/Items/Furniture/IceDoorOpen.cs +++ b/Ice/Items/Furniture/IceDoorOpen.cs @@ -23,7 +23,7 @@ public override void SetDefaults() TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile, 1, 0); TileObjectData.newTile.UsesCustomCanPlace = true; TileObjectData.newTile.LavaDeath = true; - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16, 16 }; TileObjectData.newTile.CoordinateWidth = 16; TileObjectData.newTile.CoordinatePadding = 2; TileObjectData.newTile.StyleHorizontal = true; diff --git a/Ice/Items/Furniture/IceDresserTile.cs b/Ice/Items/Furniture/IceDresserTile.cs index dc5a94af..5fb1c8c0 100644 --- a/Ice/Items/Furniture/IceDresserTile.cs +++ b/Ice/Items/Furniture/IceDresserTile.cs @@ -1,11 +1,10 @@ -using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.DataStructures; +using Terraria.Enums; using Terraria.ID; using Terraria.ModLoader; using Terraria.ObjectData; -using Terraria.Enums; -using Terraria.DataStructures; namespace Tremor.Ice.Items.Furniture { @@ -21,10 +20,10 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); TileObjectData.newTile.Origin = new Point16(1, 1); - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16 }; - TileObjectData.newTile.HookCheck = new PlacementHook(new Func(Chest.FindEmptyChest), -1, 0, true); - TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(new Func(Chest.AfterPlacement_Hook), -1, 0, false); - TileObjectData.newTile.AnchorInvalidTiles = new int[] { 127 }; + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16 }; + TileObjectData.newTile.HookCheck = new PlacementHook(Chest.FindEmptyChest, -1, 0, true); + TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(Chest.AfterPlacement_Hook, -1, 0, false); + TileObjectData.newTile.AnchorInvalidTiles = new[] { 127 }; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.LavaDeath = false; TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); @@ -44,10 +43,10 @@ public override void RightClick(int i, int j) { Main.CancelClothesWindow(true); Main.mouseRightRelease = false; - int left = (int)(Main.tile[Player.tileTargetX, Player.tileTargetY].frameX / 18); + int left = Main.tile[Player.tileTargetX, Player.tileTargetY].frameX / 18; left %= 3; left = Player.tileTargetX - left; - int top = Player.tileTargetY - (int)(Main.tile[Player.tileTargetX, Player.tileTargetY].frameY / 18); + int top = Player.tileTargetY - Main.tile[Player.tileTargetX, Player.tileTargetY].frameY / 18; if (player.sign > -1) { Main.PlaySound(11, -1, -1, 1); @@ -130,7 +129,7 @@ public override void MouseOverFar(int i, int j) Tile tile = Main.tile[Player.tileTargetX, Player.tileTargetY]; int left = Player.tileTargetX; int top = Player.tileTargetY; - left -= (int)(tile.frameX % 54 / 18); + left -= tile.frameX % 54 / 18; if (tile.frameY % 36 != 0) { top--; @@ -172,7 +171,7 @@ public override void MouseOver(int i, int j) Tile tile = Main.tile[Player.tileTargetX, Player.tileTargetY]; int left = Player.tileTargetX; int top = Player.tileTargetY; - left -= (int)(tile.frameX % 54 / 18); + left -= tile.frameX % 54 / 18; if (tile.frameY % 36 != 0) { top--; diff --git a/Ice/Items/Furniture/IceGrandfatherClockTile.cs b/Ice/Items/Furniture/IceGrandfatherClockTile.cs index 477d4b8b..36d1bd45 100644 --- a/Ice/Items/Furniture/IceGrandfatherClockTile.cs +++ b/Ice/Items/Furniture/IceGrandfatherClockTile.cs @@ -14,7 +14,7 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); TileObjectData.newTile.Height = 5; - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16, 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16, 16, 16, 16 }; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 36; TileObjectData.addTile(Type); diff --git a/Ice/Items/Furniture/IceLampTile.cs b/Ice/Items/Furniture/IceLampTile.cs index 8002d7c8..4d83ecb5 100644 --- a/Ice/Items/Furniture/IceLampTile.cs +++ b/Ice/Items/Furniture/IceLampTile.cs @@ -14,7 +14,7 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2); TileObjectData.newTile.Height = 3; - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16, 16 }; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 36; TileObjectData.addTile(Type); diff --git a/Ice/Items/Furniture/IceLanternTile.cs b/Ice/Items/Furniture/IceLanternTile.cs index a4fc3e13..ca96c7f5 100644 --- a/Ice/Items/Furniture/IceLanternTile.cs +++ b/Ice/Items/Furniture/IceLanternTile.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2Top); TileObjectData.newTile.Height = 2; - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16 }; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 111; TileObjectData.addTile(Type); diff --git a/Ice/Items/Furniture/IcePianoTile.cs b/Ice/Items/Furniture/IcePianoTile.cs index 0da3ea1c..7298c7d9 100644 --- a/Ice/Items/Furniture/IcePianoTile.cs +++ b/Ice/Items/Furniture/IcePianoTile.cs @@ -16,7 +16,7 @@ public override void SetDefaults() Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style4x2); - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); AddMapEntry(new Color(87, 144, 165)); diff --git a/Ice/Items/Furniture/IcePlatformTile.cs b/Ice/Items/Furniture/IcePlatformTile.cs index e87bbad2..e124ef1d 100644 --- a/Ice/Items/Furniture/IcePlatformTile.cs +++ b/Ice/Items/Furniture/IcePlatformTile.cs @@ -17,7 +17,7 @@ public override void SetDefaults() Main.tileNoAttach[Type] = true; Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; - TileObjectData.newTile.CoordinateHeights = new int[] { 16 }; + TileObjectData.newTile.CoordinateHeights = new[] { 16 }; TileObjectData.newTile.CoordinateWidth = 16; TileObjectData.newTile.CoordinatePadding = 2; TileObjectData.newTile.StyleHorizontal = true; diff --git a/Ice/Items/Furniture/IceSinkTile.cs b/Ice/Items/Furniture/IceSinkTile.cs index 633fe1bd..fa4ec737 100644 --- a/Ice/Items/Furniture/IceSinkTile.cs +++ b/Ice/Items/Furniture/IceSinkTile.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); AddMapEntry(new Color(87, 144, 165)); diff --git a/Ice/Items/Furniture/IceTableTile.cs b/Ice/Items/Furniture/IceTableTile.cs index e19e0720..2cea3795 100644 --- a/Ice/Items/Furniture/IceTableTile.cs +++ b/Ice/Items/Furniture/IceTableTile.cs @@ -16,7 +16,7 @@ public override void SetDefaults() Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); AddMapEntry(new Color(87, 144, 165)); diff --git a/Ice/Items/Furniture/IceWorkbenchTile.cs b/Ice/Items/Furniture/IceWorkbenchTile.cs index 363c8fd8..70e6cddc 100644 --- a/Ice/Items/Furniture/IceWorkbenchTile.cs +++ b/Ice/Items/Furniture/IceWorkbenchTile.cs @@ -16,7 +16,7 @@ public override void SetDefaults() Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x1); - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16 }; TileObjectData.addTile(Type); adjTiles = new int[] { TileID.WorkBenches }; AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); diff --git a/Ice/Items/GlacierArmchairTile.cs b/Ice/Items/GlacierArmchairTile.cs index 6bf79bf3..1a08e11d 100644 --- a/Ice/Items/GlacierArmchairTile.cs +++ b/Ice/Items/GlacierArmchairTile.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileNoAttach[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16 }; TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; TileObjectData.newTile.StyleWrapLimit = 2; //not really necessary but allows me to add more subtypes of chairs below the example chair texture TileObjectData.newTile.StyleMultiplier = 2; //same as above diff --git a/Ice/Items/GlacierKnives.cs b/Ice/Items/GlacierKnives.cs index b1b40a80..268d2c0b 100644 --- a/Ice/Items/GlacierKnives.cs +++ b/Ice/Items/GlacierKnives.cs @@ -1,7 +1,7 @@ using System; using Microsoft.Xna.Framework; -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Ice.Items @@ -47,12 +47,12 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX for (int i = 0; i < ShotAmt; i++) { - float vX = 8 * speedX + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - float vY = 8 * speedY + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + float vX = 8 * speedX + Main.rand.Next(-spread, spread + 1) * spreadMult; + float vY = 8 * speedY + Main.rand.Next(-spread, spread + 1) * spreadMult; float angle = (float)Math.Atan(vY / vX); vector2 = new Vector2(position.X + 75f * (float)Math.Cos(angle), position.Y + 75f * (float)Math.Sin(angle)); - float mouseX = (float)Main.mouseX + Main.screenPosition.X; + float mouseX = Main.mouseX + Main.screenPosition.X; if (mouseX < player.position.X) { vector2 = new Vector2(position.X - 75f * (float)Math.Cos(angle), position.Y - 75f * (float)Math.Sin(angle)); diff --git a/Ice/Items/GlacierKnivesProj.cs b/Ice/Items/GlacierKnivesProj.cs index 6e71aabf..c2ea6e9a 100644 --- a/Ice/Items/GlacierKnivesProj.cs +++ b/Ice/Items/GlacierKnivesProj.cs @@ -36,9 +36,9 @@ public override void AI() { if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1)) { - float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2); - float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2); - float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); + float num476 = Main.npc[num475].position.X + Main.npc[num475].width / 2; + float num477 = Main.npc[num475].position.Y + Main.npc[num475].height / 2; + float num478 = Math.Abs(projectile.position.X + projectile.width / 2 - num476) + Math.Abs(projectile.position.Y + projectile.height / 2 - num477); if (num478 < num474) { num474 = num478; @@ -51,16 +51,15 @@ public override void AI() if (flag17) { float num483 = 8f; - Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + Vector2 vector35 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); float num484 = num472 - vector35.X; float num485 = num473 - vector35.Y; - float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485)); + float num486 = (float)Math.Sqrt(num484 * num484 + num485 * num485); num486 = num483 / num486; num484 *= num486; num485 *= num486; projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f; projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f; - return; } } diff --git a/Ice/Items/GlacierWoodBow.cs b/Ice/Items/GlacierWoodBow.cs index be61306e..25271e1a 100644 --- a/Ice/Items/GlacierWoodBow.cs +++ b/Ice/Items/GlacierWoodBow.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Microsoft.Xna.Framework; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Ice.Items diff --git a/Ice/Items/Icoj.cs b/Ice/Items/Icoj.cs index 7592b026..f467b354 100644 --- a/Ice/Items/Icoj.cs +++ b/Ice/Items/Icoj.cs @@ -10,7 +10,7 @@ public override void SetStaticDefaults() { DisplayName.SetDefault("Ice Proj"); } - float rotationProj = 0.0f; + float rotationProj; public override void SetDefaults() { projectile.width = 92; @@ -30,7 +30,7 @@ public override void SetDefaults() //aiType = ProjectileID.Bullet; } - int timer = 0; + int timer; public override void AI() { timer++; diff --git a/Ice/Mobs/ColdtrapChain.cs b/Ice/Mobs/ColdtrapChain.cs index ca8a0800..3508a018 100644 --- a/Ice/Mobs/ColdtrapChain.cs +++ b/Ice/Mobs/ColdtrapChain.cs @@ -53,10 +53,10 @@ public float maxAngle projectile.localAI[1] = value; } } - public float angleSpeed = 0f; - public float lengthSpeed = 0f; + public float angleSpeed; + public float lengthSpeed; public int arm = -1; - private int netUpdateCounter = 0; + private int netUpdateCounter; private const float maxAngleSpeed = 0.1f; private const float angleBuffer = (float)Math.PI / 12f; public const float minLength = 80f; diff --git a/Ice/Mobs/Dot.cs b/Ice/Mobs/Dot.cs index 158ea820..b7d7ee18 100644 --- a/Ice/Mobs/Dot.cs +++ b/Ice/Mobs/Dot.cs @@ -33,8 +33,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override float SpawnChance(NPCSpawnInfo spawnInfo) @@ -61,7 +61,7 @@ public override void AI() ColdtrapChain arm = Main.projectile[proj].modProjectile as ColdtrapChain; arm.arm = npc.whoAmI; arm.width = 16f; - arm.length = Ice.Mobs.ColdtrapChain.minLength; + arm.length = ColdtrapChain.minLength; arm.minAngle = (k - 0.05f) * (float)Math.PI / 3f; arm.maxAngle = (k + 0.25f) * (float)Math.PI / 3f; Main.projectile[proj].rotation = (arm.minAngle + arm.maxAngle) / 3f; diff --git a/Ice/Mobs/Frostbyte.cs b/Ice/Mobs/Frostbyte.cs index 8fcccc59..e809dd4f 100644 --- a/Ice/Mobs/Frostbyte.cs +++ b/Ice/Mobs/Frostbyte.cs @@ -1,6 +1,6 @@ -using Microsoft.Xna.Framework; using System; using System.Linq; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; @@ -31,8 +31,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override float SpawnChance(NPCSpawnInfo spawnInfo) @@ -50,8 +50,8 @@ public override void NPCLoot() public override void AI() { int tileX = (int)(npc.Bottom.Y / 16f), tileY = (int)(npc.Bottom.Y / 16f); - int height = (int)Math.Min(10, tileX); - float velX = MathHelper.Lerp(5f, 3f, (float)height / 10f), velY = MathHelper.Lerp(-3f, -6f, (float)height / 10f); + int height = Math.Min(10, tileX); + float velX = MathHelper.Lerp(5f, 3f, height / 10f), velY = MathHelper.Lerp(-3f, -6f, height / 10f); npc.aiStyle = 1; if (npc.target >= 0 && npc.target <= 255 && Main.player[npc.target].Bottom.Y < npc.Center.Y && npc.collideX && npc.velocity.Y != 0) { @@ -61,7 +61,7 @@ public override void AI() for (int m = 0; m < 2; m++) { float xPos = npc.velocity.X > 0 ? npc.Right.X : npc.Left.X; - int dustID = Dust.NewDust(new Vector2(xPos, npc.Center.Y), 1, 1, 80, xPos < npc.Center.X ? -4f : 4f, (float)Math.Abs(npc.velocity.Y) * 0.2f, 100, Color.White, 1.5f); + int dustID = Dust.NewDust(new Vector2(xPos, npc.Center.Y), 1, 1, 80, xPos < npc.Center.X ? -4f : 4f, Math.Abs(npc.velocity.Y) * 0.2f, 100, Color.White, 1.5f); Main.dust[dustID].noGravity = true; } } diff --git a/Ice/Mobs/Glacier.cs b/Ice/Mobs/Glacier.cs index bb192992..b8aa08a1 100644 --- a/Ice/Mobs/Glacier.cs +++ b/Ice/Mobs/Glacier.cs @@ -1,5 +1,5 @@ -using Microsoft.Xna.Framework; using System.Linq; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -36,8 +36,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() @@ -68,7 +68,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GlacierGore"), 1f); } diff --git a/Ice/Mobs/IceWolf.cs b/Ice/Mobs/IceWolf.cs index 55b63550..75b62396 100644 --- a/Ice/Mobs/IceWolf.cs +++ b/Ice/Mobs/IceWolf.cs @@ -1,5 +1,5 @@ -using Microsoft.Xna.Framework; using System.Linq; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -32,8 +32,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } @@ -67,7 +67,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IceWolfGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IceWolfGore2"), 1f); diff --git a/Ice/Mobs/WhiteHound.cs b/Ice/Mobs/WhiteHound.cs index aafe93de..15468232 100644 --- a/Ice/Mobs/WhiteHound.cs +++ b/Ice/Mobs/WhiteHound.cs @@ -1,5 +1,5 @@ -using Microsoft.Xna.Framework; using System.Linq; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -37,7 +37,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WhiteHoundGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WhiteHoundGore2"), 1f); diff --git a/Ice/Mobs/WhiteWalker.cs b/Ice/Mobs/WhiteWalker.cs index 6164c8e8..41d86296 100644 --- a/Ice/Mobs/WhiteWalker.cs +++ b/Ice/Mobs/WhiteWalker.cs @@ -1,5 +1,5 @@ -using Microsoft.Xna.Framework; using System.Linq; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -32,8 +32,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override float SpawnChance(NPCSpawnInfo spawnInfo) @@ -63,7 +63,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WhiteWalkerGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WhiteWalkerGore1"), 1f); diff --git a/Ice/Tree/TremorSapling.cs b/Ice/Tree/TremorSapling.cs index 49792c54..408ea30d 100644 --- a/Ice/Tree/TremorSapling.cs +++ b/Ice/Tree/TremorSapling.cs @@ -21,10 +21,10 @@ public override void SetDefaults() TileObjectData.newTile.Origin = new Point16(0, 1); TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile, TileObjectData.newTile.Width, 0); TileObjectData.newTile.UsesCustomCanPlace = true; - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 18 }; + TileObjectData.newTile.CoordinateHeights = new[] { 16, 18 }; TileObjectData.newTile.CoordinateWidth = 16; TileObjectData.newTile.CoordinatePadding = 2; - TileObjectData.newTile.AnchorValidTiles = new int[] { mod.TileType("VeryVeryIce") }; + TileObjectData.newTile.AnchorValidTiles = new[] { mod.TileType("VeryVeryIce") }; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.DrawFlipHorizontal = true; TileObjectData.newTile.WaterPlacement = LiquidPlacement.NotAllowed; diff --git a/Ice/Tree/TremorTree.cs b/Ice/Tree/TremorTree.cs index dadde571..fe086fe7 100644 --- a/Ice/Tree/TremorTree.cs +++ b/Ice/Tree/TremorTree.cs @@ -5,13 +5,7 @@ namespace Tremor.Ice.Tree { public class TremorTree : ModTree { - private Mod mod - { - get - { - return ModLoader.GetMod("Tremor"); - } - } + private Mod mod => ModLoader.GetMod("Tremor"); public override int CreateDust() { diff --git a/Invasion/ClockofTime.cs b/Invasion/ClockofTime.cs index 91e784d6..64879345 100644 --- a/Invasion/ClockofTime.cs +++ b/Invasion/ClockofTime.cs @@ -38,14 +38,11 @@ public override bool UseItem(Player player) Main.bloodMoon = true; return true; } - else + if (Main.netMode != 1) { - if (Main.netMode != 1) - { - Main.dayTime = !Main.dayTime; - Main.time = (Main.dayTime ? 10000f : 0f); - return true; - } + Main.dayTime = !Main.dayTime; + Main.time = (Main.dayTime ? 10000f : 0f); + return true; } return true; } diff --git a/Invasion/CyberLaser.cs b/Invasion/CyberLaser.cs index e5cdecf6..c6df9bc5 100644 --- a/Invasion/CyberLaser.cs +++ b/Invasion/CyberLaser.cs @@ -56,7 +56,6 @@ public override void AI() if (projectile.wet && !projectile.lavaWet) { projectile.Kill(); - return; } } } diff --git a/Invasion/CyberLaserBat.cs b/Invasion/CyberLaserBat.cs index 41b9906d..d11bad27 100644 --- a/Invasion/CyberLaserBat.cs +++ b/Invasion/CyberLaserBat.cs @@ -28,7 +28,7 @@ public override void PostAI() Vector2 lookTarget = projectile.Center + projectile.velocity; float rotX = lookTarget.X - center.X; float rotY = lookTarget.Y - center.Y; - projectile.rotation = -((float)Math.Atan2((double)rotX, (double)rotY)) - 1.57f; + projectile.rotation = -((float)Math.Atan2(rotX, rotY)) - 1.57f; if (Main.netMode != 2) { int dustID = Dust.NewDust(projectile.position, projectile.width, projectile.height, mod.DustType("CyberDust"), projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, Color.White, 0.6f); diff --git a/Invasion/CyberWrathInvasion.cs b/Invasion/CyberWrathInvasion.cs index 635c5ce5..8cc63644 100644 --- a/Invasion/CyberWrathInvasion.cs +++ b/Invasion/CyberWrathInvasion.cs @@ -4,6 +4,7 @@ using Terraria.DataStructures; using Terraria.ModLoader; using Tremor.Invasion; + //using Terraria.Content.Fonts; namespace Tremor @@ -43,8 +44,8 @@ public override void UpdateDead() int eH = CyberWrathI.Height; int eW = CyberWrathI.Width; - int XX1 = (int)(((24 - iW1) / 2) + Main.screenWidth - sX1); - int YY1 = (int)(((24 - iH1) / 2) + sY1 + (int)(280 * 1.4) + (24 - iW1) * (-1) + 20); + int XX1 = ((24 - iW1) / 2) + Main.screenWidth - sX1; + int YY1 = ((24 - iH1) / 2) + sY1 + (int)(280 * 1.4) + (24 - iW1) * (-1) + 20; int eX = XX1 - 333; int eY = YY1 - 430 + (24 - eW) * (-1); diff --git a/Invasion/EndlessPain.cs b/Invasion/EndlessPain.cs index acd55a3c..f738be83 100644 --- a/Invasion/EndlessPain.cs +++ b/Invasion/EndlessPain.cs @@ -1,7 +1,7 @@ using Terraria; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -using Terraria.DataStructures; namespace Tremor.Invasion { diff --git a/Invasion/InvasionWorld.cs b/Invasion/InvasionWorld.cs index 857dd128..1991d4eb 100644 --- a/Invasion/InvasionWorld.cs +++ b/Invasion/InvasionWorld.cs @@ -1,9 +1,9 @@ -using System.IO; using System.Collections.Generic; +using System.IO; using Terraria; using Terraria.ModLoader; -using Terraria.World.Generation; using Terraria.ModLoader.IO; +using Terraria.World.Generation; namespace Tremor.Invasion { @@ -11,8 +11,8 @@ public class InvasionWorld : ModWorld { private const int saveVersion = 0; public static int CyberWrathPoints = 0; - public static int CyberWrathPoints1 = 0; - public static bool CyberWrath = false; + public static int CyberWrathPoints1; + public static bool CyberWrath; public override void ModifyWorldGenTasks(List tasks, ref float totalWeight) { diff --git a/Invasion/InvisibleSoul.cs b/Invasion/InvisibleSoul.cs index c7309147..90e197ee 100644 --- a/Invasion/InvisibleSoul.cs +++ b/Invasion/InvisibleSoul.cs @@ -3,7 +3,6 @@ using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.Invasion { public class InvisibleSoul : ModNPC @@ -38,12 +37,11 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) float spawn = 20f; if (InvasionWorld.CyberWrath) return 1000f; - else - return 0f; + return 0f; int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return InvasionWorld.CyberWrath && y > Main.worldSurface ? 1f : 0f; } @@ -61,7 +59,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); @@ -74,7 +72,7 @@ public override void HitEffect(int hitDirection, double damage) for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), hitDirection, -1f, 0, default(Color), 0.7f); } } @@ -82,8 +80,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(3) == 0) { @@ -94,13 +92,13 @@ public override void NPCLoot() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } float customAi1; - bool FirstState = false; - bool SecondState = false; + bool FirstState; + bool SecondState; public Vector2 tilePos = default(Vector2); public override void AI() { @@ -123,69 +121,69 @@ public override void AI() } if (FirstState) { - if (Main.player[this.npc.target].position.X > this.npc.position.X) - this.npc.spriteDirection = 1; + if (Main.player[npc.target].position.X > npc.position.X) + npc.spriteDirection = 1; else - this.npc.spriteDirection = -1; + npc.spriteDirection = -1; - if (this.npc.direction == -1 && this.npc.velocity.X > -2f) + if (npc.direction == -1 && npc.velocity.X > -2f) { - this.npc.velocity.X = this.npc.velocity.X - 0.1f; - if (this.npc.velocity.X > 2f) + npc.velocity.X = npc.velocity.X - 0.1f; + if (npc.velocity.X > 2f) { - this.npc.velocity.X = this.npc.velocity.X - 0.1f; + npc.velocity.X = npc.velocity.X - 0.1f; } else { - if (this.npc.velocity.X > 0f) + if (npc.velocity.X > 0f) { - this.npc.velocity.X = this.npc.velocity.X + 0.05f; + npc.velocity.X = npc.velocity.X + 0.05f; } } - if (this.npc.velocity.X < -2f) + if (npc.velocity.X < -2f) { - this.npc.velocity.X = -2f; + npc.velocity.X = -2f; } } else { - if (this.npc.direction == 1 && this.npc.velocity.X < 2f) + if (npc.direction == 1 && npc.velocity.X < 2f) { - this.npc.velocity.X = this.npc.velocity.X + 0.1f; - if (this.npc.velocity.X < -2f) + npc.velocity.X = npc.velocity.X + 0.1f; + if (npc.velocity.X < -2f) { - this.npc.velocity.X = this.npc.velocity.X + 0.1f; + npc.velocity.X = npc.velocity.X + 0.1f; } else { - if (this.npc.velocity.X < 0f) + if (npc.velocity.X < 0f) { - this.npc.velocity.X = this.npc.velocity.X - 0.05f; + npc.velocity.X = npc.velocity.X - 0.05f; } } - if (this.npc.velocity.X > 2f) + if (npc.velocity.X > 2f) { - this.npc.velocity.X = 2f; + npc.velocity.X = 2f; } } } - if (this.npc.directionY == -1 && (double)this.npc.velocity.Y > -1.5) + if (npc.directionY == -1 && npc.velocity.Y > -1.5) { - this.npc.velocity.Y = this.npc.velocity.Y - 0.05f; + npc.velocity.Y = npc.velocity.Y - 0.05f; - if ((double)this.npc.velocity.Y < -1.5) + if (npc.velocity.Y < -1.5) { - this.npc.velocity.Y = -1.5f; + npc.velocity.Y = -1.5f; } } else { - if (this.npc.directionY == 1 && (double)this.npc.velocity.Y < 1.5) + if (npc.directionY == 1 && npc.velocity.Y < 1.5) { - this.npc.velocity.Y = this.npc.velocity.Y + 0.05f; - if ((double)this.npc.velocity.Y > 1.5) + npc.velocity.Y = npc.velocity.Y + 0.05f; + if (npc.velocity.Y > 1.5) { - this.npc.velocity.Y = 1.5f; + npc.velocity.Y = 1.5f; } } } @@ -198,69 +196,69 @@ public override void AI() if (SecondState && !FirstState) { - if (Main.player[this.npc.target].position.X > this.npc.position.X) - this.npc.spriteDirection = 1; + if (Main.player[npc.target].position.X > npc.position.X) + npc.spriteDirection = 1; else - this.npc.spriteDirection = -1; + npc.spriteDirection = -1; - if (this.npc.direction == -1 && this.npc.velocity.X > -2f) + if (npc.direction == -1 && npc.velocity.X > -2f) { - this.npc.velocity.X = this.npc.velocity.X - 0.1f; - if (this.npc.velocity.X > 2f) + npc.velocity.X = npc.velocity.X - 0.1f; + if (npc.velocity.X > 2f) { - this.npc.velocity.X = this.npc.velocity.X - 0.1f; + npc.velocity.X = npc.velocity.X - 0.1f; } else { - if (this.npc.velocity.X > 0f) + if (npc.velocity.X > 0f) { - this.npc.velocity.X = this.npc.velocity.X + 0.05f; + npc.velocity.X = npc.velocity.X + 0.05f; } } - if (this.npc.velocity.X < -2f) + if (npc.velocity.X < -2f) { - this.npc.velocity.X = -2f; + npc.velocity.X = -2f; } } else { - if (this.npc.direction == 1 && this.npc.velocity.X < 2f) + if (npc.direction == 1 && npc.velocity.X < 2f) { - this.npc.velocity.X = this.npc.velocity.X + 0.1f; - if (this.npc.velocity.X < -2f) + npc.velocity.X = npc.velocity.X + 0.1f; + if (npc.velocity.X < -2f) { - this.npc.velocity.X = this.npc.velocity.X + 0.1f; + npc.velocity.X = npc.velocity.X + 0.1f; } else { - if (this.npc.velocity.X < 0f) + if (npc.velocity.X < 0f) { - this.npc.velocity.X = this.npc.velocity.X - 0.05f; + npc.velocity.X = npc.velocity.X - 0.05f; } } - if (this.npc.velocity.X > 2f) + if (npc.velocity.X > 2f) { - this.npc.velocity.X = 2f; + npc.velocity.X = 2f; } } } - if (this.npc.directionY == -1 && (double)this.npc.velocity.Y > -1.5) + if (npc.directionY == -1 && npc.velocity.Y > -1.5) { - this.npc.velocity.Y = this.npc.velocity.Y - 0.05f; + npc.velocity.Y = npc.velocity.Y - 0.05f; - if ((double)this.npc.velocity.Y < -1.5) + if (npc.velocity.Y < -1.5) { - this.npc.velocity.Y = -1.5f; + npc.velocity.Y = -1.5f; } } else { - if (this.npc.directionY == 1 && (double)this.npc.velocity.Y < 1.5) + if (npc.directionY == 1 && npc.velocity.Y < 1.5) { - this.npc.velocity.Y = this.npc.velocity.Y + 0.05f; - if ((double)this.npc.velocity.Y > 1.5) + npc.velocity.Y = npc.velocity.Y + 0.05f; + if (npc.velocity.Y > 1.5) { - this.npc.velocity.Y = 1.5f; + npc.velocity.Y = 1.5f; } } } diff --git a/Invasion/MiniSoul.cs b/Invasion/MiniSoul.cs index 75f72f7f..91a918f0 100644 --- a/Invasion/MiniSoul.cs +++ b/Invasion/MiniSoul.cs @@ -3,6 +3,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; + namespace Tremor.Invasion { public class MiniSoul : ModNPC @@ -13,7 +14,7 @@ public override void SetStaticDefaults() Main.npcFrameCount[npc.type] = 3; } - int num = 0; + int num; public readonly IList targets = new List(); public static readonly int arenaWidth = (int)(1.3f * NPC.sWidth); public static readonly int arenaHeight = (int)(1.3f * NPC.sHeight); @@ -57,7 +58,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); @@ -70,7 +71,7 @@ public override void HitEffect(int hitDirection, double damage) for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), hitDirection, -1f, 0, default(Color), 0.7f); } } } diff --git a/Invasion/ParadoxBat.cs b/Invasion/ParadoxBat.cs index a2e90942..4cb65004 100644 --- a/Invasion/ParadoxBat.cs +++ b/Invasion/ParadoxBat.cs @@ -4,7 +4,6 @@ using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.Invasion { public class ParadoxBat : ModNPC @@ -39,12 +38,11 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) float spawn = 20f; if (InvasionWorld.CyberWrath) return 1000f; - else - return 0f; + return 0f; int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return InvasionWorld.CyberWrath && y > Main.worldSurface ? 1f : 0f; } @@ -54,7 +52,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); @@ -67,7 +65,7 @@ public override void HitEffect(int hitDirection, double damage) for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), hitDirection, -1f, 0, default(Color), 0.7f); } } @@ -96,16 +94,16 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(3) == 0) { @@ -119,8 +117,8 @@ public override void NPCLoot() } float customAi1; - bool FirstState = false; - bool SecondState = false; + bool FirstState; + bool SecondState; public override void AI() { //PlayAnimation(); @@ -139,7 +137,7 @@ public override void AI() { for (int num36 = 0; num36 < 25; num36++) { - int dust = Dust.NewDust(new Vector2((float)npc.position.X, (float)npc.position.Y), npc.width, npc.height, mod.DustType("CyberDust"), npc.velocity.X + Main.rand.Next(-10, 10), npc.velocity.Y + Main.rand.Next(-10, 10), 1, npc.color, 1f); + int dust = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("CyberDust"), npc.velocity.X + Main.rand.Next(-10, 10), npc.velocity.Y + Main.rand.Next(-10, 10), 1, npc.color, 1f); Main.dust[dust].noGravity = true; } @@ -242,13 +240,13 @@ public override void AI() if (npc.life > 500) { Color color = new Color(); - int dust = Dust.NewDust(new Vector2((float)npc.position.X, (float)npc.position.Y), npc.width, npc.height, mod.DustType("CyberDust"), npc.velocity.X, npc.velocity.Y, 100, color, 0.6f); + int dust = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("CyberDust"), npc.velocity.X, npc.velocity.Y, 100, color, 0.6f); Main.dust[dust].noGravity = true; } else if (npc.life <= 200) { Color color = new Color(); - int dust = Dust.NewDust(new Vector2((float)npc.position.X, (float)npc.position.Y), npc.width, npc.height, mod.DustType("CyberDust"), npc.velocity.X, npc.velocity.Y, 50, color, 0.8f); + int dust = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("CyberDust"), npc.velocity.X, npc.velocity.Y, 50, color, 0.8f); Main.dust[dust].noGravity = true; } } @@ -266,24 +264,24 @@ public override void AI() Main.projectile[SpitShot1].timeLeft = 500; customAi1 = 1f; } - float npc_to_target_x = npc.position.X + (float)(npc.width / 2) - Main.player[npc.target].position.X - (float)(Main.player[npc.target].width / 2); - float npc_to_target_y = npc.position.Y + (float)npc.height - 59f - Main.player[npc.target].position.Y - (float)(Main.player[npc.target].height / 2); // 59(3.7 blocks) above bottom(slightly above center; ht is 110) to target center - float npc_to_target_angle = (float)Math.Atan2((double)npc_to_target_y, (double)npc_to_target_x) + 1.57f; // angle+pi/2 + float npc_to_target_x = npc.position.X + npc.width / 2 - Main.player[npc.target].position.X - Main.player[npc.target].width / 2; + float npc_to_target_y = npc.position.Y + npc.height - 59f - Main.player[npc.target].position.Y - Main.player[npc.target].height / 2; // 59(3.7 blocks) above bottom(slightly above center; ht is 110) to target center + float npc_to_target_angle = (float)Math.Atan2(npc_to_target_y, npc_to_target_x) + 1.57f; // angle+pi/2 if (npc_to_target_angle < 0f) // modulus npc_to_target_angle += 6.283f; - else if ((double)npc_to_target_angle > 6.283) + else if (npc_to_target_angle > 6.283) npc_to_target_angle -= 6.283f; float rotation_rate = 0.15f; float top_speed = 4f; float accel = 0.1f; int close_side_of_target = 1; - if (npc.position.X + (float)(npc.width / 2) < Main.player[npc.target].position.X + (float)Main.player[npc.target].width) + if (npc.position.X + npc.width / 2 < Main.player[npc.target].position.X + Main.player[npc.target].width) close_side_of_target = -1; - Vector2 npc_pos = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - npc_to_target_x = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) + (float)(close_side_of_target * 360) - npc_pos.X; - npc_to_target_y = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) + (float)(close_side_of_target * 160) - npc_pos.Y; - float dist_to_target = (float)Math.Sqrt((double)(npc_to_target_x * npc_to_target_x + npc_to_target_y * npc_to_target_y)); + Vector2 npc_pos = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + npc_to_target_x = Main.player[npc.target].position.X + Main.player[npc.target].width / 2 + close_side_of_target * 360 - npc_pos.X; + npc_to_target_y = Main.player[npc.target].position.Y + Main.player[npc.target].height / 2 + close_side_of_target * 160 - npc_pos.Y; + float dist_to_target = (float)Math.Sqrt(npc_to_target_x * npc_to_target_x + npc_to_target_y * npc_to_target_y); dist_to_target = top_speed / dist_to_target; npc_to_target_x *= dist_to_target; npc_to_target_y *= dist_to_target; @@ -320,7 +318,6 @@ public override void AI() if (npc.timeLeft > 10) { npc.timeLeft = 10; - return; } } else @@ -330,13 +327,13 @@ public override void AI() top_speed = 4f; accel = 0.1f; close_side_of_target = 1; - if (npc.position.X + (float)(npc.width / 2) < Main.player[npc.target].position.X + (float)Main.player[npc.target].width) + if (npc.position.X + npc.width / 2 < Main.player[npc.target].position.X + Main.player[npc.target].width) close_side_of_target = -1; - npc_pos = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - npc_to_target_x = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) + (float)(close_side_of_target * 360) - npc_pos.X; //360 pix in front of target - npc_to_target_y = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) + (float)(close_side_of_target * 160) - npc_pos.Y; //160 pix above target - dist_to_target = (float)Math.Sqrt((double)(npc_to_target_x * npc_to_target_x + npc_to_target_y * npc_to_target_y)); + npc_pos = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + npc_to_target_x = Main.player[npc.target].position.X + Main.player[npc.target].width / 2 + close_side_of_target * 360 - npc_pos.X; //360 pix in front of target + npc_to_target_y = Main.player[npc.target].position.Y + Main.player[npc.target].height / 2 + close_side_of_target * 160 - npc_pos.Y; //160 pix above target + dist_to_target = (float)Math.Sqrt(npc_to_target_x * npc_to_target_x + npc_to_target_y * npc_to_target_y); dist_to_target = top_speed / dist_to_target; npc_to_target_x *= dist_to_target; npc_to_target_y *= dist_to_target; @@ -387,10 +384,10 @@ public override void AI() npc.localAI[1] = 10f; float projectile_velocity = 15f; int projectile_dmg = 75; - npc_pos = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - npc_to_target_x = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - npc_pos.X; - npc_to_target_y = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - npc_pos.Y; - dist_to_target = (float)Math.Sqrt((double)(npc_to_target_x * npc_to_target_x + npc_to_target_y * npc_to_target_y)); + npc_pos = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + npc_to_target_x = Main.player[npc.target].position.X + Main.player[npc.target].width / 2 - npc_pos.X; + npc_to_target_y = Main.player[npc.target].position.Y + Main.player[npc.target].height / 2 - npc_pos.Y; + dist_to_target = (float)Math.Sqrt(npc_to_target_x * npc_to_target_x + npc_to_target_y * npc_to_target_y); dist_to_target = projectile_velocity / dist_to_target; // prep to normalize by velocity npc_to_target_x *= dist_to_target; // normalize by velocity npc_to_target_y *= dist_to_target; // normalize by velocity @@ -399,7 +396,6 @@ public override void AI() npc_pos.X -= npc_to_target_x * 1f; npc_pos.Y -= npc_to_target_y * 1f; //Projectile.NewProjectile(npc_pos.X, npc_pos.Y, npc_to_target_x, npc_to_target_y, ProjDef.byName["Pumpking:TerraGuardLaser"].type, projectile_dmg, 0f, Main.myPlayer); - return; } } } @@ -408,15 +404,14 @@ public override void AI() { npc.rotation = npc_to_target_angle; float speed = 14f; - npc_pos = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - npc_to_target_x = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - npc_pos.X; - npc_to_target_y = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - npc_pos.Y; - dist_to_target = (float)Math.Sqrt((double)(npc_to_target_x * npc_to_target_x + npc_to_target_y * npc_to_target_y)); + npc_pos = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + npc_to_target_x = Main.player[npc.target].position.X + Main.player[npc.target].width / 2 - npc_pos.X; + npc_to_target_y = Main.player[npc.target].position.Y + Main.player[npc.target].height / 2 - npc_pos.Y; + dist_to_target = (float)Math.Sqrt(npc_to_target_x * npc_to_target_x + npc_to_target_y * npc_to_target_y); dist_to_target = speed / dist_to_target; npc.velocity.X = npc_to_target_x * dist_to_target; npc.velocity.Y = npc_to_target_y * dist_to_target; npc.ai[1] = 2f; - return; } else if (npc.ai[1] == 2f) { @@ -425,13 +420,13 @@ public override void AI() { npc.velocity.X = npc.velocity.X * 0.93f; npc.velocity.Y = npc.velocity.Y * 0.93f; - if ((double)npc.velocity.X > -0.1 && (double)npc.velocity.X < 0.1) + if (npc.velocity.X > -0.1 && npc.velocity.X < 0.1) npc.velocity.X = 0f; - if ((double)npc.velocity.Y > -0.1 && (double)npc.velocity.Y < 0.1) + if (npc.velocity.Y > -0.1 && npc.velocity.Y < 0.1) npc.velocity.Y = 0f; } else - npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X) - 1.57f; + npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X) - 1.57f; if (npc.ai[2] >= 80f) { @@ -446,7 +441,6 @@ public override void AI() return; } npc.ai[1] = 1f; - return; } } } diff --git a/Invasion/ParadoxCohortMusicBoxTile.cs b/Invasion/ParadoxCohortMusicBoxTile.cs index 23c17ddc..603c0b5a 100644 --- a/Invasion/ParadoxCohortMusicBoxTile.cs +++ b/Invasion/ParadoxCohortMusicBoxTile.cs @@ -1,8 +1,8 @@ using Microsoft.Xna.Framework; using Terraria; +using Terraria.DataStructures; using Terraria.ModLoader; using Terraria.ObjectData; -using Terraria.DataStructures; namespace Tremor.Invasion { diff --git a/Invasion/ParadoxElement.cs b/Invasion/ParadoxElement.cs index ae238140..62efa6b7 100644 --- a/Invasion/ParadoxElement.cs +++ b/Invasion/ParadoxElement.cs @@ -1,6 +1,5 @@ using Terraria.ModLoader; - namespace Tremor.Invasion { public class ParadoxElement : ModItem diff --git a/Invasion/ParadoxSun.cs b/Invasion/ParadoxSun.cs index 0905c81d..8fe9c055 100644 --- a/Invasion/ParadoxSun.cs +++ b/Invasion/ParadoxSun.cs @@ -4,7 +4,6 @@ using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.Invasion { public class ParadoxSun : ModNPC @@ -38,12 +37,11 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) float spawn = 20f; if (InvasionWorld.CyberWrath) return 10000f; - else - return 0f; + return 0f; int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return InvasionWorld.CyberWrath && y > Main.worldSurface ? 1f : 0f; } @@ -53,7 +51,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); @@ -66,14 +64,14 @@ public override void HitEffect(int hitDirection, double damage) for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), hitDirection, -1f, 0, default(Color), 0.7f); } } public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void OnHitPlayer(Player player, int damage, bool crit) @@ -103,18 +101,18 @@ public override void AI() { flag2 = true; } - if (npc.position.X == npc.oldPosition.X || npc.ai[3] >= (float)num5 || flag2) + if (npc.position.X == npc.oldPosition.X || npc.ai[3] >= num5 || flag2) { npc.ai[3] += 1f; } else { - if ((double)Math.Abs(npc.velocity.X) > 0.9 && npc.ai[3] > 0f) + if (Math.Abs(npc.velocity.X) > 0.9 && npc.ai[3] > 0f) { npc.ai[3] -= 1f; } } - if (npc.ai[3] > (float)(num5 * 10)) + if (npc.ai[3] > num5 * 10) { npc.ai[3] = 0f; } @@ -122,12 +120,12 @@ public override void AI() { npc.ai[3] = 0f; } - if (npc.ai[3] == (float)num5) + if (npc.ai[3] == num5) { npc.netUpdate = true; } - if (npc.ai[3] < (float)num5) + if (npc.ai[3] < num5) { npc.TargetClosest(true); } @@ -189,16 +187,16 @@ public override void AI() bool flag4 = false; if (npc.velocity.Y == 0f) { - int num29 = (int)(npc.position.Y + (float)npc.height + 8f) / 16; + int num29 = (int)(npc.position.Y + npc.height + 8f) / 16; int num30 = (int)npc.position.X / 16; - int num31 = (int)(npc.position.X + (float)npc.width) / 16; + int num31 = (int)(npc.position.X + npc.width) / 16; for (int l = num30; l <= num31; l++) { if (Main.tile[l, num29] == null) { return; } - if (Main.tile[l, num29].active() && Main.tileSolid[(int)Main.tile[l, num29].type]) + if (Main.tile[l, num29].active() && Main.tileSolid[Main.tile[l, num29].type]) { flag4 = true; break; @@ -208,8 +206,8 @@ public override void AI() if (flag4) { - int num32 = (int)((npc.position.X + (float)(npc.width / 2) + (float)((npc.width / 2 + 6) * npc.direction)) / 16f); - int num33 = (int)((npc.position.Y + (float)npc.height - 15f) / 16f); + int num32 = (int)((npc.position.X + npc.width / 2 + (npc.width / 2 + 6) * npc.direction) / 16f); + int num33 = (int)((npc.position.Y + npc.height - 15f) / 16f); if (Main.tile[num32, num33] == null) { Main.tile[num32, num33] = new Tile(); @@ -245,7 +243,7 @@ public override void AI() npc.ai[3] = 0f; if (npc.ai[2] >= 60f) { - npc.velocity.X = 0.5f * (float)(-(float)npc.direction); + npc.velocity.X = 0.5f * -(float)npc.direction; npc.ai[1] += 1f; npc.ai[2] = 0f; bool flag5 = false; @@ -260,7 +258,7 @@ public override void AI() bool flag6 = WorldGen.OpenDoor(num32, num33, npc.direction); if (!flag6) { - npc.ai[3] = (float)num5; + npc.ai[3] = num5; npc.netUpdate = true; } //if (Main.netMode == 2 && flag6) @@ -273,9 +271,9 @@ public override void AI() if ((npc.velocity.X < 0f && npc.spriteDirection == -1) || (npc.velocity.X > 0f && npc.spriteDirection == 1)) { - if (Main.tile[num32, num33 - 2].active() && Main.tileSolid[(int)Main.tile[num32, num33 - 2].type]) + if (Main.tile[num32, num33 - 2].active() && Main.tileSolid[Main.tile[num32, num33 - 2].type]) { - if ((Main.tile[num32, num33 - 3].active() && Main.tileSolid[(int)Main.tile[num32, num33 - 3].type])) + if ((Main.tile[num32, num33 - 3].active() && Main.tileSolid[Main.tile[num32, num33 - 3].type])) { npc.velocity.Y = -8f; npc.netUpdate = true; @@ -288,21 +286,21 @@ public override void AI() } else { - if (Main.tile[num32, num33 - 1].active() && Main.tileSolid[(int)Main.tile[num32, num33 - 1].type]) + if (Main.tile[num32, num33 - 1].active() && Main.tileSolid[Main.tile[num32, num33 - 1].type]) { npc.velocity.Y = -6f; npc.netUpdate = true; } else { - if (Main.tile[num32, num33].active() && Main.tileSolid[(int)Main.tile[num32, num33].type]) + if (Main.tile[num32, num33].active() && Main.tileSolid[Main.tile[num32, num33].type]) { npc.velocity.Y = -5f; npc.netUpdate = true; } else { - if (npc.directionY < 0 && (!Main.tile[num32, num33 + 1].active() || !Main.tileSolid[(int)Main.tile[num32, num33 + 1].type]) && (!Main.tile[num32 + npc.direction, num33 + 1].active() || !Main.tileSolid[(int)Main.tile[num32 + npc.direction, num33 + 1].type])) + if (npc.directionY < 0 && (!Main.tile[num32, num33 + 1].active() || !Main.tileSolid[Main.tile[num32, num33 + 1].type]) && (!Main.tile[num32 + npc.direction, num33 + 1].active() || !Main.tileSolid[Main.tile[num32 + npc.direction, num33 + 1].type])) { npc.velocity.Y = -8f; npc.velocity.X = npc.velocity.X * 1.5f; diff --git a/Invasion/Relayx.cs b/Invasion/Relayx.cs index ba86046c..4befa04d 100644 --- a/Invasion/Relayx.cs +++ b/Invasion/Relayx.cs @@ -1,3 +1,4 @@ +using System.Collections.Generic; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -65,7 +66,7 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX return false; } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) + public override void ModifyTooltips(List tooltips) { TooltipLine tip = new TooltipLine(mod, "Tremor:Tooltip", "-Donator Items-"); tip.overrideColor = new Color(119, 200, 203); diff --git a/Invasion/RelayxDragon.cs b/Invasion/RelayxDragon.cs index 295cf5ef..d1748103 100644 --- a/Invasion/RelayxDragon.cs +++ b/Invasion/RelayxDragon.cs @@ -1,8 +1,8 @@ using System; -using Terraria.ModLoader; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.ModLoader; namespace Tremor.Invasion { @@ -41,9 +41,9 @@ public override void AI() { if (Main.npc[MobCounts].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[MobCounts].Center, 1, 1)) { - float Position1 = Main.npc[MobCounts].position.X + (float)(Main.npc[MobCounts].width / 2); - float Position2 = Main.npc[MobCounts].position.Y + (float)(Main.npc[MobCounts].height / 2); - float Position3 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - Position1) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - Position2); + float Position1 = Main.npc[MobCounts].position.X + Main.npc[MobCounts].width / 2; + float Position2 = Main.npc[MobCounts].position.Y + Main.npc[MobCounts].height / 2; + float Position3 = Math.Abs(projectile.position.X + projectile.width / 2 - Position1) + Math.Abs(projectile.position.Y + projectile.height / 2 - Position2); if (Position3 < Distanse) { Distanse = Position3; @@ -56,16 +56,15 @@ public override void AI() if (CheckDistanse) { float Speed = 8f; - Vector2 FinalPos = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + Vector2 FinalPos = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); float NewPosX = CenterX - FinalPos.X; float NewPosY = CenterY - FinalPos.Y; - float FinPos = (float)Math.Sqrt((double)(NewPosX * NewPosX + NewPosY * NewPosY)); + float FinPos = (float)Math.Sqrt(NewPosX * NewPosX + NewPosY * NewPosY); FinPos = Speed / FinPos; NewPosX *= FinPos; NewPosY *= FinPos; projectile.velocity.X = (projectile.velocity.X * 20f + NewPosX) / 21f; projectile.velocity.Y = (projectile.velocity.Y * 20f + NewPosY) / 21f; - return; } } diff --git a/Invasion/RelayxDragonBig.cs b/Invasion/RelayxDragonBig.cs index 3d8bbccd..a02e7846 100644 --- a/Invasion/RelayxDragonBig.cs +++ b/Invasion/RelayxDragonBig.cs @@ -1,8 +1,8 @@ using System; -using Terraria.ModLoader; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.ModLoader; namespace Tremor.Invasion { @@ -58,9 +58,9 @@ public override void AI() { if (Main.npc[MobCounts].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[MobCounts].Center, 1, 1)) { - float Position1 = Main.npc[MobCounts].position.X + (float)(Main.npc[MobCounts].width / 2); - float Position2 = Main.npc[MobCounts].position.Y + (float)(Main.npc[MobCounts].height / 2); - float Position3 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - Position1) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - Position2); + float Position1 = Main.npc[MobCounts].position.X + Main.npc[MobCounts].width / 2; + float Position2 = Main.npc[MobCounts].position.Y + Main.npc[MobCounts].height / 2; + float Position3 = Math.Abs(projectile.position.X + projectile.width / 2 - Position1) + Math.Abs(projectile.position.Y + projectile.height / 2 - Position2); if (Position3 < Distanse) { Distanse = Position3; @@ -73,16 +73,15 @@ public override void AI() if (CheckDistanse) { float Speed = 8f; - Vector2 FinalPos = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + Vector2 FinalPos = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); float NewPosX = CenterX - FinalPos.X; float NewPosY = CenterY - FinalPos.Y; - float FinPos = (float)Math.Sqrt((double)(NewPosX * NewPosX + NewPosY * NewPosY)); + float FinPos = (float)Math.Sqrt(NewPosX * NewPosX + NewPosY * NewPosY); FinPos = Speed / FinPos; NewPosX *= FinPos; NewPosY *= FinPos; projectile.velocity.X = (projectile.velocity.X * 20f + NewPosX) / 21f; projectile.velocity.Y = (projectile.velocity.Y * 20f + NewPosY) / 21f; - return; } } diff --git a/Invasion/RelayxProj.cs b/Invasion/RelayxProj.cs index 6bf99510..1311e2f0 100644 --- a/Invasion/RelayxProj.cs +++ b/Invasion/RelayxProj.cs @@ -39,9 +39,9 @@ public override void AI() { if (Main.npc[MobCounts].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[MobCounts].Center, 1, 1)) { - float Position1 = Main.npc[MobCounts].position.X + (float)(Main.npc[MobCounts].width / 2); - float Position2 = Main.npc[MobCounts].position.Y + (float)(Main.npc[MobCounts].height / 2); - float Position3 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - Position1) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - Position2); + float Position1 = Main.npc[MobCounts].position.X + Main.npc[MobCounts].width / 2; + float Position2 = Main.npc[MobCounts].position.Y + Main.npc[MobCounts].height / 2; + float Position3 = Math.Abs(projectile.position.X + projectile.width / 2 - Position1) + Math.Abs(projectile.position.Y + projectile.height / 2 - Position2); if (Position3 < Distanse) { Distanse = Position3; @@ -54,16 +54,15 @@ public override void AI() if (CheckDistanse) { float Speed = 8f; - Vector2 FinalPos = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + Vector2 FinalPos = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); float NewPosX = CenterX - FinalPos.X; float NewPosY = CenterY - FinalPos.Y; - float FinPos = (float)Math.Sqrt((double)(NewPosX * NewPosX + NewPosY * NewPosY)); + float FinPos = (float)Math.Sqrt(NewPosX * NewPosX + NewPosY * NewPosY); FinPos = Speed / FinPos; NewPosX *= FinPos; NewPosY *= FinPos; projectile.velocity.X = (projectile.velocity.X * 20f + NewPosX) / 21f; projectile.velocity.Y = (projectile.velocity.Y * 20f + NewPosY) / 21f; - return; } } diff --git a/Invasion/StrayStaff.cs b/Invasion/StrayStaff.cs index 0606c4f8..8da87f34 100644 --- a/Invasion/StrayStaff.cs +++ b/Invasion/StrayStaff.cs @@ -1,7 +1,7 @@ using Microsoft.Xna.Framework; using Terraria; -using Terraria.ModLoader; using Terraria.ID; +using Terraria.ModLoader; namespace Tremor.Invasion { diff --git a/Invasion/Titan.cs b/Invasion/Titan.cs index 66d7407e..7ed01dbf 100644 --- a/Invasion/Titan.cs +++ b/Invasion/Titan.cs @@ -4,6 +4,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; + namespace Tremor.Invasion { [AutoloadBossHead] @@ -61,7 +62,7 @@ public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) //spriteBatch.Draw(mod.GetTexture("Invasion/Titan"), new Vector2(npc.Center.X, npc.Center.Y), null, Color.White, 0.0f, new Vector2(-10, -25), 1f, SpriteEffects.None, 1); } - int CurrentFrame = 0; + int CurrentFrame; int TimeToAnimation = 6; const int AnimationRate = 6; bool FirstState_ = true; @@ -164,7 +165,7 @@ public override void AI() for (int num36 = 0; num36 < 10; num36++) { Color color = new Color(); - int dust = Dust.NewDust(new Vector2((float)npc.position.X, (float)npc.position.Y), npc.width, npc.height, mod.DustType("CyberDust"), npc.velocity.X + Main.rand.Next(-10, 10), npc.velocity.Y + Main.rand.Next(-10, 10), 200, color, 1f); + int dust = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("CyberDust"), npc.velocity.X + Main.rand.Next(-10, 10), npc.velocity.Y + Main.rand.Next(-10, 10), 200, color, 1f); Main.dust[dust].noGravity = true; } npc.ai[3] = (float)(Main.rand.Next(360) * (Math.PI / 180)); @@ -192,7 +193,7 @@ public override void AI() for (int num36 = 0; num36 < 10; num36++) { Color color = new Color(); - int dust = Dust.NewDust(new Vector2((float)npc.position.X, (float)npc.position.Y), npc.width, npc.height, mod.DustType("CyberDust"), npc.velocity.X + Main.rand.Next(-10, 10), npc.velocity.Y + Main.rand.Next(-10, 10), 200, color, 1f); + int dust = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, mod.DustType("CyberDust"), npc.velocity.X + Main.rand.Next(-10, 10), npc.velocity.Y + Main.rand.Next(-10, 10), 200, color, 1f); Main.dust[dust].noGravity = true; } npc.ai[3] = (float)(Main.rand.Next(360) * (Math.PI / 180)); @@ -289,7 +290,6 @@ public override void AI() npc.velocity.X = (float)(Math.Cos(rotation) * 28) * -1; npc.velocity.Y = (float)(Math.Sin(rotation) * 28) * -1; } - return; } } @@ -297,8 +297,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.expertMode) diff --git a/Invasion/TitanCrystal_.cs b/Invasion/TitanCrystal_.cs index fa5f994d..0d5c4855 100644 --- a/Invasion/TitanCrystal_.cs +++ b/Invasion/TitanCrystal_.cs @@ -9,7 +9,7 @@ namespace Tremor.Invasion { public class TitanCrystal_ : ModProjectile { - private int timer = 0; + private int timer; public override void SetStaticDefaults() { diff --git a/Invasion/Titan_.cs b/Invasion/Titan_.cs index 320ff944..69ac9c08 100644 --- a/Invasion/Titan_.cs +++ b/Invasion/Titan_.cs @@ -31,7 +31,7 @@ public override void SetDefaults() npc.noTileCollide = true; } - int CurrentFrame = 0; + int CurrentFrame; int TimeToAnimation = 6; const int AnimationRate = 6; bool FirstState_ = true; diff --git a/Invasion/Violeum.cs b/Invasion/Violeum.cs index 07d77c62..a82270fb 100644 --- a/Invasion/Violeum.cs +++ b/Invasion/Violeum.cs @@ -4,7 +4,6 @@ using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.Invasion { public class Violeum : ModNPC @@ -39,8 +38,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.expertMode) @@ -66,7 +65,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return InvasionWorld.CyberWrath && y > Main.worldSurface ? 0.5f : 0f; } @@ -76,7 +75,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); @@ -89,14 +88,14 @@ public override void HitEffect(int hitDirection, double damage) for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), hitDirection, -1f, 0, default(Color), 0.7f); } } public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } const string Boss_Left_Hand_Type = "Violeum_LeftArm"; @@ -157,8 +156,8 @@ public override void ModifyHitNPC(NPC target, ref int damage, ref float knockbac } float customAi1; - bool FirstState = false; - bool SecondState = false; + bool FirstState; + bool SecondState; public override void AI() { if (npc.life > npc.lifeMax / 2) @@ -215,75 +214,75 @@ public override void AI() } int num60; - this.npc.TargetClosest(true); + npc.TargetClosest(true); - if (Main.player[this.npc.target].position.Y - 150 > this.npc.position.Y) + if (Main.player[npc.target].position.Y - 150 > npc.position.Y) { - this.npc.directionY = 1; + npc.directionY = 1; } else { - this.npc.directionY = -1; + npc.directionY = -1; } - if (this.npc.direction == -1 && this.npc.velocity.X > -2f) + if (npc.direction == -1 && npc.velocity.X > -2f) { - this.npc.velocity.X = this.npc.velocity.X - 0.4f; - if (this.npc.velocity.X > 2f) + npc.velocity.X = npc.velocity.X - 0.4f; + if (npc.velocity.X > 2f) { - this.npc.velocity.X = this.npc.velocity.X - 0.4f; + npc.velocity.X = npc.velocity.X - 0.4f; } else { - if (this.npc.velocity.X > 0f) + if (npc.velocity.X > 0f) { - this.npc.velocity.X = this.npc.velocity.X + 0.08f; + npc.velocity.X = npc.velocity.X + 0.08f; } } - if (this.npc.velocity.X < -2f) + if (npc.velocity.X < -2f) { - this.npc.velocity.X = -2f; + npc.velocity.X = -2f; } } else { - if (this.npc.direction == 1 && this.npc.velocity.X < 4f) + if (npc.direction == 1 && npc.velocity.X < 4f) { - this.npc.velocity.X = this.npc.velocity.X + 0.1f; - if (this.npc.velocity.X < -2f) + npc.velocity.X = npc.velocity.X + 0.1f; + if (npc.velocity.X < -2f) { - this.npc.velocity.X = this.npc.velocity.X + 0.1f; + npc.velocity.X = npc.velocity.X + 0.1f; } else { - if (this.npc.velocity.X < 0f) + if (npc.velocity.X < 0f) { - this.npc.velocity.X = this.npc.velocity.X - 0.08f; + npc.velocity.X = npc.velocity.X - 0.08f; } } - if (this.npc.velocity.X > 2f) + if (npc.velocity.X > 2f) { - this.npc.velocity.X = 2f; + npc.velocity.X = 2f; } } } - if (this.npc.directionY == -1 && (double)this.npc.velocity.Y > -1.5) + if (npc.directionY == -1 && npc.velocity.Y > -1.5) { - this.npc.velocity.Y = this.npc.velocity.Y - 0.08f; + npc.velocity.Y = npc.velocity.Y - 0.08f; - if ((double)this.npc.velocity.Y < -1.5) + if (npc.velocity.Y < -1.5) { - this.npc.velocity.Y = -1.5f; + npc.velocity.Y = -1.5f; } } else { - if (this.npc.directionY == 1 && (double)this.npc.velocity.Y < 1.5) + if (npc.directionY == 1 && npc.velocity.Y < 1.5) { - this.npc.velocity.Y = this.npc.velocity.Y + 0.08f; - if ((double)this.npc.velocity.Y > 1.5) + npc.velocity.Y = npc.velocity.Y + 0.08f; + if (npc.velocity.Y > 1.5) { - this.npc.velocity.Y = 1.5f; + npc.velocity.Y = 1.5f; } } } @@ -300,13 +299,13 @@ public override void AI() if ((int)Main.time % 40 < 1) for (int i = 0; i < 3; i++) { - j += (float)2; + j += 2; m = (float)Math.Sin(j) * 25f; n = (float)Math.Cos(j) * 25f; Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 8); int damage = 70, type = mod.ProjectileType("CyberLaserBat"); - int num56 = Projectile.NewProjectile(this.npc.position.X + 20, this.npc.position.Y + 50, m, n, type, damage, 0f, Main.myPlayer); + int num56 = Projectile.NewProjectile(npc.position.X + 20, npc.position.Y + 50, m, n, type, damage, 0f, Main.myPlayer); Main.projectile[num56].timeLeft = 600; } } diff --git a/InvasionSky.cs b/InvasionSky.cs index 2a45a966..a840870d 100644 --- a/InvasionSky.cs +++ b/InvasionSky.cs @@ -9,8 +9,8 @@ namespace Tremor { public class InvasionSky : CustomSky { - private bool isActive = false; - private float intensity = 0f; + private bool isActive; + private float intensity; private int invasionI; public override void Update(GameTime gameTime) diff --git a/Items/AbyssBreastplate.cs b/Items/AbyssBreastplate.cs index 24af1e39..ac4625ad 100644 --- a/Items/AbyssBreastplate.cs +++ b/Items/AbyssBreastplate.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/AbyssGreaves.cs b/Items/AbyssGreaves.cs index d24b635d..64f556fe 100644 --- a/Items/AbyssGreaves.cs +++ b/Items/AbyssGreaves.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/AbyssHeadgear.cs b/Items/AbyssHeadgear.cs index 0e84f82d..5b4d164b 100644 --- a/Items/AbyssHeadgear.cs +++ b/Items/AbyssHeadgear.cs @@ -1,7 +1,7 @@ -using Terraria.ID; using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items @@ -110,8 +110,8 @@ void Shoot(int Target, int Damage) Vector2 velocity = Helper.VelocityToPoint(Main.player[item.owner].Center, Main.npc[Target].Center, ShootSpeed); for (int l = 0; l < ShootCount; l++) { - velocity.X = velocity.X + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - velocity.Y = velocity.Y + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.X = velocity.X + Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.Y = velocity.Y + Main.rand.Next(-spread, spread + 1) * spreadMult; int i = Projectile.NewProjectile(Main.player[item.owner].Center.X, Main.player[item.owner].Center.Y, velocity.X, velocity.Y, ShootType, Damage, ShootKN, item.owner); } } diff --git a/Items/AdamantiteDisc.cs b/Items/AdamantiteDisc.cs index 8ac0c944..6805e435 100644 --- a/Items/AdamantiteDisc.cs +++ b/Items/AdamantiteDisc.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/AdamantiteHat.cs b/Items/AdamantiteHat.cs index 33c410f0..a08fbfb9 100644 --- a/Items/AdamantiteHat.cs +++ b/Items/AdamantiteHat.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/AdamantiteHeader.cs b/Items/AdamantiteHeader.cs index 579fe321..1fc48b0e 100644 --- a/Items/AdamantiteHeader.cs +++ b/Items/AdamantiteHeader.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/AdamantiteRifle.cs b/Items/AdamantiteRifle.cs index 19eb8278..81ebec78 100644 --- a/Items/AdamantiteRifle.cs +++ b/Items/AdamantiteRifle.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Microsoft.Xna.Framework; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/AdamantiteStaff.cs b/Items/AdamantiteStaff.cs index f7081c10..828af19a 100644 --- a/Items/AdamantiteStaff.cs +++ b/Items/AdamantiteStaff.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/AdamantiteVisage.cs b/Items/AdamantiteVisage.cs index f45fe250..48fe23b4 100644 --- a/Items/AdamantiteVisage.cs +++ b/Items/AdamantiteVisage.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/AdvancedCircuit.cs b/Items/AdvancedCircuit.cs index 8a5b2087..50be06f3 100644 --- a/Items/AdvancedCircuit.cs +++ b/Items/AdvancedCircuit.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/AlchemistFocus.cs b/Items/AlchemistFocus.cs index bc1307c5..d12b445a 100644 --- a/Items/AlchemistFocus.cs +++ b/Items/AlchemistFocus.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Terraria; using Terraria.DataStructures; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/AlchemistGlove.cs b/Items/AlchemistGlove.cs index 4e010e3f..1c21f6ad 100644 --- a/Items/AlchemistGlove.cs +++ b/Items/AlchemistGlove.cs @@ -10,7 +10,7 @@ public override bool CanEquipAccessory(Player player, int slot) for (int i = 0; i < player.armor.Length; i++) { MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - if (modPlayer.glove == true) + if (modPlayer.glove) { return false; } diff --git a/Items/AlienBlaster.cs b/Items/AlienBlaster.cs index c62ec1dc..59eac23f 100644 --- a/Items/AlienBlaster.cs +++ b/Items/AlienBlaster.cs @@ -1,7 +1,7 @@ -using Terraria.ID; using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items @@ -60,12 +60,12 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX for (int i = 0; i < ShotAmt; i++) { - float vX = 8 * speedX + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - float vY = 8 * speedY + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + float vX = 8 * speedX + Main.rand.Next(-spread, spread + 1) * spreadMult; + float vY = 8 * speedY + Main.rand.Next(-spread, spread + 1) * spreadMult; float angle = (float)Math.Atan(vY / vX); vector2 = new Vector2(position.X + 75f * (float)Math.Cos(angle), position.Y + 75f * (float)Math.Sin(angle)); - float mouseX = (float)Main.mouseX + Main.screenPosition.X; + float mouseX = Main.mouseX + Main.screenPosition.X; if (mouseX < player.position.X) { vector2 = new Vector2(position.X - 75f * (float)Math.Cos(angle), position.Y - 75f * (float)Math.Sin(angle)); diff --git a/Items/AmethystBlade.cs b/Items/AmethystBlade.cs index 802f21a6..d10e8bbd 100644 --- a/Items/AmethystBlade.cs +++ b/Items/AmethystBlade.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/AmethystDrill.cs b/Items/AmethystDrill.cs index 182c0932..38ae7f64 100644 --- a/Items/AmethystDrill.cs +++ b/Items/AmethystDrill.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/AmplifiedEnchantmentSolution.cs b/Items/AmplifiedEnchantmentSolution.cs index d2609acc..106f33b8 100644 --- a/Items/AmplifiedEnchantmentSolution.cs +++ b/Items/AmplifiedEnchantmentSolution.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items @@ -11,7 +11,7 @@ public override bool CanEquipAccessory(Player player, int slot) for (int i = 0; i < player.armor.Length; i++) { MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - if (modPlayer.enchanted == true) + if (modPlayer.enchanted) { return false; } diff --git a/Items/AncientClaymore.cs b/Items/AncientClaymore.cs index b27e8b90..66a600fe 100644 --- a/Items/AncientClaymore.cs +++ b/Items/AncientClaymore.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/AncientMosaic.cs b/Items/AncientMosaic.cs index 3d6b9bed..eb9c6577 100644 --- a/Items/AncientMosaic.cs +++ b/Items/AncientMosaic.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/AncientSmasher.cs b/Items/AncientSmasher.cs index 29654c8f..b7c9befe 100644 --- a/Items/AncientSmasher.cs +++ b/Items/AncientSmasher.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/AncientSolarWind.cs b/Items/AncientSolarWind.cs index ca6ba722..f41caaba 100644 --- a/Items/AncientSolarWind.cs +++ b/Items/AncientSolarWind.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/AncientSunStaff.cs b/Items/AncientSunStaff.cs index d6de1f3a..15be7271 100644 --- a/Items/AncientSunStaff.cs +++ b/Items/AncientSunStaff.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/AncientVisionStaff.cs b/Items/AncientVisionStaff.cs index ec5f2ff5..293b8a5a 100644 --- a/Items/AncientVisionStaff.cs +++ b/Items/AncientVisionStaff.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/AndasCore.cs b/Items/AndasCore.cs index e0440c99..05c339e3 100644 --- a/Items/AndasCore.cs +++ b/Items/AndasCore.cs @@ -33,8 +33,8 @@ public override void UpdateAccessory(Player player, bool hideVisual) public override void ArmorSetShadows(Player player) { - player.armorEffectDrawOutlines = true; //। ஢ - player.armorEffectDrawShadowLokis = true; //쪨 ⥭ + player.armorEffectDrawOutlines = true; //�।��� ����஢���� + player.armorEffectDrawShadowLokis = true; //�����쪨� ⥭� } public override void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, diff --git a/Items/AngelFlameSword.cs b/Items/AngelFlameSword.cs index b6fbb241..413ebdc5 100644 --- a/Items/AngelFlameSword.cs +++ b/Items/AngelFlameSword.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/AngelicTears.cs b/Items/AngelicTears.cs index 78cc8e7a..c3b82ca4 100644 --- a/Items/AngelicTears.cs +++ b/Items/AngelicTears.cs @@ -1,6 +1,7 @@ +using System.Collections.Generic; +using Microsoft.Xna.Framework; using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { @@ -33,7 +34,7 @@ public override void SetStaticDefaults() } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) + public override void ModifyTooltips(List tooltips) { tooltips[0].overrideColor = new Color(238, 194, 73); } diff --git a/Items/AngeliteBar.cs b/Items/AngeliteBar.cs index 5e040d24..816161b3 100644 --- a/Items/AngeliteBar.cs +++ b/Items/AngeliteBar.cs @@ -1,5 +1,6 @@ -using Terraria.ModLoader; +using System.Collections.Generic; using Microsoft.Xna.Framework; +using Terraria.ModLoader; namespace Tremor.Items { @@ -29,7 +30,7 @@ public override void SetStaticDefaults() } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) + public override void ModifyTooltips(List tooltips) { tooltips[0].overrideColor = new Color(238, 194, 73); } diff --git a/Items/AngeliteOre.cs b/Items/AngeliteOre.cs index aa668c48..1f824da9 100644 --- a/Items/AngeliteOre.cs +++ b/Items/AngeliteOre.cs @@ -1,5 +1,6 @@ -using Terraria.ModLoader; +using System.Collections.Generic; using Microsoft.Xna.Framework; +using Terraria.ModLoader; namespace Tremor.Items { @@ -29,7 +30,7 @@ public override void SetStaticDefaults() } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) + public override void ModifyTooltips(List tooltips) { tooltips[0].overrideColor = new Color(238, 194, 73); } diff --git a/Items/AntiqueStave.cs b/Items/AntiqueStave.cs index 8fd8eee9..4ab18d63 100644 --- a/Items/AntiqueStave.cs +++ b/Items/AntiqueStave.cs @@ -1,6 +1,6 @@ +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; -using Microsoft.Xna.Framework; using Terraria.ModLoader; namespace Tremor.Items @@ -51,9 +51,9 @@ public override bool UseItem(Player player) } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - Vector2 SPos = Main.screenPosition + new Vector2((float)Main.mouseX, (float)Main.mouseY); + Vector2 SPos = Main.screenPosition + new Vector2(Main.mouseX, Main.mouseY); position = SPos; for (int l = 0; l < Main.projectile.Length; l++) { diff --git a/Items/AntlionFury.cs b/Items/AntlionFury.cs index b9dea0f4..30fb703e 100644 --- a/Items/AntlionFury.cs +++ b/Items/AntlionFury.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Microsoft.Xna.Framework; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/ArgiteBroadsword.cs b/Items/ArgiteBroadsword.cs index 04703b45..8517ecf8 100644 --- a/Items/ArgiteBroadsword.cs +++ b/Items/ArgiteBroadsword.cs @@ -1,7 +1,7 @@ -using Terraria.ID; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { diff --git a/Items/ArgiteHamaxe.cs b/Items/ArgiteHamaxe.cs index 8d4f3760..02fe2e4d 100644 --- a/Items/ArgiteHamaxe.cs +++ b/Items/ArgiteHamaxe.cs @@ -1,7 +1,7 @@ -using Terraria.ID; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { diff --git a/Items/ArgiteHelmet.cs b/Items/ArgiteHelmet.cs index 9b8100da..30139831 100644 --- a/Items/ArgiteHelmet.cs +++ b/Items/ArgiteHelmet.cs @@ -1,7 +1,7 @@ using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { diff --git a/Items/ArgitePickaxe.cs b/Items/ArgitePickaxe.cs index 033ed5e9..47b22808 100644 --- a/Items/ArgitePickaxe.cs +++ b/Items/ArgitePickaxe.cs @@ -1,7 +1,7 @@ -using Terraria.ID; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { diff --git a/Items/ArtifactEngine.cs b/Items/ArtifactEngine.cs index c145b2e1..c21d1d1d 100644 --- a/Items/ArtifactEngine.cs +++ b/Items/ArtifactEngine.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Awakening.cs b/Items/Awakening.cs index 7b444497..b6020ced 100644 --- a/Items/Awakening.cs +++ b/Items/Awakening.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/BadApple.cs b/Items/BadApple.cs index 15f65c1d..b718bf32 100644 --- a/Items/BadApple.cs +++ b/Items/BadApple.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Banhammer.cs b/Items/Banhammer.cs index 4e449b57..6684fc5a 100644 --- a/Items/Banhammer.cs +++ b/Items/Banhammer.cs @@ -1,6 +1,7 @@ -using Terraria.ID; +using System.Collections.Generic; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items @@ -35,7 +36,7 @@ public override void SetStaticDefaults() } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) + public override void ModifyTooltips(List tooltips) { tooltips[0].overrideColor = new Color(238, 194, 73); } diff --git a/Items/BasicFlask.cs b/Items/BasicFlask.cs index cf355569..335c4ad2 100644 --- a/Items/BasicFlask.cs +++ b/Items/BasicFlask.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/BasicSprayer.cs b/Items/BasicSprayer.cs index e8effb55..1abc287e 100644 --- a/Items/BasicSprayer.cs +++ b/Items/BasicSprayer.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items @@ -117,7 +117,7 @@ public override void UpdateInventory(Player player) } } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { MPlayer modPlayer = player.GetModPlayer(mod); if (modPlayer.glove) diff --git a/Items/BeetleShield.cs b/Items/BeetleShield.cs index bdb83c9e..7ae10486 100644 --- a/Items/BeetleShield.cs +++ b/Items/BeetleShield.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/BestNightmare.cs b/Items/BestNightmare.cs index ca0517ab..f976e780 100644 --- a/Items/BestNightmare.cs +++ b/Items/BestNightmare.cs @@ -1,6 +1,7 @@ +using System.Collections.Generic; +using Microsoft.Xna.Framework; using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { @@ -33,7 +34,7 @@ public override void SetStaticDefaults() } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) + public override void ModifyTooltips(List tooltips) { tooltips[0].overrideColor = new Color(238, 194, 73); } diff --git a/Items/BigBottledSpirit.cs b/Items/BigBottledSpirit.cs index 0abd6da7..44cc3c6f 100644 --- a/Items/BigBottledSpirit.cs +++ b/Items/BigBottledSpirit.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items @@ -11,7 +11,7 @@ public override bool CanEquipAccessory(Player player, int slot) for (int i = 0; i < player.armor.Length; i++) { MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - if (modPlayer.spirit == true) + if (modPlayer.spirit) { return false; } diff --git a/Items/BigHealingFlack.cs b/Items/BigHealingFlack.cs index d990abd7..f94461b5 100644 --- a/Items/BigHealingFlack.cs +++ b/Items/BigHealingFlack.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/BigManaFlask.cs b/Items/BigManaFlask.cs index bbe06d07..fb944b03 100644 --- a/Items/BigManaFlask.cs +++ b/Items/BigManaFlask.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/BigPoisonFlask.cs b/Items/BigPoisonFlask.cs index 7e7a3635..6c6f1025 100644 --- a/Items/BigPoisonFlask.cs +++ b/Items/BigPoisonFlask.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/BigVenomFlask.cs b/Items/BigVenomFlask.cs index 5f5aa4bc..a2b680ae 100644 --- a/Items/BigVenomFlask.cs +++ b/Items/BigVenomFlask.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/BlackCauldron.cs b/Items/BlackCauldron.cs index 079b9cfd..3895295d 100644 --- a/Items/BlackCauldron.cs +++ b/Items/BlackCauldron.cs @@ -2,7 +2,6 @@ using Terraria.DataStructures; using Terraria.ModLoader; - namespace Tremor.Items { public class BlackCauldron : ModItem diff --git a/Items/BlackRose.cs b/Items/BlackRose.cs index e5b3d333..cbbae1f0 100644 --- a/Items/BlackRose.cs +++ b/Items/BlackRose.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/BladeofDarkness.cs b/Items/BladeofDarkness.cs index 39933a8e..b63bd92f 100644 --- a/Items/BladeofDarkness.cs +++ b/Items/BladeofDarkness.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/BloodCarnage.cs b/Items/BloodCarnage.cs index a628d600..91538d89 100644 --- a/Items/BloodCarnage.cs +++ b/Items/BloodCarnage.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/BloodmoonPotion.cs b/Items/BloodmoonPotion.cs index a94f92c8..827d7e99 100644 --- a/Items/BloodmoonPotion.cs +++ b/Items/BloodmoonPotion.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/BloodyBow.cs b/Items/BloodyBow.cs index d4a2332a..fed78796 100644 --- a/Items/BloodyBow.cs +++ b/Items/BloodyBow.cs @@ -1,7 +1,7 @@ -using Terraria.ID; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { diff --git a/Items/BlueCrossguardPhasesaber.cs b/Items/BlueCrossguardPhasesaber.cs index 99940140..010a9fdb 100644 --- a/Items/BlueCrossguardPhasesaber.cs +++ b/Items/BlueCrossguardPhasesaber.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/BlueSakura.cs b/Items/BlueSakura.cs index e2fa6f39..5bc146f8 100644 --- a/Items/BlueSakura.cs +++ b/Items/BlueSakura.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Bolter.cs b/Items/Bolter.cs index 2e54bae1..21ba0ba9 100644 --- a/Items/Bolter.cs +++ b/Items/Bolter.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/BoneGreaves.cs b/Items/BoneGreaves.cs index eab876bb..d99252a5 100644 --- a/Items/BoneGreaves.cs +++ b/Items/BoneGreaves.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/BoneHelmet.cs b/Items/BoneHelmet.cs index 31d9c12f..cb367c03 100644 --- a/Items/BoneHelmet.cs +++ b/Items/BoneHelmet.cs @@ -1,7 +1,7 @@ -using Terraria.ID; using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/BoneRepeater.cs b/Items/BoneRepeater.cs index 058d024e..6ee06dde 100644 --- a/Items/BoneRepeater.cs +++ b/Items/BoneRepeater.cs @@ -1,6 +1,6 @@ -using Terraria.ID; -using Terraria; using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/BoneShell.cs b/Items/BoneShell.cs index 9754e811..e27de19b 100644 --- a/Items/BoneShell.cs +++ b/Items/BoneShell.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Bonecrusher.cs b/Items/Bonecrusher.cs index b14ce72f..77f80182 100644 --- a/Items/Bonecrusher.cs +++ b/Items/Bonecrusher.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/BoomFlask.cs b/Items/BoomFlask.cs index 8c7ddff8..0a41be0f 100644 --- a/Items/BoomFlask.cs +++ b/Items/BoomFlask.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; namespace Tremor.Items { diff --git a/Items/Boonerang.cs b/Items/Boonerang.cs index e9b48b5d..9b43493e 100644 --- a/Items/Boonerang.cs +++ b/Items/Boonerang.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/BottledGlue.cs b/Items/BottledGlue.cs index 0aafe82e..f8914b82 100644 --- a/Items/BottledGlue.cs +++ b/Items/BottledGlue.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/BottledSoulOfFlight.cs b/Items/BottledSoulOfFlight.cs index 54e6bbd1..3a1b9007 100644 --- a/Items/BottledSoulOfFlight.cs +++ b/Items/BottledSoulOfFlight.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/BottledSoulOfFright.cs b/Items/BottledSoulOfFright.cs index 2a914e63..6d2ab3d6 100644 --- a/Items/BottledSoulOfFright.cs +++ b/Items/BottledSoulOfFright.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/BottledSoulOfLight.cs b/Items/BottledSoulOfLight.cs index 583551d9..04c7f0cd 100644 --- a/Items/BottledSoulOfLight.cs +++ b/Items/BottledSoulOfLight.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/BottledSoulOfMight.cs b/Items/BottledSoulOfMight.cs index 093c8c0a..b66b8559 100644 --- a/Items/BottledSoulOfMight.cs +++ b/Items/BottledSoulOfMight.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/BottledSoulOfMind.cs b/Items/BottledSoulOfMind.cs index 232256ab..cbb5c004 100644 --- a/Items/BottledSoulOfMind.cs +++ b/Items/BottledSoulOfMind.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/BottledSoulOfNight.cs b/Items/BottledSoulOfNight.cs index 59c007c1..1c606703 100644 --- a/Items/BottledSoulOfNight.cs +++ b/Items/BottledSoulOfNight.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/BottledSoulOfSight.cs b/Items/BottledSoulOfSight.cs index f7707256..2cf10ffb 100644 --- a/Items/BottledSoulOfSight.cs +++ b/Items/BottledSoulOfSight.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/BottledSpirit.cs b/Items/BottledSpirit.cs index fbac62a7..56b23f3a 100644 --- a/Items/BottledSpirit.cs +++ b/Items/BottledSpirit.cs @@ -11,7 +11,7 @@ public override bool CanEquipAccessory(Player player, int slot) for (int i = 0; i < player.armor.Length; i++) { MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - if (modPlayer.spirit == true) + if (modPlayer.spirit) { return false; } diff --git a/Items/BouncingCasing.cs b/Items/BouncingCasing.cs index 0f184937..c5c07a62 100644 --- a/Items/BouncingCasing.cs +++ b/Items/BouncingCasing.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Brainiac.cs b/Items/Brainiac.cs index 7e4124dd..ac5e113f 100644 --- a/Items/Brainiac.cs +++ b/Items/Brainiac.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Microsoft.Xna.Framework; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/BrambleStaff.cs b/Items/BrambleStaff.cs index 76c05601..5ea5ceac 100644 --- a/Items/BrambleStaff.cs +++ b/Items/BrambleStaff.cs @@ -1,6 +1,6 @@ +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; -using Microsoft.Xna.Framework; using Terraria.ModLoader; namespace Tremor.Items @@ -61,9 +61,9 @@ public override void AddRecipes() recipe.AddRecipe(); } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - Vector2 SPos = Main.screenPosition + new Vector2((float)Main.mouseX, (float)Main.mouseY); + Vector2 SPos = Main.screenPosition + new Vector2(Main.mouseX, Main.mouseY); position = SPos; for (int l = 0; l < Main.projectile.Length; l++) { diff --git a/Items/BrassChainRepeater.cs b/Items/BrassChainRepeater.cs index ee0bd4f1..e3e76cd2 100644 --- a/Items/BrassChainRepeater.cs +++ b/Items/BrassChainRepeater.cs @@ -1,7 +1,7 @@ -using Terraria.ID; -using Microsoft.Xna.Framework; using System.Linq; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items @@ -39,7 +39,7 @@ public override void SetStaticDefaults() public override void UpdateInventory(Player player) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SteamRangerBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SteamRangerBuff"))) { item.damage = 45; } diff --git a/Items/BrassChestplate.cs b/Items/BrassChestplate.cs index 8c80d9f5..0b1b47b6 100644 --- a/Items/BrassChestplate.cs +++ b/Items/BrassChestplate.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/BrassGlaive.cs b/Items/BrassGlaive.cs index 44c68cf1..a617d734 100644 --- a/Items/BrassGlaive.cs +++ b/Items/BrassGlaive.cs @@ -1,6 +1,6 @@ -using Terraria.ID; -using Terraria; using System.Linq; +using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items @@ -35,7 +35,7 @@ public override void SetStaticDefaults() public override void UpdateInventory(Player player) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SteamSwordBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SteamSwordBuff"))) { item.damage = 85; } diff --git a/Items/BrassGreaves.cs b/Items/BrassGreaves.cs index 041c0731..8e403e27 100644 --- a/Items/BrassGreaves.cs +++ b/Items/BrassGreaves.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/BrassHammer.cs b/Items/BrassHammer.cs index 2c90df45..c01f228c 100644 --- a/Items/BrassHammer.cs +++ b/Items/BrassHammer.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/BrassHeadgear.cs b/Items/BrassHeadgear.cs index a3f977ef..323e048e 100644 --- a/Items/BrassHeadgear.cs +++ b/Items/BrassHeadgear.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/BrassHelmet.cs b/Items/BrassHelmet.cs index 73a9439e..0b6f5b10 100644 --- a/Items/BrassHelmet.cs +++ b/Items/BrassHelmet.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/BrassMask.cs b/Items/BrassMask.cs index 84a48679..e787f7da 100644 --- a/Items/BrassMask.cs +++ b/Items/BrassMask.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/BrassPickaxeAxe.cs b/Items/BrassPickaxeAxe.cs index 13cdaa14..e5bb5707 100644 --- a/Items/BrassPickaxeAxe.cs +++ b/Items/BrassPickaxeAxe.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/BrassRapier.cs b/Items/BrassRapier.cs index 62d9a017..9a8f12a0 100644 --- a/Items/BrassRapier.cs +++ b/Items/BrassRapier.cs @@ -1,7 +1,7 @@ -using Terraria.ID; +using System.Linq; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using System.Linq; namespace Tremor.Items { @@ -36,7 +36,7 @@ public override void SetStaticDefaults() public override void UpdateInventory(Player player) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SteamSwordBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SteamSwordBuff"))) { item.damage = 80; item.useTime = 15; diff --git a/Items/BrassStave.cs b/Items/BrassStave.cs index 6e54aece..bb0c1836 100644 --- a/Items/BrassStave.cs +++ b/Items/BrassStave.cs @@ -1,6 +1,6 @@ -using Terraria.ID; -using Terraria; using System.Linq; +using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items @@ -94,7 +94,7 @@ public override void UpdateInventory(Player player) { if (player.altFunctionUse == 2) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SteamMageBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SteamMageBuff"))) { item.damage = 100; } @@ -105,7 +105,7 @@ public override void UpdateInventory(Player player) } else { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SteamMageBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SteamMageBuff"))) { item.damage = 80; } diff --git a/Items/BrutalliskCrystal.cs b/Items/BrutalliskCrystal.cs index 4ca562cf..78d359ac 100644 --- a/Items/BrutalliskCrystal.cs +++ b/Items/BrutalliskCrystal.cs @@ -1,5 +1,5 @@ -using Terraria.ModLoader; using Terraria.ID; +using Terraria.ModLoader; namespace Tremor.Items { diff --git a/Items/BulbTorch.cs b/Items/BulbTorch.cs index faa693d9..cfe5f627 100644 --- a/Items/BulbTorch.cs +++ b/Items/BulbTorch.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/BurningFlask.cs b/Items/BurningFlask.cs index cb51598f..ce944cb2 100644 --- a/Items/BurningFlask.cs +++ b/Items/BurningFlask.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; namespace Tremor.Items { diff --git a/Items/Candent.cs b/Items/Candent.cs index 92f4d2a8..6b588850 100644 --- a/Items/Candent.cs +++ b/Items/Candent.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/CandyBlaster.cs b/Items/CandyBlaster.cs index ef3ec737..411613cb 100644 --- a/Items/CandyBlaster.cs +++ b/Items/CandyBlaster.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Carrow.cs b/Items/Carrow.cs index 552edf23..a938792f 100644 --- a/Items/Carrow.cs +++ b/Items/Carrow.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/ChainBow.cs b/Items/ChainBow.cs index 76aeb310..5dbbf51d 100644 --- a/Items/ChainBow.cs +++ b/Items/ChainBow.cs @@ -1,7 +1,7 @@ +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { diff --git a/Items/Chainjaw.cs b/Items/Chainjaw.cs index ab333185..56f468d1 100644 --- a/Items/Chainjaw.cs +++ b/Items/Chainjaw.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/ChaosBreastplate.cs b/Items/ChaosBreastplate.cs index 3706ae9a..c1280bd0 100644 --- a/Items/ChaosBreastplate.cs +++ b/Items/ChaosBreastplate.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/ChaosWings.cs b/Items/ChaosWings.cs index 3fde3923..180f6ef7 100644 --- a/Items/ChaosWings.cs +++ b/Items/ChaosWings.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Chemikaze.cs b/Items/Chemikaze.cs index d3c1c9ec..60fd8b0d 100644 --- a/Items/Chemikaze.cs +++ b/Items/Chemikaze.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items @@ -12,7 +12,7 @@ public override bool CanEquipAccessory(Player player, int slot) for (int i = 0; i < player.armor.Length; i++) { MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - if (modPlayer.pyro == true) + if (modPlayer.pyro) { return false; } diff --git a/Items/ChemistHelmet.cs b/Items/ChemistHelmet.cs index 397e5123..2c1bf695 100644 --- a/Items/ChemistHelmet.cs +++ b/Items/ChemistHelmet.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/ChlorophyteDeadshooter.cs b/Items/ChlorophyteDeadshooter.cs index 5d799582..30c6022b 100644 --- a/Items/ChlorophyteDeadshooter.cs +++ b/Items/ChlorophyteDeadshooter.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/ChlorophyteHat.cs b/Items/ChlorophyteHat.cs index 5277fb20..27509382 100644 --- a/Items/ChlorophyteHat.cs +++ b/Items/ChlorophyteHat.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/ChlorophyteHeader.cs b/Items/ChlorophyteHeader.cs index d70e2736..4b96c80d 100644 --- a/Items/ChlorophyteHeader.cs +++ b/Items/ChlorophyteHeader.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/ChlorophyteVisage.cs b/Items/ChlorophyteVisage.cs index 91cc2dc3..8e95b163 100644 --- a/Items/ChlorophyteVisage.cs +++ b/Items/ChlorophyteVisage.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/ClusterFlask.cs b/Items/ClusterFlask.cs index 3e1955b9..b30114c0 100644 --- a/Items/ClusterFlask.cs +++ b/Items/ClusterFlask.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/CobaltDisc.cs b/Items/CobaltDisc.cs index 75359bf5..8af44e70 100644 --- a/Items/CobaltDisc.cs +++ b/Items/CobaltDisc.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/CobaltHeader.cs b/Items/CobaltHeader.cs index 0737dd80..5b178e22 100644 --- a/Items/CobaltHeader.cs +++ b/Items/CobaltHeader.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/CobaltHeadgear.cs b/Items/CobaltHeadgear.cs index aaa014da..de9ed1fa 100644 --- a/Items/CobaltHeadgear.cs +++ b/Items/CobaltHeadgear.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/CobaltRifle.cs b/Items/CobaltRifle.cs index 40343d52..980b7099 100644 --- a/Items/CobaltRifle.cs +++ b/Items/CobaltRifle.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Microsoft.Xna.Framework; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/CobaltStaff.cs b/Items/CobaltStaff.cs index b3df6af2..b30219a8 100644 --- a/Items/CobaltStaff.cs +++ b/Items/CobaltStaff.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/CobaltVisage.cs b/Items/CobaltVisage.cs index cc19e88c..aa8bebe3 100644 --- a/Items/CobaltVisage.cs +++ b/Items/CobaltVisage.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/ColdMetalWings.cs b/Items/ColdMetalWings.cs index 364ddbde..6ba10a99 100644 --- a/Items/ColdMetalWings.cs +++ b/Items/ColdMetalWings.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/ColdTooth.cs b/Items/ColdTooth.cs index 6ee63bae..5905da2d 100644 --- a/Items/ColdTooth.cs +++ b/Items/ColdTooth.cs @@ -1,9 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.Items { public class ColdTooth : ModItem diff --git a/Items/CollapsiumBar.cs b/Items/CollapsiumBar.cs index f50441cc..9dbc46a8 100644 --- a/Items/CollapsiumBar.cs +++ b/Items/CollapsiumBar.cs @@ -1,5 +1,6 @@ -using Terraria.ModLoader; +using System.Collections.Generic; using Microsoft.Xna.Framework; +using Terraria.ModLoader; namespace Tremor.Items { @@ -29,7 +30,7 @@ public override void SetStaticDefaults() } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) + public override void ModifyTooltips(List tooltips) { tooltips[0].overrideColor = new Color(238, 194, 73); } diff --git a/Items/CollapsiumOre.cs b/Items/CollapsiumOre.cs index 8bc9588c..064cd5c4 100644 --- a/Items/CollapsiumOre.cs +++ b/Items/CollapsiumOre.cs @@ -1,5 +1,6 @@ -using Terraria.ModLoader; +using System.Collections.Generic; using Microsoft.Xna.Framework; +using Terraria.ModLoader; namespace Tremor.Items { @@ -29,7 +30,7 @@ public override void SetStaticDefaults() } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) + public override void ModifyTooltips(List tooltips) { tooltips[0].overrideColor = new Color(238, 194, 73); } diff --git a/Items/CopperShield.cs b/Items/CopperShield.cs index 2f591d3c..dc21d3ff 100644 --- a/Items/CopperShield.cs +++ b/Items/CopperShield.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/CoralHelmet.cs b/Items/CoralHelmet.cs index f0ea64a6..676f730e 100644 --- a/Items/CoralHelmet.cs +++ b/Items/CoralHelmet.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/CorruptorGun.cs b/Items/CorruptorGun.cs index 23b3f18f..61e05556 100644 --- a/Items/CorruptorGun.cs +++ b/Items/CorruptorGun.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/CorruptorStaff.cs b/Items/CorruptorStaff.cs index 99409da8..54f2be11 100644 --- a/Items/CorruptorStaff.cs +++ b/Items/CorruptorStaff.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/CosmicAssaultRifle.cs b/Items/CosmicAssaultRifle.cs index 705338bc..640e7aab 100644 --- a/Items/CosmicAssaultRifle.cs +++ b/Items/CosmicAssaultRifle.cs @@ -1,7 +1,7 @@ +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { diff --git a/Items/CosmicKrill.cs b/Items/CosmicKrill.cs index 220fe2eb..ed9c6f63 100644 --- a/Items/CosmicKrill.cs +++ b/Items/CosmicKrill.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/CreeperStaff.cs b/Items/CreeperStaff.cs index 4d3f26e6..2826a0f7 100644 --- a/Items/CreeperStaff.cs +++ b/Items/CreeperStaff.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/CrimtaneProtector.cs b/Items/CrimtaneProtector.cs index 32a2e8d9..815ec8e7 100644 --- a/Items/CrimtaneProtector.cs +++ b/Items/CrimtaneProtector.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/CrossBlast.cs b/Items/CrossBlast.cs index df9cf8af..1a56dfd2 100644 --- a/Items/CrossBlast.cs +++ b/Items/CrossBlast.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items @@ -11,7 +11,7 @@ public override bool CanEquipAccessory(Player player, int slot) for (int i = 0; i < player.armor.Length; i++) { MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - if (modPlayer.pyro == true) + if (modPlayer.pyro) { return false; } diff --git a/Items/Crossbow.cs b/Items/Crossbow.cs index 89bc2780..5b367578 100644 --- a/Items/Crossbow.cs +++ b/Items/Crossbow.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Microsoft.Xna.Framework; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Crusher.cs b/Items/Crusher.cs index 3d2fedb0..246f7365 100644 --- a/Items/Crusher.cs +++ b/Items/Crusher.cs @@ -1,7 +1,7 @@ -using Terraria.ID; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { diff --git a/Items/CrystalChainmer.cs b/Items/CrystalChainmer.cs index b3595cfb..35cebaca 100644 --- a/Items/CrystalChainmer.cs +++ b/Items/CrystalChainmer.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/CrystalChestplate.cs b/Items/CrystalChestplate.cs index 4ced934e..22086da9 100644 --- a/Items/CrystalChestplate.cs +++ b/Items/CrystalChestplate.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/CrystalDrill.cs b/Items/CrystalDrill.cs index 1ce8aba6..4cfe749c 100644 --- a/Items/CrystalDrill.cs +++ b/Items/CrystalDrill.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/CrystalFlask.cs b/Items/CrystalFlask.cs index c66f3ea7..ad416370 100644 --- a/Items/CrystalFlask.cs +++ b/Items/CrystalFlask.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/CrystalGreaves.cs b/Items/CrystalGreaves.cs index 2d052b8d..b5626878 100644 --- a/Items/CrystalGreaves.cs +++ b/Items/CrystalGreaves.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/CrystalHelmet.cs b/Items/CrystalHelmet.cs index 56696be4..fbf925b6 100644 --- a/Items/CrystalHelmet.cs +++ b/Items/CrystalHelmet.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/CrystalPickaxe.cs b/Items/CrystalPickaxe.cs index 4c7662b6..434f5860 100644 --- a/Items/CrystalPickaxe.cs +++ b/Items/CrystalPickaxe.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/CrystalWarhamaxe.cs b/Items/CrystalWarhamaxe.cs index c5282109..9b95dac0 100644 --- a/Items/CrystalWarhamaxe.cs +++ b/Items/CrystalWarhamaxe.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/CrystalWhirlwind.cs b/Items/CrystalWhirlwind.cs index 9e16482f..2dcc7376 100644 --- a/Items/CrystalWhirlwind.cs +++ b/Items/CrystalWhirlwind.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/CursedCauldron.cs b/Items/CursedCauldron.cs index 658b22fa..4af36add 100644 --- a/Items/CursedCauldron.cs +++ b/Items/CursedCauldron.cs @@ -2,7 +2,6 @@ using Terraria.DataStructures; using Terraria.ModLoader; - namespace Tremor.Items { public class CursedCauldron : ModItem diff --git a/Items/CursedKnife.cs b/Items/CursedKnife.cs index 5b666369..fc8ed24e 100644 --- a/Items/CursedKnife.cs +++ b/Items/CursedKnife.cs @@ -1,6 +1,6 @@ -using Terraria.ID; -using Terraria; using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/CursedPopcorn.cs b/Items/CursedPopcorn.cs index 71514283..b088a4d1 100644 --- a/Items/CursedPopcorn.cs +++ b/Items/CursedPopcorn.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/CyberCutter.cs b/Items/CyberCutter.cs index 2c30f8fe..e1761bb4 100644 --- a/Items/CyberCutter.cs +++ b/Items/CyberCutter.cs @@ -1,7 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; - using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/CyberStaff.cs b/Items/CyberStaff.cs index c8696d15..6748e996 100644 --- a/Items/CyberStaff.cs +++ b/Items/CyberStaff.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/DangerBlade.cs b/Items/DangerBlade.cs index 0a581f83..c695edce 100644 --- a/Items/DangerBlade.cs +++ b/Items/DangerBlade.cs @@ -1,7 +1,8 @@ -using Terraria.ID; +using System.Collections.Generic; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { @@ -26,7 +27,7 @@ public override void SetStaticDefaults() } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) + public override void ModifyTooltips(List tooltips) { tooltips[0].overrideColor = new Color(238, 194, 73); } diff --git a/Items/DarkAbsorber.cs b/Items/DarkAbsorber.cs index e864a585..663f0c3a 100644 --- a/Items/DarkAbsorber.cs +++ b/Items/DarkAbsorber.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Darkhalis.cs b/Items/Darkhalis.cs index f9173536..960e81f3 100644 --- a/Items/Darkhalis.cs +++ b/Items/Darkhalis.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/DarknessDust.cs b/Items/DarknessDust.cs index 5f22f2ac..19a2711a 100644 --- a/Items/DarknessDust.cs +++ b/Items/DarknessDust.cs @@ -1,7 +1,7 @@ -using Terraria.ID; using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/DeadFlower.cs b/Items/DeadFlower.cs index 9bcaf017..2fb9eeb9 100644 --- a/Items/DeadFlower.cs +++ b/Items/DeadFlower.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/DeadHead.cs b/Items/DeadHead.cs index b703716d..a9787654 100644 --- a/Items/DeadHead.cs +++ b/Items/DeadHead.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/DeadlyTreats.cs b/Items/DeadlyTreats.cs index 52c99f40..2661af66 100644 --- a/Items/DeadlyTreats.cs +++ b/Items/DeadlyTreats.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/DeathFormula.cs b/Items/DeathFormula.cs index 9d6bfd31..3a17c0c9 100644 --- a/Items/DeathFormula.cs +++ b/Items/DeathFormula.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Decayed.cs b/Items/Decayed.cs index ab53beaa..1a03b3c5 100644 --- a/Items/Decayed.cs +++ b/Items/Decayed.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Microsoft.Xna.Framework; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/DemoniteProtector.cs b/Items/DemoniteProtector.cs index 557cf094..68dc5198 100644 --- a/Items/DemoniteProtector.cs +++ b/Items/DemoniteProtector.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/DesertClaymore.cs b/Items/DesertClaymore.cs index a94e65ec..da6e937f 100644 --- a/Items/DesertClaymore.cs +++ b/Items/DesertClaymore.cs @@ -1,6 +1,6 @@ -using Terraria.ID; -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/DesertCrown.cs b/Items/DesertCrown.cs index 0b94f3d4..3ba256a2 100644 --- a/Items/DesertCrown.cs +++ b/Items/DesertCrown.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Destructor.cs b/Items/Destructor.cs index 28a282b6..38f7bca6 100644 --- a/Items/Destructor.cs +++ b/Items/Destructor.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Devastator.cs b/Items/Devastator.cs index c15b18b3..34b02b65 100644 --- a/Items/Devastator.cs +++ b/Items/Devastator.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/DiamondBlade.cs b/Items/DiamondBlade.cs index e4c2c505..0fb5be51 100644 --- a/Items/DiamondBlade.cs +++ b/Items/DiamondBlade.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/DiamondDrill.cs b/Items/DiamondDrill.cs index 2c887509..fda5657e 100644 --- a/Items/DiamondDrill.cs +++ b/Items/DiamondDrill.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/DivineClaymore.cs b/Items/DivineClaymore.cs index 5240f5e7..e8973f02 100644 --- a/Items/DivineClaymore.cs +++ b/Items/DivineClaymore.cs @@ -1,6 +1,7 @@ +using System.Collections.Generic; +using Microsoft.Xna.Framework; using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { @@ -33,7 +34,7 @@ public override void SetStaticDefaults() } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) + public override void ModifyTooltips(List tooltips) { tooltips[0].overrideColor = new Color(238, 194, 73); } diff --git a/Items/DivineForge.cs b/Items/DivineForge.cs index 0832d6fb..c88cdee4 100644 --- a/Items/DivineForge.cs +++ b/Items/DivineForge.cs @@ -1,6 +1,7 @@ +using System.Collections.Generic; +using Microsoft.Xna.Framework; using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { @@ -32,7 +33,7 @@ public override void SetStaticDefaults() } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) + public override void ModifyTooltips(List tooltips) { tooltips[0].overrideColor = new Color(238, 194, 73); } diff --git a/Items/DivineGift.cs b/Items/DivineGift.cs index 873d28db..e3d425f8 100644 --- a/Items/DivineGift.cs +++ b/Items/DivineGift.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/DoomKey.cs b/Items/DoomKey.cs index c5243ae9..36ab813e 100644 --- a/Items/DoomKey.cs +++ b/Items/DoomKey.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Doomstick.cs b/Items/Doomstick.cs index 80b7a3eb..4ad61395 100644 --- a/Items/Doomstick.cs +++ b/Items/Doomstick.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/DragonRafale.cs b/Items/DragonRafale.cs index a6254f9f..0988ec44 100644 --- a/Items/DragonRafale.cs +++ b/Items/DragonRafale.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/DukeFlask.cs b/Items/DukeFlask.cs index c7dbfce3..53796768 100644 --- a/Items/DukeFlask.cs +++ b/Items/DukeFlask.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; namespace Tremor.Items { diff --git a/Items/EaterofWorld.cs b/Items/EaterofWorld.cs index 15e2e542..f0408f7c 100644 --- a/Items/EaterofWorld.cs +++ b/Items/EaterofWorld.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/EdgeofFrostKing.cs b/Items/EdgeofFrostKing.cs index 13067887..c9b80607 100644 --- a/Items/EdgeofFrostKing.cs +++ b/Items/EdgeofFrostKing.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/EmeraldBlade.cs b/Items/EmeraldBlade.cs index 4a7c043f..f5280230 100644 --- a/Items/EmeraldBlade.cs +++ b/Items/EmeraldBlade.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/EmeraldDrill.cs b/Items/EmeraldDrill.cs index b89e650d..e7fc3571 100644 --- a/Items/EmeraldDrill.cs +++ b/Items/EmeraldDrill.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/EmperorCrown.cs b/Items/EmperorCrown.cs index 483a81f1..a9a122df 100644 --- a/Items/EmperorCrown.cs +++ b/Items/EmperorCrown.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/EnchantedHealthBooster.cs b/Items/EnchantedHealthBooster.cs index c8078bf6..cdf4552d 100644 --- a/Items/EnchantedHealthBooster.cs +++ b/Items/EnchantedHealthBooster.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/EnchantedHourglass.cs b/Items/EnchantedHourglass.cs index c1f4077a..8a3844ac 100644 --- a/Items/EnchantedHourglass.cs +++ b/Items/EnchantedHourglass.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/EnchantedManaBooster.cs b/Items/EnchantedManaBooster.cs index b7fa68c7..16b4bc98 100644 --- a/Items/EnchantedManaBooster.cs +++ b/Items/EnchantedManaBooster.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/EnchantmentSolution.cs b/Items/EnchantmentSolution.cs index 12421016..eab30ce9 100644 --- a/Items/EnchantmentSolution.cs +++ b/Items/EnchantmentSolution.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items @@ -11,7 +11,7 @@ public override bool CanEquipAccessory(Player player, int slot) for (int i = 0; i < player.armor.Length; i++) { MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - if (modPlayer.enchanted == true) + if (modPlayer.enchanted) { return false; } diff --git a/Items/EternalAgony.cs b/Items/EternalAgony.cs index 881dc3f2..9f50ae84 100644 --- a/Items/EternalAgony.cs +++ b/Items/EternalAgony.cs @@ -1,6 +1,5 @@ -using Terraria.ID; - using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/ExecutionerAxe.cs b/Items/ExecutionerAxe.cs index 30d98cb9..70be13a1 100644 --- a/Items/ExecutionerAxe.cs +++ b/Items/ExecutionerAxe.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/ExtendedBoomFlask.cs b/Items/ExtendedBoomFlask.cs index a38b63d1..320dbcfd 100644 --- a/Items/ExtendedBoomFlask.cs +++ b/Items/ExtendedBoomFlask.cs @@ -1,6 +1,6 @@ -using Terraria.ID; -using Terraria; using System.Linq; +using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items @@ -39,7 +39,7 @@ public override void SetStaticDefaults() public override void UpdateInventory(Player player) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LongFuseBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LongFuseBuff"))) { item.shootSpeed = 11f; } diff --git a/Items/ExtendedBurningFlask.cs b/Items/ExtendedBurningFlask.cs index 6d40cdae..66f88787 100644 --- a/Items/ExtendedBurningFlask.cs +++ b/Items/ExtendedBurningFlask.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/ExtendedFreezeFlask.cs b/Items/ExtendedFreezeFlask.cs index 1a7ab676..e75fa31e 100644 --- a/Items/ExtendedFreezeFlask.cs +++ b/Items/ExtendedFreezeFlask.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/EyeofInfinity.cs b/Items/EyeofInfinity.cs index e1e9a503..5fa06527 100644 --- a/Items/EyeofInfinity.cs +++ b/Items/EyeofInfinity.cs @@ -1,5 +1,5 @@ -using Terraria.ID; -using Terraria; +using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Eyezor.cs b/Items/Eyezor.cs index 6fad012e..a70e5ba2 100644 --- a/Items/Eyezor.cs +++ b/Items/Eyezor.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/FeatherStorm.cs b/Items/FeatherStorm.cs index 92545af6..da5b6cf7 100644 --- a/Items/FeatherStorm.cs +++ b/Items/FeatherStorm.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/FiercePaw.cs b/Items/FiercePaw.cs index 69c9d398..22835fac 100644 --- a/Items/FiercePaw.cs +++ b/Items/FiercePaw.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/FlamesofDespair.cs b/Items/FlamesofDespair.cs index 89330c06..bd671cd2 100644 --- a/Items/FlamesofDespair.cs +++ b/Items/FlamesofDespair.cs @@ -1,7 +1,7 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/FlamingTooth.cs b/Items/FlamingTooth.cs index 3fa4a47e..2873a62c 100644 --- a/Items/FlamingTooth.cs +++ b/Items/FlamingTooth.cs @@ -1,9 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.Items { public class FlamingTooth : ModItem diff --git a/Items/FlaskCore.cs b/Items/FlaskCore.cs index 3196368b..19d42419 100644 --- a/Items/FlaskCore.cs +++ b/Items/FlaskCore.cs @@ -10,7 +10,7 @@ public override bool CanEquipAccessory(Player player, int slot) for (int i = 0; i < player.armor.Length; i++) { MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - if (modPlayer.core == true) + if (modPlayer.core) { return false; } diff --git a/Items/FleshWings.cs b/Items/FleshWings.cs index 5b9a89b7..bc26cf68 100644 --- a/Items/FleshWings.cs +++ b/Items/FleshWings.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/FlowerofAntimony.cs b/Items/FlowerofAntimony.cs index 92ed502b..87b9a0b6 100644 --- a/Items/FlowerofAntimony.cs +++ b/Items/FlowerofAntimony.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/FreezeFlask.cs b/Items/FreezeFlask.cs index 530f1828..b90a840a 100644 --- a/Items/FreezeFlask.cs +++ b/Items/FreezeFlask.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; namespace Tremor.Items { diff --git a/Items/FrostCrown.cs b/Items/FrostCrown.cs index 93a116cd..89bfea27 100644 --- a/Items/FrostCrown.cs +++ b/Items/FrostCrown.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/FrostFreshness.cs b/Items/FrostFreshness.cs index 43282dce..03cf032b 100644 --- a/Items/FrostFreshness.cs +++ b/Items/FrostFreshness.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/FrostbiteHelmet.cs b/Items/FrostbiteHelmet.cs index e8780fd7..7bd3471a 100644 --- a/Items/FrostbiteHelmet.cs +++ b/Items/FrostbiteHelmet.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Frostbiter.cs b/Items/Frostbiter.cs index 8e88afd7..87e3060e 100644 --- a/Items/Frostbiter.cs +++ b/Items/Frostbiter.cs @@ -1,7 +1,7 @@ -using Terraria.ID; using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items @@ -60,12 +60,12 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX for (int i = 0; i < ShotAmt; i++) { - float vX = 8 * speedX + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - float vY = 8 * speedY + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + float vX = 8 * speedX + Main.rand.Next(-spread, spread + 1) * spreadMult; + float vY = 8 * speedY + Main.rand.Next(-spread, spread + 1) * spreadMult; float angle = (float)Math.Atan(vY / vX); vector2 = new Vector2(position.X + 75f * (float)Math.Cos(angle), position.Y + 75f * (float)Math.Sin(angle)); - float mouseX = (float)Main.mouseX + Main.screenPosition.X; + float mouseX = Main.mouseX + Main.screenPosition.X; if (mouseX < player.position.X) { vector2 = new Vector2(position.X - 75f * (float)Math.Cos(angle), position.Y - 75f * (float)Math.Sin(angle)); diff --git a/Items/FrostbittenBall.cs b/Items/FrostbittenBall.cs index f8ab87ab..ae46fe1b 100644 --- a/Items/FrostbittenBall.cs +++ b/Items/FrostbittenBall.cs @@ -1,6 +1,5 @@ -using Terraria.ID; - using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/FrozenTurtleShield.cs b/Items/FrozenTurtleShield.cs index 35b91045..5d233cf7 100644 --- a/Items/FrozenTurtleShield.cs +++ b/Items/FrozenTurtleShield.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/FungusBreastplate.cs b/Items/FungusBreastplate.cs index 9d6ef169..f81175d4 100644 --- a/Items/FungusBreastplate.cs +++ b/Items/FungusBreastplate.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/FungusBroadsword.cs b/Items/FungusBroadsword.cs index c3493736..382ef454 100644 --- a/Items/FungusBroadsword.cs +++ b/Items/FungusBroadsword.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/FungusGreaves.cs b/Items/FungusGreaves.cs index bfa53219..2172fdd1 100644 --- a/Items/FungusGreaves.cs +++ b/Items/FungusGreaves.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/FungusHelmet.cs b/Items/FungusHelmet.cs index c1646df5..30b4638c 100644 --- a/Items/FungusHelmet.cs +++ b/Items/FungusHelmet.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Galaxon.cs b/Items/Galaxon.cs index b9b2094f..2059ed0d 100644 --- a/Items/Galaxon.cs +++ b/Items/Galaxon.cs @@ -1,8 +1,9 @@ -using Terraria.ID; using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { @@ -37,13 +38,13 @@ public override void SetStaticDefaults() } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) + public override void ModifyTooltips(List tooltips) { tooltips[0].overrideColor = new Color(238, 194, 73); } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { int i = Main.myPlayer; float num72 = item.shootSpeed; @@ -52,19 +53,19 @@ public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 po 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(player.fullRotation, default(Vector2)); 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; + float num78 = Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = Main.mouseY + Main.screenPosition.Y - vector2.Y; if (player.gravDir == -1f) { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + num79 = Main.screenPosition.Y + Main.screenHeight - Main.mouseY - vector2.Y; } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + float num80 = (float)Math.Sqrt(num78 * num78 + num79 * num79); float num81 = num80; if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) { - num78 = (float)player.direction; + num78 = player.direction; num79 = 0f; num80 = num72; } @@ -95,10 +96,10 @@ public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 po { float num148 = num78; float num149 = num79; - float num150 = 0.05f * (float)num147; - num148 += (float)Main.rand.Next(-35, 36) * num150; - num149 += (float)Main.rand.Next(-35, 36) * num150; - num80 = (float)Math.Sqrt((double)(num148 * num148 + num149 * num149)); + float num150 = 0.05f * num147; + num148 += Main.rand.Next(-35, 36) * num150; + num149 += Main.rand.Next(-35, 36) * num150; + num80 = (float)Math.Sqrt(num148 * num148 + num149 * num149); num80 = num72 / num80; num148 *= num80; num149 *= num80; diff --git a/Items/GehennaStaff.cs b/Items/GehennaStaff.cs index dc38da98..77c046a0 100644 --- a/Items/GehennaStaff.cs +++ b/Items/GehennaStaff.cs @@ -1,7 +1,8 @@ -using Terraria.ID; +using System.Collections.Generic; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { @@ -42,7 +43,7 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX return true; } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) + public override void ModifyTooltips(List tooltips) { tooltips[0].overrideColor = new Color(238, 194, 73); } diff --git a/Items/GenieLamp.cs b/Items/GenieLamp.cs index adc53afc..5c9475f2 100644 --- a/Items/GenieLamp.cs +++ b/Items/GenieLamp.cs @@ -1,5 +1,5 @@ -using Terraria.ID; -using Terraria; +using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/GhostlyHowl.cs b/Items/GhostlyHowl.cs index e52e1d47..a09881d6 100644 --- a/Items/GhostlyHowl.cs +++ b/Items/GhostlyHowl.cs @@ -1,7 +1,7 @@ -using Terraria.ID; using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items @@ -37,7 +37,7 @@ public override void SetStaticDefaults() - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { int i = Main.myPlayer; float num72 = item.shootSpeed; @@ -46,19 +46,19 @@ public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 po 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(player.fullRotation, default(Vector2)); 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; + float num78 = Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = Main.mouseY + Main.screenPosition.Y - vector2.Y; if (player.gravDir == -1f) { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + num79 = Main.screenPosition.Y + Main.screenHeight - Main.mouseY - vector2.Y; } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + float num80 = (float)Math.Sqrt(num78 * num78 + num79 * num79); float num81 = num80; if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) { - num78 = (float)player.direction; + num78 = player.direction; num79 = 0f; num80 = num72; } @@ -89,10 +89,10 @@ public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 po { float num148 = num78; float num149 = num79; - float num150 = 0.05f * (float)num147; - num148 += (float)Main.rand.Next(-35, 36) * num150; - num149 += (float)Main.rand.Next(-35, 36) * num150; - num80 = (float)Math.Sqrt((double)(num148 * num148 + num149 * num149)); + float num150 = 0.05f * num147; + num148 += Main.rand.Next(-35, 36) * num150; + num149 += Main.rand.Next(-35, 36) * num150; + num80 = (float)Math.Sqrt(num148 * num148 + num149 * num149); num80 = num72 / num80; num148 *= num80; num149 *= num80; diff --git a/Items/GlobalItems.cs b/Items/GlobalItems.cs index fcf527e5..209d939f 100644 --- a/Items/GlobalItems.cs +++ b/Items/GlobalItems.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/GlowingRod.cs b/Items/GlowingRod.cs index 70ab8a43..b83cc884 100644 --- a/Items/GlowingRod.cs +++ b/Items/GlowingRod.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/GoldFlask.cs b/Items/GoldFlask.cs index 0a7bc406..0e89fac1 100644 --- a/Items/GoldFlask.cs +++ b/Items/GoldFlask.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; namespace Tremor.Items { diff --git a/Items/GoldShield.cs b/Items/GoldShield.cs index c39b7e53..399775d1 100644 --- a/Items/GoldShield.cs +++ b/Items/GoldShield.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/GoldenCube.cs b/Items/GoldenCube.cs index 1d64ba79..88accc57 100644 --- a/Items/GoldenCube.cs +++ b/Items/GoldenCube.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/GoldenDust.cs b/Items/GoldenDust.cs index 3d91d0df..686eeb69 100644 --- a/Items/GoldenDust.cs +++ b/Items/GoldenDust.cs @@ -1,7 +1,7 @@ -using Terraria.ID; using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/GoldenMace.cs b/Items/GoldenMace.cs index 011d94d9..bac7bf08 100644 --- a/Items/GoldenMace.cs +++ b/Items/GoldenMace.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/GoldfishStaff.cs b/Items/GoldfishStaff.cs index 4982ecfd..75738d0b 100644 --- a/Items/GoldfishStaff.cs +++ b/Items/GoldfishStaff.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/GraniteHelmet.cs b/Items/GraniteHelmet.cs index 94c8bb97..36020012 100644 --- a/Items/GraniteHelmet.cs +++ b/Items/GraniteHelmet.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/GreenCrossguardPhasesaber.cs b/Items/GreenCrossguardPhasesaber.cs index b36071ee..583e24f7 100644 --- a/Items/GreenCrossguardPhasesaber.cs +++ b/Items/GreenCrossguardPhasesaber.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/GrossBow.cs b/Items/GrossBow.cs index de15de3d..6f90d534 100644 --- a/Items/GrossBow.cs +++ b/Items/GrossBow.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/GuardianHammer.cs b/Items/GuardianHammer.cs index eb55ef5a..d9a5c98e 100644 --- a/Items/GuardianHammer.cs +++ b/Items/GuardianHammer.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/GunslingerFocus.cs b/Items/GunslingerFocus.cs index f61a77c7..e43c96c5 100644 --- a/Items/GunslingerFocus.cs +++ b/Items/GunslingerFocus.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Terraria; using Terraria.DataStructures; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/GunslingerSoul.cs b/Items/GunslingerSoul.cs index 20b0e079..2c68b609 100644 --- a/Items/GunslingerSoul.cs +++ b/Items/GunslingerSoul.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Terraria; using Terraria.DataStructures; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Gurumaster.cs b/Items/Gurumaster.cs index d9dcabb7..b8cb381c 100644 --- a/Items/Gurumaster.cs +++ b/Items/Gurumaster.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Microsoft.Xna.Framework; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/HadesBreastplate.cs b/Items/HadesBreastplate.cs index f5133af9..cf4e111b 100644 --- a/Items/HadesBreastplate.cs +++ b/Items/HadesBreastplate.cs @@ -1,7 +1,8 @@ -using Terraria.ID; +using System.Collections.Generic; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { @@ -40,7 +41,7 @@ public override void AddRecipes() recipe.AddRecipe(); } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) + public override void ModifyTooltips(List tooltips) { tooltips[0].overrideColor = new Color(238, 194, 73); } diff --git a/Items/HadesGreaves.cs b/Items/HadesGreaves.cs index b453e38d..ec6da264 100644 --- a/Items/HadesGreaves.cs +++ b/Items/HadesGreaves.cs @@ -1,7 +1,8 @@ -using Terraria.ID; +using System.Collections.Generic; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { @@ -41,7 +42,7 @@ public override void AddRecipes() recipe.AddRecipe(); } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) + public override void ModifyTooltips(List tooltips) { tooltips[0].overrideColor = new Color(238, 194, 73); } diff --git a/Items/HadesHelmet.cs b/Items/HadesHelmet.cs index be503388..0c5a8310 100644 --- a/Items/HadesHelmet.cs +++ b/Items/HadesHelmet.cs @@ -1,8 +1,9 @@ -using Terraria.ID; using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { @@ -39,7 +40,7 @@ public override void AddRecipes() recipe.AddRecipe(); } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) + public override void ModifyTooltips(List tooltips) { tooltips[0].overrideColor = new Color(238, 194, 73); } diff --git a/Items/HallowedHat.cs b/Items/HallowedHat.cs index 7bf1a9cc..080d0480 100644 --- a/Items/HallowedHat.cs +++ b/Items/HallowedHat.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/HallowedHeader.cs b/Items/HallowedHeader.cs index bd606fab..3073d456 100644 --- a/Items/HallowedHeader.cs +++ b/Items/HallowedHeader.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/HallowedVisage.cs b/Items/HallowedVisage.cs index d3d3db8f..35af1a23 100644 --- a/Items/HallowedVisage.cs +++ b/Items/HallowedVisage.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/HarpyChestplate.cs b/Items/HarpyChestplate.cs index f7abbe02..c1dee5ba 100644 --- a/Items/HarpyChestplate.cs +++ b/Items/HarpyChestplate.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/HarpyHelmet.cs b/Items/HarpyHelmet.cs index e2a8e822..6422300f 100644 --- a/Items/HarpyHelmet.cs +++ b/Items/HarpyHelmet.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/HarpyHood.cs b/Items/HarpyHood.cs index 58e05568..d49f6746 100644 --- a/Items/HarpyHood.cs +++ b/Items/HarpyHood.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/HarpyLeggings.cs b/Items/HarpyLeggings.cs index deda9561..171faad9 100644 --- a/Items/HarpyLeggings.cs +++ b/Items/HarpyLeggings.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/HarpyMask.cs b/Items/HarpyMask.cs index 03d445b4..2464264d 100644 --- a/Items/HarpyMask.cs +++ b/Items/HarpyMask.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/HarvesterScythe.cs b/Items/HarvesterScythe.cs index e5763c1d..903326b0 100644 --- a/Items/HarvesterScythe.cs +++ b/Items/HarvesterScythe.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/HealthBooster.cs b/Items/HealthBooster.cs index f89e8dcc..ffdef0e6 100644 --- a/Items/HealthBooster.cs +++ b/Items/HealthBooster.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/HealthSupportFlask.cs b/Items/HealthSupportFlask.cs index c3fabbfe..654c8f20 100644 --- a/Items/HealthSupportFlask.cs +++ b/Items/HealthSupportFlask.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/HeatCore.cs b/Items/HeatCore.cs index 740ca7b2..823203b5 100644 --- a/Items/HeatCore.cs +++ b/Items/HeatCore.cs @@ -1,7 +1,7 @@ -using Terraria.ID; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { @@ -71,8 +71,8 @@ void Shoot(int Target, int Damage) Vector2 velocity = Helper.VelocityToPoint(Main.player[item.owner].Center, Main.npc[Target].Center, ShootSpeed); for (int l = 0; l < ShootCount; l++) { - velocity.X = velocity.X + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - velocity.Y = velocity.Y + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.X = velocity.X + Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.Y = velocity.Y + Main.rand.Next(-spread, spread + 1) * spreadMult; int i = Projectile.NewProjectile(Main.player[item.owner].Center.X, Main.player[item.owner].Center.Y, velocity.X, velocity.Y, ShootType, Damage, ShootKN, item.owner); } } diff --git a/Items/HeavyBeamCannon.cs b/Items/HeavyBeamCannon.cs index d8f79821..65a691ca 100644 --- a/Items/HeavyBeamCannon.cs +++ b/Items/HeavyBeamCannon.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/HellStorm.cs b/Items/HellStorm.cs index 9cdbc224..f99842af 100644 --- a/Items/HellStorm.cs +++ b/Items/HellStorm.cs @@ -1,7 +1,8 @@ -using Terraria.ID; +using System.Collections.Generic; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { @@ -38,7 +39,7 @@ public override void SetStaticDefaults() } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) + public override void ModifyTooltips(List tooltips) { tooltips[0].overrideColor = new Color(238, 194, 73); } diff --git a/Items/HeroPotion.cs b/Items/HeroPotion.cs index 9d51f12d..519c06f1 100644 --- a/Items/HeroPotion.cs +++ b/Items/HeroPotion.cs @@ -1,7 +1,8 @@ -using Terraria.ID; +using System.Collections.Generic; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { @@ -34,7 +35,7 @@ public override bool UseItem(Player player) return true; } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) + public override void ModifyTooltips(List tooltips) { tooltips[0].overrideColor = new Color(238, 194, 73); } diff --git a/Items/HeroShield.cs b/Items/HeroShield.cs index e161a660..02816b82 100644 --- a/Items/HeroShield.cs +++ b/Items/HeroShield.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/HolyDust.cs b/Items/HolyDust.cs index d90c42a6..a8534919 100644 --- a/Items/HolyDust.cs +++ b/Items/HolyDust.cs @@ -1,7 +1,7 @@ -using Terraria.ID; using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/HolyShield.cs b/Items/HolyShield.cs index a56ecc13..8c4d128c 100644 --- a/Items/HolyShield.cs +++ b/Items/HolyShield.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/HonestBlade.cs b/Items/HonestBlade.cs index 6107b79c..96fd190c 100644 --- a/Items/HonestBlade.cs +++ b/Items/HonestBlade.cs @@ -1,6 +1,7 @@ -using Terraria.ID; -using Terraria; +using System.Collections.Generic; using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items @@ -31,7 +32,7 @@ public override void SetStaticDefaults() } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) + public override void ModifyTooltips(List tooltips) { tooltips[0].overrideColor = new Color(238, 194, 73); } diff --git a/Items/HornedWarHammer.cs b/Items/HornedWarHammer.cs index 5db03bc1..b5d91ec0 100644 --- a/Items/HornedWarHammer.cs +++ b/Items/HornedWarHammer.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/HungryStaff.cs b/Items/HungryStaff.cs index 8d05a18d..e1e36be1 100644 --- a/Items/HungryStaff.cs +++ b/Items/HungryStaff.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/HuskofDusk.cs b/Items/HuskofDusk.cs index ccac9bae..c2259859 100644 --- a/Items/HuskofDusk.cs +++ b/Items/HuskofDusk.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Microsoft.Xna.Framework; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/IceDrill.cs b/Items/IceDrill.cs index 4e717706..96db67bd 100644 --- a/Items/IceDrill.cs +++ b/Items/IceDrill.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/IceSoul.cs b/Items/IceSoul.cs index 0ae227cb..24085aec 100644 --- a/Items/IceSoul.cs +++ b/Items/IceSoul.cs @@ -1,7 +1,7 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/IchorKnife.cs b/Items/IchorKnife.cs index f8d4c60e..bafae1b3 100644 --- a/Items/IchorKnife.cs +++ b/Items/IchorKnife.cs @@ -1,6 +1,6 @@ -using Terraria.ID; -using Terraria; using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Igniter.cs b/Items/Igniter.cs index 06ad6f36..207428da 100644 --- a/Items/Igniter.cs +++ b/Items/Igniter.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Incinerator.cs b/Items/Incinerator.cs index 3d66785c..0db1a154 100644 --- a/Items/Incinerator.cs +++ b/Items/Incinerator.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Infector.cs b/Items/Infector.cs index e79a66e5..43230225 100644 --- a/Items/Infector.cs +++ b/Items/Infector.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/InfernalShield.cs b/Items/InfernalShield.cs index 43b966f3..dbd4ebe3 100644 --- a/Items/InfernalShield.cs +++ b/Items/InfernalShield.cs @@ -73,8 +73,8 @@ void Shoot(int Target, int Damage) Vector2 velocity = Helper.VelocityToPoint(Main.player[item.owner].Center, Main.npc[Target].Center, ShootSpeed); for (int l = 0; l < ShootCount; l++) { - velocity.X = velocity.X + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - velocity.Y = velocity.Y + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.X = velocity.X + Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.Y = velocity.Y + Main.rand.Next(-spread, spread + 1) * spreadMult; int i = Projectile.NewProjectile(Main.player[item.owner].Center.X, Main.player[item.owner].Center.Y, velocity.X, velocity.Y, ShootType, Damage, ShootKN, item.owner); } } diff --git a/Items/Infernality.cs b/Items/Infernality.cs index 19e78317..c54468e2 100644 --- a/Items/Infernality.cs +++ b/Items/Infernality.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Inferno.cs b/Items/Inferno.cs index e39b75c5..90bfe3c6 100644 --- a/Items/Inferno.cs +++ b/Items/Inferno.cs @@ -1,6 +1,7 @@ +using System.Collections.Generic; +using Microsoft.Xna.Framework; using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { @@ -33,7 +34,7 @@ public override void SetStaticDefaults() } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) + public override void ModifyTooltips(List tooltips) { tooltips[0].overrideColor = new Color(238, 194, 73); } diff --git a/Items/InfernoSkull.cs b/Items/InfernoSkull.cs index c7822f13..e98e0bc1 100644 --- a/Items/InfernoSkull.cs +++ b/Items/InfernoSkull.cs @@ -1,7 +1,8 @@ -using Terraria.ID; +using System.Collections.Generic; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { @@ -30,7 +31,7 @@ public override void SetStaticDefaults() } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) + public override void ModifyTooltips(List tooltips) { tooltips[0].overrideColor = new Color(238, 194, 73); } diff --git a/Items/InfernoSoul.cs b/Items/InfernoSoul.cs index b8eb9358..eda77c15 100644 --- a/Items/InfernoSoul.cs +++ b/Items/InfernoSoul.cs @@ -1,6 +1,7 @@ +using System.Collections.Generic; +using Microsoft.Xna.Framework; using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { @@ -25,7 +26,7 @@ public override void SetStaticDefaults() } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) + public override void ModifyTooltips(List tooltips) { tooltips[0].overrideColor = new Color(238, 194, 73); } diff --git a/Items/InspirationPotion.cs b/Items/InspirationPotion.cs index bd0cda65..3125b546 100644 --- a/Items/InspirationPotion.cs +++ b/Items/InspirationPotion.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/InvaderStaff.cs b/Items/InvaderStaff.cs index af6fd9bf..3047695f 100644 --- a/Items/InvaderStaff.cs +++ b/Items/InvaderStaff.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/IronShield.cs b/Items/IronShield.cs index 0dfd8588..0c4cfbd3 100644 --- a/Items/IronShield.cs +++ b/Items/IronShield.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/JellyfishStaff.cs b/Items/JellyfishStaff.cs index d0214277..fffc5e81 100644 --- a/Items/JellyfishStaff.cs +++ b/Items/JellyfishStaff.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Jellyxir.cs b/Items/Jellyxir.cs index 38a9626e..975553cb 100644 --- a/Items/Jellyxir.cs +++ b/Items/Jellyxir.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/JungleWrath.cs b/Items/JungleWrath.cs index ed25be88..10933c82 100644 --- a/Items/JungleWrath.cs +++ b/Items/JungleWrath.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/LasCannon.cs b/Items/LasCannon.cs index da58bcae..731a2955 100644 --- a/Items/LasCannon.cs +++ b/Items/LasCannon.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/LeadShield.cs b/Items/LeadShield.cs index c15467d5..d6e18a88 100644 --- a/Items/LeadShield.cs +++ b/Items/LeadShield.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/LeafBall.cs b/Items/LeafBall.cs index 02aabc11..dec534f4 100644 --- a/Items/LeafBall.cs +++ b/Items/LeafBall.cs @@ -1,6 +1,5 @@ -using Terraria.ID; - using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/LesserHealingFlack.cs b/Items/LesserHealingFlack.cs index 5f7de459..6fa193f0 100644 --- a/Items/LesserHealingFlack.cs +++ b/Items/LesserHealingFlack.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/LesserManaFlask.cs b/Items/LesserManaFlask.cs index 66966fef..344013a3 100644 --- a/Items/LesserManaFlask.cs +++ b/Items/LesserManaFlask.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/LesserPoisonFlask.cs b/Items/LesserPoisonFlask.cs index af52408a..d8b9c7d6 100644 --- a/Items/LesserPoisonFlask.cs +++ b/Items/LesserPoisonFlask.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/LesserVenomFlask.cs b/Items/LesserVenomFlask.cs index 178068ec..8a7c24cc 100644 --- a/Items/LesserVenomFlask.cs +++ b/Items/LesserVenomFlask.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/LightningOrb.cs b/Items/LightningOrb.cs index 0e2fc416..c5e5102e 100644 --- a/Items/LightningOrb.cs +++ b/Items/LightningOrb.cs @@ -1,7 +1,7 @@ -using Terraria.ID; -using Terraria.ModLoader; +using Microsoft.Xna.Framework; using Terraria; -using Microsoft.Xna.Framework; +using Terraria.ID; +using Terraria.ModLoader; namespace Tremor.Items { diff --git a/Items/LightningStaff.cs b/Items/LightningStaff.cs index bb060f9a..19c7c4ef 100644 --- a/Items/LightningStaff.cs +++ b/Items/LightningStaff.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/LinearBurst.cs b/Items/LinearBurst.cs index 0a855ad6..625bbd04 100644 --- a/Items/LinearBurst.cs +++ b/Items/LinearBurst.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items @@ -11,7 +11,7 @@ public override bool CanEquipAccessory(Player player, int slot) for (int i = 0; i < player.armor.Length; i++) { MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - if (modPlayer.nitro == true) + if (modPlayer.nitro) { return false; } diff --git a/Items/LivingTombstone.cs b/Items/LivingTombstone.cs index 68c472db..d27db4d4 100644 --- a/Items/LivingTombstone.cs +++ b/Items/LivingTombstone.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/LivingWoodBreastplate.cs b/Items/LivingWoodBreastplate.cs index be59dbdb..ee81f6d5 100644 --- a/Items/LivingWoodBreastplate.cs +++ b/Items/LivingWoodBreastplate.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/LivingWoodGreaves.cs b/Items/LivingWoodGreaves.cs index 7eb11006..7738be8a 100644 --- a/Items/LivingWoodGreaves.cs +++ b/Items/LivingWoodGreaves.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/LivingWoodMask.cs b/Items/LivingWoodMask.cs index 442f9c41..d77d5ec1 100644 --- a/Items/LivingWoodMask.cs +++ b/Items/LivingWoodMask.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/LivingWoodThreepeater.cs b/Items/LivingWoodThreepeater.cs index 449fe9c9..ac9d93b0 100644 --- a/Items/LivingWoodThreepeater.cs +++ b/Items/LivingWoodThreepeater.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/M29.cs b/Items/M29.cs index 8d5d740b..523ddf15 100644 --- a/Items/M29.cs +++ b/Items/M29.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/MagicalGreaves.cs b/Items/MagicalGreaves.cs index d8498a9c..593bbb1a 100644 --- a/Items/MagicalGreaves.cs +++ b/Items/MagicalGreaves.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/MagicalHat.cs b/Items/MagicalHat.cs index 91c7e56d..825b3dac 100644 --- a/Items/MagicalHat.cs +++ b/Items/MagicalHat.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/MagicalRobe.cs b/Items/MagicalRobe.cs index e8c0e368..46c6ed0c 100644 --- a/Items/MagicalRobe.cs +++ b/Items/MagicalRobe.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/MagiumRod.cs b/Items/MagiumRod.cs index e4efe075..96f191f8 100644 --- a/Items/MagiumRod.cs +++ b/Items/MagiumRod.cs @@ -38,7 +38,7 @@ public override void SetStaticDefaults() - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { int i = Main.myPlayer; float num72 = item.shootSpeed; @@ -47,19 +47,19 @@ public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 po 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(player.fullRotation, default(Vector2)); 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; + float num78 = Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = Main.mouseY + Main.screenPosition.Y - vector2.Y; if (player.gravDir == -1f) { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + num79 = Main.screenPosition.Y + Main.screenHeight - Main.mouseY - vector2.Y; } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + float num80 = (float)Math.Sqrt(num78 * num78 + num79 * num79); float num81 = num80; if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) { - num78 = (float)player.direction; + num78 = player.direction; num79 = 0f; num80 = num72; } @@ -90,10 +90,10 @@ public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 po { float num148 = num78; float num149 = num79; - float num150 = 0.05f * (float)num147; - num148 += (float)Main.rand.Next(-35, 36) * num150; - num149 += (float)Main.rand.Next(-35, 36) * num150; - num80 = (float)Math.Sqrt((double)(num148 * num148 + num149 * num149)); + float num150 = 0.05f * num147; + num148 += Main.rand.Next(-35, 36) * num150; + num149 += Main.rand.Next(-35, 36) * num150; + num80 = (float)Math.Sqrt(num148 * num148 + num149 * num149); num80 = num72 / num80; num148 *= num80; num149 *= num80; diff --git a/Items/MagmoniumHelmet.cs b/Items/MagmoniumHelmet.cs index 7fcf9dc9..a27c53c0 100644 --- a/Items/MagmoniumHelmet.cs +++ b/Items/MagmoniumHelmet.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/MagmoniumWings.cs b/Items/MagmoniumWings.cs index a1361779..bcdab24f 100644 --- a/Items/MagmoniumWings.cs +++ b/Items/MagmoniumWings.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/ManaBooster.cs b/Items/ManaBooster.cs index 16ed488b..fe286095 100644 --- a/Items/ManaBooster.cs +++ b/Items/ManaBooster.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/ManaSupportFlask.cs b/Items/ManaSupportFlask.cs index 3e43890a..8c08b926 100644 --- a/Items/ManaSupportFlask.cs +++ b/Items/ManaSupportFlask.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/ManiacChainsaw.cs b/Items/ManiacChainsaw.cs index e0913aec..9d71c727 100644 --- a/Items/ManiacChainsaw.cs +++ b/Items/ManiacChainsaw.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/MarbleBreastplate.cs b/Items/MarbleBreastplate.cs index 3d9bb354..d7d20361 100644 --- a/Items/MarbleBreastplate.cs +++ b/Items/MarbleBreastplate.cs @@ -1,5 +1,5 @@ -using Terraria.ID; -using Terraria; +using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/MarbleHelmet.cs b/Items/MarbleHelmet.cs index 3ce2acb2..0e212cdf 100644 --- a/Items/MarbleHelmet.cs +++ b/Items/MarbleHelmet.cs @@ -1,5 +1,5 @@ -using Terraria.ID; -using Terraria; +using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/MarbleLeggings.cs b/Items/MarbleLeggings.cs index 7f0a0253..66105f82 100644 --- a/Items/MarbleLeggings.cs +++ b/Items/MarbleLeggings.cs @@ -1,5 +1,5 @@ -using Terraria.ID; -using Terraria; +using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/MartianCommunicator.cs b/Items/MartianCommunicator.cs index 342fbdc9..5b55f59f 100644 --- a/Items/MartianCommunicator.cs +++ b/Items/MartianCommunicator.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/MartianSprayer.cs b/Items/MartianSprayer.cs index 712d2c70..74391571 100644 --- a/Items/MartianSprayer.cs +++ b/Items/MartianSprayer.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; namespace Tremor.Items { @@ -77,7 +77,7 @@ public override void UpdateInventory(Player player) } } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { MPlayer modPlayer = player.GetModPlayer(mod); if (modPlayer.glove) diff --git a/Items/MeatShield.cs b/Items/MeatShield.cs index 3d651d69..c5aa0a20 100644 --- a/Items/MeatShield.cs +++ b/Items/MeatShield.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/MechaSprayer.cs b/Items/MechaSprayer.cs index f9d857a8..4313195c 100644 --- a/Items/MechaSprayer.cs +++ b/Items/MechaSprayer.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; namespace Tremor.Items { @@ -77,7 +77,7 @@ public override void UpdateInventory(Player player) } } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { MPlayer modPlayer = player.GetModPlayer(mod); if (modPlayer.glove) diff --git a/Items/MechanicalBrain.cs b/Items/MechanicalBrain.cs index f7cff065..a715a760 100644 --- a/Items/MechanicalBrain.cs +++ b/Items/MechanicalBrain.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Megalodon.cs b/Items/Megalodon.cs index 10889fbc..462f591b 100644 --- a/Items/Megalodon.cs +++ b/Items/Megalodon.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Megavolt.cs b/Items/Megavolt.cs index 75eb5698..8f52b08a 100644 --- a/Items/Megavolt.cs +++ b/Items/Megavolt.cs @@ -1,7 +1,7 @@ -using Terraria.ID; using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items @@ -37,7 +37,7 @@ public override void SetStaticDefaults() - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { int i = Main.myPlayer; float num72 = item.shootSpeed; @@ -46,19 +46,19 @@ public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 po 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(player.fullRotation, default(Vector2)); 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; + float num78 = Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = Main.mouseY + Main.screenPosition.Y - vector2.Y; if (player.gravDir == -1f) { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + num79 = Main.screenPosition.Y + Main.screenHeight - Main.mouseY - vector2.Y; } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + float num80 = (float)Math.Sqrt(num78 * num78 + num79 * num79); float num81 = num80; if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) { - num78 = (float)player.direction; + num78 = player.direction; num79 = 0f; num80 = num72; } @@ -89,10 +89,10 @@ public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 po { float num148 = num78; float num149 = num79; - float num150 = 0.05f * (float)num147; - num148 += (float)Main.rand.Next(-35, 36) * num150; - num149 += (float)Main.rand.Next(-35, 36) * num150; - num80 = (float)Math.Sqrt((double)(num148 * num148 + num149 * num149)); + float num150 = 0.05f * num147; + num148 += Main.rand.Next(-35, 36) * num150; + num149 += Main.rand.Next(-35, 36) * num150; + num80 = (float)Math.Sqrt(num148 * num148 + num149 * num149); num80 = num72 / num80; num148 *= num80; num149 *= num80; diff --git a/Items/MeteorBlade.cs b/Items/MeteorBlade.cs index b035a184..15f9c05e 100644 --- a/Items/MeteorBlade.cs +++ b/Items/MeteorBlade.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/MeteorScepter.cs b/Items/MeteorScepter.cs index 0a2bf933..6bac0ef6 100644 --- a/Items/MeteorScepter.cs +++ b/Items/MeteorScepter.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/MoltenHeart.cs b/Items/MoltenHeart.cs index a5a206f6..c9974933 100644 --- a/Items/MoltenHeart.cs +++ b/Items/MoltenHeart.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/MoltenLance.cs b/Items/MoltenLance.cs index ce3139ea..bbcd8120 100644 --- a/Items/MoltenLance.cs +++ b/Items/MoltenLance.cs @@ -1,6 +1,6 @@ -using Terraria.ID; -using Terraria; using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/MoltenStaff.cs b/Items/MoltenStaff.cs index c6ef93b1..aee3ce14 100644 --- a/Items/MoltenStaff.cs +++ b/Items/MoltenStaff.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/MoonDustFlask.cs b/Items/MoonDustFlask.cs index 10b8cfa7..5a720522 100644 --- a/Items/MoonDustFlask.cs +++ b/Items/MoonDustFlask.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/MoonFlash.cs b/Items/MoonFlash.cs index 01c28c05..1837c273 100644 --- a/Items/MoonFlash.cs +++ b/Items/MoonFlash.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/MoonLash.cs b/Items/MoonLash.cs index d8dd6252..15ed5dca 100644 --- a/Items/MoonLash.cs +++ b/Items/MoonLash.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Motherboard.cs b/Items/Motherboard.cs index 8f6f4323..8ea8b434 100644 --- a/Items/Motherboard.cs +++ b/Items/Motherboard.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/MultidimensionalFragment.cs b/Items/MultidimensionalFragment.cs index 309c8a31..629e0741 100644 --- a/Items/MultidimensionalFragment.cs +++ b/Items/MultidimensionalFragment.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Terraria; using Terraria.DataStructures; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/MushroomCrystal.cs b/Items/MushroomCrystal.cs index 1d7e5ac5..583448cb 100644 --- a/Items/MushroomCrystal.cs +++ b/Items/MushroomCrystal.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/MysteriousDrum.cs b/Items/MysteriousDrum.cs index 9a30ae5a..13bbd10c 100644 --- a/Items/MysteriousDrum.cs +++ b/Items/MysteriousDrum.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/MythrilDisc.cs b/Items/MythrilDisc.cs index f007542a..d49b6ef8 100644 --- a/Items/MythrilDisc.cs +++ b/Items/MythrilDisc.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/MythrilHeader.cs b/Items/MythrilHeader.cs index 9c76f857..4a23f19c 100644 --- a/Items/MythrilHeader.cs +++ b/Items/MythrilHeader.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/MythrilMask.cs b/Items/MythrilMask.cs index 0b854054..64b04d2f 100644 --- a/Items/MythrilMask.cs +++ b/Items/MythrilMask.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/MythrilRifle.cs b/Items/MythrilRifle.cs index ce8a24fd..daaed7ca 100644 --- a/Items/MythrilRifle.cs +++ b/Items/MythrilRifle.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Microsoft.Xna.Framework; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/MythrilStaff.cs b/Items/MythrilStaff.cs index 497594b1..b2bc8882 100644 --- a/Items/MythrilStaff.cs +++ b/Items/MythrilStaff.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/MythrilVisage.cs b/Items/MythrilVisage.cs index d8ae2fa8..a747c17d 100644 --- a/Items/MythrilVisage.cs +++ b/Items/MythrilVisage.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/NanoBlade.cs b/Items/NanoBlade.cs index 325a232f..1c86e158 100644 --- a/Items/NanoBlade.cs +++ b/Items/NanoBlade.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/NanoDrill.cs b/Items/NanoDrill.cs index ba93760e..9e605a7d 100644 --- a/Items/NanoDrill.cs +++ b/Items/NanoDrill.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/NanoHelmet.cs b/Items/NanoHelmet.cs index 58bc6ae7..fab21b82 100644 --- a/Items/NanoHelmet.cs +++ b/Items/NanoHelmet.cs @@ -1,7 +1,7 @@ using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { diff --git a/Items/NanoJackhammer.cs b/Items/NanoJackhammer.cs index 4e00720b..f62ff855 100644 --- a/Items/NanoJackhammer.cs +++ b/Items/NanoJackhammer.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/NanoSaw.cs b/Items/NanoSaw.cs index d39bd26b..73bd669e 100644 --- a/Items/NanoSaw.cs +++ b/Items/NanoSaw.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Narsil.cs b/Items/Narsil.cs index ffb2d447..73ff0554 100644 --- a/Items/Narsil.cs +++ b/Items/Narsil.cs @@ -1,6 +1,6 @@ -using Terraria.ID; -using Terraria; using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/NebulaBand.cs b/Items/NebulaBand.cs index 15c58450..070632d5 100644 --- a/Items/NebulaBand.cs +++ b/Items/NebulaBand.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/NecromancerArmor.cs b/Items/NecromancerArmor.cs index a94446dd..6fc99126 100644 --- a/Items/NecromancerArmor.cs +++ b/Items/NecromancerArmor.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/NecromancerBelt.cs b/Items/NecromancerBelt.cs index dd8eeeaf..f0541e08 100644 --- a/Items/NecromancerBelt.cs +++ b/Items/NecromancerBelt.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/NecromancerClaymore.cs b/Items/NecromancerClaymore.cs index 11ee9a50..2e62940f 100644 --- a/Items/NecromancerClaymore.cs +++ b/Items/NecromancerClaymore.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Necronomicon.cs b/Items/Necronomicon.cs index 9d7b48ca..1b46d369 100644 --- a/Items/Necronomicon.cs +++ b/Items/Necronomicon.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/NightCore.cs b/Items/NightCore.cs index b6e8b65d..03b4f59e 100644 --- a/Items/NightCore.cs +++ b/Items/NightCore.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Microsoft.Xna.Framework; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/NightDusk.cs b/Items/NightDusk.cs index c852c686..0b015012 100644 --- a/Items/NightDusk.cs +++ b/Items/NightDusk.cs @@ -1,9 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.Items { public class NightDusk : ModItem diff --git a/Items/NightFury.cs b/Items/NightFury.cs index ceb38273..ed36ec76 100644 --- a/Items/NightFury.cs +++ b/Items/NightFury.cs @@ -1,6 +1,5 @@ -using Terraria.ID; - using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/NightingaleHood.cs b/Items/NightingaleHood.cs index a346400b..eea4b0d9 100644 --- a/Items/NightingaleHood.cs +++ b/Items/NightingaleHood.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/NightmareSprayer.cs b/Items/NightmareSprayer.cs index 47a3a5a0..15cd1f7b 100644 --- a/Items/NightmareSprayer.cs +++ b/Items/NightmareSprayer.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items @@ -93,7 +93,7 @@ public override void UpdateInventory(Player player) } } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { MPlayer modPlayer = player.GetModPlayer(mod); if (modPlayer.glove) diff --git a/Items/Nitro.cs b/Items/Nitro.cs index 43583fd7..8cfa9429 100644 --- a/Items/Nitro.cs +++ b/Items/Nitro.cs @@ -10,7 +10,7 @@ public override bool CanEquipAccessory(Player player, int slot) for (int i = 0; i < player.armor.Length; i++) { MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - if (modPlayer.nitro == true) + if (modPlayer.nitro) { return false; } diff --git a/Items/NorthStaff.cs b/Items/NorthStaff.cs index 61560d69..c7d9d3a8 100644 --- a/Items/NorthStaff.cs +++ b/Items/NorthStaff.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/NovaBand.cs b/Items/NovaBand.cs index c655ad4d..7ae854e4 100644 --- a/Items/NovaBand.cs +++ b/Items/NovaBand.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/NuclearStar.cs b/Items/NuclearStar.cs index 305243ff..a282fb8e 100644 --- a/Items/NuclearStar.cs +++ b/Items/NuclearStar.cs @@ -1,7 +1,7 @@ -using Terraria.ID; using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items @@ -19,8 +19,8 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX for (i = 0; i < 4; i++) { offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; - Terraria.Projectile.NewProjectile(position.X, position.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), item.shoot, damage, knockBack, item.owner); - Terraria.Projectile.NewProjectile(position.X, position.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), item.shoot, damage, knockBack, item.owner); + Projectile.NewProjectile(position.X, position.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), item.shoot, damage, knockBack, item.owner); + Projectile.NewProjectile(position.X, position.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), item.shoot, damage, knockBack, item.owner); } return false; } diff --git a/Items/Obscuritron.cs b/Items/Obscuritron.cs index a9a9c92f..0eef4580 100644 --- a/Items/Obscuritron.cs +++ b/Items/Obscuritron.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/ObsidianHeart.cs b/Items/ObsidianHeart.cs index 175f48d6..40ca82ef 100644 --- a/Items/ObsidianHeart.cs +++ b/Items/ObsidianHeart.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/ObsidianSaber.cs b/Items/ObsidianSaber.cs index a0fcbdf3..e6f40470 100644 --- a/Items/ObsidianSaber.cs +++ b/Items/ObsidianSaber.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/OceanBate.cs b/Items/OceanBate.cs index d49ec783..399ea72f 100644 --- a/Items/OceanBate.cs +++ b/Items/OceanBate.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/OmnikronBar.cs b/Items/OmnikronBar.cs index 66ede0a0..ed7e4dd4 100644 --- a/Items/OmnikronBar.cs +++ b/Items/OmnikronBar.cs @@ -1,7 +1,8 @@ -using Terraria; -using Terraria.ModLoader; +using System.Collections.Generic; using Microsoft.Xna.Framework; +using Terraria; using Terraria.DataStructures; +using Terraria.ModLoader; namespace Tremor.Items { @@ -25,7 +26,7 @@ public override void SetStaticDefaults() } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) + public override void ModifyTooltips(List tooltips) { tooltips[0].overrideColor = new Color(238, 194, 73); } diff --git a/Items/OmnikronBreastplate.cs b/Items/OmnikronBreastplate.cs index 421bc4c3..e9938495 100644 --- a/Items/OmnikronBreastplate.cs +++ b/Items/OmnikronBreastplate.cs @@ -1,6 +1,7 @@ +using System.Collections.Generic; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { @@ -25,7 +26,7 @@ public override void SetStaticDefaults() } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) + public override void ModifyTooltips(List tooltips) { tooltips[0].overrideColor = new Color(238, 194, 73); } diff --git a/Items/OmnikronGreaves.cs b/Items/OmnikronGreaves.cs index 2c769936..08920049 100644 --- a/Items/OmnikronGreaves.cs +++ b/Items/OmnikronGreaves.cs @@ -1,6 +1,7 @@ +using System.Collections.Generic; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { @@ -28,7 +29,7 @@ public override void SetStaticDefaults() } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) + public override void ModifyTooltips(List tooltips) { tooltips[0].overrideColor = new Color(238, 194, 73); } diff --git a/Items/OmnikronHeadgear.cs b/Items/OmnikronHeadgear.cs index 96e820c4..5c208d9e 100644 --- a/Items/OmnikronHeadgear.cs +++ b/Items/OmnikronHeadgear.cs @@ -1,7 +1,8 @@ using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { @@ -28,7 +29,7 @@ public override void SetStaticDefaults() } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) + public override void ModifyTooltips(List tooltips) { tooltips[0].overrideColor = new Color(238, 194, 73); } diff --git a/Items/OmnikronHelmet.cs b/Items/OmnikronHelmet.cs index 3f5b5355..7af29983 100644 --- a/Items/OmnikronHelmet.cs +++ b/Items/OmnikronHelmet.cs @@ -1,7 +1,8 @@ using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { @@ -28,7 +29,7 @@ public override void SetStaticDefaults() } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) + public override void ModifyTooltips(List tooltips) { tooltips[0].overrideColor = new Color(238, 194, 73); } diff --git a/Items/OmnikronMask.cs b/Items/OmnikronMask.cs index 75fe5b63..61b2f1d0 100644 --- a/Items/OmnikronMask.cs +++ b/Items/OmnikronMask.cs @@ -1,7 +1,9 @@ using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; -using Microsoft.Xna.Framework; + namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] @@ -27,7 +29,7 @@ public override void SetStaticDefaults() } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) + public override void ModifyTooltips(List tooltips) { tooltips[0].overrideColor = new Color(238, 194, 73); } diff --git a/Items/Opal.cs b/Items/Opal.cs index de6c4cce..8c360568 100644 --- a/Items/Opal.cs +++ b/Items/Opal.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Terraria; using Terraria.DataStructures; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/OrichalcumDisc.cs b/Items/OrichalcumDisc.cs index 513fe8be..04690259 100644 --- a/Items/OrichalcumDisc.cs +++ b/Items/OrichalcumDisc.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/OrichalcumHeader.cs b/Items/OrichalcumHeader.cs index 6f69d1eb..5a655fdd 100644 --- a/Items/OrichalcumHeader.cs +++ b/Items/OrichalcumHeader.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/OrichalcumHeadgear.cs b/Items/OrichalcumHeadgear.cs index 2434c2c0..2f8e761f 100644 --- a/Items/OrichalcumHeadgear.cs +++ b/Items/OrichalcumHeadgear.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/OrichalcumRifle.cs b/Items/OrichalcumRifle.cs index f713e7d5..5077b771 100644 --- a/Items/OrichalcumRifle.cs +++ b/Items/OrichalcumRifle.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Microsoft.Xna.Framework; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/OrichalcumStaff.cs b/Items/OrichalcumStaff.cs index ddfd0f22..fabb81f2 100644 --- a/Items/OrichalcumStaff.cs +++ b/Items/OrichalcumStaff.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/OrichalcumVisage.cs b/Items/OrichalcumVisage.cs index 185950f1..5d44f20a 100644 --- a/Items/OrichalcumVisage.cs +++ b/Items/OrichalcumVisage.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/PainWheel.cs b/Items/PainWheel.cs index 9ca11169..4b0ec373 100644 --- a/Items/PainWheel.cs +++ b/Items/PainWheel.cs @@ -1,6 +1,5 @@ -using Terraria.ID; - using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/PalladiumDisc.cs b/Items/PalladiumDisc.cs index 2ce573bf..576d4dfb 100644 --- a/Items/PalladiumDisc.cs +++ b/Items/PalladiumDisc.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/PalladiumHat.cs b/Items/PalladiumHat.cs index 4a2fcb57..fc7dbb47 100644 --- a/Items/PalladiumHat.cs +++ b/Items/PalladiumHat.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/PalladiumHeader.cs b/Items/PalladiumHeader.cs index f4d3a11f..c15ea428 100644 --- a/Items/PalladiumHeader.cs +++ b/Items/PalladiumHeader.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/PalladiumRifle.cs b/Items/PalladiumRifle.cs index 8ef13aab..89a71b8d 100644 --- a/Items/PalladiumRifle.cs +++ b/Items/PalladiumRifle.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Microsoft.Xna.Framework; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/PalladiumStaff.cs b/Items/PalladiumStaff.cs index 0ba3b2dd..5769b48d 100644 --- a/Items/PalladiumStaff.cs +++ b/Items/PalladiumStaff.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/PalladiumVisage.cs b/Items/PalladiumVisage.cs index b207c179..7445a15d 100644 --- a/Items/PalladiumVisage.cs +++ b/Items/PalladiumVisage.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Pandemonium.cs b/Items/Pandemonium.cs index 3bd3a010..b3052264 100644 --- a/Items/Pandemonium.cs +++ b/Items/Pandemonium.cs @@ -1,7 +1,8 @@ -using Terraria.ID; +using System.Collections.Generic; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { @@ -35,7 +36,7 @@ public override void SetStaticDefaults() } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) + public override void ModifyTooltips(List tooltips) { tooltips[0].overrideColor = new Color(238, 194, 73); } @@ -47,10 +48,10 @@ public override bool ConsumeAmmo(Player player) return true; } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - float SpeedX = speedX + (float)Main.rand.Next(-15, 16) * 0.05f; - float SpeedY = speedY + (float)Main.rand.Next(-15, 16) * 0.05f; + float SpeedX = speedX + Main.rand.Next(-15, 16) * 0.05f; + float SpeedY = speedY + Main.rand.Next(-15, 16) * 0.05f; Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f); if (Main.rand.Next(2) == 0) Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, mod.ProjectileType("PandemoniumBullet"), damage, knockBack, player.whoAmI, 0.0f, 0.0f); diff --git a/Items/ParatrooperShotgun.cs b/Items/ParatrooperShotgun.cs index 138c776f..b91aac0e 100644 --- a/Items/ParatrooperShotgun.cs +++ b/Items/ParatrooperShotgun.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/ParaxydeAxe.cs b/Items/ParaxydeAxe.cs index f19f9fef..b1c30e39 100644 --- a/Items/ParaxydeAxe.cs +++ b/Items/ParaxydeAxe.cs @@ -1,7 +1,7 @@ -using Terraria.ID; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { diff --git a/Items/ParaxydeCleaver.cs b/Items/ParaxydeCleaver.cs index e1a26cae..b204a7e0 100644 --- a/Items/ParaxydeCleaver.cs +++ b/Items/ParaxydeCleaver.cs @@ -1,7 +1,7 @@ -using Terraria.ID; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { diff --git a/Items/ParaxydeHammer.cs b/Items/ParaxydeHammer.cs index 9972ab92..8f0fead1 100644 --- a/Items/ParaxydeHammer.cs +++ b/Items/ParaxydeHammer.cs @@ -1,7 +1,7 @@ -using Terraria.ID; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { diff --git a/Items/ParaxydePickaxe.cs b/Items/ParaxydePickaxe.cs index 8cdec2da..9eff15c5 100644 --- a/Items/ParaxydePickaxe.cs +++ b/Items/ParaxydePickaxe.cs @@ -1,7 +1,7 @@ -using Terraria.ID; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { diff --git a/Items/ParaxydeShard.cs b/Items/ParaxydeShard.cs index 8834b732..489f4033 100644 --- a/Items/ParaxydeShard.cs +++ b/Items/ParaxydeShard.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/ParaxydeStave.cs b/Items/ParaxydeStave.cs index ca73a2e7..5f0d8e11 100644 --- a/Items/ParaxydeStave.cs +++ b/Items/ParaxydeStave.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/ParaxydeStormbow.cs b/Items/ParaxydeStormbow.cs index e5f618e9..beda7ca0 100644 --- a/Items/ParaxydeStormbow.cs +++ b/Items/ParaxydeStormbow.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/PartyOver.cs b/Items/PartyOver.cs index 64f65c2b..86bcaa91 100644 --- a/Items/PartyOver.cs +++ b/Items/PartyOver.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/PatronoftheMind.cs b/Items/PatronoftheMind.cs index 5fb1f34f..f14a2e2c 100644 --- a/Items/PatronoftheMind.cs +++ b/Items/PatronoftheMind.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Permafrost.cs b/Items/Permafrost.cs index 2614a75b..dc486160 100644 --- a/Items/Permafrost.cs +++ b/Items/Permafrost.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/PetalBand.cs b/Items/PetalBand.cs index b3a7e204..ab5a4fe4 100644 --- a/Items/PetalBand.cs +++ b/Items/PetalBand.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Phantablast.cs b/Items/Phantablast.cs index 0884e79f..ad7b5fd2 100644 --- a/Items/Phantablast.cs +++ b/Items/Phantablast.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/PhantomFlask.cs b/Items/PhantomFlask.cs index 245191dd..2370c94d 100644 --- a/Items/PhantomFlask.cs +++ b/Items/PhantomFlask.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; namespace Tremor.Items { diff --git a/Items/PhantomSoul.cs b/Items/PhantomSoul.cs index 034df06a..c5c4e703 100644 --- a/Items/PhantomSoul.cs +++ b/Items/PhantomSoul.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Terraria; using Terraria.DataStructures; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/PharaohBlade.cs b/Items/PharaohBlade.cs index d04c6501..4fa74a9e 100644 --- a/Items/PharaohBlade.cs +++ b/Items/PharaohBlade.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/PhilosophersFlower.cs b/Items/PhilosophersFlower.cs index 39335565..11ba67f6 100644 --- a/Items/PhilosophersFlower.cs +++ b/Items/PhilosophersFlower.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/PhoenixShotgun.cs b/Items/PhoenixShotgun.cs index 0b06351f..e3d4a857 100644 --- a/Items/PhoenixShotgun.cs +++ b/Items/PhoenixShotgun.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/PirahnaStaff.cs b/Items/PirahnaStaff.cs index 81738e44..ae501d5c 100644 --- a/Items/PirahnaStaff.cs +++ b/Items/PirahnaStaff.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/PixiePulse.cs b/Items/PixiePulse.cs index c7cc46bd..c62f4a9e 100644 --- a/Items/PixiePulse.cs +++ b/Items/PixiePulse.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Microsoft.Xna.Framework; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/PixieinaJar.cs b/Items/PixieinaJar.cs index a9384e47..73896ce2 100644 --- a/Items/PixieinaJar.cs +++ b/Items/PixieinaJar.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/PlagueBreastplate.cs b/Items/PlagueBreastplate.cs index 83790a17..bdd1c4e2 100644 --- a/Items/PlagueBreastplate.cs +++ b/Items/PlagueBreastplate.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/PlagueFlask.cs b/Items/PlagueFlask.cs index 92d697a6..17272515 100644 --- a/Items/PlagueFlask.cs +++ b/Items/PlagueFlask.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; namespace Tremor.Items { diff --git a/Items/PlagueGreaves.cs b/Items/PlagueGreaves.cs index 88b1e238..64bd314d 100644 --- a/Items/PlagueGreaves.cs +++ b/Items/PlagueGreaves.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/PlagueHelmet.cs b/Items/PlagueHelmet.cs index 9b1faae7..0d9e58ae 100644 --- a/Items/PlagueHelmet.cs +++ b/Items/PlagueHelmet.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/PlaguedBow.cs b/Items/PlaguedBow.cs index 4d8ca4b8..079b242d 100644 --- a/Items/PlaguedBow.cs +++ b/Items/PlaguedBow.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/PlatinumShield.cs b/Items/PlatinumShield.cs index 6bbb4f57..e71fdad6 100644 --- a/Items/PlatinumShield.cs +++ b/Items/PlatinumShield.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/PlazmaSword.cs b/Items/PlazmaSword.cs index 11d29052..820df683 100644 --- a/Items/PlazmaSword.cs +++ b/Items/PlazmaSword.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Poseidon.cs b/Items/Poseidon.cs index 15a1b382..115d2e20 100644 --- a/Items/Poseidon.cs +++ b/Items/Poseidon.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Microsoft.Xna.Framework; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/PrizmaticSword.cs b/Items/PrizmaticSword.cs index e714bc73..b82fa9ae 100644 --- a/Items/PrizmaticSword.cs +++ b/Items/PrizmaticSword.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items @@ -34,8 +34,8 @@ public override void SetStaticDefaults() public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - player.statMana += (int)damage / 6; - player.ManaEffect((int)damage / 6); + player.statMana += damage / 6; + player.ManaEffect(damage / 6); } public override void MeleeEffects(Player player, Rectangle hitbox) diff --git a/Items/PurpleCrossguardPhasesaber.cs b/Items/PurpleCrossguardPhasesaber.cs index 5dd974aa..1b98a89f 100644 --- a/Items/PurpleCrossguardPhasesaber.cs +++ b/Items/PurpleCrossguardPhasesaber.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Pyro.cs b/Items/Pyro.cs index 0609e37d..f21272c5 100644 --- a/Items/Pyro.cs +++ b/Items/Pyro.cs @@ -11,7 +11,7 @@ public override bool CanEquipAccessory(Player player, int slot) for (int i = 0; i < player.armor.Length; i++) { MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - if (modPlayer.pyro == true) + if (modPlayer.pyro) { return false; } diff --git a/Items/Quadratron.cs b/Items/Quadratron.cs index 0363e7f1..d29e9053 100644 --- a/Items/Quadratron.cs +++ b/Items/Quadratron.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/QuetzalcoatlStave.cs b/Items/QuetzalcoatlStave.cs index 17b83882..8eeb6903 100644 --- a/Items/QuetzalcoatlStave.cs +++ b/Items/QuetzalcoatlStave.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/RainStaff.cs b/Items/RainStaff.cs index dc134fba..93c01eb0 100644 --- a/Items/RainStaff.cs +++ b/Items/RainStaff.cs @@ -1,6 +1,6 @@ -using Terraria.ID; -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/RavenBreastplate.cs b/Items/RavenBreastplate.cs index dc6167ca..f11a7fdd 100644 --- a/Items/RavenBreastplate.cs +++ b/Items/RavenBreastplate.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/RavenClaymore.cs b/Items/RavenClaymore.cs index 235b9416..d756da6a 100644 --- a/Items/RavenClaymore.cs +++ b/Items/RavenClaymore.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/RavenGreaves.cs b/Items/RavenGreaves.cs index 6bbae1ef..6c106e4b 100644 --- a/Items/RavenGreaves.cs +++ b/Items/RavenGreaves.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/RavenHeadgear.cs b/Items/RavenHeadgear.cs index 5d7d320d..1c25de3f 100644 --- a/Items/RavenHeadgear.cs +++ b/Items/RavenHeadgear.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/RedCrossguardPhasesaber.cs b/Items/RedCrossguardPhasesaber.cs index bfad256f..90d329b7 100644 --- a/Items/RedCrossguardPhasesaber.cs +++ b/Items/RedCrossguardPhasesaber.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/RedFeatherWings.cs b/Items/RedFeatherWings.cs index 221b1179..b2738e4d 100644 --- a/Items/RedFeatherWings.cs +++ b/Items/RedFeatherWings.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/RedSteelBroadsword.cs b/Items/RedSteelBroadsword.cs index f7f243c7..e2829c29 100644 --- a/Items/RedSteelBroadsword.cs +++ b/Items/RedSteelBroadsword.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/RedStorm.cs b/Items/RedStorm.cs index f6135e73..b266adbf 100644 --- a/Items/RedStorm.cs +++ b/Items/RedStorm.cs @@ -1,7 +1,7 @@ -using Terraria.ID; using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items @@ -54,19 +54,19 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX 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(player.fullRotation, default(Vector2)); 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; + float num78 = Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = Main.mouseY + Main.screenPosition.Y - vector2.Y; if (player.gravDir == -1f) { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + num79 = Main.screenPosition.Y + Main.screenHeight - Main.mouseY - vector2.Y; } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + float num80 = (float)Math.Sqrt(num78 * num78 + num79 * num79); float num81 = num80; if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) { - num78 = (float)player.direction; + num78 = player.direction; num79 = 0f; num80 = num72; } @@ -79,11 +79,11 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX int num107 = 3; for (int num108 = 0; num108 < num107; num108++) { - vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); - vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); - vector2.Y -= (float)(100 * num108); - num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + vector2 = new Vector2(player.position.X + player.width * 0.5f + Main.rand.Next(201) * -(float)player.direction + (Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); + vector2.X = (vector2.X + player.Center.X) / 2f + Main.rand.Next(-200, 201); + vector2.Y -= 100 * num108; + num78 = Main.mouseX + Main.screenPosition.X - vector2.X; + num79 = Main.mouseY + Main.screenPosition.Y - vector2.Y; if (num79 < 0f) { num79 *= -1f; @@ -92,15 +92,15 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX { num79 = 20f; } - num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + num80 = (float)Math.Sqrt(num78 * num78 + num79 * num79); num80 = num72 / num80; num78 *= num80; num79 *= num80; - float speedX4 = num78 + (float)Main.rand.Next(-40, 41) * 0.02f; - float speedY5 = num79 + (float)Main.rand.Next(-40, 41) * 0.02f; - Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, 606, num73, num74, i, 0f, (float)Main.rand.Next(5)); - Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, 606, num73, num74, i, 0f, (float)Main.rand.Next(3)); - Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, 606, num73, num74, i, 0f, (float)Main.rand.Next(1)); + float speedX4 = num78 + Main.rand.Next(-40, 41) * 0.02f; + float speedY5 = num79 + Main.rand.Next(-40, 41) * 0.02f; + Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, 606, num73, num74, i, 0f, Main.rand.Next(5)); + Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, 606, num73, num74, i, 0f, Main.rand.Next(3)); + Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, 606, num73, num74, i, 0f, Main.rand.Next(1)); } return false; } diff --git a/Items/ReinforcedBurst.cs b/Items/ReinforcedBurst.cs index b8beb021..5c219ba1 100644 --- a/Items/ReinforcedBurst.cs +++ b/Items/ReinforcedBurst.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items @@ -11,7 +11,7 @@ public override bool CanEquipAccessory(Player player, int slot) for (int i = 0; i < player.armor.Length; i++) { MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - if (modPlayer.nitro == true) + if (modPlayer.nitro) { return false; } diff --git a/Items/RetributionofAbraxas.cs b/Items/RetributionofAbraxas.cs index 66231916..da30710a 100644 --- a/Items/RetributionofAbraxas.cs +++ b/Items/RetributionofAbraxas.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Revolwar.cs b/Items/Revolwar.cs index c26f1196..82244bd6 100644 --- a/Items/Revolwar.cs +++ b/Items/Revolwar.cs @@ -1,5 +1,6 @@ -using Terraria.ID; +using System.Collections.Generic; using Microsoft.Xna.Framework; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items @@ -33,7 +34,7 @@ public override void SetStaticDefaults() } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) + public override void ModifyTooltips(List tooltips) { tooltips[0].overrideColor = new Color(238, 194, 73); } diff --git a/Items/RichMahoganySeed.cs b/Items/RichMahoganySeed.cs index 4f7ad658..eff79aa1 100644 --- a/Items/RichMahoganySeed.cs +++ b/Items/RichMahoganySeed.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/RockClimberPotion.cs b/Items/RockClimberPotion.cs index 90ae361a..275bde4d 100644 --- a/Items/RockClimberPotion.cs +++ b/Items/RockClimberPotion.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/RockStompers.cs b/Items/RockStompers.cs index 02f42665..fe97c9df 100644 --- a/Items/RockStompers.cs +++ b/Items/RockStompers.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/RoundBlast.cs b/Items/RoundBlast.cs index 9b054a4d..aac711b1 100644 --- a/Items/RoundBlast.cs +++ b/Items/RoundBlast.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items @@ -11,7 +11,7 @@ public override bool CanEquipAccessory(Player player, int slot) for (int i = 0; i < player.armor.Length; i++) { MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - if (modPlayer.pyro == true) + if (modPlayer.pyro) { return false; } diff --git a/Items/RoyalDaggers.cs b/Items/RoyalDaggers.cs index 847ccee3..c729ccec 100644 --- a/Items/RoyalDaggers.cs +++ b/Items/RoyalDaggers.cs @@ -1,7 +1,7 @@ -using Terraria.ID; using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items @@ -37,7 +37,7 @@ public override void SetStaticDefaults() } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { int i = Main.myPlayer; float num72 = item.shootSpeed; @@ -46,19 +46,19 @@ public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 po 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(player.fullRotation, default(Vector2)); 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; + float num78 = Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = Main.mouseY + Main.screenPosition.Y - vector2.Y; if (player.gravDir == -1f) { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + num79 = Main.screenPosition.Y + Main.screenHeight - Main.mouseY - vector2.Y; } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + float num80 = (float)Math.Sqrt(num78 * num78 + num79 * num79); float num81 = num80; if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) { - num78 = (float)player.direction; + num78 = player.direction; num79 = 0f; num80 = num72; } @@ -89,10 +89,10 @@ public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 po { float num148 = num78; float num149 = num79; - float num150 = 0.05f * (float)num147; - num148 += (float)Main.rand.Next(-35, 36) * num150; - num149 += (float)Main.rand.Next(-35, 36) * num150; - num80 = (float)Math.Sqrt((double)(num148 * num148 + num149 * num149)); + float num150 = 0.05f * num147; + num148 += Main.rand.Next(-35, 36) * num150; + num149 += Main.rand.Next(-35, 36) * num150; + num80 = (float)Math.Sqrt(num148 * num148 + num149 * num149); num80 = num72 / num80; num148 *= num80; num149 *= num80; diff --git a/Items/RoyalEgg.cs b/Items/RoyalEgg.cs index 61a95923..01489927 100644 --- a/Items/RoyalEgg.cs +++ b/Items/RoyalEgg.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/RubyBlade.cs b/Items/RubyBlade.cs index 3caa359a..acd8a31d 100644 --- a/Items/RubyBlade.cs +++ b/Items/RubyBlade.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/RubyDrill.cs b/Items/RubyDrill.cs index 20674fa7..3a40c70d 100644 --- a/Items/RubyDrill.cs +++ b/Items/RubyDrill.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/RustySword.cs b/Items/RustySword.cs index f9414bd7..22cbcc96 100644 --- a/Items/RustySword.cs +++ b/Items/RustySword.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/SacredCross.cs b/Items/SacredCross.cs index 6d1c9cdd..df5a32ec 100644 --- a/Items/SacredCross.cs +++ b/Items/SacredCross.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/SacrificalPickaxe.cs b/Items/SacrificalPickaxe.cs index c17ad83d..170461de 100644 --- a/Items/SacrificalPickaxe.cs +++ b/Items/SacrificalPickaxe.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Sanctifier.cs b/Items/Sanctifier.cs index d9249632..12e994f5 100644 --- a/Items/Sanctifier.cs +++ b/Items/Sanctifier.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/SapphireBlade.cs b/Items/SapphireBlade.cs index ea742444..8c58f02d 100644 --- a/Items/SapphireBlade.cs +++ b/Items/SapphireBlade.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/SapphireDrill.cs b/Items/SapphireDrill.cs index 87158f23..b10bf53a 100644 --- a/Items/SapphireDrill.cs +++ b/Items/SapphireDrill.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/SavingPotion.cs b/Items/SavingPotion.cs index dbfa8a80..69877c8c 100644 --- a/Items/SavingPotion.cs +++ b/Items/SavingPotion.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/ScamperPotion.cs b/Items/ScamperPotion.cs index dfcb3ac6..89df98d9 100644 --- a/Items/ScamperPotion.cs +++ b/Items/ScamperPotion.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/ScarredReaper.cs b/Items/ScarredReaper.cs index e12c4cd1..cc4c8d78 100644 --- a/Items/ScarredReaper.cs +++ b/Items/ScarredReaper.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/ScorpionStinger.cs b/Items/ScorpionStinger.cs index 2dc4a8dd..7ab712bf 100644 --- a/Items/ScorpionStinger.cs +++ b/Items/ScorpionStinger.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/ScourgeofFlames.cs b/Items/ScourgeofFlames.cs index 53bc910c..162c0b61 100644 --- a/Items/ScourgeofFlames.cs +++ b/Items/ScourgeofFlames.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/ShadowMasterChestplate.cs b/Items/ShadowMasterChestplate.cs index 487624c0..326420e0 100644 --- a/Items/ShadowMasterChestplate.cs +++ b/Items/ShadowMasterChestplate.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/ShadowMasterHood.cs b/Items/ShadowMasterHood.cs index 638f4997..88e06956 100644 --- a/Items/ShadowMasterHood.cs +++ b/Items/ShadowMasterHood.cs @@ -1,7 +1,7 @@ -using Terraria.ID; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { @@ -88,8 +88,8 @@ void Shoot(int Target, int Damage) Vector2 velocity = Helper.VelocityToPoint(Main.player[item.owner].Center, Main.npc[Target].Center, ShootSpeed); for (int l = 0; l < ShootCount; l++) { - velocity.X = velocity.X + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - velocity.Y = velocity.Y + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.X = velocity.X + Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.Y = velocity.Y + Main.rand.Next(-spread, spread + 1) * spreadMult; int i = Projectile.NewProjectile(Main.player[item.owner].Center.X, Main.player[item.owner].Center.Y, velocity.X, velocity.Y, mod.ProjectileType("AlchemicBubble"), 100, ShootKN, item.owner); } } diff --git a/Items/ShadowMasterPants.cs b/Items/ShadowMasterPants.cs index b1e5d481..119ae74c 100644 --- a/Items/ShadowMasterPants.cs +++ b/Items/ShadowMasterPants.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/ShadowRelic.cs b/Items/ShadowRelic.cs index 90a76ad4..bed4bff0 100644 --- a/Items/ShadowRelic.cs +++ b/Items/ShadowRelic.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items @@ -63,7 +63,7 @@ public void SpawnShadowWall(Vector2 pos) { if (pos.Y / 16.0 < (Main.maxTilesY - 205) || Main.wof >= 0 || Main.netMode == 1) return; - int num1 = (int)Player.FindClosest(pos, 16, 16); + int num1 = Player.FindClosest(pos, 16, 16); int num2 = 1; if (pos.X / 16.0 > (Main.maxTilesX / 2)) num2 = -1; @@ -91,7 +91,7 @@ public void SpawnShadowWall(Vector2 pos) { for (; WorldGen.SolidTile(i, num4 - num5) || (int)Main.tile[i, num4 - num5].liquid >= 100; ++num5) { - if (!WorldGen.SolidTile(i, num4 + num5) && (int)Main.tile[i, num4 + num5].liquid < 100) + if (!WorldGen.SolidTile(i, num4 + num5) && Main.tile[i, num4 + num5].liquid < 100) { num4 += num5; goto label_21; diff --git a/Items/ShadowStaff.cs b/Items/ShadowStaff.cs index 588020b6..97e75709 100644 --- a/Items/ShadowStaff.cs +++ b/Items/ShadowStaff.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/ShadowTooth.cs b/Items/ShadowTooth.cs index d9ba226d..31da4c31 100644 --- a/Items/ShadowTooth.cs +++ b/Items/ShadowTooth.cs @@ -1,9 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.Items { public class ShadowTooth : ModItem diff --git a/Items/ShadowWings.cs b/Items/ShadowWings.cs index 449a58f4..7a6c6c72 100644 --- a/Items/ShadowWings.cs +++ b/Items/ShadowWings.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/SharkRage.cs b/Items/SharkRage.cs index ab543770..db4991f5 100644 --- a/Items/SharkRage.cs +++ b/Items/SharkRage.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Sharkhalis.cs b/Items/Sharkhalis.cs index 0e8b7996..19721501 100644 --- a/Items/Sharkhalis.cs +++ b/Items/Sharkhalis.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/ShiningAxe.cs b/Items/ShiningAxe.cs index ffbb1609..dd0e97ed 100644 --- a/Items/ShiningAxe.cs +++ b/Items/ShiningAxe.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/ShockwaveClaymore.cs b/Items/ShockwaveClaymore.cs index 23aa806a..119ca55e 100644 --- a/Items/ShockwaveClaymore.cs +++ b/Items/ShockwaveClaymore.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/ShroomiteMechanicalBoots.cs b/Items/ShroomiteMechanicalBoots.cs index fd37e56d..c3cec61b 100644 --- a/Items/ShroomiteMechanicalBoots.cs +++ b/Items/ShroomiteMechanicalBoots.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/ShroomiteMinigun.cs b/Items/ShroomiteMinigun.cs index 9f948c01..6144a8fd 100644 --- a/Items/ShroomiteMinigun.cs +++ b/Items/ShroomiteMinigun.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/ShroomiteRocketLauncher.cs b/Items/ShroomiteRocketLauncher.cs index 4623be71..9081a046 100644 --- a/Items/ShroomiteRocketLauncher.cs +++ b/Items/ShroomiteRocketLauncher.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/SilverShield.cs b/Items/SilverShield.cs index b67f0099..06fac546 100644 --- a/Items/SilverShield.cs +++ b/Items/SilverShield.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Skullheart.cs b/Items/Skullheart.cs index 8d4392a0..18941420 100644 --- a/Items/Skullheart.cs +++ b/Items/Skullheart.cs @@ -1,7 +1,7 @@ -using Terraria; -using Terraria.ModLoader; using Microsoft.Xna.Framework; +using Terraria; using Terraria.DataStructures; +using Terraria.ModLoader; namespace Tremor.Items { @@ -71,8 +71,8 @@ void Shoot(int Target, int Damage) Vector2 velocity = Helper.VelocityToPoint(Main.player[item.owner].Center, Main.npc[Target].Center, ShootSpeed); for (int l = 0; l < ShootCount; l++) { - velocity.X = velocity.X + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - velocity.Y = velocity.Y + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.X = velocity.X + Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.Y = velocity.Y + Main.rand.Next(-spread, spread + 1) * spreadMult; int i = Projectile.NewProjectile(Main.player[item.owner].Center.X, Main.player[item.owner].Center.Y, velocity.X, velocity.Y, ShootType, Damage, ShootKN, item.owner); } } diff --git a/Items/SlimeFlail.cs b/Items/SlimeFlail.cs index 19d2f7bc..0b9a1294 100644 --- a/Items/SlimeFlail.cs +++ b/Items/SlimeFlail.cs @@ -1,6 +1,5 @@ -using Terraria.ID; - using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/SnakeDevourer.cs b/Items/SnakeDevourer.cs index 994bce93..5b1b517a 100644 --- a/Items/SnakeDevourer.cs +++ b/Items/SnakeDevourer.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/SnowShotgun.cs b/Items/SnowShotgun.cs index e3ca5c4e..d737e171 100644 --- a/Items/SnowShotgun.cs +++ b/Items/SnowShotgun.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/SnowballChaingun.cs b/Items/SnowballChaingun.cs index d069a4e2..df1ee8a4 100644 --- a/Items/SnowballChaingun.cs +++ b/Items/SnowballChaingun.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Microsoft.Xna.Framework; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/SolarBand.cs b/Items/SolarBand.cs index f9d0d8c1..e4c5ed37 100644 --- a/Items/SolarBand.cs +++ b/Items/SolarBand.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/SorcererFocus.cs b/Items/SorcererFocus.cs index bbfd70d0..b180e6ce 100644 --- a/Items/SorcererFocus.cs +++ b/Items/SorcererFocus.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Terraria; using Terraria.DataStructures; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/SorcererSoul.cs b/Items/SorcererSoul.cs index 8e48a903..52fd7ca0 100644 --- a/Items/SorcererSoul.cs +++ b/Items/SorcererSoul.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Terraria; using Terraria.DataStructures; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/SoulEruption.cs b/Items/SoulEruption.cs index 938509b3..5abfda50 100644 --- a/Items/SoulEruption.cs +++ b/Items/SoulEruption.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/SoulofFight.cs b/Items/SoulofFight.cs index 8e5f68f0..2bcefc47 100644 --- a/Items/SoulofFight.cs +++ b/Items/SoulofFight.cs @@ -1,7 +1,7 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/SoulofMind.cs b/Items/SoulofMind.cs index d8cbb208..01c85eaa 100644 --- a/Items/SoulofMind.cs +++ b/Items/SoulofMind.cs @@ -1,7 +1,7 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/SparkingFlask.cs b/Items/SparkingFlask.cs index 4a1e1e41..7c20b7d6 100644 --- a/Items/SparkingFlask.cs +++ b/Items/SparkingFlask.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; namespace Tremor.Items { diff --git a/Items/SpectralBlade.cs b/Items/SpectralBlade.cs index a4bea513..b01f18bb 100644 --- a/Items/SpectralBlade.cs +++ b/Items/SpectralBlade.cs @@ -1,7 +1,6 @@ using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.Items { public class SpectralBlade : ModItem diff --git a/Items/SpectreNecklace.cs b/Items/SpectreNecklace.cs index 5c26c040..ab28b090 100644 --- a/Items/SpectreNecklace.cs +++ b/Items/SpectreNecklace.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/SpectreTaroCards.cs b/Items/SpectreTaroCards.cs index dfc225f0..3c42d2d3 100644 --- a/Items/SpectreTaroCards.cs +++ b/Items/SpectreTaroCards.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/SpiderMeat.cs b/Items/SpiderMeat.cs index 7b587c5c..4b09c580 100644 --- a/Items/SpiderMeat.cs +++ b/Items/SpiderMeat.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/SpineBlade.cs b/Items/SpineBlade.cs index ef018108..5fad8c17 100644 --- a/Items/SpineBlade.cs +++ b/Items/SpineBlade.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Sporaxe.cs b/Items/Sporaxe.cs index ab7bcf9a..97e8d5f0 100644 --- a/Items/Sporaxe.cs +++ b/Items/Sporaxe.cs @@ -1,7 +1,7 @@ -using Terraria.ID; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { diff --git a/Items/SporeDust.cs b/Items/SporeDust.cs index fe7b9036..52b0c199 100644 --- a/Items/SporeDust.cs +++ b/Items/SporeDust.cs @@ -1,7 +1,7 @@ -using Terraria.ID; using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/SquareBlast.cs b/Items/SquareBlast.cs index 0db41280..a51719e8 100644 --- a/Items/SquareBlast.cs +++ b/Items/SquareBlast.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items @@ -11,7 +11,7 @@ public override bool CanEquipAccessory(Player player, int slot) for (int i = 0; i < player.armor.Length; i++) { MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - if (modPlayer.pyro == true) + if (modPlayer.pyro) { return false; } diff --git a/Items/Squorb.cs b/Items/Squorb.cs index 35934629..14bf51cd 100644 --- a/Items/Squorb.cs +++ b/Items/Squorb.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Terraria; using Terraria.DataStructures; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/StarBlaster.cs b/Items/StarBlaster.cs index ed7bab90..fefab4e3 100644 --- a/Items/StarBlaster.cs +++ b/Items/StarBlaster.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Microsoft.Xna.Framework; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/StarBound.cs b/Items/StarBound.cs index 982c1a47..189eaf26 100644 --- a/Items/StarBound.cs +++ b/Items/StarBound.cs @@ -1,7 +1,7 @@ -using Terraria.ID; using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items @@ -38,7 +38,7 @@ public override void SetStaticDefaults() - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { int i = Main.myPlayer; float num72 = item.shootSpeed; @@ -47,19 +47,19 @@ public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 po 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(player.fullRotation, default(Vector2)); 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; + float num78 = Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = Main.mouseY + Main.screenPosition.Y - vector2.Y; if (player.gravDir == -1f) { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + num79 = Main.screenPosition.Y + Main.screenHeight - Main.mouseY - vector2.Y; } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + float num80 = (float)Math.Sqrt(num78 * num78 + num79 * num79); float num81 = num80; if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) { - num78 = (float)player.direction; + num78 = player.direction; num79 = 0f; num80 = num72; } @@ -90,10 +90,10 @@ public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 po { float num148 = num78; float num149 = num79; - float num150 = 0.05f * (float)num147; - num148 += (float)Main.rand.Next(-35, 36) * num150; - num149 += (float)Main.rand.Next(-35, 36) * num150; - num80 = (float)Math.Sqrt((double)(num148 * num148 + num149 * num149)); + float num150 = 0.05f * num147; + num148 += Main.rand.Next(-35, 36) * num150; + num149 += Main.rand.Next(-35, 36) * num150; + num80 = (float)Math.Sqrt(num148 * num148 + num149 * num149); num80 = num72 / num80; num148 *= num80; num149 *= num80; diff --git a/Items/StarDrill.cs b/Items/StarDrill.cs index 8ad604e9..662b0398 100644 --- a/Items/StarDrill.cs +++ b/Items/StarDrill.cs @@ -1,7 +1,8 @@ -using Terraria.ID; +using System.Collections.Generic; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { @@ -39,7 +40,7 @@ public override void SetStaticDefaults() } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) + public override void ModifyTooltips(List tooltips) { tooltips[0].overrideColor = new Color(238, 194, 73); } diff --git a/Items/StardustBand.cs b/Items/StardustBand.cs index 7601322b..64571f3c 100644 --- a/Items/StardustBand.cs +++ b/Items/StardustBand.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/StarlightGlimmer.cs b/Items/StarlightGlimmer.cs index 583fb926..1c968c1c 100644 --- a/Items/StarlightGlimmer.cs +++ b/Items/StarlightGlimmer.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/StartrooperFlameburstPistol.cs b/Items/StartrooperFlameburstPistol.cs index 821ee50d..05c0ad49 100644 --- a/Items/StartrooperFlameburstPistol.cs +++ b/Items/StartrooperFlameburstPistol.cs @@ -1,7 +1,7 @@ +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { diff --git a/Items/SteelBow.cs b/Items/SteelBow.cs index 87ecf792..f8987c94 100644 --- a/Items/SteelBow.cs +++ b/Items/SteelBow.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Microsoft.Xna.Framework; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/StickyFlail.cs b/Items/StickyFlail.cs index c2cd8459..60404311 100644 --- a/Items/StickyFlail.cs +++ b/Items/StickyFlail.cs @@ -1,6 +1,5 @@ -using Terraria.ID; - using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/StoneChestplate.cs b/Items/StoneChestplate.cs index 804e2f62..1fb68989 100644 --- a/Items/StoneChestplate.cs +++ b/Items/StoneChestplate.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/StoneHelmet.cs b/Items/StoneHelmet.cs index 85fdcf55..2e0052c3 100644 --- a/Items/StoneHelmet.cs +++ b/Items/StoneHelmet.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/StoneLeggings.cs b/Items/StoneLeggings.cs index 74543f99..766fb350 100644 --- a/Items/StoneLeggings.cs +++ b/Items/StoneLeggings.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/StoneofKnowledge.cs b/Items/StoneofKnowledge.cs index b9d97370..47127c8d 100644 --- a/Items/StoneofKnowledge.cs +++ b/Items/StoneofKnowledge.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items @@ -39,9 +39,9 @@ public override bool UseItem(Player player) Main.PlaySound(15, (int)player.position.X, (int)player.position.Y, 0); if (Main.netMode != 1) { - int b1ID = Terraria.NPC.NewNPC((int)player.Center.X - 300, (int)player.Center.Y - 800, mod.NPCType("SoulofHope")); - int b2ID = Terraria.NPC.NewNPC((int)player.Center.X, (int)player.Center.Y - 300, mod.NPCType("SoulofTrust")); - int b3ID = Terraria.NPC.NewNPC((int)player.Center.X + 100, (int)player.Center.Y - 500, mod.NPCType("SoulofTruth")); + int b1ID = NPC.NewNPC((int)player.Center.X - 300, (int)player.Center.Y - 800, mod.NPCType("SoulofHope")); + int b2ID = NPC.NewNPC((int)player.Center.X, (int)player.Center.Y - 300, mod.NPCType("SoulofTrust")); + int b3ID = NPC.NewNPC((int)player.Center.X + 100, (int)player.Center.Y - 500, mod.NPCType("SoulofTruth")); Main.npc[b1ID].ai[2] = b2ID; Main.npc[b1ID].ai[3] = b3ID; Main.npc[b2ID].ai[2] = b1ID; diff --git a/Items/StormBlade.cs b/Items/StormBlade.cs index b8c54102..c2606bca 100644 --- a/Items/StormBlade.cs +++ b/Items/StormBlade.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/StormJelly.cs b/Items/StormJelly.cs index 8f198834..6f002099 100644 --- a/Items/StormJelly.cs +++ b/Items/StormJelly.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Stormtron.cs b/Items/Stormtron.cs index 76424dbc..1439ca18 100644 --- a/Items/Stormtron.cs +++ b/Items/Stormtron.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/StrangeEgg.cs b/Items/StrangeEgg.cs index 45e5a2cd..82f713fa 100644 --- a/Items/StrangeEgg.cs +++ b/Items/StrangeEgg.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Stynginator.cs b/Items/Stynginator.cs index 4ce0c8e0..16ba7a39 100644 --- a/Items/Stynginator.cs +++ b/Items/Stynginator.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/SummonerFocus.cs b/Items/SummonerFocus.cs index 9fd18322..79c082ac 100644 --- a/Items/SummonerFocus.cs +++ b/Items/SummonerFocus.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Terraria; using Terraria.DataStructures; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/SummonerSoul.cs b/Items/SummonerSoul.cs index a97f674d..99453577 100644 --- a/Items/SummonerSoul.cs +++ b/Items/SummonerSoul.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Terraria; using Terraria.DataStructures; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/SuperBigCannon.cs b/Items/SuperBigCannon.cs index 5a6114a1..f731c69a 100644 --- a/Items/SuperBigCannon.cs +++ b/Items/SuperBigCannon.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Microsoft.Xna.Framework; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/SuperHealingFlask.cs b/Items/SuperHealingFlask.cs index ddcd30b0..84dda0a7 100644 --- a/Items/SuperHealingFlask.cs +++ b/Items/SuperHealingFlask.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/SuperManaFlask.cs b/Items/SuperManaFlask.cs index aef3a9d5..6e04f432 100644 --- a/Items/SuperManaFlask.cs +++ b/Items/SuperManaFlask.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Swordstorm.cs b/Items/Swordstorm.cs index cea6bf23..48973fba 100644 --- a/Items/Swordstorm.cs +++ b/Items/Swordstorm.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/TempleCannon.cs b/Items/TempleCannon.cs index 20d1ce11..6cf64e32 100644 --- a/Items/TempleCannon.cs +++ b/Items/TempleCannon.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/TheArtifact.cs b/Items/TheArtifact.cs index 393191b0..ce925fb3 100644 --- a/Items/TheArtifact.cs +++ b/Items/TheArtifact.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/TheBooger.cs b/Items/TheBooger.cs index bbca1d36..35503133 100644 --- a/Items/TheBooger.cs +++ b/Items/TheBooger.cs @@ -1,6 +1,5 @@ -using Terraria.ID; - using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/TheCadence.cs b/Items/TheCadence.cs index 9e66742c..066cb042 100644 --- a/Items/TheCadence.cs +++ b/Items/TheCadence.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/TheCrescent.cs b/Items/TheCrescent.cs index 449067fc..b40fcb4a 100644 --- a/Items/TheCrescent.cs +++ b/Items/TheCrescent.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/TheGlorch.cs b/Items/TheGlorch.cs index 933188cf..7e12a677 100644 --- a/Items/TheGlorch.cs +++ b/Items/TheGlorch.cs @@ -1,7 +1,7 @@ -using Terraria.ID; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { diff --git a/Items/TheTide.cs b/Items/TheTide.cs index 2542a226..a4c99895 100644 --- a/Items/TheTide.cs +++ b/Items/TheTide.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/TheUltimateBoomstick.cs b/Items/TheUltimateBoomstick.cs index 9e3818b3..1b1f83b8 100644 --- a/Items/TheUltimateBoomstick.cs +++ b/Items/TheUltimateBoomstick.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/ThrowerFocus.cs b/Items/ThrowerFocus.cs index 41b3313c..c82bd208 100644 --- a/Items/ThrowerFocus.cs +++ b/Items/ThrowerFocus.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Terraria; using Terraria.DataStructures; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/TikiArmor.cs b/Items/TikiArmor.cs index b3c7bfc6..e7c36912 100644 --- a/Items/TikiArmor.cs +++ b/Items/TikiArmor.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/TinShield.cs b/Items/TinShield.cs index 6a8bcf59..3cce2e1e 100644 --- a/Items/TinShield.cs +++ b/Items/TinShield.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/TitaniumDisc.cs b/Items/TitaniumDisc.cs index 07c3919e..d2ab9890 100644 --- a/Items/TitaniumDisc.cs +++ b/Items/TitaniumDisc.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/TitaniumHeader.cs b/Items/TitaniumHeader.cs index be754117..9b806c57 100644 --- a/Items/TitaniumHeader.cs +++ b/Items/TitaniumHeader.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/TitaniumHood.cs b/Items/TitaniumHood.cs index cb281244..4c42fe6b 100644 --- a/Items/TitaniumHood.cs +++ b/Items/TitaniumHood.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/TitaniumRifle.cs b/Items/TitaniumRifle.cs index 347eff0f..9dd3ce19 100644 --- a/Items/TitaniumRifle.cs +++ b/Items/TitaniumRifle.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Microsoft.Xna.Framework; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/TitaniumStaff.cs b/Items/TitaniumStaff.cs index 7dd3f4e2..3935c3f3 100644 --- a/Items/TitaniumStaff.cs +++ b/Items/TitaniumStaff.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/TitaniumVisage.cs b/Items/TitaniumVisage.cs index 229c9a10..064a0095 100644 --- a/Items/TitaniumVisage.cs +++ b/Items/TitaniumVisage.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/TombRaider.cs b/Items/TombRaider.cs index abea6d26..e5f59ce3 100644 --- a/Items/TombRaider.cs +++ b/Items/TombRaider.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Toothpick.cs b/Items/Toothpick.cs index 39bd03cc..e7968096 100644 --- a/Items/Toothpick.cs +++ b/Items/Toothpick.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/TopazBlade.cs b/Items/TopazBlade.cs index e966dc66..ccfb12a2 100644 --- a/Items/TopazBlade.cs +++ b/Items/TopazBlade.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/TopazDrill.cs b/Items/TopazDrill.cs index cfbb3383..63d4715e 100644 --- a/Items/TopazDrill.cs +++ b/Items/TopazDrill.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/ToxicClaymore.cs b/Items/ToxicClaymore.cs index 64b3b2fd..08e168fd 100644 --- a/Items/ToxicClaymore.cs +++ b/Items/ToxicClaymore.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/ToxicFlask.cs b/Items/ToxicFlask.cs index c781bd93..ac46d72b 100644 --- a/Items/ToxicFlask.cs +++ b/Items/ToxicFlask.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Transistor.cs b/Items/Transistor.cs index 15ae01b5..4086956e 100644 --- a/Items/Transistor.cs +++ b/Items/Transistor.cs @@ -36,7 +36,7 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX { Vector2 speed = new Vector2(speedX, speedY); speed = speed.RotatedByRandom(MathHelper.ToRadians(60)); - damage = (int)(damage); + damage = damage; speedX = speed.X; speedY = speed.Y; return true; diff --git a/Items/TrebleClef.cs b/Items/TrebleClef.cs index 82075f14..8084be26 100644 --- a/Items/TrebleClef.cs +++ b/Items/TrebleClef.cs @@ -1,3 +1,4 @@ +using System.Collections.Generic; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; @@ -34,7 +35,7 @@ public override void SetStaticDefaults() } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) + public override void ModifyTooltips(List tooltips) { tooltips[0].overrideColor = new Color(238, 194, 73); } diff --git a/Items/TremorItems.cs b/Items/TremorItems.cs index 6b08ccd3..91b22a84 100644 --- a/Items/TremorItems.cs +++ b/Items/TremorItems.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items @@ -123,11 +123,11 @@ public override void UpdateEquip(Item item, Player player) public override void SetDefaults(Item item) { - if (item.ranged == true && Main.player[Main.myPlayer].active && Main.player[Main.myPlayer].FindBuffIndex(mod.BuffType("ShotSpeedBuff")) != -1) + if (item.ranged && Main.player[Main.myPlayer].active && Main.player[Main.myPlayer].FindBuffIndex(mod.BuffType("ShotSpeedBuff")) != -1) { item.shootSpeed *= 2f; } - if (item.ranged == true && Main.player[Main.myPlayer].active && Main.player[Main.myPlayer].FindBuffIndex(mod.BuffType("ShotSpeedBuff")) != -1) + if (item.ranged && Main.player[Main.myPlayer].active && Main.player[Main.myPlayer].FindBuffIndex(mod.BuffType("ShotSpeedBuff")) != -1) { item.shootSpeed *= 2f; } diff --git a/Items/TrueArachnophobia.cs b/Items/TrueArachnophobia.cs index 3c112a05..facf49e9 100644 --- a/Items/TrueArachnophobia.cs +++ b/Items/TrueArachnophobia.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/TrueBloodCarnage.cs b/Items/TrueBloodCarnage.cs index 6500e5c8..478c37d7 100644 --- a/Items/TrueBloodCarnage.cs +++ b/Items/TrueBloodCarnage.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/TrueEssense.cs b/Items/TrueEssense.cs index f9444401..a86de89d 100644 --- a/Items/TrueEssense.cs +++ b/Items/TrueEssense.cs @@ -1,5 +1,6 @@ -using Terraria.ID; +using System.Collections.Generic; using Microsoft.Xna.Framework; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items @@ -26,7 +27,7 @@ public override void SetStaticDefaults() } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) + public override void ModifyTooltips(List tooltips) { tooltips[0].overrideColor = new Color(238, 194, 73); } diff --git a/Items/TrueHeroHood.cs b/Items/TrueHeroHood.cs index 0af16b0d..6af676c2 100644 --- a/Items/TrueHeroHood.cs +++ b/Items/TrueHeroHood.cs @@ -1,6 +1,7 @@ +using System.Collections.Generic; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { @@ -26,7 +27,7 @@ public override void SetStaticDefaults() } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) + public override void ModifyTooltips(List tooltips) { tooltips[0].overrideColor = new Color(238, 194, 73); } diff --git a/Items/TrueHeroPants.cs b/Items/TrueHeroPants.cs index 7ac06f34..113b0508 100644 --- a/Items/TrueHeroPants.cs +++ b/Items/TrueHeroPants.cs @@ -1,6 +1,7 @@ +using System.Collections.Generic; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { @@ -27,7 +28,7 @@ public override void SetStaticDefaults() } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) + public override void ModifyTooltips(List tooltips) { tooltips[0].overrideColor = new Color(238, 194, 73); } diff --git a/Items/TrueHeroShirt.cs b/Items/TrueHeroShirt.cs index 3d0be3c6..778116ff 100644 --- a/Items/TrueHeroShirt.cs +++ b/Items/TrueHeroShirt.cs @@ -1,6 +1,7 @@ +using System.Collections.Generic; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { @@ -31,7 +32,7 @@ public override void UpdateEquip(Player player) player.AddBuff(mod.BuffType("SecondTrueBlade"), 2); } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) + public override void ModifyTooltips(List tooltips) { tooltips[0].overrideColor = new Color(238, 194, 73); } diff --git a/Items/TrueTerraBlade.cs b/Items/TrueTerraBlade.cs index 81871cf7..597df8c6 100644 --- a/Items/TrueTerraBlade.cs +++ b/Items/TrueTerraBlade.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/TungstenShield.cs b/Items/TungstenShield.cs index b2ce6204..dfe80614 100644 --- a/Items/TungstenShield.cs +++ b/Items/TungstenShield.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/TurtleGreatsword.cs b/Items/TurtleGreatsword.cs index ea56ea7c..35dd86b6 100644 --- a/Items/TurtleGreatsword.cs +++ b/Items/TurtleGreatsword.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/TurtleShield.cs b/Items/TurtleShield.cs index cd15637e..23194f86 100644 --- a/Items/TurtleShield.cs +++ b/Items/TurtleShield.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/TwilightKnife.cs b/Items/TwilightKnife.cs index 0c37f371..c5acfdfd 100644 --- a/Items/TwilightKnife.cs +++ b/Items/TwilightKnife.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git "a/Items/Unpredictable\320\241ompass.cs" "b/Items/Unpredictable\320\241ompass.cs" index 1b3156b8..fe01d947 100644 --- "a/Items/Unpredictable\320\241ompass.cs" +++ "b/Items/Unpredictable\320\241ompass.cs" @@ -1,6 +1,6 @@ -using Terraria.ID; -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/UnstableCrystal.cs b/Items/UnstableCrystal.cs index 478dc886..c0190e4d 100644 --- a/Items/UnstableCrystal.cs +++ b/Items/UnstableCrystal.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Vindicator.cs b/Items/Vindicator.cs index 02e6490c..2fe0b315 100644 --- a/Items/Vindicator.cs +++ b/Items/Vindicator.cs @@ -55,7 +55,7 @@ public override void AddRecipes() return new Vector2(-12, -7); } - 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) + public override bool Shoot(Player player, ref 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, 0.0f, 0.0f); return false; diff --git a/Items/VineCape.cs b/Items/VineCape.cs index 466f8d5f..a2ef1ba9 100644 --- a/Items/VineCape.cs +++ b/Items/VineCape.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/VineHood.cs b/Items/VineHood.cs index 81f3bcde..6637e377 100644 --- a/Items/VineHood.cs +++ b/Items/VineHood.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/VinePants.cs b/Items/VinePants.cs index 2c12c4f0..40bd9a51 100644 --- a/Items/VinePants.cs +++ b/Items/VinePants.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/VoidKnife.cs b/Items/VoidKnife.cs index b043f061..46cb7223 100644 --- a/Items/VoidKnife.cs +++ b/Items/VoidKnife.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/Volcannon.cs b/Items/Volcannon.cs index 1b39942e..8502bc18 100644 --- a/Items/Volcannon.cs +++ b/Items/Volcannon.cs @@ -1,6 +1,7 @@ -using Terraria.ID; +using System.Collections.Generic; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items @@ -35,7 +36,7 @@ public override void SetStaticDefaults() } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) + public override void ModifyTooltips(List tooltips) { tooltips[0].overrideColor = new Color(238, 194, 73); } diff --git a/Items/VortexBand.cs b/Items/VortexBand.cs index 19a99b7e..e56a589d 100644 --- a/Items/VortexBand.cs +++ b/Items/VortexBand.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/VulcanBlade.cs b/Items/VulcanBlade.cs index d4c98e23..e000c45b 100644 --- a/Items/VulcanBlade.cs +++ b/Items/VulcanBlade.cs @@ -1,6 +1,7 @@ +using System.Collections.Generic; +using Microsoft.Xna.Framework; using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { @@ -33,7 +34,7 @@ public override void SetStaticDefaults() } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) + public override void ModifyTooltips(List tooltips) { tooltips[0].overrideColor = new Color(238, 194, 73); } diff --git a/Items/VultureStaff.cs b/Items/VultureStaff.cs index cde92df3..6d2ada73 100644 --- a/Items/VultureStaff.cs +++ b/Items/VultureStaff.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/VultureWings.cs b/Items/VultureWings.cs index 92060520..a46f5eeb 100644 --- a/Items/VultureWings.cs +++ b/Items/VultureWings.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/WallOfShadowsFlask.cs b/Items/WallOfShadowsFlask.cs index 802097f0..7afad261 100644 --- a/Items/WallOfShadowsFlask.cs +++ b/Items/WallOfShadowsFlask.cs @@ -87,8 +87,8 @@ void Shoot(int Target, int Damage) Vector2 velocity = Helper.VelocityToPoint(Main.player[item.owner].Center, Main.npc[Target].Center, ShootSpeed); for (int l = 0; l < ShootCount; l++) { - velocity.X = velocity.X + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - velocity.Y = velocity.Y + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.X = velocity.X + Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.Y = velocity.Y + Main.rand.Next(-spread, spread + 1) * spreadMult; int i = Projectile.NewProjectile(Main.player[item.owner].Center.X, Main.player[item.owner].Center.Y, velocity.X, velocity.Y, mod.ProjectileType("WallOfShadowsFlask_Proj"), Damage, ShootKN, item.owner); } } diff --git a/Items/WarpPad.cs b/Items/WarpPad.cs index bbc0f2d2..7c0cb49b 100644 --- a/Items/WarpPad.cs +++ b/Items/WarpPad.cs @@ -1,6 +1,6 @@ using Terraria; -using Terraria.ModLoader; using Terraria.ID; +using Terraria.ModLoader; namespace Tremor.Items { @@ -38,8 +38,7 @@ public override bool UseItem(Player player) player.showLastDeath = false; return true; } - else - return false; + return false; } public override bool CanUseItem(Player player) diff --git a/Items/WarriorFocus.cs b/Items/WarriorFocus.cs index a3e24adc..2681d6f8 100644 --- a/Items/WarriorFocus.cs +++ b/Items/WarriorFocus.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Terraria; using Terraria.DataStructures; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/WarriorSoul.cs b/Items/WarriorSoul.cs index ff049b66..1105b4c0 100644 --- a/Items/WarriorSoul.cs +++ b/Items/WarriorSoul.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Terraria; using Terraria.DataStructures; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/WartimeRocketLauncher.cs b/Items/WartimeRocketLauncher.cs index 40cd5978..984aab95 100644 --- a/Items/WartimeRocketLauncher.cs +++ b/Items/WartimeRocketLauncher.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Microsoft.Xna.Framework; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/WaterDeadShot.cs b/Items/WaterDeadShot.cs index 818b24eb..a0c380a8 100644 --- a/Items/WaterDeadShot.cs +++ b/Items/WaterDeadShot.cs @@ -1,7 +1,7 @@ -using Terraria.ID; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { diff --git a/Items/WhiteCrossguardPhasesaber.cs b/Items/WhiteCrossguardPhasesaber.cs index c07cc750..84907363 100644 --- a/Items/WhiteCrossguardPhasesaber.cs +++ b/Items/WhiteCrossguardPhasesaber.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/WhiteGoldHelmet.cs b/Items/WhiteGoldHelmet.cs index 6382ca07..00fcba33 100644 --- a/Items/WhiteGoldHelmet.cs +++ b/Items/WhiteGoldHelmet.cs @@ -1,7 +1,7 @@ -using Terraria.ID; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Items { @@ -87,8 +87,8 @@ void Shoot(int Target, int Damage) Vector2 velocity = Helper.VelocityToPoint(Main.player[item.owner].Center, Main.npc[Target].Center, ShootSpeed); for (int l = 0; l < ShootCount; l++) { - velocity.X = velocity.X + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - velocity.Y = velocity.Y + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.X = velocity.X + Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.Y = velocity.Y + Main.rand.Next(-spread, spread + 1) * spreadMult; int i = Projectile.NewProjectile(Main.player[item.owner].Center.X, Main.player[item.owner].Center.Y, velocity.X, velocity.Y, mod.ProjectileType("WhiteGoldKnife"), 100, ShootKN, item.owner); } } diff --git a/Items/WhiteMasterHood.cs b/Items/WhiteMasterHood.cs index 9454b9b0..3e6ad8cb 100644 --- a/Items/WhiteMasterHood.cs +++ b/Items/WhiteMasterHood.cs @@ -40,12 +40,12 @@ public override void UpdateEquip(Player player) public override void UpdateArmorSet(Player player) { player.setBonus = "Creates alchemical bubbles to attack enemies\nBubbles heal you"; - if (--this.TimeToShoot <= 0) + if (--TimeToShoot <= 0) { - this.TimeToShoot = ShootRate; - int Target = this.GetTarget(); + TimeToShoot = ShootRate; + int Target = GetTarget(); if (Target != -1) - Shoot(Target, this.GetDamage()); + Shoot(Target, GetDamage()); } } @@ -73,8 +73,8 @@ void Shoot(int Target, int Damage) Vector2 velocity = Helper.VelocityToPoint(Main.player[item.owner].Center, Main.npc[Target].Center, ShootSpeed); for (int l = 0; l < ShootCount; l++) { - velocity.X = velocity.X + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - velocity.Y = velocity.Y + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.X = velocity.X + Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.Y = velocity.Y + Main.rand.Next(-spread, spread + 1) * spreadMult; int i = Projectile.NewProjectile(Main.player[item.owner].Center.X, Main.player[item.owner].Center.Y, velocity.X, velocity.Y, mod.ProjectileType("AlchemicBubbleZellarium"), 115, ShootKN, item.owner); } } diff --git a/Items/WhiteSakura.cs b/Items/WhiteSakura.cs index 7168c027..78465937 100644 --- a/Items/WhiteSakura.cs +++ b/Items/WhiteSakura.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/WrathofWraith.cs b/Items/WrathofWraith.cs index 88ef802e..6c47175d 100644 --- a/Items/WrathofWraith.cs +++ b/Items/WrathofWraith.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/YellowCrossguardPhasesaber.cs b/Items/YellowCrossguardPhasesaber.cs index 44418cf0..21334d51 100644 --- a/Items/YellowCrossguardPhasesaber.cs +++ b/Items/YellowCrossguardPhasesaber.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/YinYangLance.cs b/Items/YinYangLance.cs index 236682ec..60418bf6 100644 --- a/Items/YinYangLance.cs +++ b/Items/YinYangLance.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/Items/ZootalooEgg.cs b/Items/ZootalooEgg.cs index 8cb210a4..47be1ffb 100644 --- a/Items/ZootalooEgg.cs +++ b/Items/ZootalooEgg.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Items diff --git a/MPlayer.cs b/MPlayer.cs index 4017d06a..01aa90d2 100644 --- a/MPlayer.cs +++ b/MPlayer.cs @@ -9,31 +9,31 @@ public class MPlayer : ModPlayer // 60 * 1.5 = 90 damage. public float alchemistDamage; public int alchemistCrit; - public bool pyro = false; - public bool nitro = false; - public bool spirit = false; - public bool enchanted = false; - public bool glove = false; - public bool core = false; - public bool novaAura = false; - public bool novaSet = false; - public bool novaHelmet = false; - public bool novaChestplate = false; + public bool pyro; + public bool nitro; + public bool spirit; + public bool enchanted; + public bool glove; + public bool core; + public bool novaAura; + public bool novaSet; + public bool novaHelmet; + public bool novaChestplate; public override void ResetEffects() { - this.alchemistDamage = 1; - this.alchemistCrit = 0; - this.pyro = false; - this.nitro = false; - this.spirit = false; - this.enchanted = false; - this.glove = false; - this.core = false; - this.novaAura = false; - this.novaSet = false; - this.novaHelmet = false; - this.novaChestplate = false; + alchemistDamage = 1; + alchemistCrit = 0; + pyro = false; + nitro = false; + spirit = false; + enchanted = false; + glove = false; + core = false; + novaAura = false; + novaSet = false; + novaHelmet = false; + novaChestplate = false; } } } diff --git a/NPCDrops.cs b/NPCDrops.cs index 91054b64..9965406c 100644 --- a/NPCDrops.cs +++ b/NPCDrops.cs @@ -39,8 +39,8 @@ public override void NPCLoot(NPC npc) { Item.NewItem(npc.position, npc.width, npc.height, 1365); } - Item.NewItem(npc.position, npc.width, npc.height, Utils.SelectRandom(Main.rand, NPCDrops.VanillaWoFEmblems)); - Item.NewItem(npc.position, npc.width, npc.height, Utils.SelectRandom(Main.rand, NPCDrops.VanillaWoFWeapons)); + Item.NewItem(npc.position, npc.width, npc.height, Utils.SelectRandom(Main.rand, VanillaWoFEmblems)); + Item.NewItem(npc.position, npc.width, npc.height, Utils.SelectRandom(Main.rand, VanillaWoFWeapons)); Item.NewItem(npc.position, npc.width, npc.height, ItemID.GoldCoin, Main.rand.Next(6, 10)); } break; diff --git a/NPCs/Abomination.cs b/NPCs/Abomination.cs index 4bad893e..07f403f3 100644 --- a/NPCs/Abomination.cs +++ b/NPCs/Abomination.cs @@ -1,6 +1,7 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; + namespace Tremor.NPCs { @@ -52,8 +53,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { @@ -67,7 +68,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneJungle && y > Main.rockLayer ? 0.01f : 0f; } } diff --git a/NPCs/Agloomination.cs b/NPCs/Agloomination.cs index 80b53685..851cb973 100644 --- a/NPCs/Agloomination.cs +++ b/NPCs/Agloomination.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -34,15 +34,15 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedPlantBoss && y > Main.rockLayer ? 0.01f : 0f; } @@ -52,20 +52,20 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 60; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } } else { for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 54, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 54, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 54, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, hitDirection, -1f, 0, default(Color), 0.7f); } } } diff --git a/NPCs/Alchemaster.cs b/NPCs/Alchemaster.cs index 3a68c026..a5f0076e 100644 --- a/NPCs/Alchemaster.cs +++ b/NPCs/Alchemaster.cs @@ -1,7 +1,8 @@ -using Terraria.ID; +using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -51,12 +52,12 @@ public override void SetStaticDefaults() #region "Переменные" int TimeToAnimation = AnimationRate; - int Frame = 0; + int Frame; bool Shoots = true; int TimeToShoot = ShootRate; - int State = 0; + int State; int TimeToState = StateTime_Flying; - bool runAway = false; + bool runAway; #endregion public override void SetDefaults() @@ -91,9 +92,9 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AlchemasterGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AlchemasterGore2"), 1f); @@ -101,14 +102,14 @@ public override void HitEffect(int hitDirection, double damage) Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AlchemasterGore3"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AlchemasterGore4"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AlchemasterGore4"), 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * hitDirection, -2.5f, 0, default(Color), 3.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); } } @@ -136,7 +137,7 @@ void PlayAnimation() Vector2 VelocityFPTP(Vector2 pos1, Vector2 pos2, float speed) { Vector2 move = pos2 - pos1; - return move * (speed / (float)System.Math.Sqrt(move.X * move.X + move.Y * move.Y)); + return move * (speed / (float)Math.Sqrt(move.X * move.X + move.Y * move.Y)); } void FlameShoot() @@ -238,8 +239,8 @@ public override void NPCLoot() if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (!Main.expertMode && Main.rand.Next(7) == 0) diff --git a/NPCs/Alchemist.cs b/NPCs/Alchemist.cs index f0ae6c3d..aaf750e5 100644 --- a/NPCs/Alchemist.cs +++ b/NPCs/Alchemist.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -8,21 +8,9 @@ namespace Tremor.NPCs [AutoloadHead] public class Alchemist : ModNPC { - public override string Texture - { - get - { - return "Tremor/NPCs/Alchemist"; - } - } + public override string Texture => "Tremor/NPCs/Alchemist"; - public override string[] AltTextures - { - get - { - return new string[] { "Tremor/NPCs/Alchemist" }; - } - } + public override string[] AltTextures => new[] { "Tremor/NPCs/Alchemist" }; public override bool Autoload(ref string name) @@ -250,7 +238,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AlchemistGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AlchemistGore2"), 1f); diff --git a/NPCs/AlphaWolf.cs b/NPCs/AlphaWolf.cs index 32d8945f..945d1821 100644 --- a/NPCs/AlphaWolf.cs +++ b/NPCs/AlphaWolf.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -32,8 +32,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } @@ -41,8 +41,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(2) == 0) { @@ -69,7 +69,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AlphaWolfGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AlphaWolfGore2"), 1f); @@ -81,7 +81,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneSnow && !Main.dayTime && y < Main.worldSurface ? 0.08f : 0f; } } diff --git a/NPCs/AncientCursedSkull.cs b/NPCs/AncientCursedSkull.cs index 25b78d62..e3acf79f 100644 --- a/NPCs/AncientCursedSkull.cs +++ b/NPCs/AncientCursedSkull.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -37,15 +37,15 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDungeon && NPC.downedMoonlord && Main.hardMode && y > Main.rockLayer ? 0.008f : 0f; } @@ -55,23 +55,23 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 60; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 15, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 15, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 15, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 15, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 15, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 15, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 15, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 15, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } - Dust.NewDust(npc.position, npc.width, npc.height, 15, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 15, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 15, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 15, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 15, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 15, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } else { for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 15, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 15, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } } } diff --git a/NPCs/AndasBoss/Andas.cs b/NPCs/AndasBoss/Andas.cs index 72a3f8da..3d021063 100644 --- a/NPCs/AndasBoss/Andas.cs +++ b/NPCs/AndasBoss/Andas.cs @@ -1,7 +1,7 @@ -using Terraria; using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -46,7 +46,7 @@ public override void SetDefaults() const int ShootDirection = 7; const float Speed = 14f; const float Acceleration = 0.1f; - int Timer = 0; + int Timer; #endregion public override void AI() { @@ -66,8 +66,8 @@ public override void AI() Vector2 Velocity = Helper2.VelocityFPTP(npc.Center, new Vector2(Main.player[npc.target].Center.X, Main.player[npc.target].Center.Y + 20), 10); int Spread = 65; float SpreadMult = 0.05f; - Velocity.X = Velocity.X + (float)Main.rand.Next(-Spread, Spread + 1) * SpreadMult; - Velocity.Y = Velocity.Y + (float)Main.rand.Next(-Spread, Spread + 1) * SpreadMult; + Velocity.X = Velocity.X + Main.rand.Next(-Spread, Spread + 1) * SpreadMult; + Velocity.Y = Velocity.Y + Main.rand.Next(-Spread, Spread + 1) * SpreadMult; int i = Projectile.NewProjectile(npc.Center.X, npc.Center.Y + 20, Velocity.X, Velocity.Y, 258, ShootDamage, ShootKnockback); Main.projectile[i].hostile = true; Main.projectile[i].friendly = true; @@ -76,9 +76,9 @@ public override void AI() } if (Timer >= 0 && Timer <= 1000) //flight { - Vector2 StartPosition = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float DirectionX = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - StartPosition.X; - float DirectionY = (float)(Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - 120) - StartPosition.Y; + Vector2 StartPosition = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + float DirectionX = Main.player[npc.target].position.X + Main.player[npc.target].width / 2 - StartPosition.X; + float DirectionY = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - 120 - StartPosition.Y; float Length = (float)Math.Sqrt(DirectionX * DirectionX + DirectionY * DirectionY); float Num = Speed / Length; DirectionX = DirectionX * Num; diff --git a/NPCs/AndasBoss/InfernoSkull.cs b/NPCs/AndasBoss/InfernoSkull.cs index 2a400133..c8d83091 100644 --- a/NPCs/AndasBoss/InfernoSkull.cs +++ b/NPCs/AndasBoss/InfernoSkull.cs @@ -1,4 +1,5 @@ using System; +using System.IO; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; @@ -82,7 +83,7 @@ public override bool PreAI() projectile.netUpdate = true; } } - Player targetPlayer = Main.player[this.target]; + Player targetPlayer = Main.player[target]; Vector2 direction = targetPlayer.Center - projectile.Center; direction.Normalize(); projectile.velocity *= 0.98f; @@ -104,14 +105,14 @@ public override bool PreAI() return false; } - public override void SendExtraAI(System.IO.BinaryWriter writer) + public override void SendExtraAI(BinaryWriter writer) { - writer.Write(this.target); + writer.Write(target); } - public override void ReceiveExtraAI(System.IO.BinaryReader reader) + public override void ReceiveExtraAI(BinaryReader reader) { - this.target = reader.Read(); + target = reader.Read(); } } } diff --git a/NPCs/AndasBoss/MoltenSpirit.cs b/NPCs/AndasBoss/MoltenSpirit.cs index 81544528..d80a01ef 100644 --- a/NPCs/AndasBoss/MoltenSpirit.cs +++ b/NPCs/AndasBoss/MoltenSpirit.cs @@ -1,7 +1,7 @@ -using Terraria; using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -35,7 +35,7 @@ public override void SetDefaults() } int AnimationRate = 6; - int CurrentFrame = 0; + int CurrentFrame; int TimeToAnimation = 6; Rectangle GetFrame(int Number) @@ -57,20 +57,20 @@ public override bool PreAI() float acceleration = 0.011f; npc.TargetClosest(true); Vector2 center = npc.Center; - float deltaX = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - center.X; - float deltaY = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - center.Y; - float distance = (float)Math.Sqrt((double)deltaX * (double)deltaX + (double)deltaY * (double)deltaY); + float deltaX = Main.player[npc.target].position.X + Main.player[npc.target].width / 2 - center.X; + float deltaY = Main.player[npc.target].position.Y + Main.player[npc.target].height / 2 - center.Y; + float distance = (float)Math.Sqrt(deltaX * (double)deltaX + deltaY * (double)deltaY); npc.ai[1] += 1f; - if ((double)npc.ai[1] > 600.0) + if (npc.ai[1] > 600.0) { acceleration *= 8f; velMax = 4f; - if ((double)npc.ai[1] > 650.0) + if (npc.ai[1] > 650.0) { npc.ai[1] = 0f; } } - else if ((double)distance < 250.0) + else if (distance < 250.0) { npc.ai[0] += 0.9f; if (npc.ai[0] > 0f) @@ -94,17 +94,17 @@ public override bool PreAI() npc.ai[0] = -200f; } } - if ((double)distance > 350.0) + if (distance > 350.0) { velMax = 5f; acceleration = 0.3f; } - else if ((double)distance > 300.0) + else if (distance > 300.0) { velMax = 3f; acceleration = 0.2f; } - else if ((double)distance > 250.0) + else if (distance > 250.0) { velMax = 1.5f; acceleration = 0.1f; @@ -114,8 +114,8 @@ public override bool PreAI() float velLimitY = deltaY * stepRatio; if (Main.player[npc.target].dead) { - velLimitX = (float)((double)((float)npc.direction * velMax) / 2.0); - velLimitY = (float)((double)(-(double)velMax) / 2.0); + velLimitX = (float)(npc.direction * velMax / 2.0); + velLimitY = (float)(-(double)velMax / 2.0); } if (npc.velocity.X < velLimitX) { @@ -133,15 +133,15 @@ public override bool PreAI() { npc.velocity.Y = npc.velocity.Y - acceleration; } - if ((double)velLimitX > 0.0) + if (velLimitX > 0.0) { npc.spriteDirection = -1; - npc.rotation = (float)Math.Atan2((double)velLimitY, (double)velLimitX); + npc.rotation = (float)Math.Atan2(velLimitY, velLimitX); } - if ((double)velLimitX < 0.0) + if (velLimitX < 0.0) { npc.spriteDirection = 1; - npc.rotation = (float)Math.Atan2((double)velLimitY, (double)velLimitX) + 3.14f; + npc.rotation = (float)Math.Atan2(velLimitY, velLimitX) + 3.14f; } Player target = Main.player[npc.target]; int distance2 = (int)Math.Sqrt((npc.Center.X - target.Center.X) * (npc.Center.X - target.Center.X) + (npc.Center.Y - target.Center.Y) * (npc.Center.Y - target.Center.Y)); @@ -149,15 +149,15 @@ public override bool PreAI() { float num867 = 6f; int num869 = mod.ProjectileType("SpiritFire"); - Vector2 vector86 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num864 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector86.X; - float num865 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector86.Y; - float num866 = (float)Math.Sqrt((double)(num864 * num864 + num865 * num865)); + Vector2 vector86 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + float num864 = Main.player[npc.target].position.X + Main.player[npc.target].width / 2 - vector86.X; + float num865 = Main.player[npc.target].position.Y + Main.player[npc.target].height / 2 - vector86.Y; + float num866 = (float)Math.Sqrt(num864 * num864 + num865 * num865); num866 = num867 / num866; num864 *= num866; num865 *= num866; - num865 += (float)Main.rand.Next(-40, 41) * 0.01f; - num864 += (float)Main.rand.Next(-40, 41) * 0.01f; + num865 += Main.rand.Next(-40, 41) * 0.01f; + num864 += Main.rand.Next(-40, 41) * 0.01f; num865 += npc.velocity.Y * 0.5f; num864 += npc.velocity.X * 0.5f; vector86.X -= num864 * 1f; diff --git a/NPCs/AndasBoss/SpiritFire.cs b/NPCs/AndasBoss/SpiritFire.cs index 1b106f1b..76a979e2 100644 --- a/NPCs/AndasBoss/SpiritFire.cs +++ b/NPCs/AndasBoss/SpiritFire.cs @@ -83,8 +83,7 @@ public override void AI() { projectile.ai[0] += 1f; } - projectile.rotation += 0.3f * (float)projectile.direction; - return; + projectile.rotation += 0.3f * projectile.direction; } public override bool OnTileCollide(Vector2 oldVelocity) diff --git a/NPCs/AndasBoss/TrueAndas.cs b/NPCs/AndasBoss/TrueAndas.cs index e66f424e..46f66c01 100644 --- a/NPCs/AndasBoss/TrueAndas.cs +++ b/NPCs/AndasBoss/TrueAndas.cs @@ -1,7 +1,7 @@ -using Terraria; using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -46,7 +46,7 @@ public override void SetDefaults() const int ShootDirection = 7; const float Speed = 18f; const float Acceleration = 0.15f; - int Timer = 0; + int Timer; #endregion public override void AI() { @@ -61,9 +61,9 @@ public override void AI() Timer++; if (Timer >= 0 && Timer <= 1000) //flight { - Vector2 StartPosition = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float DirectionX = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - StartPosition.X; - float DirectionY = (float)(Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - 120) - StartPosition.Y; + Vector2 StartPosition = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + float DirectionX = Main.player[npc.target].position.X + Main.player[npc.target].width / 2 - StartPosition.X; + float DirectionY = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - 120 - StartPosition.Y; float Length = (float)Math.Sqrt(DirectionX * DirectionX + DirectionY * DirectionY); float Num = Speed / Length; DirectionX = DirectionX * Num; @@ -203,8 +203,8 @@ public override void NPCLoot() if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (!Main.expertMode) diff --git a/NPCs/AndasBoss/UndeadWyrmHead.cs b/NPCs/AndasBoss/UndeadWyrmHead.cs index 74f799d1..7c2acc6e 100644 --- a/NPCs/AndasBoss/UndeadWyrmHead.cs +++ b/NPCs/AndasBoss/UndeadWyrmHead.cs @@ -15,7 +15,7 @@ public override void SetStaticDefaults() DisplayName.SetDefault("Undead Wyrm"); } - bool TailSpawned = false; + bool TailSpawned; public static int ShootRate = 20; const int ShootDamage = 58; @@ -72,9 +72,9 @@ public override void AI() lol = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.width / 2), mod.NPCType("UndeadWyrmTail"), npc.whoAmI); } Main.npc[lol].realLife = npc.whoAmI; - Main.npc[lol].ai[2] = (float)npc.whoAmI; - Main.npc[lol].ai[1] = (float)Previous; - Main.npc[Previous].ai[0] = (float)lol; + Main.npc[lol].ai[2] = npc.whoAmI; + Main.npc[lol].ai[1] = Previous; + Main.npc[Previous].ai[0] = lol; //NetMessage.SendData(23, -1, -1, "", lol, 0f, 0f, 0f, 0); Previous = lol; } diff --git a/NPCs/AngerSoul.cs b/NPCs/AngerSoul.cs index 0b7da34b..a8b96ce1 100644 --- a/NPCs/AngerSoul.cs +++ b/NPCs/AngerSoul.cs @@ -1,9 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { [AutoloadBossHead] @@ -44,25 +43,25 @@ public override void AI() } public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) { if (npc.life <= 0) { - Dust.NewDust(npc.position, npc.width, npc.height, 64, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 64, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 64, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 64, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 64, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 64, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 64, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 64, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 64, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 64, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 64, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 64, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); - Dust.NewDust(npc.position, npc.width, npc.height, 64, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 64, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + Dust.NewDust(npc.position, npc.width, npc.height, 64, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 64, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.6f); + Dust.NewDust(npc.position, npc.width, npc.height, 64, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 64, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.6f); } } } diff --git a/NPCs/ArabianMerchant.cs b/NPCs/ArabianMerchant.cs index b123e41b..6e558f59 100644 --- a/NPCs/ArabianMerchant.cs +++ b/NPCs/ArabianMerchant.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -8,21 +8,9 @@ namespace Tremor.NPCs [AutoloadHead] public class ArabianMerchant : ModNPC { - public override string Texture - { - get - { - return "Tremor/NPCs/ArabianMerchant"; - } - } + public override string Texture => "Tremor/NPCs/ArabianMerchant"; - public override string[] AltTextures - { - get - { - return new string[] { "Tremor/NPCs/ArabianMerchant" }; - } - } + public override string[] AltTextures => new[] { "Tremor/NPCs/ArabianMerchant" }; public override bool Autoload(ref string name) { @@ -176,8 +164,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { @@ -192,7 +180,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ArabianMerchantGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ArabianMerchantGore2"), 1f); diff --git a/NPCs/ArchDemon.cs b/NPCs/ArchDemon.cs index 690dc0a2..f0e63c1a 100644 --- a/NPCs/ArchDemon.cs +++ b/NPCs/ArchDemon.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -34,8 +34,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void AI() @@ -53,7 +53,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ArchdemonGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ArchdemonGore1"), 1f); diff --git a/NPCs/Archer.cs b/NPCs/Archer.cs index fbe91304..025f73c8 100644 --- a/NPCs/Archer.cs +++ b/NPCs/Archer.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -8,21 +8,9 @@ namespace Tremor.NPCs [AutoloadHead] public class Archer : ModNPC { - public override string Texture - { - get - { - return "Tremor/NPCs/Archer"; - } - } + public override string Texture => "Tremor/NPCs/Archer"; - public override string[] AltTextures - { - get - { - return new string[] { "Tremor/NPCs/Archer" }; - } - } + public override string[] AltTextures => new[] { "Tremor/NPCs/Archer" }; public override bool Autoload(ref string name) { @@ -208,7 +196,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ArcherGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ArcherGore2"), 1f); diff --git a/NPCs/ArmoredJellyfish.cs b/NPCs/ArmoredJellyfish.cs index 59db1a00..170a47ab 100644 --- a/NPCs/ArmoredJellyfish.cs +++ b/NPCs/ArmoredJellyfish.cs @@ -1,9 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { @@ -35,8 +34,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -45,7 +44,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ArmoredGore"), 1f); } @@ -55,8 +54,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { @@ -69,7 +68,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return spawnInfo.player.ZoneCorrupt && y > Main.rockLayer ? 0.05f : 0f; } diff --git a/NPCs/Astrofly.cs b/NPCs/Astrofly.cs index 11245c5f..fd8e89bb 100644 --- a/NPCs/Astrofly.cs +++ b/NPCs/Astrofly.cs @@ -1,9 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { @@ -38,16 +37,16 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(2) == 0) { @@ -64,7 +63,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return spawnInfo.spawnTileY < Main.rockLayer && NPC.downedMoonlord && tile == mod.TileType("CometiteOreTile") || tile == mod.TileType("HardCometiteOreTile") ? 0.005f : 0f; } @@ -74,13 +73,13 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AstroflyGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AstroflyGore1"), 1f); @@ -91,9 +90,9 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 59, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, hitDirection, -1f, 0, default(Color), 0.7f); } } } diff --git a/NPCs/Atis.cs b/NPCs/Atis.cs index 0b754f2d..84a6e0c8 100644 --- a/NPCs/Atis.cs +++ b/NPCs/Atis.cs @@ -1,9 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { @@ -37,8 +36,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -47,7 +46,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AtisGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AtisGore1"), 1f); @@ -62,8 +61,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(25) == 0) { @@ -92,7 +91,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && y > Main.rockLayer ? 0.01f : 0f; } } diff --git a/NPCs/Avenger.cs b/NPCs/Avenger.cs index 34b8cb43..6859f5d2 100644 --- a/NPCs/Avenger.cs +++ b/NPCs/Avenger.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -36,8 +36,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -51,7 +51,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int num86 = 0; num86 < 50; num86++) { - int num87 = Dust.NewDust(npc.position, npc.width, npc.height, 71, (float)hitDirection, 0f, 200, default(Color), 1f); + int num87 = Dust.NewDust(npc.position, npc.width, npc.height, 71, hitDirection, 0f, 200, default(Color), 1f); Main.dust[num87].velocity *= 1.5f; Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AvengerGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AvengerGore1"), 1f); @@ -67,8 +67,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(3) == 0) { @@ -89,7 +89,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.03f : 0f; } } diff --git a/NPCs/BGiantSlime.cs b/NPCs/BGiantSlime.cs index 60de6815..e511ddd0 100644 --- a/NPCs/BGiantSlime.cs +++ b/NPCs/BGiantSlime.cs @@ -1,9 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { @@ -37,8 +36,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -47,13 +46,13 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Blue, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Blue, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Blue, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Blue, 0.7f); } - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Blue, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Blue, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Blue, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 1, 2.5f * (float)hitDirection, -2.5f, 0, Color.Blue, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Blue, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Blue, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Blue, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 1, 2.5f * hitDirection, -2.5f, 0, Color.Blue, 0.7f); } } @@ -66,8 +65,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { diff --git a/NPCs/Banshee.cs b/NPCs/Banshee.cs index 66467c94..1a6ba1dd 100644 --- a/NPCs/Banshee.cs +++ b/NPCs/Banshee.cs @@ -1,7 +1,7 @@ -using Terraria.ID; using Microsoft.Xna.Framework; -using Terraria; using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -39,8 +39,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) @@ -52,7 +52,7 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) if (npc.direction == 1) { effect = SpriteEffects.FlipHorizontally; } if (npc.direction == -1) { effect = SpriteEffects.None; } Vector2 drawPos = npc.oldPos[k] - Main.screenPosition; - Color color = npc.GetAlpha(lightColor) * ((float)(npc.oldPos.Length - k) / (float)npc.oldPos.Length); + Color color = npc.GetAlpha(lightColor) * ((npc.oldPos.Length - k) / (float)npc.oldPos.Length); Rectangle frame = new Rectangle(0, 0, 50, 62); frame.Y += 164 * (k / 60); @@ -89,8 +89,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(2) == 0) { @@ -117,13 +117,13 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BansheeGore1"), 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BansheeGore2"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BansheeGore2"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BansheeGore3"), 1f); @@ -134,7 +134,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && y > Main.rockLayer ? 0.004f : 0f; } diff --git a/NPCs/Barmadillo.cs b/NPCs/Barmadillo.cs index 82860718..d88661b9 100644 --- a/NPCs/Barmadillo.cs +++ b/NPCs/Barmadillo.cs @@ -1,9 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { @@ -46,7 +45,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 44, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 44, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BarmadilloGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BarmadilloGore2"), 1f); @@ -63,7 +62,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 44, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 44, hitDirection, -1f, 0, default(Color), 0.7f); } } } @@ -73,8 +72,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(2) == 0) { @@ -89,15 +88,15 @@ public override void NPCLoot() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return Main.hardMode && TremorWorld.downedTrinity && !spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.002f : 0f; } } diff --git a/NPCs/BetaWolf.cs b/NPCs/BetaWolf.cs index 8720611b..754a7b2a 100644 --- a/NPCs/BetaWolf.cs +++ b/NPCs/BetaWolf.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -32,16 +32,16 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(2) == 0) { @@ -60,7 +60,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BetaWolfGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BetaWolfGore2"), 1f); @@ -73,7 +73,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneSnow && y < Main.worldSurface ? 0.01f : 0f; } } diff --git a/NPCs/Bicholmere.cs b/NPCs/Bicholmere.cs index 8cb630d3..000d011d 100644 --- a/NPCs/Bicholmere.cs +++ b/NPCs/Bicholmere.cs @@ -1,9 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { @@ -36,8 +35,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -46,7 +45,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BicholmereGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BicholmereGore2"), 1f); @@ -60,8 +59,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { @@ -74,7 +73,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && y > Main.rockLayer ? 0.01f : 0f; } diff --git a/NPCs/Blazer.cs b/NPCs/Blazer.cs index 44b8fa4d..18cb1374 100644 --- a/NPCs/Blazer.cs +++ b/NPCs/Blazer.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -36,8 +36,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } @@ -48,7 +48,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } NPC.NewNPC((int)npc.position.X, (int)npc.position.Y - 48, 59); } @@ -58,7 +58,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && spawnInfo.spawnTileY > Main.maxTilesY - 200 ? 0.02f : 0; } } diff --git a/NPCs/BloodmoonWarrior1.cs b/NPCs/BloodmoonWarrior1.cs index d51f9ea4..85fc754b 100644 --- a/NPCs/BloodmoonWarrior1.cs +++ b/NPCs/BloodmoonWarrior1.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -36,8 +36,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -46,7 +46,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); @@ -60,8 +60,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(25) == 0) { @@ -77,7 +77,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.bloodMoon && y < Main.worldSurface ? 0.02f : 0f; } } diff --git a/NPCs/BloodmoonWarrior2.cs b/NPCs/BloodmoonWarrior2.cs index d81bb960..886864a4 100644 --- a/NPCs/BloodmoonWarrior2.cs +++ b/NPCs/BloodmoonWarrior2.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -36,8 +36,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -46,7 +46,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); @@ -60,8 +60,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(25) == 0) { @@ -77,7 +77,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.bloodMoon && y < Main.worldSurface ? 0.01f : 0f; } } diff --git a/NPCs/BloodmoonWarrior3.cs b/NPCs/BloodmoonWarrior3.cs index 74929aa6..257cc7b0 100644 --- a/NPCs/BloodmoonWarrior3.cs +++ b/NPCs/BloodmoonWarrior3.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -36,8 +36,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -46,7 +46,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); @@ -61,8 +61,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(25) == 0) { @@ -78,7 +78,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.bloodMoon && y < Main.worldSurface ? 0.01f : 0f; } } diff --git a/NPCs/BoneArcher.cs b/NPCs/BoneArcher.cs index b7233547..4b4b5b62 100644 --- a/NPCs/BoneArcher.cs +++ b/NPCs/BoneArcher.cs @@ -1,9 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { @@ -37,16 +36,16 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(45) == 0) { @@ -75,7 +74,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); @@ -89,7 +88,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedBoss3 && y > Main.rockLayer ? 0.02f : 0f; } diff --git a/NPCs/BoneFish.cs b/NPCs/BoneFish.cs index f5918b0a..3ab50646 100644 --- a/NPCs/BoneFish.cs +++ b/NPCs/BoneFish.cs @@ -1,10 +1,9 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { @@ -37,16 +36,16 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { @@ -64,7 +63,7 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) if (npc.direction == 1) { effect = SpriteEffects.FlipHorizontally; } if (npc.direction == -1) { effect = SpriteEffects.None; } Vector2 drawPos = npc.oldPos[k] - Main.screenPosition; - Color color = npc.GetAlpha(lightColor) * ((float)(npc.oldPos.Length - k) / (float)npc.oldPos.Length); + Color color = npc.GetAlpha(lightColor) * ((npc.oldPos.Length - k) / (float)npc.oldPos.Length); Rectangle frame = new Rectangle(0, 0, 38, 26); frame.Y += 164 * (k / 60); diff --git a/NPCs/BoneFlyer.cs b/NPCs/BoneFlyer.cs index 4f3c807e..c71240b5 100644 --- a/NPCs/BoneFlyer.cs +++ b/NPCs/BoneFlyer.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -34,16 +34,16 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { @@ -66,7 +66,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FlyerGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FlyerGore2"), 1f); @@ -80,7 +80,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.01f : 0f; } diff --git a/NPCs/Brutallisk.cs b/NPCs/Brutallisk.cs index 07f3b59b..2aca3c2e 100644 --- a/NPCs/Brutallisk.cs +++ b/NPCs/Brutallisk.cs @@ -14,10 +14,10 @@ public override void SetStaticDefaults() Main.npcFrameCount[npc.type] = 4; } - int timer = 0; - int timer2 = 0; - int timer3 = 0; - int timer4 = 0; + int timer; + int timer2; + int timer3; + int timer4; bool SpawnMinion = false; public static bool phase2 = false; public static bool phase3 = false; @@ -32,9 +32,9 @@ public override void SetStaticDefaults() int TimeToShoot = ShootRate; static int num1461 = 360; float num1453 = expertMode ? 15f : 14f; //сила рывка - float num1463 = 6.28318548f / (float)(num1461 / 2); + float num1463 = 6.28318548f / (num1461 / 2); int num1450 = expertMode ? 160 : 240; //частота рывка - int num1472 = 0; + int num1472; bool flag128; static float scaleFactor10 = expertMode ? 8.5f : 7.5f; //Vector2 value17 = Main.player[npc.target].Center + new Vector2(npc.ai[1], -200f) - npc.Center; @@ -75,7 +75,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BrutalliskGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BrutalliskGore2"), 1f); @@ -88,7 +88,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 59, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, hitDirection, -1f, 0, default(Color), 0.7f); } } } @@ -130,7 +130,7 @@ public override void AI() { if (npc.ai[1] == 0f) { - npc.ai[1] = (float)(300 * Math.Sign((npc.Center - Main.player[npc.target].Center).X)); + npc.ai[1] = 300 * Math.Sign((npc.Center - Main.player[npc.target].Center).X); } //value17 = Main.player[npc.target].Center + new Vector2(npc.ai[1], -200f) - npc.Center; //vector170 = Vector2.Normalize(Main.player[npc.target].Center + new Vector2(npc.ai[1], -200f) - npc.Center - npc.velocity) * scaleFactor10; @@ -149,7 +149,7 @@ public override void AI() npc.spriteDirection = -npc.direction; } npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num1450) + if (npc.ai[2] >= num1450) { num1472 = 0; switch ((int)npc.ai[3]) @@ -185,7 +185,7 @@ public override void AI() npc.ai[1] = 0f; npc.ai[2] = 0f; npc.velocity = Vector2.Normalize(Main.player[npc.target].Center - npc.Center) * num1453; - npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X); + npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X); if (Math.Sign(Main.player[npc.target].Center.X - npc.Center.X) != 0) { npc.direction = Math.Sign(Main.player[npc.target].Center.X - npc.Center.X); @@ -353,13 +353,13 @@ public override void AI() npc.ai[1]++; npc.TargetClosest(); Player tarP = Main.player[npc.target]; float num74 = 0.022f; - float num75 = tarP.position.X + (float)(tarP.width / 2); - float num76 = tarP.position.Y + (float)(tarP.height / 2); - Vector2 vector11 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - num75 = (float)((int)(num75 / 8f) * 8); - num76 = (float)((int)(num76 / 8f) * 8); - vector11.X = (float)((int)(vector11.X / 8f) * 8); - vector11.Y = (float)((int)(vector11.Y / 8f) * 8); + float num75 = tarP.position.X + tarP.width / 2; + float num76 = tarP.position.Y + tarP.height / 2; + Vector2 vector11 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + num75 = (int)(num75 / 8f) * 8; + num76 = (int)(num76 / 8f) * 8; + vector11.X = (int)(vector11.X / 8f) * 8; + vector11.Y = (int)(vector11.Y / 8f) * 8; num75 -= vector11.X; num76 -= vector11.Y; if ((tarP.position.X + 300 < npc.position.X || tarP.position.X - 300 > npc.position.X || tarP.position.Y + 300 < npc.position.Y || tarP.position.Y - 300 > npc.position.Y)) @@ -415,7 +415,7 @@ public override void AI() { npc.velocity.Y = -vector.Y; } - npc.rotation = (float)Math.Atan2((double)num76, (double)num75) - 1.57f; + npc.rotation = (float)Math.Atan2(num76, num75) - 1.57f; float num83 = 0.7f; if (npc.collideX) { @@ -434,11 +434,11 @@ public override void AI() { npc.netUpdate = true; npc.velocity.Y = npc.oldVelocity.Y * -num83; - if (npc.velocity.Y > 0f && (double)npc.velocity.Y < 1.5) + if (npc.velocity.Y > 0f && npc.velocity.Y < 1.5) { npc.velocity.Y = 2f; } - if (npc.velocity.Y < 0f && (double)npc.velocity.Y > -1.5) + if (npc.velocity.Y < 0f && npc.velocity.Y > -1.5) { npc.velocity.Y = -2f; } @@ -500,7 +500,7 @@ public override void AI() Vector2 VelocityFPTP(Vector2 pos1, Vector2 pos2, float speed) { Vector2 move = pos2 - pos1; - return move * (speed / (float)System.Math.Sqrt(move.X * move.X + move.Y * move.Y)); + return move * (speed / (float)Math.Sqrt(move.X * move.X + move.Y * move.Y)); } public override void NPCLoot() @@ -513,8 +513,8 @@ public override void NPCLoot() if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (!Main.expertMode && Main.rand.Next(4) == 0) diff --git a/NPCs/BrutalliskSpawnMobs.cs b/NPCs/BrutalliskSpawnMobs.cs index b84ff576..0c46c105 100644 --- a/NPCs/BrutalliskSpawnMobs.cs +++ b/NPCs/BrutalliskSpawnMobs.cs @@ -1,5 +1,6 @@ using Terraria; using Terraria.ModLoader; + //using Terraria.Content.Fonts; namespace Tremor.NPCs diff --git a/NPCs/Brute.cs b/NPCs/Brute.cs index 94821baa..001f9491 100644 --- a/NPCs/Brute.cs +++ b/NPCs/Brute.cs @@ -1,7 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; + namespace Tremor.NPCs { @@ -38,9 +39,9 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 60; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BruteGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BruteGore2"), 1f); @@ -53,8 +54,8 @@ public override void HitEffect(int hitDirection, double damage) for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -2f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -2f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 0.7f); } } } @@ -72,7 +73,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.001f : 0f; } } diff --git a/NPCs/BucketheadZombie.cs b/NPCs/BucketheadZombie.cs index 5023ca04..21e7e122 100644 --- a/NPCs/BucketheadZombie.cs +++ b/NPCs/BucketheadZombie.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -32,8 +32,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -42,7 +42,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore2"), 1f); @@ -56,8 +56,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(3) == 0) { @@ -70,7 +70,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && y < Main.worldSurface ? 0.01f : 0f; } } diff --git a/NPCs/CaveGolem.cs b/NPCs/CaveGolem.cs index 71791025..ae6efd77 100644 --- a/NPCs/CaveGolem.cs +++ b/NPCs/CaveGolem.cs @@ -1,9 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { @@ -36,8 +35,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -46,7 +45,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CaveGolemGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CaveGolemGore2"), 1f); @@ -60,8 +59,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(30) == 0) @@ -76,7 +75,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && y > Main.rockLayer ? 0.01f : 0f; } diff --git a/NPCs/Chef.cs b/NPCs/Chef.cs index 98231651..d85384c7 100644 --- a/NPCs/Chef.cs +++ b/NPCs/Chef.cs @@ -1,7 +1,7 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -9,21 +9,9 @@ namespace Tremor.NPCs [AutoloadHead] public class Chef : ModNPC { - public override string Texture - { - get - { - return "Tremor/NPCs/Chef"; - } - } + public override string Texture => "Tremor/NPCs/Chef"; - public override string[] AltTextures - { - get - { - return new string[] { "Tremor/NPCs/Chef" }; - } - } + public override string[] AltTextures => new[] { "Tremor/NPCs/Chef" }; public override bool Autoload(ref string name) { @@ -186,7 +174,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ChefGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ChefGore2"), 1f); diff --git a/NPCs/Clamper.cs b/NPCs/Clamper.cs index 404f5539..389a8539 100644 --- a/NPCs/Clamper.cs +++ b/NPCs/Clamper.cs @@ -1,8 +1,8 @@ -using Terraria.ID; -using System; +using System; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.NPCs { @@ -63,63 +63,63 @@ public override void AI() if (Main.netMode != 1) { --npc.localAI[0]; - if ((double)npc.localAI[0] <= 0.0) + if (npc.localAI[0] <= 0.0) { - npc.localAI[0] = (float)Main.rand.Next(10, 26); - npc.ai[0] = (float)Main.rand.Next(-5, 14); - npc.ai[1] = (float)Main.rand.Next(-5, 14); + npc.localAI[0] = Main.rand.Next(10, 26); + npc.ai[0] = Main.rand.Next(-5, 14); + npc.ai[1] = Main.rand.Next(-5, 14); npc.netUpdate = true; } } npc.TargetClosest(true); float num1 = 0.2f; float num2 = 10f; - if ((double)Main.npc[index].life < (double)Main.npc[index].lifeMax * 0.25) + if (Main.npc[index].life < Main.npc[index].lifeMax * 0.25) num2 += 5f; - if ((double)Main.npc[index].life < (double)Main.npc[index].lifeMax * 0.1) + if (Main.npc[index].life < Main.npc[index].lifeMax * 0.1) num2 += 5f; - float x = Main.npc[index].position.X + (float)(Main.npc[index].width / 2); - float y = Main.npc[index].position.Y + (float)(Main.npc[index].height / 2); + float x = Main.npc[index].position.X + Main.npc[index].width / 2; + float y = Main.npc[index].position.Y + Main.npc[index].height / 2; Vector2 vector2 = new Vector2(x, y); float num3 = x + npc.ai[0]; float num4 = y + npc.ai[1]; float num5 = num3 - vector2.X; float num6 = num4 - vector2.Y; - float num7 = (float)Math.Sqrt((double)num5 * (double)num5 + (double)num6 * (double)num6); + float num7 = (float)Math.Sqrt(num5 * (double)num5 + num6 * (double)num6); float num8 = num2 / num7; float num9 = num5 * num8; float num10 = num6 * num8; - if ((double)npc.position.X < (double)x + (double)num9) + if (npc.position.X < x + (double)num9) { npc.velocity.X += num1; - if ((double)npc.velocity.X < 0.0 && (double)num9 > 0.0) + if (npc.velocity.X < 0.0 && num9 > 0.0) npc.velocity.X *= 0.5f; } - else if ((double)npc.position.X > (double)x + (double)num9) + else if (npc.position.X > x + (double)num9) { npc.velocity.X -= num1; - if ((double)npc.velocity.X > 0.0 && (double)num9 < 0.0) + if (npc.velocity.X > 0.0 && num9 < 0.0) npc.velocity.X *= 0.5f; } - if ((double)npc.position.Y < (double)y + (double)num10) + if (npc.position.Y < y + (double)num10) { npc.velocity.Y += num1; - if ((double)npc.velocity.Y < 0.0 && (double)num10 > 0.0) + if (npc.velocity.Y < 0.0 && num10 > 0.0) npc.velocity.Y *= 0.5f; } - else if ((double)npc.position.Y > (double)y + (double)num10) + else if (npc.position.Y > y + (double)num10) { npc.velocity.Y -= num1; - if ((double)npc.velocity.Y > 0.0 && (double)num10 < 0.0) + if (npc.velocity.Y > 0.0 && num10 < 0.0) npc.velocity.Y *= 0.5f; } - if ((double)npc.velocity.X > 8.0) + if (npc.velocity.X > 8.0) npc.velocity.X = 8f; - if ((double)npc.velocity.X < -8.0) + if (npc.velocity.X < -8.0) npc.velocity.X = -8f; - if ((double)npc.velocity.Y > 8.0) + if (npc.velocity.Y > 8.0) npc.velocity.Y = 8f; - if ((double)npc.velocity.Y < -8.0) + if (npc.velocity.Y < -8.0) npc.velocity.Y = -8f; npc.rotation = Helper.rotateBetween2Points(npc.Center, Main.player[npc.target].Center) + 3.14f; } diff --git a/NPCs/Clamper2.cs b/NPCs/Clamper2.cs index e0762387..3ed7aba4 100644 --- a/NPCs/Clamper2.cs +++ b/NPCs/Clamper2.cs @@ -1,7 +1,7 @@ -using Terraria.ID; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.NPCs { diff --git a/NPCs/CloudSlime.cs b/NPCs/CloudSlime.cs index 9e4be3c1..ccec3033 100644 --- a/NPCs/CloudSlime.cs +++ b/NPCs/CloudSlime.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -40,37 +40,37 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 60; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 15, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 15, 3.5f * (float)hitDirection, -3.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 15, 4.5f * (float)hitDirection, -4.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 15, 1.5f * (float)hitDirection, -1.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 15, 0.5f * (float)hitDirection, -0.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 15, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 15, 3.5f * hitDirection, -3.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 15, 4.5f * hitDirection, -4.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 15, 1.5f * hitDirection, -1.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 15, 0.5f * hitDirection, -0.5f, 0, default(Color), 0.7f); } } else { for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 15, (float)hitDirection, -2f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 15, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 15, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 15, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 15, (float)hitDirection, -2f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 15, hitDirection, -2f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 15, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 15, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 15, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 15, hitDirection, -2f, 0, default(Color), 0.7f); } } } public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return Tremor.NoZoneAllowWater(spawnInfo) && spawnInfo.sky ? 0.02f : 0; } } diff --git a/NPCs/CogLord.cs b/NPCs/CogLord.cs index 80374ca4..3a1b18df 100644 --- a/NPCs/CogLord.cs +++ b/NPCs/CogLord.cs @@ -1,9 +1,9 @@ -using Terraria.ID; -using Terraria; -using System; -using Terraria.ModLoader; +using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; namespace Tremor.NPCs { @@ -20,13 +20,10 @@ public override void SetStaticDefaults() Vector2 CogHands = new Vector2(-1, -1); //Bool variables - bool Ram - { - get { return ((this.CogHands.X == -1 && this.CogHands.Y == -1) || npc.ai[1] == 1); } - } + bool Ram => ((CogHands.X == -1 && CogHands.Y == -1) || npc.ai[1] == 1); bool FirstAI = true; bool SecondAI = true; - bool NeedCheck = false; + bool NeedCheck; bool Flag = true; bool Flag1 = true; bool Flag2 = true; @@ -35,25 +32,22 @@ bool Ram //Float variables float DistanseBlood = 150f; float RotationSpeed = 0.3f; - float Rotation = 0.0f; + float Rotation; float LaserRotation = MathHelper.PiOver2; float NewRotation = MathHelper.PiOver2; //Int variables - int GetLaserDamage - { - get { return 30; } - } + int GetLaserDamage => 30; int AnimationRate = 6; - int CurrentFrame = 0; + int CurrentFrame; int TimeToAnimation = 6; - int Timer = 0; + int Timer; int Timer2 = 0; int ShootType = ProjectileID.HeatRay; int LaserPosition = 20; int ShootRate = 10; int TimeToShoot = 4; - float PreviousRageRotation = 0; + float PreviousRageRotation; //String variables string LeftHandName = "CogLordHand"; @@ -100,7 +94,7 @@ public override void AI() npc.TargetClosest(); if (Main.dayTime) { - this.Timer = 0; + Timer = 0; } if (NPC.AnyNPCs(mod.NPCType("CogLordProbe"))) { @@ -112,11 +106,11 @@ public override void AI() npc.position += npc.velocity * 1.7f; else npc.position += npc.velocity * 1.02f; - this.Timer++; - this.Animation(); + Timer++; + Animation(); for (int i = 0; i < Main.dust.Length; i++) { - if (Main.dust[i].type == DustID.Blood && npc.Distance(Main.dust[i].position) < this.DistanseBlood) + if (Main.dust[i].type == DustID.Blood && npc.Distance(Main.dust[i].position) < DistanseBlood) { Main.dust[i].scale /= 1000000f; Main.dust[i].active = false; @@ -142,9 +136,9 @@ public override void AI() { Flag = false; if (Main.expertMode) - this.CogMessage("Low health is detected. Launching support drones."); + CogMessage("Low health is detected. Launching support drones."); else - this.CogMessage("Low health is detected. Launching support drone."); + CogMessage("Low health is detected. Launching support drone."); if (Main.expertMode) NPC.NewNPC((int)npc.Center.X - 100, (int)npc.Center.Y - 100, mod.NPCType("CogLordProbe"), 0, npc.whoAmI, 0, 200); NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("CogLordProbe"), 0, npc.whoAmI, 0, 200); @@ -153,9 +147,9 @@ public override void AI() { Flag1 = false; if (Main.expertMode) - this.CogMessage("Low health is detected. Launching support drones."); + CogMessage("Low health is detected. Launching support drones."); else - this.CogMessage("Low health is detected. Launching support drone."); + CogMessage("Low health is detected. Launching support drone."); if (Main.expertMode) NPC.NewNPC((int)npc.Center.X - 100, (int)npc.Center.Y - 100, mod.NPCType("CogLordProbe"), 0, npc.whoAmI, 0, 200); NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("CogLordProbe"), 0, npc.whoAmI, 0, 200); @@ -164,84 +158,83 @@ public override void AI() { Flag2 = false; if (Main.expertMode) - this.CogMessage("Low health is detected. Launching support drones."); + CogMessage("Low health is detected. Launching support drones."); else - this.CogMessage("Low health is detected. Launching support drone."); + CogMessage("Low health is detected. Launching support drone."); if (Main.expertMode) NPC.NewNPC((int)npc.Center.X - 100, (int)npc.Center.Y - 100, mod.NPCType("CogLordProbe"), 0, npc.whoAmI, 0, 200); NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("CogLordProbe"), 0, npc.whoAmI, 0, 200); } - if (this.FirstAI) + if (FirstAI) { - this.FirstAI = false; + FirstAI = false; } else { - if (this.SecondAI) + if (SecondAI) { - this.MakeHands(); - this.SecondAI = false; - this.NeedCheck = true; + MakeHands(); + SecondAI = false; + NeedCheck = true; } } - if (!this.Ram) + if (!Ram) { - if (this.NeedCheck) - this.CheckHands(); - if (this.CogHands.Y != -1 && this.NeedCheck) + if (NeedCheck) + CheckHands(); + if (CogHands.Y != -1 && NeedCheck) { - Main.npc[(int)this.CogHands.Y].localAI[3] = 0; + Main.npc[(int)CogHands.Y].localAI[3] = 0; } } else { - if (this.Rockets) + if (Rockets) { - this.Rockets = false; - this.CogMessage("Protocol 10 is activated: Preparing for rocket storm."); + Rockets = false; + CogMessage("Protocol 10 is activated: Preparing for rocket storm."); } npc.frame = GetFrame(5); - this.Rotation += this.RotationSpeed; - npc.rotation = this.Rotation; + Rotation += RotationSpeed; + npc.rotation = Rotation; if ((int)(Main.time % 120) == 0) { for (int k = 0; k < ((Main.expertMode) ? 2 : 1); k++) { Vector2 Velocity = Helper.VelocityToPoint(npc.Center, Helper.RandomPointInArea(new Vector2(Main.player[Main.myPlayer].Center.X - 10, Main.player[Main.myPlayer].Center.Y - 10), new Vector2(Main.player[Main.myPlayer].Center.X + 20, Main.player[Main.myPlayer].Center.Y + 20)), 20); - int i = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, Velocity.X, Velocity.Y, 134, (int)(this.GetLaserDamage * ((Main.expertMode) ? 3 : 2)), 1f); + int i = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, Velocity.X, Velocity.Y, 134, GetLaserDamage * ((Main.expertMode) ? 3 : 2), 1f); Main.projectile[i].hostile = true; Main.projectile[i].tileCollide = true; Main.projectile[i].friendly = false; } } - if (this.NeedCheck) - this.CheckHands(); - if (this.CogHands.Y != -1 && this.NeedCheck) + if (NeedCheck) + CheckHands(); + if (CogHands.Y != -1 && NeedCheck) { - Main.npc[(int)this.CogHands.Y].localAI[3] = 1; + Main.npc[(int)CogHands.Y].localAI[3] = 1; } } - if (this.Timer == 400) + if (Timer == 400) { - this.CogMessage("Protocol 11 is activated: Clockwork laser cutter is being enabled."); + CogMessage("Protocol 11 is activated: Clockwork laser cutter is being enabled."); } - if (this.Timer >= 500 && this.Timer < 800) + if (Timer >= 500 && Timer < 800) { - this.PreviousRageRotation = 0f; + PreviousRageRotation = 0f; if (Main.netMode != 1) { - this.LaserRotation += 0.01f; - if (--this.TimeToShoot <= 0) + LaserRotation += 0.01f; + if (--TimeToShoot <= 0) { - this.TimeToShoot = this.ShootRate; + TimeToShoot = ShootRate; var ShootPos = npc.Center + new Vector2(0, 17); var ShootVel = new Vector2(0, 7).RotatedBy(LaserRotation); - int[] i = new int[] - { - Projectile.NewProjectile(ShootPos, ShootVel, this.ShootType, this.GetLaserDamage, 1f), - Projectile.NewProjectile(ShootPos, ShootVel.RotatedBy(MathHelper.PiOver2), this.ShootType, this.GetLaserDamage, 1f), - Projectile.NewProjectile(ShootPos, ShootVel.RotatedBy(MathHelper.Pi), this.ShootType, this.GetLaserDamage, 1f), - Projectile.NewProjectile(ShootPos, ShootVel.RotatedBy(-MathHelper.PiOver2), this.ShootType, this.GetLaserDamage, 1f) + int[] i = { + Projectile.NewProjectile(ShootPos, ShootVel, ShootType, GetLaserDamage, 1f), + Projectile.NewProjectile(ShootPos, ShootVel.RotatedBy(MathHelper.PiOver2), ShootType, GetLaserDamage, 1f), + Projectile.NewProjectile(ShootPos, ShootVel.RotatedBy(MathHelper.Pi), ShootType, GetLaserDamage, 1f), + Projectile.NewProjectile(ShootPos, ShootVel.RotatedBy(-MathHelper.PiOver2), ShootType, GetLaserDamage, 1f) }; for (int l = 0; l < i.Length; l++) { @@ -251,7 +244,7 @@ public override void AI() } } } - if (this.Timer >= 800 && this.Timer < 1200) + if (Timer >= 800 && Timer < 1200) { npc.velocity.X *= 2.00f; npc.velocity.Y *= 2.00f; @@ -262,53 +255,53 @@ public override void AI() npc.velocity.Y = (float)(Math.Sin(CLRad) * 4) * -1; } } - if (this.Timer == 1100) + if (Timer == 1100) { - this.CogMessage("Protocol 12 is activated: Summoning gears."); + CogMessage("Protocol 12 is activated: Summoning gears."); } - if (this.Timer > 1200 && this.Timer < 1700) + if (Timer > 1200 && Timer < 1700) { if ((int)(Main.time % 15) == 0) NPC.NewNPC((int)((Main.player[npc.target].position.X - 500) + Main.rand.Next(1000)), (int)((Main.player[npc.target].position.Y - 500) + Main.rand.Next(1000)), mod.NPCType("GogLordGog")); } - if (this.Timer == 1600) + if (Timer == 1600) { - this.CogMessage("Protocol 13 is activated: Rocket attack incoming."); + CogMessage("Protocol 13 is activated: Rocket attack incoming."); } - if (this.Timer >= 1700 && this.Timer < 1775) + if (Timer >= 1700 && Timer < 1775) { if (Helper.Chance(0.3f)) { var ShootPos = Main.player[npc.target].position + new Vector2(Main.rand.Next(-1000, 1000), -1000); var ShootVel = new Vector2(Main.rand.NextFloat(-3f, 3f), Main.rand.NextFloat(15f, 20f)); - int i = Projectile.NewProjectile(ShootPos, ShootVel, 134, (int)(this.GetLaserDamage * ((Main.expertMode) ? 3 : 2)), 1f); + int i = Projectile.NewProjectile(ShootPos, ShootVel, 134, GetLaserDamage * ((Main.expertMode) ? 3 : 2), 1f); Main.projectile[i].hostile = true; Main.projectile[i].tileCollide = true; Main.projectile[i].friendly = false; } } - if (this.Timer > 1775) + if (Timer > 1775) { - this.Rockets = true; - this.Timer = 0; + Rockets = true; + Timer = 0; } - this.Rotation = 0; + Rotation = 0; } public void CheckHands() { - if (this.CogHands.X != -1) - if (!((Main.npc[(int)this.CogHands.X].type == mod.NPCType(this.LeftHandName) && Main.npc[(int)this.CogHands.X].ai[1] == npc.whoAmI) && Main.npc[(int)this.CogHands.X].active)) - this.CogHands.X = -1; - if (this.CogHands.Y != -1) - if (!((Main.npc[(int)this.CogHands.Y].type == mod.NPCType(this.RightHandName) && Main.npc[(int)this.CogHands.Y].ai[1] == npc.whoAmI) && Main.npc[(int)this.CogHands.Y].active)) - this.CogHands.Y = -1; + if (CogHands.X != -1) + if (!((Main.npc[(int)CogHands.X].type == mod.NPCType(LeftHandName) && Main.npc[(int)CogHands.X].ai[1] == npc.whoAmI) && Main.npc[(int)CogHands.X].active)) + CogHands.X = -1; + if (CogHands.Y != -1) + if (!((Main.npc[(int)CogHands.Y].type == mod.NPCType(RightHandName) && Main.npc[(int)CogHands.Y].ai[1] == npc.whoAmI) && Main.npc[(int)CogHands.Y].active)) + CogHands.Y = -1; } public void MakeHands() { - this.CogHands.X = NPC.NewNPC((int)npc.Center.X - 50, (int)npc.Center.Y, mod.NPCType(LeftHandName), 0, 1, npc.whoAmI); - this.CogHands.Y = NPC.NewNPC((int)npc.Center.X + 50, (int)npc.Center.Y, mod.NPCType(RightHandName), 0, -1, npc.whoAmI); + CogHands.X = NPC.NewNPC((int)npc.Center.X - 50, (int)npc.Center.Y, mod.NPCType(LeftHandName), 0, 1, npc.whoAmI); + CogHands.Y = NPC.NewNPC((int)npc.Center.X + 50, (int)npc.Center.Y, mod.NPCType(RightHandName), 0, -1, npc.whoAmI); } public void Animation() @@ -334,10 +327,6 @@ public void CogMessage(string Message) { Main.NewText("[CL-AI]: " + Message, 208, 137, 55); } - else - { - //NetMessage.SendData(25, -1, -1, Text, 208, 137, 55, 150); - } } public override void NPCLoot() { diff --git a/NPCs/CogLordArm.cs b/NPCs/CogLordArm.cs index 02683ffe..a35021d7 100644 --- a/NPCs/CogLordArm.cs +++ b/NPCs/CogLordArm.cs @@ -1,8 +1,8 @@ -using Terraria.ID; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; namespace Tremor.NPCs { @@ -15,7 +15,7 @@ public override void SetStaticDefaults() //Int variables int AnimationRate = 6; - int CurrentFrame = 0; + int CurrentFrame; int TimeToAnimation = 6; //Float variables diff --git a/NPCs/CogLordArmSecond.cs b/NPCs/CogLordArmSecond.cs index 918fc5a4..063cab07 100644 --- a/NPCs/CogLordArmSecond.cs +++ b/NPCs/CogLordArmSecond.cs @@ -1,8 +1,8 @@ -using Terraria.ID; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; namespace Tremor.NPCs { @@ -15,7 +15,7 @@ public override void SetStaticDefaults() //Int variables int AnimationRate = 6; - int CurrentFrame = 0; + int CurrentFrame; int TimeToAnimation = 6; //Float variables diff --git a/NPCs/CogLordGun.cs b/NPCs/CogLordGun.cs index bf0e9498..c5a6a3f7 100644 --- a/NPCs/CogLordGun.cs +++ b/NPCs/CogLordGun.cs @@ -1,8 +1,8 @@ -using Terraria.ID; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; namespace Tremor.NPCs { @@ -100,8 +100,8 @@ void Shoot() Vector2 velocity = Helper.VelocityToPoint(npc.Center, Main.player[Main.npc[(int)npc.ai[1]].target].Center, ShootSpeed); for (int l = 0; l < 2; l++) { - velocity.X = velocity.X + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - velocity.Y = velocity.Y + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.X = velocity.X + Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.Y = velocity.Y + Main.rand.Next(-spread, spread + 1) * spreadMult; int i = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, velocity.X, velocity.Y, ShootType, ShootDamage, ShootKN); Main.projectile[i].hostile = true; Main.projectile[i].friendly = false; diff --git a/NPCs/CogLordHand.cs b/NPCs/CogLordHand.cs index 71fb756e..0c68eb94 100644 --- a/NPCs/CogLordHand.cs +++ b/NPCs/CogLordHand.cs @@ -1,8 +1,8 @@ -using Terraria.ID; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; namespace Tremor.NPCs { @@ -32,7 +32,7 @@ public override void SetDefaults() const float MaxDist = 250f; bool FirstAI = true; - int timer = 0; + int timer; public override void AI() { timer++; diff --git a/NPCs/CogLordProbe.cs b/NPCs/CogLordProbe.cs index 83187fa8..aa144705 100644 --- a/NPCs/CogLordProbe.cs +++ b/NPCs/CogLordProbe.cs @@ -1,7 +1,7 @@ -using Terraria.ID; -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -39,9 +39,9 @@ public override void AI() { npc.Center = Main.npc[(int)npc.ai[0]].Center; } - if (--this.TimeToShoot <= 0) + if (--TimeToShoot <= 0) { - this.TimeToShoot = this.ShootRate; + TimeToShoot = ShootRate; NPC parent = Main.npc[NPC.FindFirstNPC(mod.NPCType("CogLord"))]; Vector2 Velocity = Helper.VelocityToPoint(npc.Center, parent.Center, 20); int k = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, Velocity.X, Velocity.Y, mod.ProjectileType("CogLordLaser"), 100, 1f); diff --git a/NPCs/ColossalTortoise.cs b/NPCs/ColossalTortoise.cs index b49c8977..ea0dd6ca 100644 --- a/NPCs/ColossalTortoise.cs +++ b/NPCs/ColossalTortoise.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -33,8 +33,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void AI() @@ -52,8 +52,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { @@ -72,9 +72,9 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 60; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 3, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 3, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 3, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 3, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ColossusTortoiseGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ColossusTortoiseGore2"), 1f); @@ -88,8 +88,8 @@ public override void HitEffect(int hitDirection, double damage) for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 3, (float)hitDirection, -2f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 3, hitDirection, -2f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 0.7f); } } } @@ -98,7 +98,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneJungle && NPC.downedMoonlord && Main.hardMode && y < Main.worldSurface ? 0.0002f : 0f; } diff --git a/NPCs/CometHead.cs b/NPCs/CometHead.cs index 53816175..1338e4ea 100644 --- a/NPCs/CometHead.cs +++ b/NPCs/CometHead.cs @@ -1,8 +1,8 @@ -using Terraria.ID; +using System.Linq; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using System.Linq; namespace Tremor.NPCs { @@ -37,8 +37,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } @@ -51,8 +51,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(2) == 0) { @@ -69,17 +69,17 @@ public override void HitEffect(int hitDirection, double damage) { if (npc.life <= 0) { - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.6f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.6f); } } } diff --git a/NPCs/ConjurerSkeleton.cs b/NPCs/ConjurerSkeleton.cs index 4734c335..c6125304 100644 --- a/NPCs/ConjurerSkeleton.cs +++ b/NPCs/ConjurerSkeleton.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -35,7 +35,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedBoss3 && y > Main.rockLayer ? 0.02f : 0f; } @@ -44,8 +44,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(6) == 0) { @@ -64,7 +64,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); diff --git a/NPCs/CoreBug.cs b/NPCs/CoreBug.cs index 427bdb8c..e7f80a73 100644 --- a/NPCs/CoreBug.cs +++ b/NPCs/CoreBug.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -35,21 +35,21 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) { if (npc.life <= 0) { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.6f); } } } @@ -67,7 +67,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneMeteor ? 0.005f : 0f; } } diff --git a/NPCs/CoreSlime.cs b/NPCs/CoreSlime.cs index 3865c99a..21f02ca9 100644 --- a/NPCs/CoreSlime.cs +++ b/NPCs/CoreSlime.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -36,13 +36,13 @@ public override void HitEffect(int hitDirection, double damage) { if (npc.life <= 0) { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.6f); } } } @@ -58,15 +58,15 @@ public override void AI() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneMeteor ? 0.005f : 0f; } } diff --git a/NPCs/Coretaur.cs b/NPCs/Coretaur.cs index c224a080..dbd798db 100644 --- a/NPCs/Coretaur.cs +++ b/NPCs/Coretaur.cs @@ -1,7 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; + namespace Tremor.NPCs { public class Coretaur : ModNPC @@ -34,8 +35,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { @@ -49,9 +50,9 @@ public override void HitEffect(int hitDirection, double damage) { if (npc.life <= 0) { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CoretaurGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CoretaurGore2"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CoretaurGore2"), 1f); @@ -59,12 +60,12 @@ public override void HitEffect(int hitDirection, double damage) Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CoretaurGore3"), 1f); for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.6f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.6f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.6f); } } } @@ -83,7 +84,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedBoss3 && spawnInfo.spawnTileY > Main.maxTilesY - 200 ? 0.005f : 0f; } } diff --git a/NPCs/CorruptedBicholmere.cs b/NPCs/CorruptedBicholmere.cs index e40a1b77..61eac697 100644 --- a/NPCs/CorruptedBicholmere.cs +++ b/NPCs/CorruptedBicholmere.cs @@ -1,9 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { @@ -35,8 +34,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -45,7 +44,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CorruptedBihcolmereGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CorruptedBicholmereGore2"), 1f); @@ -59,8 +58,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { @@ -73,7 +72,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneCorrupt && y > Main.rockLayer ? 0.05f : 0f; } diff --git a/NPCs/CreatorofNightmares.cs b/NPCs/CreatorofNightmares.cs index f341b0d2..c7a0bfda 100644 --- a/NPCs/CreatorofNightmares.cs +++ b/NPCs/CreatorofNightmares.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -38,8 +38,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(5) == 0) { @@ -50,15 +50,15 @@ public override void NPCLoot() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) { if (npc.life <= 0) { - Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); Gore.NewGore(npc.position, npc.velocity, 99, 1f); Gore.NewGore(npc.position, npc.velocity, 99, 1f); Gore.NewGore(npc.position, npc.velocity, 99, 1f); @@ -66,7 +66,7 @@ public override void HitEffect(int hitDirection, double damage) Gore.NewGore(npc.position, npc.velocity, 99, 1f); for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); } } } @@ -75,7 +75,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return Tremor.NormalSpawn(spawnInfo) && spawnInfo.spawnTileY < Main.rockLayer && NPC.downedMoonlord && Main.eclipse ? 0.01f : 0f; } } diff --git a/NPCs/Crimer.cs b/NPCs/Crimer.cs index 7d95292c..6bd0a50e 100644 --- a/NPCs/Crimer.cs +++ b/NPCs/Crimer.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -35,8 +35,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } @@ -47,7 +47,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } NPC.NewNPC((int)npc.position.X, (int)npc.position.Y - 48, 183); } @@ -57,7 +57,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneCrimson && Main.hardMode && y < Main.worldSurface ? 0.02f : 0f; } } diff --git a/NPCs/CrimsonBicholmere.cs b/NPCs/CrimsonBicholmere.cs index 03ceb903..ab6eb90e 100644 --- a/NPCs/CrimsonBicholmere.cs +++ b/NPCs/CrimsonBicholmere.cs @@ -1,9 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { @@ -35,8 +34,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -45,7 +44,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CrimsonBicholmereGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CrimsonBicholmereGore2"), 1f); @@ -59,8 +58,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { @@ -73,7 +72,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneCrimson && y > Main.rockLayer ? 0.01f : 0f; } diff --git a/NPCs/CyberKing.cs b/NPCs/CyberKing.cs index fa40f229..e7627070 100644 --- a/NPCs/CyberKing.cs +++ b/NPCs/CyberKing.cs @@ -1,7 +1,7 @@ -using Terraria.ID; using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -109,27 +109,27 @@ public override void AI() npc.TargetClosest(true); int num1319 = 800; float num1320 = Math.Abs(npc.Center.X - Main.player[npc.target].Center.X); - if (npc.Center.X < Main.player[npc.target].Center.X && npc.ai[2] < 0f && num1320 > (float)num1319) + if (npc.Center.X < Main.player[npc.target].Center.X && npc.ai[2] < 0f && num1320 > num1319) { npc.ai[2] = 0f; } - if (npc.Center.X > Main.player[npc.target].Center.X && npc.ai[2] > 0f && num1320 > (float)num1319) + if (npc.Center.X > Main.player[npc.target].Center.X && npc.ai[2] > 0f && num1320 > num1319) { npc.ai[2] = 0f; } float num1321 = 0.45f; float num1322 = 7f; - if ((double)npc.life < (double)npc.lifeMax * 0.75) + if (npc.life < npc.lifeMax * 0.75) { num1321 = 0.55f; num1322 = 8f; } - if ((double)npc.life < (double)npc.lifeMax * 0.5) + if (npc.life < npc.lifeMax * 0.5) { num1321 = 0.7f; num1322 = 10f; } - if ((double)npc.life < (double)npc.lifeMax * 0.25) + if (npc.life < npc.lifeMax * 0.25) { num1321 = 0.8f; num1322 = 11f; @@ -143,7 +143,7 @@ public override void AI() { npc.velocity.X = -num1322; } - float num1323 = Main.player[npc.target].position.Y - (npc.position.Y + (float)npc.height); + float num1323 = Main.player[npc.target].position.Y - (npc.position.Y + npc.height); if (num1323 < 150f) { npc.velocity.Y = npc.velocity.Y - 0.2f; @@ -165,40 +165,40 @@ public override void AI() { npc.ai[3] += 1f; int num1324 = 13; - if ((double)npc.life < (double)npc.lifeMax * 0.75) + if (npc.life < npc.lifeMax * 0.75) { num1324 = 12; } - if ((double)npc.life < (double)npc.lifeMax * 0.5) + if (npc.life < npc.lifeMax * 0.5) { num1324 = 11; } - if ((double)npc.life < (double)npc.lifeMax * 0.25) + if (npc.life < npc.lifeMax * 0.25) { num1324 = 10; } num1324++; - if (npc.ai[3] > (float)num1324) + if (npc.ai[3] > num1324) { - npc.ai[3] = (float)(-(float)num1324); + npc.ai[3] = -(float)num1324; } if (npc.ai[3] == 0f && Main.netMode != 1) { Vector2 vector159 = new Vector2(npc.Center.X, npc.Center.Y); vector159.X += npc.velocity.X * 7f; - float num1325 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector159.X; + float num1325 = Main.player[npc.target].position.X + Main.player[npc.target].width * 0.5f - vector159.X; float num1326 = Main.player[npc.target].Center.Y - vector159.Y; - float num1327 = (float)Math.Sqrt((double)(num1325 * num1325 + num1326 * num1326)); + float num1327 = (float)Math.Sqrt(num1325 * num1325 + num1326 * num1326); float num1328 = 6f; - if ((double)npc.life < (double)npc.lifeMax * 0.75) + if (npc.life < npc.lifeMax * 0.75) { num1328 = 7f; } - if ((double)npc.life < (double)npc.lifeMax * 0.5) + if (npc.life < npc.lifeMax * 0.5) { num1328 = 8f; } - if ((double)npc.life < (double)npc.lifeMax * 0.25) + if (npc.life < npc.lifeMax * 0.25) { num1328 = 9f; } @@ -214,7 +214,7 @@ public override void AI() } if (Main.netMode != 1) { - npc.ai[1] += (float)Main.rand.Next(1, 4); + npc.ai[1] += Main.rand.Next(1, 4); if (npc.ai[1] > 800f && num1320 < 600f) { npc.ai[0] = -1f; @@ -226,17 +226,17 @@ public override void AI() npc.TargetClosest(true); float num1329 = 0.15f; float num1330 = 7f; - if ((double)npc.life < (double)npc.lifeMax * 0.75) + if (npc.life < npc.lifeMax * 0.75) { num1329 = 0.17f; num1330 = 8f; } - if ((double)npc.life < (double)npc.lifeMax * 0.5) + if (npc.life < npc.lifeMax * 0.5) { num1329 = 0.2f; num1330 = 9f; } - if ((double)npc.life < (double)npc.lifeMax * 0.25) + if (npc.life < npc.lifeMax * 0.25) { num1329 = 0.25f; num1330 = 10f; @@ -263,7 +263,7 @@ public override void AI() { npc.velocity.X = npc.velocity.X * 0.95f; } - float num1331 = Main.player[npc.target].position.Y - (npc.position.Y + (float)npc.height); + float num1331 = Main.player[npc.target].position.Y - (npc.position.Y + npc.height); if (num1331 < 180f) { npc.velocity.Y = npc.velocity.Y - 0.1f; @@ -285,27 +285,27 @@ public override void AI() { npc.ai[3] += 1f; int num1332 = 15; - if ((double)npc.life < (double)npc.lifeMax * 0.75) + if (npc.life < npc.lifeMax * 0.75) { num1332 = 14; } - if ((double)npc.life < (double)npc.lifeMax * 0.5) + if (npc.life < npc.lifeMax * 0.5) { num1332 = 12; } - if ((double)npc.life < (double)npc.lifeMax * 0.25) + if (npc.life < npc.lifeMax * 0.25) { num1332 = 10; } - if ((double)npc.life < (double)npc.lifeMax * 0.1) + if (npc.life < npc.lifeMax * 0.1) { num1332 = 8; } num1332 += 3; - if (npc.ai[3] >= (float)num1332) + if (npc.ai[3] >= num1332) { npc.ai[3] = 0f; - Vector2 vector160 = new Vector2(npc.Center.X, npc.position.Y + (float)npc.height - 14f); + Vector2 vector160 = new Vector2(npc.Center.X, npc.position.Y + npc.height - 14f); int i2 = (int)(vector160.X / 16f); int j2 = (int)(vector160.Y / 16f); if (!WorldGen.SolidTile(i2, j2)) @@ -317,13 +317,13 @@ public override void AI() } num1333 += 3f; float speedX2 = npc.velocity.X * 0.25f; - Projectile.NewProjectile(vector160.X, vector160.Y, speedX2, num1333, mod.ProjectileType("RedPulsePro"), 42, 0f, Main.myPlayer, (float)Main.rand.Next(5), 0f); + Projectile.NewProjectile(vector160.X, vector160.Y, speedX2, num1333, mod.ProjectileType("RedPulsePro"), 42, 0f, Main.myPlayer, Main.rand.Next(5), 0f); } } } if (Main.netMode != 1) { - npc.ai[1] += (float)Main.rand.Next(1, 4); + npc.ai[1] += Main.rand.Next(1, 4); if (npc.ai[1] > 600f) { npc.ai[0] = -1f; @@ -334,9 +334,9 @@ public override void AI() { npc.TargetClosest(true); Vector2 vector161 = new Vector2(npc.Center.X, npc.Center.Y - 20f); - float num1334 = (float)Main.rand.Next(-1000, 1001); - float num1335 = (float)Main.rand.Next(-1000, 1001); - float num1336 = (float)Math.Sqrt((double)(num1334 * num1334 + num1335 * num1335)); + float num1334 = Main.rand.Next(-1000, 1001); + float num1335 = Main.rand.Next(-1000, 1001); + float num1336 = (float)Math.Sqrt(num1334 * num1334 + num1335 * num1335); float num1337 = 15f; npc.velocity *= 0.95f; num1336 = num1337 / num1336; @@ -347,30 +347,30 @@ public override void AI() vector161.Y += num1335 * 4f; npc.ai[3] += 1f; int num1338 = 7; - if ((double)npc.life < (double)npc.lifeMax * 0.75) + if (npc.life < npc.lifeMax * 0.75) { num1338--; } - if ((double)npc.life < (double)npc.lifeMax * 0.5) + if (npc.life < npc.lifeMax * 0.5) { num1338 -= 2; } - if ((double)npc.life < (double)npc.lifeMax * 0.25) + if (npc.life < npc.lifeMax * 0.25) { num1338 -= 3; } - if ((double)npc.life < (double)npc.lifeMax * 0.1) + if (npc.life < npc.lifeMax * 0.1) { num1338 -= 4; } - if (npc.ai[3] > (float)num1338) + if (npc.ai[3] > num1338) { npc.ai[3] = 0f; Projectile.NewProjectile(vector161.X, vector161.Y, num1334, num1335, mod.ProjectileType("PurplePulsePro"), 30, 0f, Main.myPlayer, 0f, 0f); } if (Main.netMode != 1) { - npc.ai[1] += (float)Main.rand.Next(1, 4); + npc.ai[1] += Main.rand.Next(1, 4); if (npc.ai[1] > 500f) { npc.ai[0] = -1f; @@ -385,11 +385,10 @@ public override void AI() { num1339 = 0; } - npc.ai[0] = (float)num1339; + npc.ai[0] = num1339; npc.ai[1] = 0f; npc.ai[2] = 0f; npc.ai[3] = 0f; - return; } } @@ -402,8 +401,8 @@ public override void NPCLoot() } if (Main.netMode != 1) { - int CenterX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int CenterY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int CenterX = (int)(npc.position.X + npc.width / 2) / 16; + int CenterY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (!Main.expertMode && Main.rand.Next(1) == 0) diff --git a/NPCs/Cybermite.cs b/NPCs/Cybermite.cs index 6325e2cc..209bbf26 100644 --- a/NPCs/Cybermite.cs +++ b/NPCs/Cybermite.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs diff --git a/NPCs/DarkDruid.cs b/NPCs/DarkDruid.cs index 00804a74..264c7b7a 100644 --- a/NPCs/DarkDruid.cs +++ b/NPCs/DarkDruid.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -35,8 +35,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void AI() @@ -63,7 +63,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); @@ -78,8 +78,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(20) == 0) { @@ -108,7 +108,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.bloodMoon && y < Main.worldSurface ? 0.004f : 0f; } } diff --git a/NPCs/DarkDruidMinion.cs b/NPCs/DarkDruidMinion.cs index 6333da0f..8d014fbc 100644 --- a/NPCs/DarkDruidMinion.cs +++ b/NPCs/DarkDruidMinion.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -33,16 +33,16 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(2) == 0) { @@ -57,7 +57,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); diff --git a/NPCs/DarkServant.cs b/NPCs/DarkServant.cs index 0b38ba66..1e7b0da6 100644 --- a/NPCs/DarkServant.cs +++ b/NPCs/DarkServant.cs @@ -1,9 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { @@ -38,13 +37,13 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * hitDirection, -2.5f, 0, Color.Green, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * hitDirection, -2.5f, 0, Color.Green, 0.7f); } - Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * hitDirection, -2.5f, 0, Color.Green, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * hitDirection, -2.5f, 0, Color.Green, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * hitDirection, -2.5f, 0, Color.Green, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * hitDirection, -2.5f, 0, Color.Green, 0.7f); Gore.NewGore(npc.position, npc.velocity, 99, 1f); Gore.NewGore(npc.position, npc.velocity, 99, 1f); Gore.NewGore(npc.position, npc.velocity, 99, 1f); @@ -55,8 +54,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(6) == 0) diff --git a/NPCs/DarkSlime.cs b/NPCs/DarkSlime.cs index b9ea9305..ecd60e60 100644 --- a/NPCs/DarkSlime.cs +++ b/NPCs/DarkSlime.cs @@ -1,9 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { @@ -38,10 +37,10 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * hitDirection, -2.5f, 0, Color.Green, 0.7f); } - Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * hitDirection, -2.5f, 0, Color.Green, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * hitDirection, -2.5f, 0, Color.Green, 0.7f); Gore.NewGore(npc.position, npc.velocity, 99, 1f); Gore.NewGore(npc.position, npc.velocity, 99, 1f); Gore.NewGore(npc.position, npc.velocity, 99, 1f); @@ -52,8 +51,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(8) == 0) diff --git a/NPCs/DeepwaterVilefish.cs b/NPCs/DeepwaterVilefish.cs index 890741f9..ada62ce0 100644 --- a/NPCs/DeepwaterVilefish.cs +++ b/NPCs/DeepwaterVilefish.cs @@ -1,9 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { @@ -35,8 +34,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -45,7 +44,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } } } @@ -54,8 +53,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { @@ -68,7 +67,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return spawnInfo.player.ZoneCorrupt && y > Main.rockLayer ? 0.05f : 0f; } diff --git a/NPCs/Deimos.cs b/NPCs/Deimos.cs index 409fae4a..f49ff23f 100644 --- a/NPCs/Deimos.cs +++ b/NPCs/Deimos.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -46,15 +46,15 @@ public override void AI() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.05f : 0f; } @@ -62,8 +62,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { @@ -86,17 +86,17 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 60; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 70, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 70, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); } for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); } - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 70, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * hitDirection, -2.5f, 0, default(Color), 3.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 70, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * hitDirection, -2.5f, 0, default(Color), 3.7f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DeimosGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DeimosGore2"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DeimosGore2"), 1f); @@ -106,7 +106,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); } } } diff --git a/NPCs/DesertMimic.cs b/NPCs/DesertMimic.cs index 94c4753c..01f03ede 100644 --- a/NPCs/DesertMimic.cs +++ b/NPCs/DesertMimic.cs @@ -1,6 +1,6 @@ +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; -using Microsoft.Xna.Framework; using Terraria.ModLoader; namespace Tremor.NPCs @@ -33,8 +33,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; Helper.DropItem(new Rectangle((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height), new Drop(mod.ItemType("AntlionFury"), 1, 1), new Drop(mod.ItemType("Hurricane"), 1, 2), new Drop(mod.ItemType("SandShuriken"), 1, 2), new Drop(mod.ItemType("CrawlerHook"), 1, 1), new Drop(0, 0, 0)); Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 500, Main.rand.Next(10)); @@ -47,7 +47,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && spawnInfo.player.ZoneDesert && y > Main.rockLayer ? 0.01f : 0f; } } diff --git a/NPCs/DesertMimicSummon.cs b/NPCs/DesertMimicSummon.cs index 7fc75116..6c3e3474 100644 --- a/NPCs/DesertMimicSummon.cs +++ b/NPCs/DesertMimicSummon.cs @@ -1,13 +1,13 @@ +using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria; namespace Tremor.NPCs { // Example Soul of Light/Soul of Night style NPC summon public class DesertMimicSummon : ModPlayer { - public int LastChest = 0; + public int LastChest; // This doesn't make sense, but this is around where this check happens in Vanilla Terraria. public override void PreUpdateBuffs() @@ -38,7 +38,7 @@ public static bool ChestItemSummonCheck(int x, int y, Mod mod) int numberDesertKey = 0; int numberOtherItems = 0; ushort tileType = Main.tile[Main.chest[num].x, Main.chest[num].y].type; - int tileStyle = (int)(Main.tile[Main.chest[num].x, Main.chest[num].y].frameX / 36); + int tileStyle = Main.tile[Main.chest[num].x, Main.chest[num].y].frameX / 36; if (TileID.Sets.BasicChest[tileType] && (tileStyle < 5 || tileStyle > 6)) { for (int i = 0; i < 40; i++) @@ -84,7 +84,7 @@ public static bool ChestItemSummonCheck(int x, int y, Mod mod) Main.chest[num].item[l] = new Item(); } Chest.DestroyChest(x, y); - NetMessage.SendData(34, -1, -1, null, 1, (float)x, (float)y, 0f, number, 0, 0); + NetMessage.SendData(34, -1, -1, null, 1, x, y, 0f, number, 0, 0); NetMessage.SendTileSquare(-1, x, y, 3); } int npcToSpawn = mod.NPCType("DesertMimic"); diff --git a/NPCs/DesertPrincess.cs b/NPCs/DesertPrincess.cs index 9ae58f10..2925aee4 100644 --- a/NPCs/DesertPrincess.cs +++ b/NPCs/DesertPrincess.cs @@ -42,7 +42,7 @@ Rectangle GetFrame(int Number) return new Rectangle(0, npc.frame.Height * (Number - 1), npc.frame.Width, npc.frame.Height); } - int CurrentFrame = 0; + int CurrentFrame; int TimeToAnimation = 4; public override void AI() { @@ -147,7 +147,7 @@ public override void AI() npc.ai[1] += 1f; if (npc.justHit) { - npc.ai[1] += (float)Main.rand.Next(10, 30); + npc.ai[1] += Main.rand.Next(10, 30); } if (npc.ai[1] >= 180f && Main.netMode != 1) { @@ -171,7 +171,6 @@ public override void AI() npc.ai[0] = 4f; } } - return; } } else @@ -212,7 +211,7 @@ public override void AI() } if (npc.ai[0] == 2f) { - npc.damage = (int)((double)npc.defDamage * 0.85); + npc.damage = (int)(npc.defDamage * 0.85); if (npc.target < 0 || !player.active || player.dead) { npc.TargetClosest(true); @@ -274,7 +273,6 @@ public override void AI() npc.ai[1] = 0f; npc.ai[2] = 0f; npc.ai[3] = 0f; - return; } } else @@ -349,15 +347,14 @@ public override void AI() } npc.ai[0] = 3.2f; npc.ai[1] = 0f; - npc.ai[1] = (float)npc.direction; - return; + npc.ai[1] = npc.direction; } } else { if (npc.ai[0] == 3.2f) { - npc.damage = (int)((double)npc.defDamage * 1.3); + npc.damage = (int)(npc.defDamage * 1.3); npc.collideX = false; npc.collideY = false; npc.noTileCollide = true; @@ -401,15 +398,15 @@ public override void AI() num1314 += Main.rand.Next(-num1316, num1316 + 1); if (!WorldGen.SolidTile(num1313, num1314)) { - while (!WorldGen.SolidTile(num1313, num1314) && (double)num1314 < Main.worldSurface) + while (!WorldGen.SolidTile(num1313, num1314) && num1314 < Main.worldSurface) { num1314++; } - if ((new Vector2((float)(num1313 * 16 + 8), (float)(num1314 * 16 + 8)) - player.Center).Length() < 600f) + if ((new Vector2(num1313 * 16 + 8, num1314 * 16 + 8) - player.Center).Length() < 600f) { npc.ai[0] = 4.1f; - npc.ai[1] = (float)num1313; - npc.ai[2] = (float)num1314; + npc.ai[1] = num1313; + npc.ai[2] = num1314; break; } } @@ -433,8 +430,8 @@ public override void AI() npc.noTileCollide = true; int num1317 = (int)npc.ai[1]; int num1318 = (int)npc.ai[2]; - float x2 = (float)(num1317 * 16 + 8); - float y2 = (float)(num1318 * 16 - 20); + float x2 = num1317 * 16 + 8; + float y2 = num1318 * 16 - 20; Vector2 vector207 = new Vector2(x2, y2); vector207 -= npc.Center; float num1319 = 6f + vector207.Length() / 150f; @@ -458,8 +455,8 @@ public override void AI() npc.noTileCollide = true; int num1321 = (int)npc.ai[1]; int num1322 = (int)npc.ai[2]; - float x3 = (float)(num1321 * 16 + 8); - float y3 = (float)(num1322 * 16 - 20); + float x3 = num1321 * 16 + 8; + float y3 = num1322 * 16 - 20; Vector2 vector208 = new Vector2(x3, y3); vector208 -= npc.Center; float num1323 = 4f; @@ -469,14 +466,14 @@ public override void AI() int num1325 = 70; if (Main.expertMode) { - num1325 = (int)((double)num1325 * 0.75); + num1325 = (int)(num1325 * 0.75); } npc.ai[3] += 1f; - if (npc.ai[3] == (float)num1325) + if (npc.ai[3] == num1325) { NPC.NewNPC(num1321 * 16 + 8, num1322 * 16, mod.NPCType("DesertPrincess2"), npc.whoAmI, 0f, 0f, 0f, 0f, 255); } - else if (npc.ai[3] == (float)(num1325 * 2)) + else if (npc.ai[3] == num1325 * 2) { npc.ai[0] = 0f; npc.ai[1] = 0f; @@ -498,7 +495,6 @@ public override void AI() vector208 *= num1323; } npc.velocity = (npc.velocity * (num1324 - 1f) + vector208) / num1324; - return; } } } @@ -521,8 +517,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; Helper.DropItem(new Rectangle((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height), new Drop(mod.ItemType("DesertExplorerVisage"), 1, 1), new Drop(mod.ItemType("DesertExplorerGreaves"), 1, 2), new Drop(mod.ItemType("DesertExplorerBreastplate"), 1, 2)); Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 500, Main.rand.Next(5, 15)); diff --git a/NPCs/DesertPrincess2.cs b/NPCs/DesertPrincess2.cs index 16857fe5..9da78cfb 100644 --- a/NPCs/DesertPrincess2.cs +++ b/NPCs/DesertPrincess2.cs @@ -40,7 +40,7 @@ Rectangle GetFrame(int Number) return new Rectangle(0, npc.frame.Height * (Number - 1), npc.frame.Width, npc.frame.Height); } - int CurrentFrame = 0; + int CurrentFrame; int TimeToAnimation = 4; public override void AI() { @@ -145,7 +145,7 @@ public override void AI() npc.ai[1] += 1f; if (npc.justHit) { - npc.ai[1] += (float)Main.rand.Next(10, 30); + npc.ai[1] += Main.rand.Next(10, 30); } if (npc.ai[1] >= 180f && Main.netMode != 1) { @@ -169,7 +169,6 @@ public override void AI() npc.ai[0] = 4f; } } - return; } } else @@ -210,7 +209,7 @@ public override void AI() } if (npc.ai[0] == 2f) { - npc.damage = (int)((double)npc.defDamage * 0.5); + npc.damage = (int)(npc.defDamage * 0.5); if (npc.target < 0 || !Main.player[npc.target].active || Main.player[npc.target].dead) { npc.TargetClosest(true); @@ -272,7 +271,6 @@ public override void AI() npc.ai[1] = 0f; npc.ai[2] = 0f; npc.ai[3] = 0f; - return; } } else @@ -347,15 +345,14 @@ public override void AI() } npc.ai[0] = 3.2f; npc.ai[1] = 0f; - npc.ai[1] = (float)npc.direction; - return; + npc.ai[1] = npc.direction; } } else { if (npc.ai[0] == 3.2f) { - npc.damage = (int)((double)npc.defDamage * 1.3); + npc.damage = (int)(npc.defDamage * 1.3); npc.collideX = false; npc.collideY = false; npc.noTileCollide = true; @@ -399,15 +396,15 @@ public override void AI() num1314 += Main.rand.Next(-num1316, num1316 + 1); if (!WorldGen.SolidTile(num1313, num1314)) { - while (!WorldGen.SolidTile(num1313, num1314) && (double)num1314 < Main.worldSurface) + while (!WorldGen.SolidTile(num1313, num1314) && num1314 < Main.worldSurface) { num1314++; } - if ((new Vector2((float)(num1313 * 16 + 8), (float)(num1314 * 16 + 8)) - Main.player[npc.target].Center).Length() < 600f) + if ((new Vector2(num1313 * 16 + 8, num1314 * 16 + 8) - Main.player[npc.target].Center).Length() < 600f) { npc.ai[0] = 4.1f; - npc.ai[1] = (float)num1313; - npc.ai[2] = (float)num1314; + npc.ai[1] = num1313; + npc.ai[2] = num1314; break; } } @@ -431,8 +428,8 @@ public override void AI() npc.noTileCollide = true; int num1317 = (int)npc.ai[1]; int num1318 = (int)npc.ai[2]; - float x2 = (float)(num1317 * 16 + 8); - float y2 = (float)(num1318 * 16 - 20); + float x2 = num1317 * 16 + 8; + float y2 = num1318 * 16 - 20; Vector2 vector207 = new Vector2(x2, y2); vector207 -= npc.Center; float num1319 = 6f + vector207.Length() / 150f; @@ -456,8 +453,8 @@ public override void AI() npc.noTileCollide = true; int num1321 = (int)npc.ai[1]; int num1322 = (int)npc.ai[2]; - float x3 = (float)(num1321 * 16 + 8); - float y3 = (float)(num1322 * 16 - 20); + float x3 = num1321 * 16 + 8; + float y3 = num1322 * 16 - 20; Vector2 vector208 = new Vector2(x3, y3); vector208 -= npc.Center; float num1323 = 4f; @@ -467,14 +464,14 @@ public override void AI() int num1325 = 70; if (Main.expertMode) { - num1325 = (int)((double)num1325 * 0.75); + num1325 = (int)(num1325 * 0.75); } npc.ai[3] += 1f; - if (npc.ai[3] == (float)num1325) + if (npc.ai[3] == num1325) { NPC.NewNPC(num1321 * 16 + 8, num1322 * 16, mod.NPCType("DesertPrincess2"), npc.whoAmI, 0f, 0f, 0f, 0f, 255); } - else if (npc.ai[3] == (float)(num1325 * 2)) + else if (npc.ai[3] == num1325 * 2) { npc.ai[0] = 0f; npc.ai[1] = 0f; @@ -496,7 +493,6 @@ public override void AI() vector208 *= num1323; } npc.velocity = (npc.velocity * (num1324 - 1f) + vector208) / num1324; - return; } } } diff --git a/NPCs/DevilishTortoise.cs b/NPCs/DevilishTortoise.cs index 7cd957d3..ba0596b7 100644 --- a/NPCs/DevilishTortoise.cs +++ b/NPCs/DevilishTortoise.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -36,8 +36,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } @@ -45,7 +45,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && spawnInfo.spawnTileY > Main.maxTilesY - 200 ? 0.02f : 0; } public override void HitEffect(int hitDirection, double damage) @@ -54,13 +54,13 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DevilishTortoiseGore"), 1f); } @@ -68,9 +68,9 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 0.7f); } } } diff --git a/NPCs/DevourerofPlanets.cs b/NPCs/DevourerofPlanets.cs index a8cf8994..fca356e0 100644 --- a/NPCs/DevourerofPlanets.cs +++ b/NPCs/DevourerofPlanets.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -38,16 +38,16 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { @@ -68,7 +68,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return Main.hardMode && TremorWorld.downedTrinity && !spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.005f : 0f; } @@ -78,13 +78,13 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DevourerofPlanetsGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DevourerofPlanetsGore2"), 1f); @@ -94,9 +94,9 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 27, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 22, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 22, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, hitDirection, -1f, 0, default(Color), 0.7f); } } } diff --git a/NPCs/Dinictis.cs b/NPCs/Dinictis.cs index c0e55346..0303280c 100644 --- a/NPCs/Dinictis.cs +++ b/NPCs/Dinictis.cs @@ -1,9 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { @@ -36,8 +35,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -46,7 +45,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DinictisGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DinictisGore2"), 1f); @@ -58,8 +57,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(35) == 0) { @@ -72,7 +71,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && (tile == 53 || tile == 112 || tile == 116 || tile == 234) && Tremor.NoZoneAllowWater(spawnInfo) && spawnInfo.water) && Main.hardMode && y < Main.rockLayer && (x < 250 || x > Main.maxTilesX - 250) && !spawnInfo.playerSafe ? 0.01f : 0f; } } diff --git a/NPCs/DragonMini.cs b/NPCs/DragonMini.cs index b80dbe62..c439a48d 100644 --- a/NPCs/DragonMini.cs +++ b/NPCs/DragonMini.cs @@ -1,8 +1,8 @@ -using Terraria; -using Terraria.ModLoader; -using Microsoft.Xna.Framework; -using Terraria.ID; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; namespace Tremor.NPCs { diff --git a/NPCs/DragonSkull.cs b/NPCs/DragonSkull.cs index f2431739..85d470e7 100644 --- a/NPCs/DragonSkull.cs +++ b/NPCs/DragonSkull.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -37,8 +37,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } @@ -46,7 +46,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && spawnInfo.spawnTileY > Main.maxTilesY - 200 ? 0.03f : 0; } public override void HitEffect(int hitDirection, double damage) @@ -55,13 +55,13 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DragonSkullGore"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DragonSkullGore2"), 1f); @@ -70,9 +70,9 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 0.7f); } } } @@ -80,8 +80,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) diff --git a/NPCs/Dragon_BodyB.cs b/NPCs/Dragon_BodyB.cs index 0cd021e6..639d955a 100644 --- a/NPCs/Dragon_BodyB.cs +++ b/NPCs/Dragon_BodyB.cs @@ -43,7 +43,7 @@ public override void SetDefaults() return false; } - int time = 0; + int time; public override void AI() { if (!Main.npc[(int)npc.ai[1]].active) @@ -63,7 +63,7 @@ public override void AI() if (npc.life < npc.lifeMax / 2 && Main.netMode != 1 && time == 0 && Main.rand.Next(9000) == 0) { time = 1; - int i = NPC.NewNPC((int)(npc.position.X + (float)(npc.width / 2)), (int)(npc.position.Y + (float)npc.height), mod.NPCType("DragonMini"), 0, 0f, 0f, 0f, 0f, 255); + int i = NPC.NewNPC((int)(npc.position.X + npc.width / 2), (int)(npc.position.Y + npc.height), mod.NPCType("DragonMini"), 0, 0f, 0f, 0f, 0f, 255); npc.frame = GetFrame(2); if (Main.netMode == 2 && i < 200) { diff --git a/NPCs/Dragon_HeadB.cs b/NPCs/Dragon_HeadB.cs index b5fefc76..98cc3523 100644 --- a/NPCs/Dragon_HeadB.cs +++ b/NPCs/Dragon_HeadB.cs @@ -16,7 +16,7 @@ public override void SetStaticDefaults() DisplayName.SetDefault("Ancient Dragon"); } - bool TailSpawned = false; + bool TailSpawned; public static int ShootRate = 20; const int ShootDamage = 58; @@ -66,8 +66,8 @@ public override void NPCLoot() if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (!Main.expertMode && Main.rand.Next(7) == 0) @@ -107,9 +107,9 @@ public override void AI() lol = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.width / 2), mod.NPCType("Dragon_LegB"), npc.whoAmI); } Main.npc[lol].realLife = npc.whoAmI; - Main.npc[lol].ai[2] = (float)npc.whoAmI; - Main.npc[lol].ai[1] = (float)Previous; - Main.npc[Previous].ai[0] = (float)lol; + Main.npc[lol].ai[2] = npc.whoAmI; + Main.npc[lol].ai[1] = Previous; + Main.npc[Previous].ai[0] = lol; //NetMessage.SendData(23, -1, -1, "", lol, 0f, 0f, 0f, 0); Previous = lol; } diff --git a/NPCs/Dranix.cs b/NPCs/Dranix.cs index 884dab3d..f0be33e6 100644 --- a/NPCs/Dranix.cs +++ b/NPCs/Dranix.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -45,16 +45,16 @@ public override void AI() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(2) == 0) { @@ -69,7 +69,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * hitDirection, -2.5f, 0, default(Color), 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DranixGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DranixGore2"), 1f); @@ -84,7 +84,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return Main.hardMode && NPC.downedMoonlord && !spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.04f : 0f; } } diff --git a/NPCs/DreadBeetle.cs b/NPCs/DreadBeetle.cs index b8c41fe6..7267ac36 100644 --- a/NPCs/DreadBeetle.cs +++ b/NPCs/DreadBeetle.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -35,16 +35,16 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(2) == 0) { @@ -66,7 +66,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return Main.hardMode && NPC.downedMoonlord && !spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.04f : 0f; } } diff --git a/NPCs/DungeonKeeper.cs b/NPCs/DungeonKeeper.cs index 2cb3fef8..68ec7427 100644 --- a/NPCs/DungeonKeeper.cs +++ b/NPCs/DungeonKeeper.cs @@ -1,7 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; + namespace Tremor.NPCs { @@ -34,8 +35,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -44,7 +45,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/KeeperGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/KeeperGore2"), 1f); @@ -57,8 +58,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(25) == 0) { @@ -71,7 +72,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.01f : 0f; } } diff --git a/NPCs/ElderObserver.cs b/NPCs/ElderObserver.cs index f101e35a..f44266a8 100644 --- a/NPCs/ElderObserver.cs +++ b/NPCs/ElderObserver.cs @@ -1,6 +1,7 @@ -using Terraria.ID; +using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -44,8 +45,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void AI() @@ -59,7 +60,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && Main.expertMode && Main.bloodMoon && y < Main.worldSurface ? 0.002f : 0f; } public override void HitEffect(int hitDirection, double damage) @@ -68,13 +69,13 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ElderObserverGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ElderObserverGore2"), 1f); @@ -85,9 +86,9 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 0.7f); } } } @@ -96,8 +97,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(10) == 0) { @@ -123,7 +124,7 @@ void Shoot() Vector2 VelocityFPTP(Vector2 pos1, Vector2 pos2, float speed) { Vector2 move = pos2 - pos1; - return move * (speed / (float)System.Math.Sqrt(move.X * move.X + move.Y * move.Y)); + return move * (speed / (float)Math.Sqrt(move.X * move.X + move.Y * move.Y)); } } } \ No newline at end of file diff --git a/NPCs/Elf.cs b/NPCs/Elf.cs index 1bbb3dba..24e36432 100644 --- a/NPCs/Elf.cs +++ b/NPCs/Elf.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -7,21 +7,9 @@ namespace Tremor.NPCs [AutoloadHead] public class Elf : ModNPC { - public override string Texture - { - get - { - return "Tremor/NPCs/Elf"; - } - } + public override string Texture => "Tremor/NPCs/Elf"; - public override string[] AltTextures - { - get - { - return new string[] { "Tremor/NPCs/Elf" }; - } - } + public override string[] AltTextures => new[] { "Tremor/NPCs/Elf" }; public override bool Autoload(ref string name) { diff --git a/NPCs/EliteBloodmoonWarrior.cs b/NPCs/EliteBloodmoonWarrior.cs index 2623771f..d3621bfd 100644 --- a/NPCs/EliteBloodmoonWarrior.cs +++ b/NPCs/EliteBloodmoonWarrior.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -35,16 +35,16 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { @@ -59,7 +59,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EliteGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EliteGore2"), 1f); @@ -73,7 +73,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMechBossAny && Main.bloodMoon && y < Main.worldSurface ? 0.03f : 0f; } } diff --git a/NPCs/EnragedBat.cs b/NPCs/EnragedBat.cs index c0aa6a3e..8a412c3d 100644 --- a/NPCs/EnragedBat.cs +++ b/NPCs/EnragedBat.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -36,8 +36,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -46,7 +46,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * hitDirection, -2.5f, 0, default(Color), 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EnragedGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EnragedGore1"), 1f); @@ -58,7 +58,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return Main.hardMode && NPC.downedMoonlord && !spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.1f : 0f; } } diff --git a/NPCs/EvilCorn.cs b/NPCs/EvilCorn.cs index a151219d..8abdf346 100644 --- a/NPCs/EvilCorn.cs +++ b/NPCs/EvilCorn.cs @@ -1,8 +1,8 @@ -using Terraria.ID; +using System.Collections.Generic; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; -using System.Collections.Generic; /* 1 состояние - парит на месте - при приближении игрока даёт ему оплеуху. @@ -35,17 +35,17 @@ public override void SetStaticDefaults() #endregion #region "Переменные для работы с AI" - int State = 0; + int State; // 0 - парит на месте, при приближении бьёт // 1 - парит на месте, скрыт в своих листьях // 2 - летает за игроком махая листьями int stateTime = simpleAttakStateTime; // Время до завершения текущего действия - int nowHitPlayerLeft = 0; + int nowHitPlayerLeft; // Время до завершения текущей анимации удара влево - int nowHitPlayerRight = 0; + int nowHitPlayerRight; // Время до завершения текущей анимации удара вправо - int nowCangeLeavs = 0; + int nowCangeLeavs; // Время до завершения текушей анимации смены листьев #endregion @@ -101,7 +101,7 @@ public override void OnHitByProjectile(Projectile projectile, int damage, float #region "Работа с анимацией" int _2_Frame = 17; - int FrameNow = 0; + int FrameNow; bool needState3SetFrame = true; void PlayAnimation() { @@ -203,7 +203,7 @@ Rectangle getFrame(int Index) #endregion bool NeedPrepere = true; - List Stadyes = new List() { 0, 1, 2, 3 }; + List Stadyes = new List { 0, 1, 2, 3 }; int NextStady = -1; void RechangeStage() { @@ -211,7 +211,7 @@ void RechangeStage() { if (Stadyes.Contains(State)) Stadyes.Remove(State); - if (Stadyes.Count <= 0) { Stadyes = new List() { 0, 1, 2, 3 }; Stadyes.Remove(State); } + if (Stadyes.Count <= 0) { Stadyes = new List { 0, 1, 2, 3 }; Stadyes.Remove(State); } int ID = Main.rand.Next(0, Stadyes.Count); NextStady = Stadyes[ID]; Stadyes.RemoveAt(ID); @@ -555,7 +555,7 @@ void NormalAttak() // летает за игроком махая листьям npc.position += npc.velocity; // Увеличиваем скорость вдвое } - int FrameYOffset = 0; + int FrameYOffset; bool FirstAction = true; bool needTP = true; int TimeToNS = 6; @@ -583,7 +583,7 @@ void NormalDefense() { if (Main.rand.Next(6) == 0) for (int x = (int)npc.position.X; x < (npc.position.X + npc.width); x++) - Dust.NewDust(new Vector2(x, npc.position.Y + npc.height), 1, 1, Terraria.ID.DustID.GoldCoin); + Dust.NewDust(new Vector2(x, npc.position.Y + npc.height), 1, 1, DustID.GoldCoin); npc.frame = getFrame(22); npc.frame.Y -= FrameYOffset; FrameYOffset += 4; @@ -607,7 +607,7 @@ void NormalDefense() npc.position.Y += 8; if (Main.rand.Next(6) == 0) for (int x = (int)npc.position.X; x < (npc.position.X + npc.width); x++) - Dust.NewDust(new Vector2(x, npc.position.Y + npc.height), 1, 1, Terraria.ID.DustID.GoldCoin); + Dust.NewDust(new Vector2(x, npc.position.Y + npc.height), 1, 1, DustID.GoldCoin); npc.frame = getFrame(21); npc.frame.Y += FrameYOffset; FrameYOffset += 8; @@ -636,8 +636,8 @@ public override void NPCLoot() } if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (!Main.expertMode && Main.rand.Next(7) == 0) @@ -687,7 +687,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CornGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CornGore2"), 1f); diff --git a/NPCs/EvolvedZombie.cs b/NPCs/EvolvedZombie.cs index f2f669a0..3be9cb09 100644 --- a/NPCs/EvolvedZombie.cs +++ b/NPCs/EvolvedZombie.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -35,8 +35,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -45,16 +45,16 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore2"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore2"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore5"), 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, Color.White, 3f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, Color.White, 2f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, Color.White, 3f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, Color.White, 3f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, Color.White, 2f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, Color.White, 3f); } } @@ -62,8 +62,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(2) == 0) { @@ -75,7 +75,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.03f : 0f; } } diff --git a/NPCs/EvolvedZombie2.cs b/NPCs/EvolvedZombie2.cs index 41c3f7df..7452d139 100644 --- a/NPCs/EvolvedZombie2.cs +++ b/NPCs/EvolvedZombie2.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -35,8 +35,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -45,16 +45,16 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore2"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore2"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore4"), 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, Color.White, 3f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, Color.White, 2f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, Color.White, 3f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, Color.White, 3f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, Color.White, 2f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, Color.White, 3f); } } @@ -62,8 +62,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(2) == 0) { @@ -75,7 +75,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.03f : 0f; } } diff --git a/NPCs/EvolvedZombie3.cs b/NPCs/EvolvedZombie3.cs index e9d01514..04d1deb4 100644 --- a/NPCs/EvolvedZombie3.cs +++ b/NPCs/EvolvedZombie3.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -35,8 +35,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -45,16 +45,16 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * hitDirection, -2.5f, 0, default(Color), 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore2"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore2"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore3"), 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, Color.White, 3f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, Color.White, 2f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, Color.White, 3f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, Color.White, 3f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, Color.White, 2f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, Color.White, 3f); } } @@ -62,8 +62,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(2) == 0) { @@ -75,7 +75,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.03f : 0f; } } diff --git a/NPCs/ExuberantHound.cs b/NPCs/ExuberantHound.cs index 9ebebdfe..3b7e5061 100644 --- a/NPCs/ExuberantHound.cs +++ b/NPCs/ExuberantHound.cs @@ -1,8 +1,9 @@ -using Terraria.ID; using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; + namespace Tremor.NPCs { @@ -38,9 +39,9 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 60; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ExuberantHoundGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ExuberantHoundGore2"), 1f); @@ -53,8 +54,8 @@ public override void HitEffect(int hitDirection, double damage) for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 226, (float)hitDirection, -2f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 226, hitDirection, -2f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, hitDirection, -1f, 0, default(Color), 0.7f); } } } @@ -64,8 +65,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { @@ -80,10 +81,10 @@ public override void NPCLoot() public override void AI() { - Vector2 vector72 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num738 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector72.X; + Vector2 vector72 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + float num738 = Main.player[npc.target].position.X + Main.player[npc.target].width * 0.5f - vector72.X; float num739 = Main.player[npc.target].position.Y - vector72.Y; - float num740 = (float)Math.Sqrt((double)(num738 * num738 + num739 * num739)); + float num740 = (float)Math.Sqrt(num738 * num738 + num739 * num739); if (npc.ai[2] == 1f) { @@ -91,12 +92,12 @@ public override void AI() npc.velocity.X = npc.velocity.X * 0.7f; if (npc.ai[1] < 30f) { - Vector2 vector73 = npc.Center + Vector2.UnitX * (float)npc.spriteDirection * -20f; + Vector2 vector73 = npc.Center + Vector2.UnitX * npc.spriteDirection * -20f; Dust dust11 = Main.dust[Dust.NewDust(vector73, 0, 0, 242, 0f, 0f, 0, default(Color), 1f)]; Vector2 vector74 = Vector2.UnitY.RotatedByRandom(6.2831854820251465); dust11.position = vector73 + vector74 * 20f; dust11.velocity = -vector74 * 2f; - dust11.scale = 0.5f + vector74.X * (float)(-(float)npc.spriteDirection); + dust11.scale = 0.5f + vector74.X * -(float)npc.spriteDirection; dust11.fadeIn = 1f; dust11.noGravity = true; } @@ -104,12 +105,12 @@ public override void AI() { for (int num743 = 0; num743 < 20; num743++) { - Vector2 vector75 = npc.Center + Vector2.UnitX * (float)npc.spriteDirection * -20f; + Vector2 vector75 = npc.Center + Vector2.UnitX * npc.spriteDirection * -20f; Dust dust12 = Main.dust[Dust.NewDust(vector75, 0, 0, 242, 0f, 0f, 0, default(Color), 1f)]; Vector2 vector76 = Vector2.UnitY.RotatedByRandom(6.2831854820251465); dust12.position = vector75 + vector76 * 4f; - dust12.velocity = vector76 * 4f + Vector2.UnitX * Main.rand.NextFloat() * (float)npc.spriteDirection * -5f; - dust12.scale = 0.5f + vector76.X * (float)(-(float)npc.spriteDirection); + dust12.velocity = vector76 * 4f + Vector2.UnitX * Main.rand.NextFloat() * npc.spriteDirection * -5f; + dust12.scale = 0.5f + vector76.X * -(float)npc.spriteDirection; dust12.fadeIn = 1f; dust12.noGravity = true; } @@ -121,11 +122,11 @@ public override void AI() if (npc.ai[1] == 30f && Main.netMode != 1) { int num744 = Main.expertMode ? 35 : 50; - Projectile.NewProjectile(npc.Center.X + (float)(npc.spriteDirection * -20), npc.Center.Y, (float)(npc.spriteDirection * -7), 0f, 435, num744, 0f, Main.myPlayer, (float)npc.target, 0f); + Projectile.NewProjectile(npc.Center.X + npc.spriteDirection * -20, npc.Center.Y, npc.spriteDirection * -7, 0f, 435, num744, 0f, Main.myPlayer, npc.target, 0f); } if (npc.ai[1] >= 60f) { - npc.ai[1] = (float)(-(float)Main.rand.Next(320, 601)); + npc.ai[1] = -(float)Main.rand.Next(320, 601); npc.ai[2] = 0f; } } @@ -149,7 +150,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.001f : 0f; } } diff --git a/NPCs/FallenWarrior1.cs b/NPCs/FallenWarrior1.cs index 53c7cdf6..4bc4458e 100644 --- a/NPCs/FallenWarrior1.cs +++ b/NPCs/FallenWarrior1.cs @@ -1,7 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; + namespace Tremor.NPCs { @@ -34,16 +35,16 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { @@ -58,7 +59,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); @@ -71,7 +72,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDungeon && NPC.downedMoonlord && Main.hardMode && y > Main.rockLayer ? 0.01f : 0f; } } diff --git a/NPCs/FallenWarrior2.cs b/NPCs/FallenWarrior2.cs index 69a841de..e38a9961 100644 --- a/NPCs/FallenWarrior2.cs +++ b/NPCs/FallenWarrior2.cs @@ -1,7 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; + namespace Tremor.NPCs { @@ -34,16 +35,16 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { @@ -58,7 +59,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); @@ -71,7 +72,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDungeon && NPC.downedMoonlord && Main.hardMode && y > Main.rockLayer ? 0.01f : 0f; } } diff --git a/NPCs/FallenWarrior3.cs b/NPCs/FallenWarrior3.cs index d36496ac..bd7f06c0 100644 --- a/NPCs/FallenWarrior3.cs +++ b/NPCs/FallenWarrior3.cs @@ -1,7 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; + namespace Tremor.NPCs { @@ -34,16 +35,16 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { @@ -58,7 +59,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); @@ -71,7 +72,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDungeon && NPC.downedMoonlord && Main.hardMode && y > Main.rockLayer ? 0.01f : 0f; } } diff --git a/NPCs/Farmer.cs b/NPCs/Farmer.cs index 5dcb483f..63d93061 100644 --- a/NPCs/Farmer.cs +++ b/NPCs/Farmer.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -8,21 +8,10 @@ namespace Tremor.NPCs [AutoloadHead] public class Farmer : ModNPC { - public override string Texture - { - get - { - return "Tremor/NPCs/Farmer"; - } - } + public override string Texture => "Tremor/NPCs/Farmer"; + + public override string[] AltTextures => new[] { "Tremor/NPCs/Farmer" }; - public override string[] AltTextures - { - get - { - return new string[] { "Tremor/NPCs/Farmer" }; - } - } public override bool Autoload(ref string name) { name = "Farmer"; @@ -212,7 +201,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FarmerGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FarmerGore2"), 1f); diff --git a/NPCs/FatFlinx.cs b/NPCs/FatFlinx.cs index 7516a7b1..1735931e 100644 --- a/NPCs/FatFlinx.cs +++ b/NPCs/FatFlinx.cs @@ -1,9 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { @@ -34,16 +33,16 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (NPC.downedMoonlord && Main.rand.Next(5) == 0) { @@ -58,16 +57,16 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FFGore2"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FFGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FFGore1"), 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); } } @@ -75,7 +74,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return Main.hardMode && NPC.downedMoonlord && spawnInfo.player.ZoneSnow && y > Main.rockLayer ? 0.1f : 0f; } diff --git a/NPCs/FireBeetle.cs b/NPCs/FireBeetle.cs index 97c90160..f4b9ce21 100644 --- a/NPCs/FireBeetle.cs +++ b/NPCs/FireBeetle.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -39,16 +39,16 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(2) == 0) { @@ -65,9 +65,9 @@ public override void HitEffect(int hitDirection, double damage) { if (npc.life <= 0) { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FBGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FBGore3"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FBGore2"), 1f); @@ -75,8 +75,8 @@ public override void HitEffect(int hitDirection, double damage) Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FBGore2"), 1f); for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.6f); } } } @@ -85,7 +85,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && NPC.downedMoonlord && Tremor.NoZoneAllowWater(spawnInfo)) && y > Main.rockLayer ? 0.01f : 0f; } } diff --git a/NPCs/FlamingReaper.cs b/NPCs/FlamingReaper.cs index f5da3896..b4408638 100644 --- a/NPCs/FlamingReaper.cs +++ b/NPCs/FlamingReaper.cs @@ -1,9 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { @@ -33,8 +32,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -43,7 +42,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } } } diff --git a/NPCs/Flayer.cs b/NPCs/Flayer.cs index 0973038b..d1abcc2e 100644 --- a/NPCs/Flayer.cs +++ b/NPCs/Flayer.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -34,8 +34,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -44,7 +44,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FlayerGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FlayerGore2"), 1f); @@ -59,7 +59,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedPlantBoss && Main.bloodMoon && y < Main.worldSurface ? 0.01f : 0f; } diff --git a/NPCs/FlyingJelly.cs b/NPCs/FlyingJelly.cs index 1be7515d..f859291d 100644 --- a/NPCs/FlyingJelly.cs +++ b/NPCs/FlyingJelly.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -37,9 +37,9 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 60; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } } else @@ -47,16 +47,16 @@ public override void HitEffect(int hitDirection, double damage) for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 226, (float)hitDirection, -2f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 226, hitDirection, -2f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, hitDirection, -1f, 0, default(Color), 0.7f); } } } public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } } diff --git a/NPCs/FlyingLeech.cs b/NPCs/FlyingLeech.cs index 8580e608..558826c4 100644 --- a/NPCs/FlyingLeech.cs +++ b/NPCs/FlyingLeech.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -34,15 +34,15 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedBoss2 && spawnInfo.player.ZoneCrimson && y < Main.worldSurface ? 0.02f : 0; } } diff --git a/NPCs/ForestSpirit.cs b/NPCs/ForestSpirit.cs index 81f65cde..7bf7af77 100644 --- a/NPCs/ForestSpirit.cs +++ b/NPCs/ForestSpirit.cs @@ -1,9 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { @@ -37,8 +36,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -47,7 +46,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } } @@ -57,7 +56,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedBoss2 && !Main.dayTime && y < Main.worldSurface ? 0.1f : 0f; } } diff --git a/NPCs/ForgeMaster.cs b/NPCs/ForgeMaster.cs index 159058c8..de125551 100644 --- a/NPCs/ForgeMaster.cs +++ b/NPCs/ForgeMaster.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -8,21 +8,9 @@ namespace Tremor.NPCs [AutoloadHead] public class ForgeMaster : ModNPC { - public override string Texture - { - get - { - return "Tremor/NPCs/ForgeMaster"; - } - } + public override string Texture => "Tremor/NPCs/ForgeMaster"; - public override string[] AltTextures - { - get - { - return new string[] { "Tremor/NPCs/ForgeMaster" }; - } - } + public override string[] AltTextures => new[] { "Tremor/NPCs/ForgeMaster" }; public override bool Autoload(ref string name) { @@ -258,7 +246,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BlackSmithGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BlackSmithGore2"), 1f); diff --git a/NPCs/FrostBeetle.cs b/NPCs/FrostBeetle.cs index c99ea47b..41d8fb6c 100644 --- a/NPCs/FrostBeetle.cs +++ b/NPCs/FrostBeetle.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -39,16 +39,16 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(2) == 0) { @@ -73,9 +73,9 @@ public override void HitEffect(int hitDirection, double damage) { if (npc.life <= 0) { - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IBGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IBGore3"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IBGore2"), 1f); @@ -83,8 +83,8 @@ public override void HitEffect(int hitDirection, double damage) Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IBGore2"), 1f); for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.6f); } } } @@ -93,7 +93,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return Main.hardMode && NPC.downedMoonlord && spawnInfo.player.ZoneSnow && y > Main.rockLayer ? 0.01f : 0f; } } diff --git a/NPCs/FrostKing.cs b/NPCs/FrostKing.cs index c660d178..d05c1fbd 100644 --- a/NPCs/FrostKing.cs +++ b/NPCs/FrostKing.cs @@ -1,7 +1,7 @@ -using Terraria.ID; using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -16,8 +16,8 @@ public override void SetStaticDefaults() } - private float timeToNextFrame = 0; - private int frame = 0; + private float timeToNextFrame; + private int frame; public override void SetDefaults() { @@ -53,14 +53,14 @@ public override void HitEffect(int hitDirection, double damage) private float timeToAtack = 2; private float vel = 2.5f; - private float lifeTime = 0; + private float lifeTime; private int minTimeToAtack = 3; private int maxTimeToAtack = 5; private Vector2 localTargPos = new Vector2(666, 666); - private int mode = 0; - private float atackTimer = 0; - private float atackLenghtTimer = 0; - private float preAtack = 0; + private int mode; + private float atackTimer; + private float atackLenghtTimer; + private float preAtack; public Vector2 bossCenter { @@ -274,14 +274,11 @@ private float clamp(float value, float min, float max) { return min; } - else if (value > max) + if (value > max) { return max; } - else - { - return value; - } + return value; } public override void FindFrame(int frameHeight) @@ -297,8 +294,8 @@ public override void NPCLoot() } if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (!Main.expertMode && Main.rand.Next(7) == 0) diff --git a/NPCs/FungusBeetle.cs b/NPCs/FungusBeetle.cs index 72f758c6..6567d393 100644 --- a/NPCs/FungusBeetle.cs +++ b/NPCs/FungusBeetle.cs @@ -4,7 +4,6 @@ using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { [AutoloadBossHead] @@ -45,8 +44,8 @@ public override void NPCLoot() } if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (!Main.expertMode && Main.rand.Next(7) == 0) { @@ -77,13 +76,13 @@ public override void HitEffect(int hitDirection, double damage) Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FungusBeetleGore4"), 1f); for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 67, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 67, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } } for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 67, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 67, hitDirection, -1f, 0, default(Color), 0.7f); } } @@ -151,8 +150,8 @@ public override void ModifyHitNPC(NPC target, ref int damage, ref float knockbac } float customAi1; - bool FirstState = false; - bool SecondState = false; + bool FirstState; + bool SecondState; public override void AI() { npc.position -= npc.velocity * 0.05f; @@ -251,75 +250,75 @@ public override void AI() } int num60; - this.npc.TargetClosest(true); + npc.TargetClosest(true); - if (Main.player[this.npc.target].position.Y - 150 > this.npc.position.Y) + if (Main.player[npc.target].position.Y - 150 > npc.position.Y) { - this.npc.directionY = 1; + npc.directionY = 1; } else { - this.npc.directionY = -1; + npc.directionY = -1; } - if (this.npc.direction == -1 && this.npc.velocity.X > -2f) + if (npc.direction == -1 && npc.velocity.X > -2f) { - this.npc.velocity.X = this.npc.velocity.X - 0.4f; - if (this.npc.velocity.X > 2f) + npc.velocity.X = npc.velocity.X - 0.4f; + if (npc.velocity.X > 2f) { - this.npc.velocity.X = this.npc.velocity.X - 0.4f; + npc.velocity.X = npc.velocity.X - 0.4f; } else { - if (this.npc.velocity.X > 0f) + if (npc.velocity.X > 0f) { - this.npc.velocity.X = this.npc.velocity.X + 0.08f; + npc.velocity.X = npc.velocity.X + 0.08f; } } - if (this.npc.velocity.X < -2f) + if (npc.velocity.X < -2f) { - this.npc.velocity.X = -2f; + npc.velocity.X = -2f; } } else { - if (this.npc.direction == 1 && this.npc.velocity.X < 4f) + if (npc.direction == 1 && npc.velocity.X < 4f) { - this.npc.velocity.X = this.npc.velocity.X + 0.1f; - if (this.npc.velocity.X < -2f) + npc.velocity.X = npc.velocity.X + 0.1f; + if (npc.velocity.X < -2f) { - this.npc.velocity.X = this.npc.velocity.X + 0.1f; + npc.velocity.X = npc.velocity.X + 0.1f; } else { - if (this.npc.velocity.X < 0f) + if (npc.velocity.X < 0f) { - this.npc.velocity.X = this.npc.velocity.X - 0.08f; + npc.velocity.X = npc.velocity.X - 0.08f; } } - if (this.npc.velocity.X > 2f) + if (npc.velocity.X > 2f) { - this.npc.velocity.X = 2f; + npc.velocity.X = 2f; } } } - if (this.npc.directionY == -1 && (double)this.npc.velocity.Y > -1.5) + if (npc.directionY == -1 && npc.velocity.Y > -1.5) { - this.npc.velocity.Y = this.npc.velocity.Y - 0.08f; + npc.velocity.Y = npc.velocity.Y - 0.08f; - if ((double)this.npc.velocity.Y < -1.5) + if (npc.velocity.Y < -1.5) { - this.npc.velocity.Y = -1.5f; + npc.velocity.Y = -1.5f; } } else { - if (this.npc.directionY == 1 && (double)this.npc.velocity.Y < 1.5) + if (npc.directionY == 1 && npc.velocity.Y < 1.5) { - this.npc.velocity.Y = this.npc.velocity.Y + 0.08f; - if ((double)this.npc.velocity.Y > 1.5) + npc.velocity.Y = npc.velocity.Y + 0.08f; + if (npc.velocity.Y > 1.5) { - this.npc.velocity.Y = 1.5f; + npc.velocity.Y = 1.5f; } } } diff --git a/NPCs/GGiantSlime.cs b/NPCs/GGiantSlime.cs index cb90d350..d17fc133 100644 --- a/NPCs/GGiantSlime.cs +++ b/NPCs/GGiantSlime.cs @@ -1,9 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { @@ -36,8 +35,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -46,13 +45,13 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Green, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Green, 0.7f); } - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 1, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Green, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Green, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Green, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 1, 2.5f * hitDirection, -2.5f, 0, Color.Green, 0.7f); } } @@ -65,8 +64,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { diff --git a/NPCs/Galasquid.cs b/NPCs/Galasquid.cs index 1c728f5b..1093b542 100644 --- a/NPCs/Galasquid.cs +++ b/NPCs/Galasquid.cs @@ -92,8 +92,7 @@ public override void AI() { vector283 = Vector2.UnitY.RotatedByRandom(1.5707963705062866) * new Vector2(5f, 3f); } - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vector283.X, vector283.Y, 435, 60, 0f, Main.myPlayer, 0f, (float)npc.whoAmI); - return; + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vector283.X, vector283.Y, 435, 60, 0f, Main.myPlayer, 0f, npc.whoAmI); } } } @@ -103,7 +102,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return spawnInfo.spawnTileY < Main.rockLayer && NPC.downedMoonlord && tile == mod.TileType("CometiteOreTile") || tile == mod.TileType("HardCometiteOreTile") ? 0.005f : 0f; } @@ -111,8 +110,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { diff --git a/NPCs/Geerd.cs b/NPCs/Geerd.cs index 248dcf25..43395148 100644 --- a/NPCs/Geerd.cs +++ b/NPCs/Geerd.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -36,8 +36,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(25) == 0) { @@ -48,8 +48,8 @@ public override void NPCLoot() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override float SpawnChance(NPCSpawnInfo spawnInfo) @@ -63,7 +63,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 60; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GeerdGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GrudGore2"), 1f); @@ -73,9 +73,9 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 0.7f); } } } diff --git a/NPCs/Gelateen.cs b/NPCs/Gelateen.cs index 8cd539fd..2d385d80 100644 --- a/NPCs/Gelateen.cs +++ b/NPCs/Gelateen.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -37,8 +37,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { @@ -49,15 +49,15 @@ public override void NPCLoot() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && y > Main.rockLayer ? 0.001f : 0f; } @@ -67,18 +67,18 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Green, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Green, 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GelateenGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GelateenGore2"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GelateenGore3"), 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 1, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Green, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Green, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Green, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 1, 2.5f * hitDirection, -2.5f, 0, Color.Green, 0.7f); } } } diff --git a/NPCs/GeneralSnowman.cs b/NPCs/GeneralSnowman.cs index f6f1070b..b78e1a60 100644 --- a/NPCs/GeneralSnowman.cs +++ b/NPCs/GeneralSnowman.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -35,8 +35,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -45,11 +45,11 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * hitDirection, -2.5f, 0, default(Color), 1f); } - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3f); - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2f); - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * hitDirection, -2.5f, 0, default(Color), 3f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * hitDirection, -2.5f, 0, default(Color), 2f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * hitDirection, -2.5f, 0, default(Color), 3f); } } @@ -57,7 +57,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return NPC.AnyNPCs(144) && Main.hardMode && y < Main.worldSurface ? 0.01f : 0f; } } diff --git a/NPCs/GhostKnight.cs b/NPCs/GhostKnight.cs index 145eccc2..7e8a1cb0 100644 --- a/NPCs/GhostKnight.cs +++ b/NPCs/GhostKnight.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -37,15 +37,15 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedPlantBoss && !Main.dayTime && y < Main.worldSurface ? 0.01f : 0f; } @@ -55,11 +55,11 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 60; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GhostGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GhostGore2"), 1f); @@ -68,9 +68,9 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 54, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 54, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 54, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, hitDirection, -1f, 0, default(Color), 0.7f); } } } diff --git a/NPCs/GhostWarrior.cs b/NPCs/GhostWarrior.cs index 9b02d490..2256aced 100644 --- a/NPCs/GhostWarrior.cs +++ b/NPCs/GhostWarrior.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -39,7 +39,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GWGore1"), 1f); @@ -53,8 +53,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(3) == 0) @@ -72,7 +72,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && TremorWorld.downedTrinity && NPC.downedMoonlord && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.005f : 0f; } } diff --git a/NPCs/GiantCrab.cs b/NPCs/GiantCrab.cs index 9cb1be4d..6f69d773 100644 --- a/NPCs/GiantCrab.cs +++ b/NPCs/GiantCrab.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -34,8 +34,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -44,7 +44,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CrabGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CrabGore1"), 1f); @@ -59,8 +59,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(25) == 0) { @@ -73,7 +73,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && (tile == 53 || tile == 112 || tile == 116 || tile == 234) && spawnInfo.water) && y < Main.rockLayer && (x < 250 || x > Main.maxTilesX - 250) && !spawnInfo.playerSafe && Main.hardMode ? 0.01f : 0f; } } diff --git a/NPCs/GiantGastropod.cs b/NPCs/GiantGastropod.cs index 220f3200..ce212c96 100644 --- a/NPCs/GiantGastropod.cs +++ b/NPCs/GiantGastropod.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -40,16 +40,16 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { @@ -62,15 +62,15 @@ public override void HitEffect(int hitDirection, double damage) { if (npc.life <= 0) { - Dust.NewDust(npc.position, npc.width, npc.height, 72, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 72, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 72, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 72, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 72, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 72, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GGGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GGGore2"), 1f); for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 72, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 72, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + Dust.NewDust(npc.position, npc.width, npc.height, 72, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 72, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.6f); } } } @@ -88,7 +88,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && !Main.dayTime && NPC.downedMoonlord && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneHoly && y < Main.worldSurface ? 0.01f : 0f; } } diff --git a/NPCs/GiantMeteorHead.cs b/NPCs/GiantMeteorHead.cs index 5f893a18..1198efe0 100644 --- a/NPCs/GiantMeteorHead.cs +++ b/NPCs/GiantMeteorHead.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -36,16 +36,16 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(20) == 0) { @@ -58,17 +58,17 @@ public override void HitEffect(int hitDirection, double damage) { if (npc.life <= 0) { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.6f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.6f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.6f); } } } diff --git a/NPCs/GloomySeer.cs b/NPCs/GloomySeer.cs index 92d07b46..f75e3f46 100644 --- a/NPCs/GloomySeer.cs +++ b/NPCs/GloomySeer.cs @@ -1,7 +1,7 @@ -using Terraria.ID; using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -36,8 +36,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void AI() @@ -49,10 +49,10 @@ public override void AI() if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { float num630 = 2.2f; - Vector2 vector64 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num631 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector64.X + (float)Main.rand.Next(-100, 101); - float num632 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - vector64.Y + (float)Main.rand.Next(-100, 101); - float num633 = (float)Math.Sqrt((double)(num631 * num631 + num632 * num632)); + Vector2 vector64 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + float num631 = Main.player[npc.target].position.X + Main.player[npc.target].width * 0.5f - vector64.X + Main.rand.Next(-100, 101); + float num632 = Main.player[npc.target].position.Y + Main.player[npc.target].height * 0.5f - vector64.Y + Main.rand.Next(-100, 101); + float num633 = (float)Math.Sqrt(num631 * num631 + num632 * num632); num633 = num630 / num633; num631 *= num633; num632 *= num633; @@ -62,7 +62,7 @@ public override void AI() Main.projectile[num636].timeLeft = 3000; } } - else if (npc.ai[0] >= (float)(150 + Main.rand.Next(150))) + else if (npc.ai[0] >= 150 + Main.rand.Next(150)) { npc.ai[0] = 0f; } @@ -73,7 +73,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.bloodMoon && y < Main.worldSurface ? 0.001f : 0f; } @@ -83,7 +83,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.2f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.2f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GSGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GSGore1"), 1f); diff --git a/NPCs/GoblinAssassin.cs b/NPCs/GoblinAssassin.cs index 20264b3d..b8ca3b86 100644 --- a/NPCs/GoblinAssassin.cs +++ b/NPCs/GoblinAssassin.cs @@ -14,7 +14,7 @@ public override void SetStaticDefaults() Main.npcFrameCount[npc.type] = 3; } - int CountFrame = 0; + int CountFrame; int TimeToAnimation = 4; public override void SetDefaults() { @@ -33,8 +33,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void AI() @@ -77,13 +77,13 @@ public void PlayAnimation() } } - bool TimetoShoot = false; + bool TimetoShoot; public void DoAI() { - Vector2 VectorPos = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float FirstPos = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - VectorPos.X; + Vector2 VectorPos = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + float FirstPos = Main.player[npc.target].position.X + Main.player[npc.target].width * 0.5f - VectorPos.X; float SecondPos = Main.player[npc.target].position.Y - VectorPos.Y; - float FinallyPos = (float)Math.Sqrt((double)(FirstPos * FirstPos + SecondPos * SecondPos)); + float FinallyPos = (float)Math.Sqrt(FirstPos * FirstPos + SecondPos * SecondPos); if (!npc.wet && !Main.player[npc.target].npcTypeNoAggro[npc.type]) { if (FinallyPos < 400f && Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) @@ -103,18 +103,18 @@ public void DoAI() { Flag = true; } - if (npc.position.X == npc.oldPosition.X || npc.ai[3] >= (float)Num || Flag) + if (npc.position.X == npc.oldPosition.X || npc.ai[3] >= Num || Flag) { npc.ai[3] += 1f; } else { - if ((double)Math.Abs(npc.velocity.X) > 0.9 && npc.ai[3] > 0f) + if (Math.Abs(npc.velocity.X) > 0.9 && npc.ai[3] > 0f) { npc.ai[3] -= 1f; } } - if (npc.ai[3] > (float)(Num * 10)) + if (npc.ai[3] > Num * 10) { npc.ai[3] = 0f; } @@ -122,12 +122,12 @@ public void DoAI() { npc.ai[3] = 0f; } - if (npc.ai[3] == (float)Num) + if (npc.ai[3] == Num) { npc.netUpdate = true; } - if (npc.ai[3] < (float)Num) + if (npc.ai[3] < Num) { npc.TargetClosest(true); } @@ -189,16 +189,16 @@ public void DoAI() bool Flag3 = false; if (npc.velocity.Y == 0f) { - int Num2 = (int)(npc.position.Y + (float)npc.height + 8f) / 16; + int Num2 = (int)(npc.position.Y + npc.height + 8f) / 16; int Num3 = (int)npc.position.X / 16; - int Num4 = (int)(npc.position.X + (float)npc.width) / 16; + int Num4 = (int)(npc.position.X + npc.width) / 16; for (int l = Num3; l <= Num4; l++) { if (Main.tile[l, Num2] == null) { return; } - if (Main.tile[l, Num2].active() && Main.tileSolid[(int)Main.tile[l, Num2].type]) + if (Main.tile[l, Num2].active() && Main.tileSolid[Main.tile[l, Num2].type]) { Flag3 = true; break; @@ -208,8 +208,8 @@ public void DoAI() if (Flag3) { - int Num5 = (int)((npc.position.X + (float)(npc.width / 2) + (float)((npc.width / 2 + 6) * npc.direction)) / 16f); - int Num6 = (int)((npc.position.Y + (float)npc.height - 15f) / 16f); + int Num5 = (int)((npc.position.X + npc.width / 2 + (npc.width / 2 + 6) * npc.direction) / 16f); + int Num6 = (int)((npc.position.Y + npc.height - 15f) / 16f); if (Main.tile[Num5, Num6] == null) { Main.tile[Num5, Num6] = new Tile(); @@ -245,7 +245,7 @@ public void DoAI() npc.ai[3] = 0f; if (npc.ai[2] >= 60f) { - npc.velocity.X = 0.5f * (float)(-(float)npc.direction); + npc.velocity.X = 0.5f * -(float)npc.direction; npc.ai[1] += 1f; npc.ai[2] = 0f; bool Flag4 = false; @@ -260,7 +260,7 @@ public void DoAI() bool Flag5 = WorldGen.OpenDoor(Num5, Num6, npc.direction); if (!Flag5) { - npc.ai[3] = (float)Num; + npc.ai[3] = Num; npc.netUpdate = true; } if (Main.netMode == 2 && Flag5) @@ -273,9 +273,9 @@ public void DoAI() if ((npc.velocity.X < 0f && npc.spriteDirection == -1) || (npc.velocity.X > 0f && npc.spriteDirection == 1)) { - if (Main.tile[Num5, Num6 - 2].active() && Main.tileSolid[(int)Main.tile[Num5, Num6 - 2].type]) + if (Main.tile[Num5, Num6 - 2].active() && Main.tileSolid[Main.tile[Num5, Num6 - 2].type]) { - if ((Main.tile[Num5, Num6 - 3].active() && Main.tileSolid[(int)Main.tile[Num5, Num6 - 3].type])) + if ((Main.tile[Num5, Num6 - 3].active() && Main.tileSolid[Main.tile[Num5, Num6 - 3].type])) { npc.velocity.Y = -8f; npc.netUpdate = true; @@ -288,21 +288,21 @@ public void DoAI() } else { - if (Main.tile[Num5, Num6 - 1].active() && Main.tileSolid[(int)Main.tile[Num5, Num6 - 1].type]) + if (Main.tile[Num5, Num6 - 1].active() && Main.tileSolid[Main.tile[Num5, Num6 - 1].type]) { npc.velocity.Y = -6f; npc.netUpdate = true; } else { - if (Main.tile[Num5, Num6].active() && Main.tileSolid[(int)Main.tile[Num5, Num6].type]) + if (Main.tile[Num5, Num6].active() && Main.tileSolid[Main.tile[Num5, Num6].type]) { npc.velocity.Y = -5f; npc.netUpdate = true; } else { - if (npc.directionY < 0 && (!Main.tile[Num5, Num6 + 1].active() || !Main.tileSolid[(int)Main.tile[Num5, Num6 + 1].type]) && (!Main.tile[Num5 + npc.direction, Num6 + 1].active() || !Main.tileSolid[(int)Main.tile[Num5 + npc.direction, Num6 + 1].type])) + if (npc.directionY < 0 && (!Main.tile[Num5, Num6 + 1].active() || !Main.tileSolid[Main.tile[Num5, Num6 + 1].type]) && (!Main.tile[Num5 + npc.direction, Num6 + 1].active() || !Main.tileSolid[Main.tile[Num5 + npc.direction, Num6 + 1].type])) { npc.velocity.Y = -8f; npc.velocity.X = npc.velocity.X * 1.5f; @@ -340,18 +340,18 @@ public void DoAI() { Flag = true; } - if (npc.position.X == npc.oldPosition.X || npc.ai[3] >= (float)Num || Flag) + if (npc.position.X == npc.oldPosition.X || npc.ai[3] >= Num || Flag) { npc.ai[3] += 1f; } else { - if ((double)Math.Abs(npc.velocity.X) > 0.9 && npc.ai[3] > 0f) + if (Math.Abs(npc.velocity.X) > 0.9 && npc.ai[3] > 0f) { npc.ai[3] -= 1f; } } - if (npc.ai[3] > (float)(Num * 10)) + if (npc.ai[3] > Num * 10) { npc.ai[3] = 0f; } @@ -359,12 +359,12 @@ public void DoAI() { npc.ai[3] = 0f; } - if (npc.ai[3] == (float)Num) + if (npc.ai[3] == Num) { npc.netUpdate = true; } - if (npc.ai[3] < (float)Num) + if (npc.ai[3] < Num) { npc.TargetClosest(true); } @@ -426,16 +426,16 @@ public void DoAI() bool Flag3 = false; if (npc.velocity.Y == 0f) { - int Num2 = (int)(npc.position.Y + (float)npc.height + 8f) / 16; + int Num2 = (int)(npc.position.Y + npc.height + 8f) / 16; int Num3 = (int)npc.position.X / 16; - int Num4 = (int)(npc.position.X + (float)npc.width) / 16; + int Num4 = (int)(npc.position.X + npc.width) / 16; for (int l = Num3; l <= Num4; l++) { if (Main.tile[l, Num2] == null) { return; } - if (Main.tile[l, Num2].active() && Main.tileSolid[(int)Main.tile[l, Num2].type]) + if (Main.tile[l, Num2].active() && Main.tileSolid[Main.tile[l, Num2].type]) { Flag3 = true; break; @@ -445,8 +445,8 @@ public void DoAI() if (Flag3) { - int Num5 = (int)((npc.position.X + (float)(npc.width / 2) + (float)((npc.width / 2 + 6) * npc.direction)) / 16f); - int Num6 = (int)((npc.position.Y + (float)npc.height - 15f) / 16f); + int Num5 = (int)((npc.position.X + npc.width / 2 + (npc.width / 2 + 6) * npc.direction) / 16f); + int Num6 = (int)((npc.position.Y + npc.height - 15f) / 16f); if (Main.tile[Num5, Num6] == null) { Main.tile[Num5, Num6] = new Tile(); @@ -482,7 +482,7 @@ public void DoAI() npc.ai[3] = 0f; if (npc.ai[2] >= 60f) { - npc.velocity.X = 0.5f * (float)(-(float)npc.direction); + npc.velocity.X = 0.5f * -(float)npc.direction; npc.ai[1] += 1f; npc.ai[2] = 0f; bool Flag4 = false; @@ -497,7 +497,7 @@ public void DoAI() bool Flag5 = WorldGen.OpenDoor(Num5, Num6, npc.direction); if (!Flag5) { - npc.ai[3] = (float)Num; + npc.ai[3] = Num; npc.netUpdate = true; } if (Main.netMode == 2 && Flag5) @@ -510,9 +510,9 @@ public void DoAI() if ((npc.velocity.X < 0f && npc.spriteDirection == -1) || (npc.velocity.X > 0f && npc.spriteDirection == 1)) { - if (Main.tile[Num5, Num6 - 2].active() && Main.tileSolid[(int)Main.tile[Num5, Num6 - 2].type]) + if (Main.tile[Num5, Num6 - 2].active() && Main.tileSolid[Main.tile[Num5, Num6 - 2].type]) { - if ((Main.tile[Num5, Num6 - 3].active() && Main.tileSolid[(int)Main.tile[Num5, Num6 - 3].type])) + if ((Main.tile[Num5, Num6 - 3].active() && Main.tileSolid[Main.tile[Num5, Num6 - 3].type])) { npc.velocity.Y = -8f; npc.netUpdate = true; @@ -525,21 +525,21 @@ public void DoAI() } else { - if (Main.tile[Num5, Num6 - 1].active() && Main.tileSolid[(int)Main.tile[Num5, Num6 - 1].type]) + if (Main.tile[Num5, Num6 - 1].active() && Main.tileSolid[Main.tile[Num5, Num6 - 1].type]) { npc.velocity.Y = -6f; npc.netUpdate = true; } else { - if (Main.tile[Num5, Num6].active() && Main.tileSolid[(int)Main.tile[Num5, Num6].type]) + if (Main.tile[Num5, Num6].active() && Main.tileSolid[Main.tile[Num5, Num6].type]) { npc.velocity.Y = -5f; npc.netUpdate = true; } else { - if (npc.directionY < 0 && (!Main.tile[Num5, Num6 + 1].active() || !Main.tileSolid[(int)Main.tile[Num5, Num6 + 1].type]) && (!Main.tile[Num5 + npc.direction, Num6 + 1].active() || !Main.tileSolid[(int)Main.tile[Num5 + npc.direction, Num6 + 1].type])) + if (npc.directionY < 0 && (!Main.tile[Num5, Num6 + 1].active() || !Main.tileSolid[Main.tile[Num5, Num6 + 1].type]) && (!Main.tile[Num5 + npc.direction, Num6 + 1].active() || !Main.tileSolid[Main.tile[Num5 + npc.direction, Num6 + 1].type])) { npc.velocity.Y = -8f; npc.velocity.X = npc.velocity.X * 1.5f; @@ -573,20 +573,20 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (NPC.AnyNPCs(26) || NPC.AnyNPCs(27) || NPC.AnyNPCs(28) || NPC.AnyNPCs(29)) && NPC.downedBoss3 && y < Main.worldSurface ? 0.08f : 0f; } public override void NPCLoot() { - if (Main.invasionType == Terraria.ID.InvasionID.GoblinArmy) + if (Main.invasionType == InvasionID.GoblinArmy) { Main.invasionProgress++; } if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(2) == 0) diff --git a/NPCs/GoblinBomber.cs b/NPCs/GoblinBomber.cs index dd3fc010..54e92ede 100644 --- a/NPCs/GoblinBomber.cs +++ b/NPCs/GoblinBomber.cs @@ -1,7 +1,7 @@ -using Terraria.ID; using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -31,12 +31,12 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } int TimeToAnimation = 4; - int Frame = 0; + int Frame; public override void AI() { npc.TargetClosest(true); @@ -66,18 +66,18 @@ public void DoAI() { Flag = true; } - if (npc.position.X == npc.oldPosition.X || npc.ai[3] >= (float)Num || Flag) + if (npc.position.X == npc.oldPosition.X || npc.ai[3] >= Num || Flag) { npc.ai[3] += 1f; } else { - if ((double)Math.Abs(npc.velocity.X) > 0.9 && npc.ai[3] > 0f) + if (Math.Abs(npc.velocity.X) > 0.9 && npc.ai[3] > 0f) { npc.ai[3] -= 1f; } } - if (npc.ai[3] > (float)(Num * 10)) + if (npc.ai[3] > Num * 10) { npc.ai[3] = 0f; } @@ -85,12 +85,12 @@ public void DoAI() { npc.ai[3] = 0f; } - if (npc.ai[3] == (float)Num) + if (npc.ai[3] == Num) { npc.netUpdate = true; } - if (npc.ai[3] < (float)Num) + if (npc.ai[3] < Num) { npc.TargetClosest(true); } @@ -152,16 +152,16 @@ public void DoAI() bool Flag3 = false; if (npc.velocity.Y == 0f) { - int Num2 = (int)(npc.position.Y + (float)npc.height + 8f) / 16; + int Num2 = (int)(npc.position.Y + npc.height + 8f) / 16; int Num3 = (int)npc.position.X / 16; - int Num4 = (int)(npc.position.X + (float)npc.width) / 16; + int Num4 = (int)(npc.position.X + npc.width) / 16; for (int l = Num3; l <= Num4; l++) { if (Main.tile[l, Num2] == null) { return; } - if (Main.tile[l, Num2].active() && Main.tileSolid[(int)Main.tile[l, Num2].type]) + if (Main.tile[l, Num2].active() && Main.tileSolid[Main.tile[l, Num2].type]) { Flag3 = true; break; @@ -171,8 +171,8 @@ public void DoAI() if (Flag3) { - int Num5 = (int)((npc.position.X + (float)(npc.width / 2) + (float)((npc.width / 2 + 6) * npc.direction)) / 16f); - int Num6 = (int)((npc.position.Y + (float)npc.height - 15f) / 16f); + int Num5 = (int)((npc.position.X + npc.width / 2 + (npc.width / 2 + 6) * npc.direction) / 16f); + int Num6 = (int)((npc.position.Y + npc.height - 15f) / 16f); if (Main.tile[Num5, Num6] == null) { Main.tile[Num5, Num6] = new Tile(); @@ -208,7 +208,7 @@ public void DoAI() npc.ai[3] = 0f; if (npc.ai[2] >= 60f) { - npc.velocity.X = 0.5f * (float)(-(float)npc.direction); + npc.velocity.X = 0.5f * -(float)npc.direction; npc.ai[1] += 1f; npc.ai[2] = 0f; bool Flag4 = false; @@ -223,7 +223,7 @@ public void DoAI() bool Flag5 = WorldGen.OpenDoor(Num5, Num6, npc.direction); if (!Flag5) { - npc.ai[3] = (float)Num; + npc.ai[3] = Num; npc.netUpdate = true; } if (Main.netMode == 2 && Flag5) @@ -236,9 +236,9 @@ public void DoAI() if ((npc.velocity.X < 0f && npc.spriteDirection == -1) || (npc.velocity.X > 0f && npc.spriteDirection == 1)) { - if (Main.tile[Num5, Num6 - 2].active() && Main.tileSolid[(int)Main.tile[Num5, Num6 - 2].type]) + if (Main.tile[Num5, Num6 - 2].active() && Main.tileSolid[Main.tile[Num5, Num6 - 2].type]) { - if ((Main.tile[Num5, Num6 - 3].active() && Main.tileSolid[(int)Main.tile[Num5, Num6 - 3].type])) + if ((Main.tile[Num5, Num6 - 3].active() && Main.tileSolid[Main.tile[Num5, Num6 - 3].type])) { npc.velocity.Y = -8f; npc.netUpdate = true; @@ -251,21 +251,21 @@ public void DoAI() } else { - if (Main.tile[Num5, Num6 - 1].active() && Main.tileSolid[(int)Main.tile[Num5, Num6 - 1].type]) + if (Main.tile[Num5, Num6 - 1].active() && Main.tileSolid[Main.tile[Num5, Num6 - 1].type]) { npc.velocity.Y = -6f; npc.netUpdate = true; } else { - if (Main.tile[Num5, Num6].active() && Main.tileSolid[(int)Main.tile[Num5, Num6].type]) + if (Main.tile[Num5, Num6].active() && Main.tileSolid[Main.tile[Num5, Num6].type]) { npc.velocity.Y = -5f; npc.netUpdate = true; } else { - if (npc.directionY < 0 && (!Main.tile[Num5, Num6 + 1].active() || !Main.tileSolid[(int)Main.tile[Num5, Num6 + 1].type]) && (!Main.tile[Num5 + npc.direction, Num6 + 1].active() || !Main.tileSolid[(int)Main.tile[Num5 + npc.direction, Num6 + 1].type])) + if (npc.directionY < 0 && (!Main.tile[Num5, Num6 + 1].active() || !Main.tileSolid[Main.tile[Num5, Num6 + 1].type]) && (!Main.tile[Num5 + npc.direction, Num6 + 1].active() || !Main.tileSolid[Main.tile[Num5 + npc.direction, Num6 + 1].type])) { npc.velocity.Y = -8f; npc.velocity.X = npc.velocity.X * 1.5f; @@ -300,12 +300,12 @@ public override void OnHitPlayer(Player player, int damage, bool crit) npc.active = false; npc.checkDead(); Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 62); - npc.position.X = npc.position.X + (float)(npc.width / 2); - npc.position.Y = npc.position.Y + (float)(npc.height / 2); + npc.position.X = npc.position.X + npc.width / 2; + npc.position.Y = npc.position.Y + npc.height / 2; npc.width = 80; npc.height = 80; - npc.position.X = npc.position.X - (float)(npc.width / 2); - npc.position.Y = npc.position.Y - (float)(npc.height / 2); + npc.position.X = npc.position.X - npc.width / 2; + npc.position.Y = npc.position.Y - npc.height / 2; for (int num628 = 0; num628 < 40; num628++) { int num629 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 31, 0f, 0f, 100, default(Color), 2f); @@ -313,7 +313,7 @@ public override void OnHitPlayer(Player player, int damage, bool crit) if (Main.rand.Next(2) == 0) { Main.dust[num629].scale = 0.5f; - Main.dust[num629].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num629].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } for (int num630 = 0; num630 < 70; num630++) @@ -335,37 +335,37 @@ public override void OnHitPlayer(Player player, int damage, bool crit) { scaleFactor10 = 1f; } - int num633 = 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 num633 = Gore.NewGore(new Vector2(npc.position.X + npc.width / 2 - 24f, npc.position.Y + npc.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13E6D_cp_0 = Main.gore[num633]; expr_13E6D_cp_0.velocity.X = expr_13E6D_cp_0.velocity.X + 1f; Gore expr_13E8D_cp_0 = Main.gore[num633]; expr_13E8D_cp_0.velocity.Y = expr_13E8D_cp_0.velocity.Y + 1f; - num633 = 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), 2f); + num633 = Gore.NewGore(new Vector2(npc.position.X + npc.width / 2 - 24f, npc.position.Y + npc.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 2f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13F30_cp_0 = Main.gore[num633]; expr_13F30_cp_0.velocity.X = expr_13F30_cp_0.velocity.X - 1f; Gore expr_13F50_cp_0 = Main.gore[num633]; expr_13F50_cp_0.velocity.Y = expr_13F50_cp_0.velocity.Y + 1f; - num633 = 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); + num633 = Gore.NewGore(new Vector2(npc.position.X + npc.width / 2 - 24f, npc.position.Y + npc.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13FF3_cp_0 = Main.gore[num633]; expr_13FF3_cp_0.velocity.X = expr_13FF3_cp_0.velocity.X + 1f; Gore expr_14013_cp_0 = Main.gore[num633]; expr_14013_cp_0.velocity.Y = expr_14013_cp_0.velocity.Y - 1f; - num633 = 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); + num633 = Gore.NewGore(new Vector2(npc.position.X + npc.width / 2 - 24f, npc.position.Y + npc.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_140B6_cp_0 = Main.gore[num633]; expr_140B6_cp_0.velocity.X = expr_140B6_cp_0.velocity.X - 1f; Gore expr_140D6_cp_0 = Main.gore[num633]; expr_140D6_cp_0.velocity.Y = expr_140D6_cp_0.velocity.Y - 1f; } - npc.position.X = npc.position.X + (float)(npc.width / 2); - npc.position.Y = npc.position.Y + (float)(npc.height / 2); + npc.position.X = npc.position.X + npc.width / 2; + npc.position.Y = npc.position.Y + npc.height / 2; npc.width = 10; npc.height = 10; - npc.position.X = npc.position.X - (float)(npc.width / 2); - npc.position.Y = npc.position.Y - (float)(npc.height / 2); + npc.position.X = npc.position.X - npc.width / 2; + npc.position.Y = npc.position.Y - npc.height / 2; } public override void HitEffect(int hitDirection, double damage) @@ -373,12 +373,12 @@ public override void HitEffect(int hitDirection, double damage) if (npc.life <= 0) { Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 62); - npc.position.X = npc.position.X + (float)(npc.width / 2); - npc.position.Y = npc.position.Y + (float)(npc.height / 2); + npc.position.X = npc.position.X + npc.width / 2; + npc.position.Y = npc.position.Y + npc.height / 2; npc.width = 80; npc.height = 80; - npc.position.X = npc.position.X - (float)(npc.width / 2); - npc.position.Y = npc.position.Y - (float)(npc.height / 2); + npc.position.X = npc.position.X - npc.width / 2; + npc.position.Y = npc.position.Y - npc.height / 2; for (int num628 = 0; num628 < 40; num628++) { int num629 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 31, 0f, 0f, 100, default(Color), 2f); @@ -386,7 +386,7 @@ public override void HitEffect(int hitDirection, double damage) if (Main.rand.Next(2) == 0) { Main.dust[num629].scale = 0.5f; - Main.dust[num629].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num629].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } for (int num630 = 0; num630 < 70; num630++) @@ -408,50 +408,50 @@ public override void HitEffect(int hitDirection, double damage) { scaleFactor10 = 1f; } - int num633 = 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 num633 = Gore.NewGore(new Vector2(npc.position.X + npc.width / 2 - 24f, npc.position.Y + npc.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13E6D_cp_0 = Main.gore[num633]; expr_13E6D_cp_0.velocity.X = expr_13E6D_cp_0.velocity.X + 1f; Gore expr_13E8D_cp_0 = Main.gore[num633]; expr_13E8D_cp_0.velocity.Y = expr_13E8D_cp_0.velocity.Y + 1f; - num633 = 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), 2f); + num633 = Gore.NewGore(new Vector2(npc.position.X + npc.width / 2 - 24f, npc.position.Y + npc.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 2f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13F30_cp_0 = Main.gore[num633]; expr_13F30_cp_0.velocity.X = expr_13F30_cp_0.velocity.X - 1f; Gore expr_13F50_cp_0 = Main.gore[num633]; expr_13F50_cp_0.velocity.Y = expr_13F50_cp_0.velocity.Y + 1f; - num633 = 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); + num633 = Gore.NewGore(new Vector2(npc.position.X + npc.width / 2 - 24f, npc.position.Y + npc.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13FF3_cp_0 = Main.gore[num633]; expr_13FF3_cp_0.velocity.X = expr_13FF3_cp_0.velocity.X + 1f; Gore expr_14013_cp_0 = Main.gore[num633]; expr_14013_cp_0.velocity.Y = expr_14013_cp_0.velocity.Y - 1f; - num633 = 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); + num633 = Gore.NewGore(new Vector2(npc.position.X + npc.width / 2 - 24f, npc.position.Y + npc.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_140B6_cp_0 = Main.gore[num633]; expr_140B6_cp_0.velocity.X = expr_140B6_cp_0.velocity.X - 1f; Gore expr_140D6_cp_0 = Main.gore[num633]; expr_140D6_cp_0.velocity.Y = expr_140D6_cp_0.velocity.Y - 1f; } - npc.position.X = npc.position.X + (float)(npc.width / 2); - npc.position.Y = npc.position.Y + (float)(npc.height / 2); + npc.position.X = npc.position.X + npc.width / 2; + npc.position.Y = npc.position.Y + npc.height / 2; npc.width = 10; npc.height = 10; - npc.position.X = npc.position.X - (float)(npc.width / 2); - npc.position.Y = npc.position.Y - (float)(npc.height / 2); + npc.position.X = npc.position.X - npc.width / 2; + npc.position.Y = npc.position.Y - npc.height / 2; } } public override void NPCLoot() { - if (Main.invasionType == Terraria.ID.InvasionID.GoblinArmy) + if (Main.invasionType == InvasionID.GoblinArmy) { Main.invasionProgress++; } if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(2) == 0) @@ -475,7 +475,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (NPC.AnyNPCs(26) || NPC.AnyNPCs(27) || NPC.AnyNPCs(28) || NPC.AnyNPCs(29)) && NPC.downedBoss3 && y < Main.worldSurface ? 0.08f : 0f; } } diff --git a/NPCs/GoblinStandardBearer.cs b/NPCs/GoblinStandardBearer.cs index a1dbdd0f..34cd5c81 100644 --- a/NPCs/GoblinStandardBearer.cs +++ b/NPCs/GoblinStandardBearer.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -32,8 +32,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void AI() @@ -85,21 +85,21 @@ public override void AI() } } } - if (npc.directionY == -1 && (double)npc.velocity.Y > -1.5) + if (npc.directionY == -1 && npc.velocity.Y > -1.5) { npc.velocity.Y = npc.velocity.Y - 0.05f; - if ((double)npc.velocity.Y < -1.5) + if (npc.velocity.Y < -1.5) { npc.velocity.Y = -1.5f; } } else { - if (npc.directionY == 1 && (double)npc.velocity.Y < 1.5) + if (npc.directionY == 1 && npc.velocity.Y < 1.5) { npc.velocity.Y = npc.velocity.Y + 0.05f; - if ((double)npc.velocity.Y > 1.5) + if (npc.velocity.Y > 1.5) { npc.velocity.Y = 1.5f; } @@ -107,7 +107,7 @@ public override void AI() } } - int Frame = 0; + int Frame; int TimeToAnimation = 6; public void PlayAnimation() { @@ -129,7 +129,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (NPC.AnyNPCs(26) || NPC.AnyNPCs(27) || NPC.AnyNPCs(28) || NPC.AnyNPCs(29)) && NPC.downedBoss3 && y < Main.worldSurface ? 0.3f : 0f; } diff --git a/NPCs/GoblinStandardBearer_Balloon.cs b/NPCs/GoblinStandardBearer_Balloon.cs index 136bedba..920da38e 100644 --- a/NPCs/GoblinStandardBearer_Balloon.cs +++ b/NPCs/GoblinStandardBearer_Balloon.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -31,8 +31,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void AI() @@ -84,21 +84,21 @@ public override void AI() } } } - if (npc.directionY == -1 && (double)npc.velocity.Y > -1.5) + if (npc.directionY == -1 && npc.velocity.Y > -1.5) { npc.velocity.Y = npc.velocity.Y - 0.05f; - if ((double)npc.velocity.Y < -1.5) + if (npc.velocity.Y < -1.5) { npc.velocity.Y = -1.5f; } } else { - if (npc.directionY == 1 && (double)npc.velocity.Y < 1.5) + if (npc.directionY == 1 && npc.velocity.Y < 1.5) { npc.velocity.Y = npc.velocity.Y + 0.05f; - if ((double)npc.velocity.Y > 1.5) + if (npc.velocity.Y > 1.5) { npc.velocity.Y = 1.5f; } @@ -106,7 +106,7 @@ public override void AI() } } - int Frame = 0; + int Frame; int TimeToAnimation = 6; public void PlayAnimation() { @@ -126,14 +126,14 @@ Rectangle GetFrame(int Num) public override void NPCLoot() { - if (Main.invasionType == Terraria.ID.InvasionID.GoblinArmy) + if (Main.invasionType == InvasionID.GoblinArmy) { Main.invasionProgress++; } if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(2) == 0) diff --git a/NPCs/GogLordGog.cs b/NPCs/GogLordGog.cs index 7baf6d89..05fd128f 100644 --- a/NPCs/GogLordGog.cs +++ b/NPCs/GogLordGog.cs @@ -1,8 +1,8 @@ -using Terraria.ID; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; namespace Tremor.NPCs { @@ -30,10 +30,10 @@ public override void SetDefaults() npc.value = Item.buyPrice(0, 1, 0, 0); } - int timer = 0; + int timer; public override void AI() { - float Num1 = (float)Main.mouseTextColor / 200f - 0.35f; + float Num1 = Main.mouseTextColor / 200f - 0.35f; Num1 *= 0.5f; npc.scale = Num1 + 0.95f; timer++; diff --git a/NPCs/GoplitArcher.cs b/NPCs/GoplitArcher.cs index 6887b6a2..7f812e92 100644 --- a/NPCs/GoplitArcher.cs +++ b/NPCs/GoplitArcher.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -36,8 +36,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -46,7 +46,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 31, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 31, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GoplitAGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GoplitAGore2"), 1f); @@ -59,8 +59,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(2) == 0) { diff --git a/NPCs/GoplitOfficer.cs b/NPCs/GoplitOfficer.cs index 1dad408d..b0fe8bef 100644 --- a/NPCs/GoplitOfficer.cs +++ b/NPCs/GoplitOfficer.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -32,8 +32,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } @@ -43,7 +43,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SHGore3"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SHGore3"), 1f); diff --git a/NPCs/GraniteBeetle.cs b/NPCs/GraniteBeetle.cs index 8b457868..e5e74949 100644 --- a/NPCs/GraniteBeetle.cs +++ b/NPCs/GraniteBeetle.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -39,8 +39,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(2) == 0) { @@ -55,8 +55,8 @@ public override void NPCLoot() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -65,7 +65,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 31, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 31, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GBeetleGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GBeetleGore2"), 1f); diff --git a/NPCs/GraniteBowman.cs b/NPCs/GraniteBowman.cs index 9cdafb42..46efc12d 100644 --- a/NPCs/GraniteBowman.cs +++ b/NPCs/GraniteBowman.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -38,8 +38,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(2) == 0) { @@ -54,8 +54,8 @@ public override void NPCLoot() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -64,7 +64,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 31, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 31, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GBGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GBGore2"), 1f); diff --git a/NPCs/GrayRaven.cs b/NPCs/GrayRaven.cs index 876fb991..f116fec2 100644 --- a/NPCs/GrayRaven.cs +++ b/NPCs/GrayRaven.cs @@ -1,7 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; + namespace Tremor.NPCs { @@ -34,8 +35,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { @@ -58,7 +59,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GrayRavenGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GrayRavenGore1"), 1f); @@ -71,7 +72,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && y > Main.rockLayer ? 0.01f : 0f; } } diff --git a/NPCs/GreatFungusBug.cs b/NPCs/GreatFungusBug.cs index 6383ce79..0ac92f8e 100644 --- a/NPCs/GreatFungusBug.cs +++ b/NPCs/GreatFungusBug.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -34,8 +34,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -48,18 +48,18 @@ public override void HitEffect(int hitDirection, double damage) Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FungalBugGore3"), 1f); for (int k = 0; k < 60; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 67, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 67, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 67, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 67, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } } else { for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 67, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 67, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } } } diff --git a/NPCs/Grood.cs b/NPCs/Grood.cs index 9fd4b5f9..8d8b21bd 100644 --- a/NPCs/Grood.cs +++ b/NPCs/Grood.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -36,8 +36,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(23) == 0) { @@ -52,8 +52,8 @@ public override void NPCLoot() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override float SpawnChance(NPCSpawnInfo spawnInfo) @@ -67,7 +67,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 60; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GroodGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GroodGore2"), 1f); @@ -79,9 +79,9 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 0.7f); } } } diff --git a/NPCs/Gurd.cs b/NPCs/Gurd.cs index 53412f97..392c94bd 100644 --- a/NPCs/Gurd.cs +++ b/NPCs/Gurd.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -36,8 +36,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(27) == 0) { @@ -48,8 +48,8 @@ public override void NPCLoot() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override float SpawnChance(NPCSpawnInfo spawnInfo) @@ -63,7 +63,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 60; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GrudGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GrudGore2"), 1f); @@ -73,9 +73,9 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 0.7f); } } } diff --git a/NPCs/HallowSlimer.cs b/NPCs/HallowSlimer.cs index d3407484..6ceb2d97 100644 --- a/NPCs/HallowSlimer.cs +++ b/NPCs/HallowSlimer.cs @@ -1,7 +1,7 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -37,8 +37,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } @@ -51,7 +51,7 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) if (npc.direction == 1) { effect = SpriteEffects.FlipHorizontally; } if (npc.direction == -1) { effect = SpriteEffects.None; } Vector2 drawPos = npc.oldPos[k] - Main.screenPosition; - Color color = npc.GetAlpha(lightColor) * ((float)(npc.oldPos.Length - k) / (float)npc.oldPos.Length); + Color color = npc.GetAlpha(lightColor) * ((npc.oldPos.Length - k) / (float)npc.oldPos.Length); Rectangle frame = new Rectangle(0, 0, 90, 42); frame.Y += 164 * (k / 60); @@ -68,7 +68,7 @@ public override void HitEffect(int hitDirection, double damage) NPC.NewNPC((int)npc.position.X, (int)npc.position.Y - 48, 138); for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } } } @@ -88,7 +88,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneHoly && y < Main.worldSurface ? 0.01f : 0f; } } diff --git a/NPCs/Hallower.cs b/NPCs/Hallower.cs index a3664977..6fc9e34b 100644 --- a/NPCs/Hallower.cs +++ b/NPCs/Hallower.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -40,16 +40,16 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { @@ -62,13 +62,13 @@ public override void HitEffect(int hitDirection, double damage) { if (npc.life <= 0) { - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } } } @@ -90,7 +90,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && NPC.downedMoonlord && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneHoly && y < Main.worldSurface ? 0.01f : 0f; } } diff --git a/NPCs/HappySoul.cs b/NPCs/HappySoul.cs index 87fda8a9..7cd97f06 100644 --- a/NPCs/HappySoul.cs +++ b/NPCs/HappySoul.cs @@ -1,9 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { [AutoloadBossHead] @@ -47,17 +46,17 @@ public override void HitEffect(int hitDirection, double damage) { if (npc.life <= 0) { - Dust.NewDust(npc.position, npc.width, npc.height, 62, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 62, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 62, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 62, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 62, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 62, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 62, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 62, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 62, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 62, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 62, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 62, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); - Dust.NewDust(npc.position, npc.width, npc.height, 62, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 62, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + Dust.NewDust(npc.position, npc.width, npc.height, 62, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 62, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.6f); + Dust.NewDust(npc.position, npc.width, npc.height, 62, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 62, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.6f); } } } diff --git a/NPCs/HarpyWarrior.cs b/NPCs/HarpyWarrior.cs index f624eb13..f7b872b6 100644 --- a/NPCs/HarpyWarrior.cs +++ b/NPCs/HarpyWarrior.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -41,7 +41,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HarpyGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HarpyGore1"), 1f); @@ -51,15 +51,15 @@ public override void HitEffect(int hitDirection, double damage) public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return Tremor.NoZoneAllowWater(spawnInfo) && Main.hardMode && spawnInfo.sky ? 0.02f : 0; } } diff --git a/NPCs/HeadlessZombie.cs b/NPCs/HeadlessZombie.cs index 05e3fba6..912543d8 100644 --- a/NPCs/HeadlessZombie.cs +++ b/NPCs/HeadlessZombie.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -34,8 +34,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -44,7 +44,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore2"), 1f); @@ -57,8 +57,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(3) == 0) { @@ -70,7 +70,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && y < Main.worldSurface ? 0.01f : 0f; } } diff --git a/NPCs/HeaterOfWorldsBody.cs b/NPCs/HeaterOfWorldsBody.cs index 45a91b2e..0d42263b 100644 --- a/NPCs/HeaterOfWorldsBody.cs +++ b/NPCs/HeaterOfWorldsBody.cs @@ -1,3 +1,4 @@ +using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -72,7 +73,7 @@ void Shoot() Vector2 VelocityFPTP(Vector2 pos1, Vector2 pos2, float speed) { Vector2 move = pos2 - pos1; - return move * (speed / (float)System.Math.Sqrt(move.X * move.X + move.Y * move.Y)); + return move * (speed / (float)Math.Sqrt(move.X * move.X + move.Y * move.Y)); } public override void AI() diff --git a/NPCs/HeaterOfWorldsHead.cs b/NPCs/HeaterOfWorldsHead.cs index d22d635a..71428140 100644 --- a/NPCs/HeaterOfWorldsHead.cs +++ b/NPCs/HeaterOfWorldsHead.cs @@ -15,7 +15,7 @@ public override void SetStaticDefaults() DisplayName.SetDefault("Heater of Worlds"); } - bool TailSpawned = false; + bool TailSpawned; public static int ShootRate = 20; const int ShootDamage = 58; @@ -103,9 +103,9 @@ public override void AI() lol = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.width / 2), mod.NPCType("HeaterOfWorldsTail"), npc.whoAmI); } Main.npc[lol].realLife = npc.whoAmI; - Main.npc[lol].ai[2] = (float)npc.whoAmI; - Main.npc[lol].ai[1] = (float)Previous; - Main.npc[Previous].ai[0] = (float)lol; + Main.npc[lol].ai[2] = npc.whoAmI; + Main.npc[lol].ai[1] = Previous; + Main.npc[Previous].ai[0] = lol; //NetMessage.SendData(23, -1, -1, "", lol, 0f, 0f, 0f, 0); Previous = lol; } @@ -139,8 +139,8 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) public override void NPCLoot() { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; for (int x = centerX - halfLength; x <= centerX + halfLength; x++) { diff --git a/NPCs/HeavyZombie.cs b/NPCs/HeavyZombie.cs index 0fc251d6..a0bfb8fe 100644 --- a/NPCs/HeavyZombie.cs +++ b/NPCs/HeavyZombie.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -34,8 +34,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -44,7 +44,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HeavyGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HeavyGore2"), 1f); @@ -57,8 +57,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(3) == 0) { @@ -86,7 +86,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.03f : 0f; } } diff --git a/NPCs/Hellgron.cs b/NPCs/Hellgron.cs index 4448ee94..a77f8f07 100644 --- a/NPCs/Hellgron.cs +++ b/NPCs/Hellgron.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -40,8 +40,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void AI() { @@ -56,17 +56,17 @@ public override void HitEffect(int hitDirection, double damage) { if (npc.life <= 0) { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HellgronGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HellgronGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HellgronGore2"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HellgronGore3"), 1f); for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.6f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.6f); } } } @@ -76,7 +76,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.spawnTileY > Main.maxTilesY - 200 ? 0.03f : 0; } } diff --git a/NPCs/Hellhound.cs b/NPCs/Hellhound.cs index 97dadc4a..d100ec21 100644 --- a/NPCs/Hellhound.cs +++ b/NPCs/Hellhound.cs @@ -1,8 +1,9 @@ -using Terraria.ID; using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; + namespace Tremor.NPCs { @@ -41,9 +42,9 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 60; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HellhoundGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HellhoundGore2"), 1f); @@ -56,8 +57,8 @@ public override void HitEffect(int hitDirection, double damage) for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 6, (float)hitDirection, -2f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -2f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default(Color), 0.7f); } } } @@ -66,8 +67,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { @@ -88,10 +89,10 @@ public override void AI() int num706 = Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 1f); Main.dust[num706].velocity *= 0.3f; } - Vector2 vector72 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num738 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector72.X; + Vector2 vector72 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + float num738 = Main.player[npc.target].position.X + Main.player[npc.target].width * 0.5f - vector72.X; float num739 = Main.player[npc.target].position.Y - vector72.Y; - float num740 = (float)Math.Sqrt((double)(num738 * num738 + num739 * num739)); + float num740 = (float)Math.Sqrt(num738 * num738 + num739 * num739); if (npc.ai[2] == 1f) { @@ -99,12 +100,12 @@ public override void AI() npc.velocity.X = npc.velocity.X * 0.7f; if (npc.ai[1] < 30f) { - Vector2 vector73 = npc.Center + Vector2.UnitX * (float)npc.spriteDirection * -20f; + Vector2 vector73 = npc.Center + Vector2.UnitX * npc.spriteDirection * -20f; Dust dust11 = Main.dust[Dust.NewDust(vector73, 0, 0, 6, 0f, 0f, 0, default(Color), 1f)]; Vector2 vector74 = Vector2.UnitY.RotatedByRandom(6.2831854820251465); dust11.position = vector73 + vector74 * 20f; dust11.velocity = -vector74 * 2f; - dust11.scale = 0.5f + vector74.X * (float)(-(float)npc.spriteDirection); + dust11.scale = 0.5f + vector74.X * -(float)npc.spriteDirection; dust11.fadeIn = 1f; dust11.noGravity = true; } @@ -112,12 +113,12 @@ public override void AI() { for (int num743 = 0; num743 < 20; num743++) { - Vector2 vector75 = npc.Center + Vector2.UnitX * (float)npc.spriteDirection * -20f; + Vector2 vector75 = npc.Center + Vector2.UnitX * npc.spriteDirection * -20f; Dust dust12 = Main.dust[Dust.NewDust(vector75, 0, 0, 6, 0f, 0f, 0, default(Color), 1f)]; Vector2 vector76 = Vector2.UnitY.RotatedByRandom(6.2831854820251465); dust12.position = vector75 + vector76 * 4f; - dust12.velocity = vector76 * 4f + Vector2.UnitX * Main.rand.NextFloat() * (float)npc.spriteDirection * -5f; - dust12.scale = 0.5f + vector76.X * (float)(-(float)npc.spriteDirection); + dust12.velocity = vector76 * 4f + Vector2.UnitX * Main.rand.NextFloat() * npc.spriteDirection * -5f; + dust12.scale = 0.5f + vector76.X * -(float)npc.spriteDirection; dust12.fadeIn = 1f; dust12.noGravity = true; } @@ -129,11 +130,11 @@ public override void AI() if (npc.ai[1] == 30f && Main.netMode != 1) { int num744 = Main.expertMode ? 35 : 50; - Projectile.NewProjectile(npc.Center.X + (float)(npc.spriteDirection * -20), npc.Center.Y, (float)(npc.spriteDirection * -7), 0f, 467, num744, 0f, Main.myPlayer, (float)npc.target, 0f); + Projectile.NewProjectile(npc.Center.X + npc.spriteDirection * -20, npc.Center.Y, npc.spriteDirection * -7, 0f, 467, num744, 0f, Main.myPlayer, npc.target, 0f); } if (npc.ai[1] >= 60f) { - npc.ai[1] = (float)(-(float)Main.rand.Next(320, 601)); + npc.ai[1] = -(float)Main.rand.Next(320, 601); npc.ai[2] = 0f; } } @@ -158,7 +159,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && spawnInfo.spawnTileY > Main.maxTilesY - 200 ? 0.002f : 0f; } diff --git a/NPCs/HiveHeadZombie.cs b/NPCs/HiveHeadZombie.cs index 980303fa..5c0925c2 100644 --- a/NPCs/HiveHeadZombie.cs +++ b/NPCs/HiveHeadZombie.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -34,8 +34,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -44,7 +44,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore2"), 1f); @@ -59,7 +59,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedQueenBee && !Main.dayTime && y < Main.worldSurface ? 0.01f : 0f; } } diff --git a/NPCs/IceBlazer.cs b/NPCs/IceBlazer.cs index 56d0588c..cb66a00d 100644 --- a/NPCs/IceBlazer.cs +++ b/NPCs/IceBlazer.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -37,15 +37,15 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && spawnInfo.player.ZoneSnow && y < Main.worldSurface ? 0.004f : 0f; } @@ -53,8 +53,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(2) == 0) { @@ -73,20 +73,20 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 60; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 92, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 92, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 92, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 92, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 92, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 92, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 92, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 92, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } } else { for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 92, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 92, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } } } diff --git a/NPCs/IceMotherSlime.cs b/NPCs/IceMotherSlime.cs index 1a458fb8..8931ce0b 100644 --- a/NPCs/IceMotherSlime.cs +++ b/NPCs/IceMotherSlime.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -37,16 +37,16 @@ public override void HitEffect(int hitDirection, double damage) { if (npc.life <= 0) { - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); NPC.NewNPC((int)npc.position.X, (int)npc.position.Y - 48, 147); NPC.NewNPC((int)npc.position.X, (int)npc.position.Y - 48, 147); NPC.NewNPC((int)npc.position.X, (int)npc.position.Y - 48, 147); for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.6f); } } } @@ -62,15 +62,15 @@ public override void AI() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && Main.cloudAlpha > 0f && y < Main.worldSurface && spawnInfo.player.ZoneSnow ? 0.01f : 0f; } } diff --git a/NPCs/IndifferenceSoul.cs b/NPCs/IndifferenceSoul.cs index e56c4100..e7631791 100644 --- a/NPCs/IndifferenceSoul.cs +++ b/NPCs/IndifferenceSoul.cs @@ -1,9 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { [AutoloadBossHead] @@ -36,8 +35,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void AI() { @@ -52,17 +51,17 @@ public override void HitEffect(int hitDirection, double damage) { if (npc.life <= 0) { - Dust.NewDust(npc.position, npc.width, npc.height, 60, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 60, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 60, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 60, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 60, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 60, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 60, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 60, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 60, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 60, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 60, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 60, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); - Dust.NewDust(npc.position, npc.width, npc.height, 60, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 60, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + Dust.NewDust(npc.position, npc.width, npc.height, 60, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 60, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.6f); + Dust.NewDust(npc.position, npc.width, npc.height, 60, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 60, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.6f); } } } diff --git a/NPCs/InfectedZombie.cs b/NPCs/InfectedZombie.cs index 5dfced4a..cfadc3aa 100644 --- a/NPCs/InfectedZombie.cs +++ b/NPCs/InfectedZombie.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -33,15 +33,15 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && NPC.downedBoss2 && spawnInfo.player.ZoneCrimson && y < Main.worldSurface ? 0.02f : 0; } } diff --git a/NPCs/IronGiant.cs b/NPCs/IronGiant.cs index 1e322416..cbc49f3b 100644 --- a/NPCs/IronGiant.cs +++ b/NPCs/IronGiant.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -38,8 +38,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(8) == 0) { @@ -54,8 +54,8 @@ public override void NPCLoot() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -64,7 +64,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 31, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 31, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, 99, 1f); Gore.NewGore(npc.position, npc.velocity, 99, 1f); @@ -82,7 +82,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && y > Main.rockLayer ? 0.001f : 0f; } diff --git a/NPCs/JungleMimic.cs b/NPCs/JungleMimic.cs index 0f083ff0..bd4b23ad 100644 --- a/NPCs/JungleMimic.cs +++ b/NPCs/JungleMimic.cs @@ -1,6 +1,6 @@ -using Terraria.ID; -using Terraria; using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -33,8 +33,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; Helper.DropItem(new Rectangle((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height), new Drop(mod.ItemType("SporeBlade"), 1, 1), new Drop(mod.ItemType("TechnologyofDionysus"), 1, 2), new Drop(mod.ItemType("LivingWoodThreepeater"), 1, 2), new Drop(mod.ItemType("UnfathomableFlower"), 1, 1), new Drop(0, 0, 0)); Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 500, Main.rand.Next(10)); @@ -46,7 +46,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && spawnInfo.player.ZoneJungle && y > Main.rockLayer ? 0.003f : 0f; } } diff --git a/NPCs/JungleMimicSummon.cs b/NPCs/JungleMimicSummon.cs index b9b25814..66f6d5dd 100644 --- a/NPCs/JungleMimicSummon.cs +++ b/NPCs/JungleMimicSummon.cs @@ -1,13 +1,13 @@ -using Terraria.ID; +using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Terraria; namespace Tremor.NPCs { // Example Soul of Light/Soul of Night style NPC summon public class JungleMimicSummon : ModPlayer { - public int LastChest = 0; + public int LastChest; // This doesn't make sense, but this is around where this check happens in Vanilla Terraria. public override void PreUpdateBuffs() @@ -38,7 +38,7 @@ public static bool ChestItemSummonCheck(int x, int y, Mod mod) int numberJungleKey = 0; int numberOtherItems = 0; ushort tileType = Main.tile[Main.chest[num].x, Main.chest[num].y].type; - int tileStyle = (int)(Main.tile[Main.chest[num].x, Main.chest[num].y].frameX / 36); + int tileStyle = Main.tile[Main.chest[num].x, Main.chest[num].y].frameX / 36; if (TileID.Sets.BasicChest[tileType] && (tileStyle < 5 || tileStyle > 6)) { for (int i = 0; i < 40; i++) @@ -84,7 +84,7 @@ public static bool ChestItemSummonCheck(int x, int y, Mod mod) Main.chest[num].item[l] = new Item(); } Chest.DestroyChest(x, y); - NetMessage.SendData(34, -1, -1, null, 1, (float)x, (float)y, 0f, number, 0, 0); + NetMessage.SendData(34, -1, -1, null, 1, x, y, 0f, number, 0, 0); NetMessage.SendTileSquare(-1, x, y, 3); } int npcToSpawn = mod.NPCType("JungleMimic"); diff --git a/NPCs/JungleSpirit.cs b/NPCs/JungleSpirit.cs index 3ceb6f67..d774bc07 100644 --- a/NPCs/JungleSpirit.cs +++ b/NPCs/JungleSpirit.cs @@ -1,9 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { @@ -37,8 +36,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -47,7 +46,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/JungleSpiritGore"), 1f); @@ -60,7 +59,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneJungle && y > Main.rockLayer ? 0.005f : 0f; } } diff --git a/NPCs/Knight.cs b/NPCs/Knight.cs index 9ff29842..dfa39a8c 100644 --- a/NPCs/Knight.cs +++ b/NPCs/Knight.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -8,21 +8,9 @@ namespace Tremor.NPCs [AutoloadHead] public class Knight : ModNPC { - public override string Texture - { - get - { - return "Tremor/NPCs/Knight"; - } - } + public override string Texture => "Tremor/NPCs/Knight"; - public override string[] AltTextures - { - get - { - return new string[] { "Tremor/NPCs/Knight" }; - } - } + public override string[] AltTextures => new[] { "Tremor/NPCs/Knight" }; public override bool Autoload(ref string name) { @@ -196,7 +184,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/KnightGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/KnightGore2"), 1f); diff --git a/NPCs/KnightZombie.cs b/NPCs/KnightZombie.cs index 80a37456..f74b9dfd 100644 --- a/NPCs/KnightZombie.cs +++ b/NPCs/KnightZombie.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -32,8 +32,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -42,7 +42,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore2"), 1f); @@ -56,8 +56,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(25) == 0) { @@ -69,7 +69,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && y < Main.worldSurface ? 0.1f : 0f; } } diff --git a/NPCs/KnightZombieSword.cs b/NPCs/KnightZombieSword.cs index 31d9d171..cb48fe60 100644 --- a/NPCs/KnightZombieSword.cs +++ b/NPCs/KnightZombieSword.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -45,8 +45,8 @@ public override void AI() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override float SpawnChance(NPCSpawnInfo spawnInfo) @@ -60,7 +60,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore2"), 1f); @@ -75,8 +75,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(25) == 0) { diff --git a/NPCs/LadyMoon.cs b/NPCs/LadyMoon.cs index 747010db..e735bdf8 100644 --- a/NPCs/LadyMoon.cs +++ b/NPCs/LadyMoon.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -8,21 +8,9 @@ namespace Tremor.NPCs [AutoloadHead] public class LadyMoon : ModNPC { - public override string Texture - { - get - { - return "Tremor/NPCs/LadyMoon"; - } - } + public override string Texture => "Tremor/NPCs/LadyMoon"; - public override string[] AltTextures - { - get - { - return new string[] { "Tremor/NPCs/LadyMoon" }; - } - } + public override string[] AltTextures => new[] { "Tremor/NPCs/LadyMoon" }; public override bool Autoload(ref string name) { @@ -182,7 +170,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FarmerGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FarmerGore2"), 1f); diff --git a/NPCs/Leprechaun.cs b/NPCs/Leprechaun.cs index d1c4db98..7f5b5615 100644 --- a/NPCs/Leprechaun.cs +++ b/NPCs/Leprechaun.cs @@ -1,6 +1,6 @@ -using Terraria.ID; -using Terraria; using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -31,8 +31,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -41,7 +41,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 31, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 31, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, 220, 1f); Gore.NewGore(npc.position, npc.velocity, 221, 1f); @@ -53,7 +53,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && y > Main.rockLayer ? 0.0007f : 0f; } } diff --git a/NPCs/LihzahrdWarrior.cs b/NPCs/LihzahrdWarrior.cs index 2e399f30..d534b105 100644 --- a/NPCs/LihzahrdWarrior.cs +++ b/NPCs/LihzahrdWarrior.cs @@ -1,7 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; + namespace Tremor.NPCs { @@ -34,16 +35,16 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(6) == 0) { @@ -58,7 +59,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/LWGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/LWGore2"), 1f); @@ -72,7 +73,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return Main.hardMode && (tile == 226) && NPC.downedMoonlord && y > Main.rockLayer ? 0.01f : 0f; } } diff --git a/NPCs/LittleMushroomBug.cs b/NPCs/LittleMushroomBug.cs index 4b653393..6d00a3b2 100644 --- a/NPCs/LittleMushroomBug.cs +++ b/NPCs/LittleMushroomBug.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -34,8 +34,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -44,18 +44,18 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 60; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 67, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 67, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 67, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 67, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } } else { for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 67, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 67, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } } } diff --git a/NPCs/Lizard.cs b/NPCs/Lizard.cs index 69d36026..f9f5bf81 100644 --- a/NPCs/Lizard.cs +++ b/NPCs/Lizard.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -31,8 +31,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/Luminion.cs b/NPCs/Luminion.cs index 445d7c7e..86cd4dfc 100644 --- a/NPCs/Luminion.cs +++ b/NPCs/Luminion.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -36,16 +36,16 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(4) == 0) { @@ -68,7 +68,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * hitDirection, -2.5f, 0, default(Color), 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/LuminionGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/LuminionGore2"), 1f); @@ -81,7 +81,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return Main.hardMode && NPC.downedMoonlord && !spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.01f : 0f; } } diff --git a/NPCs/MagiumFlyer.cs b/NPCs/MagiumFlyer.cs index 6b825774..4cca79b6 100644 --- a/NPCs/MagiumFlyer.cs +++ b/NPCs/MagiumFlyer.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -14,7 +14,7 @@ public override void SetStaticDefaults() Main.npcFrameCount[npc.type] = 4; } - const int SpeedMulti = 3; // ⥫ ᪮ + const int SpeedMulti = 3; // �����⥫� ᪮��� public override void SetDefaults() { @@ -38,8 +38,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -48,18 +48,18 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 60; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } } else { for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 59, (float)hitDirection, -2f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, (float)hitDirection, -2f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, hitDirection, -2f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, hitDirection, -2f, 0, default(Color), 0.7f); } } } diff --git a/NPCs/MagiumKeeper.cs b/NPCs/MagiumKeeper.cs index 94888ac8..a87ebf71 100644 --- a/NPCs/MagiumKeeper.cs +++ b/NPCs/MagiumKeeper.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -34,8 +34,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void AI() @@ -43,7 +43,7 @@ public override void AI() if (npc.ai[3] < 0f) { npc.knockBackResist = 0f; - npc.defense = (int)((double)npc.defDefense * 1.1); + npc.defense = (int)(npc.defDefense * 1.1); npc.noGravity = true; npc.noTileCollide = true; if (npc.velocity.X < 0f) @@ -58,7 +58,7 @@ public override void AI() if (Main.netMode != 1) { npc.localAI[3] += 1f; - if (npc.localAI[3] > (float)Main.rand.Next(20, 180)) + if (npc.localAI[3] > Main.rand.Next(20, 180)) { npc.localAI[3] = 0f; Vector2 value3 = npc.position; @@ -130,7 +130,7 @@ public override void AI() } if (npc.ai[2] == 0f) { - npc.ai[2] = (float)npc.direction; + npc.ai[2] = npc.direction; } npc.velocity.Y = npc.velocity.Y * 0.9f; npc.velocity.X = npc.velocity.X + npc.ai[2] * 0.3f; @@ -147,9 +147,7 @@ public override void AI() { npc.ai[3] = -4f; npc.ai[2] = 0f; - return; } - return; } else { @@ -162,7 +160,7 @@ public override void AI() npc.velocity *= 0.9f; } int num50 = (int)npc.position.X / 16; - int num51 = (int)(npc.position.Y + (float)npc.height + 12f) / 16; + int num51 = (int)(npc.position.Y + npc.height + 12f) / 16; bool flag4 = false; for (int num52 = num50 - 1; num52 <= num50 + 1; num52++) { @@ -170,7 +168,7 @@ public override void AI() { Main.tile[num50, num51] = new Tile(); } - if (Main.tile[num52, num51].active() && Main.tileSolid[(int)Main.tile[num52, num51].type]) + if (Main.tile[num52, num51].active() && Main.tileSolid[Main.tile[num52, num51].type]) { flag4 = true; } @@ -209,12 +207,12 @@ public override void AI() for (int num53 = 0; num53 < 2; num53++) { Vector2 vector11 = center3; - Vector2 value5 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value5 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value5.Normalize(); - value5 *= (float)Main.rand.Next(0, 100) * 0.1f; + value5 *= Main.rand.Next(0, 100) * 0.1f; vector11 += value5; value5.Normalize(); - value5 *= (float)Main.rand.Next(50, 90) * 0.1f; + value5 *= Main.rand.Next(50, 90) * 0.1f; int num54 = Dust.NewDust(vector11, 1, 1, 59, 0f, 0f, 0, default(Color), 3f); Main.dust[num54].velocity = -value5 * 0.3f; Main.dust[num54].alpha = 100; @@ -271,8 +269,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { @@ -291,21 +289,21 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MagiumGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MagiumGore2"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MagiumGore2"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MagiumGore3"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MagiumGore3"), 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); } } @@ -313,7 +311,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && y > Main.rockLayer ? 0.0003f : 0f; } } diff --git a/NPCs/MagiumSword.cs b/NPCs/MagiumSword.cs index 4b6a835d..13d07e2f 100644 --- a/NPCs/MagiumSword.cs +++ b/NPCs/MagiumSword.cs @@ -1,9 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { @@ -45,8 +44,8 @@ public override void AI() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -55,7 +54,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } } } diff --git a/NPCs/MagmaLeechHead.cs b/NPCs/MagmaLeechHead.cs index 0a3ab73a..3f4a3cd6 100644 --- a/NPCs/MagmaLeechHead.cs +++ b/NPCs/MagmaLeechHead.cs @@ -15,7 +15,7 @@ public override void SetStaticDefaults() DisplayName.SetDefault("Magma Leech"); } - bool TailSpawned = false; + bool TailSpawned; public static int ShootRate = 20; const int ShootDamage = 58; @@ -87,9 +87,9 @@ public override void AI() lol = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.width / 2), mod.NPCType("MagmaLeechTail"), npc.whoAmI); } Main.npc[lol].realLife = npc.whoAmI; - Main.npc[lol].ai[2] = (float)npc.whoAmI; - Main.npc[lol].ai[1] = (float)Previous; - Main.npc[Previous].ai[0] = (float)lol; + Main.npc[lol].ai[2] = npc.whoAmI; + Main.npc[lol].ai[1] = Previous; + Main.npc[Previous].ai[0] = lol; //NetMessage.SendData(23, -1, -1, "", lol, 0f, 0f, 0f, 0); Previous = lol; } diff --git a/NPCs/Magus.cs b/NPCs/Magus.cs index a87a914e..a5f0af6c 100644 --- a/NPCs/Magus.cs +++ b/NPCs/Magus.cs @@ -1,7 +1,7 @@ -using Terraria.ID; using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -32,13 +32,13 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } int timer = 0; int TimeToAnimation = 50; - int Frame = 0; + int Frame; public override void AI() { if ((int)(Main.time % 180) == 0) @@ -69,7 +69,7 @@ public void Teleport() { for (int Num = 0; Num < 10; Num++) { - int dust = Dust.NewDust(new Vector2((float)npc.position.X, (float)npc.position.Y), npc.width, npc.height, 68, npc.velocity.X + Main.rand.Next(-10, 10), npc.velocity.Y + Main.rand.Next(-10, 10), 5, npc.color, 2.6f); + int dust = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 68, npc.velocity.X + Main.rand.Next(-10, 10), npc.velocity.Y + Main.rand.Next(-10, 10), 5, npc.color, 2.6f); Main.dust[dust].noGravity = true; } npc.position.X = (Main.player[npc.target].position.X - 500) + Main.rand.Next(1000); @@ -92,14 +92,14 @@ public void DoAI() public override void NPCLoot() { - if (Main.invasionType == Terraria.ID.InvasionID.GoblinArmy) + if (Main.invasionType == InvasionID.GoblinArmy) { Main.invasionProgress++; } if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(50) == 0) @@ -113,7 +113,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (NPC.AnyNPCs(26) || NPC.AnyNPCs(27) || NPC.AnyNPCs(28) || NPC.AnyNPCs(29)) && Main.hardMode && y < Main.worldSurface ? 0.08f : 0f; } } diff --git a/NPCs/MechanicalFirefly.cs b/NPCs/MechanicalFirefly.cs index 56df2dfa..3e5f14b6 100644 --- a/NPCs/MechanicalFirefly.cs +++ b/NPCs/MechanicalFirefly.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -36,8 +36,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -46,7 +46,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, 61, 1f); Gore.NewGore(npc.position, npc.velocity, 61, 1f); @@ -60,7 +60,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && Main.bloodMoon && y < Main.worldSurface ? 0.007f : 0f; } } diff --git a/NPCs/MeteoriteGolem.cs b/NPCs/MeteoriteGolem.cs index aedc7b0e..83f3a6d2 100644 --- a/NPCs/MeteoriteGolem.cs +++ b/NPCs/MeteoriteGolem.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -39,16 +39,16 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { @@ -65,9 +65,9 @@ public override void HitEffect(int hitDirection, double damage) { if (npc.life <= 0) { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MGGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MGGore3"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MGGore3"), 1f); @@ -75,8 +75,8 @@ public override void HitEffect(int hitDirection, double damage) Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MGGore2"), 1f); for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.6f); } } } @@ -85,7 +85,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneMeteor ? 0.005f : 0f; } } diff --git a/NPCs/MightyNimbus.cs b/NPCs/MightyNimbus.cs index c326a7d0..db2c7549 100644 --- a/NPCs/MightyNimbus.cs +++ b/NPCs/MightyNimbus.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -40,18 +40,18 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) { if (npc.life <= 0) { - Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); Gore.NewGore(npc.position, npc.velocity, 99, 1f); Gore.NewGore(npc.position, npc.velocity, 99, 2f); Gore.NewGore(npc.position, npc.velocity, 99, 1f); @@ -75,7 +75,6 @@ public override void AI() if (Main.rand.Next(700) == 0) { Main.PlaySound(29, (int)npc.position.X, (int)npc.position.Y, Main.rand.Next(41, 44)); - return; } } @@ -83,7 +82,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && NPC.downedMoonlord && Tremor.NoZoneAllowWater(spawnInfo)) && Main.raining && y < Main.worldSurface ? 0.01f : 0f; } } diff --git a/NPCs/Minotaur.cs b/NPCs/Minotaur.cs index de4b7508..e236a7f4 100644 --- a/NPCs/Minotaur.cs +++ b/NPCs/Minotaur.cs @@ -1,7 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; + namespace Tremor.NPCs { public class Minotaur : ModNPC @@ -34,8 +35,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { @@ -54,7 +55,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MinotaurGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MinotaurGore2"), 1f); @@ -68,7 +69,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.005f : 0f; } } diff --git a/NPCs/Motherboard.cs b/NPCs/Motherboard.cs index 3565c8ba..0127df3e 100644 --- a/NPCs/Motherboard.cs +++ b/NPCs/Motherboard.cs @@ -1,9 +1,9 @@ -using Terraria.ID; -using Terraria; -using Terraria.ModLoader; -using System; +using System; using System.Collections.Generic; using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; namespace Tremor.NPCs { @@ -43,24 +43,26 @@ public class Motherboard : ModNPC List SignalDrones = new List(); // ID сигнальных дронов int LastSignalDron = -1; // Последний дрон принимающий лазер int stateTime = stateOne_AppearingTime + stateOne_DisappearingTime + stateOne_FollowPlayerTime; // Время стадии - bool ShootNow = false; // Происходит ли сейчас стрелба + bool ShootNow; // Происходит ли сейчас стрелба int TimeToNextDrone = 1; // Время до спавна следующего дрона int TimeToShoot = 60; // Время до следующего выстрела int TimeToLaser = 3; // Время до выстрела лазера от дрона до дрона - int CurrentFrame = 0; // Содержит текущий кадр анимации + int CurrentFrame; // Содержит текущий кадр анимации int TimeToAnimation = 6; // Время до смены кадра List Clampers = new List(); // Список кламперов int SecondShootTime = 60; int ai = 0; - int getStateTime { get { return getAppearingTimeNow + getDisappearingTimeNow + getFollowPlayerTimeNow; } } //----- + int getStateTime => getAppearingTimeNow + getDisappearingTimeNow + getFollowPlayerTimeNow; +//----- // Получить время требуемое на полный цикл смены состояний - int getTimeToNextDrone { get { return (Main.rand.Next(3, 6) * 60); } } // Получить время до следующего дрона + int getTimeToNextDrone => (Main.rand.Next(3, 6) * 60); +// Получить время до следующего дрона //----- Методы получения времени на состояния в данный момент - int getFollowPlayerTimeNow { get { return (FirstState) ? stateOne_FollowPlayerTime : stateSecond_FollowPlayerTime; } } - int getDisappearingTimeNow { get { return (FirstState) ? stateOne_DisappearingTime : stateSecond_DisappearingTime; } } - int getAppearingTimeNow { get { return (FirstState) ? stateOne_AppearingTime : stateSecond_AppearingTime; } } + int getFollowPlayerTimeNow => (FirstState) ? stateOne_FollowPlayerTime : stateSecond_FollowPlayerTime; + int getDisappearingTimeNow => (FirstState) ? stateOne_DisappearingTime : stateSecond_DisappearingTime; + int getAppearingTimeNow => (FirstState) ? stateOne_AppearingTime : stateSecond_AppearingTime; //----- #endregion @@ -141,13 +143,13 @@ public override void AI() Vector2 vector142 = new Vector2(npc.Center.X, npc.Center.Y); float num1243 = Main.player[npc.target].Center.X - vector142.X; float num1244 = Main.player[npc.target].Center.Y - vector142.Y; - float num1245 = (float)Math.Sqrt((double)(num1243 * num1243 + num1244 * num1244)); + float num1245 = (float)Math.Sqrt(num1243 * num1243 + num1244 * num1244); if (npc.ai[1] == 0f) { if (Main.netMode != 1) { npc.localAI[1] += 1f; - if (npc.localAI[1] >= (float)(120 + Main.rand.Next(200))) + if (npc.localAI[1] >= 120 + Main.rand.Next(200)) { npc.localAI[1] = 0f; npc.TargetClosest(true); @@ -161,7 +163,7 @@ public override void AI() num1251 = (int)Main.player[npc.target].Center.Y / 16; num1250 += Main.rand.Next(-50, 51); num1251 += Main.rand.Next(-50, 51); - if (!WorldGen.SolidTile(num1250, num1251) && Collision.CanHit(new Vector2((float)(num1250 * 16), (float)(num1251 * 16)), 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + if (!WorldGen.SolidTile(num1250, num1251) && Collision.CanHit(new Vector2(num1250 * 16, num1251 * 16), 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { break; } @@ -171,8 +173,8 @@ public override void AI() } } npc.ai[1] = 1f; - npc.ai[2] = (float)num1250; - npc.ai[3] = (float)num1251; + npc.ai[2] = num1250; + npc.ai[3] = num1251; npc.netUpdate = true; return; } @@ -184,8 +186,8 @@ public override void AI() if (npc.alpha >= 255) { npc.alpha = 255; - npc.position.X = npc.ai[2] * 16f - (float)(npc.width / 2); - npc.position.Y = npc.ai[3] * 16f - (float)(npc.height / 2); + npc.position.X = npc.ai[2] * 16f - npc.width / 2; + npc.position.Y = npc.ai[3] * 16f - npc.height / 2; npc.ai[1] = 2f; return; } @@ -232,7 +234,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MotherboardGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MotherboardGore2"), 1f); @@ -241,6 +243,7 @@ public override void HitEffect(int hitDirection, double damage) Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MotherboardGore4"), 1f); } } + void SecondShoot() { for (int i = (int)npc.position.X - 8; i < (npc.position.X + 8 + npc.width); i += 8) @@ -261,11 +264,13 @@ void ChangeStady() // Попытка смены стадии if (SignalDrones.Count <= 0) // Если живих дронов нет { FirstState = false; // Выключаем первую стадию - Clampers = new List { - NPC.NewNPC((int)npc.Center.X - 15, (int)npc.Center.Y + 25, mod.NPCType("Clamper"), 0, 0, 0, 0, npc.whoAmI), - NPC.NewNPC((int)npc.Center.X - 10, (int)npc.Center.Y + 25, mod.NPCType("Clamper"), 0, 0, 0, 0, npc.whoAmI), - NPC.NewNPC((int)npc.Center.X + 10, (int)npc.Center.Y + 25, mod.NPCType("Clamper"), 0, 0, 0, 0, npc.whoAmI), - NPC.NewNPC((int)npc.Center.X + 15, (int)npc.Center.Y + 25, mod.NPCType("Clamper"), 0, 0, 0, 0, npc.whoAmI)}; + Clampers = new List + { + NPC.NewNPC((int) npc.Center.X - 15, (int) npc.Center.Y + 25, mod.NPCType("Clamper"), 0, 0, 0, 0, npc.whoAmI), + NPC.NewNPC((int) npc.Center.X - 10, (int) npc.Center.Y + 25, mod.NPCType("Clamper"), 0, 0, 0, 0, npc.whoAmI), + NPC.NewNPC((int) npc.Center.X + 10, (int) npc.Center.Y + 25, mod.NPCType("Clamper"), 0, 0, 0, 0, npc.whoAmI), + NPC.NewNPC((int) npc.Center.X + 15, (int) npc.Center.Y + 25, mod.NPCType("Clamper"), 0, 0, 0, 0, npc.whoAmI) + }; Main.npc[Clampers[0]].localAI[1] = 1; Main.npc[Clampers[1]].localAI[1] = 2; Main.npc[Clampers[2]].localAI[1] = 3; @@ -273,7 +278,7 @@ void ChangeStady() // Попытка смены стадии } } - int AppearTime = 0; + int AppearTime; void ChangeAI() // Сменяет состояние (преследование/исчезновение/появление) { if (FirstState) @@ -383,8 +388,8 @@ void ShootDrones() // Если пришло время, начинает стр for (int i = 0; i < SecondShootCount; i++) { Vector2 velocity = Helper.VelocityToPoint(Main.npc[SignalDrones[SignalDrones.Count - 1]].Center, Main.player[npc.target].Center, SecondShootSpeed); - velocity.X = velocity.X + (float)Main.rand.Next(-SecondShootSpread, SecondShootSpread + 1) * SecondShootSpreadMult; - velocity.Y = velocity.Y + (float)Main.rand.Next(-SecondShootSpread, SecondShootSpread + 1) * SecondShootSpreadMult; + velocity.X = velocity.X + Main.rand.Next(-SecondShootSpread, SecondShootSpread + 1) * SecondShootSpreadMult; + velocity.Y = velocity.Y + Main.rand.Next(-SecondShootSpread, SecondShootSpread + 1) * SecondShootSpreadMult; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, velocity.X, velocity.Y, LaserType, SecondShootDamage, SecondShootKN); } LastSignalDron = -1; @@ -402,8 +407,8 @@ public override void NPCLoot() TremorWorld.downedMotherboard = true; if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.expertMode) diff --git a/NPCs/Mothership.cs b/NPCs/Mothership.cs index 011773cd..131a4ab8 100644 --- a/NPCs/Mothership.cs +++ b/NPCs/Mothership.cs @@ -1,7 +1,7 @@ -using Terraria.ID; using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -16,8 +16,8 @@ public override void SetStaticDefaults() } - private float timeToNextFrame = 0; - public int frame = 0; + private float timeToNextFrame; + public int frame; public override void SetDefaults() { @@ -41,8 +41,8 @@ public override void SetDefaults() public float timeToShoot = 2; private float vel = 2.5f; - private float lifeTime = 0; - private bool Rage = false; + private float lifeTime; + private bool Rage; @@ -167,14 +167,11 @@ private float clamp(float value, float min, float max) { return min; } - else if (value > max) + if (value > max) { return max; } - else - { - return value; - } + return value; } public override void FindFrame(int frameHeight) diff --git a/NPCs/MushroomCreature.cs b/NPCs/MushroomCreature.cs index f1cf2603..db778439 100644 --- a/NPCs/MushroomCreature.cs +++ b/NPCs/MushroomCreature.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -35,8 +35,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void AI() @@ -54,7 +54,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } //Gore.NewGore(npc.position, npc.velocity, mod.GoreType("Orc1Gore1"), 1f); } @@ -63,7 +63,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && (tile == 70)) && y < Main.rockLayer ? 0.03f : 0f; } } diff --git a/NPCs/Naga.cs b/NPCs/Naga.cs index af10b0e4..31f3ea25 100644 --- a/NPCs/Naga.cs +++ b/NPCs/Naga.cs @@ -35,7 +35,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/NagaGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/NagaGore2"), 1f); @@ -46,7 +46,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 59, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, hitDirection, -1f, 0, default(Color), 0.7f); } } } @@ -58,8 +58,8 @@ public override void OnHitPlayer(Player player, int damage, bool crit) public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } } } \ No newline at end of file diff --git a/NPCs/NightTerror.cs b/NPCs/NightTerror.cs index f642b5a3..dbcd0d4c 100644 --- a/NPCs/NightTerror.cs +++ b/NPCs/NightTerror.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -37,15 +37,15 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && Main.bloodMoon && y < Main.worldSurface ? 0.004f : 0f; } @@ -53,8 +53,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(40) == 0) { @@ -69,13 +69,13 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 60; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, 99, 1f); Gore.NewGore(npc.position, npc.velocity, 99, 1f); diff --git a/NPCs/NightWalker.cs b/NPCs/NightWalker.cs index a976590d..cd452cee 100644 --- a/NPCs/NightWalker.cs +++ b/NPCs/NightWalker.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -36,8 +36,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(23) == 0) { @@ -48,8 +48,8 @@ public override void NPCLoot() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override float SpawnChance(NPCSpawnInfo spawnInfo) @@ -63,7 +63,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 60; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/NWGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/NWGore2"), 1f); @@ -75,9 +75,9 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 0.7f); } } } diff --git a/NPCs/NorthWind.cs b/NPCs/NorthWind.cs index 4f7505ee..f40b4c97 100644 --- a/NPCs/NorthWind.cs +++ b/NPCs/NorthWind.cs @@ -1,9 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { @@ -38,16 +37,16 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(2) == 0) { @@ -66,15 +65,15 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); } - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); } } @@ -83,7 +82,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && Main.cloudAlpha > 0f && y < Main.worldSurface && spawnInfo.player.ZoneSnow ? 0.06f : 0f; } } diff --git a/NPCs/Observer.cs b/NPCs/Observer.cs index 4737c4ae..0330bb95 100644 --- a/NPCs/Observer.cs +++ b/NPCs/Observer.cs @@ -1,6 +1,7 @@ -using Terraria.ID; +using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -44,8 +45,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void AI() @@ -59,7 +60,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && Main.bloodMoon && y < Main.worldSurface ? 0.006f : 0f; } public override void HitEffect(int hitDirection, double damage) @@ -68,13 +69,13 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ObserverGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ObserverGore2"), 1f); @@ -85,9 +86,9 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 0.7f); } } } @@ -96,8 +97,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(15) == 0) { @@ -123,7 +124,7 @@ void Shoot() Vector2 VelocityFPTP(Vector2 pos1, Vector2 pos2, float speed) { Vector2 move = pos2 - pos1; - return move * (speed / (float)System.Math.Sqrt(move.X * move.X + move.Y * move.Y)); + return move * (speed / (float)Math.Sqrt(move.X * move.X + move.Y * move.Y)); } } } \ No newline at end of file diff --git a/NPCs/OceanMimic.cs b/NPCs/OceanMimic.cs index 986282c0..60667c00 100644 --- a/NPCs/OceanMimic.cs +++ b/NPCs/OceanMimic.cs @@ -1,6 +1,6 @@ -using Terraria.ID; -using Terraria; using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -33,8 +33,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; Helper.DropItem(new Rectangle((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height), new Drop(mod.ItemType("TheTide"), 1, 1), new Drop(mod.ItemType("TrueTrident"), 1, 1), new Drop(mod.ItemType("SharkRage"), 1, 1), new Drop(mod.ItemType("OceanAmulet"), 1, 1), new Drop(mod.ItemType("SquidTentacle"), 1, 1)); Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 500, Main.rand.Next(10)); @@ -46,7 +46,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && (tile == 53 || tile == 112 || tile == 116 || tile == 234) && Tremor.NoZoneAllowWater(spawnInfo) && spawnInfo.water) && Main.hardMode && y < Main.rockLayer && (x < 250 || x > Main.maxTilesX - 250) && !spawnInfo.playerSafe ? 0.01f : 0f; } } diff --git a/NPCs/OceanMimicSummon.cs b/NPCs/OceanMimicSummon.cs index aa71d34d..35b6ccd0 100644 --- a/NPCs/OceanMimicSummon.cs +++ b/NPCs/OceanMimicSummon.cs @@ -1,13 +1,13 @@ +using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria; namespace Tremor.NPCs { // Example Soul of Light/Soul of Night style NPC summon public class OceanMimicSummon : ModPlayer { - public int LastChest = 0; + public int LastChest; // This doesn't make sense, but this is around where this check happens in Vanilla Terraria. public override void PreUpdateBuffs() @@ -38,7 +38,7 @@ public static bool ChestItemSummonCheck(int x, int y, Mod mod) int numberOceanKey = 0; int numberOtherItems = 0; ushort tileType = Main.tile[Main.chest[num].x, Main.chest[num].y].type; - int tileStyle = (int)(Main.tile[Main.chest[num].x, Main.chest[num].y].frameX / 36); + int tileStyle = Main.tile[Main.chest[num].x, Main.chest[num].y].frameX / 36; if (TileID.Sets.BasicChest[tileType] && (tileStyle < 5 || tileStyle > 6)) { for (int i = 0; i < 40; i++) @@ -84,7 +84,7 @@ public static bool ChestItemSummonCheck(int x, int y, Mod mod) Main.chest[num].item[l] = new Item(); } Chest.DestroyChest(x, y); - NetMessage.SendData(34, -1, -1, null, 1, (float)x, (float)y, 0f, number, 0, 0); + NetMessage.SendData(34, -1, -1, null, 1, x, y, 0f, number, 0, 0); NetMessage.SendTileSquare(-1, x, y, 3); } int npcToSpawn = mod.NPCType("OceanMimic"); diff --git a/NPCs/OmegaWolf.cs b/NPCs/OmegaWolf.cs index 7bb1cda3..6362f9d1 100644 --- a/NPCs/OmegaWolf.cs +++ b/NPCs/OmegaWolf.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -34,8 +34,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(2) == 0) { @@ -54,7 +54,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OmegaWolfGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OmegaWolfGore2"), 1f); @@ -66,7 +66,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneSnow && y < Main.worldSurface ? 0.02f : 0f; } diff --git a/NPCs/Orc.cs b/NPCs/Orc.cs index 56123e5b..0d43c920 100644 --- a/NPCs/Orc.cs +++ b/NPCs/Orc.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -35,8 +35,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } @@ -46,7 +46,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Orc1Gore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Orc1Gore2"), 1f); @@ -59,8 +59,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(20) == 0) @@ -78,7 +78,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedBoss1 && y < Main.worldSurface ? 0.1f : 0f; } } diff --git a/NPCs/OrcChampion.cs b/NPCs/OrcChampion.cs index e6168363..3e81f849 100644 --- a/NPCs/OrcChampion.cs +++ b/NPCs/OrcChampion.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -39,17 +39,17 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) { if (npc.life <= 0) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OCGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OCGore2"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OCGore3"), 1f); @@ -58,8 +58,8 @@ public override void HitEffect(int hitDirection, double damage) Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OCGore4"), 1f); for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.6f); } } } @@ -68,7 +68,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.005f : 0f; } } diff --git a/NPCs/OrcSkeleton.cs b/NPCs/OrcSkeleton.cs index b9d986eb..8bd2dd58 100644 --- a/NPCs/OrcSkeleton.cs +++ b/NPCs/OrcSkeleton.cs @@ -1,9 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { @@ -36,8 +35,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -46,7 +45,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OrcSkeletonGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OrcSkeletonGore2"), 1f); @@ -60,7 +59,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedBoss1 && y > Main.rockLayer ? 0.01f : 0f; } diff --git a/NPCs/OrcWarrior.cs b/NPCs/OrcWarrior.cs index a37a11e4..370ea229 100644 --- a/NPCs/OrcWarrior.cs +++ b/NPCs/OrcWarrior.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -34,8 +34,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -44,7 +44,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OrcWarriorGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OrcWarriorGore2"), 1f); @@ -58,8 +58,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(30) == 0) @@ -85,7 +85,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedBoss1 && !Main.dayTime && y < Main.worldSurface ? 0.1f : 0f; } } diff --git a/NPCs/PGiantSlime.cs b/NPCs/PGiantSlime.cs index f935e380..0b2674cd 100644 --- a/NPCs/PGiantSlime.cs +++ b/NPCs/PGiantSlime.cs @@ -1,9 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { @@ -36,8 +35,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -46,13 +45,13 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Purple, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Purple, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Purple, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Purple, 0.7f); } - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Purple, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Purple, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Purple, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 1, 2.5f * (float)hitDirection, -2.5f, 0, Color.Purple, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Purple, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Purple, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Purple, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 1, 2.5f * hitDirection, -2.5f, 0, Color.Purple, 0.7f); } } @@ -65,8 +64,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { diff --git a/NPCs/Parasprite.cs b/NPCs/Parasprite.cs index 174a801a..59fa5139 100644 --- a/NPCs/Parasprite.cs +++ b/NPCs/Parasprite.cs @@ -1,9 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { @@ -39,7 +38,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ParaspriteGore"), 1f); } @@ -47,21 +46,21 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 59, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, hitDirection, -1f, 0, default(Color), 0.7f); } } } public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && y > Main.rockLayer ? 0.01f : 0f; } } diff --git a/NPCs/Peepers.cs b/NPCs/Peepers.cs index 72d18614..3bb4c81c 100644 --- a/NPCs/Peepers.cs +++ b/NPCs/Peepers.cs @@ -1,6 +1,7 @@ -using Terraria.ID; +using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -44,8 +45,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void AI() @@ -59,7 +60,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.01f : 0f; } public override void HitEffect(int hitDirection, double damage) @@ -68,13 +69,13 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PeepersGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PeepersGore2"), 1f); @@ -84,9 +85,9 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 0.7f); } } } @@ -104,15 +105,15 @@ void Shoot() Vector2 VelocityFPTP(Vector2 pos1, Vector2 pos2, float speed) { Vector2 move = pos2 - pos1; - return move * (speed / (float)System.Math.Sqrt(move.X * move.X + move.Y * move.Y)); + return move * (speed / (float)Math.Sqrt(move.X * move.X + move.Y * move.Y)); } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { diff --git a/NPCs/Phabor.cs b/NPCs/Phabor.cs index c5046046..4596fea8 100644 --- a/NPCs/Phabor.cs +++ b/NPCs/Phabor.cs @@ -1,6 +1,7 @@ -using Terraria.ID; +using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -44,8 +45,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void AI() @@ -59,8 +60,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { @@ -73,7 +74,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && Main.bloodMoon && y < Main.worldSurface ? 0.06f : 0f; } public override void HitEffect(int hitDirection, double damage) @@ -82,13 +83,13 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PhaborGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PhaborGore2"), 1f); @@ -101,9 +102,9 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 0.7f); } } } @@ -121,7 +122,7 @@ void Shoot() Vector2 VelocityFPTP(Vector2 pos1, Vector2 pos2, float speed) { Vector2 move = pos2 - pos1; - return move * (speed / (float)System.Math.Sqrt(move.X * move.X + move.Y * move.Y)); + return move * (speed / (float)Math.Sqrt(move.X * move.X + move.Y * move.Y)); } } } \ No newline at end of file diff --git a/NPCs/Phantom.cs b/NPCs/Phantom.cs index 101d6ad3..cbc0e2aa 100644 --- a/NPCs/Phantom.cs +++ b/NPCs/Phantom.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -14,7 +14,7 @@ public override void SetStaticDefaults() Main.npcFrameCount[npc.type] = 4; } - const int SpeedMulti = 3; // ⥫ ᪮ + const int SpeedMulti = 3; // �����⥫� ᪮��� public override void SetDefaults() { @@ -38,8 +38,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -48,16 +48,16 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 60; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } } else { for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 27, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, hitDirection, -1f, 0, default(Color), 0.7f); } } } @@ -66,8 +66,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { @@ -84,7 +84,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.bloodMoon && y < Main.worldSurface ? 0.03f : 0f; } } diff --git a/NPCs/PharaohCaster.cs b/NPCs/PharaohCaster.cs index 6b9fa26f..f0959bce 100644 --- a/NPCs/PharaohCaster.cs +++ b/NPCs/PharaohCaster.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -33,8 +33,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } @@ -42,7 +42,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && NPC.downedBoss1 && Main.dayTime && y < Main.worldSurface ? 0.01f : 0f; } @@ -52,7 +52,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PharaonGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PharaonGore2"), 1f); diff --git a/NPCs/Phobos.cs b/NPCs/Phobos.cs index ebe0d0b9..dedf02c4 100644 --- a/NPCs/Phobos.cs +++ b/NPCs/Phobos.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -46,15 +46,15 @@ public override void AI() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.05f : 0f; } @@ -62,8 +62,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { @@ -86,17 +86,17 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 60; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 70, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 70, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); } for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); } - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 70, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * hitDirection, -2.5f, 0, default(Color), 3.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 70, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * hitDirection, -2.5f, 0, default(Color), 3.7f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PhobosGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PhobosGore2"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PhobosGore2"), 1f); @@ -107,7 +107,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); } } } diff --git a/NPCs/PixieQueen.cs b/NPCs/PixieQueen.cs index 384b3cf6..91e43578 100644 --- a/NPCs/PixieQueen.cs +++ b/NPCs/PixieQueen.cs @@ -1,8 +1,8 @@ -using Terraria.ID; using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -47,13 +47,13 @@ public class PixieQueen : ModNPC bool runAway = false; #endregion - int timer = 0; - int timer2 = 0; - int timer3 = 0; - int timer4 = 0; + int timer; + int timer2; + int timer3; + int timer4; bool SpawnMinion = false; - public static bool phase2 = false; - public static bool phase3 = false; + public static bool phase2; + public static bool phase3; public override void SetStaticDefaults() @@ -131,8 +131,8 @@ public override void AI() if (timer >= 650 && timer <= 1000) { Shoot(); - int currentLifeP2 = (int)(npc.lifeMax * (2 / 3)); - int currentLifeP3 = (int)(npc.lifeMax * (1 / 3)); + int currentLifeP2 = npc.lifeMax * (2 / 3); + int currentLifeP3 = npc.lifeMax * (1 / 3); if (npc.life <= currentLifeP2) { phase2 = true; @@ -164,11 +164,11 @@ public override void AI() { npc.TargetClosest(false); npc.velocity.Y = npc.velocity.Y + 1f; - if ((double)npc.position.Y > Main.worldSurface * 16.0) + if (npc.position.Y > Main.worldSurface * 16.0) { npc.velocity.Y = npc.velocity.Y + 1f; } - if ((double)npc.position.Y > Main.rockLayer * 16.0) + if (npc.position.Y > Main.rockLayer * 16.0) { for (int num957 = 0; num957 < 200; num957++) { @@ -197,8 +197,8 @@ public override void AI() num1042 = 3; } } - while ((float)num1042 == num1041); - npc.ai[0] = (float)num1042; + while (num1042 == num1041); + npc.ai[0] = num1042; npc.ai[1] = 0f; npc.ai[2] = 0f; return; @@ -219,7 +219,7 @@ public override void AI() { num1043++; } - if (npc.ai[1] > (float)(2 * num1043) && npc.ai[1] % 2f == 0f) + if (npc.ai[1] > 2 * num1043 && npc.ai[1] % 2f == 0f) { npc.ai[0] = -1f; npc.ai[1] = 0f; @@ -230,32 +230,32 @@ public override void AI() if (npc.ai[1] % 2f == 0f) { npc.TargetClosest(true); - if (Math.Abs(npc.position.Y + (float)(npc.height / 2) - (Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2))) < 20f) + if (Math.Abs(npc.position.Y + npc.height / 2 - (Main.player[npc.target].position.Y + Main.player[npc.target].height / 2)) < 20f) { npc.localAI[0] = 1f; npc.ai[1] += 1f; npc.ai[2] = 0f; float num1044 = 16f; //16 - if ((double)npc.life < (double)npc.lifeMax * 0.75) + if (npc.life < npc.lifeMax * 0.75) { num1044 += 2f; //2 not a prob } - if ((double)npc.life < (double)npc.lifeMax * 0.5) + if (npc.life < npc.lifeMax * 0.5) { num1044 += 2f; //2 not a prob } - if ((double)npc.life < (double)npc.lifeMax * 0.25) + if (npc.life < npc.lifeMax * 0.25) { num1044 += 2f; //2 not a prob } - if ((double)npc.life < (double)npc.lifeMax * 0.1) + if (npc.life < npc.lifeMax * 0.1) { num1044 += 2f; //2 not a prob } - Vector2 vector117 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num1045 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector117.X; - float num1046 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector117.Y; - float num1047 = (float)Math.Sqrt((double)(num1045 * num1045 + num1046 * num1046)); + Vector2 vector117 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + float num1045 = Main.player[npc.target].position.X + Main.player[npc.target].width / 2 - vector117.X; + float num1046 = Main.player[npc.target].position.Y + Main.player[npc.target].height / 2 - vector117.Y; + float num1047 = (float)Math.Sqrt(num1045 * num1045 + num1046 * num1046); num1047 = num1044 / num1047; npc.velocity.X = num1045 * num1047; npc.velocity.Y = num1046 * num1047; @@ -266,27 +266,27 @@ public override void AI() npc.localAI[0] = 0f; float num1048 = 12f; //12 not a prob float num1049 = 0.15f; //0.15 not a prob - if ((double)npc.life < (double)npc.lifeMax * 0.75) + if (npc.life < npc.lifeMax * 0.75) { num1048 += 1f; //1 not a prob num1049 += 0.05f; //0.05 not a prob } - if ((double)npc.life < (double)npc.lifeMax * 0.5) + if (npc.life < npc.lifeMax * 0.5) { num1048 += 1f; //1 not a prob num1049 += 0.05f; //0.05 not a prob } - if ((double)npc.life < (double)npc.lifeMax * 0.25) + if (npc.life < npc.lifeMax * 0.25) { num1048 += 2f; //2 not a prob num1049 += 0.05f; //0.05 not a prob } - if ((double)npc.life < (double)npc.lifeMax * 0.1) + if (npc.life < npc.lifeMax * 0.1) { num1048 += 2f; //2 not a prob num1049 += 0.1f; //0.1 not a prob } - if (npc.position.Y + (float)(npc.height / 2) < Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2)) + if (npc.position.Y + npc.height / 2 < Main.player[npc.target].position.Y + Main.player[npc.target].height / 2) { npc.velocity.Y = npc.velocity.Y + num1049; } @@ -302,13 +302,13 @@ public override void AI() { npc.velocity.Y = num1048; } - if (Math.Abs(npc.position.X + (float)(npc.width / 2) - (Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2))) > 600f) + if (Math.Abs(npc.position.X + npc.width / 2 - (Main.player[npc.target].position.X + Main.player[npc.target].width / 2)) > 600f) { - npc.velocity.X = npc.velocity.X + 0.15f * (float)npc.direction; + npc.velocity.X = npc.velocity.X + 0.15f * npc.direction; } - else if (Math.Abs(npc.position.X + (float)(npc.width / 2) - (Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2))) < 300f) + else if (Math.Abs(npc.position.X + npc.width / 2 - (Main.player[npc.target].position.X + Main.player[npc.target].width / 2)) < 300f) { - npc.velocity.X = npc.velocity.X - 0.15f * (float)npc.direction; + npc.velocity.X = npc.velocity.X - 0.15f * npc.direction; } else { @@ -325,82 +325,79 @@ public override void AI() npc.spriteDirection = npc.direction; return; } + if (npc.velocity.X < 0f) + { + npc.direction = -1; + } else { - if (npc.velocity.X < 0f) - { - npc.direction = -1; - } - else - { - npc.direction = 1; - } - npc.spriteDirection = npc.direction; - int num1050 = 600; //600 not a prob - if (!playerWet) - { - num1050 = 350; - } - else + npc.direction = 1; + } + npc.spriteDirection = npc.direction; + int num1050 = 600; //600 not a prob + if (!playerWet) + { + num1050 = 350; + } + else + { + num1050 = 600; + if (npc.life < npc.lifeMax * 0.1) { - num1050 = 600; - if ((double)npc.life < (double)npc.lifeMax * 0.1) - { - num1050 = 800; //300 not a prob - } - else if ((double)npc.life < (double)npc.lifeMax * 0.25) - { - num1050 = 750; //450 not a prob - } - else if ((double)npc.life < (double)npc.lifeMax * 0.5) - { - num1050 = 700; //500 not a prob - } - else if ((double)npc.life < (double)npc.lifeMax * 0.75) - { - num1050 = 650; //550 not a prob - } + num1050 = 800; //300 not a prob } - int num1051 = 1; - if (npc.position.X + (float)(npc.width / 2) < Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2)) + else if (npc.life < npc.lifeMax * 0.25) { - num1051 = -1; + num1050 = 750; //450 not a prob } - if (npc.direction == num1051 && Math.Abs(npc.position.X + (float)(npc.width / 2) - (Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2))) > (float)num1050) + else if (npc.life < npc.lifeMax * 0.5) { - npc.ai[2] = 1f; + num1050 = 700; //500 not a prob } - if (npc.ai[2] != 1f) + else if (npc.life < npc.lifeMax * 0.75) { - npc.localAI[0] = 1f; - return; + num1050 = 650; //550 not a prob } - npc.TargetClosest(true); - npc.spriteDirection = npc.direction; - npc.localAI[0] = 0f; + } + int num1051 = 1; + if (npc.position.X + npc.width / 2 < Main.player[npc.target].position.X + Main.player[npc.target].width / 2) + { + num1051 = -1; + } + if (npc.direction == num1051 && Math.Abs(npc.position.X + npc.width / 2 - (Main.player[npc.target].position.X + Main.player[npc.target].width / 2)) > num1050) + { + npc.ai[2] = 1f; + } + if (npc.ai[2] != 1f) + { + npc.localAI[0] = 1f; + return; + } + npc.TargetClosest(true); + npc.spriteDirection = npc.direction; + npc.localAI[0] = 0f; + npc.velocity *= 0.9f; + float num1052 = 0.1f; //0.1 + if (npc.life < npc.lifeMax / 2) + { npc.velocity *= 0.9f; - float num1052 = 0.1f; //0.1 - if (npc.life < npc.lifeMax / 2) - { - npc.velocity *= 0.9f; - num1052 += 0.05f; //0.05 - } - if (npc.life < npc.lifeMax / 3) - { - npc.velocity *= 0.9f; - num1052 += 0.05f; //0.05 - } - if (npc.life < npc.lifeMax / 5) - { - npc.velocity *= 0.9f; - num1052 += 0.05f; //0.05 - } - if (Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y) < num1052) - { - npc.ai[2] = 0f; - npc.ai[1] += 1f; - return; - } + num1052 += 0.05f; //0.05 + } + if (npc.life < npc.lifeMax / 3) + { + npc.velocity *= 0.9f; + num1052 += 0.05f; //0.05 + } + if (npc.life < npc.lifeMax / 5) + { + npc.velocity *= 0.9f; + num1052 += 0.05f; //0.05 + } + if (Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y) < num1052) + { + npc.ai[2] = 0f; + npc.ai[1] += 1f; + return; } } else if (npc.ai[0] == 2f) @@ -409,10 +406,10 @@ public override void AI() npc.spriteDirection = npc.direction; float num1053 = 12f; //12 found one! dictates speed during bee spawn float num1054 = 0.1f; //0.1 found one! dictates speed during bee spawn - Vector2 vector118 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num1055 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector118.X; - float num1056 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - 200f - vector118.Y; - float num1057 = (float)Math.Sqrt((double)(num1055 * num1055 + num1056 * num1056)); + Vector2 vector118 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + float num1055 = Main.player[npc.target].position.X + Main.player[npc.target].width / 2 - vector118.X; + float num1056 = Main.player[npc.target].position.Y + Main.player[npc.target].height / 2 - 200f - vector118.Y; + float num1057 = (float)Math.Sqrt(num1055 * num1055 + num1056 * num1056); if (num1057 < 800f) { npc.ai[0] = 1f; @@ -460,26 +457,26 @@ public override void AI() { npc.localAI[0] = 0f; npc.TargetClosest(true); - Vector2 vector119 = new Vector2(npc.position.X + (float)(npc.width / 2) + (float)(Main.rand.Next(20) * npc.direction), npc.position.Y + (float)npc.height * 0.8f); - Vector2 vector120 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num1058 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector120.X; - float num1059 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector120.Y; - float num1060 = (float)Math.Sqrt((double)(num1058 * num1058 + num1059 * num1059)); + Vector2 vector119 = new Vector2(npc.position.X + npc.width / 2 + Main.rand.Next(20) * npc.direction, npc.position.Y + npc.height * 0.8f); + Vector2 vector120 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + float num1058 = Main.player[npc.target].position.X + Main.player[npc.target].width / 2 - vector120.X; + float num1059 = Main.player[npc.target].position.Y + Main.player[npc.target].height / 2 - vector120.Y; + float num1060 = (float)Math.Sqrt(num1058 * num1058 + num1059 * num1059); npc.ai[1] += 1f; - npc.ai[1] += (float)(num1038 / 2); - if ((double)npc.life < (double)npc.lifeMax * 0.75) + npc.ai[1] += num1038 / 2; + if (npc.life < npc.lifeMax * 0.75) { npc.ai[1] += 0.25f; //0.25 not a prob } - if ((double)npc.life < (double)npc.lifeMax * 0.5) + if (npc.life < npc.lifeMax * 0.5) { npc.ai[1] += 0.25f; //0.25 not a prob } - if ((double)npc.life < (double)npc.lifeMax * 0.25) + if (npc.life < npc.lifeMax * 0.25) { npc.ai[1] += 0.25f; //0.25 not a prob } - if ((double)npc.life < (double)npc.lifeMax * 0.1) + if (npc.life < npc.lifeMax * 0.1) { npc.ai[1] += 0.25f; //0.25 not a prob } @@ -505,8 +502,8 @@ public override void AI() num1061 = mod.NPCType("Parasea"); } int num1062 = NPC.NewNPC((int)vector119.X, (int)vector119.Y, num1061, 0, 0f, 0f, 0f, 0f, 255); - Main.npc[num1062].velocity.X = (float)Main.rand.Next(-200, 201) * 0.01f; - Main.npc[num1062].velocity.Y = (float)Main.rand.Next(-200, 201) * 0.01f; + Main.npc[num1062].velocity.X = Main.rand.Next(-200, 201) * 0.01f; + Main.npc[num1062].velocity.Y = Main.rand.Next(-200, 201) * 0.01f; Main.npc[num1062].localAI[0] = 60f; Main.npc[num1062].netUpdate = true; } @@ -516,9 +513,9 @@ public override void AI() float num1063 = 14f; //changed from 14 not a prob float num1064 = 0.1f; //changed from 0.1 not a prob vector120 = vector119; - num1058 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector120.X; - num1059 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector120.Y; - num1060 = (float)Math.Sqrt((double)(num1058 * num1058 + num1059 * num1059)); + num1058 = Main.player[npc.target].position.X + Main.player[npc.target].width / 2 - vector120.X; + num1059 = Main.player[npc.target].position.Y + Main.player[npc.target].height / 2 - vector120.Y; + num1060 = (float)Math.Sqrt(num1058 * num1058 + num1059 * num1059); num1060 = num1063 / num1060; if (npc.velocity.X < num1058) { @@ -648,20 +645,20 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("NPCs/PixieQueenGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("NPCs/PixieQueenGore2"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("NPCs/PixieQueenGore3"), 1f); @@ -761,8 +758,8 @@ public override void NPCLoot() } if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (!Main.expertMode && Main.rand.Next(7) == 0) diff --git a/NPCs/PixieQueenGuardian.cs b/NPCs/PixieQueenGuardian.cs index 49f121bc..93583028 100644 --- a/NPCs/PixieQueenGuardian.cs +++ b/NPCs/PixieQueenGuardian.cs @@ -38,13 +38,13 @@ public override void HitEffect(int hitDirection, double damage) { if (npc.life <= 0) { - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } } } @@ -64,8 +64,8 @@ public override void OnHitPlayer(Player player, int damage, bool crit) public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } diff --git a/NPCs/PlagueSoul.cs b/NPCs/PlagueSoul.cs index 690daa83..b97cbf15 100644 --- a/NPCs/PlagueSoul.cs +++ b/NPCs/PlagueSoul.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -36,9 +36,9 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 60; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } } else @@ -46,16 +46,16 @@ public override void HitEffect(int hitDirection, double damage) for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 27, (float)hitDirection, -2f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, hitDirection, -2f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, hitDirection, -1f, 0, default(Color), 0.7f); } } } public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } } diff --git a/NPCs/Polaris.cs b/NPCs/Polaris.cs index 58c121ad..b5384691 100644 --- a/NPCs/Polaris.cs +++ b/NPCs/Polaris.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -35,16 +35,16 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(20) == 0) { @@ -67,17 +67,17 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.8f); + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * hitDirection, -2.5f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.8f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PolarisGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PolarisGore2"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PolarisGore2"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PolarisGore3"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PolarisGore3"), 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2f); - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * hitDirection, -2.5f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * hitDirection, -2.5f, 0, default(Color), 2f); + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * hitDirection, -2.5f, 0, default(Color), 1f); } } @@ -86,7 +86,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && Main.cloudAlpha > 0f && y < Main.worldSurface && spawnInfo.player.ZoneSnow ? 0.03f : 0f; } } diff --git a/NPCs/PossessedHornet1.cs b/NPCs/PossessedHornet1.cs index 3fabff04..cce2f46e 100644 --- a/NPCs/PossessedHornet1.cs +++ b/NPCs/PossessedHornet1.cs @@ -1,7 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; + namespace Tremor.NPCs { @@ -35,16 +36,16 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { @@ -59,7 +60,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("NightmareFlame"), 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("NightmareFlame"), 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PHGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PHGore2"), 1f); @@ -71,7 +72,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneJungle && NPC.downedMoonlord && Main.hardMode && y > Main.rockLayer ? 0.01f : 0f; } } diff --git a/NPCs/PossessedHornet2.cs b/NPCs/PossessedHornet2.cs index c11ce0cf..85179d73 100644 --- a/NPCs/PossessedHornet2.cs +++ b/NPCs/PossessedHornet2.cs @@ -1,7 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; + namespace Tremor.NPCs { @@ -35,16 +36,16 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { @@ -59,7 +60,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("NightmareFlame"), 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("NightmareFlame"), 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PHGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PHGore2"), 1f); @@ -71,7 +72,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneJungle && NPC.downedMoonlord && Main.hardMode && y > Main.rockLayer ? 0.01f : 0f; } } diff --git a/NPCs/PossessedHound.cs b/NPCs/PossessedHound.cs index 9680c204..8b118c47 100644 --- a/NPCs/PossessedHound.cs +++ b/NPCs/PossessedHound.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -32,8 +32,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void AI() @@ -49,8 +49,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(2) == 0) { @@ -65,7 +65,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HoundGore3"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HoundGore1"), 1f); @@ -77,7 +77,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && Main.bloodMoon && y < Main.worldSurface ? 0.007f : 0f; } diff --git a/NPCs/Professor.cs b/NPCs/Professor.cs index 77a56692..be358413 100644 --- a/NPCs/Professor.cs +++ b/NPCs/Professor.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -8,21 +8,9 @@ namespace Tremor.NPCs [AutoloadHead] public class Professor : ModNPC { - public override string Texture - { - get - { - return "Tremor/NPCs/Professor"; - } - } + public override string Texture => "Tremor/NPCs/Professor"; - public override string[] AltTextures - { - get - { - return new string[] { "Tremor/NPCs/Professor" }; - } - } + public override string[] AltTextures => new[] { "Tremor/NPCs/Professor" }; public override bool Autoload(ref string name) { @@ -185,7 +173,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfessorGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfessorGore2"), 1f); diff --git a/NPCs/PyramidHead.cs b/NPCs/PyramidHead.cs index a956e561..bfe42271 100644 --- a/NPCs/PyramidHead.cs +++ b/NPCs/PyramidHead.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -35,8 +35,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -45,7 +45,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PyramidGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PyramidGore2"), 1f); @@ -60,8 +60,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; } } @@ -69,7 +69,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDesert && !Main.dayTime && y < Main.worldSurface ? 0.08f : 0f; } } diff --git a/NPCs/PyramidRider.cs b/NPCs/PyramidRider.cs index b6cb5d3e..f201b8eb 100644 --- a/NPCs/PyramidRider.cs +++ b/NPCs/PyramidRider.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -35,7 +35,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 18, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 18, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } NPC.NewNPC((int)npc.position.X, (int)npc.position.Y + 55, 508); NPC.NewNPC((int)npc.position.X - 22, (int)npc.position.Y + 55, mod.NPCType("PyramidHead")); @@ -46,23 +46,23 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; } } public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDesert && NPC.downedBoss1 && !Main.dayTime && y < Main.worldSurface ? 0.03f : 0f; } } diff --git a/NPCs/QuartzBeetle.cs b/NPCs/QuartzBeetle.cs index bf69c43a..c532307e 100644 --- a/NPCs/QuartzBeetle.cs +++ b/NPCs/QuartzBeetle.cs @@ -1,7 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; + namespace Tremor.NPCs { @@ -34,16 +35,16 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { @@ -58,7 +59,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("NightmareFlame"), 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("NightmareFlame"), 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/QBGore1"), 1f); } @@ -68,7 +69,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneJungle && NPC.downedMoonlord && Main.hardMode && y > Main.rockLayer ? 0.01f : 0f; } } diff --git a/NPCs/Quetzalcoatl.cs b/NPCs/Quetzalcoatl.cs index 6ba08a3d..889da8fc 100644 --- a/NPCs/Quetzalcoatl.cs +++ b/NPCs/Quetzalcoatl.cs @@ -38,7 +38,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/QGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/QGore2"), 1f); @@ -49,14 +49,14 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 59, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, hitDirection, -1f, 0, default(Color), 0.7f); } } } public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } } } \ No newline at end of file diff --git a/NPCs/RGiantSlime.cs b/NPCs/RGiantSlime.cs index c2853091..1b2d91d0 100644 --- a/NPCs/RGiantSlime.cs +++ b/NPCs/RGiantSlime.cs @@ -1,9 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { @@ -36,8 +35,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -46,13 +45,13 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Red, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Red, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Red, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Red, 0.7f); } - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Red, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Red, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Red, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 1, 2.5f * (float)hitDirection, -2.5f, 0, Color.Red, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Red, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Red, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Red, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 1, 2.5f * hitDirection, -2.5f, 0, Color.Red, 0.7f); } } @@ -60,7 +59,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return Main.hardMode && NPC.downedMoonlord && !spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.1f : 0f; } @@ -68,8 +67,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { diff --git a/NPCs/RichSlime.cs b/NPCs/RichSlime.cs index 0bc4bd30..a5974ddb 100644 --- a/NPCs/RichSlime.cs +++ b/NPCs/RichSlime.cs @@ -1,9 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { @@ -34,8 +33,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -44,13 +43,13 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Yellow, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Yellow, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Yellow, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Yellow, 0.7f); } - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Yellow, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Yellow, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Yellow, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 1, 2.5f * (float)hitDirection, -2.5f, 0, Color.Yellow, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Yellow, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Yellow, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Yellow, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 1, 2.5f * hitDirection, -2.5f, 0, Color.Yellow, 0.7f); } } @@ -63,8 +62,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { diff --git a/NPCs/Rogue.cs b/NPCs/Rogue.cs index 07712a96..513cf424 100644 --- a/NPCs/Rogue.cs +++ b/NPCs/Rogue.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -33,16 +33,16 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(15) == 0) { @@ -94,7 +94,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/RogueGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/RogueGore2"), 1f); diff --git a/NPCs/RuinGhost1.cs b/NPCs/RuinGhost1.cs index a628ba64..03d8ef06 100644 --- a/NPCs/RuinGhost1.cs +++ b/NPCs/RuinGhost1.cs @@ -1,7 +1,7 @@ +using System.Linq; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using System.Linq; namespace Tremor.NPCs { diff --git a/NPCs/RuinGhost2.cs b/NPCs/RuinGhost2.cs index 22a38b44..72aae6e8 100644 --- a/NPCs/RuinGhost2.cs +++ b/NPCs/RuinGhost2.cs @@ -1,7 +1,7 @@ +using System.Linq; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using System.Linq; namespace Tremor.NPCs { diff --git a/NPCs/SandThing.cs b/NPCs/SandThing.cs index 2fce7edb..18f50edb 100644 --- a/NPCs/SandThing.cs +++ b/NPCs/SandThing.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -36,8 +36,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(50) == 0) { @@ -55,13 +55,13 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 19, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 19, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 19, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 19, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } - Dust.NewDust(npc.position, npc.width, npc.height, 19, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 19, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 19, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 19, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 19, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 19, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 19, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 19, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); Gore.NewGore(npc.position, npc.velocity, 220, 1f); Gore.NewGore(npc.position, npc.velocity, 221, 1f); Gore.NewGore(npc.position, npc.velocity, 222, 1f); @@ -70,15 +70,15 @@ public override void HitEffect(int hitDirection, double damage) public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDesert && NPC.downedBoss1 && Main.dayTime && y < Main.worldSurface ? 0.01f : 0f; } diff --git a/NPCs/ScaryBat.cs b/NPCs/ScaryBat.cs index 9b854c03..6c03b9cb 100644 --- a/NPCs/ScaryBat.cs +++ b/NPCs/ScaryBat.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -14,7 +14,7 @@ public override void SetStaticDefaults() Main.npcFrameCount[npc.type] = 4; } - const int SpeedMulti = 3; // ⥫ ᪮ + const int SpeedMulti = 3; // �����⥫� ᪮��� public override void SetDefaults() { @@ -39,8 +39,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -49,18 +49,18 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 60; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } } else { for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 54, (float)hitDirection, -2f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 54, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 54, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 54, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 54, (float)hitDirection, -2f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, hitDirection, -2f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, hitDirection, -2f, 0, default(Color), 0.7f); } } } @@ -69,7 +69,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedPlantBoss && y > Main.rockLayer ? 0.01f : 0f; } } diff --git a/NPCs/Scavenger.cs b/NPCs/Scavenger.cs index e253ea59..4a41e588 100644 --- a/NPCs/Scavenger.cs +++ b/NPCs/Scavenger.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -69,7 +69,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGore2"), 1f); @@ -85,8 +85,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (!Main.hardMode) { @@ -288,7 +288,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && y < Main.worldSurface ? 0.0001f : 0f; } } diff --git a/NPCs/Screamer.cs b/NPCs/Screamer.cs index efa9e7d7..7dc43a7c 100644 --- a/NPCs/Screamer.cs +++ b/NPCs/Screamer.cs @@ -1,7 +1,7 @@ -using Terraria.ID; using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -92,8 +92,7 @@ public override void AI() { vector283 = Vector2.UnitY.RotatedByRandom(1.5707963705062866) * new Vector2(5f, 3f); } - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vector283.X, vector283.Y, 593, 60, 0f, Main.myPlayer, 0f, (float)npc.whoAmI); - return; + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vector283.X, vector283.Y, 593, 60, 0f, Main.myPlayer, 0f, npc.whoAmI); } } } @@ -103,7 +102,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return spawnInfo.spawnTileY < Main.rockLayer && NPC.downedMoonlord && Main.eclipse ? 0.001f : 0f; } @@ -111,8 +110,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { diff --git a/NPCs/ShadowHand.cs b/NPCs/ShadowHand.cs index ef37ec68..b2ff82c8 100644 --- a/NPCs/ShadowHand.cs +++ b/NPCs/ShadowHand.cs @@ -1,9 +1,7 @@ -using Terraria.ID; -using System; - +using System; using Microsoft.Xna.Framework; - using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs diff --git a/NPCs/ShadowHandTwo.cs b/NPCs/ShadowHandTwo.cs index c211baa3..b09bd897 100644 --- a/NPCs/ShadowHandTwo.cs +++ b/NPCs/ShadowHandTwo.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -41,8 +41,8 @@ public override void ModifyHitPlayer(Player target, ref int damage, ref bool cri public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/ShadowRipper.cs b/NPCs/ShadowRipper.cs index faa7b92d..ac86b102 100644 --- a/NPCs/ShadowRipper.cs +++ b/NPCs/ShadowRipper.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -39,16 +39,16 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(2) == 0) { @@ -61,7 +61,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return Main.hardMode && NPC.downedMoonlord && !spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.04f : 0f; } public override void HitEffect(int hitDirection, double damage) @@ -70,13 +70,13 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/RipperGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/RipperGore2"), 1f); @@ -86,9 +86,9 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 74, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 74, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 74, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, hitDirection, -1f, 0, default(Color), 0.7f); } } } diff --git a/NPCs/ShadowSteed.cs b/NPCs/ShadowSteed.cs index 0d806839..4f627e55 100644 --- a/NPCs/ShadowSteed.cs +++ b/NPCs/ShadowSteed.cs @@ -1,9 +1,7 @@ -using Terraria.ID; - -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; - using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs diff --git a/NPCs/Shnoot.cs b/NPCs/Shnoot.cs index 47c78931..73427580 100644 --- a/NPCs/Shnoot.cs +++ b/NPCs/Shnoot.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -36,8 +36,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(2) == 0) { @@ -52,15 +52,15 @@ public override void NPCLoot() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && y > Main.rockLayer ? 0.005f : 0f; } @@ -70,7 +70,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 60; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ShnootGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ShnootGore1"), 1f); @@ -82,9 +82,9 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 0.7f); } } } diff --git a/NPCs/Shroot.cs b/NPCs/Shroot.cs index 518e8db0..84b5937b 100644 --- a/NPCs/Shroot.cs +++ b/NPCs/Shroot.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -37,8 +37,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { @@ -53,15 +53,15 @@ public override void NPCLoot() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && y > Main.rockLayer ? 0.003f : 0f; } @@ -71,7 +71,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 60; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ShnootGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ShnootGore1"), 1f); @@ -83,9 +83,9 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default(Color), 0.7f); } } } diff --git a/NPCs/Sighted.cs b/NPCs/Sighted.cs index 15680b54..aabd7648 100644 --- a/NPCs/Sighted.cs +++ b/NPCs/Sighted.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -36,8 +36,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -46,21 +46,21 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SightedGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SightedGore2"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SightedGore3"), 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 3f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 2f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 3f); } } public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.01f : 0f; } } diff --git a/NPCs/SignalDron.cs b/NPCs/SignalDron.cs index 27490a03..1d9105e7 100644 --- a/NPCs/SignalDron.cs +++ b/NPCs/SignalDron.cs @@ -1,8 +1,8 @@ -using Terraria.ID; -using System; +using System; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.NPCs { @@ -35,23 +35,23 @@ public override void AI() npc.active = false; npc.netUpdate = true; } - else if ((double)npc.ai[0] == 0.0) + else if (npc.ai[0] == 0.0) { Vector2 vector2 = new Vector2(npc.Center.X, npc.Center.Y); float num1 = Main.npc[(int)npc.ai[3]].Center.X - vector2.X; float num2 = Main.npc[(int)npc.ai[3]].Center.Y - vector2.Y; - float num3 = (float)Math.Sqrt((double)num1 * (double)num1 + (double)num2 * (double)num2); - if ((double)num3 > 90.0) + float num3 = (float)Math.Sqrt(num1 * (double)num1 + num2 * (double)num2); + if (num3 > 90.0) { float num4 = 8f / num3; float num5 = num1 * num4; float num6 = num2 * num4; - npc.velocity.X = (float)(((double)npc.velocity.X * 15.0 + (double)num5) / 16.0); - npc.velocity.Y = (float)(((double)npc.velocity.Y * 15.0 + (double)num6) / 16.0); + npc.velocity.X = (float)((npc.velocity.X * 15.0 + num5) / 16.0); + npc.velocity.Y = (float)((npc.velocity.Y * 15.0 + num6) / 16.0); } else { - if ((double)Math.Abs(npc.velocity.X) + (double)Math.Abs(npc.velocity.Y) < 8.0) + if (Math.Abs(npc.velocity.X) + (double)Math.Abs(npc.velocity.Y) < 8.0) { npc.velocity.Y *= 1.05f; npc.velocity.X *= 1.05f; @@ -62,7 +62,7 @@ public override void AI() vector2 = new Vector2(npc.Center.X, npc.Center.Y); float num4 = Main.player[npc.target].Center.X - vector2.X; float num5 = Main.player[npc.target].Center.Y - vector2.Y; - float num6 = 8f / (float)Math.Sqrt((double)num4 * (double)num4 + (double)num5 * (double)num5); + float num6 = 8f / (float)Math.Sqrt(num4 * (double)num4 + num5 * (double)num5); npc.velocity.X = num4 * num6; npc.velocity.Y = num5 * num6; npc.ai[0] = 1f; @@ -80,7 +80,7 @@ public override void AI() Vector2 vector2_1 = new Vector2(npc.Center.X, npc.Center.Y); float num1 = Main.npc[(int)npc.ai[3]].Center.X - vector2_1.X; float num2 = Main.npc[(int)npc.ai[3]].Center.Y - vector2_1.Y; - if (Math.Sqrt((double)num1 * (double)num1 + (double)num2 * (double)num2) <= 700.0 && !npc.justHit) + if (Math.Sqrt(num1 * (double)num1 + num2 * (double)num2) <= 700.0 && !npc.justHit) return; npc.ai[0] = 0.0f; } diff --git a/NPCs/SkeletonKnight.cs b/NPCs/SkeletonKnight.cs index bcd4a1bd..60251896 100644 --- a/NPCs/SkeletonKnight.cs +++ b/NPCs/SkeletonKnight.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -35,7 +35,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedBoss3 && y > Main.rockLayer ? 0.02f : 0f; } @@ -43,8 +43,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(3) == 0) { @@ -69,7 +69,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SkelKnightGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SkelKnightGore2"), 1f); diff --git a/NPCs/Skullker.cs b/NPCs/Skullker.cs index 76438e94..c94ba86e 100644 --- a/NPCs/Skullker.cs +++ b/NPCs/Skullker.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -37,15 +37,15 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDungeon && NPC.downedMoonlord && Main.hardMode && y > Main.rockLayer ? 0.006f : 0f; } @@ -55,13 +55,13 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 60; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SkullkerGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SkullkerGore2"), 1f); @@ -71,7 +71,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } } } diff --git a/NPCs/SnowBat.cs b/NPCs/SnowBat.cs index c4f6d2bd..7d67bc1c 100644 --- a/NPCs/SnowBat.cs +++ b/NPCs/SnowBat.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -36,16 +36,16 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { @@ -60,12 +60,12 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * hitDirection, -2.5f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * hitDirection, -2.5f, 0, default(Color), 1f); } - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3f); - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2f); - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * hitDirection, -2.5f, 0, default(Color), 3f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * hitDirection, -2.5f, 0, default(Color), 2f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * hitDirection, -2.5f, 0, default(Color), 3f); } } @@ -73,7 +73,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && Main.cloudAlpha > 0f && y < Main.worldSurface && spawnInfo.player.ZoneSnow ? 0.01f : 0f; } } diff --git a/NPCs/SnowEater.cs b/NPCs/SnowEater.cs index b75706b5..ec842320 100644 --- a/NPCs/SnowEater.cs +++ b/NPCs/SnowEater.cs @@ -1,7 +1,7 @@ -using Terraria.ID; using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -38,8 +38,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(2) == 0) { @@ -55,30 +55,30 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return spawnInfo.player.ZoneSnow && y > Main.rockLayer ? 0.01f : 0f; } public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) { if (npc.life <= 0) { - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SEGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SEGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SEGore2"), 1f); for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.6f); } } } @@ -87,30 +87,30 @@ public override void AI() { npc.TargetClosest(true); float num679 = 12f; - Vector2 vector67 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num680 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector67.X; + Vector2 vector67 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + float num680 = Main.player[npc.target].position.X + Main.player[npc.target].width / 2 - vector67.X; float num681 = Main.player[npc.target].position.Y - vector67.Y; - float num682 = (float)Math.Sqrt((double)(num680 * num680 + num681 * num681)); + float num682 = (float)Math.Sqrt(num680 * num680 + num681 * num681); num682 = num679 / num682; num680 *= num682; num681 *= num682; bool flag74 = false; if (npc.directionY < 0) { - npc.rotation = (float)(Math.Atan2((double)num681, (double)num680) + 1.57); - flag74 = ((double)npc.rotation >= -1.2 && (double)npc.rotation <= 1.2); - if ((double)npc.rotation < -0.8) + npc.rotation = (float)(Math.Atan2(num681, num680) + 1.57); + flag74 = (npc.rotation >= -1.2 && npc.rotation <= 1.2); + if (npc.rotation < -0.8) { npc.rotation = -0.8f; } - else if ((double)npc.rotation > 0.8) + else if (npc.rotation > 0.8) { npc.rotation = 0.8f; } if (npc.velocity.X != 0f) { npc.velocity.X = npc.velocity.X * 0.9f; - if ((double)npc.velocity.X > -0.1 || (double)npc.velocity.X < 0.1) + if (npc.velocity.X > -0.1 || npc.velocity.X < 0.1) { npc.netUpdate = true; npc.velocity.X = 0f; @@ -140,9 +140,9 @@ public override void AI() try { int num686 = (int)npc.position.X / 16; - int num687 = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int num688 = (int)(npc.position.X + (float)npc.width) / 16; - int num689 = (int)(npc.position.Y + (float)npc.height) / 16; + int num687 = (int)(npc.position.X + npc.width / 2) / 16; + int num688 = (int)(npc.position.X + npc.width) / 16; + int num689 = (int)(npc.position.Y + npc.height) / 16; bool flag75 = false; if (Main.tile[num686, num689] == null) { @@ -156,7 +156,7 @@ public override void AI() { Main.tile[num686, num689] = new Tile(); } - if ((Main.tile[num686, num689].nactive() && Main.tileSolid[(int)Main.tile[num686, num689].type]) || (Main.tile[num687, num689].nactive() && Main.tileSolid[(int)Main.tile[num687, num689].type]) || (Main.tile[num688, num689].nactive() && Main.tileSolid[(int)Main.tile[num688, num689].type])) + if ((Main.tile[num686, num689].nactive() && Main.tileSolid[Main.tile[num686, num689].type]) || (Main.tile[num687, num689].nactive() && Main.tileSolid[Main.tile[num687, num689].type]) || (Main.tile[num688, num689].nactive() && Main.tileSolid[Main.tile[num688, num689].type])) { flag75 = true; } @@ -172,7 +172,7 @@ public override void AI() npc.noTileCollide = false; if (Main.rand.Next(2) == 0) { - int num690 = Dust.NewDust(new Vector2(npc.position.X - 4f, npc.position.Y + (float)npc.height - 8f), npc.width + 8, 24, 80, 0f, npc.velocity.Y / 2f, 0, default(Color), 1f); + int num690 = Dust.NewDust(new Vector2(npc.position.X - 4f, npc.position.Y + npc.height - 8f), npc.width + 8, 24, 80, 0f, npc.velocity.Y / 2f, 0, default(Color), 1f); Dust expr_28A1C_cp_0 = Main.dust[num690]; expr_28A1C_cp_0.velocity.X = expr_28A1C_cp_0.velocity.X * 0.4f; Dust expr_28A3C_cp_0 = Main.dust[num690]; @@ -184,11 +184,9 @@ public override void AI() } } } - return; } catch { - return; } } diff --git a/NPCs/Snowcopter.cs b/NPCs/Snowcopter.cs index bb517345..51c15031 100644 --- a/NPCs/Snowcopter.cs +++ b/NPCs/Snowcopter.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -38,8 +38,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -48,7 +48,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, 61, 1f); Gore.NewGore(npc.position, npc.velocity, 61, 1f); @@ -62,7 +62,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return NPC.AnyNPCs(145) && Main.hardMode && y < Main.worldSurface ? 0.06f : 0f; } } diff --git a/NPCs/SnowmanBomber.cs b/NPCs/SnowmanBomber.cs index d433892e..418f8634 100644 --- a/NPCs/SnowmanBomber.cs +++ b/NPCs/SnowmanBomber.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -35,8 +35,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -45,11 +45,11 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * hitDirection, -2.5f, 0, default(Color), 1f); } - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3f); - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2f); - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * hitDirection, -2.5f, 0, default(Color), 3f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * hitDirection, -2.5f, 0, default(Color), 2f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * hitDirection, -2.5f, 0, default(Color), 3f); } } @@ -57,7 +57,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return NPC.AnyNPCs(144) && Main.hardMode && y < Main.worldSurface ? 0.08f : 0f; } } diff --git a/NPCs/SnowmanWarrior.cs b/NPCs/SnowmanWarrior.cs index d7eebe45..da7088fb 100644 --- a/NPCs/SnowmanWarrior.cs +++ b/NPCs/SnowmanWarrior.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -35,8 +35,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -45,11 +45,11 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * hitDirection, -2.5f, 0, default(Color), 1f); } - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3f); - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2f); - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * hitDirection, -2.5f, 0, default(Color), 3f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * hitDirection, -2.5f, 0, default(Color), 2f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * hitDirection, -2.5f, 0, default(Color), 3f); } } @@ -57,7 +57,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return NPC.AnyNPCs(144) && Main.hardMode && y < Main.worldSurface ? 0.08f : 0f; } } diff --git a/NPCs/Sorcerer.cs b/NPCs/Sorcerer.cs index 3b62357e..6132469f 100644 --- a/NPCs/Sorcerer.cs +++ b/NPCs/Sorcerer.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -8,21 +8,9 @@ namespace Tremor.NPCs [AutoloadHead] public class Sorcerer : ModNPC { - public override string Texture - { - get - { - return "Tremor/NPCs/Sorcerer"; - } - } + public override string Texture => "Tremor/NPCs/Sorcerer"; - public override string[] AltTextures - { - get - { - return new string[] { "Tremor/NPCs/Sorcerer" }; - } - } + public override string[] AltTextures => new[] { "Tremor/NPCs/Sorcerer" }; public override bool Autoload(ref string name) { @@ -178,7 +166,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SorcererGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SorcererGore2"), 1f); diff --git a/NPCs/SoulofHope.cs b/NPCs/SoulofHope.cs index 83830b57..39dfe9e4 100644 --- a/NPCs/SoulofHope.cs +++ b/NPCs/SoulofHope.cs @@ -1,8 +1,8 @@ -using Terraria.ID; +using System; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; -using System; namespace Tremor.NPCs { @@ -32,14 +32,14 @@ public override void SetStaticDefaults() const int ShootType = 435; const float RotationSpeed = 0.3f; - bool Power = false; - bool OnlyPower = false; + bool Power; + bool OnlyPower; int TimeToShoot = NormalShootRate; - float Rotation = 0.0f; + float Rotation; Color TextColor = Color.Orange; bool StateFlag = true; - System.Random rnd = new System.Random(); + Random rnd = new Random(); public override void SetDefaults() { @@ -65,7 +65,7 @@ public override void ScaleExpertStats(int numPlayers, float bossLifeScale) npc.damage = (int)(npc.damage * 0.6f); } - bool RunAway = false; + bool RunAway; public override void AI() { npc.position += npc.velocity * 1.7f; @@ -89,13 +89,13 @@ public override void AI() Vector2 vector142 = new Vector2(npc.Center.X, npc.Center.Y); float num1243 = Main.player[npc.target].Center.X - vector142.X; float num1244 = Main.player[npc.target].Center.Y - vector142.Y; - float num1245 = (float)Math.Sqrt((double)(num1243 * num1243 + num1244 * num1244)); + float num1245 = (float)Math.Sqrt(num1243 * num1243 + num1244 * num1244); if (npc.ai[1] == 0f) { if (Main.netMode != 1) { npc.localAI[1] += 1f; - if (npc.localAI[1] >= (float)(120 + Main.rand.Next(200))) + if (npc.localAI[1] >= 120 + Main.rand.Next(200)) { npc.localAI[1] = 0f; npc.TargetClosest(true); @@ -109,7 +109,7 @@ public override void AI() num1251 = (int)Main.player[npc.target].Center.Y / 16; num1250 += Main.rand.Next(-50, 51); num1251 += Main.rand.Next(-50, 51); - if (!WorldGen.SolidTile(num1250, num1251) && Collision.CanHit(new Vector2((float)(num1250 * 16), (float)(num1251 * 16)), 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + if (!WorldGen.SolidTile(num1250, num1251) && Collision.CanHit(new Vector2(num1250 * 16, num1251 * 16), 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { break; } @@ -119,8 +119,8 @@ public override void AI() } } npc.ai[1] = 1f; - npc.ai[2] = (float)num1250; - npc.ai[3] = (float)num1251; + npc.ai[2] = num1250; + npc.ai[3] = num1251; npc.netUpdate = true; //return; } @@ -132,8 +132,8 @@ public override void AI() if (npc.alpha >= 255) { npc.alpha = 255; - npc.position.X = npc.ai[2] * 16f - (float)(npc.width / 2); - npc.position.Y = npc.ai[3] * 16f - (float)(npc.height / 2); + npc.position.X = npc.ai[2] * 16f - npc.width / 2; + npc.position.Y = npc.ai[3] * 16f - npc.height / 2; npc.ai[1] = 2f; //return; } @@ -172,9 +172,9 @@ public override void AI() if (Main.dayTime || RunAway || npc.localAI[3] == 1) { npc.localAI[3] = 1; - if (Main.npc[(int)npc.ai[2]].type == mod.NPCType("SoulofTrust") && Main.npc[(int)npc.ai[2]].active == true) + if (Main.npc[(int)npc.ai[2]].type == mod.NPCType("SoulofTrust") && Main.npc[(int)npc.ai[2]].active) Main.npc[(int)npc.ai[2]].localAI[3] = 1; - if (Main.npc[(int)npc.ai[3]].type == mod.NPCType("SoulofTruth") && Main.npc[(int)npc.ai[3]].active == true) + if (Main.npc[(int)npc.ai[3]].type == mod.NPCType("SoulofTruth") && Main.npc[(int)npc.ai[3]].active) Main.npc[(int)npc.ai[3]].localAI[3] = 1; npc.life += 11; npc.aiStyle = 0; @@ -185,8 +185,8 @@ public override void AI() } if (StateFlag) if ( - !((Main.npc[(int)npc.ai[2]].type == mod.NPCType("SoulofTrust") && Main.npc[(int)npc.ai[2]].active == true)) || - !((Main.npc[(int)npc.ai[3]].type == mod.NPCType("SoulofTruth") && Main.npc[(int)npc.ai[3]].active == true)) + !((Main.npc[(int)npc.ai[2]].type == mod.NPCType("SoulofTrust") && Main.npc[(int)npc.ai[2]].active)) || + !((Main.npc[(int)npc.ai[3]].type == mod.NPCType("SoulofTruth") && Main.npc[(int)npc.ai[3]].active)) ) { StateFlag = false; @@ -273,7 +273,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HopeGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HopeGore2"), 1f); @@ -301,8 +301,8 @@ public override void NPCLoot() if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; @@ -330,11 +330,11 @@ public override void NPCLoot() for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 6E-05); k++) { - WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)(Main.maxTilesY * .3f), (int)(Main.maxTilesY * .65f)), (double)WorldGen.genRand.Next(9, 15), WorldGen.genRand.Next(9, 15), mod.TileType("CollapsiumOreTile"), false, 0f, 0f, false, true); + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)(Main.maxTilesY * .3f), (int)(Main.maxTilesY * .65f)), WorldGen.genRand.Next(9, 15), WorldGen.genRand.Next(9, 15), mod.TileType("CollapsiumOreTile"), false, 0f, 0f, false, true); } for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 6E-05); k++) { - WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)(Main.maxTilesY * .3f), (int)(Main.maxTilesY * .65f)), (double)WorldGen.genRand.Next(9, 15), WorldGen.genRand.Next(9, 15), mod.TileType("AngeliteOreTile"), false, 0f, 0f, false, true); + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)(Main.maxTilesY * .3f), (int)(Main.maxTilesY * .65f)), WorldGen.genRand.Next(9, 15), WorldGen.genRand.Next(9, 15), mod.TileType("AngeliteOreTile"), false, 0f, 0f, false, true); } TremorWorld.downedTrinity = true; } diff --git a/NPCs/SoulofTrust.cs b/NPCs/SoulofTrust.cs index 5e2b0e5f..88428d6a 100644 --- a/NPCs/SoulofTrust.cs +++ b/NPCs/SoulofTrust.cs @@ -1,8 +1,8 @@ -using Terraria.ID; +using System; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; -using System; namespace Tremor.NPCs { @@ -30,15 +30,15 @@ public override void SetStaticDefaults() const int BonusDefenseInPower = 5; const int BonusDamageInPower = 10; - bool Power = false; - bool OnlyPower = false; + bool Power; + bool OnlyPower; int TimeToShoot = NormalShootRate; int CurrentPower = PowerTime; int Step = -1; Color TextColor = Color.Orange; bool StateFlag = true; - System.Random rnd = new System.Random(); + Random rnd = new Random(); public override void SetDefaults() { @@ -64,7 +64,7 @@ public override void ScaleExpertStats(int numPlayers, float bossLifeScale) npc.damage = (int)(npc.damage * 0.6f); } - bool RunAway = false; + bool RunAway; public override void AI() { @@ -89,13 +89,13 @@ public override void AI() Vector2 vector142 = new Vector2(npc.Center.X, npc.Center.Y); float num1243 = Main.player[npc.target].Center.X - vector142.X; float num1244 = Main.player[npc.target].Center.Y - vector142.Y; - float num1245 = (float)Math.Sqrt((double)(num1243 * num1243 + num1244 * num1244)); + float num1245 = (float)Math.Sqrt(num1243 * num1243 + num1244 * num1244); if (npc.ai[1] == 0f) { if (Main.netMode != 1) { npc.localAI[1] += 1f; - if (npc.localAI[1] >= (float)(120 + Main.rand.Next(200))) + if (npc.localAI[1] >= 120 + Main.rand.Next(200)) { npc.localAI[1] = 0f; npc.TargetClosest(true); @@ -109,7 +109,7 @@ public override void AI() num1251 = (int)Main.player[npc.target].Center.Y / 16; num1250 += Main.rand.Next(-50, 51); num1251 += Main.rand.Next(-50, 51); - if (!WorldGen.SolidTile(num1250, num1251) && Collision.CanHit(new Vector2((float)(num1250 * 16), (float)(num1251 * 16)), 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + if (!WorldGen.SolidTile(num1250, num1251) && Collision.CanHit(new Vector2(num1250 * 16, num1251 * 16), 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { break; } @@ -119,8 +119,8 @@ public override void AI() } } npc.ai[1] = 1f; - npc.ai[2] = (float)num1250; - npc.ai[3] = (float)num1251; + npc.ai[2] = num1250; + npc.ai[3] = num1251; npc.netUpdate = true; //return; } @@ -132,8 +132,8 @@ public override void AI() if (npc.alpha >= 255) { npc.alpha = 255; - npc.position.X = npc.ai[2] * 16f - (float)(npc.width / 2); - npc.position.Y = npc.ai[3] * 16f - (float)(npc.height / 2); + npc.position.X = npc.ai[2] * 16f - npc.width / 2; + npc.position.Y = npc.ai[3] * 16f - npc.height / 2; npc.ai[1] = 2f; //return; } @@ -188,9 +188,9 @@ public override void AI() if (Main.dayTime || RunAway || npc.localAI[3] == 1) //если(Мой.День или Убегать или нпс.местный ИИ 3 к 1) { npc.localAI[3] = 1; //нпс.местный ИИ[3] равен 3 - if (Main.npc[(int)npc.ai[2]].type == mod.NPCType("SoulofHope") && Main.npc[(int)npc.ai[2]].active == true) //если(Мой.нпс[(значение)нпс.ИИ[2]].тип равен мод.НПС Тип("МОБ") и Мой.нпс[(значение)нпс.ИИ[2]].активен равен да) + if (Main.npc[(int)npc.ai[2]].type == mod.NPCType("SoulofHope") && Main.npc[(int)npc.ai[2]].active) //если(Мой.нпс[(значение)нпс.ИИ[2]].тип равен мод.НПС Тип("МОБ") и Мой.нпс[(значение)нпс.ИИ[2]].активен равен да) Main.npc[(int)npc.ai[2]].localAI[3] = 1; //Мой.нпс[(значение)нпс.ИИ[2]].местный ИИ[3] варно 1 - if (Main.npc[(int)npc.ai[3]].type == mod.NPCType("SoulofTruth") && Main.npc[(int)npc.ai[3]].active == true) //если(Мой.нпс[(значение)нпс.ИИ[2]].тип равен мод.НПС Тип("МОБ") и Мой.нпс[(значение)нпс.ИИ[2]].активен равен да) + if (Main.npc[(int)npc.ai[3]].type == mod.NPCType("SoulofTruth") && Main.npc[(int)npc.ai[3]].active) //если(Мой.нпс[(значение)нпс.ИИ[2]].тип равен мод.НПС Тип("МОБ") и Мой.нпс[(значение)нпс.ИИ[2]].активен равен да) Main.npc[(int)npc.ai[3]].localAI[3] = 1; //Мой.нпс[(значение)нпс.ИИ[2]].местный ИИ[3] варно 1 npc.life += 11; //нпс.жизнь прибавить npc.aiStyle = 0; //нпс.ИИ Стиль - 0 @@ -201,8 +201,8 @@ public override void AI() } if (StateFlag) if ( - !((Main.npc[(int)npc.ai[2]].type == mod.NPCType("SoulofHope") && Main.npc[(int)npc.ai[2]].active == true)) || - !((Main.npc[(int)npc.ai[3]].type == mod.NPCType("SoulofTruth") && Main.npc[(int)npc.ai[3]].active == true)) + !((Main.npc[(int)npc.ai[2]].type == mod.NPCType("SoulofHope") && Main.npc[(int)npc.ai[2]].active)) || + !((Main.npc[(int)npc.ai[3]].type == mod.NPCType("SoulofTruth") && Main.npc[(int)npc.ai[3]].active)) ) { StateFlag = false; @@ -239,14 +239,13 @@ public override void AI() Vector2 velocity = Helper2.VelocityFPTP(npc.Center, Main.player[npc.target].Center, PowerBulletSpeed); int spread = 65; float spreadMult = 0.05f; - velocity.X = velocity.X + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - velocity.Y = velocity.Y + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.X = velocity.X + Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.Y = velocity.Y + Main.rand.Next(-spread, spread + 1) * spreadMult; int i = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, velocity.X, velocity.Y, PowerShootType, PowerBulletDamage, PowerBulletKB); Main.projectile[i].hostile = true; Main.projectile[i].friendly = true; } } - return; } } @@ -288,8 +287,8 @@ void Shoot() float spreadMult = 0.075f; for (int l = 0; l < 2; l++) { - velocity.X = velocity.X + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - velocity.Y = velocity.Y + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.X = velocity.X + Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.Y = velocity.Y + Main.rand.Next(-spread, spread + 1) * spreadMult; int i = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, velocity.X, velocity.Y, NormalShootType, NormalBulletDamage, NormalBulletKB); Main.projectile[i].hostile = true; Main.projectile[i].friendly = false; @@ -303,7 +302,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TrustGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TrustGore2"), 1f); @@ -326,8 +325,8 @@ public override void NPCLoot() if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; @@ -354,11 +353,11 @@ public override void NPCLoot() for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 6E-05); k++) { - WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)(Main.maxTilesY * .3f), (int)(Main.maxTilesY * .65f)), (double)WorldGen.genRand.Next(9, 15), WorldGen.genRand.Next(9, 15), mod.TileType("CollapsiumOreTile"), false, 0f, 0f, false, true); + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)(Main.maxTilesY * .3f), (int)(Main.maxTilesY * .65f)), WorldGen.genRand.Next(9, 15), WorldGen.genRand.Next(9, 15), mod.TileType("CollapsiumOreTile"), false, 0f, 0f, false, true); } for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 6E-05); k++) { - WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)(Main.maxTilesY * .3f), (int)(Main.maxTilesY * .65f)), (double)WorldGen.genRand.Next(9, 15), WorldGen.genRand.Next(9, 15), mod.TileType("AngeliteOreTile"), false, 0f, 0f, false, true); + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)(Main.maxTilesY * .3f), (int)(Main.maxTilesY * .65f)), WorldGen.genRand.Next(9, 15), WorldGen.genRand.Next(9, 15), mod.TileType("AngeliteOreTile"), false, 0f, 0f, false, true); } TremorWorld.downedTrinity = true; } diff --git a/NPCs/SoulofTruth.cs b/NPCs/SoulofTruth.cs index 222bf1e0..0fdf9065 100644 --- a/NPCs/SoulofTruth.cs +++ b/NPCs/SoulofTruth.cs @@ -1,9 +1,9 @@ -using Terraria.ID; +using System; using System.IO; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; -using System; namespace Tremor.NPCs { @@ -27,15 +27,15 @@ public override void SetStaticDefaults() const int ShootType = 76; const float RotationSpeed = 0.2f; - bool Power = false; - bool OnlyPower = false; - float Rotation = 0.0f; + bool Power; + bool OnlyPower; + float Rotation; Color TextColor = Color.Orange; bool StateFlag = true; float[] myAI = new float[2]; - System.Random rnd = new System.Random(); + Random rnd = new Random(); public override void SetDefaults() { @@ -61,7 +61,7 @@ public override void ScaleExpertStats(int numPlayers, float bossLifeScale) npc.damage = (int)(npc.damage * 0.6f); } - bool RunAway = false; + bool RunAway; public override void AI() { @@ -86,13 +86,13 @@ public override void AI() Vector2 vector142 = new Vector2(npc.Center.X, npc.Center.Y); float num1243 = Main.player[npc.target].Center.X - vector142.X; float num1244 = Main.player[npc.target].Center.Y - vector142.Y; - float num1245 = (float)Math.Sqrt((double)(num1243 * num1243 + num1244 * num1244)); + float num1245 = (float)Math.Sqrt(num1243 * num1243 + num1244 * num1244); if (npc.ai[1] == 0f) { if (Main.netMode != 1) { npc.localAI[1] += 1f; - if (npc.localAI[1] >= (float)(120 + Main.rand.Next(200))) + if (npc.localAI[1] >= 120 + Main.rand.Next(200)) { npc.localAI[1] = 0f; npc.TargetClosest(true); @@ -106,7 +106,7 @@ public override void AI() num1251 = (int)Main.player[npc.target].Center.Y / 16; num1250 += Main.rand.Next(-50, 51); num1251 += Main.rand.Next(-50, 51); - if (!WorldGen.SolidTile(num1250, num1251) && Collision.CanHit(new Vector2((float)(num1250 * 16), (float)(num1251 * 16)), 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + if (!WorldGen.SolidTile(num1250, num1251) && Collision.CanHit(new Vector2(num1250 * 16, num1251 * 16), 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { break; } @@ -116,8 +116,8 @@ public override void AI() } } npc.ai[1] = 1f; - npc.ai[2] = (float)num1250; - npc.ai[3] = (float)num1251; + npc.ai[2] = num1250; + npc.ai[3] = num1251; npc.netUpdate = true; //return; } @@ -129,8 +129,8 @@ public override void AI() if (npc.alpha >= 255) { npc.alpha = 255; - npc.position.X = npc.ai[2] * 16f - (float)(npc.width / 2); - npc.position.Y = npc.ai[3] * 16f - (float)(npc.height / 2); + npc.position.X = npc.ai[2] * 16f - npc.width / 2; + npc.position.Y = npc.ai[3] * 16f - npc.height / 2; npc.ai[1] = 2f; //return; } @@ -171,9 +171,9 @@ public override void AI() if (Main.dayTime || RunAway || npc.localAI[3] == 1) { npc.localAI[3] = 1; - if (Main.npc[(int)npc.ai[2]].type == mod.NPCType("SoulofTrust") && Main.npc[(int)npc.ai[2]].active == true) + if (Main.npc[(int)npc.ai[2]].type == mod.NPCType("SoulofTrust") && Main.npc[(int)npc.ai[2]].active) Main.npc[(int)npc.ai[2]].localAI[3] = 1; - if (Main.npc[(int)npc.ai[3]].type == mod.NPCType("SoulofTruth") && Main.npc[(int)npc.ai[3]].active == true) + if (Main.npc[(int)npc.ai[3]].type == mod.NPCType("SoulofTruth") && Main.npc[(int)npc.ai[3]].active) Main.npc[(int)npc.ai[3]].localAI[3] = 1; npc.life += 11; npc.aiStyle = 0; @@ -184,8 +184,8 @@ public override void AI() } if (StateFlag) if ( - !((Main.npc[(int)npc.ai[2]].type == mod.NPCType("SoulofHope") && Main.npc[(int)npc.ai[2]].active == true)) || - !((Main.npc[(int)npc.ai[3]].type == mod.NPCType("SoulofTrust") && Main.npc[(int)npc.ai[3]].active == true)) + !((Main.npc[(int)npc.ai[2]].type == mod.NPCType("SoulofHope") && Main.npc[(int)npc.ai[2]].active)) || + !((Main.npc[(int)npc.ai[3]].type == mod.NPCType("SoulofTrust") && Main.npc[(int)npc.ai[3]].active)) ) { StateFlag = false; @@ -254,8 +254,8 @@ void Shoot() float spreadMult = 0.05f; for (int l = 0; l < 2; l++) { - velocity.X = velocity.X + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - velocity.Y = velocity.Y + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.X = velocity.X + Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.Y = velocity.Y + Main.rand.Next(-spread, spread + 1) * spreadMult; int i = Projectile.NewProjectile(npc.Center.X, npc.Center.Y + 20, velocity.X, velocity.Y, ShootType, PowerLaserDamage, PowerLaserKB); Main.projectile[i].hostile = true; Main.projectile[i].friendly = false; @@ -276,7 +276,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TruthGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TruthGore2"), 1f); @@ -299,8 +299,8 @@ public override void NPCLoot() if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; @@ -328,11 +328,11 @@ public override void NPCLoot() for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 6E-05); k++) { - WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)(Main.maxTilesY * .3f), (int)(Main.maxTilesY * .65f)), (double)WorldGen.genRand.Next(9, 15), WorldGen.genRand.Next(9, 15), mod.TileType("CollapsiumOreTile"), false, 0f, 0f, false, true); + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)(Main.maxTilesY * .3f), (int)(Main.maxTilesY * .65f)), WorldGen.genRand.Next(9, 15), WorldGen.genRand.Next(9, 15), mod.TileType("CollapsiumOreTile"), false, 0f, 0f, false, true); } for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 6E-05); k++) { - WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)(Main.maxTilesY * .3f), (int)(Main.maxTilesY * .65f)), (double)WorldGen.genRand.Next(9, 15), WorldGen.genRand.Next(9, 15), mod.TileType("AngeliteOreTile"), false, 0f, 0f, false, true); + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)(Main.maxTilesY * .3f), (int)(Main.maxTilesY * .65f)), WorldGen.genRand.Next(9, 15), WorldGen.genRand.Next(9, 15), mod.TileType("AngeliteOreTile"), false, 0f, 0f, false, true); } TremorWorld.downedTrinity = true; } diff --git a/NPCs/SpaceWhale.cs b/NPCs/SpaceWhale.cs index 3ad806ac..28435338 100644 --- a/NPCs/SpaceWhale.cs +++ b/NPCs/SpaceWhale.cs @@ -1,7 +1,7 @@ -using Terraria.ID; using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -44,9 +44,9 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 60; k++) { - Dust.NewDust(npc.Center, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.Center, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.Center, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.Center, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.Center, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.Center, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/SWGore1"), 1f); Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/SWGore2"), 1f); @@ -60,8 +60,8 @@ public override void HitEffect(int hitDirection, double damage) for (int k = 0; k < damage / npc.lifeMax * 20.0; k++) { - Dust.NewDust(npc.Center, npc.width, npc.height, 226, (float)hitDirection, -2f, 0, default(Color), 0.7f); - Dust.NewDust(npc.Center, npc.width, npc.height, 27, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.Center, npc.width, npc.height, 226, hitDirection, -2f, 0, default(Color), 0.7f); + Dust.NewDust(npc.Center, npc.width, npc.height, 27, hitDirection, -1f, 0, default(Color), 0.7f); } } } @@ -113,7 +113,7 @@ public override void AI() int num1085 = 4; float scaleFactor4 = 6f; float scaleFactor5 = 20f; - float num1086 = 6.28318548f / (float)(num1084 / 2); + float num1086 = 6.28318548f / (num1084 / 2); int num1087 = 75; Vector2 vector134 = npc.Center; Player player2 = Main.player[npc.target]; @@ -151,7 +151,7 @@ public override void AI() npc.netUpdate = true; } } - float num1088 = (float)Math.Atan2((double)(player2.Center.Y - vector134.Y), (double)(player2.Center.X - vector134.X)); + float num1088 = (float)Math.Atan2(player2.Center.Y - vector134.Y, player2.Center.X - vector134.X); if (npc.spriteDirection == 1) { num1088 += 3.14159274f; @@ -203,7 +203,7 @@ public override void AI() } if (npc.rotation < num1088) { - if ((double)(num1088 - npc.rotation) > 3.1415926535897931) + if (num1088 - npc.rotation > 3.1415926535897931) { npc.rotation -= num1089; } @@ -214,7 +214,7 @@ public override void AI() } if (npc.rotation > num1088) { - if ((double)(npc.rotation - num1088) > 3.1415926535897931) + if (npc.rotation - num1088 > 3.1415926535897931) { npc.rotation += num1089; } @@ -286,13 +286,13 @@ public override void AI() npc.alpha = 150; } } - if (npc.ai[2] == (float)(num1082 - 30)) + if (npc.ai[2] == num1082 - 30) { int num1091 = 36; for (int num1092 = 0; num1092 < num1091; num1092++) { - Vector2 vector135 = Vector2.Normalize(npc.velocity) * new Vector2((float)npc.width / 2f, (float)npc.height) * 0.75f * 0.5f; - vector135 = vector135.RotatedBy((double)((float)(num1092 - (num1091 / 2 - 1)) * 6.28318548f / (float)num1091), default(Vector2)) + npc.Center; + Vector2 vector135 = Vector2.Normalize(npc.velocity) * new Vector2(npc.width / 2f, npc.height) * 0.75f * 0.5f; + vector135 = vector135.RotatedBy((num1092 - (num1091 / 2 - 1)) * 6.28318548f / num1091, default(Vector2)) + npc.Center; Vector2 value2 = vector135 - npc.Center; int num1093 = Dust.NewDust(vector135 + value2, 0, 0, 172, value2.X * 2f, value2.Y * 2f, 100, default(Color), 1.4f); Main.dust[num1093].noGravity = true; @@ -302,20 +302,19 @@ public override void AI() Main.PlaySound(29, (int)vector134.X, (int)vector134.Y, 96); } npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num1087) + if (npc.ai[2] >= num1087) { npc.ai[0] = 0f; npc.ai[1] = 0f; npc.ai[2] = 0f; npc.netUpdate = true; - return; } } else if (npc.ai[0] == 0f && !player2.dead) { if (npc.ai[1] == 0f) { - npc.ai[1] = (float)(300 * Math.Sign((vector134 - player2.Center).X)); + npc.ai[1] = 300 * Math.Sign((vector134 - player2.Center).X); } Vector2 value3 = player2.Center + new Vector2(npc.ai[1], -200f) - vector134; Vector2 vector136 = Vector2.Normalize(value3 - npc.velocity) * scaleFactor; @@ -366,7 +365,7 @@ public override void AI() npc.spriteDirection = -npc.direction; } npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num1076) + if (npc.ai[2] >= num1076) { int num1095 = 0; switch ((int)npc.ai[3]) @@ -402,7 +401,7 @@ public override void AI() npc.ai[1] = 0f; npc.ai[2] = 0f; npc.velocity = Vector2.Normalize(player2.Center - vector134) * scaleFactor2; - npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X); + npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X); if (num1094 != 0) { npc.direction = num1094; @@ -432,7 +431,6 @@ public override void AI() npc.ai[2] = 0f; } npc.netUpdate = true; - return; } } else if (npc.ai[0] == 1f) @@ -440,9 +438,9 @@ public override void AI() int num1096 = 7; for (int num1097 = 0; num1097 < num1096; num1097++) { - Vector2 vector137 = Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f; - vector137 = vector137.RotatedBy((double)(num1097 - (num1096 / 2 - 1)) * 3.1415926535897931 / (double)((float)num1096), default(Vector2)) + vector134; - Vector2 value4 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); + Vector2 vector137 = Vector2.Normalize(npc.velocity) * new Vector2((npc.width + 50) / 2f, npc.height) * 0.75f; + vector137 = vector137.RotatedBy((num1097 - (num1096 / 2 - 1)) * 3.1415926535897931 / num1096, default(Vector2)) + vector134; + Vector2 value4 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * Main.rand.Next(3, 8); int num1098 = Dust.NewDust(vector137 + value4, 0, 0, 172, value4.X * 2f, value4.Y * 2f, 100, default(Color), 1.4f); Main.dust[num1098].noGravity = true; Main.dust[num1098].noLight = true; @@ -450,21 +448,20 @@ public override void AI() Main.dust[num1098].velocity -= npc.velocity; } npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num1078) + if (npc.ai[2] >= num1078) { npc.ai[0] = 0f; npc.ai[1] = 0f; npc.ai[2] = 0f; npc.ai[3] += 2f; npc.netUpdate = true; - return; } } else if (npc.ai[0] == 2f) { if (npc.ai[1] == 0f) { - npc.ai[1] = (float)(300 * Math.Sign((vector134 - player2.Center).X)); + npc.ai[1] = 300 * Math.Sign((vector134 - player2.Center).X); } Vector2 value5 = player2.Center + new Vector2(npc.ai[1], -200f) - vector134; Vector2 vector138 = Vector2.Normalize(value5 - npc.velocity) * scaleFactor3; @@ -504,12 +501,12 @@ public override void AI() { Main.PlaySound(29, (int)vector134.X, (int)vector134.Y, 96); } - if (npc.ai[2] % (float)num1080 == 0f) + if (npc.ai[2] % num1080 == 0f) { Main.PlaySound(4, (int)npc.Center.X, (int)npc.Center.Y, 19); if (Main.netMode != 1) { - Vector2 vector139 = Vector2.Normalize(player2.Center - vector134) * (float)(npc.width + 20) / 2f + vector134; + Vector2 vector139 = Vector2.Normalize(player2.Center - vector134) * (npc.width + 20) / 2f + vector134; NPC.NewNPC((int)vector139.X, (int)vector139.Y + 45, mod.NPCType("SpaceWhaleMinion"), 0); } } @@ -524,70 +521,67 @@ public override void AI() npc.spriteDirection = -npc.direction; } npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num1079) + if (npc.ai[2] >= num1079) { npc.ai[0] = 0f; npc.ai[1] = 0f; npc.ai[2] = 0f; npc.netUpdate = true; - return; } } else if (npc.ai[0] == 3f) { npc.velocity *= 0.98f; npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); - if (npc.ai[2] == (float)(num1082 - 30)) + if (npc.ai[2] == num1082 - 30) { Main.PlaySound(29, (int)vector134.X, (int)vector134.Y, 95); } - if (Main.netMode != 1 && npc.ai[2] == (float)(num1082 - 30)) + if (Main.netMode != 1 && npc.ai[2] == num1082 - 30) { - Vector2 vector140 = npc.rotation.ToRotationVector2() * (Vector2.UnitX * (float)npc.direction) * (float)(npc.width + 20) / 2f + vector134; - Projectile.NewProjectile(vector140.X, vector140.Y, (float)(npc.direction * 2), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); Projectile.NewProjectile(vector140.X, vector140.Y, (float)(npc.direction * 3), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); Projectile.NewProjectile(vector140.X, vector140.Y, (float)(npc.direction * 4), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); Projectile.NewProjectile(vector140.X, vector140.Y, (float)(npc.direction * 5), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); Projectile.NewProjectile(vector140.X, vector140.Y, (float)(npc.direction * 6), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); Projectile.NewProjectile(vector140.X, vector140.Y, (float)(npc.direction * 7), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); Projectile.NewProjectile(vector140.X, vector140.Y, (float)(npc.direction * 8), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); Projectile.NewProjectile(vector140.X, vector140.Y, (float)(npc.direction * 9), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(vector140.X, vector140.Y, (float)(-(float)npc.direction * 2), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(vector140.X, vector140.Y, (float)(-(float)npc.direction * 3), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(vector140.X, vector140.Y, (float)(-(float)npc.direction * 4), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(vector140.X, vector140.Y, (float)(-(float)npc.direction * 5), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(vector140.X, vector140.Y, (float)(-(float)npc.direction * 6), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(vector140.X, vector140.Y, (float)(-(float)npc.direction * 7), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(vector140.X, vector140.Y, (float)(-(float)npc.direction * 8), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(vector140.X, vector140.Y, (float)(-(float)npc.direction * 9), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); + Vector2 vector140 = npc.rotation.ToRotationVector2() * (Vector2.UnitX * npc.direction) * (npc.width + 20) / 2f + vector134; + Projectile.NewProjectile(vector140.X, vector140.Y, npc.direction * 2, 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); Projectile.NewProjectile(vector140.X, vector140.Y, npc.direction * 3, 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); Projectile.NewProjectile(vector140.X, vector140.Y, npc.direction * 4, 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); Projectile.NewProjectile(vector140.X, vector140.Y, npc.direction * 5, 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); Projectile.NewProjectile(vector140.X, vector140.Y, npc.direction * 6, 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); Projectile.NewProjectile(vector140.X, vector140.Y, npc.direction * 7, 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); Projectile.NewProjectile(vector140.X, vector140.Y, npc.direction * 8, 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); Projectile.NewProjectile(vector140.X, vector140.Y, npc.direction * 9, 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector140.X, vector140.Y, -(float)npc.direction * 2, 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector140.X, vector140.Y, -(float)npc.direction * 3, 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector140.X, vector140.Y, -(float)npc.direction * 4, 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector140.X, vector140.Y, -(float)npc.direction * 5, 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector140.X, vector140.Y, -(float)npc.direction * 6, 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector140.X, vector140.Y, -(float)npc.direction * 7, 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector140.X, vector140.Y, -(float)npc.direction * 8, 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector140.X, vector140.Y, -(float)npc.direction * 9, 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); } npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num1082) + if (npc.ai[2] >= num1082) { npc.ai[0] = 0f; npc.ai[1] = 0f; npc.ai[2] = 0f; npc.netUpdate = true; - return; } } else if (npc.ai[0] == 4f) { npc.velocity *= 0.98f; npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); - if (npc.ai[2] == (float)(num1083 - 60)) + if (npc.ai[2] == num1083 - 60) { Main.PlaySound(29, (int)vector134.X, (int)vector134.Y, 98); } npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num1083) + if (npc.ai[2] >= num1083) { npc.ai[0] = 5f; npc.ai[1] = 0f; npc.ai[2] = 0f; npc.ai[3] = 0f; npc.netUpdate = true; - return; } } else if (npc.ai[0] == 5f && !player2.dead) { if (npc.ai[1] == 0f) { - npc.ai[1] = (float)(300 * Math.Sign((vector134 - player2.Center).X)); + npc.ai[1] = 300 * Math.Sign((vector134 - player2.Center).X); } Vector2 value6 = player2.Center + new Vector2(npc.ai[1], -200f) - vector134; Vector2 vector141 = Vector2.Normalize(value6 - npc.velocity) * scaleFactor; @@ -638,7 +632,7 @@ public override void AI() npc.spriteDirection = -npc.direction; } npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num1076) + if (npc.ai[2] >= num1076) { int num1101 = 0; switch ((int)npc.ai[3]) @@ -666,7 +660,7 @@ public override void AI() npc.ai[1] = 0f; npc.ai[2] = 0f; npc.velocity = Vector2.Normalize(player2.Center - vector134) * scaleFactor2; - npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X); + npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X); if (num1100 != 0) { npc.direction = num1100; @@ -680,7 +674,7 @@ public override void AI() else if (num1101 == 2) { npc.velocity = Vector2.Normalize(player2.Center - vector134) * scaleFactor5; - npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X); + npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X); if (num1100 != 0) { npc.direction = num1100; @@ -701,7 +695,6 @@ public override void AI() npc.ai[2] = 0f; } npc.netUpdate = true; - return; } } else if (npc.ai[0] == 6f) @@ -709,9 +702,9 @@ public override void AI() int num1102 = 7; for (int num1103 = 0; num1103 < num1102; num1103++) { - Vector2 vector142 = Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f; - vector142 = vector142.RotatedBy((double)(num1103 - (num1102 / 2 - 1)) * 3.1415926535897931 / (double)((float)num1102), default(Vector2)) + vector134; - Vector2 value7 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); + Vector2 vector142 = Vector2.Normalize(npc.velocity) * new Vector2((npc.width + 50) / 2f, npc.height) * 0.75f; + vector142 = vector142.RotatedBy((num1103 - (num1102 / 2 - 1)) * 3.1415926535897931 / num1102, default(Vector2)) + vector134; + Vector2 value7 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * Main.rand.Next(3, 8); int num1104 = Dust.NewDust(vector142 + value7, 0, 0, 172, value7.X * 2f, value7.Y * 2f, 100, default(Color), 1.4f); Main.dust[num1104].noGravity = true; Main.dust[num1104].noLight = true; @@ -719,14 +712,13 @@ public override void AI() Main.dust[num1104].velocity -= npc.velocity; } npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num1078) + if (npc.ai[2] >= num1078) { npc.ai[0] = 5f; npc.ai[1] = 0f; npc.ai[2] = 0f; npc.ai[3] += 2f; npc.netUpdate = true; - return; } } else if (npc.ai[0] == 7f) @@ -735,51 +727,49 @@ public override void AI() { Main.PlaySound(29, (int)vector134.X, (int)vector134.Y, 98); } - if (npc.ai[2] % (float)num1085 == 0f) + if (npc.ai[2] % num1085 == 0f) { Main.PlaySound(4, (int)npc.Center.X, (int)npc.Center.Y, 19); if (Main.netMode != 1) { - Vector2 vector143 = Vector2.Normalize(npc.velocity) * (float)(npc.width + 20) / 2f + vector134; + Vector2 vector143 = Vector2.Normalize(npc.velocity) * (npc.width + 20) / 2f + vector134; int num1105 = NPC.NewNPC((int)vector143.X, (int)vector143.Y + 45, mod.NPCType("SpaceWhaleMinion"), 0); Main.npc[num1105].target = npc.target; - Main.npc[num1105].velocity = Vector2.Normalize(npc.velocity).RotatedBy((double)(1.57079637f * (float)npc.direction), default(Vector2)) * scaleFactor4; + Main.npc[num1105].velocity = Vector2.Normalize(npc.velocity).RotatedBy(1.57079637f * npc.direction, default(Vector2)) * scaleFactor4; Main.npc[num1105].netUpdate = true; - Main.npc[num1105].ai[3] = (float)Main.rand.Next(80, 121) / 100f; + Main.npc[num1105].ai[3] = Main.rand.Next(80, 121) / 100f; } } - npc.velocity = npc.velocity.RotatedBy((double)(-(double)num1086 * (float)npc.direction), default(Vector2)); - npc.rotation -= num1086 * (float)npc.direction; + npc.velocity = npc.velocity.RotatedBy(-(double)num1086 * npc.direction, default(Vector2)); + npc.rotation -= num1086 * npc.direction; npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num1084) + if (npc.ai[2] >= num1084) { npc.ai[0] = 5f; npc.ai[1] = 0f; npc.ai[2] = 0f; npc.netUpdate = true; - return; } } else if (npc.ai[0] == 8f) { npc.velocity *= 0.98f; npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); - if (npc.ai[2] == (float)(num1082 - 30)) + if (npc.ai[2] == num1082 - 30) { Main.PlaySound(29, (int)vector134.X, (int)vector134.Y, 94); } - if (Main.netMode != 1 && npc.ai[2] == (float)(num1082 - 30)) + if (Main.netMode != 1 && npc.ai[2] == num1082 - 30) { - Projectile.NewProjectile(vector134.X, vector134.Y, 0f, 0f, mod.ProjectileType("SpaceMeteorPro"), 0, 0f, Main.myPlayer, 1f, (float)(npc.target + 1)); + Projectile.NewProjectile(vector134.X, vector134.Y, 0f, 0f, mod.ProjectileType("SpaceMeteorPro"), 0, 0f, Main.myPlayer, 1f, npc.target + 1); } npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num1082) + if (npc.ai[2] >= num1082) { npc.ai[0] = 5f; npc.ai[1] = 0f; npc.ai[2] = 0f; npc.netUpdate = true; - return; } } @@ -795,8 +785,8 @@ public override void NPCLoot() if (Main.netMode != 1) { - int CenterX = (int)(npc.Center.X + (float)(npc.width / 2)) / 16; - int CenterY = (int)(npc.Center.Y + (float)(npc.height / 2)) / 16; + int CenterX = (int)(npc.Center.X + npc.width / 2) / 16; + int CenterY = (int)(npc.Center.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; diff --git a/NPCs/SpaceWhaleMinion.cs b/NPCs/SpaceWhaleMinion.cs index 9084fc79..31a99505 100644 --- a/NPCs/SpaceWhaleMinion.cs +++ b/NPCs/SpaceWhaleMinion.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -34,8 +34,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } @@ -43,17 +43,17 @@ public override void HitEffect(int hitDirection, double damage) { if (npc.life <= 0) { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.6f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.6f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.6f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.6f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.6f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.6f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SpaceWhaleMinionGore"), 1f); } diff --git a/NPCs/Spaceman.cs b/NPCs/Spaceman.cs index 22b5ae1e..6feb34d8 100644 --- a/NPCs/Spaceman.cs +++ b/NPCs/Spaceman.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -48,16 +48,16 @@ public override void AI() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(6) == 0) { @@ -81,7 +81,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SpaceManGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SpaceManGore2"), 1f); diff --git a/NPCs/SpiderMan.cs b/NPCs/SpiderMan.cs index b709c9d9..c5b832b3 100644 --- a/NPCs/SpiderMan.cs +++ b/NPCs/SpiderMan.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -34,8 +34,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -44,7 +44,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SpiderManGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SpiderManGore2"), 1f); @@ -57,8 +57,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(2) == 0) diff --git a/NPCs/SquidZombie.cs b/NPCs/SquidZombie.cs index 9433ef8f..5cd0fabe 100644 --- a/NPCs/SquidZombie.cs +++ b/NPCs/SquidZombie.cs @@ -1,7 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; + namespace Tremor.NPCs { @@ -37,7 +38,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore2"), 1f); @@ -49,16 +50,16 @@ public override void HitEffect(int hitDirection, double damage) public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(24) == 0) { @@ -75,7 +76,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && (tile == 53 || tile == 112 || tile == 116 || tile == 234) && Tremor.NoZoneAllowWater(spawnInfo) && spawnInfo.water) && y < Main.rockLayer && (x < 250 || x > Main.maxTilesX - 250) && !spawnInfo.playerSafe ? 0.01f : 0f; } } diff --git a/NPCs/Squoma.cs b/NPCs/Squoma.cs index 21c4b971..469d58c1 100644 --- a/NPCs/Squoma.cs +++ b/NPCs/Squoma.cs @@ -1,9 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { @@ -39,7 +38,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SquomaGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SquomaGore1"), 1f); @@ -51,7 +50,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 59, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, hitDirection, -1f, 0, default(Color), 0.7f); } } } @@ -61,8 +60,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(3) == 0) { @@ -73,15 +72,15 @@ public override void NPCLoot() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && spawnInfo.player.ZoneSnow && y < Main.worldSurface ? 0.08f : 0f; } } diff --git a/NPCs/Startrooper.cs b/NPCs/Startrooper.cs index d0023b1b..7780d559 100644 --- a/NPCs/Startrooper.cs +++ b/NPCs/Startrooper.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -8,21 +8,9 @@ namespace Tremor.NPCs [AutoloadHead] public class Startrooper : ModNPC { - public override string Texture - { - get - { - return "Tremor/NPCs/Startrooper"; - } - } + public override string Texture => "Tremor/NPCs/Startrooper"; - public override string[] AltTextures - { - get - { - return new string[] { "Tremor/NPCs/Startrooper" }; - } - } + public override string[] AltTextures => new[] { "Tremor/NPCs/Startrooper" }; public override bool Autoload(ref string name) { @@ -200,7 +188,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/StartrooperNGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/StartrooperNGore2"), 1f); diff --git a/NPCs/StormJellyfish.cs b/NPCs/StormJellyfish.cs index c512dc78..3cf9ad41 100644 --- a/NPCs/StormJellyfish.cs +++ b/NPCs/StormJellyfish.cs @@ -1,6 +1,7 @@ -using Terraria.ID; +using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -73,9 +74,9 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 60; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/StormGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/StormGore1"), 1f); @@ -90,16 +91,16 @@ public override void HitEffect(int hitDirection, double damage) for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 226, (float)hitDirection, -2f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 226, hitDirection, -2f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, hitDirection, -1f, 0, default(Color), 0.7f); } } } public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } void Shoot() @@ -119,7 +120,7 @@ void Shoot2() Vector2 VelocityFPTP(Vector2 pos1, Vector2 pos2, float speed) { Vector2 move = pos2 - pos1; - return move * (speed / (float)System.Math.Sqrt(move.X * move.X + move.Y * move.Y)); + return move * (speed / (float)Math.Sqrt(move.X * move.X + move.Y * move.Y)); } @@ -127,8 +128,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.expertMode) diff --git a/NPCs/SupremePossessedArmor.cs b/NPCs/SupremePossessedArmor.cs index 82818b94..18f4492a 100644 --- a/NPCs/SupremePossessedArmor.cs +++ b/NPCs/SupremePossessedArmor.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -36,16 +36,16 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(30) == 0) { @@ -60,7 +60,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PossessedGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PossessedGore2"), 1f); @@ -74,7 +74,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMechBossAny && !Main.dayTime && y < Main.worldSurface ? 0.1f : 0f; } } diff --git a/NPCs/TempleSlime.cs b/NPCs/TempleSlime.cs index 4436dc1c..4032cda8 100644 --- a/NPCs/TempleSlime.cs +++ b/NPCs/TempleSlime.cs @@ -1,9 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { @@ -38,27 +37,27 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Brown, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Brown, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Brown, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Brown, 0.7f); } - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Brown, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Brown, 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Brown, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Brown, 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Brown, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Brown, 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Brown, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Brown, 1.7f); } } public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return Main.hardMode && (tile == 226) && NPC.downedMoonlord && y > Main.rockLayer ? 0.005f : 0f; } @@ -66,8 +65,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { diff --git a/NPCs/TheAxeman.cs b/NPCs/TheAxeman.cs index 4ed782fc..22f887a1 100644 --- a/NPCs/TheAxeman.cs +++ b/NPCs/TheAxeman.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -35,15 +35,15 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) { if (npc.life <= 0) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TheAxemanGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TheAxemanGore2"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TheAxemanGore2"), 1f); @@ -51,7 +51,7 @@ public override void HitEffect(int hitDirection, double damage) Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TheAxemanGore3"), 1f); for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); } } } @@ -60,8 +60,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(5) == 0) { @@ -73,7 +73,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && (tile == 53 || tile == 112 || tile == 116 || tile == 234) && spawnInfo.water) && y < Main.rockLayer && (x < 250 || x > Main.maxTilesX - 250) && !spawnInfo.playerSafe && NPC.downedMoonlord && Main.eclipse ? 0.01f : 0f; } } diff --git a/NPCs/TheDarkEmperor.cs b/NPCs/TheDarkEmperor.cs index 04c0e2d1..9ced0acc 100644 --- a/NPCs/TheDarkEmperor.cs +++ b/NPCs/TheDarkEmperor.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -53,8 +53,8 @@ public override void AI() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -63,9 +63,9 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 60; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Main.PlaySound(15, 0); NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("TheDarkEmperorTwo")); @@ -90,8 +90,8 @@ public override void HitEffect(int hitDirection, double damage) for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 191, (float)hitDirection, -2f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 191, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 191, hitDirection, -2f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 191, hitDirection, -1f, 0, default(Color), 0.7f); } } } diff --git a/NPCs/TheDarkEmperorTwo.cs b/NPCs/TheDarkEmperorTwo.cs index 0b093ed2..f1570744 100644 --- a/NPCs/TheDarkEmperorTwo.cs +++ b/NPCs/TheDarkEmperorTwo.cs @@ -1,7 +1,7 @@ -using Terraria.ID; using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -101,27 +101,27 @@ public override void AI() npc.TargetClosest(true); int num1319 = 800; float num1320 = Math.Abs(npc.Center.X - Main.player[npc.target].Center.X); - if (npc.Center.X < Main.player[npc.target].Center.X && npc.ai[2] < 0f && num1320 > (float)num1319) + if (npc.Center.X < Main.player[npc.target].Center.X && npc.ai[2] < 0f && num1320 > num1319) { npc.ai[2] = 0f; } - if (npc.Center.X > Main.player[npc.target].Center.X && npc.ai[2] > 0f && num1320 > (float)num1319) + if (npc.Center.X > Main.player[npc.target].Center.X && npc.ai[2] > 0f && num1320 > num1319) { npc.ai[2] = 0f; } float num1321 = 0.45f; float num1322 = 7f; - if ((double)npc.life < (double)npc.lifeMax * 0.75) + if (npc.life < npc.lifeMax * 0.75) { num1321 = 0.55f; num1322 = 8f; } - if ((double)npc.life < (double)npc.lifeMax * 0.5) + if (npc.life < npc.lifeMax * 0.5) { num1321 = 0.7f; num1322 = 10f; } - if ((double)npc.life < (double)npc.lifeMax * 0.25) + if (npc.life < npc.lifeMax * 0.25) { num1321 = 0.8f; num1322 = 11f; @@ -135,7 +135,7 @@ public override void AI() { npc.velocity.X = -num1322; } - float num1323 = Main.player[npc.target].position.Y - (npc.position.Y + (float)npc.height); + float num1323 = Main.player[npc.target].position.Y - (npc.position.Y + npc.height); if (num1323 < 150f) { npc.velocity.Y = npc.velocity.Y - 0.2f; @@ -157,40 +157,40 @@ public override void AI() { npc.ai[3] += 1f; int num1324 = 13; - if ((double)npc.life < (double)npc.lifeMax * 0.75) + if (npc.life < npc.lifeMax * 0.75) { num1324 = 12; } - if ((double)npc.life < (double)npc.lifeMax * 0.5) + if (npc.life < npc.lifeMax * 0.5) { num1324 = 11; } - if ((double)npc.life < (double)npc.lifeMax * 0.25) + if (npc.life < npc.lifeMax * 0.25) { num1324 = 10; } num1324++; - if (npc.ai[3] > (float)num1324) + if (npc.ai[3] > num1324) { - npc.ai[3] = (float)(-(float)num1324); + npc.ai[3] = -(float)num1324; } if (npc.ai[3] == 0f && Main.netMode != 1) { Vector2 vector159 = new Vector2(npc.Center.X, npc.Center.Y); vector159.X += npc.velocity.X * 7f; - float num1325 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector159.X; + float num1325 = Main.player[npc.target].position.X + Main.player[npc.target].width * 0.5f - vector159.X; float num1326 = Main.player[npc.target].Center.Y - vector159.Y; - float num1327 = (float)Math.Sqrt((double)(num1325 * num1325 + num1326 * num1326)); + float num1327 = (float)Math.Sqrt(num1325 * num1325 + num1326 * num1326); float num1328 = 6f; - if ((double)npc.life < (double)npc.lifeMax * 0.75) + if (npc.life < npc.lifeMax * 0.75) { num1328 = 7f; } - if ((double)npc.life < (double)npc.lifeMax * 0.5) + if (npc.life < npc.lifeMax * 0.5) { num1328 = 8f; } - if ((double)npc.life < (double)npc.lifeMax * 0.25) + if (npc.life < npc.lifeMax * 0.25) { num1328 = 9f; } @@ -206,7 +206,7 @@ public override void AI() } if (Main.netMode != 1) { - npc.ai[1] += (float)Main.rand.Next(1, 4); + npc.ai[1] += Main.rand.Next(1, 4); if (npc.ai[1] > 800f && num1320 < 600f) { npc.ai[0] = -1f; @@ -218,17 +218,17 @@ public override void AI() npc.TargetClosest(true); float num1329 = 0.15f; float num1330 = 7f; - if ((double)npc.life < (double)npc.lifeMax * 0.75) + if (npc.life < npc.lifeMax * 0.75) { num1329 = 0.17f; num1330 = 8f; } - if ((double)npc.life < (double)npc.lifeMax * 0.5) + if (npc.life < npc.lifeMax * 0.5) { num1329 = 0.2f; num1330 = 9f; } - if ((double)npc.life < (double)npc.lifeMax * 0.25) + if (npc.life < npc.lifeMax * 0.25) { num1329 = 0.25f; num1330 = 10f; @@ -255,7 +255,7 @@ public override void AI() { npc.velocity.X = npc.velocity.X * 0.95f; } - float num1331 = Main.player[npc.target].position.Y - (npc.position.Y + (float)npc.height); + float num1331 = Main.player[npc.target].position.Y - (npc.position.Y + npc.height); if (num1331 < 180f) { npc.velocity.Y = npc.velocity.Y - 0.1f; @@ -277,27 +277,27 @@ public override void AI() { npc.ai[3] += 1f; int num1332 = 15; - if ((double)npc.life < (double)npc.lifeMax * 0.75) + if (npc.life < npc.lifeMax * 0.75) { num1332 = 14; } - if ((double)npc.life < (double)npc.lifeMax * 0.5) + if (npc.life < npc.lifeMax * 0.5) { num1332 = 12; } - if ((double)npc.life < (double)npc.lifeMax * 0.25) + if (npc.life < npc.lifeMax * 0.25) { num1332 = 10; } - if ((double)npc.life < (double)npc.lifeMax * 0.1) + if (npc.life < npc.lifeMax * 0.1) { num1332 = 8; } num1332 += 3; - if (npc.ai[3] >= (float)num1332) + if (npc.ai[3] >= num1332) { npc.ai[3] = 0f; - Vector2 vector160 = new Vector2(npc.Center.X, npc.position.Y + (float)npc.height - 14f); + Vector2 vector160 = new Vector2(npc.Center.X, npc.position.Y + npc.height - 14f); int i2 = (int)(vector160.X / 16f); int j2 = (int)(vector160.Y / 16f); if (!WorldGen.SolidTile(i2, j2)) @@ -309,13 +309,13 @@ public override void AI() } num1333 += 3f; float speedX2 = npc.velocity.X * 0.25f; - Projectile.NewProjectile(vector160.X, vector160.Y, speedX2, num1333, mod.ProjectileType("FallingDarkSlime"), 34, 0f, Main.myPlayer, (float)Main.rand.Next(5), 0f); + Projectile.NewProjectile(vector160.X, vector160.Y, speedX2, num1333, mod.ProjectileType("FallingDarkSlime"), 34, 0f, Main.myPlayer, Main.rand.Next(5), 0f); } } } if (Main.netMode != 1) { - npc.ai[1] += (float)Main.rand.Next(1, 4); + npc.ai[1] += Main.rand.Next(1, 4); if (npc.ai[1] > 600f) { npc.ai[0] = -1f; @@ -326,9 +326,9 @@ public override void AI() { npc.TargetClosest(true); Vector2 vector161 = new Vector2(npc.Center.X, npc.Center.Y - 20f); - float num1334 = (float)Main.rand.Next(-1000, 1001); - float num1335 = (float)Main.rand.Next(-1000, 1001); - float num1336 = (float)Math.Sqrt((double)(num1334 * num1334 + num1335 * num1335)); + float num1334 = Main.rand.Next(-1000, 1001); + float num1335 = Main.rand.Next(-1000, 1001); + float num1336 = (float)Math.Sqrt(num1334 * num1334 + num1335 * num1335); float num1337 = 15f; npc.velocity *= 0.95f; num1336 = num1337 / num1336; @@ -339,30 +339,30 @@ public override void AI() vector161.Y += num1335 * 4f; npc.ai[3] += 1f; int num1338 = 7; - if ((double)npc.life < (double)npc.lifeMax * 0.75) + if (npc.life < npc.lifeMax * 0.75) { num1338--; } - if ((double)npc.life < (double)npc.lifeMax * 0.5) + if (npc.life < npc.lifeMax * 0.5) { num1338 -= 2; } - if ((double)npc.life < (double)npc.lifeMax * 0.25) + if (npc.life < npc.lifeMax * 0.25) { num1338 -= 3; } - if ((double)npc.life < (double)npc.lifeMax * 0.1) + if (npc.life < npc.lifeMax * 0.1) { num1338 -= 4; } - if (npc.ai[3] > (float)num1338) + if (npc.ai[3] > num1338) { npc.ai[3] = 0f; Projectile.NewProjectile(vector161.X, vector161.Y, num1334, num1335, mod.ProjectileType("DarkBubblePro"), 40, 0f, Main.myPlayer, 0f, 0f); } if (Main.netMode != 1) { - npc.ai[1] += (float)Main.rand.Next(1, 4); + npc.ai[1] += Main.rand.Next(1, 4); if (npc.ai[1] > 500f) { npc.ai[0] = -1f; @@ -377,11 +377,10 @@ public override void AI() { num1339 = 0; } - npc.ai[0] = (float)num1339; + npc.ai[0] = num1339; npc.ai[1] = 0f; npc.ai[2] = 0f; npc.ai[3] = 0f; - return; } } @@ -395,8 +394,8 @@ public override void NPCLoot() if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; diff --git a/NPCs/TheGirl.cs b/NPCs/TheGirl.cs index 9347c5a9..d3d434c9 100644 --- a/NPCs/TheGirl.cs +++ b/NPCs/TheGirl.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -35,8 +35,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -45,13 +45,13 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 60; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } } } @@ -60,8 +60,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(5) == 0) { @@ -73,7 +73,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && (tile == 53 || tile == 112 || tile == 116 || tile == 234) && spawnInfo.water) && y < Main.rockLayer && (x < 250 || x > Main.maxTilesX - 250) && !spawnInfo.playerSafe && NPC.downedMoonlord && Main.eclipse ? 0.01f : 0f; } } diff --git a/NPCs/TheThing.cs b/NPCs/TheThing.cs index 495e93dd..c369d721 100644 --- a/NPCs/TheThing.cs +++ b/NPCs/TheThing.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -39,16 +39,16 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { @@ -61,9 +61,9 @@ public override void HitEffect(int hitDirection, double damage) { if (npc.life <= 0) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TTGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TTGore2"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TTGore2"), 1f); @@ -72,8 +72,8 @@ public override void HitEffect(int hitDirection, double damage) Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TTGore4"), 1f); for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.6f); } } } @@ -82,7 +82,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.002f : 0f; } } diff --git a/NPCs/Thief1.cs b/NPCs/Thief1.cs index 34ee1e01..23837761 100644 --- a/NPCs/Thief1.cs +++ b/NPCs/Thief1.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -36,8 +36,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(6) == 0) { @@ -92,8 +92,8 @@ public override void NPCLoot() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -102,7 +102,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief1Gore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief1Gore2"), 1f); @@ -119,10 +119,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { return spawnInfo.spawnTileY < Main.rockLayer && Main.dayTime ? 0.02f : 0f; } - else - { - return spawnInfo.spawnTileY < Main.rockLayer && Main.dayTime ? 0.002f : 0f; - } + return spawnInfo.spawnTileY < Main.rockLayer && Main.dayTime ? 0.002f : 0f; } } diff --git a/NPCs/Thief2.cs b/NPCs/Thief2.cs index cbbcb97e..430b4243 100644 --- a/NPCs/Thief2.cs +++ b/NPCs/Thief2.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -36,8 +36,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(20) == 0) { @@ -92,8 +92,8 @@ public override void NPCLoot() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -102,7 +102,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief2Gore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief2Gore2"), 1f); @@ -118,10 +118,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { return spawnInfo.spawnTileY < Main.rockLayer && Main.dayTime ? 0.02f : 0f; } - else - { - return spawnInfo.spawnTileY < Main.rockLayer && Main.dayTime ? 0.002f : 0f; - } + return spawnInfo.spawnTileY < Main.rockLayer && Main.dayTime ? 0.002f : 0f; } } } diff --git a/NPCs/Thief3.cs b/NPCs/Thief3.cs index 4d8fca74..bb171b2a 100644 --- a/NPCs/Thief3.cs +++ b/NPCs/Thief3.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -36,8 +36,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(20) == 0) { @@ -92,8 +92,8 @@ public override void NPCLoot() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -102,7 +102,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief3Gore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief3Gore2"), 1f); @@ -119,10 +119,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { return spawnInfo.spawnTileY < Main.rockLayer && Main.dayTime ? 0.02f : 0f; } - else - { - return spawnInfo.spawnTileY < Main.rockLayer && Main.dayTime ? 0.002f : 0f; - } + return spawnInfo.spawnTileY < Main.rockLayer && Main.dayTime ? 0.002f : 0f; } } diff --git a/NPCs/ThinMan.cs b/NPCs/ThinMan.cs index b1b68961..f7974bdc 100644 --- a/NPCs/ThinMan.cs +++ b/NPCs/ThinMan.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -36,16 +36,16 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(5) == 0) { @@ -60,7 +60,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * hitDirection, -2.5f, 0, default(Color), 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TMGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TMGore2"), 1f); @@ -75,7 +75,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return spawnInfo.spawnTileY < Main.rockLayer && NPC.downedMoonlord && Main.eclipse ? 0.001f : 0f; } } diff --git a/NPCs/ThunderBones.cs b/NPCs/ThunderBones.cs index 7da57437..dea1dd49 100644 --- a/NPCs/ThunderBones.cs +++ b/NPCs/ThunderBones.cs @@ -1,8 +1,7 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { @@ -37,8 +36,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(20) == 0) { @@ -61,8 +60,8 @@ public override void AI() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } @@ -88,7 +87,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedBoss3 && Main.bloodMoon && y < Main.worldSurface ? 0.01f : 0f; } diff --git a/NPCs/TikiSorcerer.cs b/NPCs/TikiSorcerer.cs index 9c86f8c5..f81e71a9 100644 --- a/NPCs/TikiSorcerer.cs +++ b/NPCs/TikiSorcerer.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -32,16 +32,16 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(45) == 0) @@ -57,7 +57,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TSGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TSGore2"), 1f); diff --git a/NPCs/TikiSoul.cs b/NPCs/TikiSoul.cs index c033c944..7fbdab7a 100644 --- a/NPCs/TikiSoul.cs +++ b/NPCs/TikiSoul.cs @@ -1,8 +1,8 @@ -using Terraria.ID; -using System; +using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -49,9 +49,9 @@ public override bool PreAI() npc.position.X = parent.Center.X - (int)(Math.Cos(rad) * dist) - npc.width / 2; npc.position.Y = parent.Center.Y - (int)(Math.Sin(rad) * dist) - npc.height / 2; npc.ai[1] += 2f; - if (--this.TimeToShoot <= 0) + if (--TimeToShoot <= 0) { - this.TimeToShoot = this.ShootRate; + TimeToShoot = ShootRate; NPC parent2 = Main.npc[NPC.FindFirstNPC(mod.NPCType("TikiTotem"))]; Vector2 Velocity = Helper.VelocityToPoint(npc.Center, parent2.Center, 20); //int k = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, Velocity.X, Velocity.Y, mod.ProjectileType("TikiSoulPro"), 0, 1f); diff --git a/NPCs/TikiTotem.cs b/NPCs/TikiTotem.cs index 6bc42816..d3d4391e 100644 --- a/NPCs/TikiTotem.cs +++ b/NPCs/TikiTotem.cs @@ -1,10 +1,10 @@ -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; using System; using System.Collections.Generic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; namespace Tremor.NPCs { @@ -41,8 +41,8 @@ public override void SetDefaults() //Variables bool FirstState = true; - bool SpawnTiki = false; - int Timer = 0; + bool SpawnTiki; + int Timer; bool Flag1 = true; bool Flag2 = true; bool Flag3 = true; @@ -53,7 +53,7 @@ public override void AI() { npc.position += npc.velocity * 1f; } - this.Timer++; + Timer++; for (int num74 = npc.oldPos.Length - 1; num74 > 0; num74--) { npc.oldPos[num74] = npc.oldPos[num74 - 1]; @@ -64,19 +64,19 @@ public override void AI() npc.position.X = Main.player[npc.target].position.X; npc.position.Y = Main.player[npc.target].position.Y - 300f; } - if (NPC.CountNPCS(mod.NPCType("TikiSoul")) <= ((Main.expertMode) ? 6 : 3) && Main.time % 60 == 0 && !this.SpawnTiki) + if (NPC.CountNPCS(mod.NPCType("TikiSoul")) <= ((Main.expertMode) ? 6 : 3) && Main.time % 60 == 0 && !SpawnTiki) { NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("TikiSoul")); } if (NPC.CountNPCS(mod.NPCType("TikiSoul")) >= ((Main.expertMode) ? 6 : 3)) { - this.SpawnTiki = true; + SpawnTiki = true; } - if (NPC.CountNPCS(mod.NPCType("TikiSoul")) == 0 && this.Timer >= 200) + if (NPC.CountNPCS(mod.NPCType("TikiSoul")) == 0 && Timer >= 200) { - this.FirstState = false; + FirstState = false; } - if (this.FirstState) + if (FirstState) { npc.aiStyle = 3; } @@ -101,35 +101,35 @@ public override void AI() npc.TargetClosest(true); } bool flag116 = false; - if ((double)npc.life < (double)npc.lifeMax * 0.75) + if (npc.life < npc.lifeMax * 0.75) { num1263 = 3f; } - if ((double)npc.life < (double)npc.lifeMax * 0.5) + if (npc.life < npc.lifeMax * 0.5) { num1263 = 4f; } else if (npc.ai[0] == 0f) { npc.ai[1] += 1f; - if ((double)npc.life < (double)npc.lifeMax * 0.5) + if (npc.life < npc.lifeMax * 0.5) { npc.ai[1] += 1f; } - if ((double)npc.life < (double)npc.lifeMax * 0.25) + if (npc.life < npc.lifeMax * 0.25) { npc.ai[1] += 1f; } if (npc.ai[1] >= 300f && Main.netMode != 1) { npc.ai[1] = 0f; - if ((double)npc.life < (double)npc.lifeMax * 0.25 && npc.type != 344) + if (npc.life < npc.lifeMax * 0.25 && npc.type != 344) { - npc.ai[0] = (float)Main.rand.Next(3, 5); + npc.ai[0] = Main.rand.Next(3, 5); } else { - npc.ai[0] = (float)Main.rand.Next(1, 3); + npc.ai[0] = Main.rand.Next(1, 3); } npc.netUpdate = true; } @@ -142,20 +142,20 @@ public override void AI() npc.ai[1] += 1f; if (npc.ai[1] % 5f == 0f) { - Vector2 vector146 = new Vector2(npc.position.X + 20f + (float)Main.rand.Next(npc.width - 40), npc.position.Y + 20f + (float)Main.rand.Next(npc.height - 40)); - float num1264 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector146.X; + Vector2 vector146 = new Vector2(npc.position.X + 20f + Main.rand.Next(npc.width - 40), npc.position.Y + 20f + Main.rand.Next(npc.height - 40)); + float num1264 = Main.player[npc.target].position.X + Main.player[npc.target].width * 0.5f - vector146.X; float num1265 = Main.player[npc.target].position.Y - vector146.Y; - num1264 += (float)Main.rand.Next(-50, 51); - num1265 += (float)Main.rand.Next(-50, 51); - num1265 -= Math.Abs(num1264) * ((float)Main.rand.Next(0, 21) * 0.01f); - float num1266 = (float)Math.Sqrt((double)(num1264 * num1264 + num1265 * num1265)); + num1264 += Main.rand.Next(-50, 51); + num1265 += Main.rand.Next(-50, 51); + num1265 -= Math.Abs(num1264) * (Main.rand.Next(0, 21) * 0.01f); + float num1266 = (float)Math.Sqrt(num1264 * num1264 + num1265 * num1265); float num1267 = 12.5f; num1266 = num1267 / num1266; num1264 *= num1266; num1265 *= num1266; - num1264 *= 1f + (float)Main.rand.Next(-20, 21) * 0.02f; - num1265 *= 1f + (float)Main.rand.Next(-20, 21) * 0.02f; - Projectile.NewProjectile(vector146.X, vector146.Y, num1264, num1265, mod.ProjectileType("LizardPro"), 23, 0f, Main.myPlayer, (float)Main.rand.Next(0, 31), 0f); + num1264 *= 1f + Main.rand.Next(-20, 21) * 0.02f; + num1265 *= 1f + Main.rand.Next(-20, 21) * 0.02f; + Projectile.NewProjectile(vector146.X, vector146.Y, num1264, num1265, mod.ProjectileType("LizardPro"), 23, 0f, Main.myPlayer, Main.rand.Next(0, 31), 0f); } if (npc.ai[1] >= 180f) { @@ -169,16 +169,16 @@ public override void AI() npc.ai[1] += 1f; if (npc.ai[1] % 15f == 0f) { - Vector2 vector147 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f + 30f); - float num1268 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector147.X; + Vector2 vector147 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f + 30f); + float num1268 = Main.player[npc.target].position.X + Main.player[npc.target].width * 0.5f - vector147.X; float num1269 = Main.player[npc.target].position.Y - vector147.Y; - float num1270 = (float)Math.Sqrt((double)(num1268 * num1268 + num1269 * num1269)); + float num1270 = (float)Math.Sqrt(num1268 * num1268 + num1269 * num1269); float num1271 = 10f; num1270 = num1271 / num1270; num1268 *= num1270; num1269 *= num1270; - num1268 *= 1f + (float)Main.rand.Next(-20, 21) * 0.01f; - num1269 *= 1f + (float)Main.rand.Next(-20, 21) * 0.01f; + num1268 *= 1f + Main.rand.Next(-20, 21) * 0.01f; + num1269 *= 1f + Main.rand.Next(-20, 21) * 0.01f; Projectile.NewProjectile(vector147.X, vector147.Y, num1268, num1269, mod.ProjectileType("LizardPro"), 50, 0f, Main.myPlayer, 0f, 0f); } if (npc.ai[1] >= 120f) @@ -197,20 +197,20 @@ public override void AI() if (npc.ai[1] > 60f && npc.ai[1] < 240f && npc.ai[1] % 15f == 0f) { float num1272 = 4.5f; - Vector2 vector148 = new Vector2(npc.position.X + 20f + (float)Main.rand.Next(npc.width - 40), npc.position.Y + 60f + (float)Main.rand.Next(npc.height - 80)); - float num1273 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector148.X; + Vector2 vector148 = new Vector2(npc.position.X + 20f + Main.rand.Next(npc.width - 40), npc.position.Y + 60f + Main.rand.Next(npc.height - 80)); + float num1273 = Main.player[npc.target].position.X + Main.player[npc.target].width * 0.5f - vector148.X; float num1274 = Main.player[npc.target].position.Y - vector148.Y; num1274 -= Math.Abs(num1273) * 0.3f; num1272 += Math.Abs(num1273) * 0.004f; - num1273 += (float)Main.rand.Next(-50, 51); - num1274 -= (float)Main.rand.Next(50, 201); - float num1275 = (float)Math.Sqrt((double)(num1273 * num1273 + num1274 * num1274)); + num1273 += Main.rand.Next(-50, 51); + num1274 -= Main.rand.Next(50, 201); + float num1275 = (float)Math.Sqrt(num1273 * num1273 + num1274 * num1274); num1275 = num1272 / num1275; num1273 *= num1275; num1274 *= num1275; - num1273 *= 1f + (float)Main.rand.Next(-30, 31) * 0.01f; - num1274 *= 1f + (float)Main.rand.Next(-30, 31) * 0.01f; - Projectile.NewProjectile(vector148.X, vector148.Y, num1273, num1274, mod.ProjectileType("LizardPro"), 23, 0f, Main.myPlayer, 0f, (float)Main.rand.Next(2)); + num1273 *= 1f + Main.rand.Next(-30, 31) * 0.01f; + num1274 *= 1f + Main.rand.Next(-30, 31) * 0.01f; + Projectile.NewProjectile(vector148.X, vector148.Y, num1273, num1274, mod.ProjectileType("LizardPro"), 23, 0f, Main.myPlayer, 0f, Main.rand.Next(2)); } if (npc.ai[1] >= 300f) { @@ -225,8 +225,8 @@ public override void AI() if (npc.ai[1] > 60f && npc.ai[1] < 240f && npc.ai[1] % 8f == 0f) { float num1276 = 10f; - Vector2 vector149 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f + 30f); - float num1277 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector149.X; + Vector2 vector149 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f + 30f); + float num1277 = Main.player[npc.target].position.X + Main.player[npc.target].width * 0.5f - vector149.X; float num1278 = Main.player[npc.target].position.Y - vector149.Y; num1278 -= Math.Abs(num1277) * 0.3f; num1276 += Math.Abs(num1277) * 0.004f; @@ -234,14 +234,14 @@ public override void AI() { num1276 = 14f; } - num1277 += (float)Main.rand.Next(-50, 51); - num1278 -= (float)Main.rand.Next(50, 61); - float num1279 = (float)Math.Sqrt((double)(num1277 * num1277 + num1278 * num1278)); + num1277 += Main.rand.Next(-50, 51); + num1278 -= Main.rand.Next(50, 61); + float num1279 = (float)Math.Sqrt(num1277 * num1277 + num1278 * num1278); num1279 = num1276 / num1279; num1277 *= num1279; num1278 *= num1279; - num1277 *= 1f + (float)Main.rand.Next(-30, 31) * 0.01f; - num1278 *= 1f + (float)Main.rand.Next(-30, 31) * 0.01f; + num1277 *= 1f + Main.rand.Next(-30, 31) * 0.01f; + num1278 *= 1f + Main.rand.Next(-30, 31) * 0.01f; Projectile.NewProjectile(vector149.X, vector149.Y, num1277, num1278, 81, 23, 0f, Main.myPlayer, 0f, 0f); } if (npc.ai[1] >= 300f) @@ -257,16 +257,16 @@ public override void AI() npc.ai[1] += 1f; if (npc.ai[1] % 30f == 0f) { - Vector2 vector150 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f + 30f); - float num1280 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector150.X; + Vector2 vector150 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f + 30f); + float num1280 = Main.player[npc.target].position.X + Main.player[npc.target].width * 0.5f - vector150.X; float num1281 = Main.player[npc.target].position.Y - vector150.Y; - float num1282 = (float)Math.Sqrt((double)(num1280 * num1280 + num1281 * num1281)); + float num1282 = (float)Math.Sqrt(num1280 * num1280 + num1281 * num1281); float num1283 = 16f; num1282 = num1283 / num1282; num1280 *= num1282; num1281 *= num1282; - num1280 *= 1f + (float)Main.rand.Next(-20, 21) * 0.001f; - num1281 *= 1f + (float)Main.rand.Next(-20, 21) * 0.001f; + num1280 *= 1f + Main.rand.Next(-20, 21) * 0.001f; + num1281 *= 1f + Main.rand.Next(-20, 21) * 0.001f; Projectile.NewProjectile(vector150.X, vector150.Y, num1280, num1281, mod.ProjectileType("LizardPro"), 23, 0f, Main.myPlayer, 0f, 0f); } if (npc.ai[1] >= 120f) @@ -282,8 +282,8 @@ public override void AI() if (npc.ai[1] % 10f == 0f) { float num1284 = 12f; - Vector2 vector151 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f + 30f); - float num1285 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector151.X; + Vector2 vector151 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f + 30f); + float num1285 = Main.player[npc.target].position.X + Main.player[npc.target].width * 0.5f - vector151.X; float num1286 = Main.player[npc.target].position.Y - vector151.Y; num1286 -= Math.Abs(num1285) * 0.2f; num1284 += Math.Abs(num1285) * 0.002f; @@ -291,14 +291,14 @@ public override void AI() { num1284 = 16f; } - num1285 += (float)Main.rand.Next(-50, 51); - num1286 -= (float)Main.rand.Next(50, 71); - float num1287 = (float)Math.Sqrt((double)(num1285 * num1285 + num1286 * num1286)); + num1285 += Main.rand.Next(-50, 51); + num1286 -= Main.rand.Next(50, 71); + float num1287 = (float)Math.Sqrt(num1285 * num1285 + num1286 * num1286); num1287 = num1284 / num1287; num1285 *= num1287; num1286 *= num1287; - num1285 *= 1f + (float)Main.rand.Next(-30, 31) * 0.005f; - num1286 *= 1f + (float)Main.rand.Next(-30, 31) * 0.005f; + num1285 *= 1f + Main.rand.Next(-30, 31) * 0.005f; + num1286 *= 1f + Main.rand.Next(-30, 31) * 0.005f; Projectile.NewProjectile(vector151.X, vector151.Y, num1285, num1286, 81, 23, 0f, Main.myPlayer, 0f, 0f); } if (npc.ai[1] >= 240f) @@ -314,7 +314,7 @@ public override void AI() if (flag116) { npc.velocity.X = npc.velocity.X * 0.9f; - if ((double)npc.velocity.X > -0.1 && (double)npc.velocity.X < 0.1) + if (npc.velocity.X > -0.1 && npc.velocity.X < 0.1) { npc.velocity.X = 0f; } @@ -332,9 +332,9 @@ public override void AI() } int num1288 = 80; int num1289 = 20; - Vector2 position7 = new Vector2(npc.Center.X - (float)(num1288 / 2), npc.position.Y + (float)npc.height - (float)num1289); + Vector2 position7 = new Vector2(npc.Center.X - num1288 / 2, npc.position.Y + npc.height - num1289); bool flag117 = false; - if (npc.position.X < Main.player[npc.target].position.X && npc.position.X + (float)npc.width > Main.player[npc.target].position.X + (float)Main.player[npc.target].width && npc.position.Y + (float)npc.height < Main.player[npc.target].position.Y + (float)Main.player[npc.target].height - 16f) + if (npc.position.X < Main.player[npc.target].position.X && npc.position.X + npc.width > Main.player[npc.target].position.X + Main.player[npc.target].width && npc.position.Y + npc.height < Main.player[npc.target].position.Y + Main.player[npc.target].height - 16f) { flag117 = true; } @@ -348,7 +348,7 @@ public override void AI() { npc.velocity.Y = 0f; } - if ((double)npc.velocity.Y > -0.2) + if (npc.velocity.Y > -0.2) { npc.velocity.Y = npc.velocity.Y - 0.025f; } @@ -367,7 +367,7 @@ public override void AI() { npc.velocity.Y = 0f; } - if ((double)npc.velocity.Y < 0.1) + if (npc.velocity.Y < 0.1) { npc.velocity.Y = npc.velocity.Y + 0.025f; } @@ -382,19 +382,19 @@ public override void AI() return; } - if (npc.life < npc.lifeMax * 0.5f && this.Flag1) + if (npc.life < npc.lifeMax * 0.5f && Flag1) { - this.Flag1 = false; + Flag1 = false; NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y + 95, mod.NPCType("HappySoul")); } - if (npc.life < npc.lifeMax * 0.3f && this.Flag2) + if (npc.life < npc.lifeMax * 0.3f && Flag2) { - this.Flag2 = false; + Flag2 = false; NPC.NewNPC((int)npc.Center.X - 50, (int)npc.Center.Y + 110, mod.NPCType("AngerSoul")); } - if (npc.life < npc.lifeMax * 0.1f && this.Flag3) + if (npc.life < npc.lifeMax * 0.1f && Flag3) { - this.Flag3 = false; + Flag3 = false; NPC.NewNPC((int)npc.Center.X + 50, (int)npc.Center.Y + 110, mod.NPCType("IndifferenceSoul")); } } @@ -410,7 +410,7 @@ public override void HitEffect(int hitDirection, double damage) { if (npc.life <= 0) { - this.Timer = 0; + Timer = 0; Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/TikiTotemGore1"), 1f); Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/TikiTotemGore2"), 1f); Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/TikiTotemGore3"), 1f); @@ -423,7 +423,7 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) for (int k = 0; k < npc.oldPos.Length; k++) { Vector2 drawPos = npc.oldPos[k] - Main.screenPosition; - Color color = npc.GetAlpha(lightColor) * ((float)(npc.oldPos.Length - k) / (float)npc.oldPos.Length); + Color color = npc.GetAlpha(lightColor) * ((npc.oldPos.Length - k) / (float)npc.oldPos.Length); Rectangle frame = new Rectangle(0, 0, 86, 162); frame.Y += 164 * (k / 60); @@ -440,8 +440,8 @@ public override void NPCLoot() } if (Main.netMode != 1) { - int centerX = (int)(npc.Center.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.Center.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.Center.X + npc.width / 2) / 16; + int centerY = (int)(npc.Center.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (!Main.expertMode && Main.rand.Next(1) == 0) diff --git a/NPCs/TikiWarrior.cs b/NPCs/TikiWarrior.cs index 98f992e9..4eda2f49 100644 --- a/NPCs/TikiWarrior.cs +++ b/NPCs/TikiWarrior.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -33,16 +33,16 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(45) == 0) @@ -58,7 +58,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TikiWarriorGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TikiWarriorGore2"), 1f); diff --git a/NPCs/TremorGlobalNPC.cs b/NPCs/TremorGlobalNPC.cs index 2db9ea3a..9ea13e3c 100644 --- a/NPCs/TremorGlobalNPC.cs +++ b/NPCs/TremorGlobalNPC.cs @@ -7,15 +7,9 @@ namespace Tremor.NPCs public class TremorGlobalNPC : GlobalNPC { - public override bool InstancePerEntity - { - get - { - return true; - } - } + public override bool InstancePerEntity => true; - public bool dFear = false; + public bool dFear; public bool Irradiated = false; public override void ResetEffects(NPC npc) diff --git a/NPCs/TremorNPC.cs b/NPCs/TremorNPC.cs index 875706ab..70601c45 100644 --- a/NPCs/TremorNPC.cs +++ b/NPCs/TremorNPC.cs @@ -1,6 +1,7 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; +using Tremor.Items; namespace Tremor.NPCs { @@ -460,17 +461,17 @@ public override void NPCLoot(NPC npc) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Narsil")); } - if (npc.boss == true && !Main.hardMode && Main.rand.Next(5) == 0) + if (npc.boss && !Main.hardMode && Main.rand.Next(5) == 0) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HeavenHelmet")); } - if (npc.boss == true && !Main.hardMode && Main.rand.Next(5) == 0) + if (npc.boss && !Main.hardMode && Main.rand.Next(5) == 0) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HeavenBreastplate")); } - if (npc.boss == true && !Main.hardMode && Main.rand.Next(5) == 0) + if (npc.boss && !Main.hardMode && Main.rand.Next(5) == 0) { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HeavenLeggings")); @@ -886,12 +887,12 @@ public override void NPCLoot(NPC npc) { int i2 = WorldGen.genRand.Next(0, Main.maxTilesX); int j2 = WorldGen.genRand.Next((int)(Main.maxTilesY * .3f), (int)(Main.maxTilesY * .45f)); - WorldGen.OreRunner(i2, j2, (double)WorldGen.genRand.Next(3, 4), WorldGen.genRand.Next(3, 8), (ushort)mod.TileType("NightmareOreTile")); + WorldGen.OreRunner(i2, j2, WorldGen.genRand.Next(3, 4), WorldGen.genRand.Next(3, 8), (ushort)mod.TileType("NightmareOreTile")); } for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 6E-05); k++) { - float value = (float)((double)k / ((double)(Main.maxTilesX * Main.maxTilesY) * 2E-05)); + float value = (float)(k / (Main.maxTilesX * Main.maxTilesY * 2E-05)); bool flag2 = false; int num = 0; while (!flag2) @@ -922,7 +923,7 @@ public override void SetupShop(int type, Chest shop, ref int nextSlot) { if (type == NPCID.Merchant && Main.bloodMoon) { - shop.item[nextSlot].SetDefaults(mod.ItemType()); + shop.item[nextSlot].SetDefaults(mod.ItemType()); nextSlot++; } } diff --git a/NPCs/TwilightBat.cs b/NPCs/TwilightBat.cs index b11ac1b8..10f1281d 100644 --- a/NPCs/TwilightBat.cs +++ b/NPCs/TwilightBat.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -36,16 +36,16 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { @@ -60,14 +60,14 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * hitDirection, -2.5f, 0, default(Color), 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TwilightGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TwilightGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TwilightGore2"), 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * hitDirection, -2.5f, 0, default(Color), 3f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * hitDirection, -2.5f, 0, default(Color), 2f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * hitDirection, -2.5f, 0, default(Color), 3f); } } @@ -75,7 +75,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.02f : 0f; } } diff --git a/NPCs/UndeadArchaeologist.cs b/NPCs/UndeadArchaeologist.cs index cc28c42f..15e42961 100644 --- a/NPCs/UndeadArchaeologist.cs +++ b/NPCs/UndeadArchaeologist.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -40,7 +40,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UAG1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UAG2"), 1f); @@ -52,15 +52,15 @@ public override void HitEffect(int hitDirection, double damage) public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && !Main.dayTime && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDesert ? 0.01f : 0f; } } diff --git a/NPCs/UndeadArchaeologist2.cs b/NPCs/UndeadArchaeologist2.cs index 0e882337..c41499b6 100644 --- a/NPCs/UndeadArchaeologist2.cs +++ b/NPCs/UndeadArchaeologist2.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -35,8 +35,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -45,7 +45,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UAG4"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UAG2"), 1f); @@ -63,7 +63,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && !Main.dayTime && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDesert ? 0.04f : 0f; } diff --git a/NPCs/UndeadMusketeer.cs b/NPCs/UndeadMusketeer.cs index 0364ea41..5802b787 100644 --- a/NPCs/UndeadMusketeer.cs +++ b/NPCs/UndeadMusketeer.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -32,8 +32,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -42,7 +42,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore1"), 1f); @@ -56,8 +56,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(22) == 0) { @@ -77,7 +77,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedBoss2 && !Main.dayTime && y < Main.worldSurface ? 0.02f : 0f; } } diff --git a/NPCs/UndeadWarlock.cs b/NPCs/UndeadWarlock.cs index 2ffdf5b4..22baacb6 100644 --- a/NPCs/UndeadWarlock.cs +++ b/NPCs/UndeadWarlock.cs @@ -1,6 +1,7 @@ -using Terraria.ID; +using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -68,7 +69,7 @@ void Shoot() Vector2 VelocityFPTP(Vector2 pos1, Vector2 pos2, float speed) { Vector2 move = pos2 - pos1; - return move * (speed / (float)System.Math.Sqrt(move.X * move.X + move.Y * move.Y)); + return move * (speed / (float)Math.Sqrt(move.X * move.X + move.Y * move.Y)); } public override void HitEffect(int hitDirection, double damage) @@ -77,11 +78,11 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UWGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UWGore2"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UWGore2"), 1f); @@ -95,7 +96,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedBoss3 && !Main.dayTime && y < Main.worldSurface ? 0.008f : 0f; } } diff --git a/NPCs/UndeadWarrior1.cs b/NPCs/UndeadWarrior1.cs index 40eec7d8..1e67351f 100644 --- a/NPCs/UndeadWarrior1.cs +++ b/NPCs/UndeadWarrior1.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -38,7 +38,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); @@ -53,8 +53,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(5) == 0) @@ -80,7 +80,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && y < Main.worldSurface ? 0.05f : 0f; } } diff --git a/NPCs/UndeadWarrior2.cs b/NPCs/UndeadWarrior2.cs index 761a0a48..e51b3c01 100644 --- a/NPCs/UndeadWarrior2.cs +++ b/NPCs/UndeadWarrior2.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -38,7 +38,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); @@ -53,8 +53,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(5) == 0) @@ -80,7 +80,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && y < Main.worldSurface ? 0.05f : 0f; } } diff --git a/NPCs/UndeadWarrior3.cs b/NPCs/UndeadWarrior3.cs index f338f9a0..948d45c6 100644 --- a/NPCs/UndeadWarrior3.cs +++ b/NPCs/UndeadWarrior3.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -38,7 +38,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); @@ -53,8 +53,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(5) == 0) @@ -79,7 +79,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && y < Main.worldSurface ? 0.08f : 0f; } } diff --git a/NPCs/UndeadWarrior4.cs b/NPCs/UndeadWarrior4.cs index 356ef895..8ede5694 100644 --- a/NPCs/UndeadWarrior4.cs +++ b/NPCs/UndeadWarrior4.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -38,7 +38,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); @@ -53,8 +53,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(5) == 0) @@ -80,7 +80,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && y < Main.worldSurface ? 0.1f : 0f; } } diff --git a/NPCs/Undertaker.cs b/NPCs/Undertaker.cs index b850e28e..05c728f0 100644 --- a/NPCs/Undertaker.cs +++ b/NPCs/Undertaker.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -9,21 +9,9 @@ namespace Tremor.NPCs [AutoloadHead] public class Undertaker : ModNPC { - public override string Texture - { - get - { - return "Tremor/NPCs/Undertaker"; - } - } + public override string Texture => "Tremor/NPCs/Undertaker"; - public override string[] AltTextures - { - get - { - return new string[] { "Tremor/NPCs/Undertaker" }; - } - } + public override string[] AltTextures => new[] { "Tremor/NPCs/Undertaker" }; public override bool Autoload(ref string name) { @@ -168,7 +156,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TheUndertakerGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TheUndertakerGore2"), 1f); diff --git a/NPCs/WallOfShadow.cs b/NPCs/WallOfShadow.cs index b7a5d5a4..2ea5fc2a 100644 --- a/NPCs/WallOfShadow.cs +++ b/NPCs/WallOfShadow.cs @@ -1,10 +1,8 @@ -using Terraria.ID; using System; - using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; - using Terraria; +using Terraria.ID; using Terraria.ModLoader; // Main.wofB = Wall of Flesh bottom @@ -168,11 +166,11 @@ public override bool PreAI() { npc.TargetClosest(false); npc.velocity.Y = npc.velocity.Y + 1f; - if ((double)npc.position.Y > Main.worldSurface * 16.0) + if (npc.position.Y > Main.worldSurface * 16.0) { npc.velocity.Y = npc.velocity.Y + 1f; } - if ((double)npc.position.Y > Main.rockLayer * 16.0) + if (npc.position.Y > Main.rockLayer * 16.0) { for (int num957 = 0; num957 < 200; num957++) { @@ -193,7 +191,7 @@ public override bool PreAI() if ((int)(Main.time % 360) == 0) { - int index = NPC.NewNPC((int)(npc.position.X + (npc.width / 2)), (int)(npc.position.Y + (npc.height / 2) + 20.0), mod.NPCType("ShadowSteed"), 1, 0.0f, 0.0f, 0.0f, 0.0f, (int)byte.MaxValue); + int index = NPC.NewNPC((int)(npc.position.X + (npc.width / 2)), (int)(npc.position.Y + (npc.height / 2) + 20.0), mod.NPCType("ShadowSteed"), 1, 0.0f, 0.0f, 0.0f, 0.0f, byte.MaxValue); Main.npc[index].velocity.X = npc.direction * 6; } @@ -253,7 +251,7 @@ public override bool PreAI() { if (!WorldGen.SolidTile(i, npcBottom)) { - if ((int)Main.tile[i, npcBottom].liquid <= 0) + if (Main.tile[i, npcBottom].liquid <= 0) continue; } ++solidTiles; @@ -291,7 +289,7 @@ public override bool PreAI() { if (!WorldGen.SolidTile(i, j2)) { - if ((int)Main.tile[i, j2].liquid <= 0) + if (Main.tile[i, j2].liquid <= 0) continue; } ++num6; @@ -459,7 +457,7 @@ public override bool PreAI() { if (!WorldGen.SolidTile(i, npcBottom)) { - if ((int)Main.tile[i, npcBottom].liquid <= 0) + if (Main.tile[i, npcBottom].liquid <= 0) continue; } ++solidTiles; @@ -497,7 +495,7 @@ public override bool PreAI() { if (!WorldGen.SolidTile(i, j2)) { - if ((int)Main.tile[i, j2].liquid <= 0) + if (Main.tile[i, j2].liquid <= 0) continue; } ++num6; @@ -613,7 +611,7 @@ public override bool PreAI() num16 = (num16 * 3 + 60) / 4; if (num16 < 20) num16 = (num16 + 20) / 2; - int maxValue1 = (int)((double)num16 * 0.7); + int maxValue1 = (int)(num16 * 0.7); if (Main.rand.Next(maxValue1) == 0) { int index1 = 0; @@ -633,11 +631,11 @@ public override bool PreAI() for (int index2 = 0; index2 < 1000; ++index2) { int num18 = Main.rand.Next(20); - float num19 = (float)((double)num18 * 0.100000001490116 - 0.0500000007450581); + float num19 = (float)(num18 * 0.100000001490116 - 0.0500000007450581); bool flag = true; for (int index3 = 0; index3 < index1; ++index3) { - if ((double)num19 == (double)numArray[index3]) + if (num19 == (double)numArray[index3]) { flag = false; break; @@ -770,8 +768,8 @@ public override void NPCLoot() if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (!Main.expertMode) @@ -852,7 +850,7 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) num3 = num - vector.X; num4 = num2 - vector.Y; Color color = Lighting.GetColor((int)vector.X / 16, (int)(vector.Y / 16f)); - spriteBatch.Draw(shadowChain, new Vector2(vector.X - Main.screenPosition.X, vector.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, shadowChain.Width, shadowChain.Height)), color, rotation, new Vector2(shadowChain.Width * 0.5f, shadowChain.Height * 0.5f), 1f, SpriteEffects.None, 0f); + spriteBatch.Draw(shadowChain, new Vector2(vector.X - Main.screenPosition.X, vector.Y - Main.screenPosition.Y), new Rectangle(0, 0, shadowChain.Width, shadowChain.Height), color, rotation, new Vector2(shadowChain.Width * 0.5f, shadowChain.Height * 0.5f), 1f, SpriteEffects.None, 0f); } } } @@ -902,15 +900,15 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) num9 = num6 - vector2.X; num10 = num7 - vector2.Y; Color color2 = Lighting.GetColor((int)vector2.X / 16, (int)(vector2.Y / 16f)); - spriteBatch.Draw(shadowChain, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, shadowChain.Width, height)), color2, rotation2, new Vector2(shadowChain.Width * 0.5f, shadowChain.Height * 0.5f), 1f, effects1, 0f); + spriteBatch.Draw(shadowChain, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Rectangle(0, 0, shadowChain.Width, height), color2, rotation2, new Vector2(shadowChain.Width * 0.5f, shadowChain.Height * 0.5f), 1f, effects1, 0f); } } } int num12 = 140; - float num13 = (float)Main.wofT; - float num14 = (float)Main.wofB; + float num13 = Main.wofT; + float num14 = Main.wofB; num14 = Main.screenPosition.Y + Main.screenHeight; - float num15 = (float)((int)((num13 - Main.screenPosition.Y) / (float)num12) + 1); + float num15 = (int)((num13 - Main.screenPosition.Y) / num12) + 1; num15 *= num12; if (num15 > 0f) { @@ -949,24 +947,24 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) while (flag4) { num18 = num14 - num16; - if (num18 > (float)num12) + if (num18 > num12) { - num18 = (float)num12; + num18 = num12; } bool flag5 = true; int num20 = 0; while (flag5) { - int x = (int)(num17 + (float)(shadowWall.Width / 2)) / 16; - int y = (int)(num16 + (float)num20) / 16; - Main.spriteBatch.Draw(shadowWall, new Vector2(num17 - Main.screenPosition.X, num16 + (float)num20 - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, num19 + num20, shadowWall.Width, 16)), Lighting.GetColor(x, y), 0f, default(Vector2), 1f, effects2, 0f); + int x = (int)(num17 + shadowWall.Width / 2) / 16; + int y = (int)(num16 + num20) / 16; + Main.spriteBatch.Draw(shadowWall, new Vector2(num17 - Main.screenPosition.X, num16 + num20 - Main.screenPosition.Y), new Rectangle(0, num19 + num20, shadowWall.Width, 16), Lighting.GetColor(x, y), 0f, default(Vector2), 1f, effects2, 0f); num20 += 16; - if ((float)num20 >= num18) + if (num20 >= num18) { flag5 = false; } } - num16 += (float)num12; + num16 += num12; if (num16 >= num14) { flag4 = false; diff --git a/NPCs/WallOfShadowEye.cs b/NPCs/WallOfShadowEye.cs index 86b9b076..b4991fcc 100644 --- a/NPCs/WallOfShadowEye.cs +++ b/NPCs/WallOfShadowEye.cs @@ -1,9 +1,7 @@ -using Terraria.ID; using System; - using Microsoft.Xna.Framework; - using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs diff --git a/NPCs/Warlock.cs b/NPCs/Warlock.cs index c790f347..995783d7 100644 --- a/NPCs/Warlock.cs +++ b/NPCs/Warlock.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -9,21 +9,9 @@ namespace Tremor.NPCs [AutoloadHead] public class Warlock : ModNPC { - public override string Texture - { - get - { - return "Tremor/NPCs/Warlock"; - } - } + public override string Texture => "Tremor/NPCs/Warlock"; - public override string[] AltTextures - { - get - { - return new string[] { "Tremor/NPCs/Warlock" }; - } - } + public override string[] AltTextures => new[] { "Tremor/NPCs/Warlock" }; public override bool Autoload(ref string name) { @@ -182,7 +170,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WarlockGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WarlockGore2"), 1f); diff --git a/NPCs/Witch.cs b/NPCs/Witch.cs index de31b8c2..590c635b 100644 --- a/NPCs/Witch.cs +++ b/NPCs/Witch.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -9,21 +9,9 @@ namespace Tremor.NPCs [AutoloadHead] public class Witch : ModNPC { - public override string Texture - { - get - { - return "Tremor/NPCs/Witch"; - } - } + public override string Texture => "Tremor/NPCs/Witch"; - public override string[] AltTextures - { - get - { - return new string[] { "Tremor/NPCs/Witch" }; - } - } + public override string[] AltTextures => new[] { "Tremor/NPCs/Witch" }; public override bool Autoload(ref string name) { @@ -183,7 +171,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WitchGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WitchGore2"), 1f); diff --git a/NPCs/Woodling.cs b/NPCs/Woodling.cs index bafbeaa1..326b8682 100644 --- a/NPCs/Woodling.cs +++ b/NPCs/Woodling.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -36,16 +36,16 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { @@ -60,7 +60,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * hitDirection, -2.5f, 0, default(Color), 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodlingGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodlingGore2"), 1f); @@ -75,7 +75,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && NPC.downedBoss1 && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && y < Main.worldSurface ? 0.002f : 0f; } } diff --git a/NPCs/WoodlingWarrior.cs b/NPCs/WoodlingWarrior.cs index d3280613..e060f9dd 100644 --- a/NPCs/WoodlingWarrior.cs +++ b/NPCs/WoodlingWarrior.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -36,16 +36,16 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { @@ -64,7 +64,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * hitDirection, -2.5f, 0, default(Color), 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodlingGore4"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodlingGore2"), 1f); @@ -85,7 +85,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && NPC.downedBoss2 && y < Main.worldSurface ? 0.001f : 0f; } } diff --git a/NPCs/Woody.cs b/NPCs/Woody.cs index 778f6a29..77f53431 100644 --- a/NPCs/Woody.cs +++ b/NPCs/Woody.cs @@ -1,8 +1,7 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { @@ -34,8 +33,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -50,7 +49,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneJungle && y > Main.rockLayer ? 0.01f : 0f; } } diff --git a/NPCs/YGiantSlime.cs b/NPCs/YGiantSlime.cs index 5b798a63..529df3b4 100644 --- a/NPCs/YGiantSlime.cs +++ b/NPCs/YGiantSlime.cs @@ -1,9 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { @@ -40,27 +39,27 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Yellow, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Yellow, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Yellow, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Yellow, 0.7f); } - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Yellow, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Yellow, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Yellow, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Yellow, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Yellow, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Yellow, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Yellow, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * hitDirection, -2.5f, 0, Color.Yellow, 0.7f); } } public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return Main.hardMode && NPC.downedMoonlord && !spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.1f : 0f; } @@ -68,8 +67,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { diff --git a/NPCs/Zarprite.cs b/NPCs/Zarprite.cs index 40edade1..8c5bcfbc 100644 --- a/NPCs/Zarprite.cs +++ b/NPCs/Zarprite.cs @@ -1,8 +1,7 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { @@ -35,8 +34,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -53,7 +52,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && y > Main.rockLayer ? 0.01f : 0f; } } diff --git a/NPCs/Zarprute.cs b/NPCs/Zarprute.cs index 452846ac..b5676c78 100644 --- a/NPCs/Zarprute.cs +++ b/NPCs/Zarprute.cs @@ -1,8 +1,7 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { @@ -35,8 +34,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -55,7 +54,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && y > Main.rockLayer ? 0.01f : 0f; } } diff --git a/NPCs/Zootaloo.cs b/NPCs/Zootaloo.cs index 4c066a0d..b31340ed 100644 --- a/NPCs/Zootaloo.cs +++ b/NPCs/Zootaloo.cs @@ -1,9 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { @@ -40,7 +39,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 44, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 44, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZootalooGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZootalooGore2"), 1f); @@ -50,7 +49,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 44, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 44, hitDirection, -1f, 0, default(Color), 0.7f); } } } @@ -60,8 +59,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(3) == 0) { @@ -76,15 +75,15 @@ public override void NPCLoot() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && y < Main.worldSurface ? 0.01f : 0f; } } diff --git a/NPCs/ZootalooMatriarch.cs b/NPCs/ZootalooMatriarch.cs index 11fd3aca..5a56f2e5 100644 --- a/NPCs/ZootalooMatriarch.cs +++ b/NPCs/ZootalooMatriarch.cs @@ -1,9 +1,8 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.NPCs { @@ -40,7 +39,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 44, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 44, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZootalooGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZootalooGore2"), 1f); @@ -50,7 +49,7 @@ public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 44, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 44, hitDirection, -1f, 0, default(Color), 0.7f); } } } @@ -60,8 +59,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (Main.rand.Next(1) == 0) { @@ -80,15 +79,15 @@ public override void NPCLoot() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override float SpawnChance(NPCSpawnInfo spawnInfo) { int x = spawnInfo.spawnTileX; int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = Main.tile[x, y].type; return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && y < Main.worldSurface ? 0.001f : 0f; } } diff --git a/NPCs/npcVultureKing.cs b/NPCs/npcVultureKing.cs index 5dbaf393..65f5ab91 100644 --- a/NPCs/npcVultureKing.cs +++ b/NPCs/npcVultureKing.cs @@ -1,7 +1,7 @@ -using Terraria.ID; -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NPCs @@ -45,12 +45,12 @@ public class npcVultureKing : ModNPC #region "Переменные" int TimeToAnimation = AnimationRate; - int Frame = 0; + int Frame; bool Shoots = true; int TimeToShoot = ShootRate; - int State = 0; + int State; int TimeToState = StateTime_Flying; - bool runAway = false; + bool runAway; #endregion @@ -220,8 +220,8 @@ public override void NPCLoot() } if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if (!Main.expertMode && Main.rand.Next(7) == 0) diff --git a/NovaPillar/Deadling.cs b/NovaPillar/Deadling.cs index 7a653481..86290f34 100644 --- a/NovaPillar/Deadling.cs +++ b/NovaPillar/Deadling.cs @@ -32,8 +32,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override float SpawnChance(NPCSpawnInfo spawnInfo) @@ -65,10 +65,10 @@ public override void OnHitPlayer(Player player, int damage, bool crit) } for (int k = 0; k < 30; k++) { - Vector2 Vector = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 Vector = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); Vector.Normalize(); - Vector *= (float)Main.rand.Next(10, 201) * 0.01f; - int i = Projectile.NewProjectile(npc.position.X, npc.position.Y, Vector.X, Vector.Y, mod.ProjectileType("NovaAlchemistCloud"), 20, 1f, Main.myPlayer, 0f, (float)Main.rand.Next(-45, 1)); + Vector *= Main.rand.Next(10, 201) * 0.01f; + int i = Projectile.NewProjectile(npc.position.X, npc.position.Y, Vector.X, Vector.Y, mod.ProjectileType("NovaAlchemistCloud"), 20, 1f, Main.myPlayer, 0f, Main.rand.Next(-45, 1)); Main.projectile[i].friendly = false; } } @@ -89,10 +89,10 @@ public override void HitEffect(int hitDirection, double damage) } for (int k = 0; k < 30; k++) { - Vector2 Vector = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 Vector = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); Vector.Normalize(); - Vector *= (float)Main.rand.Next(10, 201) * 0.01f; - int i = Projectile.NewProjectile(npc.position.X, npc.position.Y, Vector.X, Vector.Y, mod.ProjectileType("NovaAlchemistCloud"), 20, 1f, Main.myPlayer, 0f, (float)Main.rand.Next(-45, 1)); + Vector *= Main.rand.Next(10, 201) * 0.01f; + int i = Projectile.NewProjectile(npc.position.X, npc.position.Y, Vector.X, Vector.Y, mod.ProjectileType("NovaAlchemistCloud"), 20, 1f, Main.myPlayer, 0f, Main.rand.Next(-45, 1)); Main.projectile[i].friendly = false; } } diff --git a/NovaPillar/NovaAlchemist.cs b/NovaPillar/NovaAlchemist.cs index a1183818..d1d351a9 100644 --- a/NovaPillar/NovaAlchemist.cs +++ b/NovaPillar/NovaAlchemist.cs @@ -11,12 +11,12 @@ public class NovaAlchemist : ModNPC //Int variables int AnimationRate = 8; - int CountFrame = 0; + int CountFrame; int TimeToAnimation = 8; - int Timer = 0; + int Timer; //Bool variables - bool TimeToPortals = false; + bool TimeToPortals; public override void SetDefaults() { npc.lifeMax = 2500; @@ -40,8 +40,8 @@ public override void SetStaticDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -77,13 +77,13 @@ public override void AI() { Main.PlaySound(SoundID.NPCDeath51, npc.Center); } - this.Timer++; - this.NovaAnimation(); - if (this.Timer >= 600) + Timer++; + NovaAnimation(); + if (Timer >= 600) { - this.TimeToPortals = true; + TimeToPortals = true; } - if (this.Timer >= 600 && this.Timer % 200 == 0) + if (Timer >= 600 && Timer % 200 == 0) { if (Main.netMode != 1) { @@ -92,15 +92,15 @@ public override void AI() NPC.NewNPC((int)npc.Center.X - 25, (int)npc.Center.Y, mod.NPCType("NovaAlchemistC")); } } - if (this.Timer < 600) + if (Timer < 600) { - this.TimeToPortals = false; + TimeToPortals = false; } - if (this.Timer >= 800) + if (Timer >= 800) { - this.Timer = 0; + Timer = 0; } - if (this.TimeToPortals) + if (TimeToPortals) { npc.velocity.X = 0f; npc.velocity.Y += 5f; @@ -114,18 +114,18 @@ public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) public void NovaAnimation() { - if (!this.TimeToPortals) + if (!TimeToPortals) { - if (--this.TimeToAnimation <= 0) + if (--TimeToAnimation <= 0) { - if (++this.CountFrame > 3) - this.CountFrame = 1; - this.TimeToAnimation = this.AnimationRate; - npc.frame = this.GetFrame(this.CountFrame); + if (++CountFrame > 3) + CountFrame = 1; + TimeToAnimation = AnimationRate; + npc.frame = GetFrame(CountFrame); } } else - npc.frame = this.GetFrame(4); + npc.frame = GetFrame(4); } Rectangle GetFrame(int Num) diff --git a/NovaPillar/NovaAlchemistC.cs b/NovaPillar/NovaAlchemistC.cs index 32d3ee98..f3425cfa 100644 --- a/NovaPillar/NovaAlchemistC.cs +++ b/NovaPillar/NovaAlchemistC.cs @@ -1,7 +1,7 @@ +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.NovaPillar { @@ -17,9 +17,9 @@ public override void SetStaticDefaults() //Int variables int AnimationRate = 8; - int CountFrame = 0; + int CountFrame; int TimeToAnimation = 8; - int Timer = 0; + int Timer; public override void SetDefaults() { npc.lifeMax = 1; @@ -48,18 +48,18 @@ public override void AI() npc.spriteDirection = npc.direction; Player player = Main.player[npc.target]; npc.rotation = 0f; - this.NovaAnimation(); - this.Timer++; - if (this.Timer >= 350) + NovaAnimation(); + Timer++; + if (Timer >= 350) { npc.life = -1; npc.active = false; npc.checkDead(); for (int k = 0; k < 19; k++) { - Vector2 Vector = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 Vector = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); Vector.Normalize(); - Vector *= (float)Main.rand.Next(10, 201) * 0.01f; + Vector *= Main.rand.Next(10, 201) * 0.01f; int i = Projectile.NewProjectile(npc.position.X, npc.position.Y, Vector.X, Vector.Y, mod.ProjectileType("NovaAlchemistCloud"), 20, 1); Main.projectile[i].friendly = false; } @@ -68,12 +68,12 @@ public override void AI() void NovaAnimation() { - if (--this.TimeToAnimation <= 0) + if (--TimeToAnimation <= 0) { - if (++this.CountFrame > 3) - this.CountFrame = 1; - this.TimeToAnimation = this.AnimationRate; - npc.frame = this.GetFrame(this.CountFrame + 0); + if (++CountFrame > 3) + CountFrame = 1; + TimeToAnimation = AnimationRate; + npc.frame = GetFrame(CountFrame + 0); } } diff --git a/NovaPillar/NovaAlchemistCloud.cs b/NovaPillar/NovaAlchemistCloud.cs index ee338516..a7530236 100644 --- a/NovaPillar/NovaAlchemistCloud.cs +++ b/NovaPillar/NovaAlchemistCloud.cs @@ -34,9 +34,9 @@ public override void AI() projectile.Kill(); projectile.ai[0] = 255f; } - projectile.alpha = (int)(100.0 + (double)projectile.ai[0] * 0.7); + projectile.alpha = (int)(100.0 + projectile.ai[0] * 0.7); projectile.rotation += projectile.velocity.X * 0.1f; - projectile.rotation += (float)projectile.direction * 0.003f; + projectile.rotation += projectile.direction * 0.003f; projectile.velocity *= 0.96f; } } diff --git a/NovaPillar/NovaAlchemistProjectile.cs b/NovaPillar/NovaAlchemistProjectile.cs index 407c3f9e..873dc570 100644 --- a/NovaPillar/NovaAlchemistProjectile.cs +++ b/NovaPillar/NovaAlchemistProjectile.cs @@ -31,7 +31,7 @@ public override void AI() if (projectile.localAI[0] == 0f) { projectile.localAI[0] = 1f; - int num960 = (int)Player.FindClosest(projectile.Center, 0, 0); + int num960 = Player.FindClosest(projectile.Center, 0, 0); Vector2 vector103 = Main.player[num960].Center - projectile.Center; if (vector103 == Vector2.Zero) { @@ -46,8 +46,8 @@ public override void AI() if (Main.rand.Next(2) == 0) { Vector2 vector106 = projectile.ai[1].ToRotationVector2(); - Vector2 vector107 = vector106.RotatedBy(1.5707963705062866, default(Vector2)) * (float)(Main.rand.Next(2) == 0).ToDirectionInt() * (float)Main.rand.Next(10, 21); - Vector2 value60 = vector106 * (float)Main.rand.Next(-80, 81); + Vector2 vector107 = vector106.RotatedBy(1.5707963705062866, default(Vector2)) * (Main.rand.Next(2) == 0).ToDirectionInt() * Main.rand.Next(10, 21); + Vector2 value60 = vector106 * Main.rand.Next(-80, 81); Vector2 vector108 = value60 - vector107; vector108 /= 10f; int num961 = 57; @@ -57,7 +57,7 @@ public override void AI() dust14.velocity = vector108; dust14.scale = 0.5f + Main.rand.NextFloat(); dust14.fadeIn = 0.5f; - value60 = vector106 * (float)Main.rand.Next(40, 121); + value60 = vector106 * Main.rand.Next(40, 121); vector108 = value60 - vector107 / 2f; vector108 /= 10f; dust14 = Main.dust[Dust.NewDust(projectile.Center, 0, 0, num961, 0f, 0f, 0, default(Color), 1f)]; @@ -65,7 +65,6 @@ public override void AI() dust14.position = projectile.Center + vector107 / 2f; dust14.velocity = vector108; dust14.scale = 1f + Main.rand.NextFloat(); - return; } } else if (projectile.ai[0] <= 90f) @@ -73,15 +72,11 @@ public override void AI() projectile.scale = (projectile.ai[0] - 50f) / 40f; projectile.alpha = 255 - (int)(255f * projectile.scale); Vector2 vector111 = projectile.ai[1].ToRotationVector2(); - Vector2 value61 = vector111.RotatedBy(1.5707963705062866, default(Vector2)) * (float)(Main.rand.Next(2) == 0).ToDirectionInt() * (float)Main.rand.Next(10, 21); + Vector2 value61 = vector111.RotatedBy(1.5707963705062866, default(Vector2)) * (Main.rand.Next(2) == 0).ToDirectionInt() * Main.rand.Next(10, 21); vector111 *= (float)Main.rand.Next(-80, 81); Vector2 vector112 = vector111 - value61; vector112 /= 10f; - int num962 = Utils.SelectRandom(Main.rand, new int[] - { - 57, - 57 - }); + int num962 = Utils.SelectRandom(Main.rand, 57, 57); Dust dust17 = Main.dust[Dust.NewDust(projectile.Center, 0, 0, num962, 0f, 0f, 0, default(Color), 1f)]; dust17.noGravity = true; dust17.position = projectile.Center + value61; @@ -91,9 +86,8 @@ public override void AI() if (projectile.ai[0] == 90f && Main.netMode != 1) { Vector2 vector113 = projectile.ai[1].ToRotationVector2() * 8f; - float ai2 = (float)Main.rand.Next(80); + float ai2 = Main.rand.Next(80); Projectile.NewProjectile(projectile.Center.X - vector113.X, projectile.Center.Y - vector113.Y, vector113.X, vector113.Y, mod.ProjectileType("NovaAlchemistFlask"), 15, 1f, Main.myPlayer, projectile.ai[1], ai2); - return; } } else @@ -114,7 +108,7 @@ public override void AI() Vector2 vector114 = Vector2.UnitY.RotatedByRandom(6.2831854820251465) * projectile.scale; Dust dust18 = Main.dust[Dust.NewDust(projectile.Center - vector114 * 30f, 0, 0, 57, 0f, 0f, 0, default(Color), 1f)]; dust18.noGravity = true; - dust18.position = projectile.Center - vector114 * (float)Main.rand.Next(10, 21); + dust18.position = projectile.Center - vector114 * Main.rand.Next(10, 21); dust18.velocity = vector114.RotatedBy(1.5707963705062866, default(Vector2)) * 6f; dust18.scale = 0.5f + Main.rand.NextFloat(); dust18.fadeIn = 0.5f; @@ -141,7 +135,7 @@ public override void AI() Vector2 vector116 = Vector2.UnitY.RotatedByRandom(6.2831854820251465); Dust dust20 = Main.dust[Dust.NewDust(projectile.Center - vector116 * 30f, 0, 0, 57, 0f, 0f, 0, default(Color), 1f)]; dust20.noGravity = true; - dust20.position = projectile.Center - vector116 * (float)Main.rand.Next(10, 21); + dust20.position = projectile.Center - vector116 * Main.rand.Next(10, 21); dust20.velocity = vector116.RotatedBy(1.5707963705062866, default(Vector2)) * 6f; dust20.scale = 0.5f + Main.rand.NextFloat(); dust20.fadeIn = 0.5f; @@ -156,7 +150,6 @@ public override void AI() dust21.scale = 0.5f + Main.rand.NextFloat(); dust21.fadeIn = 0.5f; dust21.customData = projectile.Center; - return; } } } diff --git a/NovaPillar/NovaBat.cs b/NovaPillar/NovaBat.cs index 85639fc3..12f2727d 100644 --- a/NovaPillar/NovaBat.cs +++ b/NovaPillar/NovaBat.cs @@ -51,9 +51,9 @@ public override void HitEffect(int hitDirection, double damage) } for (int k = 0; k < 19; k++) { - Vector2 Vector = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 Vector = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); Vector.Normalize(); - Vector *= (float)Main.rand.Next(10, 201) * 0.01f; + Vector *= Main.rand.Next(10, 201) * 0.01f; int i = Projectile.NewProjectile(npc.position.X, npc.position.Y, Vector.X, Vector.Y, mod.ProjectileType("NovaAlchemistCloud"), 20, 1); Main.projectile[i].friendly = false; } @@ -78,9 +78,9 @@ public override void AI() { for (int k = 0; k < 19; k++) { - Vector2 Vector = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 Vector = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); Vector.Normalize(); - Vector *= (float)Main.rand.Next(10, 201) * 0.01f; + Vector *= Main.rand.Next(10, 201) * 0.01f; int i = Projectile.NewProjectile(npc.position.X, npc.position.Y, Vector.X, Vector.Y, mod.ProjectileType("NovaAlchemistCloud"), 20, 1); Main.projectile[i].friendly = false; } diff --git a/NovaPillar/NovaBottle.cs b/NovaPillar/NovaBottle.cs index 21128d83..1e5609f7 100644 --- a/NovaPillar/NovaBottle.cs +++ b/NovaPillar/NovaBottle.cs @@ -39,10 +39,10 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(5, 8); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - int k = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("NovaBottleCloud"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + int k = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("NovaBottleCloud"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); Main.projectile[k].friendly = false; } } diff --git a/NovaPillar/NovaBreastplate.cs b/NovaPillar/NovaBreastplate.cs index eaab75e4..68b12a06 100644 --- a/NovaPillar/NovaBreastplate.cs +++ b/NovaPillar/NovaBreastplate.cs @@ -30,7 +30,7 @@ public override void UpdateEquip(Player player) player.GetModPlayer(mod).alchemistCrit += 20; player.GetModPlayer(mod).alchemistDamage += 0.25f; player.GetModPlayer(mod).novaChestplate = true; - Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.0f, 1.27f, 0.64f); + Lighting.AddLight((int)((item.position.X + item.width / 2) / 16f), (int)((item.position.Y + item.height / 2) / 16f), 0.0f, 1.27f, 0.64f); } public override void AddRecipes() diff --git a/NovaPillar/NovaCauldron.cs b/NovaPillar/NovaCauldron.cs index 73786cfd..56afd62c 100644 --- a/NovaPillar/NovaCauldron.cs +++ b/NovaPillar/NovaCauldron.cs @@ -58,17 +58,17 @@ public override void AI() projectile.Kill(); } projectile.rotation = 0f; - Vector2 value = base.projectile.position; + Vector2 value = projectile.position; float num2 = 500f; bool flag = false; - base.projectile.tileCollide = true; + projectile.tileCollide = true; for (int j = 0; j < 200; j++) { NPC nPC = Main.npc[j]; if (nPC.CanBeChasedBy(this, false)) { - float num3 = Vector2.Distance(nPC.Center, base.projectile.Center); - if ((num3 < num2 || !flag) && Collision.CanHitLine(base.projectile.position, base.projectile.width, base.projectile.height, nPC.position, nPC.width, nPC.height)) + float num3 = Vector2.Distance(nPC.Center, projectile.Center); + if ((num3 < num2 || !flag) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, nPC.position, nPC.width, nPC.height)) { num2 = num3; value = nPC.Center; @@ -76,107 +76,107 @@ public override void AI() } } } - if (Vector2.Distance(player.Center, base.projectile.Center) > (flag ? 1000f : 500f)) + if (Vector2.Distance(player.Center, projectile.Center) > (flag ? 1000f : 500f)) { - base.projectile.ai[0] = 1f; - base.projectile.netUpdate = true; + projectile.ai[0] = 1f; + projectile.netUpdate = true; } - if (base.projectile.ai[0] == 1f) + if (projectile.ai[0] == 1f) { - base.projectile.tileCollide = false; + projectile.tileCollide = false; } - if (flag && base.projectile.ai[0] == 0f) + if (flag && projectile.ai[0] == 0f) { - Vector2 value2 = value - base.projectile.Center; + Vector2 value2 = value - projectile.Center; if (value2.Length() > 200f) { value2.Normalize(); - base.projectile.velocity = (base.projectile.velocity * 20f + value2 * 6f) / 21f; + projectile.velocity = (projectile.velocity * 20f + value2 * 6f) / 21f; } else { - base.projectile.velocity *= (float)Math.Pow(0.97, 2.0); + projectile.velocity *= (float)Math.Pow(0.97, 2.0); } } else { - if (!Collision.CanHitLine(base.projectile.Center, 1, 1, player.Center, 1, 1)) + if (!Collision.CanHitLine(projectile.Center, 1, 1, player.Center, 1, 1)) { - base.projectile.ai[0] = 1f; + projectile.ai[0] = 1f; } float num4 = 6f; - if (base.projectile.ai[0] == 1f) + if (projectile.ai[0] == 1f) { num4 = 15f; } - Vector2 center = base.projectile.Center; + Vector2 center = projectile.Center; Vector2 vector = player.Center - center; - base.projectile.ai[1] = 3600f; - base.projectile.netUpdate = true; + projectile.ai[1] = 3600f; + projectile.netUpdate = true; int num5 = 1; - for (int k = 0; k < base.projectile.whoAmI; k++) + for (int k = 0; k < projectile.whoAmI; k++) { - if (Main.projectile[k].active && Main.projectile[k].owner == base.projectile.owner && Main.projectile[k].type == base.projectile.type) + if (Main.projectile[k].active && Main.projectile[k].owner == projectile.owner && Main.projectile[k].type == projectile.type) { num5++; } } - vector.X -= (float)((10 + num5 * 40) * player.direction); + vector.X -= (10 + num5 * 40) * player.direction; vector.Y -= 70f; float num6 = vector.Length(); if (num6 > 200f && num4 < 9f) { num4 = 9f; } - if (num6 < 100f && base.projectile.ai[0] == 1f && !Collision.SolidCollision(base.projectile.position, base.projectile.width, base.projectile.height)) + if (num6 < 100f && projectile.ai[0] == 1f && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) { - base.projectile.ai[0] = 0f; - base.projectile.netUpdate = true; + projectile.ai[0] = 0f; + projectile.netUpdate = true; } if (num6 > 2000f) { - base.projectile.Center = player.Center; + projectile.Center = player.Center; } if (num6 > 48f) { vector.Normalize(); vector *= num4; float num7 = 10f; - base.projectile.velocity = (base.projectile.velocity * num7 + vector) / (num7 + 1f); + projectile.velocity = (projectile.velocity * num7 + vector) / (num7 + 1f); } else { - base.projectile.direction = Main.player[base.projectile.owner].direction; - base.projectile.velocity *= (float)Math.Pow(0.9, 2.0); + projectile.direction = Main.player[projectile.owner].direction; + projectile.velocity *= (float)Math.Pow(0.9, 2.0); } } - base.projectile.rotation = base.projectile.velocity.X * 0.05f; - if (base.projectile.velocity.X > 0f) + projectile.rotation = projectile.velocity.X * 0.05f; + if (projectile.velocity.X > 0f) { - base.projectile.spriteDirection = (base.projectile.direction = -1); + projectile.spriteDirection = (projectile.direction = -1); } - else if (base.projectile.velocity.X < 0f) + else if (projectile.velocity.X < 0f) { - base.projectile.spriteDirection = (base.projectile.direction = 1); + projectile.spriteDirection = (projectile.direction = 1); } - if (base.projectile.ai[1] > 0f) + if (projectile.ai[1] > 0f) { - base.projectile.ai[1] += 1f; + projectile.ai[1] += 1f; } - if (base.projectile.ai[1] > 140f) + if (projectile.ai[1] > 140f) { - base.projectile.ai[1] = 0f; - base.projectile.netUpdate = true; + projectile.ai[1] = 0f; + projectile.netUpdate = true; } - if (base.projectile.ai[0] == 0f && flag) + if (projectile.ai[0] == 0f && flag) { - if ((value - base.projectile.Center).X > 0f) + if ((value - projectile.Center).X > 0f) { - base.projectile.spriteDirection = (base.projectile.direction = -1); + projectile.spriteDirection = (projectile.direction = -1); } - else if ((value - base.projectile.Center).X < 0f) + else if ((value - projectile.Center).X < 0f) { - base.projectile.spriteDirection = (base.projectile.direction = 1); + projectile.spriteDirection = (projectile.direction = 1); } } if (projectile.owner == Main.myPlayer) @@ -194,9 +194,9 @@ public override void AI() { if (Main.npc[k].CanBeChasedBy(projectile, true)) { - float Num6 = Main.npc[k].position.X + (float)(Main.npc[k].width / 2); - float Num7 = Main.npc[k].position.Y + (float)(Main.npc[k].height / 2); - float Num8 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - Num6) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - Num7); + float Num6 = Main.npc[k].position.X + Main.npc[k].width / 2; + float Num7 = Main.npc[k].position.Y + Main.npc[k].height / 2; + float Num8 = Math.Abs(projectile.position.X + projectile.width / 2 - Num6) + Math.Abs(projectile.position.Y + projectile.height / 2 - Num7); if (Num8 < Num5 && Collision.CanHit(projectile.position, projectile.width, projectile.height, Main.npc[k].position, Main.npc[k].width, Main.npc[k].height)) { Num5 = Num8; @@ -209,16 +209,15 @@ public override void AI() if (Flag2) { float Num9 = 12f; - Vector2 Vector = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + Vector2 Vector = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); float Num10 = Num3 - Vector.X; float Num11 = Num4 - Vector.Y; - float Num12 = (float)Math.Sqrt((double)(Num10 * Num10 + Num11 * Num11)); + float Num12 = (float)Math.Sqrt(Num10 * Num10 + Num11 * Num11); Num12 = Num9 / Num12; Num10 *= Num12; Num11 *= Num12; Projectile.NewProjectile(projectile.Center.X - 4f, projectile.Center.Y, Num10, Num11, mod.ProjectileType("NovaCauldron_Fire"), 65, projectile.knockBack, projectile.owner, 0f, 0f); projectile.ai[0] = 50f; - return; } } } diff --git a/NovaPillar/NovaCauldron_Fire.cs b/NovaPillar/NovaCauldron_Fire.cs index 34fedac9..f97b52b8 100644 --- a/NovaPillar/NovaCauldron_Fire.cs +++ b/NovaPillar/NovaCauldron_Fire.cs @@ -1,6 +1,6 @@ +using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ModLoader; @@ -24,8 +24,8 @@ public override bool PreAI() { for (int i = 0; i < 10; i++) { - float x = projectile.Center.X - projectile.velocity.X / 10f * (float)i; - float y = projectile.Center.Y - projectile.velocity.Y / 10f * (float)i; + float x = projectile.Center.X - projectile.velocity.X / 10f * i; + float y = projectile.Center.Y - projectile.velocity.Y / 10f * i; int dust = Dust.NewDust(new Vector2(x, y), 1, 1, 57, 0f, 0f, 0, default(Color), 1f); Main.dust[dust].alpha = projectile.alpha; Main.dust[dust].position.X = x; @@ -71,9 +71,9 @@ public override void AI() { if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1)) { - float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2); - float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2); - float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); + float num476 = Main.npc[num475].position.X + Main.npc[num475].width / 2; + float num477 = Main.npc[num475].position.Y + Main.npc[num475].height / 2; + float num478 = Math.Abs(projectile.position.X + projectile.width / 2 - num476) + Math.Abs(projectile.position.Y + projectile.height / 2 - num477); if (num478 < num474) { num474 = num478; @@ -86,16 +86,15 @@ public override void AI() if (flag17) { float num483 = 10f; - Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + Vector2 vector35 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); float num484 = num472 - vector35.X; float num485 = num473 - vector35.Y; - float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485)); + float num486 = (float)Math.Sqrt(num484 * num484 + num485 * num485); num486 = num483 / num486; num484 *= num486; num485 *= num486; projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f; projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f; - return; } } @@ -109,9 +108,9 @@ public override void Kill(int timeLeft) int num = Dust.NewDust(projectile.position, projectile.width, projectile.height, 57, 0f, -2f, 0, default(Color), 2f); Main.dust[num].noGravity = true; Dust expr_62_cp_0 = Main.dust[num]; - expr_62_cp_0.position.X = expr_62_cp_0.position.X + ((float)(Main.rand.Next(-50, 51) / 20) - 1.5f); + expr_62_cp_0.position.X = expr_62_cp_0.position.X + (Main.rand.Next(-50, 51) / 20 - 1.5f); Dust expr_92_cp_0 = Main.dust[num]; - expr_92_cp_0.position.Y = expr_92_cp_0.position.Y + ((float)(Main.rand.Next(-50, 51) / 20) - 1.5f); + expr_92_cp_0.position.Y = expr_92_cp_0.position.Y + (Main.rand.Next(-50, 51) / 20 - 1.5f); if (Main.dust[num].position != projectile.Center) { Main.dust[num].velocity = projectile.DirectionTo(Main.dust[num].position) * 6f; diff --git a/NovaPillar/NovaFlask.cs b/NovaPillar/NovaFlask.cs index ad52284f..d04fa69f 100644 --- a/NovaPillar/NovaFlask.cs +++ b/NovaPillar/NovaFlask.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NovaPillar diff --git a/NovaPillar/NovaFlask_Proj.cs b/NovaPillar/NovaFlask_Proj.cs index 78222e10..3224377c 100644 --- a/NovaPillar/NovaFlask_Proj.cs +++ b/NovaPillar/NovaFlask_Proj.cs @@ -1,9 +1,9 @@ using System; +using System.Linq; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; -using System.Linq; using Terraria.ModLoader; namespace Tremor.NovaPillar @@ -17,7 +17,7 @@ public override void SetDefaults() projectile.friendly = true; projectile.aiStyle = 2; projectile.timeLeft = 1200; - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate = 3; } @@ -34,7 +34,7 @@ public override void SetDefaults() public override bool OnTileCollide(Vector2 oldVelocity) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate--; if (projectile.penetrate <= 0) @@ -72,7 +72,7 @@ public override void ModifyHitNPC(NPC target, ref int damage, ref float knockbac public override void AI() { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) { int[] array = new int[20]; int num428 = 0; @@ -82,9 +82,9 @@ public override void AI() { if (Main.npc[num430].CanBeChasedBy(projectile, false)) { - float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2); - float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2); - float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432); + float num431 = Main.npc[num430].position.X + Main.npc[num430].width / 2; + float num432 = Main.npc[num430].position.Y + Main.npc[num430].height / 2; + float num433 = Math.Abs(projectile.position.X + projectile.width / 2 - num431) + Math.Abs(projectile.position.Y + projectile.height / 2 - num432); if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1)) { if (num428 < 20) @@ -100,18 +100,18 @@ public override void AI() { int num434 = Main.rand.Next(num428); num434 = array[num434]; - float num435 = Main.npc[num434].position.X + (float)(Main.npc[num434].width / 2); - float num436 = Main.npc[num434].position.Y + (float)(Main.npc[num434].height / 2); + float num435 = Main.npc[num434].position.X + Main.npc[num434].width / 2; + float num436 = Main.npc[num434].position.Y + Main.npc[num434].height / 2; projectile.localAI[0] += 1f; if (projectile.localAI[0] > 8f) { projectile.localAI[0] = 0f; float num437 = 6f; - Vector2 value10 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + Vector2 value10 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); value10 += projectile.velocity * 4f; float num438 = num435 - value10.X; float num439 = num436 - value10.Y; - float num440 = (float)Math.Sqrt((double)(num438 * num438 + num439 * num439)); + float num440 = (float)Math.Sqrt(num438 * num438 + num439 * num439); num440 = num437 / num440; num438 *= num440; num439 *= num440; @@ -119,7 +119,6 @@ public override void AI() { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } - return; } } } @@ -138,15 +137,15 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(2, 3); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - int k = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("NovaFlask_ProjBall"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + int k = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("NovaFlask_ProjBall"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); Main.projectile[k].friendly = true; } } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) { for (int i = 0; i < 5; i++) { @@ -156,15 +155,15 @@ public override void Kill(int timeLeft) Main.projectile[a].friendly = true; } } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) { int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } diff --git a/NovaPillar/NovaFlask_ProjBall.cs b/NovaPillar/NovaFlask_ProjBall.cs index 52a31fcb..36e71d40 100644 --- a/NovaPillar/NovaFlask_ProjBall.cs +++ b/NovaPillar/NovaFlask_ProjBall.cs @@ -1,8 +1,8 @@ +using System.Linq; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using System.Linq; namespace Tremor.NovaPillar { @@ -17,7 +17,7 @@ public override void SetDefaults() projectile.width = 20; Main.projFrames[projectile.type] = 3; projectile.height = 20; - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.scale = 3f; } @@ -64,18 +64,18 @@ public override void Kill(int timeLeft) { Player player = Main.player[projectile.owner]; MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0, 0, mod.ProjectileType("NovaFlask_ProjFire"), (int)(projectile.damage - 30), 0, Main.myPlayer); - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0, 0, mod.ProjectileType("NovaFlask_ProjFire"), (int)(projectile.damage - 30), 0, Main.myPlayer); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0, 0, mod.ProjectileType("NovaFlask_ProjFire"), projectile.damage - 30, 0, Main.myPlayer); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0, 0, mod.ProjectileType("NovaFlask_ProjFire"), projectile.damage - 30, 0, Main.myPlayer); if (projectile.owner == Main.myPlayer) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1.5f, projectile.owner); Main.projectile[a].scale = 1.5f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -85,7 +85,7 @@ public override void Kill(int timeLeft) int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 32, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); int e = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 32, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -111,7 +111,7 @@ public override void Kill(int timeLeft) int m = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 70, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 0.5f, projectile.owner); Main.projectile[m].scale = 0.8f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 60, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -124,7 +124,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y - 40, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 70, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -137,13 +137,13 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 70, projectile.position.Y - 70, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); @@ -151,7 +151,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X - 50, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); @@ -161,7 +161,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X - 100, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -170,7 +170,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X - 20, projectile.position.Y, -5, 0, mod.ProjectileType("NovaSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -181,7 +181,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y + 10, -4, 0, mod.ProjectileType("NovaSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -194,7 +194,7 @@ public override void Kill(int timeLeft) int g = Projectile.NewProjectile(projectile.position.X - 70, projectile.position.Y + 15, -4, 0, mod.ProjectileType("NovaSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -214,7 +214,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -233,7 +233,7 @@ public override void Kill(int timeLeft) Main.projectile[h].scale = 1.2f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -260,7 +260,7 @@ public override void Kill(int timeLeft) Main.projectile[m].scale = 0.6f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -272,7 +272,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -295,7 +295,7 @@ public override void Kill(int timeLeft) Main.projectile[l].scale = 0.75f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -326,14 +326,14 @@ public override void Kill(int timeLeft) Main.projectile[p].scale = 0.7f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X - 30, projectile.position.Y, -2, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); Projectile.NewProjectile(projectile.position.X + 30, projectile.position.Y, +2, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y, -2, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); @@ -342,7 +342,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X + 60, projectile.position.Y, +3, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y, -2, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); @@ -353,7 +353,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X + 80, projectile.position.Y, +4, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 4, 0, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -366,7 +366,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 60, 0, 4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 6, 0, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -379,7 +379,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 60, 0, 6, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 8, 0, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); diff --git a/NovaPillar/NovaFlask_ProjFire.cs b/NovaPillar/NovaFlask_ProjFire.cs index 1e94b8c7..1bff5002 100644 --- a/NovaPillar/NovaFlask_ProjFire.cs +++ b/NovaPillar/NovaFlask_ProjFire.cs @@ -1,5 +1,5 @@ -using Microsoft.Xna.Framework; using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; @@ -43,7 +43,7 @@ public override bool PreAI() { projectile.frame = 0; } - float num2 = (float)Math.Sqrt((double)(projectile.velocity.X * projectile.velocity.X + projectile.velocity.Y * projectile.velocity.Y)); + float num2 = (float)Math.Sqrt(projectile.velocity.X * projectile.velocity.X + projectile.velocity.Y * projectile.velocity.Y); float num3 = projectile.localAI[0]; if (num3 == 0f) { @@ -59,12 +59,12 @@ public override bool PreAI() { for (int j = 0; j < 200; j++) { - if (Main.npc[j].CanBeChasedBy(this, false) && (projectile.ai[1] == 0f || projectile.ai[1] == (float)(j + 1))) + if (Main.npc[j].CanBeChasedBy(this, false) && (projectile.ai[1] == 0f || projectile.ai[1] == j + 1)) { - float num8 = Main.npc[j].position.X + (float)(Main.npc[j].width / 2); - float num9 = Main.npc[j].position.Y + (float)(Main.npc[j].height / 2); - float num10 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num8) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num9); - if (num10 < num6 && Collision.CanHit(new Vector2(projectile.position.X + (float)(projectile.width / 2), projectile.position.Y + (float)(projectile.height / 2)), 1, 1, Main.npc[j].position, Main.npc[j].width, Main.npc[j].height)) + float num8 = Main.npc[j].position.X + Main.npc[j].width / 2; + float num9 = Main.npc[j].position.Y + Main.npc[j].height / 2; + float num10 = Math.Abs(projectile.position.X + projectile.width / 2 - num8) + Math.Abs(projectile.position.Y + projectile.height / 2 - num9); + if (num10 < num6 && Collision.CanHit(new Vector2(projectile.position.X + projectile.width / 2, projectile.position.Y + projectile.height / 2), 1, 1, Main.npc[j].position, Main.npc[j].width, Main.npc[j].height)) { num6 = num10; num4 = num8; @@ -76,7 +76,7 @@ public override bool PreAI() } if (flag) { - projectile.ai[1] = (float)(num7 + 1); + projectile.ai[1] = num7 + 1; } flag = false; } @@ -85,14 +85,14 @@ public override bool PreAI() int num11 = (int)(projectile.ai[1] - 1f); if (Main.npc[num11].active && Main.npc[num11].CanBeChasedBy(this, true) && !Main.npc[num11].dontTakeDamage) { - float num12 = Main.npc[num11].position.X + (float)(Main.npc[num11].width / 2); - float num13 = Main.npc[num11].position.Y + (float)(Main.npc[num11].height / 2); - float num14 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num12) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num13); + float num12 = Main.npc[num11].position.X + Main.npc[num11].width / 2; + float num13 = Main.npc[num11].position.Y + Main.npc[num11].height / 2; + float num14 = Math.Abs(projectile.position.X + projectile.width / 2 - num12) + Math.Abs(projectile.position.Y + projectile.height / 2 - num13); if (num14 < 1000f) { flag = true; - num4 = Main.npc[num11].position.X + (float)(Main.npc[num11].width / 2); - num5 = Main.npc[num11].position.Y + (float)(Main.npc[num11].height / 2); + num4 = Main.npc[num11].position.X + Main.npc[num11].width / 2; + num5 = Main.npc[num11].position.Y + Main.npc[num11].height / 2; } } else @@ -107,16 +107,16 @@ public override bool PreAI() if (flag) { float num15 = num3; - Vector2 vector = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + Vector2 vector = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); float num16 = num4 - vector.X; float num17 = num5 - vector.Y; - float num18 = (float)Math.Sqrt((double)(num16 * num16 + num17 * num17)); + float num18 = (float)Math.Sqrt(num16 * num16 + num17 * num17); num18 = num15 / num18; num16 *= num18; num17 *= num18; int num19 = 8; - projectile.velocity.X = (projectile.velocity.X * (float)(num19 - 1) + num16) / (float)num19; - projectile.velocity.Y = (projectile.velocity.Y * (float)(num19 - 1) + num17) / (float)num19; + projectile.velocity.X = (projectile.velocity.X * (num19 - 1) + num16) / num19; + projectile.velocity.Y = (projectile.velocity.Y * (num19 - 1) + num17) / num19; } return false; } @@ -131,9 +131,9 @@ public override void Kill(int timeLeft) int num = Dust.NewDust(projectile.position, projectile.width, projectile.height, 57, 0f, -2f, 0, default(Color), 2f); Main.dust[num].noGravity = true; Dust expr_62_cp_0 = Main.dust[num]; - expr_62_cp_0.position.X = expr_62_cp_0.position.X + ((float)(Main.rand.Next(-50, 51) / 20) - 1.5f); + expr_62_cp_0.position.X = expr_62_cp_0.position.X + (Main.rand.Next(-50, 51) / 20 - 1.5f); Dust expr_92_cp_0 = Main.dust[num]; - expr_92_cp_0.position.Y = expr_92_cp_0.position.Y + ((float)(Main.rand.Next(-50, 51) / 20) - 1.5f); + expr_92_cp_0.position.Y = expr_92_cp_0.position.Y + (Main.rand.Next(-50, 51) / 20 - 1.5f); if (Main.dust[num].position != projectile.Center) { Main.dust[num].velocity = projectile.DirectionTo(Main.dust[num].position) * 6f; diff --git a/NovaPillar/NovaFlier.cs b/NovaPillar/NovaFlier.cs index a3101332..8e8a0967 100644 --- a/NovaPillar/NovaFlier.cs +++ b/NovaPillar/NovaFlier.cs @@ -16,14 +16,14 @@ public override void SetStaticDefaults() //Int variables int AnimationRate = 4; - int CountFrame = 0; + int CountFrame; int TimeToAnimation = 4; int Timer = 0; //Vanilla AI static int num1461 = 360; float num1453 = 7f; - float num1463 = 6.28318548f / (float)(num1461 / 2); + float num1463 = 6.28318548f / (num1461 / 2); int num1450 = 200; int num1472 = 0; bool flag128; @@ -48,14 +48,14 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void AI() { npc.spriteDirection = npc.direction; - this.NovaAnimation(); + NovaAnimation(); if (Main.time % 200 == 0) { Vector2 Velocity = Helper.VelocityToPoint(npc.Center, Helper.RandomPointInArea(new Vector2(Main.player[Main.myPlayer].Center.X - 10, Main.player[Main.myPlayer].Center.Y - 10), new Vector2(Main.player[Main.myPlayer].Center.X + 20, Main.player[Main.myPlayer].Center.Y + 20)), 7); @@ -94,12 +94,12 @@ public override void HitEffect(int hitDirection, double damage) void NovaAnimation() { - if (--this.TimeToAnimation <= 0) + if (--TimeToAnimation <= 0) { - if (++this.CountFrame > 4) - this.CountFrame = 1; - this.TimeToAnimation = this.AnimationRate; - npc.frame = this.GetFrame(this.CountFrame + 0); + if (++CountFrame > 4) + CountFrame = 1; + TimeToAnimation = AnimationRate; + npc.frame = GetFrame(CountFrame + 0); } } diff --git a/NovaPillar/NovaFlierProj.cs b/NovaPillar/NovaFlierProj.cs index 70d1901d..759ce52b 100644 --- a/NovaPillar/NovaFlierProj.cs +++ b/NovaPillar/NovaFlierProj.cs @@ -1,3 +1,4 @@ +using System; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; @@ -26,7 +27,7 @@ public override void SetDefaults() public override void AI() { - projectile.rotation = (float)System.Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + 1.57f; } @@ -38,10 +39,10 @@ public override void Kill(int timeLeft) } for (int k = 0; k < 5; k++) { - Vector2 Vector = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 Vector = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); Vector.Normalize(); - Vector *= (float)Main.rand.Next(10, 201) * 0.01f; - int i = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, Vector.X, Vector.Y, mod.ProjectileType("NovaAlchemistCloud"), 14, 1f, Main.myPlayer, 0f, (float)Main.rand.Next(-45, 1)); + Vector *= Main.rand.Next(10, 201) * 0.01f; + int i = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, Vector.X, Vector.Y, mod.ProjectileType("NovaAlchemistCloud"), 14, 1f, Main.myPlayer, 0f, Main.rand.Next(-45, 1)); Main.projectile[i].friendly = false; } } diff --git a/NovaPillar/NovaHandler.cs b/NovaPillar/NovaHandler.cs index 08c3c1a2..5a9c63ae 100644 --- a/NovaPillar/NovaHandler.cs +++ b/NovaPillar/NovaHandler.cs @@ -133,8 +133,8 @@ void MovePillar(int position, int whoAmI) if (whoAmI == -1) { whoAmI = NPC.NewNPC((int)spawnPos.X, (int)spawnPos.Y, mod.NPCType("NovaPillar")); - NovaHandler.TowerX = (int)spawnPos.X; - NovaHandler.TowerY = (int)spawnPos.Y; + TowerX = (int)spawnPos.X; + TowerY = (int)spawnPos.Y; } else { diff --git a/NovaPillar/NovaHelmet.cs b/NovaPillar/NovaHelmet.cs index 6b99797b..dba0e639 100644 --- a/NovaPillar/NovaHelmet.cs +++ b/NovaPillar/NovaHelmet.cs @@ -31,7 +31,7 @@ public override void UpdateEquip(Player player) player.GetModPlayer(mod).alchemistCrit += 12; player.GetModPlayer(mod).alchemistDamage += 0.12f; player.aggro += 10; - Lighting.AddLight((int)((player.position.X + (float)(player.width / 2)) / 16f), (int)((player.position.Y + (float)(player.height / 2)) / 16f), 0.8f, 0.7f, 0.3f); + Lighting.AddLight((int)((player.position.X + player.width / 2) / 16f), (int)((player.position.Y + player.height / 2) / 16f), 0.8f, 0.7f, 0.3f); } public override bool IsArmorSet(Item head, Item body, Item legs) diff --git a/NovaPillar/NovaLeggings.cs b/NovaPillar/NovaLeggings.cs index 2bb983ac..9ec54787 100644 --- a/NovaPillar/NovaLeggings.cs +++ b/NovaPillar/NovaLeggings.cs @@ -1,6 +1,6 @@ +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.NovaPillar { @@ -36,7 +36,7 @@ public override void UpdateEquip(Player player) player.GetModPlayer(mod).alchemistDamage += 0.18f; player.GetModPlayer(mod).alchemistCrit += 12; player.moveSpeed += 0.14f; - Lighting.AddLight((int)((player.position.X + (float)(player.width / 2)) / 16f), (int)((player.position.Y + (float)(player.height / 2)) / 16f), 0.8f, 0.7f, 0.3f); + Lighting.AddLight((int)((player.position.X + player.width / 2) / 16f), (int)((player.position.Y + player.height / 2) / 16f), 0.8f, 0.7f, 0.3f); } public override void AddRecipes() diff --git a/NovaPillar/NovaMonolith_Tile.cs b/NovaPillar/NovaMonolith_Tile.cs index 03d419c9..c0094d1c 100644 --- a/NovaPillar/NovaMonolith_Tile.cs +++ b/NovaPillar/NovaMonolith_Tile.cs @@ -16,7 +16,7 @@ public override void SetDefaults() TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); TileObjectData.newTile.Height = 3; TileObjectData.newTile.Origin = new Point16(1, 2); - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 18 }; + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16, 18 }; TileObjectData.addTile(Type); AddMapEntry(new Color(75, 139, 166)); dustType = 1; @@ -51,7 +51,7 @@ public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) Texture2D texture; if (Main.canDrawColorTile(i, j)) { - texture = Main.tileAltTexture[Type, (int)tile.color()]; + texture = Main.tileAltTexture[Type, tile.color()]; } else { diff --git a/NovaPillar/NovaPillar.cs b/NovaPillar/NovaPillar.cs index 2955b794..1dddac3c 100644 --- a/NovaPillar/NovaPillar.cs +++ b/NovaPillar/NovaPillar.cs @@ -38,11 +38,11 @@ public override void SetDefaults() music = MusicID.TheTowers; } - int Timer = 0; + int Timer; public override void AI() { - this.Timer++; - if (this.Timer % 150 == 0) + Timer++; + if (Timer % 150 == 0) { if (Main.player[npc.target].GetModPlayer(mod).ZoneTowerNova) { @@ -68,7 +68,7 @@ public override void AI() if (Main.rand.Next(5) == 0) { Dust dust21 = Main.dust[Dust.NewDust(npc.Left, npc.width, npc.height / 2, 241, 0f, 0f, 0, default(Color), 1f)]; - dust21.position = npc.Center + Vector2.UnitY.RotatedByRandom(2.0943951606750488) * new Vector2((float)(npc.width / 2), (float)(npc.height / 2)) * (0.8f + Main.rand.NextFloat() * 0.2f); + dust21.position = npc.Center + Vector2.UnitY.RotatedByRandom(2.0943951606750488) * new Vector2(npc.width / 2, npc.height / 2) * (0.8f + Main.rand.NextFloat() * 0.2f); dust21.velocity.X = 0f; dust21.velocity.Y = Math.Abs(dust21.velocity.Y) * 0.25f; } @@ -76,12 +76,12 @@ public override void AI() { if (Main.rand.Next(5) == 0) { - Dust dust22 = Main.dust[Dust.NewDust(npc.Top + new Vector2((float)(-(float)npc.width) * (0.33f - 0.11f * (float)num1940), -20f), (int)((float)npc.width * (0.66f - 0.22f * (float)num1940)), 20, 135, 0f, 0f, 0, default(Color), 1f)]; + Dust dust22 = Main.dust[Dust.NewDust(npc.Top + new Vector2(-(float)npc.width * (0.33f - 0.11f * num1940), -20f), (int)(npc.width * (0.66f - 0.22f * num1940)), 20, 135, 0f, 0f, 0, default(Color), 1f)]; dust22.velocity.X = 0f; - dust22.velocity.Y = -Math.Abs(dust22.velocity.Y - (float)num1940 + npc.velocity.Y - 4f) * 1f; + dust22.velocity.Y = -Math.Abs(dust22.velocity.Y - num1940 + npc.velocity.Y - 4f) * 1f; dust22.noGravity = true; dust22.fadeIn = 1f; - dust22.scale = 1f + Main.rand.NextFloat() + (float)num1940 * 0.3f; + dust22.scale = 1f + Main.rand.NextFloat() + num1940 * 0.3f; } } if (npc.ai[2] == 1f) @@ -107,12 +107,12 @@ public override void AI() for (int i = 0; i < 3; i++) { Dust dust4 = Main.dust[Dust.NewDust(npc.Left, npc.width, npc.height / 2, dustID)]; - dust4.position = npc.Center + Vector2.UnitY.RotatedByRandom(4.1887903213500977) * new Vector2((float)npc.width * 1.5f, (float)npc.height * 1.1f) * 0.8f * (0.8f + Main.rand.NextFloat() * 0.2f); + dust4.position = npc.Center + Vector2.UnitY.RotatedByRandom(4.1887903213500977) * new Vector2(npc.width * 1.5f, npc.height * 1.1f) * 0.8f * (0.8f + Main.rand.NextFloat() * 0.2f); dust4.velocity.X = 0f; - dust4.velocity.Y = -Math.Abs(dust4.velocity.Y - (float)i + npc.velocity.Y - 4f) * 3f; + dust4.velocity.Y = -Math.Abs(dust4.velocity.Y - i + npc.velocity.Y - 4f) * 3f; dust4.noGravity = true; dust4.fadeIn = 1f; - dust4.scale = 1f + Main.rand.NextFloat() + (float)i * 0.3f; + dust4.scale = 1f + Main.rand.NextFloat() + i * 0.3f; } } if (npc.ai[1] < 150f) @@ -121,12 +121,12 @@ public override void AI() { if (Main.rand.Next(4) == 0) { - Dust dust5 = Main.dust[Dust.NewDust(npc.Top + new Vector2((float)(-(float)npc.width) * (0.33f - 0.11f * (float)num1362), -20f), (int)((float)npc.width * (0.66f - 0.22f * (float)num1362)), 20, dustID)]; + Dust dust5 = Main.dust[Dust.NewDust(npc.Top + new Vector2(-(float)npc.width * (0.33f - 0.11f * num1362), -20f), (int)(npc.width * (0.66f - 0.22f * num1362)), 20, dustID)]; dust5.velocity.X = 0f; - dust5.velocity.Y = -Math.Abs(dust5.velocity.Y - (float)num1362 + npc.velocity.Y - 4f) * (1f + npc.ai[1] / 180f * 0.5f); + dust5.velocity.Y = -Math.Abs(dust5.velocity.Y - num1362 + npc.velocity.Y - 4f) * (1f + npc.ai[1] / 180f * 0.5f); dust5.noGravity = true; dust5.fadeIn = 1f; - dust5.scale = 1f + Main.rand.NextFloat() + (float)num1362 * 0.3f; + dust5.scale = 1f + Main.rand.NextFloat() + num1362 * 0.3f; } } } @@ -134,7 +134,7 @@ public override void AI() { for (int i = 0; i < 3; i++) { - Vector2 position6 = npc.Center + Vector2.UnitY.RotatedByRandom(4.1887903213500977) * new Vector2((float)npc.width, (float)npc.height) * 0.7f * Main.rand.NextFloat(); + Vector2 position6 = npc.Center + Vector2.UnitY.RotatedByRandom(4.1887903213500977) * new Vector2(npc.width, npc.height) * 0.7f * Main.rand.NextFloat(); float num1364 = 1f + Main.rand.NextFloat() * 2f + npc.ai[1] / 180f * 4f; for (int num1365 = 0; num1365 < 6; num1365++) { @@ -145,15 +145,15 @@ public override void AI() dust6.velocity.Y = -Math.Abs(dust6.velocity.Y) * num1364; dust6.noGravity = true; dust6.fadeIn = 1f; - dust6.scale = 1.5f + Main.rand.NextFloat() + (float)num1365 * 0.13f; + dust6.scale = 1.5f + Main.rand.NextFloat() + num1365 * 0.13f; } - Main.PlaySound(3, position6, Utils.SelectRandom(Main.rand, new[] { 1, 18 })); + Main.PlaySound(3, position6, Utils.SelectRandom(Main.rand, 1, 18)); } } if (Main.rand.Next(3) != 0 && npc.ai[1] < 150f) { Dust dust7 = Main.dust[Dust.NewDust(npc.Left, npc.width, npc.height / 2, DustID.MarblePot)]; - dust7.position = npc.Center + Vector2.UnitY.RotatedByRandom(4.1887903213500977) * new Vector2((float)(npc.width / 2), (float)(npc.height / 2)) * (0.8f + Main.rand.NextFloat() * 0.2f); + dust7.position = npc.Center + Vector2.UnitY.RotatedByRandom(4.1887903213500977) * new Vector2(npc.width / 2, npc.height / 2) * (0.8f + Main.rand.NextFloat() * 0.2f); dust7.velocity.X = 0f; dust7.velocity.Y = Math.Abs(dust7.velocity.Y) * 0.25f; } @@ -171,7 +171,6 @@ public override void AI() npc.checkDead(); } } - return; } } @@ -230,7 +229,7 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) { TremorUtils.DrawNPCGlowMask(spriteBatch, npc, mod.GetTexture("NovaPillar/NovaPillar_GlowMask")); - float num88 = (float)NovaHandler.ShieldStrength / (float)NPC.ShieldStrengthTowerMax; + float num88 = NovaHandler.ShieldStrength / (float)NPC.ShieldStrengthTowerMax; if (NovaHandler.ShieldStrength > 0) { Main.spriteBatch.End(); @@ -245,7 +244,7 @@ public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) Filters.Scene["Tremor:Nova"].GetShader().UseIntensity(1f + num89).UseProgress(0f); DrawData drawData = new DrawData(TextureManager.Load("Images/Misc/Perlin"), center - new Vector2(0, 10), new Rectangle(0, 0, 600, 600), Color.White * (num88 * 0.8f + 0.2f), npc.rotation, new Vector2(300f, 300f), npc.scale * (1f + num89 * 0.05f), SpriteEffects.None, 0); GameShaders.Misc["ForceField"].UseColor(new Vector3(1f + num89 * 0.5f)); - GameShaders.Misc["ForceField"].Apply(new DrawData?(drawData)); + GameShaders.Misc["ForceField"].Apply(drawData); drawData.Draw(Main.spriteBatch); Main.spriteBatch.End(); Main.spriteBatch.Begin(); @@ -259,9 +258,9 @@ public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) float num90 = npc.ai[3] / 120f; float num91 = Math.Min(npc.ai[3] / 30f, 1f); Filters.Scene["Tremor:Nova"].GetShader().UseIntensity(Math.Min(5f, 15f * num90) + 1f).UseProgress(num90); - DrawData drawData = new DrawData(TextureManager.Load("Images/Misc/Perlin"), center - new Vector2(0, 10), new Rectangle(0, 0, 600, 600), new Color(new Vector4(1f - (float)Math.Sqrt((double)num91))), npc.rotation, new Vector2(300f, 300f), npc.scale * (1f + num91), SpriteEffects.None, 0); + DrawData drawData = new DrawData(TextureManager.Load("Images/Misc/Perlin"), center - new Vector2(0, 10), new Rectangle(0, 0, 600, 600), new Color(new Vector4(1f - (float)Math.Sqrt(num91))), npc.rotation, new Vector2(300f, 300f), npc.scale * (1f + num91), SpriteEffects.None, 0); GameShaders.Misc["ForceField"].UseColor(new Vector3(2f)); - GameShaders.Misc["ForceField"].Apply(new DrawData?(drawData)); + GameShaders.Misc["ForceField"].Apply(drawData); drawData.Draw(Main.spriteBatch); Main.spriteBatch.End(); Main.spriteBatch.Begin(); diff --git a/NovaPillar/NovaSky.cs b/NovaPillar/NovaSky.cs index b8c7b3cc..ce25d9cd 100644 --- a/NovaPillar/NovaSky.cs +++ b/NovaPillar/NovaSky.cs @@ -18,13 +18,13 @@ private struct Star public float AlphaFrequency; public float AlphaAmplitude; } - private NovaSky.Star[] _stars; + private Star[] _stars; private Random _random = new Random(); public static Texture2D PlanetTexture; private Texture2D[] _starTextures; public static Texture2D BGTexture; - bool Active = false; - float Intensity = 0f; + bool Active; + float Intensity; public override void Update(GameTime gameTime) { @@ -38,10 +38,10 @@ public override void Update(GameTime gameTime) public override void OnLoad() { - this._starTextures = new Texture2D[3]; - for (int i = 0; i < this._starTextures.Length; i++) + _starTextures = new Texture2D[3]; + for (int i = 0; i < _starTextures.Length; i++) { - this._starTextures[i] = ModLoader.GetMod("Tremor").GetTexture("NovaPillar/NovaSoul " + i); + _starTextures[i] = ModLoader.GetMod("Tremor").GetTexture("NovaPillar/NovaSoul " + i); } } @@ -66,9 +66,9 @@ public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDept } int num = -1; int num2 = 0; - for (int i = 0; i < this._stars.Length; i++) + for (int i = 0; i < _stars.Length; i++) { - float depth = this._stars[i].Depth; + float depth = _stars[i].Depth; if (num == -1 && depth < maxDepth) { num = i; @@ -84,19 +84,19 @@ public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDept return; } float scale = Math.Min(1f, (Main.screenPosition.Y - 1000f) / 1000f); - Vector2 value3 = Main.screenPosition + new Vector2((float)(Main.screenWidth >> 1), (float)(Main.screenHeight >> 1)); + Vector2 value3 = Main.screenPosition + new Vector2(Main.screenWidth >> 1, Main.screenHeight >> 1); Rectangle rectangle = new Rectangle(-1000, -1000, 4000, 4000); for (int j = num; j < num2; j++) { - Vector2 value4 = new Vector2(1f / this._stars[j].Depth, 1.1f / this._stars[j].Depth); - Vector2 position = (this._stars[j].Position - value3) * value4 + value3 - Main.screenPosition; + Vector2 value4 = new Vector2(1f / _stars[j].Depth, 1.1f / _stars[j].Depth); + Vector2 position = (_stars[j].Position - value3) * value4 + value3 - Main.screenPosition; if (rectangle.Contains((int)position.X, (int)position.Y)) { - float num3 = (float)Math.Sin((double)(this._stars[j].AlphaFrequency * Main.GlobalTime + this._stars[j].SinOffset)) * this._stars[j].AlphaAmplitude + this._stars[j].AlphaAmplitude; - float num4 = (float)Math.Sin((double)(this._stars[j].AlphaFrequency * Main.GlobalTime * 5f + this._stars[j].SinOffset)) * 0.1f - 0.1f; + float num3 = (float)Math.Sin(_stars[j].AlphaFrequency * Main.GlobalTime + _stars[j].SinOffset) * _stars[j].AlphaAmplitude + _stars[j].AlphaAmplitude; + float num4 = (float)Math.Sin(_stars[j].AlphaFrequency * Main.GlobalTime * 5f + _stars[j].SinOffset) * 0.1f - 0.1f; num3 = MathHelper.Clamp(num3, 0f, 1f); - Texture2D texture2D = this._starTextures[this._stars[j].TextureIndex]; - spriteBatch.Draw(texture2D, position, null, Color.White * scale * num3 * 0.8f * (1f - num4) * Intensity, 0f, new Vector2((float)(texture2D.Width >> 1), (float)(texture2D.Height >> 1)), (value4.X * 0.5f + 0.5f) * (num3 * 0.3f + 0.7f), SpriteEffects.None, 0f); + Texture2D texture2D = _starTextures[_stars[j].TextureIndex]; + spriteBatch.Draw(texture2D, position, null, Color.White * scale * num3 * 0.8f * (1f - num4) * Intensity, 0f, new Vector2(texture2D.Width >> 1, texture2D.Height >> 1), (value4.X * 0.5f + 0.5f) * (num3 * 0.3f + 0.7f), SpriteEffects.None, 0f); } } } @@ -110,30 +110,30 @@ public override void Activate(Vector2 position, params object[] args) { int num = 200; int num2 = 10; - this._stars = new NovaSky.Star[num * num2]; + _stars = new Star[num * num2]; int num3 = 0; for (int i = 0; i < num; i++) { - float num4 = (float)i / (float)num; + float num4 = i / (float)num; for (int j = 0; j < num2; j++) { - float num5 = (float)j / (float)num2; - this._stars[num3].Position.X = num4 * (float)Main.maxTilesX * 16f; - this._stars[num3].Position.Y = num5 * ((float)Main.worldSurface * 16f + 2000f) - 1000f; - this._stars[num3].Depth = Main.rand.NextFloat() * 8f + 1.5f; - this._stars[num3].TextureIndex = Main.rand.Next(this._starTextures.Length); - this._stars[num3].SinOffset = Main.rand.NextFloat() * 6.28f; - this._stars[num3].AlphaAmplitude = Main.rand.NextFloat() * 5f; - this._stars[num3].AlphaFrequency = Main.rand.NextFloat() + 1f; + float num5 = j / (float)num2; + _stars[num3].Position.X = num4 * Main.maxTilesX * 16f; + _stars[num3].Position.Y = num5 * ((float)Main.worldSurface * 16f + 2000f) - 1000f; + _stars[num3].Depth = Main.rand.NextFloat() * 8f + 1.5f; + _stars[num3].TextureIndex = Main.rand.Next(_starTextures.Length); + _stars[num3].SinOffset = Main.rand.NextFloat() * 6.28f; + _stars[num3].AlphaAmplitude = Main.rand.NextFloat() * 5f; + _stars[num3].AlphaFrequency = Main.rand.NextFloat() + 1f; num3++; } } - Array.Sort(this._stars, new Comparison(this.SortMethod)); + Array.Sort(_stars, SortMethod); Active = true; } - private int SortMethod(NovaSky.Star meteor1, NovaSky.Star meteor2) + private int SortMethod(Star meteor1, Star meteor2) { return meteor2.Depth.CompareTo(meteor1.Depth); } diff --git a/NovaPillar/NovaSprayer.cs b/NovaPillar/NovaSprayer.cs index ddf57130..7b5d655b 100644 --- a/NovaPillar/NovaSprayer.cs +++ b/NovaPillar/NovaSprayer.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NovaPillar @@ -65,7 +65,7 @@ public override void UpdateInventory(Player player) } } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { MPlayer modPlayer = player.GetModPlayer(mod); if (modPlayer.glove) diff --git a/NovaPillar/Varki.cs b/NovaPillar/Varki.cs index d49b837a..32e28bd0 100644 --- a/NovaPillar/Varki.cs +++ b/NovaPillar/Varki.cs @@ -1,7 +1,7 @@ -using Terraria.ID; -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.NovaPillar @@ -16,9 +16,9 @@ public override void SetStaticDefaults() //Int variables int AnimationRate = 4; - int CountFrame = 0; + int CountFrame; int TimeToAnimation = 4; - int Timer = 0; + int Timer; public override void SetDefaults() { npc.lifeMax = 750; @@ -36,19 +36,19 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void AI() { npc.spriteDirection = npc.direction; - this.Timer++; - if (this.Timer == 2000) + Timer++; + if (Timer == 2000) { npc.Transform(mod.NPCType("Youwarkee2")); } - this.NovaAnimation(); + NovaAnimation(); } public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) @@ -78,10 +78,10 @@ public override void HitEffect(int hitDirection, double damage) Gore.NewGore(npc.Top, npc.velocity * hitDirection, mod.GetGoreSlot("Gores/VarkiGore3")); for (int k = 0; k < 7; k++) { - Vector2 Vector = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 Vector = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); Vector.Normalize(); - Vector *= (float)Main.rand.Next(10, 201) * 0.01f; - int i = Projectile.NewProjectile(npc.position.X, npc.position.Y, Vector.X, Vector.Y, mod.ProjectileType("NovaAlchemistCloud"), 20, 1f, Main.myPlayer, 0f, (float)Main.rand.Next(-45, 1)); + Vector *= Main.rand.Next(10, 201) * 0.01f; + int i = Projectile.NewProjectile(npc.position.X, npc.position.Y, Vector.X, Vector.Y, mod.ProjectileType("NovaAlchemistCloud"), 20, 1f, Main.myPlayer, 0f, Main.rand.Next(-45, 1)); Main.projectile[i].friendly = false; } } @@ -89,12 +89,12 @@ public override void HitEffect(int hitDirection, double damage) void NovaAnimation() { - if (--this.TimeToAnimation <= 0) + if (--TimeToAnimation <= 0) { - if (++this.CountFrame > 2) - this.CountFrame = 1; - this.TimeToAnimation = this.AnimationRate; - npc.frame = this.GetFrame(this.CountFrame + 0); + if (++CountFrame > 2) + CountFrame = 1; + TimeToAnimation = AnimationRate; + npc.frame = GetFrame(CountFrame + 0); } } diff --git a/NovaPillar/Youwarkee.cs b/NovaPillar/Youwarkee.cs index 6ee2ef3b..7cb97d24 100644 --- a/NovaPillar/Youwarkee.cs +++ b/NovaPillar/Youwarkee.cs @@ -17,9 +17,9 @@ public override void SetStaticDefaults() //Int variables int AnimationRate = 4; - int CountFrame = 0; + int CountFrame; int TimeToAnimation = 4; - int Timer = 0; + int Timer; public override void SetDefaults() { npc.lifeMax = 1750; @@ -38,19 +38,19 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } const float Speed = 4f; const float Acceleration = 0.27f; - int k = 0; + int k; public override void AI() { - Vector2 StartPosition = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float DirectionX = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - StartPosition.X; - float DirectionY = (float)(Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - 120) - StartPosition.Y; + Vector2 StartPosition = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + float DirectionX = Main.player[npc.target].position.X + Main.player[npc.target].width / 2 - StartPosition.X; + float DirectionY = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - 120 - StartPosition.Y; float Length = (float)Math.Sqrt(DirectionX * DirectionX + DirectionY * DirectionY); float Num = Speed / Length; DirectionX = DirectionX * Num; @@ -87,17 +87,17 @@ public override void AI() npc.velocity.Y = (float)(Math.Sin(AndasRotation) * 15) * -1; npc.netUpdate = true; } - this.Timer++; - if (this.Timer >= 700) + Timer++; + if (Timer >= 700) { - this.Timer = 0; + Timer = 0; } - if (NPC.CountNPCS(k) < 3 && this.Timer % 200 == 0) + if (NPC.CountNPCS(k) < 3 && Timer % 200 == 0) { k = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("Varki"), 0, npc.whoAmI, 0, 200); } npc.rotation = npc.velocity.X * 0.1f; - this.NovaAnimation(); + NovaAnimation(); } public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) @@ -131,12 +131,12 @@ public override void HitEffect(int hitDirection, double damage) void NovaAnimation() { - if (--this.TimeToAnimation <= 0) + if (--TimeToAnimation <= 0) { - if (++this.CountFrame > 4) - this.CountFrame = 1; - this.TimeToAnimation = this.AnimationRate; - npc.frame = this.GetFrame(this.CountFrame + 0); + if (++CountFrame > 4) + CountFrame = 1; + TimeToAnimation = AnimationRate; + npc.frame = GetFrame(CountFrame + 0); } } diff --git a/NovaPillar/Youwarkee2.cs b/NovaPillar/Youwarkee2.cs index 3666399b..1e67f687 100644 --- a/NovaPillar/Youwarkee2.cs +++ b/NovaPillar/Youwarkee2.cs @@ -17,9 +17,9 @@ public override void SetStaticDefaults() //Int variables int AnimationRate = 4; - int CountFrame = 0; + int CountFrame; int TimeToAnimation = 4; - int Timer = 0; + int Timer; public override void SetDefaults() { npc.lifeMax = 2000; @@ -38,8 +38,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } const float Speed = 4f; @@ -48,9 +48,9 @@ public override void ScaleExpertStats(int numPlayers, float bossLifeScale) int k = 0; public override void AI() { - Vector2 StartPosition = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float DirectionX = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - StartPosition.X; - float DirectionY = (float)(Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - 120) - StartPosition.Y; + Vector2 StartPosition = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + float DirectionX = Main.player[npc.target].position.X + Main.player[npc.target].width / 2 - StartPosition.X; + float DirectionY = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - 120 - StartPosition.Y; float Length = (float)Math.Sqrt(DirectionX * DirectionX + DirectionY * DirectionY); float Num = Speed / Length; DirectionX = DirectionX * Num; @@ -87,13 +87,13 @@ public override void AI() npc.velocity.Y = (float)(Math.Sin(AndasRotation) * 15) * -1; npc.netUpdate = true; } - this.Timer++; - if (this.Timer >= 700) + Timer++; + if (Timer >= 700) { - this.Timer = 0; + Timer = 0; } npc.rotation = npc.velocity.X * 0.1f; - this.NovaAnimation(); + NovaAnimation(); } public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) @@ -127,12 +127,12 @@ public override void HitEffect(int hitDirection, double damage) void NovaAnimation() { - if (--this.TimeToAnimation <= 0) + if (--TimeToAnimation <= 0) { - if (++this.CountFrame > 4) - this.CountFrame = 1; - this.TimeToAnimation = this.AnimationRate; - npc.frame = this.GetFrame(this.CountFrame + 0); + if (++CountFrame > 4) + CountFrame = 1; + TimeToAnimation = AnimationRate; + npc.frame = GetFrame(CountFrame + 0); } } diff --git a/PiggyBank.cs b/PiggyBank.cs index 553c3f0c..181ad34e 100644 --- a/PiggyBank.cs +++ b/PiggyBank.cs @@ -1,8 +1,8 @@ using System.Collections.Generic; -using Terraria; -using Terraria.ModLoader; using System.Linq; +using Terraria; using Terraria.ID; +using Terraria.ModLoader; namespace Tremor { @@ -30,8 +30,7 @@ public int GetSimilarItemsStack(Item item, Item[] inventory) public override void ModifyTooltips(Item item, List tooltips) { Player player = Main.player[Main.myPlayer]; - int[] coins = new int[] - { + int[] coins = { ItemID.CopperCoin, ItemID.SilverCoin, ItemID.GoldCoin, diff --git a/Projectiles/AdamantiteBolt.cs b/Projectiles/AdamantiteBolt.cs index 7e9130b2..eab80243 100644 --- a/Projectiles/AdamantiteBolt.cs +++ b/Projectiles/AdamantiteBolt.cs @@ -55,7 +55,6 @@ public override void AI() if (projectile.wet && !projectile.lavaWet) { projectile.Kill(); - return; } } } @@ -72,10 +71,10 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("AdamantiteCloud"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("AdamantiteCloud"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } diff --git a/Projectiles/Alchemic/AlchemicBubbleZellarium.cs b/Projectiles/Alchemic/AlchemicBubbleZellarium.cs index 78c5a625..f76804f8 100644 --- a/Projectiles/Alchemic/AlchemicBubbleZellarium.cs +++ b/Projectiles/Alchemic/AlchemicBubbleZellarium.cs @@ -30,7 +30,7 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) for (int k = 0; k < projectile.oldPos.Length; k++) { Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); - Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); + Color color = projectile.GetAlpha(lightColor) * ((projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); } return true; @@ -52,10 +52,10 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(1, 3); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("ZellariumCloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("ZellariumCloudPro"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } diff --git a/Projectiles/Alchemic/BasicFlaskPro.cs b/Projectiles/Alchemic/BasicFlaskPro.cs index 4cd020a3..07a63e34 100644 --- a/Projectiles/Alchemic/BasicFlaskPro.cs +++ b/Projectiles/Alchemic/BasicFlaskPro.cs @@ -1,8 +1,8 @@ using System; +using System.Linq; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; -using System.Linq; using Terraria.ModLoader; namespace Tremor.Projectiles.Alchemic @@ -16,7 +16,7 @@ public override void SetDefaults() projectile.friendly = true; projectile.aiStyle = 2; projectile.penetrate = 1; - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate = 3; } @@ -31,7 +31,7 @@ public override void SetDefaults() public override void AI() { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) { int[] array = new int[20]; int num428 = 0; @@ -41,9 +41,9 @@ public override void AI() { if (Main.npc[num430].CanBeChasedBy(projectile, false)) { - float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2); - float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2); - float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432); + float num431 = Main.npc[num430].position.X + Main.npc[num430].width / 2; + float num432 = Main.npc[num430].position.Y + Main.npc[num430].height / 2; + float num433 = Math.Abs(projectile.position.X + projectile.width / 2 - num431) + Math.Abs(projectile.position.Y + projectile.height / 2 - num432); if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1)) { if (num428 < 20) @@ -59,18 +59,18 @@ public override void AI() { int num434 = Main.rand.Next(num428); num434 = array[num434]; - float num435 = Main.npc[num434].position.X + (float)(Main.npc[num434].width / 2); - float num436 = Main.npc[num434].position.Y + (float)(Main.npc[num434].height / 2); + float num435 = Main.npc[num434].position.X + Main.npc[num434].width / 2; + float num436 = Main.npc[num434].position.Y + Main.npc[num434].height / 2; projectile.localAI[0] += 1f; if (projectile.localAI[0] > 8f) { projectile.localAI[0] = 0f; float num437 = 6f; - Vector2 value10 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + Vector2 value10 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); value10 += projectile.velocity * 4f; float num438 = num435 - value10.X; float num439 = num436 - value10.Y; - float num440 = (float)Math.Sqrt((double)(num438 * num438 + num439 * num439)); + float num440 = (float)Math.Sqrt(num438 * num438 + num439 * num439); num440 = num437 / num440; num438 *= num440; num439 *= num440; @@ -78,7 +78,6 @@ public override void AI() { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } - return; } } } @@ -96,7 +95,7 @@ public override void ModifyHitNPC(NPC target, ref int damage, ref float knockbac public override bool OnTileCollide(Vector2 oldVelocity) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate--; if (projectile.penetrate <= 0) @@ -139,13 +138,13 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("CloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("CloudPro"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) { for (int i = 0; i < 5; i++) { @@ -155,33 +154,33 @@ public override void Kill(int timeLeft) Main.projectile[a].friendly = true; } } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) { int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } if (projectile.owner == Main.myPlayer) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) { int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); int b = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BasicBlast"), projectile.damage * 2, 1.5f, projectile.owner); Main.projectile[a].scale = 1.5f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BasicBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -191,7 +190,7 @@ public override void Kill(int timeLeft) int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 32, 0, 0, mod.ProjectileType("BasicBlast"), projectile.damage * 2, 1f, projectile.owner); int e = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 32, 0, 0, mod.ProjectileType("BasicBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BasicBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -217,7 +216,7 @@ public override void Kill(int timeLeft) int m = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 70, 0, 0, mod.ProjectileType("BasicBlast"), projectile.damage * 2, 0.5f, projectile.owner); Main.projectile[m].scale = 0.8f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 60, projectile.position.Y, 0, 0, mod.ProjectileType("BasicBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -230,7 +229,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y - 40, 0, 0, mod.ProjectileType("BasicBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 70, projectile.position.Y, 0, 0, mod.ProjectileType("BasicBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -243,13 +242,13 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 70, projectile.position.Y - 70, 0, 0, mod.ProjectileType("BasicBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BasicBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BasicBurst"), projectile.damage, 1f, projectile.owner); @@ -257,7 +256,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-50, projectile.position.Y, 0, 0, mod.ProjectileType("BasicBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BasicBurst"), projectile.damage, 1f, projectile.owner); @@ -267,7 +266,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-100, projectile.position.Y, 0, 0, mod.ProjectileType("BasicBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BasicBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -276,7 +275,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-20, projectile.position.Y, -5, 0, mod.ProjectileType("BasicSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BasicBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -287,7 +286,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y+10, -4, 0, mod.ProjectileType("BasicSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BasicBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -300,7 +299,7 @@ public override void Kill(int timeLeft) int g = Projectile.NewProjectile(projectile.position.X-70, projectile.position.Y+15, -4, 0, mod.ProjectileType("BasicSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BasicBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -320,7 +319,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BasicBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -339,7 +338,7 @@ public override void Kill(int timeLeft) Main.projectile[h].scale = 1.2f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BasicBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -366,7 +365,7 @@ public override void Kill(int timeLeft) Main.projectile[m].scale = 0.6f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BasicBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -378,7 +377,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BasicBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -401,7 +400,7 @@ public override void Kill(int timeLeft) Main.projectile[l].scale = 0.75f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BasicBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -432,14 +431,14 @@ public override void Kill(int timeLeft) Main.projectile[p].scale = 0.7f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-30, projectile.position.Y, -2, 0, mod.ProjectileType("BasicBurst"), projectile.damage, 1f, projectile.owner); Projectile.NewProjectile(projectile.position.X+30, projectile.position.Y, +2, 0, mod.ProjectileType("BasicBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("BasicBurst"), projectile.damage, 1f, projectile.owner); @@ -448,7 +447,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+60, projectile.position.Y, +3, 0, mod.ProjectileType("BasicBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("BasicBurst"), projectile.damage, 1f, projectile.owner); @@ -459,7 +458,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+80, projectile.position.Y, +4, 0, mod.ProjectileType("BasicBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 4, 0, mod.ProjectileType("BasicSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -472,7 +471,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 4, mod.ProjectileType("BasicSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 6, 0, mod.ProjectileType("BasicSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -485,7 +484,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 6, mod.ProjectileType("BasicSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 8, 0, mod.ProjectileType("BasicSkullburst"), projectile.damage * 1, 1f, projectile.owner); diff --git a/Projectiles/Alchemic/BigHealingFlackPro.cs b/Projectiles/Alchemic/BigHealingFlackPro.cs index bea2619c..a92c525c 100644 --- a/Projectiles/Alchemic/BigHealingFlackPro.cs +++ b/Projectiles/Alchemic/BigHealingFlackPro.cs @@ -1,9 +1,9 @@ using System; +using System.Linq; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using System.Linq; namespace Tremor.Projectiles.Alchemic { public class BigHealingFlackPro : ModProjectile @@ -16,7 +16,7 @@ public override void SetDefaults() projectile.aiStyle = 2; projectile.timeLeft = 1200; projectile.penetrate = 1; - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate = 3; } @@ -28,7 +28,7 @@ public override void SetDefaults() public override void AI() { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) { int[] array = new int[20]; int num428 = 0; @@ -38,9 +38,9 @@ public override void AI() { if (Main.npc[num430].CanBeChasedBy(projectile, false)) { - float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2); - float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2); - float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432); + float num431 = Main.npc[num430].position.X + Main.npc[num430].width / 2; + float num432 = Main.npc[num430].position.Y + Main.npc[num430].height / 2; + float num433 = Math.Abs(projectile.position.X + projectile.width / 2 - num431) + Math.Abs(projectile.position.Y + projectile.height / 2 - num432); if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1)) { if (num428 < 20) @@ -56,18 +56,18 @@ public override void AI() { int num434 = Main.rand.Next(num428); num434 = array[num434]; - float num435 = Main.npc[num434].position.X + (float)(Main.npc[num434].width / 2); - float num436 = Main.npc[num434].position.Y + (float)(Main.npc[num434].height / 2); + float num435 = Main.npc[num434].position.X + Main.npc[num434].width / 2; + float num436 = Main.npc[num434].position.Y + Main.npc[num434].height / 2; projectile.localAI[0] += 1f; if (projectile.localAI[0] > 8f) { projectile.localAI[0] = 0f; float num437 = 6f; - Vector2 value10 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + Vector2 value10 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); value10 += projectile.velocity * 4f; float num438 = num435 - value10.X; float num439 = num436 - value10.Y; - float num440 = (float)Math.Sqrt((double)(num438 * num438 + num439 * num439)); + float num440 = (float)Math.Sqrt(num438 * num438 + num439 * num439); num440 = num437 / num440; num438 *= num440; num439 *= num440; @@ -75,7 +75,6 @@ public override void AI() { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } - return; } } } @@ -92,7 +91,7 @@ public override void ModifyHitNPC(NPC target, ref int damage, ref float knockbac public override bool OnTileCollide(Vector2 oldVelocity) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate--; if (projectile.penetrate <= 0) @@ -123,7 +122,7 @@ public override bool OnTileCollide(Vector2 oldVelocity) public override void Kill(int timeLeft) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) { int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); int b = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); @@ -134,7 +133,7 @@ public override void Kill(int timeLeft) Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 704, 1f); Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 705, 1f); - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) { for (int i = 0; i < 5; i++) { @@ -144,15 +143,15 @@ public override void Kill(int timeLeft) Main.projectile[a].friendly = true; } } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) { int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } @@ -163,23 +162,23 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("HealingCloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("HealingCloudPro"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } if (projectile.owner == Main.myPlayer) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1.5f, projectile.owner); Main.projectile[a].scale = 1.5f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -189,7 +188,7 @@ public override void Kill(int timeLeft) int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 32, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1f, projectile.owner); int e = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 32, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -215,7 +214,7 @@ public override void Kill(int timeLeft) int m = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 70, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 0.5f, projectile.owner); Main.projectile[m].scale = 0.8f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 60, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -228,7 +227,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y - 40, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 70, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -241,13 +240,13 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 70, projectile.position.Y - 70, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBurst"), projectile.damage, 1f, projectile.owner); @@ -255,7 +254,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-50, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBurst"), projectile.damage, 1f, projectile.owner); @@ -265,7 +264,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-100, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -274,7 +273,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-20, projectile.position.Y, -5, 0, mod.ProjectileType("HealingSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -285,7 +284,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y+10, -4, 0, mod.ProjectileType("HealingSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -298,7 +297,7 @@ public override void Kill(int timeLeft) int g = Projectile.NewProjectile(projectile.position.X-70, projectile.position.Y+15, -4, 0, mod.ProjectileType("HealingSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -318,7 +317,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -337,7 +336,7 @@ public override void Kill(int timeLeft) Main.projectile[h].scale = 1.2f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -364,7 +363,7 @@ public override void Kill(int timeLeft) Main.projectile[m].scale = 0.6f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -376,7 +375,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -399,7 +398,7 @@ public override void Kill(int timeLeft) Main.projectile[l].scale = 0.75f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -430,14 +429,14 @@ public override void Kill(int timeLeft) Main.projectile[p].scale = 0.7f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-30, projectile.position.Y, -2, 0, mod.ProjectileType("HealingBurst"), projectile.damage, 1f, projectile.owner); Projectile.NewProjectile(projectile.position.X+30, projectile.position.Y, +2, 0, mod.ProjectileType("HealingBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("HealingBurst"), projectile.damage, 1f, projectile.owner); @@ -446,7 +445,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+60, projectile.position.Y, +3, 0, mod.ProjectileType("HealingBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("HealingBurst"), projectile.damage, 1f, projectile.owner); @@ -457,7 +456,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+80, projectile.position.Y, +4, 0, mod.ProjectileType("HealingBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 4, 0, mod.ProjectileType("HealingSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -470,7 +469,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 4, mod.ProjectileType("HealingSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 6, 0, mod.ProjectileType("HealingSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -483,7 +482,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 6, mod.ProjectileType("HealingSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 8, 0, mod.ProjectileType("HealingSkullburst"), projectile.damage * 1, 1f, projectile.owner); diff --git a/Projectiles/Alchemic/BigManaFlaskPro.cs b/Projectiles/Alchemic/BigManaFlaskPro.cs index 2e0de45a..daefb542 100644 --- a/Projectiles/Alchemic/BigManaFlaskPro.cs +++ b/Projectiles/Alchemic/BigManaFlaskPro.cs @@ -1,8 +1,8 @@ using System; +using System.Linq; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; -using System.Linq; using Terraria.ModLoader; namespace Tremor.Projectiles.Alchemic { @@ -15,7 +15,7 @@ public override void SetDefaults() projectile.friendly = true; projectile.aiStyle = 2; projectile.penetrate = 1; - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate = 3; } @@ -28,7 +28,7 @@ public override void SetDefaults() public override void AI() { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) { int[] array = new int[20]; int num428 = 0; @@ -38,9 +38,9 @@ public override void AI() { if (Main.npc[num430].CanBeChasedBy(projectile, false)) { - float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2); - float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2); - float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432); + float num431 = Main.npc[num430].position.X + Main.npc[num430].width / 2; + float num432 = Main.npc[num430].position.Y + Main.npc[num430].height / 2; + float num433 = Math.Abs(projectile.position.X + projectile.width / 2 - num431) + Math.Abs(projectile.position.Y + projectile.height / 2 - num432); if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1)) { if (num428 < 20) @@ -56,18 +56,18 @@ public override void AI() { int num434 = Main.rand.Next(num428); num434 = array[num434]; - float num435 = Main.npc[num434].position.X + (float)(Main.npc[num434].width / 2); - float num436 = Main.npc[num434].position.Y + (float)(Main.npc[num434].height / 2); + float num435 = Main.npc[num434].position.X + Main.npc[num434].width / 2; + float num436 = Main.npc[num434].position.Y + Main.npc[num434].height / 2; projectile.localAI[0] += 1f; if (projectile.localAI[0] > 8f) { projectile.localAI[0] = 0f; float num437 = 6f; - Vector2 value10 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + Vector2 value10 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); value10 += projectile.velocity * 4f; float num438 = num435 - value10.X; float num439 = num436 - value10.Y; - float num440 = (float)Math.Sqrt((double)(num438 * num438 + num439 * num439)); + float num440 = (float)Math.Sqrt(num438 * num438 + num439 * num439); num440 = num437 / num440; num438 *= num440; num439 *= num440; @@ -75,7 +75,6 @@ public override void AI() { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } - return; } } } @@ -92,7 +91,7 @@ public override void ModifyHitNPC(NPC target, ref int damage, ref float knockbac public override bool OnTileCollide(Vector2 oldVelocity) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate--; if (projectile.penetrate <= 0) @@ -123,7 +122,7 @@ public override bool OnTileCollide(Vector2 oldVelocity) public override void Kill(int timeLeft) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) { int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); int b = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); @@ -134,7 +133,7 @@ public override void Kill(int timeLeft) Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 704, 1f); Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 705, 1f); - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) { for (int i = 0; i < 5; i++) { @@ -144,15 +143,15 @@ public override void Kill(int timeLeft) Main.projectile[a].friendly = true; } } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) { int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } @@ -163,23 +162,23 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("ManaCloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("ManaCloudPro"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } if (projectile.owner == Main.myPlayer) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1.5f, projectile.owner); Main.projectile[a].scale = 1.5f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -189,7 +188,7 @@ public override void Kill(int timeLeft) int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 32, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1f, projectile.owner); int e = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 32, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -215,7 +214,7 @@ public override void Kill(int timeLeft) int m = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 70, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 0.5f, projectile.owner); Main.projectile[m].scale = 0.8f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 60, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -228,7 +227,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y - 40, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 70, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -241,13 +240,13 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 70, projectile.position.Y - 70, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBurst"), projectile.damage, 1f, projectile.owner); @@ -255,7 +254,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-50, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBurst"), projectile.damage, 1f, projectile.owner); @@ -265,7 +264,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-100, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -274,7 +273,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-20, projectile.position.Y, -5, 0, mod.ProjectileType("ManaSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -285,7 +284,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y+10, -4, 0, mod.ProjectileType("ManaSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -298,7 +297,7 @@ public override void Kill(int timeLeft) int g = Projectile.NewProjectile(projectile.position.X-70, projectile.position.Y+15, -4, 0, mod.ProjectileType("ManaSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -318,7 +317,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -337,7 +336,7 @@ public override void Kill(int timeLeft) Main.projectile[h].scale = 1.2f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -364,7 +363,7 @@ public override void Kill(int timeLeft) Main.projectile[m].scale = 0.6f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -376,7 +375,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -399,7 +398,7 @@ public override void Kill(int timeLeft) Main.projectile[l].scale = 0.75f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -430,14 +429,14 @@ public override void Kill(int timeLeft) Main.projectile[p].scale = 0.7f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-30, projectile.position.Y, -2, 0, mod.ProjectileType("ManaBurst"), projectile.damage, 1f, projectile.owner); Projectile.NewProjectile(projectile.position.X+30, projectile.position.Y, +2, 0, mod.ProjectileType("ManaBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("ManaBurst"), projectile.damage, 1f, projectile.owner); @@ -446,7 +445,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+60, projectile.position.Y, +3, 0, mod.ProjectileType("ManaBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("ManaBurst"), projectile.damage, 1f, projectile.owner); @@ -457,7 +456,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+80, projectile.position.Y, +4, 0, mod.ProjectileType("ManaBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 4, 0, mod.ProjectileType("ManaSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -470,7 +469,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 4, mod.ProjectileType("ManaSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 6, 0, mod.ProjectileType("ManaSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -483,7 +482,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 6, mod.ProjectileType("ManaSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 8, 0, mod.ProjectileType("ManaSkullburst"), projectile.damage * 1, 1f, projectile.owner); diff --git a/Projectiles/Alchemic/BigPoisonFlaskPro.cs b/Projectiles/Alchemic/BigPoisonFlaskPro.cs index eee3e729..4b1f8a29 100644 --- a/Projectiles/Alchemic/BigPoisonFlaskPro.cs +++ b/Projectiles/Alchemic/BigPoisonFlaskPro.cs @@ -1,8 +1,8 @@ using System; +using System.Linq; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; -using System.Linq; using Terraria.ModLoader; namespace Tremor.Projectiles.Alchemic { @@ -16,7 +16,7 @@ public override void SetDefaults() projectile.aiStyle = 2; projectile.timeLeft = 1200; projectile.penetrate = 1; - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate = 3; } @@ -28,7 +28,7 @@ public override void SetDefaults() public override void AI() { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) { int[] array = new int[20]; int num428 = 0; @@ -38,9 +38,9 @@ public override void AI() { if (Main.npc[num430].CanBeChasedBy(projectile, false)) { - float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2); - float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2); - float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432); + float num431 = Main.npc[num430].position.X + Main.npc[num430].width / 2; + float num432 = Main.npc[num430].position.Y + Main.npc[num430].height / 2; + float num433 = Math.Abs(projectile.position.X + projectile.width / 2 - num431) + Math.Abs(projectile.position.Y + projectile.height / 2 - num432); if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1)) { if (num428 < 20) @@ -56,18 +56,18 @@ public override void AI() { int num434 = Main.rand.Next(num428); num434 = array[num434]; - float num435 = Main.npc[num434].position.X + (float)(Main.npc[num434].width / 2); - float num436 = Main.npc[num434].position.Y + (float)(Main.npc[num434].height / 2); + float num435 = Main.npc[num434].position.X + Main.npc[num434].width / 2; + float num436 = Main.npc[num434].position.Y + Main.npc[num434].height / 2; projectile.localAI[0] += 1f; if (projectile.localAI[0] > 8f) { projectile.localAI[0] = 0f; float num437 = 6f; - Vector2 value10 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + Vector2 value10 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); value10 += projectile.velocity * 4f; float num438 = num435 - value10.X; float num439 = num436 - value10.Y; - float num440 = (float)Math.Sqrt((double)(num438 * num438 + num439 * num439)); + float num440 = (float)Math.Sqrt(num438 * num438 + num439 * num439); num440 = num437 / num440; num438 *= num440; num439 *= num440; @@ -75,7 +75,6 @@ public override void AI() { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } - return; } } } @@ -92,7 +91,7 @@ public override void ModifyHitNPC(NPC target, ref int damage, ref float knockbac public override bool OnTileCollide(Vector2 oldVelocity) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate--; if (projectile.penetrate <= 0) @@ -123,7 +122,7 @@ public override bool OnTileCollide(Vector2 oldVelocity) public override void Kill(int timeLeft) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) { int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); int b = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); @@ -134,7 +133,7 @@ public override void Kill(int timeLeft) Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 704, 1f); Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 705, 1f); - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) { for (int i = 0; i < 5; i++) { @@ -144,15 +143,15 @@ public override void Kill(int timeLeft) Main.projectile[a].friendly = true; } } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) { int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } @@ -163,23 +162,23 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("PoisonCloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("PoisonCloudPro"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } if (projectile.owner == Main.myPlayer) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1.5f, projectile.owner); Main.projectile[a].scale = 1.5f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -189,7 +188,7 @@ public override void Kill(int timeLeft) int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 32, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1f, projectile.owner); int e = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 32, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -215,7 +214,7 @@ public override void Kill(int timeLeft) int m = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 70, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 0.5f, projectile.owner); Main.projectile[m].scale = 0.8f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 60, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -228,7 +227,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y - 40, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 70, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -241,13 +240,13 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 70, projectile.position.Y - 70, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBurst"), projectile.damage, 1f, projectile.owner); @@ -255,7 +254,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-50, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBurst"), projectile.damage, 1f, projectile.owner); @@ -265,7 +264,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-100, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -274,7 +273,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-20, projectile.position.Y, -5, 0, mod.ProjectileType("PoisonSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -285,7 +284,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y+10, -4, 0, mod.ProjectileType("PoisonSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -298,7 +297,7 @@ public override void Kill(int timeLeft) int g = Projectile.NewProjectile(projectile.position.X-70, projectile.position.Y+15, -4, 0, mod.ProjectileType("PoisonSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -318,7 +317,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -337,7 +336,7 @@ public override void Kill(int timeLeft) Main.projectile[h].scale = 1.2f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -364,7 +363,7 @@ public override void Kill(int timeLeft) Main.projectile[m].scale = 0.6f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -376,7 +375,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -399,7 +398,7 @@ public override void Kill(int timeLeft) Main.projectile[l].scale = 0.75f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -430,14 +429,14 @@ public override void Kill(int timeLeft) Main.projectile[p].scale = 0.7f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-30, projectile.position.Y, -2, 0, mod.ProjectileType("PoisonBurst"), projectile.damage, 1f, projectile.owner); Projectile.NewProjectile(projectile.position.X+30, projectile.position.Y, +2, 0, mod.ProjectileType("PoisonBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("PoisonBurst"), projectile.damage, 1f, projectile.owner); @@ -446,7 +445,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+60, projectile.position.Y, +3, 0, mod.ProjectileType("PoisonBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("PoisonBurst"), projectile.damage, 1f, projectile.owner); @@ -457,7 +456,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+80, projectile.position.Y, +4, 0, mod.ProjectileType("PoisonBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 4, 0, mod.ProjectileType("PoisonSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -470,7 +469,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 4, mod.ProjectileType("PoisonSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 6, 0, mod.ProjectileType("PoisonSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -483,7 +482,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 6, mod.ProjectileType("PoisonSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 8, 0, mod.ProjectileType("PoisonSkullburst"), projectile.damage * 1, 1f, projectile.owner); diff --git a/Projectiles/Alchemic/BigVenomFlaskPro.cs b/Projectiles/Alchemic/BigVenomFlaskPro.cs index 818a01eb..c78dbd2c 100644 --- a/Projectiles/Alchemic/BigVenomFlaskPro.cs +++ b/Projectiles/Alchemic/BigVenomFlaskPro.cs @@ -1,8 +1,8 @@ using System; +using System.Linq; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; -using System.Linq; using Terraria.ModLoader; namespace Tremor.Projectiles.Alchemic { @@ -16,7 +16,7 @@ public override void SetDefaults() projectile.aiStyle = 2; projectile.timeLeft = 1200; projectile.penetrate = 1; - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate = 3; } @@ -28,7 +28,7 @@ public override void SetDefaults() public override void AI() { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) { int[] array = new int[20]; int num428 = 0; @@ -38,9 +38,9 @@ public override void AI() { if (Main.npc[num430].CanBeChasedBy(projectile, false)) { - float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2); - float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2); - float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432); + float num431 = Main.npc[num430].position.X + Main.npc[num430].width / 2; + float num432 = Main.npc[num430].position.Y + Main.npc[num430].height / 2; + float num433 = Math.Abs(projectile.position.X + projectile.width / 2 - num431) + Math.Abs(projectile.position.Y + projectile.height / 2 - num432); if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1)) { if (num428 < 20) @@ -56,18 +56,18 @@ public override void AI() { int num434 = Main.rand.Next(num428); num434 = array[num434]; - float num435 = Main.npc[num434].position.X + (float)(Main.npc[num434].width / 2); - float num436 = Main.npc[num434].position.Y + (float)(Main.npc[num434].height / 2); + float num435 = Main.npc[num434].position.X + Main.npc[num434].width / 2; + float num436 = Main.npc[num434].position.Y + Main.npc[num434].height / 2; projectile.localAI[0] += 1f; if (projectile.localAI[0] > 8f) { projectile.localAI[0] = 0f; float num437 = 6f; - Vector2 value10 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + Vector2 value10 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); value10 += projectile.velocity * 4f; float num438 = num435 - value10.X; float num439 = num436 - value10.Y; - float num440 = (float)Math.Sqrt((double)(num438 * num438 + num439 * num439)); + float num440 = (float)Math.Sqrt(num438 * num438 + num439 * num439); num440 = num437 / num440; num438 *= num440; num439 *= num440; @@ -75,7 +75,6 @@ public override void AI() { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } - return; } } } @@ -94,7 +93,7 @@ public override void ModifyHitNPC(NPC target, ref int damage, ref float knockbac public override bool OnTileCollide(Vector2 oldVelocity) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate--; if (projectile.penetrate <= 0) @@ -125,7 +124,7 @@ public override bool OnTileCollide(Vector2 oldVelocity) public override void Kill(int timeLeft) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) { int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); int b = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); @@ -136,7 +135,7 @@ public override void Kill(int timeLeft) Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 704, 1f); Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 705, 1f); - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) { for (int i = 0; i < 5; i++) { @@ -146,15 +145,15 @@ public override void Kill(int timeLeft) Main.projectile[a].friendly = true; } } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) { int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } @@ -165,23 +164,23 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("PurpleCloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("PurpleCloudPro"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } if (projectile.owner == Main.myPlayer) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PurpleBlast"), projectile.damage * 2, 1.5f, projectile.owner); Main.projectile[a].scale = 1.5f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PurpleBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -191,7 +190,7 @@ public override void Kill(int timeLeft) int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 32, 0, 0, mod.ProjectileType("PurpleBlast"), projectile.damage * 2, 1f, projectile.owner); int e = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 32, 0, 0, mod.ProjectileType("PurpleBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PurpleBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -217,7 +216,7 @@ public override void Kill(int timeLeft) int m = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 70, 0, 0, mod.ProjectileType("PurpleBlast"), projectile.damage * 2, 0.5f, projectile.owner); Main.projectile[m].scale = 0.8f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 60, projectile.position.Y, 0, 0, mod.ProjectileType("PurpleBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -230,7 +229,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y - 40, 0, 0, mod.ProjectileType("PurpleBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 70, projectile.position.Y, 0, 0, mod.ProjectileType("PurpleBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -243,13 +242,13 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 70, projectile.position.Y - 70, 0, 0, mod.ProjectileType("PurpleBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PurpleBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PurpleBurst"), projectile.damage, 1f, projectile.owner); @@ -257,7 +256,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-50, projectile.position.Y, 0, 0, mod.ProjectileType("PurpleBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PurpleBurst"), projectile.damage, 1f, projectile.owner); @@ -267,7 +266,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-100, projectile.position.Y, 0, 0, mod.ProjectileType("PurpleBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PurpleBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -276,7 +275,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-20, projectile.position.Y, -5, 0, mod.ProjectileType("PurpleSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PurpleBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -287,7 +286,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y+10, -4, 0, mod.ProjectileType("PurpleSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PurpleBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -300,7 +299,7 @@ public override void Kill(int timeLeft) int g = Projectile.NewProjectile(projectile.position.X-70, projectile.position.Y+15, -4, 0, mod.ProjectileType("PurpleSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PurpleBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -320,7 +319,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PurpleBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -339,7 +338,7 @@ public override void Kill(int timeLeft) Main.projectile[h].scale = 1.2f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PurpleBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -366,7 +365,7 @@ public override void Kill(int timeLeft) Main.projectile[m].scale = 0.6f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PurpleBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -378,7 +377,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PurpleBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -401,7 +400,7 @@ public override void Kill(int timeLeft) Main.projectile[l].scale = 0.75f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PurpleBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -432,14 +431,14 @@ public override void Kill(int timeLeft) Main.projectile[p].scale = 0.7f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-30, projectile.position.Y, -2, 0, mod.ProjectileType("PurpleBurst"), projectile.damage, 1f, projectile.owner); Projectile.NewProjectile(projectile.position.X+30, projectile.position.Y, +2, 0, mod.ProjectileType("PurpleBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("PurpleBurst"), projectile.damage, 1f, projectile.owner); @@ -448,7 +447,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+60, projectile.position.Y, +3, 0, mod.ProjectileType("PurpleBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("PurpleBurst"), projectile.damage, 1f, projectile.owner); @@ -459,7 +458,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+80, projectile.position.Y, +4, 0, mod.ProjectileType("PurpleBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 4, 0, mod.ProjectileType("PurpleSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -472,7 +471,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 4, mod.ProjectileType("PurpleSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 6, 0, mod.ProjectileType("PurpleSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -485,7 +484,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 6, mod.ProjectileType("PurpleSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 8, 0, mod.ProjectileType("PurpleSkullburst"), projectile.damage * 1, 1f, projectile.owner); diff --git a/Projectiles/Alchemic/Blasts/ClusterBlast.cs b/Projectiles/Alchemic/Blasts/ClusterBlast.cs index 1d46f592..24be4cc6 100644 --- a/Projectiles/Alchemic/Blasts/ClusterBlast.cs +++ b/Projectiles/Alchemic/Blasts/ClusterBlast.cs @@ -35,10 +35,10 @@ public override void Kill(int timeLeft) { if (projectile.scale > 0.85f) { - Vector2 valuekok = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 valuekok = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); valuekok.Normalize(); - valuekok *= (float)Main.rand.Next(10, 201) * 0.01f; - int proj = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, valuekok.X, valuekok.Y, mod.ProjectileType("ClusterBlastPro"), projectile.damage, 0.8f, projectile.owner, 2f, (float)Main.rand.Next(-45, 45)); + valuekok *= Main.rand.Next(10, 201) * 0.01f; + int proj = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, valuekok.X, valuekok.Y, mod.ProjectileType("ClusterBlastPro"), projectile.damage, 0.8f, projectile.owner, 2f, Main.rand.Next(-45, 45)); Main.projectile[proj].scale = 0.8f; } } diff --git a/Projectiles/Alchemic/Blasts/HealingBlast.cs b/Projectiles/Alchemic/Blasts/HealingBlast.cs index 5b9e6c95..8112555a 100644 --- a/Projectiles/Alchemic/Blasts/HealingBlast.cs +++ b/Projectiles/Alchemic/Blasts/HealingBlast.cs @@ -1,6 +1,6 @@ +using System.Linq; using Microsoft.Xna.Framework; using Terraria; -using System.Linq; using Terraria.ModLoader; namespace Tremor.Projectiles.Alchemic.Blasts @@ -45,7 +45,7 @@ public override void AI() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ConcentratedTinctureBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ConcentratedTinctureBuff"))) { int newLife = 2; Main.player[projectile.owner].statLife += newLife; diff --git a/Projectiles/Alchemic/BoomFlaskPro.cs b/Projectiles/Alchemic/BoomFlaskPro.cs index e7e86322..442b49bc 100644 --- a/Projectiles/Alchemic/BoomFlaskPro.cs +++ b/Projectiles/Alchemic/BoomFlaskPro.cs @@ -1,9 +1,9 @@ using System; +using System.Linq; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using System.Linq; namespace Tremor.Projectiles.Alchemic { public class BoomFlaskPro : ModProjectile @@ -14,7 +14,7 @@ public override void SetDefaults() projectile.height = 28; projectile.friendly = true; projectile.penetrate = 1; - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate = 3; } @@ -28,7 +28,7 @@ public override void SetDefaults() public override void AI() { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) { int[] array = new int[20]; int num428 = 0; @@ -38,9 +38,9 @@ public override void AI() { if (Main.npc[num430].CanBeChasedBy(projectile, false)) { - float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2); - float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2); - float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432); + float num431 = Main.npc[num430].position.X + Main.npc[num430].width / 2; + float num432 = Main.npc[num430].position.Y + Main.npc[num430].height / 2; + float num433 = Math.Abs(projectile.position.X + projectile.width / 2 - num431) + Math.Abs(projectile.position.Y + projectile.height / 2 - num432); if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1)) { if (num428 < 20) @@ -56,18 +56,18 @@ public override void AI() { int num434 = Main.rand.Next(num428); num434 = array[num434]; - float num435 = Main.npc[num434].position.X + (float)(Main.npc[num434].width / 2); - float num436 = Main.npc[num434].position.Y + (float)(Main.npc[num434].height / 2); + float num435 = Main.npc[num434].position.X + Main.npc[num434].width / 2; + float num436 = Main.npc[num434].position.Y + Main.npc[num434].height / 2; projectile.localAI[0] += 1f; if (projectile.localAI[0] > 8f) { projectile.localAI[0] = 0f; float num437 = 6f; - Vector2 value10 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + Vector2 value10 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); value10 += projectile.velocity * 4f; float num438 = num435 - value10.X; float num439 = num436 - value10.Y; - float num440 = (float)Math.Sqrt((double)(num438 * num438 + num439 * num439)); + float num440 = (float)Math.Sqrt(num438 * num438 + num439 * num439); num440 = num437 / num440; num438 *= num440; num439 *= num440; @@ -75,7 +75,6 @@ public override void AI() { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } - return; } } } @@ -91,7 +90,7 @@ public override void ModifyHitNPC(NPC target, ref int damage, ref float knockbac public override bool OnTileCollide(Vector2 oldVelocity) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate--; if (projectile.penetrate <= 0) @@ -122,7 +121,7 @@ public override bool OnTileCollide(Vector2 oldVelocity) public override void Kill(int timeLeft) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) { int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); int b = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); @@ -131,7 +130,7 @@ public override void Kill(int timeLeft) Player player = Main.player[projectile.owner]; MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) { for (int i = 0; i < 5; i++) { @@ -141,24 +140,24 @@ public override void Kill(int timeLeft) Main.projectile[a].friendly = true; } } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) { int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.position.X = projectile.position.X + projectile.width / 2; + projectile.position.Y = projectile.position.Y + projectile.height / 2; projectile.width = 80; projectile.height = 80; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.position.X = projectile.position.X - projectile.width / 2; + projectile.position.Y = projectile.position.Y - projectile.height / 2; for (int num628 = 0; num628 < 40; num628++) { int num629 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); @@ -166,7 +165,7 @@ public override void Kill(int timeLeft) if (Main.rand.Next(2) == 0) { Main.dust[num629].scale = 0.5f; - Main.dust[num629].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num629].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } for (int num630 = 0; num630 < 70; num630++) @@ -188,37 +187,37 @@ public override void Kill(int timeLeft) { scaleFactor10 = 1f; } - int num633 = 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 num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13E6D_cp_0 = Main.gore[num633]; expr_13E6D_cp_0.velocity.X = expr_13E6D_cp_0.velocity.X + 1f; Gore expr_13E8D_cp_0 = Main.gore[num633]; expr_13E8D_cp_0.velocity.Y = expr_13E8D_cp_0.velocity.Y + 1f; - num633 = 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), 2f); + num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 2f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13F30_cp_0 = Main.gore[num633]; expr_13F30_cp_0.velocity.X = expr_13F30_cp_0.velocity.X - 1f; Gore expr_13F50_cp_0 = Main.gore[num633]; expr_13F50_cp_0.velocity.Y = expr_13F50_cp_0.velocity.Y + 1f; - num633 = 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); + num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13FF3_cp_0 = Main.gore[num633]; expr_13FF3_cp_0.velocity.X = expr_13FF3_cp_0.velocity.X + 1f; Gore expr_14013_cp_0 = Main.gore[num633]; expr_14013_cp_0.velocity.Y = expr_14013_cp_0.velocity.Y - 1f; - num633 = 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); + num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_140B6_cp_0 = Main.gore[num633]; expr_140B6_cp_0.velocity.X = expr_140B6_cp_0.velocity.X - 1f; Gore expr_140D6_cp_0 = Main.gore[num633]; expr_140D6_cp_0.velocity.Y = expr_140D6_cp_0.velocity.Y - 1f; } - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.position.X = projectile.position.X + projectile.width / 2; + projectile.position.Y = projectile.position.Y + projectile.height / 2; projectile.width = 10; projectile.height = 10; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.position.X = projectile.position.X - projectile.width / 2; + projectile.position.Y = projectile.position.Y - projectile.height / 2; if (!modPlayer.pyro && !modPlayer.nitro) { @@ -227,22 +226,22 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(3, 8); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("BoomCloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("BoomCloudPro"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } if (projectile.owner == Main.myPlayer) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BoomBlast"), projectile.damage * 2, 1.5f, projectile.owner); Main.projectile[a].scale = 1.5f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BoomBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -252,7 +251,7 @@ public override void Kill(int timeLeft) int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 32, 0, 0, mod.ProjectileType("BoomBlast"), projectile.damage * 2, 1f, projectile.owner); int e = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 32, 0, 0, mod.ProjectileType("BoomBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BoomBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -278,7 +277,7 @@ public override void Kill(int timeLeft) int m = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 70, 0, 0, mod.ProjectileType("BoomBlast"), projectile.damage * 2, 0.5f, projectile.owner); Main.projectile[m].scale = 0.8f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 60, projectile.position.Y, 0, 0, mod.ProjectileType("BoomBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -291,7 +290,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y - 40, 0, 0, mod.ProjectileType("BoomBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 70, projectile.position.Y, 0, 0, mod.ProjectileType("BoomBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -304,13 +303,13 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 70, projectile.position.Y - 70, 0, 0, mod.ProjectileType("BoomBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BoomBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BoomBurst"), projectile.damage, 1f, projectile.owner); @@ -318,7 +317,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-50, projectile.position.Y, 0, 0, mod.ProjectileType("BoomBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BoomBurst"), projectile.damage, 1f, projectile.owner); @@ -328,7 +327,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-100, projectile.position.Y, 0, 0, mod.ProjectileType("BoomBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BoomBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -337,7 +336,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-20, projectile.position.Y, -5, 0, mod.ProjectileType("BoomSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BoomBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -348,7 +347,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y+10, -4, 0, mod.ProjectileType("BoomSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BoomBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -361,7 +360,7 @@ public override void Kill(int timeLeft) int g = Projectile.NewProjectile(projectile.position.X-70, projectile.position.Y+15, -4, 0, mod.ProjectileType("BoomSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BoomBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -381,7 +380,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BoomBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -400,7 +399,7 @@ public override void Kill(int timeLeft) Main.projectile[h].scale = 1.2f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BoomBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -427,7 +426,7 @@ public override void Kill(int timeLeft) Main.projectile[m].scale = 0.6f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BoomBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -439,7 +438,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BoomBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -462,7 +461,7 @@ public override void Kill(int timeLeft) Main.projectile[l].scale = 0.75f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BoomBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -493,14 +492,14 @@ public override void Kill(int timeLeft) Main.projectile[p].scale = 0.7f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-30, projectile.position.Y, -2, 0, mod.ProjectileType("BoomBurst"), projectile.damage, 1f, projectile.owner); Projectile.NewProjectile(projectile.position.X+30, projectile.position.Y, +2, 0, mod.ProjectileType("BoomBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("BoomBurst"), projectile.damage, 1f, projectile.owner); @@ -509,7 +508,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+60, projectile.position.Y, +3, 0, mod.ProjectileType("BoomBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("BoomBurst"), projectile.damage, 1f, projectile.owner); @@ -520,7 +519,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+80, projectile.position.Y, +4, 0, mod.ProjectileType("BoomBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 4, 0, mod.ProjectileType("BoomSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -533,7 +532,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 4, mod.ProjectileType("BoomSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 6, 0, mod.ProjectileType("BoomSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -546,7 +545,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 6, mod.ProjectileType("BoomSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 8, 0, mod.ProjectileType("BoomSkullburst"), projectile.damage * 1, 1f, projectile.owner); diff --git a/Projectiles/Alchemic/BurningFlaskPro.cs b/Projectiles/Alchemic/BurningFlaskPro.cs index c3e5d950..fb273b41 100644 --- a/Projectiles/Alchemic/BurningFlaskPro.cs +++ b/Projectiles/Alchemic/BurningFlaskPro.cs @@ -1,8 +1,8 @@ using System; +using System.Linq; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; -using System.Linq; using Terraria.ModLoader; namespace Tremor.Projectiles.Alchemic { @@ -15,7 +15,7 @@ public override void SetDefaults() projectile.friendly = true; projectile.aiStyle = 2; projectile.penetrate = 1; - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate = 3; } @@ -28,7 +28,7 @@ public override void SetDefaults() public override void AI() { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) { int[] array = new int[20]; int num428 = 0; @@ -38,9 +38,9 @@ public override void AI() { if (Main.npc[num430].CanBeChasedBy(projectile, false)) { - float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2); - float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2); - float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432); + float num431 = Main.npc[num430].position.X + Main.npc[num430].width / 2; + float num432 = Main.npc[num430].position.Y + Main.npc[num430].height / 2; + float num433 = Math.Abs(projectile.position.X + projectile.width / 2 - num431) + Math.Abs(projectile.position.Y + projectile.height / 2 - num432); if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1)) { if (num428 < 20) @@ -56,18 +56,18 @@ public override void AI() { int num434 = Main.rand.Next(num428); num434 = array[num434]; - float num435 = Main.npc[num434].position.X + (float)(Main.npc[num434].width / 2); - float num436 = Main.npc[num434].position.Y + (float)(Main.npc[num434].height / 2); + float num435 = Main.npc[num434].position.X + Main.npc[num434].width / 2; + float num436 = Main.npc[num434].position.Y + Main.npc[num434].height / 2; projectile.localAI[0] += 1f; if (projectile.localAI[0] > 8f) { projectile.localAI[0] = 0f; float num437 = 6f; - Vector2 value10 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + Vector2 value10 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); value10 += projectile.velocity * 4f; float num438 = num435 - value10.X; float num439 = num436 - value10.Y; - float num440 = (float)Math.Sqrt((double)(num438 * num438 + num439 * num439)); + float num440 = (float)Math.Sqrt(num438 * num438 + num439 * num439); num440 = num437 / num440; num438 *= num440; num439 *= num440; @@ -75,7 +75,6 @@ public override void AI() { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } - return; } } } @@ -94,7 +93,7 @@ public override void ModifyHitNPC(NPC target, ref int damage, ref float knockbac public override bool OnTileCollide(Vector2 oldVelocity) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate--; if (projectile.penetrate <= 0) @@ -124,7 +123,7 @@ public override bool OnTileCollide(Vector2 oldVelocity) public override void Kill(int timeLeft) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) { int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); int b = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); @@ -135,7 +134,7 @@ public override void Kill(int timeLeft) Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 704, 1f); Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 705, 1f); - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) { for (int i = 0; i < 5; i++) { @@ -145,15 +144,15 @@ public override void Kill(int timeLeft) Main.projectile[a].friendly = true; } } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) { int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } @@ -164,23 +163,23 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("FieryCloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("FieryCloudPro"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } if (projectile.owner == Main.myPlayer) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1.5f, projectile.owner); Main.projectile[a].scale = 1.5f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -190,7 +189,7 @@ public override void Kill(int timeLeft) int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 32, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1f, projectile.owner); int e = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 32, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -216,7 +215,7 @@ public override void Kill(int timeLeft) int m = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 70, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 0.5f, projectile.owner); Main.projectile[m].scale = 0.8f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 60, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -229,7 +228,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y - 40, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 70, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -242,13 +241,13 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 70, projectile.position.Y - 70, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBurst"), projectile.damage, 1f, projectile.owner); @@ -256,7 +255,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-50, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBurst"), projectile.damage, 1f, projectile.owner); @@ -266,7 +265,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-100, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -275,7 +274,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-20, projectile.position.Y, -5, 0, mod.ProjectileType("FierySkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -286,7 +285,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y+10, -4, 0, mod.ProjectileType("FierySkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -299,7 +298,7 @@ public override void Kill(int timeLeft) int g = Projectile.NewProjectile(projectile.position.X-70, projectile.position.Y+15, -4, 0, mod.ProjectileType("FierySkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -319,7 +318,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -338,7 +337,7 @@ public override void Kill(int timeLeft) Main.projectile[h].scale = 1.2f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -365,7 +364,7 @@ public override void Kill(int timeLeft) Main.projectile[m].scale = 0.6f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -377,7 +376,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -400,7 +399,7 @@ public override void Kill(int timeLeft) Main.projectile[l].scale = 0.75f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -431,14 +430,14 @@ public override void Kill(int timeLeft) Main.projectile[p].scale = 0.7f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-30, projectile.position.Y, -2, 0, mod.ProjectileType("FieryBurst"), projectile.damage, 1f, projectile.owner); Projectile.NewProjectile(projectile.position.X+30, projectile.position.Y, +2, 0, mod.ProjectileType("FieryBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("FieryBurst"), projectile.damage, 1f, projectile.owner); @@ -447,7 +446,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+60, projectile.position.Y, +3, 0, mod.ProjectileType("FieryBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("FieryBurst"), projectile.damage, 1f, projectile.owner); @@ -458,7 +457,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+80, projectile.position.Y, +4, 0, mod.ProjectileType("FieryBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 4, 0, mod.ProjectileType("FierySkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -471,7 +470,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 4, mod.ProjectileType("FierySkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 6, 0, mod.ProjectileType("FierySkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -484,7 +483,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 6, mod.ProjectileType("FierySkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 8, 0, mod.ProjectileType("FierySkullburst"), projectile.damage * 1, 1f, projectile.owner); diff --git a/Projectiles/Alchemic/Bursts/BoomSkull.cs b/Projectiles/Alchemic/Bursts/BoomSkull.cs index 26b366c0..2702b219 100644 --- a/Projectiles/Alchemic/Bursts/BoomSkull.cs +++ b/Projectiles/Alchemic/Bursts/BoomSkull.cs @@ -39,12 +39,12 @@ public override void ModifyHitNPC(NPC target, ref int damage, ref float knockbac public override void Kill(int timeLeft) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.position.X = projectile.position.X + projectile.width / 2; + projectile.position.Y = projectile.position.Y + projectile.height / 2; projectile.width = 80; projectile.height = 80; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.position.X = projectile.position.X - projectile.width / 2; + projectile.position.Y = projectile.position.Y - projectile.height / 2; for (int num628 = 0; num628 < 40; num628++) { int num629 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); @@ -52,7 +52,7 @@ public override void Kill(int timeLeft) if (Main.rand.Next(2) == 0) { Main.dust[num629].scale = 0.5f; - Main.dust[num629].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num629].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } for (int num630 = 0; num630 < 70; num630++) @@ -74,47 +74,47 @@ public override void Kill(int timeLeft) { scaleFactor10 = 1f; } - int num633 = 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 num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13E6D_cp_0 = Main.gore[num633]; expr_13E6D_cp_0.velocity.X = expr_13E6D_cp_0.velocity.X + 1f; Gore expr_13E8D_cp_0 = Main.gore[num633]; expr_13E8D_cp_0.velocity.Y = expr_13E8D_cp_0.velocity.Y + 1f; - num633 = 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), 2f); + num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 2f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13F30_cp_0 = Main.gore[num633]; expr_13F30_cp_0.velocity.X = expr_13F30_cp_0.velocity.X - 1f; Gore expr_13F50_cp_0 = Main.gore[num633]; expr_13F50_cp_0.velocity.Y = expr_13F50_cp_0.velocity.Y + 1f; - num633 = 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); + num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13FF3_cp_0 = Main.gore[num633]; expr_13FF3_cp_0.velocity.X = expr_13FF3_cp_0.velocity.X + 1f; Gore expr_14013_cp_0 = Main.gore[num633]; expr_14013_cp_0.velocity.Y = expr_14013_cp_0.velocity.Y - 1f; - num633 = 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); + num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_140B6_cp_0 = Main.gore[num633]; expr_140B6_cp_0.velocity.X = expr_140B6_cp_0.velocity.X - 1f; Gore expr_140D6_cp_0 = Main.gore[num633]; expr_140D6_cp_0.velocity.Y = expr_140D6_cp_0.velocity.Y - 1f; } - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.position.X = projectile.position.X + projectile.width / 2; + projectile.position.Y = projectile.position.Y + projectile.height / 2; projectile.width = 10; projectile.height = 10; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.position.X = projectile.position.X - projectile.width / 2; + projectile.position.Y = projectile.position.Y - projectile.height / 2; if (projectile.owner == Main.myPlayer) { int num220 = Main.rand.Next(2, 3); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("BoomCloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("BoomCloudPro"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } diff --git a/Projectiles/Alchemic/Bursts/BoomSkullburst.cs b/Projectiles/Alchemic/Bursts/BoomSkullburst.cs index 04c91e7d..12535bfe 100644 --- a/Projectiles/Alchemic/Bursts/BoomSkullburst.cs +++ b/Projectiles/Alchemic/Bursts/BoomSkullburst.cs @@ -29,12 +29,12 @@ public override void ModifyHitNPC(NPC target, ref int damage, ref float knockbac public override void Kill(int timeLeft) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.position.X = projectile.position.X + projectile.width / 2; + projectile.position.Y = projectile.position.Y + projectile.height / 2; projectile.width = 80; projectile.height = 80; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.position.X = projectile.position.X - projectile.width / 2; + projectile.position.Y = projectile.position.Y - projectile.height / 2; for (int num628 = 0; num628 < 40; num628++) { int num629 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); @@ -42,7 +42,7 @@ public override void Kill(int timeLeft) if (Main.rand.Next(2) == 0) { Main.dust[num629].scale = 0.5f; - Main.dust[num629].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num629].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } for (int num630 = 0; num630 < 70; num630++) @@ -64,47 +64,47 @@ public override void Kill(int timeLeft) { scaleFactor10 = 1f; } - int num633 = 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 num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13E6D_cp_0 = Main.gore[num633]; expr_13E6D_cp_0.velocity.X = expr_13E6D_cp_0.velocity.X + 1f; Gore expr_13E8D_cp_0 = Main.gore[num633]; expr_13E8D_cp_0.velocity.Y = expr_13E8D_cp_0.velocity.Y + 1f; - num633 = 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), 2f); + num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 2f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13F30_cp_0 = Main.gore[num633]; expr_13F30_cp_0.velocity.X = expr_13F30_cp_0.velocity.X - 1f; Gore expr_13F50_cp_0 = Main.gore[num633]; expr_13F50_cp_0.velocity.Y = expr_13F50_cp_0.velocity.Y + 1f; - num633 = 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); + num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13FF3_cp_0 = Main.gore[num633]; expr_13FF3_cp_0.velocity.X = expr_13FF3_cp_0.velocity.X + 1f; Gore expr_14013_cp_0 = Main.gore[num633]; expr_14013_cp_0.velocity.Y = expr_14013_cp_0.velocity.Y - 1f; - num633 = 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); + num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_140B6_cp_0 = Main.gore[num633]; expr_140B6_cp_0.velocity.X = expr_140B6_cp_0.velocity.X - 1f; Gore expr_140D6_cp_0 = Main.gore[num633]; expr_140D6_cp_0.velocity.Y = expr_140D6_cp_0.velocity.Y - 1f; } - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.position.X = projectile.position.X + projectile.width / 2; + projectile.position.Y = projectile.position.Y + projectile.height / 2; projectile.width = 10; projectile.height = 10; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.position.X = projectile.position.X - projectile.width / 2; + projectile.position.Y = projectile.position.Y - projectile.height / 2; if (projectile.owner == Main.myPlayer) { int num220 = Main.rand.Next(2, 3); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("BoomCloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("BoomCloudPro"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } diff --git a/Projectiles/Alchemic/Bursts/HealingBurst.cs b/Projectiles/Alchemic/Bursts/HealingBurst.cs index 3339ff59..e059b1c1 100644 --- a/Projectiles/Alchemic/Bursts/HealingBurst.cs +++ b/Projectiles/Alchemic/Bursts/HealingBurst.cs @@ -1,6 +1,6 @@ +using System.Linq; using Microsoft.Xna.Framework; using Terraria; -using System.Linq; using Terraria.ModLoader; namespace Tremor.Projectiles.Alchemic.Bursts @@ -44,7 +44,7 @@ public override void AI() } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ConcentratedTinctureBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ConcentratedTinctureBuff"))) { int newLife = 2; Main.player[projectile.owner].statLife += newLife; diff --git a/Projectiles/Alchemic/Bursts/HealingSkull.cs b/Projectiles/Alchemic/Bursts/HealingSkull.cs index 083be774..e79d0999 100644 --- a/Projectiles/Alchemic/Bursts/HealingSkull.cs +++ b/Projectiles/Alchemic/Bursts/HealingSkull.cs @@ -1,7 +1,7 @@ using System; +using System.Linq; using Microsoft.Xna.Framework; using Terraria; -using System.Linq; using Terraria.ModLoader; namespace Tremor.Projectiles.Alchemic.Bursts @@ -37,7 +37,7 @@ public override void ModifyHitNPC(NPC target, ref int damage, ref float knockbac public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ConcentratedTinctureBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ConcentratedTinctureBuff"))) { int newLife = 2; Main.player[projectile.owner].statLife += newLife; diff --git a/Projectiles/Alchemic/Bursts/HealingSkullburst.cs b/Projectiles/Alchemic/Bursts/HealingSkullburst.cs index a4ea0575..3564cc02 100644 --- a/Projectiles/Alchemic/Bursts/HealingSkullburst.cs +++ b/Projectiles/Alchemic/Bursts/HealingSkullburst.cs @@ -1,6 +1,6 @@ +using System.Linq; using Microsoft.Xna.Framework; using Terraria; -using System.Linq; using Terraria.ModLoader; namespace Tremor.Projectiles.Alchemic.Bursts @@ -33,7 +33,7 @@ public override void ModifyHitNPC(NPC target, ref int damage, ref float knockbac public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ConcentratedTinctureBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ConcentratedTinctureBuff"))) { int newLife = 2; Main.player[projectile.owner].statLife += newLife; diff --git a/Projectiles/Alchemic/ClusterFlaskPro.cs b/Projectiles/Alchemic/ClusterFlaskPro.cs index 25be4490..c1477671 100644 --- a/Projectiles/Alchemic/ClusterFlaskPro.cs +++ b/Projectiles/Alchemic/ClusterFlaskPro.cs @@ -1,8 +1,8 @@ using System; +using System.Linq; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; -using System.Linq; using Terraria.ModLoader; namespace Tremor.Projectiles.Alchemic { @@ -16,7 +16,7 @@ public override void SetDefaults() projectile.aiStyle = 2; projectile.timeLeft = 1200; projectile.penetrate = 1; - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate = 3; } @@ -28,7 +28,7 @@ public override void SetDefaults() public override void AI() { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) { int[] array = new int[20]; int num428 = 0; @@ -38,9 +38,9 @@ public override void AI() { if (Main.npc[num430].CanBeChasedBy(projectile, false)) { - float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2); - float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2); - float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432); + float num431 = Main.npc[num430].position.X + Main.npc[num430].width / 2; + float num432 = Main.npc[num430].position.Y + Main.npc[num430].height / 2; + float num433 = Math.Abs(projectile.position.X + projectile.width / 2 - num431) + Math.Abs(projectile.position.Y + projectile.height / 2 - num432); if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1)) { if (num428 < 20) @@ -56,18 +56,18 @@ public override void AI() { int num434 = Main.rand.Next(num428); num434 = array[num434]; - float num435 = Main.npc[num434].position.X + (float)(Main.npc[num434].width / 2); - float num436 = Main.npc[num434].position.Y + (float)(Main.npc[num434].height / 2); + float num435 = Main.npc[num434].position.X + Main.npc[num434].width / 2; + float num436 = Main.npc[num434].position.Y + Main.npc[num434].height / 2; projectile.localAI[0] += 1f; if (projectile.localAI[0] > 8f) { projectile.localAI[0] = 0f; float num437 = 6f; - Vector2 value10 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + Vector2 value10 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); value10 += projectile.velocity * 4f; float num438 = num435 - value10.X; float num439 = num436 - value10.Y; - float num440 = (float)Math.Sqrt((double)(num438 * num438 + num439 * num439)); + float num440 = (float)Math.Sqrt(num438 * num438 + num439 * num439); num440 = num437 / num440; num438 *= num440; num439 *= num440; @@ -75,7 +75,6 @@ public override void AI() { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } - return; } } } @@ -96,7 +95,7 @@ public override void ModifyHitNPC(NPC target, ref int damage, ref float knockbac public override bool OnTileCollide(Vector2 oldVelocity) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate--; if (projectile.penetrate <= 0) @@ -126,7 +125,7 @@ public override bool OnTileCollide(Vector2 oldVelocity) public override void Kill(int timeLeft) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) { int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); int b = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); @@ -137,7 +136,7 @@ public override void Kill(int timeLeft) Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 704, 1f); Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 705, 1f); - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) { for (int i = 0; i < 5; i++) { @@ -147,15 +146,15 @@ public override void Kill(int timeLeft) Main.projectile[a].friendly = true; } } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) { int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } @@ -166,23 +165,23 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("ClusterCloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("ClusterCloudPro"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } if (projectile.owner == Main.myPlayer) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ClusterBlast"), projectile.damage * 2, 1.5f, projectile.owner); Main.projectile[a].scale = 1.5f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ClusterBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -192,7 +191,7 @@ public override void Kill(int timeLeft) int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 32, 0, 0, mod.ProjectileType("ClusterBlast"), projectile.damage * 2, 1f, projectile.owner); int e = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 32, 0, 0, mod.ProjectileType("ClusterBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ClusterBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -218,7 +217,7 @@ public override void Kill(int timeLeft) int m = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 70, 0, 0, mod.ProjectileType("ClusterBlast"), projectile.damage * 2, 0.5f, projectile.owner); Main.projectile[m].scale = 0.8f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 60, projectile.position.Y, 0, 0, mod.ProjectileType("ClusterBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -231,7 +230,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y - 40, 0, 0, mod.ProjectileType("ClusterBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 70, projectile.position.Y, 0, 0, mod.ProjectileType("ClusterBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -244,13 +243,13 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 70, projectile.position.Y - 70, 0, 0, mod.ProjectileType("ClusterBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ClusterBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ClusterBurst"), projectile.damage, 1f, projectile.owner); @@ -258,7 +257,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-50, projectile.position.Y, 0, 0, mod.ProjectileType("ClusterBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ClusterBurst"), projectile.damage, 1f, projectile.owner); @@ -268,7 +267,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-100, projectile.position.Y, 0, 0, mod.ProjectileType("ClusterBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ClusterBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -277,7 +276,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-20, projectile.position.Y, -5, 0, mod.ProjectileType("ClusterSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ClusterBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -288,7 +287,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y+10, -4, 0, mod.ProjectileType("ClusterSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ClusterBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -301,7 +300,7 @@ public override void Kill(int timeLeft) int g = Projectile.NewProjectile(projectile.position.X-70, projectile.position.Y+15, -4, 0, mod.ProjectileType("ClusterSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ClusterBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -321,7 +320,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ClusterBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -340,7 +339,7 @@ public override void Kill(int timeLeft) Main.projectile[h].scale = 1.2f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ClusterBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -367,7 +366,7 @@ public override void Kill(int timeLeft) Main.projectile[m].scale = 0.6f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ClusterBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -379,7 +378,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ClusterBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -402,7 +401,7 @@ public override void Kill(int timeLeft) Main.projectile[l].scale = 0.75f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ClusterBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -433,14 +432,14 @@ public override void Kill(int timeLeft) Main.projectile[p].scale = 0.7f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-30, projectile.position.Y, -2, 0, mod.ProjectileType("ClusterBurst"), projectile.damage, 1f, projectile.owner); Projectile.NewProjectile(projectile.position.X+30, projectile.position.Y, +2, 0, mod.ProjectileType("ClusterBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("ClusterBurst"), projectile.damage, 1f, projectile.owner); @@ -449,7 +448,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+60, projectile.position.Y, +3, 0, mod.ProjectileType("ClusterBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("ClusterBurst"), projectile.damage, 1f, projectile.owner); @@ -460,7 +459,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+80, projectile.position.Y, +4, 0, mod.ProjectileType("ClusterBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 4, 0, mod.ProjectileType("ClusterSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -473,7 +472,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 4, mod.ProjectileType("ClusterSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 6, 0, mod.ProjectileType("ClusterSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -486,7 +485,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 6, mod.ProjectileType("ClusterSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 8, 0, mod.ProjectileType("ClusterSkullburst"), projectile.damage * 1, 1f, projectile.owner); diff --git a/Projectiles/Alchemic/CrystalFlaskPro.cs b/Projectiles/Alchemic/CrystalFlaskPro.cs index 1146cd13..cfc7b13d 100644 --- a/Projectiles/Alchemic/CrystalFlaskPro.cs +++ b/Projectiles/Alchemic/CrystalFlaskPro.cs @@ -1,9 +1,9 @@ using System; +using System.Linq; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using System.Linq; namespace Tremor.Projectiles.Alchemic { public class CrystalFlaskPro : ModProjectile @@ -15,7 +15,7 @@ public override void SetDefaults() projectile.friendly = true; projectile.aiStyle = 2; projectile.penetrate = 1; - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate = 3; } @@ -28,7 +28,7 @@ public override void SetDefaults() public override void AI() { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) { int[] array = new int[20]; int num428 = 0; @@ -38,9 +38,9 @@ public override void AI() { if (Main.npc[num430].CanBeChasedBy(projectile, false)) { - float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2); - float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2); - float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432); + float num431 = Main.npc[num430].position.X + Main.npc[num430].width / 2; + float num432 = Main.npc[num430].position.Y + Main.npc[num430].height / 2; + float num433 = Math.Abs(projectile.position.X + projectile.width / 2 - num431) + Math.Abs(projectile.position.Y + projectile.height / 2 - num432); if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1)) { if (num428 < 20) @@ -56,18 +56,18 @@ public override void AI() { int num434 = Main.rand.Next(num428); num434 = array[num434]; - float num435 = Main.npc[num434].position.X + (float)(Main.npc[num434].width / 2); - float num436 = Main.npc[num434].position.Y + (float)(Main.npc[num434].height / 2); + float num435 = Main.npc[num434].position.X + Main.npc[num434].width / 2; + float num436 = Main.npc[num434].position.Y + Main.npc[num434].height / 2; projectile.localAI[0] += 1f; if (projectile.localAI[0] > 8f) { projectile.localAI[0] = 0f; float num437 = 6f; - Vector2 value10 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + Vector2 value10 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); value10 += projectile.velocity * 4f; float num438 = num435 - value10.X; float num439 = num436 - value10.Y; - float num440 = (float)Math.Sqrt((double)(num438 * num438 + num439 * num439)); + float num440 = (float)Math.Sqrt(num438 * num438 + num439 * num439); num440 = num437 / num440; num438 *= num440; num439 *= num440; @@ -75,7 +75,6 @@ public override void AI() { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } - return; } } } @@ -95,7 +94,7 @@ public override void ModifyHitNPC(NPC target, ref int damage, ref float knockbac public override bool OnTileCollide(Vector2 oldVelocity) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate--; if (projectile.penetrate <= 0) @@ -125,7 +124,7 @@ public override bool OnTileCollide(Vector2 oldVelocity) public override void Kill(int timeLeft) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) { int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); int b = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); @@ -136,7 +135,7 @@ public override void Kill(int timeLeft) Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 704, 1f); Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 705, 1f); - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) { for (int i = 0; i < 5; i++) { @@ -146,15 +145,15 @@ public override void Kill(int timeLeft) Main.projectile[a].friendly = true; } } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) { int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } @@ -165,23 +164,23 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("CrystalCloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("CrystalCloudPro"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } if (projectile.owner == Main.myPlayer) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("CrystalBlast"), projectile.damage * 2, 1.5f, projectile.owner); Main.projectile[a].scale = 1.5f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("CrystalBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -191,7 +190,7 @@ public override void Kill(int timeLeft) int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 32, 0, 0, mod.ProjectileType("CrystalBlast"), projectile.damage * 2, 1f, projectile.owner); int e = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 32, 0, 0, mod.ProjectileType("CrystalBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("CrystalBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -217,7 +216,7 @@ public override void Kill(int timeLeft) int m = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 70, 0, 0, mod.ProjectileType("CrystalBlast"), projectile.damage * 2, 0.5f, projectile.owner); Main.projectile[m].scale = 0.8f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 60, projectile.position.Y, 0, 0, mod.ProjectileType("CrystalBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -230,7 +229,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y - 40, 0, 0, mod.ProjectileType("CrystalBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 70, projectile.position.Y, 0, 0, mod.ProjectileType("CrystalBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -243,13 +242,13 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 70, projectile.position.Y - 70, 0, 0, mod.ProjectileType("CrystalBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("CrystalBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("CrystalBurst"), projectile.damage, 1f, projectile.owner); @@ -257,7 +256,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-50, projectile.position.Y, 0, 0, mod.ProjectileType("CrystalBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("CrystalBurst"), projectile.damage, 1f, projectile.owner); @@ -267,7 +266,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-100, projectile.position.Y, 0, 0, mod.ProjectileType("CrystalBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("CrystalBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -276,7 +275,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-20, projectile.position.Y, -5, 0, mod.ProjectileType("CrystalSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("CrystalBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -287,7 +286,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y+10, -4, 0, mod.ProjectileType("CrystalSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("CrystalBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -300,7 +299,7 @@ public override void Kill(int timeLeft) int g = Projectile.NewProjectile(projectile.position.X-70, projectile.position.Y+15, -4, 0, mod.ProjectileType("CrystalSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("CrystalBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -320,7 +319,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("CrystalBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -339,7 +338,7 @@ public override void Kill(int timeLeft) Main.projectile[h].scale = 1.2f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("CrystalBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -366,7 +365,7 @@ public override void Kill(int timeLeft) Main.projectile[m].scale = 0.6f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("CrystalBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -378,7 +377,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("CrystalBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -401,7 +400,7 @@ public override void Kill(int timeLeft) Main.projectile[l].scale = 0.75f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("CrystalBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -432,14 +431,14 @@ public override void Kill(int timeLeft) Main.projectile[p].scale = 0.7f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-30, projectile.position.Y, -2, 0, mod.ProjectileType("CrystalBurst"), projectile.damage, 1f, projectile.owner); Projectile.NewProjectile(projectile.position.X+30, projectile.position.Y, +2, 0, mod.ProjectileType("CrystalBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("CrystalBurst"), projectile.damage, 1f, projectile.owner); @@ -448,7 +447,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+60, projectile.position.Y, +3, 0, mod.ProjectileType("CrystalBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("CrystalBurst"), projectile.damage, 1f, projectile.owner); @@ -459,7 +458,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+80, projectile.position.Y, +4, 0, mod.ProjectileType("CrystalBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 4, 0, mod.ProjectileType("CrystalSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -472,7 +471,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 4, mod.ProjectileType("CrystalSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 6, 0, mod.ProjectileType("CrystalSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -485,7 +484,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 6, mod.ProjectileType("CrystalSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 8, 0, mod.ProjectileType("CrystalSkullburst"), projectile.damage * 1, 1f, projectile.owner); diff --git a/Projectiles/Alchemic/DepressionFlaskPro.cs b/Projectiles/Alchemic/DepressionFlaskPro.cs index d4546565..f165dec3 100644 --- a/Projectiles/Alchemic/DepressionFlaskPro.cs +++ b/Projectiles/Alchemic/DepressionFlaskPro.cs @@ -36,10 +36,10 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("DepressionCloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("DepressionCloudPro"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } diff --git a/Projectiles/Alchemic/DukeFlaskPro.cs b/Projectiles/Alchemic/DukeFlaskPro.cs index dc676fd9..4f6d9f35 100644 --- a/Projectiles/Alchemic/DukeFlaskPro.cs +++ b/Projectiles/Alchemic/DukeFlaskPro.cs @@ -1,8 +1,8 @@ using System; +using System.Linq; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; -using System.Linq; using Terraria.ModLoader; namespace Tremor.Projectiles.Alchemic @@ -16,7 +16,7 @@ public override void SetDefaults() projectile.friendly = true; projectile.aiStyle = 2; projectile.penetrate = 1; - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate = 3; } @@ -38,7 +38,7 @@ public override void ModifyHitNPC(NPC target, ref int damage, ref float knockbac public override void AI() { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) { int[] array = new int[20]; int num428 = 0; @@ -48,9 +48,9 @@ public override void AI() { if (Main.npc[num430].CanBeChasedBy(projectile, false)) { - float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2); - float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2); - float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432); + float num431 = Main.npc[num430].position.X + Main.npc[num430].width / 2; + float num432 = Main.npc[num430].position.Y + Main.npc[num430].height / 2; + float num433 = Math.Abs(projectile.position.X + projectile.width / 2 - num431) + Math.Abs(projectile.position.Y + projectile.height / 2 - num432); if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1)) { if (num428 < 20) @@ -66,18 +66,18 @@ public override void AI() { int num434 = Main.rand.Next(num428); num434 = array[num434]; - float num435 = Main.npc[num434].position.X + (float)(Main.npc[num434].width / 2); - float num436 = Main.npc[num434].position.Y + (float)(Main.npc[num434].height / 2); + float num435 = Main.npc[num434].position.X + Main.npc[num434].width / 2; + float num436 = Main.npc[num434].position.Y + Main.npc[num434].height / 2; projectile.localAI[0] += 1f; if (projectile.localAI[0] > 8f) { projectile.localAI[0] = 0f; float num437 = 6f; - Vector2 value10 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + Vector2 value10 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); value10 += projectile.velocity * 4f; float num438 = num435 - value10.X; float num439 = num436 - value10.Y; - float num440 = (float)Math.Sqrt((double)(num438 * num438 + num439 * num439)); + float num440 = (float)Math.Sqrt(num438 * num438 + num439 * num439); num440 = num437 / num440; num438 *= num440; num439 *= num440; @@ -85,7 +85,6 @@ public override void AI() { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } - return; } } } @@ -93,7 +92,7 @@ public override void AI() public override bool OnTileCollide(Vector2 oldVelocity) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate--; if (projectile.penetrate <= 0) @@ -134,7 +133,7 @@ public override void Kill(int timeLeft) Main.PlaySound(29, (int)projectile.position.X, (int)projectile.position.Y, 20); Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 704, 1f); Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 705, 1f); - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) { for (int i = 0; i < 5; i++) { @@ -144,15 +143,15 @@ public override void Kill(int timeLeft) Main.projectile[a].friendly = true; } } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) { int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } if (projectile.owner == Main.myPlayer) @@ -179,13 +178,13 @@ public override void Kill(int timeLeft) for (int num234 = num231; num234 < num231 + num233; num234++) { Tile tile = Main.tile[num232, num234]; - if (tile.active() && (Main.tileSolid[(int)tile.type] || tile.liquid != 0)) + if (tile.active() && (Main.tileSolid[tile.type] || tile.liquid != 0)) { num231 = num234; break; } } - int num236 = Projectile.NewProjectile((float)(num232 * 16 + 8), (float)(num231 * 16 - 24), 0f, 0f, mod.ProjectileType("Dukado"), 80, 4f, Main.myPlayer, 16f, 15f); + int num236 = Projectile.NewProjectile(num232 * 16 + 8, num231 * 16 - 24, 0f, 0f, mod.ProjectileType("Dukado"), 80, 4f, Main.myPlayer, 16f, 15f); int num237 = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0f, 0f, mod.ProjectileType("Dukado"), 80, 4f, Main.myPlayer, 16f, 15f); Main.projectile[num236].netUpdate = true; Main.projectile[num237].netUpdate = true; diff --git a/Projectiles/Alchemic/ExtendedBoomFlaskPro.cs b/Projectiles/Alchemic/ExtendedBoomFlaskPro.cs index 5d6d7a8f..052304c4 100644 --- a/Projectiles/Alchemic/ExtendedBoomFlaskPro.cs +++ b/Projectiles/Alchemic/ExtendedBoomFlaskPro.cs @@ -1,9 +1,9 @@ using System; +using System.Linq; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using System.Linq; namespace Tremor.Projectiles.Alchemic { public class ExtendedBoomFlaskPro : ModProjectile @@ -15,7 +15,7 @@ public override void SetDefaults() projectile.friendly = true; projectile.aiStyle = 2; projectile.penetrate = 1; - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate = 3; } @@ -28,7 +28,7 @@ public override void SetDefaults() public override void AI() { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) { int[] array = new int[20]; int num428 = 0; @@ -38,9 +38,9 @@ public override void AI() { if (Main.npc[num430].CanBeChasedBy(projectile, false)) { - float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2); - float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2); - float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432); + float num431 = Main.npc[num430].position.X + Main.npc[num430].width / 2; + float num432 = Main.npc[num430].position.Y + Main.npc[num430].height / 2; + float num433 = Math.Abs(projectile.position.X + projectile.width / 2 - num431) + Math.Abs(projectile.position.Y + projectile.height / 2 - num432); if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1)) { if (num428 < 20) @@ -56,18 +56,18 @@ public override void AI() { int num434 = Main.rand.Next(num428); num434 = array[num434]; - float num435 = Main.npc[num434].position.X + (float)(Main.npc[num434].width / 2); - float num436 = Main.npc[num434].position.Y + (float)(Main.npc[num434].height / 2); + float num435 = Main.npc[num434].position.X + Main.npc[num434].width / 2; + float num436 = Main.npc[num434].position.Y + Main.npc[num434].height / 2; projectile.localAI[0] += 1f; if (projectile.localAI[0] > 8f) { projectile.localAI[0] = 0f; float num437 = 6f; - Vector2 value10 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + Vector2 value10 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); value10 += projectile.velocity * 4f; float num438 = num435 - value10.X; float num439 = num436 - value10.Y; - float num440 = (float)Math.Sqrt((double)(num438 * num438 + num439 * num439)); + float num440 = (float)Math.Sqrt(num438 * num438 + num439 * num439); num440 = num437 / num440; num438 *= num440; num439 *= num440; @@ -75,7 +75,6 @@ public override void AI() { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } - return; } } } @@ -91,7 +90,7 @@ public override void ModifyHitNPC(NPC target, ref int damage, ref float knockbac public override bool OnTileCollide(Vector2 oldVelocity) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate--; if (projectile.penetrate <= 0) @@ -122,7 +121,7 @@ public override bool OnTileCollide(Vector2 oldVelocity) public override void Kill(int timeLeft) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) { int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); int b = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); @@ -131,7 +130,7 @@ public override void Kill(int timeLeft) Player player = Main.player[projectile.owner]; MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) { for (int i = 0; i < 5; i++) { @@ -141,24 +140,24 @@ public override void Kill(int timeLeft) Main.projectile[a].friendly = true; } } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) { int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.position.X = projectile.position.X + projectile.width / 2; + projectile.position.Y = projectile.position.Y + projectile.height / 2; projectile.width = 80; projectile.height = 80; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.position.X = projectile.position.X - projectile.width / 2; + projectile.position.Y = projectile.position.Y - projectile.height / 2; for (int num628 = 0; num628 < 40; num628++) { int num629 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); @@ -166,7 +165,7 @@ public override void Kill(int timeLeft) if (Main.rand.Next(2) == 0) { Main.dust[num629].scale = 0.5f; - Main.dust[num629].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num629].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } for (int num630 = 0; num630 < 70; num630++) @@ -188,37 +187,37 @@ public override void Kill(int timeLeft) { scaleFactor10 = 1f; } - int num633 = 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 num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13E6D_cp_0 = Main.gore[num633]; expr_13E6D_cp_0.velocity.X = expr_13E6D_cp_0.velocity.X + 1f; Gore expr_13E8D_cp_0 = Main.gore[num633]; expr_13E8D_cp_0.velocity.Y = expr_13E8D_cp_0.velocity.Y + 1f; - num633 = 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), 2f); + num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 2f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13F30_cp_0 = Main.gore[num633]; expr_13F30_cp_0.velocity.X = expr_13F30_cp_0.velocity.X - 1f; Gore expr_13F50_cp_0 = Main.gore[num633]; expr_13F50_cp_0.velocity.Y = expr_13F50_cp_0.velocity.Y + 1f; - num633 = 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); + num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13FF3_cp_0 = Main.gore[num633]; expr_13FF3_cp_0.velocity.X = expr_13FF3_cp_0.velocity.X + 1f; Gore expr_14013_cp_0 = Main.gore[num633]; expr_14013_cp_0.velocity.Y = expr_14013_cp_0.velocity.Y - 1f; - num633 = 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); + num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_140B6_cp_0 = Main.gore[num633]; expr_140B6_cp_0.velocity.X = expr_140B6_cp_0.velocity.X - 1f; Gore expr_140D6_cp_0 = Main.gore[num633]; expr_140D6_cp_0.velocity.Y = expr_140D6_cp_0.velocity.Y - 1f; } - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.position.X = projectile.position.X + projectile.width / 2; + projectile.position.Y = projectile.position.Y + projectile.height / 2; projectile.width = 10; projectile.height = 10; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.position.X = projectile.position.X - projectile.width / 2; + projectile.position.Y = projectile.position.Y - projectile.height / 2; if (!modPlayer.pyro && !modPlayer.nitro) { @@ -227,22 +226,22 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(3, 8); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("BoomCloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("BoomCloudPro"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } if (projectile.owner == Main.myPlayer) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BoomBlast"), projectile.damage * 2, 1.5f, projectile.owner); Main.projectile[a].scale = 1.5f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BoomBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -252,7 +251,7 @@ public override void Kill(int timeLeft) int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 32, 0, 0, mod.ProjectileType("BoomBlast"), projectile.damage * 2, 1f, projectile.owner); int e = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 32, 0, 0, mod.ProjectileType("BoomBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BoomBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -278,7 +277,7 @@ public override void Kill(int timeLeft) int m = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 70, 0, 0, mod.ProjectileType("BoomBlast"), projectile.damage * 2, 0.5f, projectile.owner); Main.projectile[m].scale = 0.8f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 60, projectile.position.Y, 0, 0, mod.ProjectileType("BoomBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -291,7 +290,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y - 40, 0, 0, mod.ProjectileType("BoomBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 70, projectile.position.Y, 0, 0, mod.ProjectileType("BoomBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -304,13 +303,13 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 70, projectile.position.Y - 70, 0, 0, mod.ProjectileType("BoomBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BoomBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BoomBurst"), projectile.damage, 1f, projectile.owner); @@ -318,7 +317,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-50, projectile.position.Y, 0, 0, mod.ProjectileType("BoomBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BoomBurst"), projectile.damage, 1f, projectile.owner); @@ -328,7 +327,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-100, projectile.position.Y, 0, 0, mod.ProjectileType("BoomBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BoomBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -337,7 +336,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-20, projectile.position.Y, -5, 0, mod.ProjectileType("BoomSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BoomBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -348,7 +347,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y+10, -4, 0, mod.ProjectileType("BoomSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BoomBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -361,7 +360,7 @@ public override void Kill(int timeLeft) int g = Projectile.NewProjectile(projectile.position.X-70, projectile.position.Y+15, -4, 0, mod.ProjectileType("BoomSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BoomBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -381,7 +380,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BoomBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -400,7 +399,7 @@ public override void Kill(int timeLeft) Main.projectile[h].scale = 1.2f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BoomBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -427,7 +426,7 @@ public override void Kill(int timeLeft) Main.projectile[m].scale = 0.6f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BoomBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -439,7 +438,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BoomBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -462,7 +461,7 @@ public override void Kill(int timeLeft) Main.projectile[l].scale = 0.75f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("BoomBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -493,14 +492,14 @@ public override void Kill(int timeLeft) Main.projectile[p].scale = 0.7f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-30, projectile.position.Y, -2, 0, mod.ProjectileType("BoomBurst"), projectile.damage, 1f, projectile.owner); Projectile.NewProjectile(projectile.position.X+30, projectile.position.Y, +2, 0, mod.ProjectileType("BoomBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("BoomBurst"), projectile.damage, 1f, projectile.owner); @@ -509,7 +508,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+60, projectile.position.Y, +3, 0, mod.ProjectileType("BoomBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("BoomBurst"), projectile.damage, 1f, projectile.owner); @@ -520,7 +519,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+80, projectile.position.Y, +4, 0, mod.ProjectileType("BoomBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 4, 0, mod.ProjectileType("BoomSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -533,7 +532,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 4, mod.ProjectileType("BoomSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 6, 0, mod.ProjectileType("BoomSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -546,7 +545,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 6, mod.ProjectileType("BoomSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 8, 0, mod.ProjectileType("BoomSkullburst"), projectile.damage * 1, 1f, projectile.owner); diff --git a/Projectiles/Alchemic/ExtendedBurningFlaskPro.cs b/Projectiles/Alchemic/ExtendedBurningFlaskPro.cs index 2ca3a48c..10faca0d 100644 --- a/Projectiles/Alchemic/ExtendedBurningFlaskPro.cs +++ b/Projectiles/Alchemic/ExtendedBurningFlaskPro.cs @@ -1,7 +1,7 @@ using System; +using System.Linq; using Microsoft.Xna.Framework; using Terraria; -using System.Linq; using Terraria.ID; using Terraria.ModLoader; @@ -15,7 +15,7 @@ public override void SetDefaults() projectile.friendly = true; projectile.aiStyle = 2; projectile.penetrate = 1; - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate = 3; } @@ -28,7 +28,7 @@ public override void SetDefaults() public override void AI() { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) { int[] array = new int[20]; int num428 = 0; @@ -38,9 +38,9 @@ public override void AI() { if (Main.npc[num430].CanBeChasedBy(projectile, false)) { - float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2); - float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2); - float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432); + float num431 = Main.npc[num430].position.X + Main.npc[num430].width / 2; + float num432 = Main.npc[num430].position.Y + Main.npc[num430].height / 2; + float num433 = Math.Abs(projectile.position.X + projectile.width / 2 - num431) + Math.Abs(projectile.position.Y + projectile.height / 2 - num432); if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1)) { if (num428 < 20) @@ -56,18 +56,18 @@ public override void AI() { int num434 = Main.rand.Next(num428); num434 = array[num434]; - float num435 = Main.npc[num434].position.X + (float)(Main.npc[num434].width / 2); - float num436 = Main.npc[num434].position.Y + (float)(Main.npc[num434].height / 2); + float num435 = Main.npc[num434].position.X + Main.npc[num434].width / 2; + float num436 = Main.npc[num434].position.Y + Main.npc[num434].height / 2; projectile.localAI[0] += 1f; if (projectile.localAI[0] > 8f) { projectile.localAI[0] = 0f; float num437 = 6f; - Vector2 value10 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + Vector2 value10 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); value10 += projectile.velocity * 4f; float num438 = num435 - value10.X; float num439 = num436 - value10.Y; - float num440 = (float)Math.Sqrt((double)(num438 * num438 + num439 * num439)); + float num440 = (float)Math.Sqrt(num438 * num438 + num439 * num439); num440 = num437 / num440; num438 *= num440; num439 *= num440; @@ -75,7 +75,6 @@ public override void AI() { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } - return; } } } @@ -93,7 +92,7 @@ public override void ModifyHitNPC(NPC target, ref int damage, ref float knockbac public override bool OnTileCollide(Vector2 oldVelocity) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate--; if (projectile.penetrate <= 0) @@ -123,7 +122,7 @@ public override bool OnTileCollide(Vector2 oldVelocity) public override void Kill(int timeLeft) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) { int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); int b = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); @@ -134,7 +133,7 @@ public override void Kill(int timeLeft) Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 704, 1f); Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 705, 1f); - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) { for (int i = 0; i < 5; i++) { @@ -144,15 +143,15 @@ public override void Kill(int timeLeft) Main.projectile[a].friendly = true; } } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) { int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } @@ -163,23 +162,23 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("FieryCloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("FieryCloudPro"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } if (projectile.owner == Main.myPlayer) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1.5f, projectile.owner); Main.projectile[a].scale = 1.5f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -189,7 +188,7 @@ public override void Kill(int timeLeft) int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 32, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1f, projectile.owner); int e = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 32, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -215,7 +214,7 @@ public override void Kill(int timeLeft) int m = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 70, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 0.5f, projectile.owner); Main.projectile[m].scale = 0.8f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 60, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -228,7 +227,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y - 40, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 70, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -241,13 +240,13 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 70, projectile.position.Y - 70, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBurst"), projectile.damage, 1f, projectile.owner); @@ -255,7 +254,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-50, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBurst"), projectile.damage, 1f, projectile.owner); @@ -265,7 +264,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-100, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -274,7 +273,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-20, projectile.position.Y, -5, 0, mod.ProjectileType("FierySkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -285,7 +284,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y+10, -4, 0, mod.ProjectileType("FierySkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -298,7 +297,7 @@ public override void Kill(int timeLeft) int g = Projectile.NewProjectile(projectile.position.X-70, projectile.position.Y+15, -4, 0, mod.ProjectileType("FierySkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -318,7 +317,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -337,7 +336,7 @@ public override void Kill(int timeLeft) Main.projectile[h].scale = 1.2f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -364,7 +363,7 @@ public override void Kill(int timeLeft) Main.projectile[m].scale = 0.6f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -376,7 +375,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -399,7 +398,7 @@ public override void Kill(int timeLeft) Main.projectile[l].scale = 0.75f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -430,14 +429,14 @@ public override void Kill(int timeLeft) Main.projectile[p].scale = 0.7f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-30, projectile.position.Y, -2, 0, mod.ProjectileType("FieryBurst"), projectile.damage, 1f, projectile.owner); Projectile.NewProjectile(projectile.position.X+30, projectile.position.Y, +2, 0, mod.ProjectileType("FieryBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("FieryBurst"), projectile.damage, 1f, projectile.owner); @@ -446,7 +445,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+60, projectile.position.Y, +3, 0, mod.ProjectileType("FieryBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("FieryBurst"), projectile.damage, 1f, projectile.owner); @@ -457,7 +456,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+80, projectile.position.Y, +4, 0, mod.ProjectileType("FieryBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 4, 0, mod.ProjectileType("FierySkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -470,7 +469,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 4, mod.ProjectileType("FierySkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 6, 0, mod.ProjectileType("FierySkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -483,7 +482,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 6, mod.ProjectileType("FierySkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 8, 0, mod.ProjectileType("FierySkullburst"), projectile.damage * 1, 1f, projectile.owner); diff --git a/Projectiles/Alchemic/ExtendedFreezeFlaskPro.cs b/Projectiles/Alchemic/ExtendedFreezeFlaskPro.cs index e78cdbed..2e618842 100644 --- a/Projectiles/Alchemic/ExtendedFreezeFlaskPro.cs +++ b/Projectiles/Alchemic/ExtendedFreezeFlaskPro.cs @@ -1,7 +1,7 @@ using System; +using System.Linq; using Microsoft.Xna.Framework; using Terraria; -using System.Linq; using Terraria.ID; using Terraria.ModLoader; @@ -15,7 +15,7 @@ public override void SetDefaults() projectile.friendly = true; projectile.aiStyle = 2; projectile.penetrate = 1; - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate = 3; } @@ -28,7 +28,7 @@ public override void SetDefaults() public override void AI() { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) { int[] array = new int[20]; int num428 = 0; @@ -38,9 +38,9 @@ public override void AI() { if (Main.npc[num430].CanBeChasedBy(projectile, false)) { - float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2); - float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2); - float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432); + float num431 = Main.npc[num430].position.X + Main.npc[num430].width / 2; + float num432 = Main.npc[num430].position.Y + Main.npc[num430].height / 2; + float num433 = Math.Abs(projectile.position.X + projectile.width / 2 - num431) + Math.Abs(projectile.position.Y + projectile.height / 2 - num432); if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1)) { if (num428 < 20) @@ -56,18 +56,18 @@ public override void AI() { int num434 = Main.rand.Next(num428); num434 = array[num434]; - float num435 = Main.npc[num434].position.X + (float)(Main.npc[num434].width / 2); - float num436 = Main.npc[num434].position.Y + (float)(Main.npc[num434].height / 2); + float num435 = Main.npc[num434].position.X + Main.npc[num434].width / 2; + float num436 = Main.npc[num434].position.Y + Main.npc[num434].height / 2; projectile.localAI[0] += 1f; if (projectile.localAI[0] > 8f) { projectile.localAI[0] = 0f; float num437 = 6f; - Vector2 value10 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + Vector2 value10 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); value10 += projectile.velocity * 4f; float num438 = num435 - value10.X; float num439 = num436 - value10.Y; - float num440 = (float)Math.Sqrt((double)(num438 * num438 + num439 * num439)); + float num440 = (float)Math.Sqrt(num438 * num438 + num439 * num439); num440 = num437 / num440; num438 *= num440; num439 *= num440; @@ -75,7 +75,6 @@ public override void AI() { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } - return; } } } @@ -94,7 +93,7 @@ public override void ModifyHitNPC(NPC target, ref int damage, ref float knockbac public override bool OnTileCollide(Vector2 oldVelocity) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate--; if (projectile.penetrate <= 0) @@ -124,7 +123,7 @@ public override bool OnTileCollide(Vector2 oldVelocity) public override void Kill(int timeLeft) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) { int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); int b = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); @@ -135,7 +134,7 @@ public override void Kill(int timeLeft) Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 704, 1f); Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 705, 1f); - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) { for (int i = 0; i < 5; i++) { @@ -145,15 +144,15 @@ public override void Kill(int timeLeft) Main.projectile[a].friendly = true; } } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) { int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } @@ -164,23 +163,23 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("FrostCloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("FrostCloudPro"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } if (projectile.owner == Main.myPlayer) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FrostBlast"), projectile.damage * 2, 1.5f, projectile.owner); Main.projectile[a].scale = 1.5f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FrostBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -190,7 +189,7 @@ public override void Kill(int timeLeft) int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 32, 0, 0, mod.ProjectileType("FrostBlast"), projectile.damage * 2, 1f, projectile.owner); int e = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 32, 0, 0, mod.ProjectileType("FrostBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FrostBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -216,7 +215,7 @@ public override void Kill(int timeLeft) int m = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 70, 0, 0, mod.ProjectileType("FrostBlast"), projectile.damage * 2, 0.5f, projectile.owner); Main.projectile[m].scale = 0.8f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 60, projectile.position.Y, 0, 0, mod.ProjectileType("FrostBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -229,7 +228,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y - 40, 0, 0, mod.ProjectileType("FrostBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 70, projectile.position.Y, 0, 0, mod.ProjectileType("FrostBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -242,13 +241,13 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 70, projectile.position.Y - 70, 0, 0, mod.ProjectileType("FrostBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FrostBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FrostBurst"), projectile.damage, 1f, projectile.owner); @@ -256,7 +255,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-50, projectile.position.Y, 0, 0, mod.ProjectileType("FrostBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FrostBurst"), projectile.damage, 1f, projectile.owner); @@ -266,7 +265,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-100, projectile.position.Y, 0, 0, mod.ProjectileType("FrostBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FrostBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -275,7 +274,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-20, projectile.position.Y, -5, 0, mod.ProjectileType("FrostSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FrostBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -286,7 +285,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y+10, -4, 0, mod.ProjectileType("FrostSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FrostBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -299,7 +298,7 @@ public override void Kill(int timeLeft) int g = Projectile.NewProjectile(projectile.position.X-70, projectile.position.Y+15, -4, 0, mod.ProjectileType("FrostSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FrostBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -319,7 +318,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FrostBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -338,7 +337,7 @@ public override void Kill(int timeLeft) Main.projectile[h].scale = 1.2f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FrostBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -365,7 +364,7 @@ public override void Kill(int timeLeft) Main.projectile[m].scale = 0.6f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FrostBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -377,7 +376,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FrostBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -400,7 +399,7 @@ public override void Kill(int timeLeft) Main.projectile[l].scale = 0.75f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FrostBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -431,14 +430,14 @@ public override void Kill(int timeLeft) Main.projectile[p].scale = 0.7f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-30, projectile.position.Y, -2, 0, mod.ProjectileType("FrostBurst"), projectile.damage, 1f, projectile.owner); Projectile.NewProjectile(projectile.position.X+30, projectile.position.Y, +2, 0, mod.ProjectileType("FrostBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("FrostBurst"), projectile.damage, 1f, projectile.owner); @@ -447,7 +446,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+60, projectile.position.Y, +3, 0, mod.ProjectileType("FrostBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("FrostBurst"), projectile.damage, 1f, projectile.owner); @@ -458,7 +457,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+80, projectile.position.Y, +4, 0, mod.ProjectileType("FrostBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 4, 0, mod.ProjectileType("FrostSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -471,7 +470,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 4, mod.ProjectileType("FrostSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 6, 0, mod.ProjectileType("FrostSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -484,7 +483,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 6, mod.ProjectileType("FrostSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 8, 0, mod.ProjectileType("FrostSkullburst"), projectile.damage * 1, 1f, projectile.owner); diff --git a/Projectiles/Alchemic/FreezeFlaskPro.cs b/Projectiles/Alchemic/FreezeFlaskPro.cs index ffd80d3e..8789a960 100644 --- a/Projectiles/Alchemic/FreezeFlaskPro.cs +++ b/Projectiles/Alchemic/FreezeFlaskPro.cs @@ -1,8 +1,8 @@ using System; +using System.Linq; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; -using System.Linq; using Terraria.ModLoader; namespace Tremor.Projectiles.Alchemic { @@ -15,7 +15,7 @@ public override void SetDefaults() projectile.friendly = true; projectile.aiStyle = 2; projectile.penetrate = 1; - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate = 3; } @@ -28,7 +28,7 @@ public override void SetDefaults() public override void AI() { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) { int[] array = new int[20]; int num428 = 0; @@ -38,9 +38,9 @@ public override void AI() { if (Main.npc[num430].CanBeChasedBy(projectile, false)) { - float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2); - float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2); - float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432); + float num431 = Main.npc[num430].position.X + Main.npc[num430].width / 2; + float num432 = Main.npc[num430].position.Y + Main.npc[num430].height / 2; + float num433 = Math.Abs(projectile.position.X + projectile.width / 2 - num431) + Math.Abs(projectile.position.Y + projectile.height / 2 - num432); if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1)) { if (num428 < 20) @@ -56,18 +56,18 @@ public override void AI() { int num434 = Main.rand.Next(num428); num434 = array[num434]; - float num435 = Main.npc[num434].position.X + (float)(Main.npc[num434].width / 2); - float num436 = Main.npc[num434].position.Y + (float)(Main.npc[num434].height / 2); + float num435 = Main.npc[num434].position.X + Main.npc[num434].width / 2; + float num436 = Main.npc[num434].position.Y + Main.npc[num434].height / 2; projectile.localAI[0] += 1f; if (projectile.localAI[0] > 8f) { projectile.localAI[0] = 0f; float num437 = 6f; - Vector2 value10 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + Vector2 value10 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); value10 += projectile.velocity * 4f; float num438 = num435 - value10.X; float num439 = num436 - value10.Y; - float num440 = (float)Math.Sqrt((double)(num438 * num438 + num439 * num439)); + float num440 = (float)Math.Sqrt(num438 * num438 + num439 * num439); num440 = num437 / num440; num438 *= num440; num439 *= num440; @@ -75,7 +75,6 @@ public override void AI() { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } - return; } } } @@ -92,7 +91,7 @@ public override void ModifyHitNPC(NPC target, ref int damage, ref float knockbac public override bool OnTileCollide(Vector2 oldVelocity) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate--; if (projectile.penetrate <= 0) @@ -128,7 +127,7 @@ public override void Kill(int timeLeft) Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 704, 1f); Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 705, 1f); - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) { for (int i = 0; i < 5; i++) { @@ -138,15 +137,15 @@ public override void Kill(int timeLeft) Main.projectile[a].friendly = true; } } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) { int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } @@ -157,28 +156,28 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("FrostCloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("FrostCloudPro"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } if (projectile.owner == Main.myPlayer) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) { int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); int b = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FrostBlast"), projectile.damage * 2, 1.5f, projectile.owner); Main.projectile[a].scale = 1.5f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FrostBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -188,7 +187,7 @@ public override void Kill(int timeLeft) int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 32, 0, 0, mod.ProjectileType("FrostBlast"), projectile.damage * 2, 1f, projectile.owner); int e = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 32, 0, 0, mod.ProjectileType("FrostBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FrostBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -214,7 +213,7 @@ public override void Kill(int timeLeft) int m = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 70, 0, 0, mod.ProjectileType("FrostBlast"), projectile.damage * 2, 0.5f, projectile.owner); Main.projectile[m].scale = 0.8f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 60, projectile.position.Y, 0, 0, mod.ProjectileType("FrostBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -227,7 +226,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y - 40, 0, 0, mod.ProjectileType("FrostBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 70, projectile.position.Y, 0, 0, mod.ProjectileType("FrostBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -240,13 +239,13 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 70, projectile.position.Y - 70, 0, 0, mod.ProjectileType("FrostBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FrostBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FrostBurst"), projectile.damage, 1f, projectile.owner); @@ -254,7 +253,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-50, projectile.position.Y, 0, 0, mod.ProjectileType("FrostBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FrostBurst"), projectile.damage, 1f, projectile.owner); @@ -264,7 +263,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-100, projectile.position.Y, 0, 0, mod.ProjectileType("FrostBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FrostBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -273,7 +272,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-20, projectile.position.Y, -5, 0, mod.ProjectileType("FrostSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FrostBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -284,7 +283,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y+10, -4, 0, mod.ProjectileType("FrostSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FrostBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -297,7 +296,7 @@ public override void Kill(int timeLeft) int g = Projectile.NewProjectile(projectile.position.X-70, projectile.position.Y+15, -4, 0, mod.ProjectileType("FrostSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FrostBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -317,7 +316,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FrostBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -336,7 +335,7 @@ public override void Kill(int timeLeft) Main.projectile[h].scale = 1.2f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FrostBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -363,7 +362,7 @@ public override void Kill(int timeLeft) Main.projectile[m].scale = 0.6f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FrostBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -375,7 +374,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FrostBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -398,7 +397,7 @@ public override void Kill(int timeLeft) Main.projectile[l].scale = 0.75f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FrostBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -429,14 +428,14 @@ public override void Kill(int timeLeft) Main.projectile[p].scale = 0.7f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-30, projectile.position.Y, -2, 0, mod.ProjectileType("FrostBurst"), projectile.damage, 1f, projectile.owner); Projectile.NewProjectile(projectile.position.X+30, projectile.position.Y, +2, 0, mod.ProjectileType("FrostBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("FrostBurst"), projectile.damage, 1f, projectile.owner); @@ -445,7 +444,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+60, projectile.position.Y, +3, 0, mod.ProjectileType("FrostBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("FrostBurst"), projectile.damage, 1f, projectile.owner); @@ -456,7 +455,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+80, projectile.position.Y, +4, 0, mod.ProjectileType("FrostBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 4, 0, mod.ProjectileType("FrostSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -469,7 +468,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 4, mod.ProjectileType("FrostSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 6, 0, mod.ProjectileType("FrostSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -482,7 +481,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 6, mod.ProjectileType("FrostSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 8, 0, mod.ProjectileType("FrostSkullburst"), projectile.damage * 1, 1f, projectile.owner); diff --git a/Projectiles/Alchemic/GoldFlaskPro.cs b/Projectiles/Alchemic/GoldFlaskPro.cs index 92210a8e..63afe53c 100644 --- a/Projectiles/Alchemic/GoldFlaskPro.cs +++ b/Projectiles/Alchemic/GoldFlaskPro.cs @@ -1,7 +1,7 @@ using System; +using System.Linq; using Microsoft.Xna.Framework; using Terraria; -using System.Linq; using Terraria.ID; using Terraria.ModLoader; @@ -16,7 +16,7 @@ public override void SetDefaults() projectile.aiStyle = 2; projectile.timeLeft = 1200; projectile.penetrate = 1; - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate = 3; } @@ -28,7 +28,7 @@ public override void SetDefaults() public override void AI() { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) { int[] array = new int[20]; int num428 = 0; @@ -38,9 +38,9 @@ public override void AI() { if (Main.npc[num430].CanBeChasedBy(projectile, false)) { - float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2); - float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2); - float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432); + float num431 = Main.npc[num430].position.X + Main.npc[num430].width / 2; + float num432 = Main.npc[num430].position.Y + Main.npc[num430].height / 2; + float num433 = Math.Abs(projectile.position.X + projectile.width / 2 - num431) + Math.Abs(projectile.position.Y + projectile.height / 2 - num432); if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1)) { if (num428 < 20) @@ -56,18 +56,18 @@ public override void AI() { int num434 = Main.rand.Next(num428); num434 = array[num434]; - float num435 = Main.npc[num434].position.X + (float)(Main.npc[num434].width / 2); - float num436 = Main.npc[num434].position.Y + (float)(Main.npc[num434].height / 2); + float num435 = Main.npc[num434].position.X + Main.npc[num434].width / 2; + float num436 = Main.npc[num434].position.Y + Main.npc[num434].height / 2; projectile.localAI[0] += 1f; if (projectile.localAI[0] > 8f) { projectile.localAI[0] = 0f; float num437 = 6f; - Vector2 value10 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + Vector2 value10 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); value10 += projectile.velocity * 4f; float num438 = num435 - value10.X; float num439 = num436 - value10.Y; - float num440 = (float)Math.Sqrt((double)(num438 * num438 + num439 * num439)); + float num440 = (float)Math.Sqrt(num438 * num438 + num439 * num439); num440 = num437 / num440; num438 *= num440; num439 *= num440; @@ -75,7 +75,6 @@ public override void AI() { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } - return; } } } @@ -93,7 +92,7 @@ public override void ModifyHitNPC(NPC target, ref int damage, ref float knockbac public override bool OnTileCollide(Vector2 oldVelocity) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate--; if (projectile.penetrate <= 0) @@ -129,7 +128,7 @@ public override void Kill(int timeLeft) Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 704, 1f); Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 705, 1f); - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) { for (int i = 0; i < 5; i++) { @@ -139,15 +138,15 @@ public override void Kill(int timeLeft) Main.projectile[a].friendly = true; } } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) { int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } @@ -158,28 +157,28 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("GoldenCloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("GoldenCloudPro"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } if (projectile.owner == Main.myPlayer) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) { int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); int b = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("GoldenBlast"), projectile.damage * 2, 1.5f, projectile.owner); Main.projectile[a].scale = 1.5f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("GoldenBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -189,7 +188,7 @@ public override void Kill(int timeLeft) int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 32, 0, 0, mod.ProjectileType("GoldenBlast"), projectile.damage * 2, 1f, projectile.owner); int e = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 32, 0, 0, mod.ProjectileType("GoldenBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("GoldenBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -215,7 +214,7 @@ public override void Kill(int timeLeft) int m = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 70, 0, 0, mod.ProjectileType("GoldenBlast"), projectile.damage * 2, 0.5f, projectile.owner); Main.projectile[m].scale = 0.8f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 60, projectile.position.Y, 0, 0, mod.ProjectileType("GoldenBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -228,7 +227,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y - 40, 0, 0, mod.ProjectileType("GoldenBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 70, projectile.position.Y, 0, 0, mod.ProjectileType("GoldenBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -241,13 +240,13 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 70, projectile.position.Y - 70, 0, 0, mod.ProjectileType("GoldenBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("GoldenBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("GoldenBurst"), projectile.damage, 1f, projectile.owner); @@ -255,7 +254,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-50, projectile.position.Y, 0, 0, mod.ProjectileType("GoldenBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("GoldenBurst"), projectile.damage, 1f, projectile.owner); @@ -265,7 +264,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-100, projectile.position.Y, 0, 0, mod.ProjectileType("GoldenBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("GoldenBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -274,7 +273,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-20, projectile.position.Y, -5, 0, mod.ProjectileType("GoldenSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("GoldenBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -285,7 +284,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y+10, -4, 0, mod.ProjectileType("GoldenSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("GoldenBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -298,7 +297,7 @@ public override void Kill(int timeLeft) int g = Projectile.NewProjectile(projectile.position.X-70, projectile.position.Y+15, -4, 0, mod.ProjectileType("GoldenSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("GoldenBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -318,7 +317,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("GoldenBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -337,7 +336,7 @@ public override void Kill(int timeLeft) Main.projectile[h].scale = 1.2f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("GoldenBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -364,7 +363,7 @@ public override void Kill(int timeLeft) Main.projectile[m].scale = 0.6f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("GoldenBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -376,7 +375,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("GoldenBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -399,7 +398,7 @@ public override void Kill(int timeLeft) Main.projectile[l].scale = 0.75f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("GoldenBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -430,14 +429,14 @@ public override void Kill(int timeLeft) Main.projectile[p].scale = 0.7f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-30, projectile.position.Y, -2, 0, mod.ProjectileType("GoldenBurst"), projectile.damage, 1f, projectile.owner); Projectile.NewProjectile(projectile.position.X+30, projectile.position.Y, +2, 0, mod.ProjectileType("GoldenBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("GoldenBurst"), projectile.damage, 1f, projectile.owner); @@ -446,7 +445,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+60, projectile.position.Y, +3, 0, mod.ProjectileType("GoldenBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("GoldenBurst"), projectile.damage, 1f, projectile.owner); @@ -457,7 +456,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+80, projectile.position.Y, +4, 0, mod.ProjectileType("GoldenBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 4, 0, mod.ProjectileType("GoldenSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -470,7 +469,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 4, mod.ProjectileType("GoldenSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 6, 0, mod.ProjectileType("GoldenSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -483,7 +482,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 6, mod.ProjectileType("GoldenSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 8, 0, mod.ProjectileType("GoldenSkullburst"), projectile.damage * 1, 1f, projectile.owner); diff --git a/Projectiles/Alchemic/HealingCloudPro.cs b/Projectiles/Alchemic/HealingCloudPro.cs index 218c5f9c..80f4543e 100644 --- a/Projectiles/Alchemic/HealingCloudPro.cs +++ b/Projectiles/Alchemic/HealingCloudPro.cs @@ -1,5 +1,5 @@ -using Terraria; using System.Linq; +using Terraria; using Terraria.ModLoader; namespace Tremor.Projectiles.Alchemic @@ -32,7 +32,7 @@ public override void AI() public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ConcentratedTinctureBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ConcentratedTinctureBuff"))) { int newLife = 2; Main.player[projectile.owner].statLife += newLife; diff --git a/Projectiles/Alchemic/HealthSupportFlaskPro.cs b/Projectiles/Alchemic/HealthSupportFlaskPro.cs index 6fcb60eb..18a8f15b 100644 --- a/Projectiles/Alchemic/HealthSupportFlaskPro.cs +++ b/Projectiles/Alchemic/HealthSupportFlaskPro.cs @@ -1,8 +1,8 @@ +using System.Linq; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using System.Linq; namespace Tremor.Projectiles.Alchemic { @@ -29,7 +29,7 @@ public override void ModifyHitNPC(NPC target, ref int damage, ref float knockbac public override void Kill(int timeLeft) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) { int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); int b = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); @@ -42,10 +42,10 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("HealthSupportCloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("HealthSupportCloudPro"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } diff --git a/Projectiles/Alchemic/LesserHealingFlackPro.cs b/Projectiles/Alchemic/LesserHealingFlackPro.cs index 945bfdfc..1fd1ef10 100644 --- a/Projectiles/Alchemic/LesserHealingFlackPro.cs +++ b/Projectiles/Alchemic/LesserHealingFlackPro.cs @@ -1,8 +1,8 @@ using System; +using System.Linq; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; -using System.Linq; using Terraria.ModLoader; namespace Tremor.Projectiles.Alchemic { @@ -16,7 +16,7 @@ public override void SetDefaults() projectile.aiStyle = 2; projectile.timeLeft = 1200; projectile.penetrate = 1; - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate = 3; } @@ -29,7 +29,7 @@ public override void SetDefaults() public override void AI() { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) { int[] array = new int[20]; int num428 = 0; @@ -39,9 +39,9 @@ public override void AI() { if (Main.npc[num430].CanBeChasedBy(projectile, false)) { - float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2); - float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2); - float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432); + float num431 = Main.npc[num430].position.X + Main.npc[num430].width / 2; + float num432 = Main.npc[num430].position.Y + Main.npc[num430].height / 2; + float num433 = Math.Abs(projectile.position.X + projectile.width / 2 - num431) + Math.Abs(projectile.position.Y + projectile.height / 2 - num432); if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1)) { if (num428 < 20) @@ -57,18 +57,18 @@ public override void AI() { int num434 = Main.rand.Next(num428); num434 = array[num434]; - float num435 = Main.npc[num434].position.X + (float)(Main.npc[num434].width / 2); - float num436 = Main.npc[num434].position.Y + (float)(Main.npc[num434].height / 2); + float num435 = Main.npc[num434].position.X + Main.npc[num434].width / 2; + float num436 = Main.npc[num434].position.Y + Main.npc[num434].height / 2; projectile.localAI[0] += 1f; if (projectile.localAI[0] > 8f) { projectile.localAI[0] = 0f; float num437 = 6f; - Vector2 value10 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + Vector2 value10 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); value10 += projectile.velocity * 4f; float num438 = num435 - value10.X; float num439 = num436 - value10.Y; - float num440 = (float)Math.Sqrt((double)(num438 * num438 + num439 * num439)); + float num440 = (float)Math.Sqrt(num438 * num438 + num439 * num439); num440 = num437 / num440; num438 *= num440; num439 *= num440; @@ -76,7 +76,6 @@ public override void AI() { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } - return; } } } @@ -92,7 +91,7 @@ public override void ModifyHitNPC(NPC target, ref int damage, ref float knockbac public override bool OnTileCollide(Vector2 oldVelocity) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate--; if (projectile.penetrate <= 0) @@ -129,7 +128,7 @@ public override void Kill(int timeLeft) Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 704, 1f); Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 705, 1f); - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) { for (int i = 0; i < 5; i++) { @@ -139,15 +138,15 @@ public override void Kill(int timeLeft) Main.projectile[a].friendly = true; } } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) { int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } @@ -158,28 +157,28 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("HealingCloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("HealingCloudPro"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } if (projectile.owner == Main.myPlayer) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) { int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); int b = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1.5f, projectile.owner); Main.projectile[a].scale = 1.5f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -189,7 +188,7 @@ public override void Kill(int timeLeft) int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 32, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1f, projectile.owner); int e = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 32, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -215,7 +214,7 @@ public override void Kill(int timeLeft) int m = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 70, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 0.5f, projectile.owner); Main.projectile[m].scale = 0.8f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 60, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -228,7 +227,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y - 40, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 70, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -241,13 +240,13 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 70, projectile.position.Y - 70, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBurst"), projectile.damage, 1f, projectile.owner); @@ -255,7 +254,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-50, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBurst"), projectile.damage, 1f, projectile.owner); @@ -265,7 +264,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-100, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -274,7 +273,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-20, projectile.position.Y, -5, 0, mod.ProjectileType("HealingSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -285,7 +284,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y+10, -4, 0, mod.ProjectileType("HealingSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -298,7 +297,7 @@ public override void Kill(int timeLeft) int g = Projectile.NewProjectile(projectile.position.X-70, projectile.position.Y+15, -4, 0, mod.ProjectileType("HealingSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -318,7 +317,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -337,7 +336,7 @@ public override void Kill(int timeLeft) Main.projectile[h].scale = 1.2f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -364,7 +363,7 @@ public override void Kill(int timeLeft) Main.projectile[m].scale = 0.6f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -376,7 +375,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -399,7 +398,7 @@ public override void Kill(int timeLeft) Main.projectile[l].scale = 0.75f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -430,14 +429,14 @@ public override void Kill(int timeLeft) Main.projectile[p].scale = 0.7f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-30, projectile.position.Y, -2, 0, mod.ProjectileType("HealingBurst"), projectile.damage, 1f, projectile.owner); Projectile.NewProjectile(projectile.position.X+30, projectile.position.Y, +2, 0, mod.ProjectileType("HealingBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("HealingBurst"), projectile.damage, 1f, projectile.owner); @@ -446,7 +445,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+60, projectile.position.Y, +3, 0, mod.ProjectileType("HealingBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("HealingBurst"), projectile.damage, 1f, projectile.owner); @@ -457,7 +456,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+80, projectile.position.Y, +4, 0, mod.ProjectileType("HealingBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 4, 0, mod.ProjectileType("HealingSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -470,7 +469,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 4, mod.ProjectileType("HealingSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 6, 0, mod.ProjectileType("HealingSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -483,7 +482,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 6, mod.ProjectileType("HealingSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 8, 0, mod.ProjectileType("HealingSkullburst"), projectile.damage * 1, 1f, projectile.owner); diff --git a/Projectiles/Alchemic/LesserManaFlaskPro.cs b/Projectiles/Alchemic/LesserManaFlaskPro.cs index 60ec0527..7dd9bd10 100644 --- a/Projectiles/Alchemic/LesserManaFlaskPro.cs +++ b/Projectiles/Alchemic/LesserManaFlaskPro.cs @@ -1,9 +1,9 @@ using System; +using System.Linq; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using System.Linq; namespace Tremor.Projectiles.Alchemic { public class LesserManaFlaskPro : ModProjectile @@ -16,7 +16,7 @@ public override void SetDefaults() projectile.aiStyle = 2; projectile.timeLeft = 1200; projectile.penetrate = 1; - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate = 3; } @@ -28,7 +28,7 @@ public override void SetDefaults() public override void AI() { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) { int[] array = new int[20]; int num428 = 0; @@ -38,9 +38,9 @@ public override void AI() { if (Main.npc[num430].CanBeChasedBy(projectile, false)) { - float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2); - float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2); - float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432); + float num431 = Main.npc[num430].position.X + Main.npc[num430].width / 2; + float num432 = Main.npc[num430].position.Y + Main.npc[num430].height / 2; + float num433 = Math.Abs(projectile.position.X + projectile.width / 2 - num431) + Math.Abs(projectile.position.Y + projectile.height / 2 - num432); if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1)) { if (num428 < 20) @@ -56,18 +56,18 @@ public override void AI() { int num434 = Main.rand.Next(num428); num434 = array[num434]; - float num435 = Main.npc[num434].position.X + (float)(Main.npc[num434].width / 2); - float num436 = Main.npc[num434].position.Y + (float)(Main.npc[num434].height / 2); + float num435 = Main.npc[num434].position.X + Main.npc[num434].width / 2; + float num436 = Main.npc[num434].position.Y + Main.npc[num434].height / 2; projectile.localAI[0] += 1f; if (projectile.localAI[0] > 8f) { projectile.localAI[0] = 0f; float num437 = 6f; - Vector2 value10 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + Vector2 value10 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); value10 += projectile.velocity * 4f; float num438 = num435 - value10.X; float num439 = num436 - value10.Y; - float num440 = (float)Math.Sqrt((double)(num438 * num438 + num439 * num439)); + float num440 = (float)Math.Sqrt(num438 * num438 + num439 * num439); num440 = num437 / num440; num438 *= num440; num439 *= num440; @@ -75,7 +75,6 @@ public override void AI() { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } - return; } } } @@ -92,7 +91,7 @@ public override void ModifyHitNPC(NPC target, ref int damage, ref float knockbac public override bool OnTileCollide(Vector2 oldVelocity) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate--; if (projectile.penetrate <= 0) @@ -129,7 +128,7 @@ public override void Kill(int timeLeft) Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 704, 1f); Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 705, 1f); - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) { for (int i = 0; i < 5; i++) { @@ -139,15 +138,15 @@ public override void Kill(int timeLeft) Main.projectile[a].friendly = true; } } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) { int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } @@ -158,28 +157,28 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("ManaCloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("ManaCloudPro"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } if (projectile.owner == Main.myPlayer) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) { int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); int b = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1.5f, projectile.owner); Main.projectile[a].scale = 1.5f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -189,7 +188,7 @@ public override void Kill(int timeLeft) int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 32, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1f, projectile.owner); int e = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 32, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -215,7 +214,7 @@ public override void Kill(int timeLeft) int m = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 70, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 0.5f, projectile.owner); Main.projectile[m].scale = 0.8f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 60, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -228,7 +227,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y - 40, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 70, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -241,13 +240,13 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 70, projectile.position.Y - 70, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBurst"), projectile.damage, 1f, projectile.owner); @@ -255,7 +254,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-50, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBurst"), projectile.damage, 1f, projectile.owner); @@ -265,7 +264,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-100, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -274,7 +273,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-20, projectile.position.Y, -5, 0, mod.ProjectileType("ManaSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -285,7 +284,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y+10, -4, 0, mod.ProjectileType("ManaSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -298,7 +297,7 @@ public override void Kill(int timeLeft) int g = Projectile.NewProjectile(projectile.position.X-70, projectile.position.Y+15, -4, 0, mod.ProjectileType("ManaSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -318,7 +317,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -337,7 +336,7 @@ public override void Kill(int timeLeft) Main.projectile[h].scale = 1.2f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -364,7 +363,7 @@ public override void Kill(int timeLeft) Main.projectile[m].scale = 0.6f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -376,7 +375,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -399,7 +398,7 @@ public override void Kill(int timeLeft) Main.projectile[l].scale = 0.75f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -430,14 +429,14 @@ public override void Kill(int timeLeft) Main.projectile[p].scale = 0.7f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-30, projectile.position.Y, -2, 0, mod.ProjectileType("ManaBurst"), projectile.damage, 1f, projectile.owner); Projectile.NewProjectile(projectile.position.X+30, projectile.position.Y, +2, 0, mod.ProjectileType("ManaBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("ManaBurst"), projectile.damage, 1f, projectile.owner); @@ -446,7 +445,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+60, projectile.position.Y, +3, 0, mod.ProjectileType("ManaBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("ManaBurst"), projectile.damage, 1f, projectile.owner); @@ -457,7 +456,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+80, projectile.position.Y, +4, 0, mod.ProjectileType("ManaBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 4, 0, mod.ProjectileType("ManaSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -470,7 +469,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 4, mod.ProjectileType("ManaSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 6, 0, mod.ProjectileType("ManaSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -483,7 +482,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 6, mod.ProjectileType("ManaSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 8, 0, mod.ProjectileType("ManaSkullburst"), projectile.damage * 1, 1f, projectile.owner); diff --git a/Projectiles/Alchemic/LesserPoisonFlaskPro.cs b/Projectiles/Alchemic/LesserPoisonFlaskPro.cs index df28935a..a37768fa 100644 --- a/Projectiles/Alchemic/LesserPoisonFlaskPro.cs +++ b/Projectiles/Alchemic/LesserPoisonFlaskPro.cs @@ -1,9 +1,9 @@ using System; +using System.Linq; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using System.Linq; namespace Tremor.Projectiles.Alchemic { public class LesserPoisonFlaskPro : ModProjectile @@ -15,7 +15,7 @@ public override void SetDefaults() projectile.friendly = true; projectile.aiStyle = 2; projectile.penetrate = 1; - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate = 3; } @@ -28,7 +28,7 @@ public override void SetDefaults() public override void AI() { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) { int[] array = new int[20]; int num428 = 0; @@ -38,9 +38,9 @@ public override void AI() { if (Main.npc[num430].CanBeChasedBy(projectile, false)) { - float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2); - float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2); - float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432); + float num431 = Main.npc[num430].position.X + Main.npc[num430].width / 2; + float num432 = Main.npc[num430].position.Y + Main.npc[num430].height / 2; + float num433 = Math.Abs(projectile.position.X + projectile.width / 2 - num431) + Math.Abs(projectile.position.Y + projectile.height / 2 - num432); if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1)) { if (num428 < 20) @@ -56,18 +56,18 @@ public override void AI() { int num434 = Main.rand.Next(num428); num434 = array[num434]; - float num435 = Main.npc[num434].position.X + (float)(Main.npc[num434].width / 2); - float num436 = Main.npc[num434].position.Y + (float)(Main.npc[num434].height / 2); + float num435 = Main.npc[num434].position.X + Main.npc[num434].width / 2; + float num436 = Main.npc[num434].position.Y + Main.npc[num434].height / 2; projectile.localAI[0] += 1f; if (projectile.localAI[0] > 8f) { projectile.localAI[0] = 0f; float num437 = 6f; - Vector2 value10 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + Vector2 value10 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); value10 += projectile.velocity * 4f; float num438 = num435 - value10.X; float num439 = num436 - value10.Y; - float num440 = (float)Math.Sqrt((double)(num438 * num438 + num439 * num439)); + float num440 = (float)Math.Sqrt(num438 * num438 + num439 * num439); num440 = num437 / num440; num438 *= num440; num439 *= num440; @@ -75,7 +75,6 @@ public override void AI() { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } - return; } } } @@ -93,7 +92,7 @@ public override void ModifyHitNPC(NPC target, ref int damage, ref float knockbac public override bool OnTileCollide(Vector2 oldVelocity) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate--; if (projectile.penetrate <= 0) @@ -130,7 +129,7 @@ public override void Kill(int timeLeft) Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 704, 1f); Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 705, 1f); - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) { for (int i = 0; i < 5; i++) { @@ -140,15 +139,15 @@ public override void Kill(int timeLeft) Main.projectile[a].friendly = true; } } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) { int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } @@ -159,28 +158,28 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("PoisonCloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("PoisonCloudPro"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } if (projectile.owner == Main.myPlayer) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) { int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); int b = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1.5f, projectile.owner); Main.projectile[a].scale = 1.5f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -190,7 +189,7 @@ public override void Kill(int timeLeft) int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 32, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1f, projectile.owner); int e = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 32, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -216,7 +215,7 @@ public override void Kill(int timeLeft) int m = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 70, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 0.5f, projectile.owner); Main.projectile[m].scale = 0.8f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 60, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -229,7 +228,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y - 40, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 70, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -242,13 +241,13 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 70, projectile.position.Y - 70, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBurst"), projectile.damage, 1f, projectile.owner); @@ -256,7 +255,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-50, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBurst"), projectile.damage, 1f, projectile.owner); @@ -266,7 +265,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-100, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -275,7 +274,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-20, projectile.position.Y, -5, 0, mod.ProjectileType("PoisonSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -286,7 +285,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y+10, -4, 0, mod.ProjectileType("PoisonSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -299,7 +298,7 @@ public override void Kill(int timeLeft) int g = Projectile.NewProjectile(projectile.position.X-70, projectile.position.Y+15, -4, 0, mod.ProjectileType("PoisonSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -319,7 +318,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -338,7 +337,7 @@ public override void Kill(int timeLeft) Main.projectile[h].scale = 1.2f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -365,7 +364,7 @@ public override void Kill(int timeLeft) Main.projectile[m].scale = 0.6f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -377,7 +376,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -400,7 +399,7 @@ public override void Kill(int timeLeft) Main.projectile[l].scale = 0.75f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -431,14 +430,14 @@ public override void Kill(int timeLeft) Main.projectile[p].scale = 0.7f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-30, projectile.position.Y, -2, 0, mod.ProjectileType("PoisonBurst"), projectile.damage, 1f, projectile.owner); Projectile.NewProjectile(projectile.position.X+30, projectile.position.Y, +2, 0, mod.ProjectileType("PoisonBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("PoisonBurst"), projectile.damage, 1f, projectile.owner); @@ -447,7 +446,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+60, projectile.position.Y, +3, 0, mod.ProjectileType("PoisonBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("PoisonBurst"), projectile.damage, 1f, projectile.owner); @@ -458,7 +457,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+80, projectile.position.Y, +4, 0, mod.ProjectileType("PoisonBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 4, 0, mod.ProjectileType("PoisonSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -471,7 +470,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 4, mod.ProjectileType("PoisonSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 6, 0, mod.ProjectileType("PoisonSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -484,7 +483,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 6, mod.ProjectileType("PoisonSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 8, 0, mod.ProjectileType("PoisonSkullburst"), projectile.damage * 1, 1f, projectile.owner); diff --git a/Projectiles/Alchemic/LesserVenomFlaskPro.cs b/Projectiles/Alchemic/LesserVenomFlaskPro.cs index 6748f90b..a83fd957 100644 --- a/Projectiles/Alchemic/LesserVenomFlaskPro.cs +++ b/Projectiles/Alchemic/LesserVenomFlaskPro.cs @@ -1,8 +1,8 @@ using System; +using System.Linq; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; -using System.Linq; using Terraria.ModLoader; namespace Tremor.Projectiles.Alchemic { @@ -15,7 +15,7 @@ public override void SetDefaults() projectile.friendly = true; projectile.aiStyle = 2; projectile.penetrate = 1; - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate = 3; } @@ -28,7 +28,7 @@ public override void SetDefaults() public override void AI() { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) { int[] array = new int[20]; int num428 = 0; @@ -38,9 +38,9 @@ public override void AI() { if (Main.npc[num430].CanBeChasedBy(projectile, false)) { - float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2); - float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2); - float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432); + float num431 = Main.npc[num430].position.X + Main.npc[num430].width / 2; + float num432 = Main.npc[num430].position.Y + Main.npc[num430].height / 2; + float num433 = Math.Abs(projectile.position.X + projectile.width / 2 - num431) + Math.Abs(projectile.position.Y + projectile.height / 2 - num432); if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1)) { if (num428 < 20) @@ -56,18 +56,18 @@ public override void AI() { int num434 = Main.rand.Next(num428); num434 = array[num434]; - float num435 = Main.npc[num434].position.X + (float)(Main.npc[num434].width / 2); - float num436 = Main.npc[num434].position.Y + (float)(Main.npc[num434].height / 2); + float num435 = Main.npc[num434].position.X + Main.npc[num434].width / 2; + float num436 = Main.npc[num434].position.Y + Main.npc[num434].height / 2; projectile.localAI[0] += 1f; if (projectile.localAI[0] > 8f) { projectile.localAI[0] = 0f; float num437 = 6f; - Vector2 value10 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + Vector2 value10 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); value10 += projectile.velocity * 4f; float num438 = num435 - value10.X; float num439 = num436 - value10.Y; - float num440 = (float)Math.Sqrt((double)(num438 * num438 + num439 * num439)); + float num440 = (float)Math.Sqrt(num438 * num438 + num439 * num439); num440 = num437 / num440; num438 *= num440; num439 *= num440; @@ -75,7 +75,6 @@ public override void AI() { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } - return; } } } @@ -95,7 +94,7 @@ public override void ModifyHitNPC(NPC target, ref int damage, ref float knockbac public override bool OnTileCollide(Vector2 oldVelocity) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate--; if (projectile.penetrate <= 0) @@ -132,7 +131,7 @@ public override void Kill(int timeLeft) Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 704, 1f); Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 705, 1f); - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) { for (int i = 0; i < 5; i++) { @@ -142,15 +141,15 @@ public override void Kill(int timeLeft) Main.projectile[a].friendly = true; } } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) { int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } @@ -161,28 +160,28 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("PurpleCloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("PurpleCloudPro"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } if (projectile.owner == Main.myPlayer) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) { int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); int b = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PurpleBlast"), projectile.damage * 2, 1.5f, projectile.owner); Main.projectile[a].scale = 1.5f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PurpleBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -192,7 +191,7 @@ public override void Kill(int timeLeft) int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 32, 0, 0, mod.ProjectileType("PurpleBlast"), projectile.damage * 2, 1f, projectile.owner); int e = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 32, 0, 0, mod.ProjectileType("PurpleBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PurpleBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -218,7 +217,7 @@ public override void Kill(int timeLeft) int m = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 70, 0, 0, mod.ProjectileType("PurpleBlast"), projectile.damage * 2, 0.5f, projectile.owner); Main.projectile[m].scale = 0.8f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 60, projectile.position.Y, 0, 0, mod.ProjectileType("PurpleBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -231,7 +230,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y - 40, 0, 0, mod.ProjectileType("PurpleBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 70, projectile.position.Y, 0, 0, mod.ProjectileType("PurpleBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -244,13 +243,13 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 70, projectile.position.Y - 70, 0, 0, mod.ProjectileType("PurpleBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PurpleBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PurpleBurst"), projectile.damage, 1f, projectile.owner); @@ -258,7 +257,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-50, projectile.position.Y, 0, 0, mod.ProjectileType("PurpleBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PurpleBurst"), projectile.damage, 1f, projectile.owner); @@ -268,7 +267,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-100, projectile.position.Y, 0, 0, mod.ProjectileType("PurpleBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PurpleBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -277,7 +276,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-20, projectile.position.Y, -5, 0, mod.ProjectileType("PurpleSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PurpleBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -288,7 +287,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y+10, -4, 0, mod.ProjectileType("PurpleSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PurpleBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -301,7 +300,7 @@ public override void Kill(int timeLeft) int g = Projectile.NewProjectile(projectile.position.X-70, projectile.position.Y+15, -4, 0, mod.ProjectileType("PurpleSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PurpleBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -321,7 +320,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PurpleBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -340,7 +339,7 @@ public override void Kill(int timeLeft) Main.projectile[h].scale = 1.2f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PurpleBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -367,7 +366,7 @@ public override void Kill(int timeLeft) Main.projectile[m].scale = 0.6f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PurpleBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -379,7 +378,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PurpleBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -402,7 +401,7 @@ public override void Kill(int timeLeft) Main.projectile[l].scale = 0.75f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PurpleBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -433,14 +432,14 @@ public override void Kill(int timeLeft) Main.projectile[p].scale = 0.7f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-30, projectile.position.Y, -2, 0, mod.ProjectileType("PurpleBurst"), projectile.damage, 1f, projectile.owner); Projectile.NewProjectile(projectile.position.X+30, projectile.position.Y, +2, 0, mod.ProjectileType("PurpleBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("PurpleBurst"), projectile.damage, 1f, projectile.owner); @@ -449,7 +448,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+60, projectile.position.Y, +3, 0, mod.ProjectileType("PurpleBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("PurpleBurst"), projectile.damage, 1f, projectile.owner); @@ -460,7 +459,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+80, projectile.position.Y, +4, 0, mod.ProjectileType("PurpleBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 4, 0, mod.ProjectileType("PurpleSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -473,7 +472,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 4, mod.ProjectileType("PurpleSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 6, 0, mod.ProjectileType("PurpleSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -486,7 +485,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 6, mod.ProjectileType("PurpleSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 8, 0, mod.ProjectileType("PurpleSkullburst"), projectile.damage * 1, 1f, projectile.owner); diff --git a/Projectiles/Alchemic/ManaSupportFlaskPro.cs b/Projectiles/Alchemic/ManaSupportFlaskPro.cs index 341d95a4..967c2124 100644 --- a/Projectiles/Alchemic/ManaSupportFlaskPro.cs +++ b/Projectiles/Alchemic/ManaSupportFlaskPro.cs @@ -1,8 +1,8 @@ +using System.Linq; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using System.Linq; namespace Tremor.Projectiles.Alchemic { @@ -29,7 +29,7 @@ public override void ModifyHitNPC(NPC target, ref int damage, ref float knockbac public override void Kill(int timeLeft) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) { int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); int b = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); @@ -42,10 +42,10 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("ManaSupportCloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("ManaSupportCloudPro"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } diff --git a/Projectiles/Alchemic/MoonDustFlaskPro.cs b/Projectiles/Alchemic/MoonDustFlaskPro.cs index d3692a5a..f3f1e462 100644 --- a/Projectiles/Alchemic/MoonDustFlaskPro.cs +++ b/Projectiles/Alchemic/MoonDustFlaskPro.cs @@ -1,8 +1,8 @@ using System; +using System.Linq; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; -using System.Linq; using Terraria.ModLoader; namespace Tremor.Projectiles.Alchemic { @@ -16,7 +16,7 @@ public override void SetDefaults() projectile.aiStyle = 2; projectile.timeLeft = 1200; projectile.penetrate = 1; - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate = 3; } @@ -28,7 +28,7 @@ public override void SetDefaults() public override void AI() { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) { int[] array = new int[20]; int num428 = 0; @@ -38,9 +38,9 @@ public override void AI() { if (Main.npc[num430].CanBeChasedBy(projectile, false)) { - float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2); - float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2); - float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432); + float num431 = Main.npc[num430].position.X + Main.npc[num430].width / 2; + float num432 = Main.npc[num430].position.Y + Main.npc[num430].height / 2; + float num433 = Math.Abs(projectile.position.X + projectile.width / 2 - num431) + Math.Abs(projectile.position.Y + projectile.height / 2 - num432); if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1)) { if (num428 < 20) @@ -56,18 +56,18 @@ public override void AI() { int num434 = Main.rand.Next(num428); num434 = array[num434]; - float num435 = Main.npc[num434].position.X + (float)(Main.npc[num434].width / 2); - float num436 = Main.npc[num434].position.Y + (float)(Main.npc[num434].height / 2); + float num435 = Main.npc[num434].position.X + Main.npc[num434].width / 2; + float num436 = Main.npc[num434].position.Y + Main.npc[num434].height / 2; projectile.localAI[0] += 1f; if (projectile.localAI[0] > 8f) { projectile.localAI[0] = 0f; float num437 = 6f; - Vector2 value10 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + Vector2 value10 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); value10 += projectile.velocity * 4f; float num438 = num435 - value10.X; float num439 = num436 - value10.Y; - float num440 = (float)Math.Sqrt((double)(num438 * num438 + num439 * num439)); + float num440 = (float)Math.Sqrt(num438 * num438 + num439 * num439); num440 = num437 / num440; num438 *= num440; num439 *= num440; @@ -75,7 +75,6 @@ public override void AI() { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } - return; } } } @@ -93,7 +92,7 @@ public override void ModifyHitNPC(NPC target, ref int damage, ref float knockbac public override bool OnTileCollide(Vector2 oldVelocity) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate--; if (projectile.penetrate <= 0) @@ -130,7 +129,7 @@ public override void Kill(int timeLeft) Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 704, 1f); Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 705, 1f); - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) { for (int i = 0; i < 5; i++) { @@ -140,15 +139,15 @@ public override void Kill(int timeLeft) Main.projectile[a].friendly = true; } } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) { int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } @@ -159,28 +158,28 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(6, 12); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("MoonBlast"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("MoonBlast"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } if (projectile.owner == Main.myPlayer) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) { int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); int b = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("MoonBlast"), projectile.damage * 2, 1.5f, projectile.owner); Main.projectile[a].scale = 1.5f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("MoonBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -190,7 +189,7 @@ public override void Kill(int timeLeft) int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 32, 0, 0, mod.ProjectileType("MoonBlast"), projectile.damage * 2, 1f, projectile.owner); int e = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 32, 0, 0, mod.ProjectileType("MoonBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("MoonBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -216,7 +215,7 @@ public override void Kill(int timeLeft) int m = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 70, 0, 0, mod.ProjectileType("MoonBlast"), projectile.damage * 2, 0.5f, projectile.owner); Main.projectile[m].scale = 0.8f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 60, projectile.position.Y, 0, 0, mod.ProjectileType("MoonBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -229,7 +228,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y - 40, 0, 0, mod.ProjectileType("MoonBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 70, projectile.position.Y, 0, 0, mod.ProjectileType("MoonBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -242,7 +241,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 70, projectile.position.Y - 70, 0, 0, mod.ProjectileType("MoonBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); @@ -255,7 +254,7 @@ public override void Kill(int timeLeft) int f = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("MoonBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("MoonBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -269,7 +268,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-50, projectile.position.Y, 0, 0, mod.ProjectileType("MoonBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int g = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("MoonBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -285,7 +284,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-100, projectile.position.Y, 0, 0, mod.ProjectileType("MoonBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("MoonBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -294,7 +293,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-20, projectile.position.Y, -5, 0, mod.ProjectileType("MoonSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("MoonBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -305,7 +304,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y+10, -4, 0, mod.ProjectileType("MoonSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("MoonBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -318,7 +317,7 @@ public override void Kill(int timeLeft) int g = Projectile.NewProjectile(projectile.position.X-70, projectile.position.Y+15, -4, 0, mod.ProjectileType("MoonSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("MoonBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -338,7 +337,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("MoonBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -357,7 +356,7 @@ public override void Kill(int timeLeft) Main.projectile[h].scale = 1.2f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("MoonBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -384,7 +383,7 @@ public override void Kill(int timeLeft) Main.projectile[m].scale = 0.6f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("MoonBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -396,7 +395,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("MoonBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -419,7 +418,7 @@ public override void Kill(int timeLeft) Main.projectile[l].scale = 0.75f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("MoonBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -450,7 +449,7 @@ public override void Kill(int timeLeft) Main.projectile[p].scale = 0.7f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("MoonBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -463,7 +462,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+30, projectile.position.Y, +2, 0, mod.ProjectileType("MoonBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("MoonBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -478,7 +477,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+60, projectile.position.Y, +3, 0, mod.ProjectileType("MoonBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("MoonBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -495,7 +494,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+80, projectile.position.Y, +4, 0, mod.ProjectileType("MoonBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 4, 0, mod.ProjectileType("MoonSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -508,7 +507,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 4, mod.ProjectileType("MoonSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 6, 0, mod.ProjectileType("MoonSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -521,7 +520,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 6, mod.ProjectileType("MoonSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 8, 0, mod.ProjectileType("MoonSkullburst"), projectile.damage * 1, 1f, projectile.owner); diff --git a/Projectiles/Alchemic/PhantomFlaskPro.cs b/Projectiles/Alchemic/PhantomFlaskPro.cs index 491b006a..71eddb76 100644 --- a/Projectiles/Alchemic/PhantomFlaskPro.cs +++ b/Projectiles/Alchemic/PhantomFlaskPro.cs @@ -1,10 +1,10 @@ using System; +using System.Linq; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using System.Linq; -using Microsoft.Xna.Framework.Graphics; namespace Tremor.Projectiles.Alchemic { public class PhantomFlaskPro : ModProjectile @@ -16,7 +16,7 @@ public override void SetDefaults() projectile.friendly = true; projectile.aiStyle = 2; projectile.penetrate = 1; - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate = 3; } @@ -29,7 +29,7 @@ public override void SetDefaults() public override void AI() { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) { int[] array = new int[20]; int num428 = 0; @@ -39,9 +39,9 @@ public override void AI() { if (Main.npc[num430].CanBeChasedBy(projectile, false)) { - float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2); - float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2); - float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432); + float num431 = Main.npc[num430].position.X + Main.npc[num430].width / 2; + float num432 = Main.npc[num430].position.Y + Main.npc[num430].height / 2; + float num433 = Math.Abs(projectile.position.X + projectile.width / 2 - num431) + Math.Abs(projectile.position.Y + projectile.height / 2 - num432); if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1)) { if (num428 < 20) @@ -57,18 +57,18 @@ public override void AI() { int num434 = Main.rand.Next(num428); num434 = array[num434]; - float num435 = Main.npc[num434].position.X + (float)(Main.npc[num434].width / 2); - float num436 = Main.npc[num434].position.Y + (float)(Main.npc[num434].height / 2); + float num435 = Main.npc[num434].position.X + Main.npc[num434].width / 2; + float num436 = Main.npc[num434].position.Y + Main.npc[num434].height / 2; projectile.localAI[0] += 1f; if (projectile.localAI[0] > 8f) { projectile.localAI[0] = 0f; float num437 = 6f; - Vector2 value10 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + Vector2 value10 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); value10 += projectile.velocity * 4f; float num438 = num435 - value10.X; float num439 = num436 - value10.Y; - float num440 = (float)Math.Sqrt((double)(num438 * num438 + num439 * num439)); + float num440 = (float)Math.Sqrt(num438 * num438 + num439 * num439); num440 = num437 / num440; num438 *= num440; num439 *= num440; @@ -76,7 +76,6 @@ public override void AI() { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } - return; } } } @@ -101,7 +100,7 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) for(int k = 0; k < projectile.oldPos.Length; k++) { Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); - Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); + Color color = projectile.GetAlpha(lightColor) * ((projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); } return true; @@ -110,7 +109,7 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) public override bool OnTileCollide(Vector2 oldVelocity) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate--; if (projectile.penetrate <= 0) @@ -147,7 +146,7 @@ public override void Kill(int timeLeft) Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 704, 1f); Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 705, 1f); - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) { for (int i = 0; i < 5; i++) { @@ -157,15 +156,15 @@ public override void Kill(int timeLeft) Main.projectile[a].friendly = true; } } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) { int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } @@ -176,28 +175,28 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("ShadowCloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("ShadowCloudPro"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } if (projectile.owner == Main.myPlayer) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) { int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); int b = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ShadowBlast"), projectile.damage * 2, 1.5f, projectile.owner); Main.projectile[a].scale = 1.5f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ShadowBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -207,7 +206,7 @@ public override void Kill(int timeLeft) int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 32, 0, 0, mod.ProjectileType("ShadowBlast"), projectile.damage * 2, 1f, projectile.owner); int e = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 32, 0, 0, mod.ProjectileType("ShadowBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ShadowBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -233,7 +232,7 @@ public override void Kill(int timeLeft) int m = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 70, 0, 0, mod.ProjectileType("ShadowBlast"), projectile.damage * 2, 0.5f, projectile.owner); Main.projectile[m].scale = 0.8f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 60, projectile.position.Y, 0, 0, mod.ProjectileType("ShadowBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -246,7 +245,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y - 40, 0, 0, mod.ProjectileType("ShadowBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 70, projectile.position.Y, 0, 0, mod.ProjectileType("ShadowBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -259,13 +258,13 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 70, projectile.position.Y - 70, 0, 0, mod.ProjectileType("ShadowBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ShadowBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ShadowBurst"), projectile.damage, 1f, projectile.owner); @@ -273,7 +272,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-50, projectile.position.Y, 0, 0, mod.ProjectileType("ShadowBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ShadowBurst"), projectile.damage, 1f, projectile.owner); @@ -283,7 +282,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-100, projectile.position.Y, 0, 0, mod.ProjectileType("ShadowBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ShadowBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -292,7 +291,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-20, projectile.position.Y, -5, 0, mod.ProjectileType("ShadowSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ShadowBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -303,7 +302,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y+10, -4, 0, mod.ProjectileType("ShadowSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ShadowBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -316,7 +315,7 @@ public override void Kill(int timeLeft) int g = Projectile.NewProjectile(projectile.position.X-70, projectile.position.Y+15, -4, 0, mod.ProjectileType("ShadowSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ShadowBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -336,7 +335,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ShadowBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -355,7 +354,7 @@ public override void Kill(int timeLeft) Main.projectile[h].scale = 1.2f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ShadowBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -382,7 +381,7 @@ public override void Kill(int timeLeft) Main.projectile[m].scale = 0.6f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ShadowBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -394,7 +393,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ShadowBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -417,7 +416,7 @@ public override void Kill(int timeLeft) Main.projectile[l].scale = 0.75f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ShadowBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -448,14 +447,14 @@ public override void Kill(int timeLeft) Main.projectile[p].scale = 0.7f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-30, projectile.position.Y, -2, 0, mod.ProjectileType("ShadowBurst"), projectile.damage, 1f, projectile.owner); Projectile.NewProjectile(projectile.position.X+30, projectile.position.Y, +2, 0, mod.ProjectileType("ShadowBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("ShadowBurst"), projectile.damage, 1f, projectile.owner); @@ -464,7 +463,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+60, projectile.position.Y, +3, 0, mod.ProjectileType("ShadowBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("ShadowBurst"), projectile.damage, 1f, projectile.owner); @@ -475,7 +474,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+80, projectile.position.Y, +4, 0, mod.ProjectileType("ShadowBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 4, 0, mod.ProjectileType("ShadowSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -488,7 +487,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 4, mod.ProjectileType("ShadowSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 6, 0, mod.ProjectileType("ShadowSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -501,7 +500,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 6, mod.ProjectileType("ShadowSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 8, 0, mod.ProjectileType("ShadowSkullburst"), projectile.damage * 1, 1f, projectile.owner); diff --git a/Projectiles/Alchemic/PlagueFlaskPro.cs b/Projectiles/Alchemic/PlagueFlaskPro.cs index f37e6916..2b6d9688 100644 --- a/Projectiles/Alchemic/PlagueFlaskPro.cs +++ b/Projectiles/Alchemic/PlagueFlaskPro.cs @@ -1,10 +1,10 @@ using System; +using System.Linq; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; -using System.Linq; using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework.Graphics; namespace Tremor.Projectiles.Alchemic { public class PlagueFlaskPro : ModProjectile @@ -15,7 +15,7 @@ public override void SetDefaults() projectile.height = 28; projectile.friendly = true; projectile.penetrate = 1; - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate = 3; } @@ -29,7 +29,7 @@ public override void SetDefaults() public override void AI() { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) { int[] array = new int[20]; int num428 = 0; @@ -39,9 +39,9 @@ public override void AI() { if (Main.npc[num430].CanBeChasedBy(projectile, false)) { - float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2); - float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2); - float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432); + float num431 = Main.npc[num430].position.X + Main.npc[num430].width / 2; + float num432 = Main.npc[num430].position.Y + Main.npc[num430].height / 2; + float num433 = Math.Abs(projectile.position.X + projectile.width / 2 - num431) + Math.Abs(projectile.position.Y + projectile.height / 2 - num432); if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1)) { if (num428 < 20) @@ -57,18 +57,18 @@ public override void AI() { int num434 = Main.rand.Next(num428); num434 = array[num434]; - float num435 = Main.npc[num434].position.X + (float)(Main.npc[num434].width / 2); - float num436 = Main.npc[num434].position.Y + (float)(Main.npc[num434].height / 2); + float num435 = Main.npc[num434].position.X + Main.npc[num434].width / 2; + float num436 = Main.npc[num434].position.Y + Main.npc[num434].height / 2; projectile.localAI[0] += 1f; if (projectile.localAI[0] > 8f) { projectile.localAI[0] = 0f; float num437 = 6f; - Vector2 value10 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + Vector2 value10 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); value10 += projectile.velocity * 4f; float num438 = num435 - value10.X; float num439 = num436 - value10.Y; - float num440 = (float)Math.Sqrt((double)(num438 * num438 + num439 * num439)); + float num440 = (float)Math.Sqrt(num438 * num438 + num439 * num439); num440 = num437 / num440; num438 *= num440; num439 *= num440; @@ -76,7 +76,6 @@ public override void AI() { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } - return; } } } @@ -88,7 +87,7 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) for(int k = 0; k < projectile.oldPos.Length; k++) { Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); - Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); + Color color = projectile.GetAlpha(lightColor) * ((projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); } return true; @@ -106,7 +105,7 @@ public override void ModifyHitNPC(NPC target, ref int damage, ref float knockbac public override bool OnTileCollide(Vector2 oldVelocity) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate--; if (projectile.penetrate <= 0) @@ -143,7 +142,7 @@ public override void Kill(int timeLeft) Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 704, 1f); Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 705, 1f); - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) { for (int i = 0; i < 5; i++) { @@ -153,15 +152,15 @@ public override void Kill(int timeLeft) Main.projectile[a].friendly = true; } } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) { int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } @@ -172,28 +171,28 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(6, 9); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("PlaguePro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("PlaguePro"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } if (projectile.owner == Main.myPlayer) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) { int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); int b = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1.5f, projectile.owner); Main.projectile[a].scale = 1.5f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -203,7 +202,7 @@ public override void Kill(int timeLeft) int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 32, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1f, projectile.owner); int e = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 32, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -229,7 +228,7 @@ public override void Kill(int timeLeft) int m = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 70, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 0.5f, projectile.owner); Main.projectile[m].scale = 0.8f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 60, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -242,7 +241,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y - 40, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 70, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -255,13 +254,13 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 70, projectile.position.Y - 70, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBurst"), projectile.damage, 1f, projectile.owner); @@ -269,7 +268,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-50, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBurst"), projectile.damage, 1f, projectile.owner); @@ -279,7 +278,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-100, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -288,7 +287,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-20, projectile.position.Y, -5, 0, mod.ProjectileType("BigPlague"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -299,7 +298,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y+10, -4, 0, mod.ProjectileType("BigPlague"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -312,7 +311,7 @@ public override void Kill(int timeLeft) int g = Projectile.NewProjectile(projectile.position.X-70, projectile.position.Y+15, -4, 0, mod.ProjectileType("BigPlague"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -332,7 +331,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -351,7 +350,7 @@ public override void Kill(int timeLeft) Main.projectile[h].scale = 1.2f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -378,7 +377,7 @@ public override void Kill(int timeLeft) Main.projectile[m].scale = 0.6f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -390,7 +389,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -413,7 +412,7 @@ public override void Kill(int timeLeft) Main.projectile[l].scale = 0.75f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PoisonBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -444,14 +443,14 @@ public override void Kill(int timeLeft) Main.projectile[p].scale = 0.7f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-30, projectile.position.Y, -2, 0, mod.ProjectileType("PoisonBurst"), projectile.damage, 1f, projectile.owner); Projectile.NewProjectile(projectile.position.X+30, projectile.position.Y, +2, 0, mod.ProjectileType("PoisonBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("PoisonBurst"), projectile.damage, 1f, projectile.owner); @@ -460,7 +459,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+60, projectile.position.Y, +3, 0, mod.ProjectileType("PoisonBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("PoisonBurst"), projectile.damage, 1f, projectile.owner); @@ -471,7 +470,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+80, projectile.position.Y, +4, 0, mod.ProjectileType("PoisonBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 4, 0, mod.ProjectileType("BigPlagueburst"), projectile.damage * 1, 1f, projectile.owner); @@ -484,7 +483,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 4, mod.ProjectileType("BigPlagueburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 6, 0, mod.ProjectileType("BigPlagueburst"), projectile.damage * 1, 1f, projectile.owner); @@ -497,7 +496,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 6, mod.ProjectileType("BigPlagueburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 8, 0, mod.ProjectileType("BigPlagueburst"), projectile.damage * 1, 1f, projectile.owner); diff --git a/Projectiles/Alchemic/SparkingFlaskPro.cs b/Projectiles/Alchemic/SparkingFlaskPro.cs index 14604aaf..5ce31ffd 100644 --- a/Projectiles/Alchemic/SparkingFlaskPro.cs +++ b/Projectiles/Alchemic/SparkingFlaskPro.cs @@ -1,10 +1,10 @@ using System; +using System.Linq; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; -using System.Linq; using Terraria.ModLoader; -using Microsoft.Xna.Framework.Graphics; namespace Tremor.Projectiles.Alchemic { public class SparkingFlaskPro : ModProjectile @@ -16,7 +16,7 @@ public override void SetDefaults() projectile.friendly = true; projectile.aiStyle = 2; projectile.penetrate = 1; - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate = 3; } @@ -30,7 +30,7 @@ public override void SetDefaults() public override void AI() { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) { int[] array = new int[20]; int num428 = 0; @@ -40,9 +40,9 @@ public override void AI() { if (Main.npc[num430].CanBeChasedBy(projectile, false)) { - float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2); - float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2); - float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432); + float num431 = Main.npc[num430].position.X + Main.npc[num430].width / 2; + float num432 = Main.npc[num430].position.Y + Main.npc[num430].height / 2; + float num433 = Math.Abs(projectile.position.X + projectile.width / 2 - num431) + Math.Abs(projectile.position.Y + projectile.height / 2 - num432); if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1)) { if (num428 < 20) @@ -58,18 +58,18 @@ public override void AI() { int num434 = Main.rand.Next(num428); num434 = array[num434]; - float num435 = Main.npc[num434].position.X + (float)(Main.npc[num434].width / 2); - float num436 = Main.npc[num434].position.Y + (float)(Main.npc[num434].height / 2); + float num435 = Main.npc[num434].position.X + Main.npc[num434].width / 2; + float num436 = Main.npc[num434].position.Y + Main.npc[num434].height / 2; projectile.localAI[0] += 1f; if (projectile.localAI[0] > 8f) { projectile.localAI[0] = 0f; float num437 = 6f; - Vector2 value10 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + Vector2 value10 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); value10 += projectile.velocity * 4f; float num438 = num435 - value10.X; float num439 = num436 - value10.Y; - float num440 = (float)Math.Sqrt((double)(num438 * num438 + num439 * num439)); + float num440 = (float)Math.Sqrt(num438 * num438 + num439 * num439); num440 = num437 / num440; num438 *= num440; num439 *= num440; @@ -77,7 +77,6 @@ public override void AI() { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } - return; } } } @@ -97,7 +96,7 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) for(int k = 0; k < projectile.oldPos.Length; k++) { Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); - Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); + Color color = projectile.GetAlpha(lightColor) * ((projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); } return true; @@ -108,7 +107,7 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) public override bool OnTileCollide(Vector2 oldVelocity) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate--; if (projectile.penetrate <= 0) @@ -146,7 +145,7 @@ public override void Kill(int timeLeft) Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 704, 1f); Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 705, 1f); - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) { for (int i = 0; i < 5; i++) { @@ -156,15 +155,15 @@ public override void Kill(int timeLeft) Main.projectile[a].friendly = true; } } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) { int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } @@ -175,29 +174,29 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(2, 3); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-101, 0)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-101, 0)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("SparkingBallz"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("SparkingBallz"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("SparkingBurst"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("SparkingBurst"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } if (projectile.owner == Main.myPlayer) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) { int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); int b = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1.5f, projectile.owner); Main.projectile[a].scale = 1.5f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -207,7 +206,7 @@ public override void Kill(int timeLeft) int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 32, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1f, projectile.owner); int e = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 32, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -233,7 +232,7 @@ public override void Kill(int timeLeft) int m = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 70, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 0.5f, projectile.owner); Main.projectile[m].scale = 0.8f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 60, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -246,7 +245,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y - 40, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 70, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -259,13 +258,13 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 70, projectile.position.Y - 70, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBurst"), projectile.damage, 1f, projectile.owner); @@ -273,7 +272,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-50, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBurst"), projectile.damage, 1f, projectile.owner); @@ -283,7 +282,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-100, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -292,7 +291,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-20, projectile.position.Y, -5, 0, mod.ProjectileType("SparkingBallz"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -303,7 +302,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y+10, -4, 0, mod.ProjectileType("SparkingBallz"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -316,7 +315,7 @@ public override void Kill(int timeLeft) int g = Projectile.NewProjectile(projectile.position.X-70, projectile.position.Y+15, -4, 0, mod.ProjectileType("SparkingBallz"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -336,7 +335,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -355,7 +354,7 @@ public override void Kill(int timeLeft) Main.projectile[h].scale = 1.2f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -382,7 +381,7 @@ public override void Kill(int timeLeft) Main.projectile[m].scale = 0.6f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -394,7 +393,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -417,7 +416,7 @@ public override void Kill(int timeLeft) Main.projectile[l].scale = 0.75f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FieryBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -448,14 +447,14 @@ public override void Kill(int timeLeft) Main.projectile[p].scale = 0.7f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-30, projectile.position.Y, -2, 0, mod.ProjectileType("FieryBurst"), projectile.damage, 1f, projectile.owner); Projectile.NewProjectile(projectile.position.X+30, projectile.position.Y, +2, 0, mod.ProjectileType("FieryBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("FieryBurst"), projectile.damage, 1f, projectile.owner); @@ -464,7 +463,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+60, projectile.position.Y, +3, 0, mod.ProjectileType("FieryBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("FieryBurst"), projectile.damage, 1f, projectile.owner); @@ -475,7 +474,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+80, projectile.position.Y, +4, 0, mod.ProjectileType("FieryBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 4, 0, mod.ProjectileType("FierySkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -488,7 +487,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 4, mod.ProjectileType("FierySkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 6, 0, mod.ProjectileType("FierySkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -501,7 +500,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 6, mod.ProjectileType("FierySkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 8, 0, mod.ProjectileType("FierySkullburst"), projectile.damage * 1, 1f, projectile.owner); diff --git a/Projectiles/Alchemic/SuperHealingFlaskPro.cs b/Projectiles/Alchemic/SuperHealingFlaskPro.cs index 82e1e378..2db9b6fe 100644 --- a/Projectiles/Alchemic/SuperHealingFlaskPro.cs +++ b/Projectiles/Alchemic/SuperHealingFlaskPro.cs @@ -1,9 +1,9 @@ using System; +using System.Linq; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using System.Linq; namespace Tremor.Projectiles.Alchemic { public class SuperHealingFlaskPro : ModProjectile @@ -15,7 +15,7 @@ public override void SetDefaults() projectile.friendly = true; projectile.aiStyle = 2; projectile.penetrate = 1; - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate = 3; } @@ -28,7 +28,7 @@ public override void SetDefaults() public override void AI() { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) { int[] array = new int[20]; int num428 = 0; @@ -38,9 +38,9 @@ public override void AI() { if (Main.npc[num430].CanBeChasedBy(projectile, false)) { - float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2); - float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2); - float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432); + float num431 = Main.npc[num430].position.X + Main.npc[num430].width / 2; + float num432 = Main.npc[num430].position.Y + Main.npc[num430].height / 2; + float num433 = Math.Abs(projectile.position.X + projectile.width / 2 - num431) + Math.Abs(projectile.position.Y + projectile.height / 2 - num432); if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1)) { if (num428 < 20) @@ -56,18 +56,18 @@ public override void AI() { int num434 = Main.rand.Next(num428); num434 = array[num434]; - float num435 = Main.npc[num434].position.X + (float)(Main.npc[num434].width / 2); - float num436 = Main.npc[num434].position.Y + (float)(Main.npc[num434].height / 2); + float num435 = Main.npc[num434].position.X + Main.npc[num434].width / 2; + float num436 = Main.npc[num434].position.Y + Main.npc[num434].height / 2; projectile.localAI[0] += 1f; if (projectile.localAI[0] > 8f) { projectile.localAI[0] = 0f; float num437 = 6f; - Vector2 value10 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + Vector2 value10 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); value10 += projectile.velocity * 4f; float num438 = num435 - value10.X; float num439 = num436 - value10.Y; - float num440 = (float)Math.Sqrt((double)(num438 * num438 + num439 * num439)); + float num440 = (float)Math.Sqrt(num438 * num438 + num439 * num439); num440 = num437 / num440; num438 *= num440; num439 *= num440; @@ -75,7 +75,6 @@ public override void AI() { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } - return; } } } @@ -91,7 +90,7 @@ public override void ModifyHitNPC(NPC target, ref int damage, ref float knockbac public override bool OnTileCollide(Vector2 oldVelocity) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate--; if (projectile.penetrate <= 0) @@ -128,7 +127,7 @@ public override void Kill(int timeLeft) Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 704, 1f); Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 705, 1f); - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) { for (int i = 0; i < 5; i++) { @@ -138,15 +137,15 @@ public override void Kill(int timeLeft) Main.projectile[a].friendly = true; } } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) { int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } @@ -157,28 +156,28 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("HealingCloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("HealingCloudPro"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } if (projectile.owner == Main.myPlayer) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) { int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); int b = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1.5f, projectile.owner); Main.projectile[a].scale = 1.5f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -188,7 +187,7 @@ public override void Kill(int timeLeft) int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 32, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1f, projectile.owner); int e = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 32, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -214,7 +213,7 @@ public override void Kill(int timeLeft) int m = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 70, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 0.5f, projectile.owner); Main.projectile[m].scale = 0.8f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 60, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -227,7 +226,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y - 40, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 70, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -240,13 +239,13 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 70, projectile.position.Y - 70, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBurst"), projectile.damage, 1f, projectile.owner); @@ -254,7 +253,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-50, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBurst"), projectile.damage, 1f, projectile.owner); @@ -264,7 +263,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-100, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -273,7 +272,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-20, projectile.position.Y, -5, 0, mod.ProjectileType("HealingSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -284,7 +283,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y+10, -4, 0, mod.ProjectileType("HealingSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -297,7 +296,7 @@ public override void Kill(int timeLeft) int g = Projectile.NewProjectile(projectile.position.X-70, projectile.position.Y+15, -4, 0, mod.ProjectileType("HealingSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -317,7 +316,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -336,7 +335,7 @@ public override void Kill(int timeLeft) Main.projectile[h].scale = 1.2f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -363,7 +362,7 @@ public override void Kill(int timeLeft) Main.projectile[m].scale = 0.6f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -375,7 +374,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -398,7 +397,7 @@ public override void Kill(int timeLeft) Main.projectile[l].scale = 0.75f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("HealingBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -429,14 +428,14 @@ public override void Kill(int timeLeft) Main.projectile[p].scale = 0.7f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-30, projectile.position.Y, -2, 0, mod.ProjectileType("HealingBurst"), projectile.damage, 1f, projectile.owner); Projectile.NewProjectile(projectile.position.X+30, projectile.position.Y, +2, 0, mod.ProjectileType("HealingBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("HealingBurst"), projectile.damage, 1f, projectile.owner); @@ -445,7 +444,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+60, projectile.position.Y, +3, 0, mod.ProjectileType("HealingBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("HealingBurst"), projectile.damage, 1f, projectile.owner); @@ -456,7 +455,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+80, projectile.position.Y, +4, 0, mod.ProjectileType("HealingBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 4, 0, mod.ProjectileType("HealingSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -469,7 +468,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 4, mod.ProjectileType("HealingSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 6, 0, mod.ProjectileType("HealingSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -482,7 +481,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 6, mod.ProjectileType("HealingSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 8, 0, mod.ProjectileType("HealingSkullburst"), projectile.damage * 1, 1f, projectile.owner); diff --git a/Projectiles/Alchemic/SuperManaFlaskPro.cs b/Projectiles/Alchemic/SuperManaFlaskPro.cs index 2432732b..55a6705c 100644 --- a/Projectiles/Alchemic/SuperManaFlaskPro.cs +++ b/Projectiles/Alchemic/SuperManaFlaskPro.cs @@ -1,9 +1,9 @@ using System; +using System.Linq; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using System.Linq; namespace Tremor.Projectiles.Alchemic { public class SuperManaFlaskPro : ModProjectile @@ -16,7 +16,7 @@ public override void SetDefaults() projectile.aiStyle = 2; projectile.timeLeft = 1200; projectile.penetrate = 1; - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate = 3; } @@ -28,7 +28,7 @@ public override void SetDefaults() public override void AI() { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) { int[] array = new int[20]; int num428 = 0; @@ -38,9 +38,9 @@ public override void AI() { if (Main.npc[num430].CanBeChasedBy(projectile, false)) { - float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2); - float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2); - float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432); + float num431 = Main.npc[num430].position.X + Main.npc[num430].width / 2; + float num432 = Main.npc[num430].position.Y + Main.npc[num430].height / 2; + float num433 = Math.Abs(projectile.position.X + projectile.width / 2 - num431) + Math.Abs(projectile.position.Y + projectile.height / 2 - num432); if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1)) { if (num428 < 20) @@ -56,18 +56,18 @@ public override void AI() { int num434 = Main.rand.Next(num428); num434 = array[num434]; - float num435 = Main.npc[num434].position.X + (float)(Main.npc[num434].width / 2); - float num436 = Main.npc[num434].position.Y + (float)(Main.npc[num434].height / 2); + float num435 = Main.npc[num434].position.X + Main.npc[num434].width / 2; + float num436 = Main.npc[num434].position.Y + Main.npc[num434].height / 2; projectile.localAI[0] += 1f; if (projectile.localAI[0] > 8f) { projectile.localAI[0] = 0f; float num437 = 6f; - Vector2 value10 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + Vector2 value10 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); value10 += projectile.velocity * 4f; float num438 = num435 - value10.X; float num439 = num436 - value10.Y; - float num440 = (float)Math.Sqrt((double)(num438 * num438 + num439 * num439)); + float num440 = (float)Math.Sqrt(num438 * num438 + num439 * num439); num440 = num437 / num440; num438 *= num440; num439 *= num440; @@ -75,7 +75,6 @@ public override void AI() { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } - return; } } } @@ -91,7 +90,7 @@ public override void ModifyHitNPC(NPC target, ref int damage, ref float knockbac public override bool OnTileCollide(Vector2 oldVelocity) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate--; if (projectile.penetrate <= 0) @@ -128,7 +127,7 @@ public override void Kill(int timeLeft) Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 704, 1f); Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 705, 1f); - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) { for (int i = 0; i < 5; i++) { @@ -138,15 +137,15 @@ public override void Kill(int timeLeft) Main.projectile[a].friendly = true; } } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) { int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } @@ -157,28 +156,28 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("ManaCloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("ManaCloudPro"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } if (projectile.owner == Main.myPlayer) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("DesertEmperorSetBuff"))) { int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); int b = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("FlaskWasp"), projectile.damage * 2, 1.5f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1.5f, projectile.owner); Main.projectile[a].scale = 1.5f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -188,7 +187,7 @@ public override void Kill(int timeLeft) int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 32, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1f, projectile.owner); int e = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 32, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1.25f, projectile.owner); @@ -214,7 +213,7 @@ public override void Kill(int timeLeft) int m = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 70, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 0.5f, projectile.owner); Main.projectile[m].scale = 0.8f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 60, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -227,7 +226,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y - 40, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X + 70, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -240,13 +239,13 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X - 70, projectile.position.Y - 70, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBurst"), projectile.damage, 1f, projectile.owner); @@ -254,7 +253,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-50, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBurst"), projectile.damage, 1f, projectile.owner); @@ -264,7 +263,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-100, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -273,7 +272,7 @@ public override void Kill(int timeLeft) int c = Projectile.NewProjectile(projectile.position.X-20, projectile.position.Y, -5, 0, mod.ProjectileType("ManaSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -284,7 +283,7 @@ public override void Kill(int timeLeft) int e = Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y+10, -4, 0, mod.ProjectileType("ManaSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -297,7 +296,7 @@ public override void Kill(int timeLeft) int g = Projectile.NewProjectile(projectile.position.X-70, projectile.position.Y+15, -4, 0, mod.ProjectileType("ManaSkull"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -317,7 +316,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -336,7 +335,7 @@ public override void Kill(int timeLeft) Main.projectile[h].scale = 1.2f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1.5f, projectile.owner); @@ -363,7 +362,7 @@ public override void Kill(int timeLeft) Main.projectile[m].scale = 0.6f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -375,7 +374,7 @@ public override void Kill(int timeLeft) } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -398,7 +397,7 @@ public override void Kill(int timeLeft) Main.projectile[l].scale = 0.75f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("ManaBlast"), projectile.damage * 2, 1f, projectile.owner); @@ -429,14 +428,14 @@ public override void Kill(int timeLeft) Main.projectile[p].scale = 0.7f; } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-30, projectile.position.Y, -2, 0, mod.ProjectileType("ManaBurst"), projectile.damage, 1f, projectile.owner); Projectile.NewProjectile(projectile.position.X+30, projectile.position.Y, +2, 0, mod.ProjectileType("ManaBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("ManaBurst"), projectile.damage, 1f, projectile.owner); @@ -445,7 +444,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+60, projectile.position.Y, +3, 0, mod.ProjectileType("ManaBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); Projectile.NewProjectile(projectile.position.X-40, projectile.position.Y, -2, 0, mod.ProjectileType("ManaBurst"), projectile.damage, 1f, projectile.owner); @@ -456,7 +455,7 @@ public override void Kill(int timeLeft) Projectile.NewProjectile(projectile.position.X+80, projectile.position.Y, +4, 0, mod.ProjectileType("ManaBurst"), projectile.damage, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 4, 0, mod.ProjectileType("ManaSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -469,7 +468,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 4, mod.ProjectileType("ManaSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 6, 0, mod.ProjectileType("ManaSkullburst"), projectile.damage * 1, 1f, projectile.owner); @@ -482,7 +481,7 @@ public override void Kill(int timeLeft) int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y-60, 0, 6, mod.ProjectileType("ManaSkullburst"), projectile.damage * 1, 1f, projectile.owner); } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 8, 0, mod.ProjectileType("ManaSkullburst"), projectile.damage * 1, 1f, projectile.owner); diff --git a/Projectiles/Alchemic/ToxicFlaskPro.cs b/Projectiles/Alchemic/ToxicFlaskPro.cs index f5ab8845..f14ba421 100644 --- a/Projectiles/Alchemic/ToxicFlaskPro.cs +++ b/Projectiles/Alchemic/ToxicFlaskPro.cs @@ -1,9 +1,9 @@ using System; +using System.Linq; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using System.Linq; namespace Tremor.Projectiles.Alchemic { @@ -18,7 +18,7 @@ public override void SetDefaults() projectile.timeLeft = 1200; projectile.penetrate = 1; projectile.scale = 1.1f; - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate = 3; } @@ -30,7 +30,7 @@ public override void SetDefaults() public override void AI() { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) { int[] array = new int[20]; int num428 = 0; @@ -40,9 +40,9 @@ public override void AI() { if (Main.npc[num430].CanBeChasedBy(projectile, false)) { - float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2); - float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2); - float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432); + float num431 = Main.npc[num430].position.X + Main.npc[num430].width / 2; + float num432 = Main.npc[num430].position.Y + Main.npc[num430].height / 2; + float num433 = Math.Abs(projectile.position.X + projectile.width / 2 - num431) + Math.Abs(projectile.position.Y + projectile.height / 2 - num432); if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1)) { if (num428 < 20) @@ -58,18 +58,18 @@ public override void AI() { int num434 = Main.rand.Next(num428); num434 = array[num434]; - float num435 = Main.npc[num434].position.X + (float)(Main.npc[num434].width / 2); - float num436 = Main.npc[num434].position.Y + (float)(Main.npc[num434].height / 2); + float num435 = Main.npc[num434].position.X + Main.npc[num434].width / 2; + float num436 = Main.npc[num434].position.Y + Main.npc[num434].height / 2; projectile.localAI[0] += 1f; if (projectile.localAI[0] > 8f) { projectile.localAI[0] = 0f; float num437 = 6f; - Vector2 value10 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + Vector2 value10 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); value10 += projectile.velocity * 4f; float num438 = num435 - value10.X; float num439 = num436 - value10.Y; - float num440 = (float)Math.Sqrt((double)(num438 * num438 + num439 * num439)); + float num440 = (float)Math.Sqrt(num438 * num438 + num439 * num439); num440 = num437 / num440; num438 *= num440; num439 *= num440; @@ -77,7 +77,6 @@ public override void AI() { Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } - return; } } } @@ -93,7 +92,7 @@ public override void ModifyHitNPC(NPC target, ref int damage, ref float knockbac public override bool OnTileCollide(Vector2 oldVelocity) { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) { projectile.penetrate--; if (projectile.penetrate <= 0) @@ -127,7 +126,7 @@ public override void Kill(int timeLeft) MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 107); Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 704, 1f); - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) { for (int i = 0; i < 5; i++) { @@ -137,15 +136,15 @@ public override void Kill(int timeLeft) Main.projectile[a].friendly = true; } } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) { int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } @@ -154,10 +153,10 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(20, 31); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value17.X, value17.Y, mod.ProjectileType("ToxicFlaskCloud"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value17.X, value17.Y, mod.ProjectileType("ToxicFlaskCloud"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } diff --git a/Projectiles/AlchemicBubble.cs b/Projectiles/AlchemicBubble.cs index b5c7afdb..03f2ac9e 100644 --- a/Projectiles/AlchemicBubble.cs +++ b/Projectiles/AlchemicBubble.cs @@ -35,7 +35,7 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) for (int k = 0; k < projectile.oldPos.Length; k++) { Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); - Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); + Color color = projectile.GetAlpha(lightColor) * ((projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); } return true; @@ -54,10 +54,10 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(1, 3); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("ShadowCloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("ShadowCloudPro"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } diff --git a/Projectiles/AncientDaggerPro.cs b/Projectiles/AncientDaggerPro.cs index b2c5276d..79927f8b 100644 --- a/Projectiles/AncientDaggerPro.cs +++ b/Projectiles/AncientDaggerPro.cs @@ -26,12 +26,12 @@ public override void SetStaticDefaults() public override void Kill(int timeLeft) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.position.X = projectile.position.X + projectile.width / 2; + projectile.position.Y = projectile.position.Y + projectile.height / 2; projectile.width = 80; projectile.height = 80; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.position.X = projectile.position.X - projectile.width / 2; + projectile.position.Y = projectile.position.Y - projectile.height / 2; for (int num628 = 0; num628 < 40; num628++) { int num629 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); @@ -39,7 +39,7 @@ public override void Kill(int timeLeft) if (Main.rand.Next(2) == 0) { Main.dust[num629].scale = 0.5f; - Main.dust[num629].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num629].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } for (int num630 = 0; num630 < 70; num630++) @@ -61,47 +61,47 @@ public override void Kill(int timeLeft) { scaleFactor10 = 1f; } - int num633 = 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 num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13E6D_cp_0 = Main.gore[num633]; expr_13E6D_cp_0.velocity.X = expr_13E6D_cp_0.velocity.X + 1f; Gore expr_13E8D_cp_0 = Main.gore[num633]; expr_13E8D_cp_0.velocity.Y = expr_13E8D_cp_0.velocity.Y + 1f; - num633 = 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), 2f); + num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 2f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13F30_cp_0 = Main.gore[num633]; expr_13F30_cp_0.velocity.X = expr_13F30_cp_0.velocity.X - 1f; Gore expr_13F50_cp_0 = Main.gore[num633]; expr_13F50_cp_0.velocity.Y = expr_13F50_cp_0.velocity.Y + 1f; - num633 = 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); + num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13FF3_cp_0 = Main.gore[num633]; expr_13FF3_cp_0.velocity.X = expr_13FF3_cp_0.velocity.X + 1f; Gore expr_14013_cp_0 = Main.gore[num633]; expr_14013_cp_0.velocity.Y = expr_14013_cp_0.velocity.Y - 1f; - num633 = 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); + num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_140B6_cp_0 = Main.gore[num633]; expr_140B6_cp_0.velocity.X = expr_140B6_cp_0.velocity.X - 1f; Gore expr_140D6_cp_0 = Main.gore[num633]; expr_140D6_cp_0.velocity.Y = expr_140D6_cp_0.velocity.Y - 1f; } - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.position.X = projectile.position.X + projectile.width / 2; + projectile.position.Y = projectile.position.Y + projectile.height / 2; projectile.width = 10; projectile.height = 10; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.position.X = projectile.position.X - projectile.width / 2; + projectile.position.Y = projectile.position.Y - projectile.height / 2; if (projectile.owner == Main.myPlayer) { int num220 = Main.rand.Next(3, 8); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("BoomCloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("BoomCloudPro"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } diff --git a/Projectiles/AncientFlailPro.cs b/Projectiles/AncientFlailPro.cs index 0037caf4..38d06f41 100644 --- a/Projectiles/AncientFlailPro.cs +++ b/Projectiles/AncientFlailPro.cs @@ -1,8 +1,6 @@ using System; - using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; - using Terraria; using Terraria.ModLoader; @@ -29,17 +27,17 @@ public override void SetStaticDefaults() } - public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Color lightColor) + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Texture2D texture = ModLoader.GetTexture("Tremor/Projectiles/AncientFlail_Chain"); Vector2 position = projectile.Center; Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; - Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(); - Vector2 origin = new Vector2((float)texture.Width * 0.5f, (float)texture.Height * 0.5f); - float num1 = (float)texture.Height; + Rectangle? sourceRectangle = new Rectangle?(); + Vector2 origin = new Vector2(texture.Width * 0.5f, texture.Height * 0.5f); + float num1 = texture.Height; Vector2 vector2_4 = mountedCenter - position; - float rotation = (float)Math.Atan2((double)vector2_4.Y, (double)vector2_4.X) - 1.57f; + float rotation = (float)Math.Atan2(vector2_4.Y, vector2_4.X) - 1.57f; bool flag = true; if (float.IsNaN(position.X) && float.IsNaN(position.Y)) flag = false; @@ -47,7 +45,7 @@ public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch sprite flag = false; while (flag) { - if ((double)vector2_4.Length() < (double)num1 + 1.0) + if (vector2_4.Length() < num1 + 1.0) { flag = false; } @@ -57,7 +55,7 @@ public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch sprite vector2_1.Normalize(); position += vector2_1 * num1; vector2_4 = mountedCenter - position; - Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)position.X / 16, (int)((double)position.Y / 16.0)); + Color color2 = Lighting.GetColor((int)position.X / 16, (int)(position.Y / 16.0)); color2 = projectile.GetAlpha(color2); Main.spriteBatch.Draw(texture, position - Main.screenPosition, sourceRectangle, color2, rotation, origin, 1f, SpriteEffects.None, 0.0f); } diff --git a/Projectiles/AncientShield.cs b/Projectiles/AncientShield.cs index 33641fd0..7469e3db 100644 --- a/Projectiles/AncientShield.cs +++ b/Projectiles/AncientShield.cs @@ -37,29 +37,29 @@ public override bool PreAI() float Num = 4f; float Num2 = 1.1f; int Num3 = 1; - if (projectile.position.X + (float)(projectile.width / 2) < Main.player[projectile.owner].position.X + (float)Main.player[projectile.owner].width) + if (projectile.position.X + projectile.width / 2 < Main.player[projectile.owner].position.X + Main.player[projectile.owner].width) { Num3 = -1; } - Vector2 Vector1 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float Num4 = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) + (float)(Num3 * 180) - Vector1.X; - float Num5 = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - Vector1.Y; - float Num6 = (float)Math.Sqrt((double)(Num4 * Num4 + Num5 * Num5)); - float Num7 = projectile.position.X + (float)(projectile.width / 2) - Main.player[projectile.owner].position.X - (float)(Main.player[projectile.owner].width / 2); - float Num8 = projectile.position.Y + (float)projectile.height - 59f - Main.player[projectile.owner].position.Y - (float)(Main.player[projectile.owner].height / 2); - float Num9 = (float)Math.Atan2((double)Num8, (double)Num7) + 1.57f; + Vector2 Vector1 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); + float Num4 = Main.player[projectile.owner].position.X + Main.player[projectile.owner].width / 2 + Num3 * 180 - Vector1.X; + float Num5 = Main.player[projectile.owner].position.Y + Main.player[projectile.owner].height / 2 - Vector1.Y; + float Num6 = (float)Math.Sqrt(Num4 * Num4 + Num5 * Num5); + float Num7 = projectile.position.X + projectile.width / 2 - Main.player[projectile.owner].position.X - Main.player[projectile.owner].width / 2; + float Num8 = projectile.position.Y + projectile.height - 59f - Main.player[projectile.owner].position.Y - Main.player[projectile.owner].height / 2; + float Num9 = (float)Math.Atan2(Num8, Num7) + 1.57f; if (Num9 < 0f) { Num9 += 6.283f; } - else if ((double)Num9 > 6.283) + else if (Num9 > 6.283) { Num9 -= 6.283f; } float Num10 = 0.15f; if (projectile.rotation < Num9) { - if ((double)(Num9 - projectile.rotation) > 3.1415) + if (Num9 - projectile.rotation > 3.1415) { projectile.rotation -= Num10; } @@ -70,7 +70,7 @@ public override bool PreAI() } else if (projectile.rotation > Num9) { - if ((double)(projectile.rotation - Num9) > 3.1415) + if (projectile.rotation - Num9 > 3.1415) { projectile.rotation += Num10; } @@ -87,7 +87,7 @@ public override bool PreAI() { projectile.rotation += 6.283f; } - else if ((double)projectile.rotation > 6.283) + else if (projectile.rotation > 6.283) { projectile.rotation -= 6.283f; } diff --git a/Projectiles/AncientSolarWindPro.cs b/Projectiles/AncientSolarWindPro.cs index fd3f70f5..40a2a843 100644 --- a/Projectiles/AncientSolarWindPro.cs +++ b/Projectiles/AncientSolarWindPro.cs @@ -30,8 +30,8 @@ public override void AI() Main.player[projectile.owner].direction = projectile.direction; Main.player[projectile.owner].heldProj = projectile.whoAmI; Main.player[projectile.owner].itemTime = Main.player[projectile.owner].itemAnimation; - 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.X = Main.player[projectile.owner].position.X + Main.player[projectile.owner].width / 2 - projectile.width / 2; + projectile.position.Y = Main.player[projectile.owner].position.Y + Main.player[projectile.owner].height / 2 - projectile.height / 2; projectile.position += projectile.velocity * projectile.ai[0]; if (projectile.ai[0] == 0f) { @@ -62,7 +62,7 @@ public override void AI() } //Rotate spear - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 2.355f; + projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + 2.355f; if (projectile.spriteDirection == -1) { projectile.rotation -= 1.57f; diff --git a/Projectiles/AncientSunExplosionPro.cs b/Projectiles/AncientSunExplosionPro.cs index 78f8a0db..24953b1d 100644 --- a/Projectiles/AncientSunExplosionPro.cs +++ b/Projectiles/AncientSunExplosionPro.cs @@ -75,12 +75,12 @@ public override void AI() num461 *= 0.7f; projectile.ai[0] += 4f; int num462 = 0; - while ((float)num462 < num461) + while (num462 < num461) { - float num463 = (float)Main.rand.Next(-10, 11); - float num464 = (float)Main.rand.Next(-10, 11); - float num465 = (float)Main.rand.Next(3, 9); - float num466 = (float)Math.Sqrt((double)(num463 * num463 + num464 * num464)); + float num463 = Main.rand.Next(-10, 11); + float num464 = Main.rand.Next(-10, 11); + float num465 = Main.rand.Next(3, 9); + float num466 = (float)Math.Sqrt(num463 * num463 + num464 * num464); num466 = num465 / num466; num463 *= num466; num464 *= num466; @@ -89,14 +89,13 @@ public override void AI() Main.dust[num467].position.X = projectile.Center.X; Main.dust[num467].position.Y = projectile.Center.Y; Dust expr_149DF_cp_0 = Main.dust[num467]; - expr_149DF_cp_0.position.X = expr_149DF_cp_0.position.X + (float)Main.rand.Next(-10, 11); + expr_149DF_cp_0.position.X = expr_149DF_cp_0.position.X + Main.rand.Next(-10, 11); Dust expr_14A09_cp_0 = Main.dust[num467]; - expr_14A09_cp_0.position.Y = expr_14A09_cp_0.position.Y + (float)Main.rand.Next(-10, 11); + expr_14A09_cp_0.position.Y = expr_14A09_cp_0.position.Y + Main.rand.Next(-10, 11); Main.dust[num467].velocity.X = num463; Main.dust[num467].velocity.Y = num464; num462++; } - return; } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/AncientSunPro.cs b/Projectiles/AncientSunPro.cs index 44d76a3a..83c4dd60 100644 --- a/Projectiles/AncientSunPro.cs +++ b/Projectiles/AncientSunPro.cs @@ -44,7 +44,6 @@ public override void AI() Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; } - return; } public override bool OnTileCollide(Vector2 oldVelocity) diff --git a/Projectiles/AngelTearsPro.cs b/Projectiles/AngelTearsPro.cs index 836099ce..d49a2973 100644 --- a/Projectiles/AngelTearsPro.cs +++ b/Projectiles/AngelTearsPro.cs @@ -31,10 +31,10 @@ public override void AI() Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.45f) / 255f, ((255 - projectile.alpha) * 0.2f) / 255f, ((255 - projectile.alpha) * 0.1f) / 255f); for (int num92 = 0; num92 < 5; num92++) { - float num93 = projectile.velocity.X / 3f * (float)num92; - float num94 = projectile.velocity.Y / 3f * (float)num92; + float num93 = projectile.velocity.X / 3f * num92; + float num94 = projectile.velocity.Y / 3f * 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, 57, 0f, 0f, 100, default(Color), 1.2f); + int num96 = Dust.NewDust(new Vector2(projectile.position.X + num95, projectile.position.Y + num95), projectile.width - num95 * 2, projectile.height - num95 * 2, 57, 0f, 0f, 100, default(Color), 1.2f); Main.dust[num96].noGravity = true; Main.dust[num96].velocity *= 0.1f; Main.dust[num96].velocity += projectile.velocity * 0.1f; @@ -46,7 +46,7 @@ public override void AI() if (Main.rand.Next(5) == 0) { 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 + num97, projectile.position.Y + num97), projectile.width - num97 * 2, projectile.height - num97 * 2, 174, 0f, 0f, 100, default(Color), 0.6f); Main.dust[num98].velocity *= 0.25f; Main.dust[num98].velocity += projectile.velocity * 0.5f; } @@ -56,12 +56,11 @@ public override void AI() } else { - projectile.rotation += 0.3f * (float)projectile.direction; + projectile.rotation += 0.3f * projectile.direction; } if (projectile.velocity.Y > 16f) { projectile.velocity.Y = 16f; - return; } } diff --git a/Projectiles/ArgiteSpherePro.cs b/Projectiles/ArgiteSpherePro.cs index d5dd40bc..e4319312 100644 --- a/Projectiles/ArgiteSpherePro.cs +++ b/Projectiles/ArgiteSpherePro.cs @@ -66,13 +66,13 @@ public override void Kill(int timeLeft) int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 44, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); if (Main.rand.Next(3) == 0) { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].type++; } else { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 1.2f + Main.rand.Next(-10, 11) * 0.01f; } Main.dust[num159].noGravity = true; Main.dust[num159].velocity *= 2.5f; @@ -83,14 +83,14 @@ public override void Kill(int timeLeft) int num160 = Main.rand.Next(0, 0); for (int num161 = 0; num161 < num160; num161++) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); while (value12.X == 0f && value12.Y == 0f) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); } value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); + value12 *= Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + projectile.width / 2, projectile.oldPosition.Y + projectile.height / 2, value12.X, value12.Y, 400, (int)(projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/BallChainPro.cs b/Projectiles/BallChainPro.cs index 8389346a..51178e04 100644 --- a/Projectiles/BallChainPro.cs +++ b/Projectiles/BallChainPro.cs @@ -1,8 +1,6 @@ using System; - using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; - using Terraria; using Terraria.ModLoader; @@ -13,7 +11,7 @@ public class BallChainPro : ModProjectile const float RotationSpeed = 0.05f; const float Distanse = 320; - float Rotation = 0; + float Rotation; public override void SetDefaults() { @@ -47,17 +45,17 @@ public override void AI() return !target.friendly; } - public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Color lightColor) + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Texture2D texture = ModLoader.GetTexture("Tremor/Projectiles/BallChain_Chain"); Vector2 position = projectile.Center; Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; - Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(); - Vector2 origin = new Vector2((float)texture.Width * 0.5f, (float)texture.Height * 0.5f); - float num1 = (float)texture.Height; + Rectangle? sourceRectangle = new Rectangle?(); + Vector2 origin = new Vector2(texture.Width * 0.5f, texture.Height * 0.5f); + float num1 = texture.Height; Vector2 vector2_4 = mountedCenter - position; - float rotation = (float)Math.Atan2((double)vector2_4.Y, (double)vector2_4.X) - 1.57f; + float rotation = (float)Math.Atan2(vector2_4.Y, vector2_4.X) - 1.57f; bool flag = true; if (float.IsNaN(position.X) && float.IsNaN(position.Y)) flag = false; @@ -65,7 +63,7 @@ public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch sprite flag = false; while (flag) { - if ((double)vector2_4.Length() < (double)num1 + 1.0) + if (vector2_4.Length() < num1 + 1.0) { flag = false; } @@ -75,7 +73,7 @@ public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch sprite vector2_1.Normalize(); position += vector2_1 * num1; vector2_4 = mountedCenter - position; - Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)position.X / 16, (int)((double)position.Y / 16.0)); + Color color2 = Lighting.GetColor((int)position.X / 16, (int)(position.Y / 16.0)); color2 = projectile.GetAlpha(color2); Main.spriteBatch.Draw(texture, position - Main.screenPosition, sourceRectangle, color2, rotation, origin, 1f, SpriteEffects.None, 0.0f); } diff --git a/Projectiles/BerserkerPro.cs b/Projectiles/BerserkerPro.cs index e87ea4a3..fa84a484 100644 --- a/Projectiles/BerserkerPro.cs +++ b/Projectiles/BerserkerPro.cs @@ -1,5 +1,5 @@ -using Terraria.ModLoader; -using Terraria; +using Terraria; +using Terraria.ModLoader; namespace Tremor.Projectiles { @@ -8,7 +8,7 @@ public class BerserkerPro : ModProjectile const float RotationSpeed = 0.05f; const float Distanse = 48; - float Rotation = 0; + float Rotation; public override void SetDefaults() { @@ -33,8 +33,8 @@ public override void SetStaticDefaults() public override void AI() { Rotation += RotationSpeed; - projectile.Center = Helper.PolarPos(Terraria.Main.player[(int)projectile.ai[0]].Center, Distanse, Helper.GradtoRad(Rotation)); - projectile.rotation = Helper.rotateBetween2Points(Terraria.Main.player[(int)projectile.ai[0]].Center, projectile.Center) - Helper.GradtoRad(90); + projectile.Center = Helper.PolarPos(Main.player[(int)projectile.ai[0]].Center, Distanse, Helper.GradtoRad(Rotation)); + projectile.rotation = Helper.rotateBetween2Points(Main.player[(int)projectile.ai[0]].Center, projectile.Center) - Helper.GradtoRad(90); } public override bool? CanHitNPC(NPC target) diff --git a/Projectiles/BestNightmarePro.cs b/Projectiles/BestNightmarePro.cs index 29af37d6..053fcfd4 100644 --- a/Projectiles/BestNightmarePro.cs +++ b/Projectiles/BestNightmarePro.cs @@ -1,3 +1,4 @@ +using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -30,7 +31,7 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) for (int k = 0; k < projectile.oldPos.Length; k++) { Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); - Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); + Color color = projectile.GetAlpha(lightColor) * ((projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); } return true; @@ -38,7 +39,7 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) public override void AI() { - projectile.rotation = (float)System.Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + 1.57f; if (Main.rand.Next(1) == 0) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 62, projectile.velocity.X * 0.9f, projectile.velocity.Y * 0.9f); @@ -93,7 +94,7 @@ public override void AI() { Vector2 vector64 = vector63 * -1f; vector64.Normalize(); - vector64 *= (float)Main.rand.Next(5, 25) * 0.9f; + vector64 *= Main.rand.Next(5, 25) * 0.9f; Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vector64.X, vector64.Y, mod.ProjectileType("ChaosStarPro"), projectile.damage / 3, projectile.knockBack, projectile.owner, -10f, 0f); } diff --git a/Projectiles/BloodyArrow.cs b/Projectiles/BloodyArrow.cs index d4709a2d..a4d3eae0 100644 --- a/Projectiles/BloodyArrow.cs +++ b/Projectiles/BloodyArrow.cs @@ -39,13 +39,13 @@ public override void Kill(int timeLeft) int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); if (Main.rand.Next(3) == 0) { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].type++; } else { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 1.2f + Main.rand.Next(-10, 11) * 0.01f; } Main.dust[num159].noGravity = true; Main.dust[num159].velocity *= 2.5f; @@ -56,14 +56,14 @@ public override void Kill(int timeLeft) int num160 = Main.rand.Next(0, 0); for (int num161 = 0; num161 < num160; num161++) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); while (value12.X == 0f && value12.Y == 0f) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); } value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); + value12 *= Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + projectile.width / 2, projectile.oldPosition.Y + projectile.height / 2, value12.X, value12.Y, 400, (int)(projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/BrainSmasherPro.cs b/Projectiles/BrainSmasherPro.cs index a6a82093..33ea8d3a 100644 --- a/Projectiles/BrainSmasherPro.cs +++ b/Projectiles/BrainSmasherPro.cs @@ -1,8 +1,6 @@ using System; - using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; - using Terraria; using Terraria.ModLoader; @@ -13,7 +11,7 @@ public class BrainSmasherPro : ModProjectile const float RotationSpeed = 0.05f; const float Distanse = 300; - float Rotation = 0; + float Rotation; public override void SetDefaults() { @@ -38,8 +36,8 @@ public override void SetStaticDefaults() public override void AI() { Rotation += RotationSpeed; - projectile.Center = Helper.PolarPos(Terraria.Main.player[(int)projectile.ai[0]].Center, Distanse, Helper.GradtoRad(Rotation)); - projectile.rotation = Helper.rotateBetween2Points(Terraria.Main.player[(int)projectile.ai[0]].Center, projectile.Center) - Helper.GradtoRad(90); + projectile.Center = Helper.PolarPos(Main.player[(int)projectile.ai[0]].Center, Distanse, Helper.GradtoRad(Rotation)); + projectile.rotation = Helper.rotateBetween2Points(Main.player[(int)projectile.ai[0]].Center, projectile.Center) - Helper.GradtoRad(90); } public override bool? CanHitNPC(NPC target) @@ -47,17 +45,17 @@ public override void AI() return !target.friendly; } - public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Color lightColor) + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Texture2D texture = ModLoader.GetTexture("Tremor/Projectiles/BrainSmasher_Chain"); Vector2 position = projectile.Center; Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; - Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(); - Vector2 origin = new Vector2((float)texture.Width * 0.5f, (float)texture.Height * 0.5f); - float num1 = (float)texture.Height; + Rectangle? sourceRectangle = new Rectangle?(); + Vector2 origin = new Vector2(texture.Width * 0.5f, texture.Height * 0.5f); + float num1 = texture.Height; Vector2 vector2_4 = mountedCenter - position; - float rotation = (float)Math.Atan2((double)vector2_4.Y, (double)vector2_4.X) - 1.57f; + float rotation = (float)Math.Atan2(vector2_4.Y, vector2_4.X) - 1.57f; bool flag = true; if (float.IsNaN(position.X) && float.IsNaN(position.Y)) flag = false; @@ -65,7 +63,7 @@ public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch sprite flag = false; while (flag) { - if ((double)vector2_4.Length() < (double)num1 + 1.0) + if (vector2_4.Length() < num1 + 1.0) { flag = false; } @@ -75,7 +73,7 @@ public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch sprite vector2_1.Normalize(); position += vector2_1 * num1; vector2_4 = mountedCenter - position; - Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)position.X / 16, (int)((double)position.Y / 16.0)); + Color color2 = Lighting.GetColor((int)position.X / 16, (int)(position.Y / 16.0)); color2 = projectile.GetAlpha(color2); Main.spriteBatch.Draw(texture, position - Main.screenPosition, sourceRectangle, color2, rotation, origin, 1f, SpriteEffects.None, 0.0f); } diff --git a/Projectiles/BrainiacWavePro.cs b/Projectiles/BrainiacWavePro.cs index eb87cac7..d2ad6c36 100644 --- a/Projectiles/BrainiacWavePro.cs +++ b/Projectiles/BrainiacWavePro.cs @@ -1,3 +1,4 @@ +using System; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; @@ -24,7 +25,7 @@ public override void SetStaticDefaults() public override void AI() { - projectile.rotation = (float)System.Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + 1.57f; if (Main.rand.Next(1) == 0) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 60, projectile.velocity.X * 0.9f, projectile.velocity.Y * 0.9f); @@ -57,13 +58,13 @@ public override void Kill(int timeLeft) int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); if (Main.rand.Next(3) == 0) { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].type++; } else { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 1.2f + Main.rand.Next(-10, 11) * 0.01f; } Main.dust[num159].noGravity = true; Main.dust[num159].velocity *= 2.5f; @@ -74,14 +75,14 @@ public override void Kill(int timeLeft) int num160 = Main.rand.Next(0, 0); for (int num161 = 0; num161 < num160; num161++) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); while (value12.X == 0f && value12.Y == 0f) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); } value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); + value12 *= Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + projectile.width / 2, projectile.oldPosition.Y + projectile.height / 2, value12.X, value12.Y, 400, (int)(projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/BurningFist.cs b/Projectiles/BurningFist.cs index c7a802fd..918ef928 100644 --- a/Projectiles/BurningFist.cs +++ b/Projectiles/BurningFist.cs @@ -32,20 +32,20 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(3, 6); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, 15, projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, 15, projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.position.X = projectile.position.X + projectile.width / 2; + projectile.position.Y = projectile.position.Y + projectile.height / 2; projectile.width = 80; projectile.height = 80; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.position.X = projectile.position.X - projectile.width / 2; + projectile.position.Y = projectile.position.Y - projectile.height / 2; for (int num628 = 0; num628 < 40; num628++) { int num629 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); @@ -53,7 +53,7 @@ public override void Kill(int timeLeft) if (Main.rand.Next(2) == 0) { Main.dust[num629].scale = 0.5f; - Main.dust[num629].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num629].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } for (int num630 = 0; num630 < 70; num630++) @@ -75,37 +75,37 @@ public override void Kill(int timeLeft) { scaleFactor10 = 1f; } - int num633 = 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 num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13E6D_cp_0 = Main.gore[num633]; expr_13E6D_cp_0.velocity.X = expr_13E6D_cp_0.velocity.X + 1f; Gore expr_13E8D_cp_0 = Main.gore[num633]; expr_13E8D_cp_0.velocity.Y = expr_13E8D_cp_0.velocity.Y + 1f; - num633 = 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), 2f); + num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 2f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13F30_cp_0 = Main.gore[num633]; expr_13F30_cp_0.velocity.X = expr_13F30_cp_0.velocity.X - 1f; Gore expr_13F50_cp_0 = Main.gore[num633]; expr_13F50_cp_0.velocity.Y = expr_13F50_cp_0.velocity.Y + 1f; - num633 = 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); + num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13FF3_cp_0 = Main.gore[num633]; expr_13FF3_cp_0.velocity.X = expr_13FF3_cp_0.velocity.X + 1f; Gore expr_14013_cp_0 = Main.gore[num633]; expr_14013_cp_0.velocity.Y = expr_14013_cp_0.velocity.Y - 1f; - num633 = 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); + num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_140B6_cp_0 = Main.gore[num633]; expr_140B6_cp_0.velocity.X = expr_140B6_cp_0.velocity.X - 1f; Gore expr_140D6_cp_0 = Main.gore[num633]; expr_140D6_cp_0.velocity.Y = expr_140D6_cp_0.velocity.Y - 1f; } - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.position.X = projectile.position.X + projectile.width / 2; + projectile.position.Y = projectile.position.Y + projectile.height / 2; projectile.width = 10; projectile.height = 10; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.position.X = projectile.position.X - projectile.width / 2; + projectile.position.Y = projectile.position.Y - projectile.height / 2; } diff --git a/Projectiles/ChainedRocketPro.cs b/Projectiles/ChainedRocketPro.cs index 2d5c0736..7e82f869 100644 --- a/Projectiles/ChainedRocketPro.cs +++ b/Projectiles/ChainedRocketPro.cs @@ -1,8 +1,6 @@ using System; - using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; - using Terraria; using Terraria.ModLoader; @@ -53,7 +51,7 @@ public override void AI() Main.player[projectile.owner].ChangeDir(-1); projectile.direction = -1; } - Main.player[projectile.owner].itemRotation = (vector63 * -1f * (float)projectile.direction).ToRotation(); + Main.player[projectile.owner].itemRotation = (vector63 * -1f * projectile.direction).ToRotation(); projectile.spriteDirection = ((vector63.X > 0f) ? -1 : 1); if (projectile.ai[0] == 0f && vector63.Length() > 800f) { @@ -93,23 +91,23 @@ public override void AI() { Vector2 vector64 = vector63 * -1f; vector64.Normalize(); - vector64 *= (float)Main.rand.Next(45, 65) * 0.1f; + vector64 *= Main.rand.Next(45, 65) * 0.1f; vector64 = vector64.RotatedBy((Main.rand.NextDouble() - 0.5) * 1.5707963705062866, default(Vector2)); Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vector64.X, vector64.Y, mod.ProjectileType("nichego"), projectile.damage, projectile.knockBack, projectile.owner, -10f, 0f); } } - public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Color lightColor) + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Texture2D texture = ModLoader.GetTexture("Tremor/Projectiles/ChainedRocket_Chain"); Vector2 position = projectile.Center; Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; - Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(); - Vector2 origin = new Vector2((float)texture.Width * 0.5f, (float)texture.Height * 0.5f); - float num1 = (float)texture.Height; + Rectangle? sourceRectangle = new Rectangle?(); + Vector2 origin = new Vector2(texture.Width * 0.5f, texture.Height * 0.5f); + float num1 = texture.Height; Vector2 vector2_4 = mountedCenter - position; - float rotation = (float)Math.Atan2((double)vector2_4.Y, (double)vector2_4.X) - 1.57f; + float rotation = (float)Math.Atan2(vector2_4.Y, vector2_4.X) - 1.57f; bool flag = true; if (float.IsNaN(position.X) && float.IsNaN(position.Y)) flag = false; @@ -117,7 +115,7 @@ public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch sprite flag = false; while (flag) { - if ((double)vector2_4.Length() < (double)num1 + 1.0) + if (vector2_4.Length() < num1 + 1.0) { flag = false; } @@ -127,7 +125,7 @@ public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch sprite vector2_1.Normalize(); position += vector2_1 * num1; vector2_4 = mountedCenter - position; - Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)position.X / 16, (int)((double)position.Y / 16.0)); + Color color2 = Lighting.GetColor((int)position.X / 16, (int)(position.Y / 16.0)); color2 = projectile.GetAlpha(color2); Main.spriteBatch.Draw(texture, position - Main.screenPosition, sourceRectangle, color2, rotation, origin, 1f, SpriteEffects.None, 0.0f); } diff --git a/Projectiles/ChaosStarPro.cs b/Projectiles/ChaosStarPro.cs index 6e5ef911..b13a4d9d 100644 --- a/Projectiles/ChaosStarPro.cs +++ b/Projectiles/ChaosStarPro.cs @@ -35,7 +35,7 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) for (int k = 0; k < projectile.oldPos.Length; k++) { Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); - Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); + Color color = projectile.GetAlpha(lightColor) * ((projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); } return true; @@ -48,13 +48,13 @@ public override void Kill(int timeLeft) int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 68, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.3f); if (Main.rand.Next(3) == 0) { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].type++; } else { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 1.2f + Main.rand.Next(-10, 11) * 0.01f; } Main.dust[num159].noGravity = true; Main.dust[num159].velocity *= 2.5f; @@ -65,14 +65,14 @@ public override void Kill(int timeLeft) int num160 = Main.rand.Next(0, 0); for (int num161 = 0; num161 < num160; num161++) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); while (value12.X == 0f && value12.Y == 0f) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); } value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 2.8f, projectile.owner, 0f, 0f); + value12 *= Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + projectile.width / 2, projectile.oldPosition.Y + projectile.height / 2, value12.X, value12.Y, 400, (int)(projectile.damage * 0.8), projectile.knockBack * 2.8f, projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/ChargedArrowBoom.cs b/Projectiles/ChargedArrowBoom.cs index f57e7318..5c97aef3 100644 --- a/Projectiles/ChargedArrowBoom.cs +++ b/Projectiles/ChargedArrowBoom.cs @@ -74,12 +74,12 @@ public override void AI() num461 *= 0.7f; projectile.ai[0] += 4f; int num462 = 0; - while ((float)num462 < num461) + while (num462 < num461) { - float num463 = (float)Main.rand.Next(-10, 11); - float num464 = (float)Main.rand.Next(-10, 11); - float num465 = (float)Main.rand.Next(3, 9); - float num466 = (float)Math.Sqrt((double)(num463 * num463 + num464 * num464)); + float num463 = Main.rand.Next(-10, 11); + float num464 = Main.rand.Next(-10, 11); + float num465 = Main.rand.Next(3, 9); + float num466 = (float)Math.Sqrt(num463 * num463 + num464 * num464); num466 = num465 / num466; num463 *= num466; num464 *= num466; @@ -88,14 +88,13 @@ public override void AI() Main.dust[num467].position.X = projectile.Center.X; Main.dust[num467].position.Y = projectile.Center.Y; Dust expr_149DF_cp_0 = Main.dust[num467]; - expr_149DF_cp_0.position.X = expr_149DF_cp_0.position.X + (float)Main.rand.Next(-10, 11); + expr_149DF_cp_0.position.X = expr_149DF_cp_0.position.X + Main.rand.Next(-10, 11); Dust expr_14A09_cp_0 = Main.dust[num467]; - expr_14A09_cp_0.position.Y = expr_14A09_cp_0.position.Y + (float)Main.rand.Next(-10, 11); + expr_14A09_cp_0.position.Y = expr_14A09_cp_0.position.Y + Main.rand.Next(-10, 11); Main.dust[num467].velocity.X = num463; Main.dust[num467].velocity.Y = num464; num462++; } - return; } } diff --git a/Projectiles/CobaltBolt.cs b/Projectiles/CobaltBolt.cs index 6af18cd8..80fc4b0c 100644 --- a/Projectiles/CobaltBolt.cs +++ b/Projectiles/CobaltBolt.cs @@ -55,7 +55,6 @@ public override void AI() if (projectile.wet && !projectile.lavaWet) { projectile.Kill(); - return; } } } diff --git a/Projectiles/CogLordLaser.cs b/Projectiles/CogLordLaser.cs index f00b8966..e1eb0f22 100644 --- a/Projectiles/CogLordLaser.cs +++ b/Projectiles/CogLordLaser.cs @@ -37,15 +37,15 @@ public override void AI() for (int num449 = 0; num449 < 4; num449++) { Vector2 vector34 = projectile.position; - vector34 -= projectile.velocity * ((float)num449 * 0.25f); + vector34 -= projectile.velocity * (num449 * 0.25f); projectile.alpha = 255; int num450 = Dust.NewDust(vector34, 1, 1, 162, 0f, 0f, 0, default(Color), 1f); Main.dust[num450].position = vector34; Dust expr_13F6C_cp_0 = Main.dust[num450]; - expr_13F6C_cp_0.position.X = expr_13F6C_cp_0.position.X + (float)(projectile.width / 2); + expr_13F6C_cp_0.position.X = expr_13F6C_cp_0.position.X + projectile.width / 2; Dust expr_13F90_cp_0 = Main.dust[num450]; - expr_13F90_cp_0.position.Y = expr_13F90_cp_0.position.Y + (float)(projectile.height / 2); - Main.dust[num450].scale = (float)Main.rand.Next(70, 110) * 0.013f; + expr_13F90_cp_0.position.Y = expr_13F90_cp_0.position.Y + projectile.height / 2; + Main.dust[num450].scale = Main.rand.Next(70, 110) * 0.013f; Main.dust[num450].velocity *= 0.2f; } } diff --git a/Projectiles/CorfirePro.cs b/Projectiles/CorfirePro.cs index 119b7512..3a0873a9 100644 --- a/Projectiles/CorfirePro.cs +++ b/Projectiles/CorfirePro.cs @@ -1,3 +1,4 @@ +using System; using Terraria; using Terraria.ModLoader; @@ -23,7 +24,7 @@ public override void SetStaticDefaults() public override void AI() { - projectile.rotation = (float)System.Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + 1.57f; if (Main.rand.Next(1) == 0) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 74, projectile.velocity.X * 0.9f, projectile.velocity.Y * 0.9f); diff --git a/Projectiles/CthulhunadoPro.cs b/Projectiles/CthulhunadoPro.cs index 6a53f01a..44b42a2b 100644 --- a/Projectiles/CthulhunadoPro.cs +++ b/Projectiles/CthulhunadoPro.cs @@ -57,20 +57,20 @@ public override void AI() if (projectile.localAI[0] == 0f) { projectile.localAI[0] = 1f; - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); - projectile.scale = ((float)(num613 + num614) - projectile.ai[1]) * num615 / (float)(num614 + num613); - projectile.width = (int)((float)num616 * projectile.scale); - projectile.height = (int)((float)num617 * projectile.scale); - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.position.X = projectile.position.X + projectile.width / 2; + projectile.position.Y = projectile.position.Y + projectile.height / 2; + projectile.scale = (num613 + num614 - projectile.ai[1]) * num615 / (num614 + num613); + projectile.width = (int)(num616 * projectile.scale); + projectile.height = (int)(num617 * projectile.scale); + projectile.position.X = projectile.position.X - projectile.width / 2; + projectile.position.Y = projectile.position.Y - projectile.height / 2; projectile.netUpdate = true; } if (projectile.ai[1] != -1f) { - projectile.scale = ((float)(num613 + num614) - projectile.ai[1]) * num615 / (float)(num614 + num613); - projectile.width = (int)((float)num616 * projectile.scale); - projectile.height = (int)((float)num617 * projectile.scale); + projectile.scale = (num613 + num614 - projectile.ai[1]) * num615 / (num614 + num613); + projectile.width = (int)(num616 * projectile.scale); + projectile.height = (int)(num617 * projectile.scale); } if (!Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) { @@ -96,22 +96,21 @@ public override void AI() { projectile.netUpdate = true; Vector2 center = projectile.Center; - center.Y -= (float)num617 * projectile.scale / 2f; - float num618 = ((float)(num613 + num614) - projectile.ai[1] + 1f) * num615 / (float)(num614 + num613); - center.Y -= (float)num617 * num618 / 2f; + center.Y -= num617 * projectile.scale / 2f; + float num618 = (num613 + num614 - projectile.ai[1] + 1f) * num615 / (num614 + num613); + center.Y -= num617 * num618 / 2f; center.Y += 2f; Projectile.NewProjectile(center.X, center.Y, projectile.velocity.X, projectile.velocity.Y, projectile.type, projectile.damage, projectile.knockBack, projectile.owner, 10f, projectile.ai[1] - 1f); } if (projectile.ai[0] <= 0f) { float num622 = 0.104719758f; - float num623 = (float)projectile.width / 5f; - float num624 = (float)(Math.Cos((double)(num622 * -(double)projectile.ai[0])) - 0.5) * num623; - projectile.position.X = projectile.position.X - num624 * (float)(-(float)projectile.direction); + float num623 = projectile.width / 5f; + float num624 = (float)(Math.Cos(num622 * -(double)projectile.ai[0]) - 0.5) * num623; + projectile.position.X = projectile.position.X - num624 * -(float)projectile.direction; projectile.ai[0] -= 1f; - num624 = (float)(Math.Cos((double)(num622 * -(double)projectile.ai[0])) - 0.5) * num623; - projectile.position.X = projectile.position.X + num624 * (float)(-(float)projectile.direction); - return; + num624 = (float)(Math.Cos(num622 * -(double)projectile.ai[0]) - 0.5) * num623; + projectile.position.X = projectile.position.X + num624 * -(float)projectile.direction; } } } diff --git a/Projectiles/CursedTwisterPro.cs b/Projectiles/CursedTwisterPro.cs index fb1592c6..34663d45 100644 --- a/Projectiles/CursedTwisterPro.cs +++ b/Projectiles/CursedTwisterPro.cs @@ -75,7 +75,7 @@ public override void AI() { projectile.ai[0] += 1f; } - projectile.rotation += 0.3f * (float)projectile.direction; + projectile.rotation += 0.3f * projectile.direction; } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/CyberCutterPro.cs b/Projectiles/CyberCutterPro.cs index 1a4f191e..104daf0c 100644 --- a/Projectiles/CyberCutterPro.cs +++ b/Projectiles/CyberCutterPro.cs @@ -1,6 +1,5 @@ using System; using Microsoft.Xna.Framework; - using Terraria; using Terraria.ModLoader; @@ -38,130 +37,130 @@ public override void AI() Main.dust[DustID1].noGravity = true; Main.dust[DustID2].noGravity = true; Main.dust[DustID3].noGravity = true; - projectile.rotation += (float)projectile.direction * 0.8f; + projectile.rotation += projectile.direction * 0.8f; if (Main.myPlayer == projectile.owner && projectile.ai[0] == 0f) { - projectile.rotation += (float)projectile.direction * 0.8f; + projectile.rotation += projectile.direction * 0.8f; if (Main.player[projectile.owner].channel) { - projectile.rotation += (float)projectile.direction * 0.8f; + projectile.rotation += projectile.direction * 0.8f; float num146 = 12f; - Vector2 vector10 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - projectile.rotation += (float)projectile.direction * 0.8f; - float num147 = (float)Main.mouseX + Main.screenPosition.X - vector10.X; - projectile.rotation += (float)projectile.direction * 0.8f; - float num148 = (float)Main.mouseY + Main.screenPosition.Y - vector10.Y; - projectile.rotation += (float)projectile.direction * 0.8f; + Vector2 vector10 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); + projectile.rotation += projectile.direction * 0.8f; + float num147 = Main.mouseX + Main.screenPosition.X - vector10.X; + projectile.rotation += projectile.direction * 0.8f; + float num148 = Main.mouseY + Main.screenPosition.Y - vector10.Y; + projectile.rotation += projectile.direction * 0.8f; if (Main.player[projectile.owner].gravDir == -1f) { - num148 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector10.Y; - projectile.rotation += (float)projectile.direction * 0.8f; + num148 = Main.screenPosition.Y + Main.screenHeight - Main.mouseY - vector10.Y; + projectile.rotation += projectile.direction * 0.8f; } - float num149 = (float)Math.Sqrt((double)(num147 * num147 + num148 * num148)); - num149 = (float)Math.Sqrt((double)(num147 * num147 + num148 * num148)); + float num149 = (float)Math.Sqrt(num147 * num147 + num148 * num148); + num149 = (float)Math.Sqrt(num147 * num147 + num148 * num148); if (num149 > num146) { - projectile.rotation += (float)projectile.direction * 0.8f; + projectile.rotation += projectile.direction * 0.8f; num149 = num146 / num149; num147 *= num149; num148 *= num149; int num150 = (int)(num147 * 1000f); int num151 = (int)(projectile.velocity.X * 1000f); - projectile.rotation += (float)projectile.direction * 0.8f; + projectile.rotation += projectile.direction * 0.8f; int num152 = (int)(num148 * 1000f); int num153 = (int)(projectile.velocity.Y * 1000f); - projectile.rotation += (float)projectile.direction * 0.8f; + projectile.rotation += projectile.direction * 0.8f; if (num150 != num151 || num152 != num153) { - projectile.rotation += (float)projectile.direction * 0.8f; + projectile.rotation += projectile.direction * 0.8f; projectile.netUpdate = true; - projectile.rotation += (float)projectile.direction * 0.8f; + projectile.rotation += projectile.direction * 0.8f; } projectile.velocity.X = num147; - projectile.rotation += (float)projectile.direction * 0.8f; + projectile.rotation += projectile.direction * 0.8f; projectile.velocity.Y = num148; - projectile.rotation += (float)projectile.direction * 0.8f; + projectile.rotation += projectile.direction * 0.8f; } else { - projectile.rotation += (float)projectile.direction * 0.8f; + projectile.rotation += projectile.direction * 0.8f; int num154 = (int)(num147 * 1000f); int num155 = (int)(projectile.velocity.X * 1000f); - projectile.rotation += (float)projectile.direction * 0.8f; + projectile.rotation += projectile.direction * 0.8f; int num156 = (int)(num148 * 1000f); int num157 = (int)(projectile.velocity.Y * 1000f); - projectile.rotation += (float)projectile.direction * 0.8f; + projectile.rotation += projectile.direction * 0.8f; if (num154 != num155 || num156 != num157) { - projectile.rotation += (float)projectile.direction * 0.8f; + projectile.rotation += projectile.direction * 0.8f; projectile.netUpdate = true; - projectile.rotation += (float)projectile.direction * 0.8f; + projectile.rotation += projectile.direction * 0.8f; } projectile.velocity.X = num147; - projectile.rotation += (float)projectile.direction * 0.8f; + projectile.rotation += projectile.direction * 0.8f; projectile.velocity.Y = num148; - projectile.rotation += (float)projectile.direction * 0.8f; + projectile.rotation += projectile.direction * 0.8f; } - projectile.rotation += (float)projectile.direction * 0.8f; + projectile.rotation += projectile.direction * 0.8f; } else { - projectile.rotation += (float)projectile.direction * 0.8f; + projectile.rotation += projectile.direction * 0.8f; if (projectile.ai[0] == 0f) { projectile.ai[0] = 1f; - projectile.rotation += (float)projectile.direction * 0.8f; + projectile.rotation += projectile.direction * 0.8f; projectile.netUpdate = true; - projectile.rotation += (float)projectile.direction * 0.8f; + projectile.rotation += projectile.direction * 0.8f; float num158 = 12f; - Vector2 vector11 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num159 = (float)Main.mouseX + Main.screenPosition.X - vector11.X; - projectile.rotation += (float)projectile.direction * 0.8f; - float num160 = (float)Main.mouseY + Main.screenPosition.Y - vector11.Y; - projectile.rotation += (float)projectile.direction * 0.8f; + Vector2 vector11 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); + float num159 = Main.mouseX + Main.screenPosition.X - vector11.X; + projectile.rotation += projectile.direction * 0.8f; + float num160 = Main.mouseY + Main.screenPosition.Y - vector11.Y; + projectile.rotation += projectile.direction * 0.8f; if (Main.player[projectile.owner].gravDir == -1f) { - num160 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector11.Y; - projectile.rotation += (float)projectile.direction * 0.8f; + num160 = Main.screenPosition.Y + Main.screenHeight - Main.mouseY - vector11.Y; + projectile.rotation += projectile.direction * 0.8f; } - float num161 = (float)Math.Sqrt((double)(num159 * num159 + num160 * num160)); + float num161 = (float)Math.Sqrt(num159 * num159 + num160 * num160); if (num161 == 0f) { - vector11 = new Vector2(Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2), Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2)); - projectile.rotation += (float)projectile.direction * 0.8f; - num159 = projectile.position.X + (float)projectile.width * 0.5f - vector11.X; - projectile.rotation += (float)projectile.direction * 0.8f; - num160 = projectile.position.Y + (float)projectile.height * 0.5f - vector11.Y; - projectile.rotation += (float)projectile.direction * 0.8f; - num161 = (float)Math.Sqrt((double)(num159 * num159 + num160 * num160)); + vector11 = new Vector2(Main.player[projectile.owner].position.X + Main.player[projectile.owner].width / 2, Main.player[projectile.owner].position.Y + Main.player[projectile.owner].height / 2); + projectile.rotation += projectile.direction * 0.8f; + num159 = projectile.position.X + projectile.width * 0.5f - vector11.X; + projectile.rotation += projectile.direction * 0.8f; + num160 = projectile.position.Y + projectile.height * 0.5f - vector11.Y; + projectile.rotation += projectile.direction * 0.8f; + num161 = (float)Math.Sqrt(num159 * num159 + num160 * num160); } num161 = num158 / num161; num159 *= num161; num160 *= num161; projectile.velocity.X = num159; - projectile.rotation += (float)projectile.direction * 0.8f; + projectile.rotation += projectile.direction * 0.8f; projectile.velocity.Y = num160; - projectile.rotation += (float)projectile.direction * 0.8f; + projectile.rotation += projectile.direction * 0.8f; if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) { projectile.Kill(); } } - projectile.rotation += (float)projectile.direction * 0.8f; + projectile.rotation += projectile.direction * 0.8f; } - projectile.rotation += (float)projectile.direction * 0.8f; + projectile.rotation += projectile.direction * 0.8f; } - projectile.rotation += (float)projectile.direction * 0.8f; + projectile.rotation += projectile.direction * 0.8f; if (projectile.velocity.X != 0f || projectile.velocity.Y != 0f) { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) - 2.355f; - projectile.rotation += (float)projectile.direction * 0.8f; + projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) - 2.355f; + projectile.rotation += projectile.direction * 0.8f; } - projectile.rotation += (float)projectile.direction * 0.8f; + projectile.rotation += projectile.direction * 0.8f; if (projectile.velocity.Y > 16f) { projectile.velocity.Y = 16f; - projectile.rotation += (float)projectile.direction * 0.8f; + projectile.rotation += projectile.direction * 0.8f; } if (projectile.timeLeft % 60 == 0) Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 23); diff --git a/Projectiles/CyberRingPro.cs b/Projectiles/CyberRingPro.cs index 907029d2..02c68da3 100644 --- a/Projectiles/CyberRingPro.cs +++ b/Projectiles/CyberRingPro.cs @@ -1,3 +1,4 @@ +using System; using Terraria; using Terraria.ModLoader; @@ -32,7 +33,7 @@ public override void AI() projectile.ai[1] = 1f; Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 67); } - projectile.rotation = (float)System.Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + 1.57f; if (Main.rand.Next(1) == 0) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 60, projectile.velocity.X * 0.9f, projectile.velocity.Y * 0.9f); diff --git a/Projectiles/CyclonePro.cs b/Projectiles/CyclonePro.cs index 39beeb02..27dd518f 100644 --- a/Projectiles/CyclonePro.cs +++ b/Projectiles/CyclonePro.cs @@ -34,9 +34,9 @@ public override void AI() int num816 = 6; for (int num817 = 0; num817 < num816; num817++) { - Vector2 vector65 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width, (float)projectile.height) / 2f; - vector65 = vector65.RotatedBy((double)(num817 - (num816 / 2 - 1)) * 3.1415926535897931 / (double)((float)num816), default(Vector2)) + projectile.Center; - Vector2 value24 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); + Vector2 vector65 = Vector2.Normalize(projectile.velocity) * new Vector2(projectile.width, projectile.height) / 2f; + vector65 = vector65.RotatedBy((num817 - (num816 / 2 - 1)) * 3.1415926535897931 / num816, default(Vector2)) + projectile.Center; + Vector2 value24 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * Main.rand.Next(3, 8); int num818 = Dust.NewDust(vector65 + value24, 0, 0, 61, value24.X * 2f, value24.Y * 2f, 100, default(Color), 1.4f); Main.dust[num818].noGravity = true; Main.dust[num818].noLight = true; @@ -64,7 +64,7 @@ public override void AI() for (int num821 = 0; num821 < 200; num821++) { NPC nPC8 = Main.npc[num821]; - if (nPC8.active && !nPC8.dontTakeDamage && !nPC8.friendly && nPC8.lifeMax > 5 && (projectile.ai[0] == 0f || projectile.ai[0] == (float)(num821 + 1))) + if (nPC8.active && !nPC8.dontTakeDamage && !nPC8.friendly && nPC8.lifeMax > 5 && (projectile.ai[0] == 0f || projectile.ai[0] == num821 + 1)) { Vector2 vector67 = nPC8.Center; float num822 = Vector2.Distance(vector67, vector66); @@ -78,7 +78,7 @@ public override void AI() } if (num819 >= 0) { - projectile.ai[0] = (float)(num819 + 1); + projectile.ai[0] = num819 + 1; projectile.netUpdate = true; } } @@ -92,9 +92,9 @@ public override void AI() int num823 = (int)(projectile.ai[0] - 1f); if (Main.npc[num823].active && !Main.npc[num823].dontTakeDamage && Main.npc[num823].immune[projectile.owner] == 0) { - float num824 = Main.npc[num823].position.X + (float)(Main.npc[num823].width / 2); - float num825 = Main.npc[num823].position.Y + (float)(Main.npc[num823].height / 2); - float num826 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num824) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num825); + float num824 = Main.npc[num823].position.X + Main.npc[num823].width / 2; + float num825 = Main.npc[num823].position.Y + Main.npc[num823].height / 2; + float num826 = Math.Abs(projectile.position.X + projectile.width / 2 - num824) + Math.Abs(projectile.position.Y + projectile.height / 2 - num825); if (num826 < 1000f) { flag33 = true; @@ -113,7 +113,7 @@ public override void AI() Vector2 v = vector66 - projectile.Center; float num827 = projectile.velocity.ToRotation(); float num828 = v.ToRotation(); - double num829 = (double)(num828 - num827); + double num829 = num828 - num827; if (num829 > 3.1415926535897931) { num829 -= 6.2831853071795862; diff --git a/Projectiles/DangerBladePro.cs b/Projectiles/DangerBladePro.cs index c8daf6fd..cbbd4028 100644 --- a/Projectiles/DangerBladePro.cs +++ b/Projectiles/DangerBladePro.cs @@ -41,13 +41,13 @@ public override void Kill(int timeLeft) int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); if (Main.rand.Next(3) == 0) { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].type++; } else { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 1.2f + Main.rand.Next(-10, 11) * 0.01f; } Main.dust[num159].noGravity = true; Main.dust[num159].velocity *= 2.5f; @@ -58,14 +58,14 @@ public override void Kill(int timeLeft) int num160 = Main.rand.Next(0, 0); for (int num161 = 0; num161 < num160; num161++) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); while (value12.X == 0f && value12.Y == 0f) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); } value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); + value12 *= Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + projectile.width / 2, projectile.oldPosition.Y + projectile.height / 2, value12.X, value12.Y, 400, (int)(projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/DarkBubblePro.cs b/Projectiles/DarkBubblePro.cs index 9a764e31..e67fef5a 100644 --- a/Projectiles/DarkBubblePro.cs +++ b/Projectiles/DarkBubblePro.cs @@ -49,13 +49,13 @@ public override void Kill(int timeLeft) int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 54, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.3f); if (Main.rand.Next(3) == 0) { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].type++; } else { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 1.2f + Main.rand.Next(-10, 11) * 0.01f; } Main.dust[num159].noGravity = true; Main.dust[num159].velocity *= 2.5f; @@ -66,14 +66,14 @@ public override void Kill(int timeLeft) int num160 = Main.rand.Next(0, 0); for (int num161 = 0; num161 < num160; num161++) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); while (value12.X == 0f && value12.Y == 0f) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); } value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 2.8f, projectile.owner, 0f, 0f); + value12 *= Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + projectile.width / 2, projectile.oldPosition.Y + projectile.height / 2, value12.X, value12.Y, 400, (int)(projectile.damage * 0.8), projectile.knockBack * 2.8f, projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/DeadFlowerPro.cs b/Projectiles/DeadFlowerPro.cs index d23f76ed..e68600c9 100644 --- a/Projectiles/DeadFlowerPro.cs +++ b/Projectiles/DeadFlowerPro.cs @@ -49,7 +49,6 @@ public override void AI() if (projectile.wet && !projectile.lavaWet) { projectile.Kill(); - return; } } } @@ -62,13 +61,13 @@ public override void Kill(int timeLeft) int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 27, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); if (Main.rand.Next(3) == 0) { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].type++; } else { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 1.2f + Main.rand.Next(-10, 11) * 0.01f; } Main.dust[num159].noGravity = true; Main.dust[num159].velocity *= 2.5f; @@ -79,14 +78,14 @@ public override void Kill(int timeLeft) int num160 = Main.rand.Next(0, 0); for (int num161 = 0; num161 < num160; num161++) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); while (value12.X == 0f && value12.Y == 0f) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); } value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); + value12 *= Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + projectile.width / 2, projectile.oldPosition.Y + projectile.height / 2, value12.X, value12.Y, 400, (int)(projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/DeathHooksPro.cs b/Projectiles/DeathHooksPro.cs index 628f6d29..d078958a 100644 --- a/Projectiles/DeathHooksPro.cs +++ b/Projectiles/DeathHooksPro.cs @@ -24,17 +24,17 @@ public override void SetStaticDefaults() } - public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Color lightColor) + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Texture2D texture = ModLoader.GetTexture("Tremor/Projectiles/DeathHooks_Chain"); Vector2 position = projectile.Center; Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; - Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(); - Vector2 origin = new Vector2((float)texture.Width * 0.5f, (float)texture.Height * 0.5f); - float num1 = (float)texture.Height; + Rectangle? sourceRectangle = new Rectangle?(); + Vector2 origin = new Vector2(texture.Width * 0.5f, texture.Height * 0.5f); + float num1 = texture.Height; Vector2 vector2_4 = mountedCenter - position; - float rotation = (float)Math.Atan2((double)vector2_4.Y, (double)vector2_4.X) - 1.57f; + float rotation = (float)Math.Atan2(vector2_4.Y, vector2_4.X) - 1.57f; bool flag = true; if (float.IsNaN(position.X) && float.IsNaN(position.Y)) flag = false; @@ -42,7 +42,7 @@ public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch sprite flag = false; while (flag) { - if ((double)vector2_4.Length() < (double)num1 + 1.0) + if (vector2_4.Length() < num1 + 1.0) { flag = false; } @@ -52,7 +52,7 @@ public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch sprite vector2_1.Normalize(); position += vector2_1 * num1; vector2_4 = mountedCenter - position; - Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)position.X / 16, (int)((double)position.Y / 16.0)); + Color color2 = Lighting.GetColor((int)position.X / 16, (int)(position.Y / 16.0)); color2 = projectile.GetAlpha(color2); Main.spriteBatch.Draw(texture, position - Main.screenPosition, sourceRectangle, color2, rotation, origin, 1f, SpriteEffects.None, 0.0f); } diff --git a/Projectiles/DesertClaymorePro.cs b/Projectiles/DesertClaymorePro.cs index baeb63e6..af84571b 100644 --- a/Projectiles/DesertClaymorePro.cs +++ b/Projectiles/DesertClaymorePro.cs @@ -9,10 +9,10 @@ public class DesertClaymorePro : ModProjectile const int SpeedMulti = 2; const int XOffset = 24; // На сколько блоков от игрока будет появлятся меч. (16ед. == 1 блок.) - int YOffset = 0; + int YOffset; int YOffsetStep = -1; bool UP = true; - float YPos = 0; + float YPos; public override void SetDefaults() { diff --git a/Projectiles/DesertSigil.cs b/Projectiles/DesertSigil.cs index 287567c8..f8c18c9f 100644 --- a/Projectiles/DesertSigil.cs +++ b/Projectiles/DesertSigil.cs @@ -89,7 +89,6 @@ public override void AI() if (projectile.wet && !projectile.lavaWet) { projectile.Kill(); - return; } } } diff --git a/Projectiles/DiamondBeamPro.cs b/Projectiles/DiamondBeamPro.cs index 2e582d60..002f115f 100644 --- a/Projectiles/DiamondBeamPro.cs +++ b/Projectiles/DiamondBeamPro.cs @@ -2,8 +2,8 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; -using Terraria.ModLoader; using Terraria.Enums; +using Terraria.ModLoader; namespace Tremor.Projectiles { @@ -225,7 +225,7 @@ public override void AI() //Add lights DelegateMethods.v3_1 = new Vector3(0.8f, 0.8f, 1f); - Utils.PlotTileLine(projectile.Center, projectile.Center + projectile.velocity * (Distance - MOVE_DISTANCE), 26, new Utils.PerLinePoint(DelegateMethods.CastLight)); + Utils.PlotTileLine(projectile.Center, projectile.Center + projectile.velocity * (Distance - MOVE_DISTANCE), 26, DelegateMethods.CastLight); } public override bool ShouldUpdatePosition() @@ -237,7 +237,7 @@ public override void CutTiles() { DelegateMethods.tilecut_0 = TileCuttingContext.AttackProjectile; Vector2 unit = projectile.velocity; - Utils.PlotTileLine(projectile.Center, projectile.Center + unit * Distance, (projectile.width + 16) * projectile.scale, new Utils.PerLinePoint(DelegateMethods.CutTiles)); + Utils.PlotTileLine(projectile.Center, projectile.Center + unit * Distance, (projectile.width + 16) * projectile.scale, DelegateMethods.CutTiles); } } } diff --git a/Projectiles/DissolverPro.cs b/Projectiles/DissolverPro.cs index 05599884..94204a37 100644 --- a/Projectiles/DissolverPro.cs +++ b/Projectiles/DissolverPro.cs @@ -1,3 +1,4 @@ +using System; using Terraria; using Terraria.ModLoader; @@ -30,7 +31,7 @@ public override void OnHitNPC(NPC target, int damage, float knockback, bool crit public override void AI() { - projectile.rotation = (float)System.Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + 1.57f; if (Main.rand.Next(1) == 0) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 57, projectile.velocity.X * 0.9f, projectile.velocity.Y * 0.9f); diff --git a/Projectiles/DivineClaymorePro.cs b/Projectiles/DivineClaymorePro.cs index f8082981..f5ee2535 100644 --- a/Projectiles/DivineClaymorePro.cs +++ b/Projectiles/DivineClaymorePro.cs @@ -44,13 +44,13 @@ public override void Kill(int timeLeft) int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 226, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 1.5f); if (Main.rand.Next(3) == 0) { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].type++; } else { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 1.2f + Main.rand.Next(-10, 11) * 0.01f; } Main.dust[num159].noGravity = true; Main.dust[num159].velocity *= 2.5f; @@ -61,14 +61,14 @@ public override void Kill(int timeLeft) int num160 = Main.rand.Next(0, 0); for (int num161 = 0; num161 < num160; num161++) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); while (value12.X == 0f && value12.Y == 0f) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); } value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 2.8f, projectile.owner, 0f, 0f); + value12 *= Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + projectile.width / 2, projectile.oldPosition.Y + projectile.height / 2, value12.X, value12.Y, 400, (int)(projectile.damage * 0.8), projectile.knockBack * 2.8f, projectile.owner, 0f, 0f); } } } @@ -119,7 +119,7 @@ public override void AI() { Vector2 vector64 = vector63 * -1f; vector64.Normalize(); - vector64 *= (float)Main.rand.Next(5, 25) * 0.9f; + vector64 *= Main.rand.Next(5, 25) * 0.9f; Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vector64.X, vector64.Y, mod.ProjectileType("DivineRingPro"), projectile.damage / 4, projectile.knockBack, projectile.owner, -10f, 0f); } @@ -133,7 +133,7 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) for (int k = 0; k < projectile.oldPos.Length; k++) { Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); - Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); + Color color = projectile.GetAlpha(lightColor) * ((projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); } return true; diff --git a/Projectiles/DivineRingPro.cs b/Projectiles/DivineRingPro.cs index d4ee3760..99a50aa0 100644 --- a/Projectiles/DivineRingPro.cs +++ b/Projectiles/DivineRingPro.cs @@ -41,7 +41,7 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) for (int k = 0; k < projectile.oldPos.Length; k++) { Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); - Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); + Color color = projectile.GetAlpha(lightColor) * ((projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); } return true; @@ -54,13 +54,13 @@ public override void Kill(int timeLeft) int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 226, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.3f); if (Main.rand.Next(3) == 0) { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].type++; } else { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 1.2f + Main.rand.Next(-10, 11) * 0.01f; } Main.dust[num159].noGravity = true; Main.dust[num159].velocity *= 2.5f; @@ -71,14 +71,14 @@ public override void Kill(int timeLeft) int num160 = Main.rand.Next(0, 0); for (int num161 = 0; num161 < num160; num161++) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); while (value12.X == 0f && value12.Y == 0f) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); } value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 2.8f, projectile.owner, 0f, 0f); + value12 *= Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + projectile.width / 2, projectile.oldPosition.Y + projectile.height / 2, value12.X, value12.Y, 400, (int)(projectile.damage * 0.8), projectile.knockBack * 2.8f, projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/DragonHead.cs b/Projectiles/DragonHead.cs index 9585c001..d2651934 100644 --- a/Projectiles/DragonHead.cs +++ b/Projectiles/DragonHead.cs @@ -1,8 +1,6 @@ using System; - using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; - using Terraria; using Terraria.ModLoader; @@ -29,17 +27,17 @@ public override void SetStaticDefaults() } - public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Color lightColor) + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Texture2D texture = ModLoader.GetTexture("Tremor/Projectiles/DragonHead_Chain"); Vector2 position = projectile.Center; Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; - Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(); - Vector2 origin = new Vector2((float)texture.Width * 0.5f, (float)texture.Height * 0.5f); - float num1 = (float)texture.Height; + Rectangle? sourceRectangle = new Rectangle?(); + Vector2 origin = new Vector2(texture.Width * 0.5f, texture.Height * 0.5f); + float num1 = texture.Height; Vector2 vector2_4 = mountedCenter - position; - float rotation = (float)Math.Atan2((double)vector2_4.Y, (double)vector2_4.X) - 1.57f; + float rotation = (float)Math.Atan2(vector2_4.Y, vector2_4.X) - 1.57f; bool flag = true; if (float.IsNaN(position.X) && float.IsNaN(position.Y)) flag = false; @@ -47,7 +45,7 @@ public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch sprite flag = false; while (flag) { - if ((double)vector2_4.Length() < (double)num1 + 1.0) + if (vector2_4.Length() < num1 + 1.0) { flag = false; } @@ -57,7 +55,7 @@ public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch sprite vector2_1.Normalize(); position += vector2_1 * num1; vector2_4 = mountedCenter - position; - Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)position.X / 16, (int)((double)position.Y / 16.0)); + Color color2 = Lighting.GetColor((int)position.X / 16, (int)(position.Y / 16.0)); color2 = projectile.GetAlpha(color2); Main.spriteBatch.Draw(texture, position - Main.screenPosition, sourceRectangle, color2, rotation, origin, 1f, SpriteEffects.None, 0.0f); } diff --git a/Projectiles/Dukado.cs b/Projectiles/Dukado.cs index bd9df007..d9821deb 100644 --- a/Projectiles/Dukado.cs +++ b/Projectiles/Dukado.cs @@ -61,20 +61,20 @@ public override void AI() if (projectile.localAI[0] == 0f) { projectile.localAI[0] = 1f; - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); - projectile.scale = ((float)(num613 + num614) - projectile.ai[1]) * num615 / (float)(num614 + num613); - projectile.width = (int)((float)num616 * projectile.scale); - projectile.height = (int)((float)num617 * projectile.scale); - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.position.X = projectile.position.X + projectile.width / 2; + projectile.position.Y = projectile.position.Y + projectile.height / 2; + projectile.scale = (num613 + num614 - projectile.ai[1]) * num615 / (num614 + num613); + projectile.width = (int)(num616 * projectile.scale); + projectile.height = (int)(num617 * projectile.scale); + projectile.position.X = projectile.position.X - projectile.width / 2; + projectile.position.Y = projectile.position.Y - projectile.height / 2; projectile.netUpdate = true; } if (projectile.ai[1] != -1f) { - projectile.scale = ((float)(num613 + num614) - projectile.ai[1]) * num615 / (float)(num614 + num613); - projectile.width = (int)((float)num616 * projectile.scale); - projectile.height = (int)((float)num617 * projectile.scale); + projectile.scale = (num613 + num614 - projectile.ai[1]) * num615 / (num614 + num613); + projectile.width = (int)(num616 * projectile.scale); + projectile.height = (int)(num617 * projectile.scale); } if (!Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) { @@ -100,22 +100,21 @@ public override void AI() { projectile.netUpdate = true; Vector2 center = projectile.Center; - center.Y -= (float)num617 * projectile.scale / 2f; - float num618 = ((float)(num613 + num614) - projectile.ai[1] + 1f) * num615 / (float)(num614 + num613); - center.Y -= (float)num617 * num618 / 2f; + center.Y -= num617 * projectile.scale / 2f; + float num618 = (num613 + num614 - projectile.ai[1] + 1f) * num615 / (num614 + num613); + center.Y -= num617 * num618 / 2f; center.Y += 2f; Projectile.NewProjectile(center.X, center.Y, projectile.velocity.X, projectile.velocity.Y, projectile.type, projectile.damage, projectile.knockBack, projectile.owner, 10f, projectile.ai[1] - 1f); } if (projectile.ai[0] <= 0f) { float num622 = 0.104719758f; - float num623 = (float)projectile.width / 5f; - float num624 = (float)(Math.Cos((double)(num622 * -(double)projectile.ai[0])) - 0.5) * num623; - projectile.position.X = projectile.position.X - num624 * (float)(-(float)projectile.direction); + float num623 = projectile.width / 5f; + float num624 = (float)(Math.Cos(num622 * -(double)projectile.ai[0]) - 0.5) * num623; + projectile.position.X = projectile.position.X - num624 * -(float)projectile.direction; projectile.ai[0] -= 1f; - num624 = (float)(Math.Cos((double)(num622 * -(double)projectile.ai[0])) - 0.5) * num623; - projectile.position.X = projectile.position.X + num624 * (float)(-(float)projectile.direction); - return; + num624 = (float)(Math.Cos(num622 * -(double)projectile.ai[0]) - 0.5) * num623; + projectile.position.X = projectile.position.X + num624 * -(float)projectile.direction; } } } diff --git a/Projectiles/EaterofDreamsPro.cs b/Projectiles/EaterofDreamsPro.cs index 356b34e0..2bbf92db 100644 --- a/Projectiles/EaterofDreamsPro.cs +++ b/Projectiles/EaterofDreamsPro.cs @@ -87,8 +87,7 @@ public override void AI() { projectile.ai[0] += 1f; } - projectile.rotation += 0.3f * (float)projectile.direction; - return; + projectile.rotation += 0.3f * projectile.direction; } public override bool OnTileCollide(Vector2 oldVelocity) { diff --git a/Projectiles/EruptPro.cs b/Projectiles/EruptPro.cs index 1c0d77e1..e63e6202 100644 --- a/Projectiles/EruptPro.cs +++ b/Projectiles/EruptPro.cs @@ -44,10 +44,10 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(3, 5); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, 297, projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, 297, projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } @@ -80,7 +80,6 @@ public override void AI() if (projectile.wet && !projectile.lavaWet) { projectile.Kill(); - return; } } } diff --git a/Projectiles/EternalAgonyPro.cs b/Projectiles/EternalAgonyPro.cs index 23f82187..6801ce2c 100644 --- a/Projectiles/EternalAgonyPro.cs +++ b/Projectiles/EternalAgonyPro.cs @@ -1,8 +1,6 @@ using System; - using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; - using Terraria; using Terraria.ModLoader; @@ -45,17 +43,17 @@ public override void OnHitPvp(Player target, int damage, bool crit) } } - public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Color lightColor) + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Texture2D texture = ModLoader.GetTexture("Tremor/Projectiles/EternalAgony_Chain"); Vector2 position = projectile.Center; Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; - Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(); - Vector2 origin = new Vector2((float)texture.Width * 0.5f, (float)texture.Height * 0.5f); - float num1 = (float)texture.Height; + Rectangle? sourceRectangle = new Rectangle?(); + Vector2 origin = new Vector2(texture.Width * 0.5f, texture.Height * 0.5f); + float num1 = texture.Height; Vector2 vector2_4 = mountedCenter - position; - float rotation = (float)Math.Atan2((double)vector2_4.Y, (double)vector2_4.X) - 1.57f; + float rotation = (float)Math.Atan2(vector2_4.Y, vector2_4.X) - 1.57f; bool flag = true; if (float.IsNaN(position.X) && float.IsNaN(position.Y)) flag = false; @@ -63,7 +61,7 @@ public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch sprite flag = false; while (flag) { - if ((double)vector2_4.Length() < (double)num1 + 1.0) + if (vector2_4.Length() < num1 + 1.0) { flag = false; } @@ -73,7 +71,7 @@ public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch sprite vector2_1.Normalize(); position += vector2_1 * num1; vector2_4 = mountedCenter - position; - Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)position.X / 16, (int)((double)position.Y / 16.0)); + Color color2 = Lighting.GetColor((int)position.X / 16, (int)(position.Y / 16.0)); color2 = projectile.GetAlpha(color2); Main.spriteBatch.Draw(texture, position - Main.screenPosition, sourceRectangle, color2, rotation, origin, 1f, SpriteEffects.None, 0.0f); } diff --git a/Projectiles/ExampleLaser.cs b/Projectiles/ExampleLaser.cs index 1214d2b4..5173fdbf 100644 --- a/Projectiles/ExampleLaser.cs +++ b/Projectiles/ExampleLaser.cs @@ -2,8 +2,8 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; -using Terraria.ModLoader; using Terraria.Enums; +using Terraria.ModLoader; namespace Tremor.Projectiles { @@ -225,7 +225,7 @@ public override void AI() //Add lights DelegateMethods.v3_1 = new Vector3(0.8f, 0.8f, 1f); - Utils.PlotTileLine(projectile.Center, projectile.Center + projectile.velocity * (Distance - MOVE_DISTANCE), 26, new Utils.PerLinePoint(DelegateMethods.CastLight)); + Utils.PlotTileLine(projectile.Center, projectile.Center + projectile.velocity * (Distance - MOVE_DISTANCE), 26, DelegateMethods.CastLight); } public override bool ShouldUpdatePosition() @@ -237,7 +237,7 @@ public override void CutTiles() { DelegateMethods.tilecut_0 = TileCuttingContext.AttackProjectile; Vector2 unit = projectile.velocity; - Utils.PlotTileLine(projectile.Center, projectile.Center + unit * Distance, (projectile.width + 16) * projectile.scale, new Utils.PerLinePoint(DelegateMethods.CutTiles)); + Utils.PlotTileLine(projectile.Center, projectile.Center + unit * Distance, (projectile.width + 16) * projectile.scale, DelegateMethods.CutTiles); } } } diff --git a/Projectiles/FlamesofDespairPro.cs b/Projectiles/FlamesofDespairPro.cs index 77d59bd0..d9b2c0e5 100644 --- a/Projectiles/FlamesofDespairPro.cs +++ b/Projectiles/FlamesofDespairPro.cs @@ -44,7 +44,7 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) for (int k = 0; k < projectile.oldPos.Length; k++) { Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); - Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); + Color color = projectile.GetAlpha(lightColor) * ((projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); } return true; @@ -53,12 +53,12 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) public override void Kill(int timeLeft) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.position.X = projectile.position.X + projectile.width / 2; + projectile.position.Y = projectile.position.Y + projectile.height / 2; projectile.width = 80; projectile.height = 80; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.position.X = projectile.position.X - projectile.width / 2; + projectile.position.Y = projectile.position.Y - projectile.height / 2; for (int num628 = 0; num628 < 40; num628++) { int num629 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); @@ -66,7 +66,7 @@ public override void Kill(int timeLeft) if (Main.rand.Next(2) == 0) { Main.dust[num629].scale = 0.5f; - Main.dust[num629].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num629].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } for (int num630 = 0; num630 < 70; num630++) @@ -88,37 +88,37 @@ public override void Kill(int timeLeft) { scaleFactor10 = 1f; } - int num633 = 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), 1.5f); + int num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1.5f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13E6D_cp_0 = Main.gore[num633]; expr_13E6D_cp_0.velocity.X = expr_13E6D_cp_0.velocity.X + 1f; Gore expr_13E8D_cp_0 = Main.gore[num633]; expr_13E8D_cp_0.velocity.Y = expr_13E8D_cp_0.velocity.Y + 1f; - num633 = 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); + num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 0.5f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13F30_cp_0 = Main.gore[num633]; expr_13F30_cp_0.velocity.X = expr_13F30_cp_0.velocity.X - 1f; Gore expr_13F50_cp_0 = Main.gore[num633]; expr_13F50_cp_0.velocity.Y = expr_13F50_cp_0.velocity.Y + 1f; - num633 = 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), 1.5f); + num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1.5f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13FF3_cp_0 = Main.gore[num633]; expr_13FF3_cp_0.velocity.X = expr_13FF3_cp_0.velocity.X + 1f; Gore expr_14013_cp_0 = Main.gore[num633]; expr_14013_cp_0.velocity.Y = expr_14013_cp_0.velocity.Y - 1f; - num633 = 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); + num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 0.5f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_140B6_cp_0 = Main.gore[num633]; expr_140B6_cp_0.velocity.X = expr_140B6_cp_0.velocity.X - 1f; Gore expr_140D6_cp_0 = Main.gore[num633]; expr_140D6_cp_0.velocity.Y = expr_140D6_cp_0.velocity.Y - 1f; } - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.position.X = projectile.position.X + projectile.width / 2; + projectile.position.Y = projectile.position.Y + projectile.height / 2; projectile.width = 10; projectile.height = 10; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.position.X = projectile.position.X - projectile.width / 2; + projectile.position.Y = projectile.position.Y - projectile.height / 2; } } } diff --git a/Projectiles/FlowerofAntimony.cs b/Projectiles/FlowerofAntimony.cs index 9160883f..eb7fe2ad 100644 --- a/Projectiles/FlowerofAntimony.cs +++ b/Projectiles/FlowerofAntimony.cs @@ -43,7 +43,6 @@ public override void AI() Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; } - return; } public override bool OnTileCollide(Vector2 oldVelocity) diff --git a/Projectiles/FrostbittenBallPro.cs b/Projectiles/FrostbittenBallPro.cs index 55635037..a44a5d49 100644 --- a/Projectiles/FrostbittenBallPro.cs +++ b/Projectiles/FrostbittenBallPro.cs @@ -1,8 +1,6 @@ using System; - using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; - using Terraria; using Terraria.ModLoader; @@ -51,17 +49,17 @@ public override void OnHitPvp(Player target, int damage, bool crit) } } - public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Color lightColor) + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Texture2D texture = ModLoader.GetTexture("Tremor/Projectiles/FrostbittenBall_Chain"); Vector2 position = projectile.Center; Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; - Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(); - Vector2 origin = new Vector2((float)texture.Width * 0.5f, (float)texture.Height * 0.5f); - float num1 = (float)texture.Height; + Rectangle? sourceRectangle = new Rectangle?(); + Vector2 origin = new Vector2(texture.Width * 0.5f, texture.Height * 0.5f); + float num1 = texture.Height; Vector2 vector2_4 = mountedCenter - position; - float rotation = (float)Math.Atan2((double)vector2_4.Y, (double)vector2_4.X) - 1.57f; + float rotation = (float)Math.Atan2(vector2_4.Y, vector2_4.X) - 1.57f; bool flag = true; if (float.IsNaN(position.X) && float.IsNaN(position.Y)) flag = false; @@ -69,7 +67,7 @@ public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch sprite flag = false; while (flag) { - if ((double)vector2_4.Length() < (double)num1 + 1.0) + if (vector2_4.Length() < num1 + 1.0) { flag = false; } @@ -79,7 +77,7 @@ public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch sprite vector2_1.Normalize(); position += vector2_1 * num1; vector2_4 = mountedCenter - position; - Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)position.X / 16, (int)((double)position.Y / 16.0)); + Color color2 = Lighting.GetColor((int)position.X / 16, (int)(position.Y / 16.0)); color2 = projectile.GetAlpha(color2); Main.spriteBatch.Draw(texture, position - Main.screenPosition, sourceRectangle, color2, rotation, origin, 1f, SpriteEffects.None, 0.0f); } diff --git a/Projectiles/FrostwindPro.cs b/Projectiles/FrostwindPro.cs index aa4c57c6..6121586a 100644 --- a/Projectiles/FrostwindPro.cs +++ b/Projectiles/FrostwindPro.cs @@ -54,20 +54,20 @@ public override void AI() if (projectile.localAI[0] == 0f) { projectile.localAI[0] = 1f; - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); - projectile.scale = ((float)(num613 + num614) - projectile.ai[1]) * num615 / (float)(num614 + num613); - projectile.width = (int)((float)num616 * projectile.scale); - projectile.height = (int)((float)num617 * projectile.scale); - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.position.X = projectile.position.X + projectile.width / 2; + projectile.position.Y = projectile.position.Y + projectile.height / 2; + projectile.scale = (num613 + num614 - projectile.ai[1]) * num615 / (num614 + num613); + projectile.width = (int)(num616 * projectile.scale); + projectile.height = (int)(num617 * projectile.scale); + projectile.position.X = projectile.position.X - projectile.width / 2; + projectile.position.Y = projectile.position.Y - projectile.height / 2; projectile.netUpdate = true; } if (projectile.ai[1] != -1f) { - projectile.scale = ((float)(num613 + num614) - projectile.ai[1]) * num615 / (float)(num614 + num613); - projectile.width = (int)((float)num616 * projectile.scale); - projectile.height = (int)((float)num617 * projectile.scale); + projectile.scale = (num613 + num614 - projectile.ai[1]) * num615 / (num614 + num613); + projectile.width = (int)(num616 * projectile.scale); + projectile.height = (int)(num617 * projectile.scale); } if (!Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) { @@ -93,22 +93,21 @@ public override void AI() { projectile.netUpdate = true; Vector2 center = projectile.Center; - center.Y -= (float)num617 * projectile.scale / 2f; - float num618 = ((float)(num613 + num614) - projectile.ai[1] + 1f) * num615 / (float)(num614 + num613); - center.Y -= (float)num617 * num618 / 2f; + center.Y -= num617 * projectile.scale / 2f; + float num618 = (num613 + num614 - projectile.ai[1] + 1f) * num615 / (num614 + num613); + center.Y -= num617 * num618 / 2f; center.Y += 2f; Projectile.NewProjectile(center.X, center.Y, projectile.velocity.X, projectile.velocity.Y, projectile.type, projectile.damage, projectile.knockBack, projectile.owner, 10f, projectile.ai[1] - 1f); } if (projectile.ai[0] <= 0f) { float num622 = 0.104719758f; - float num623 = (float)projectile.width / 5f; - float num624 = (float)(Math.Cos((double)(num622 * -(double)projectile.ai[0])) - 0.5) * num623; - projectile.position.X = projectile.position.X - num624 * (float)(-(float)projectile.direction); + float num623 = projectile.width / 5f; + float num624 = (float)(Math.Cos(num622 * -(double)projectile.ai[0]) - 0.5) * num623; + projectile.position.X = projectile.position.X - num624 * -(float)projectile.direction; projectile.ai[0] -= 1f; - num624 = (float)(Math.Cos((double)(num622 * -(double)projectile.ai[0])) - 0.5) * num623; - projectile.position.X = projectile.position.X + num624 * (float)(-(float)projectile.direction); - return; + num624 = (float)(Math.Cos(num622 * -(double)projectile.ai[0]) - 0.5) * num623; + projectile.position.X = projectile.position.X + num624 * -(float)projectile.direction; } } diff --git a/Projectiles/FungusBlueSword.cs b/Projectiles/FungusBlueSword.cs index fbd4a771..dbed87df 100644 --- a/Projectiles/FungusBlueSword.cs +++ b/Projectiles/FungusBlueSword.cs @@ -1,6 +1,6 @@ -using Terraria.ModLoader; -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ModLoader; namespace Tremor.Projectiles { @@ -9,7 +9,7 @@ public class FungusBlueSword : ModProjectile const float RotationSpeed = 0.05f; const float Distanse = 100; - float Rotation = 0; + float Rotation; public override void SetDefaults() { diff --git a/Projectiles/FungusYellowSword.cs b/Projectiles/FungusYellowSword.cs index 20e243d1..52a9c00d 100644 --- a/Projectiles/FungusYellowSword.cs +++ b/Projectiles/FungusYellowSword.cs @@ -1,6 +1,6 @@ -using Terraria.ModLoader; -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ModLoader; namespace Tremor.Projectiles { @@ -9,7 +9,7 @@ public class FungusYellowSword : ModProjectile const float RotationSpeed = 0.08f; const float Distanse = 100; - float Rotation = 0; + float Rotation; public override Color? GetAlpha(Color lightColor) { diff --git a/Projectiles/GalaxonPro.cs b/Projectiles/GalaxonPro.cs index d29aaa95..d79c7ea3 100644 --- a/Projectiles/GalaxonPro.cs +++ b/Projectiles/GalaxonPro.cs @@ -66,7 +66,7 @@ public override void AI() projectile.frameCounter = 0; projectile.frame++; } - if (projectile.ai[0] >= (float)(Main.projFrames[projectile.type] * projectile.MaxUpdates * 3)) + if (projectile.ai[0] >= Main.projFrames[projectile.type] * projectile.MaxUpdates * 3) { projectile.Kill(); } @@ -95,7 +95,6 @@ public override void AI() projectile.ai[0] = 0f; projectile.ai[1] = -1f; projectile.netUpdate = true; - return; } } } diff --git a/Projectiles/GhostlyExplosion.cs b/Projectiles/GhostlyExplosion.cs index 3235719b..32b8cd8e 100644 --- a/Projectiles/GhostlyExplosion.cs +++ b/Projectiles/GhostlyExplosion.cs @@ -74,12 +74,12 @@ public override void AI() num461 *= 0.7f; projectile.ai[0] += 4f; int num462 = 0; - while ((float)num462 < num461) + while (num462 < num461) { - float num463 = (float)Main.rand.Next(-10, 11); - float num464 = (float)Main.rand.Next(-10, 11); - float num465 = (float)Main.rand.Next(3, 9); - float num466 = (float)Math.Sqrt((double)(num463 * num463 + num464 * num464)); + float num463 = Main.rand.Next(-10, 11); + float num464 = Main.rand.Next(-10, 11); + float num465 = Main.rand.Next(3, 9); + float num466 = (float)Math.Sqrt(num463 * num463 + num464 * num464); num466 = num465 / num466; num463 *= num466; num464 *= num466; @@ -88,14 +88,13 @@ public override void AI() Main.dust[num467].position.X = projectile.Center.X; Main.dust[num467].position.Y = projectile.Center.Y; Dust expr_149DF_cp_0 = Main.dust[num467]; - expr_149DF_cp_0.position.X = expr_149DF_cp_0.position.X + (float)Main.rand.Next(-10, 11); + expr_149DF_cp_0.position.X = expr_149DF_cp_0.position.X + Main.rand.Next(-10, 11); Dust expr_14A09_cp_0 = Main.dust[num467]; - expr_14A09_cp_0.position.Y = expr_14A09_cp_0.position.Y + (float)Main.rand.Next(-10, 11); + expr_14A09_cp_0.position.Y = expr_14A09_cp_0.position.Y + Main.rand.Next(-10, 11); Main.dust[num467].velocity.X = num463; Main.dust[num467].velocity.Y = num464; num462++; } - return; } } diff --git a/Projectiles/GoldFishPro.cs b/Projectiles/GoldFishPro.cs index 51f8be35..bf152a66 100644 --- a/Projectiles/GoldFishPro.cs +++ b/Projectiles/GoldFishPro.cs @@ -36,13 +36,13 @@ public override void Kill(int timeLeft) int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); if (Main.rand.Next(3) == 0) { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].type++; } else { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 1.2f + Main.rand.Next(-10, 11) * 0.01f; } Main.dust[num159].noGravity = true; Main.dust[num159].velocity *= 2.5f; @@ -53,14 +53,14 @@ public override void Kill(int timeLeft) int num160 = Main.rand.Next(0, 0); for (int num161 = 0; num161 < num160; num161++) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); while (value12.X == 0f && value12.Y == 0f) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); } value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); + value12 *= Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + projectile.width / 2, projectile.oldPosition.Y + projectile.height / 2, value12.X, value12.Y, 400, (int)(projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/GoldenMacePro.cs b/Projectiles/GoldenMacePro.cs index 559ba862..b01032d4 100644 --- a/Projectiles/GoldenMacePro.cs +++ b/Projectiles/GoldenMacePro.cs @@ -75,7 +75,7 @@ public override void AI() { projectile.ai[0] += 1f; } - projectile.rotation += 0.3f * (float)projectile.direction; + projectile.rotation += 0.3f * projectile.direction; } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/GuardianHammerPro.cs b/Projectiles/GuardianHammerPro.cs index bcc9d8ef..b52f7f56 100644 --- a/Projectiles/GuardianHammerPro.cs +++ b/Projectiles/GuardianHammerPro.cs @@ -1,3 +1,4 @@ +using System; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; @@ -40,7 +41,7 @@ public override bool CanHitPlayer(Player target) public override void AI() { - projectile.rotation = (float)System.Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + 1.57f; if (Main.rand.Next(1) == 0) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 62, projectile.velocity.X * 0.9f, projectile.velocity.Y * 0.9f); diff --git a/Projectiles/Gurumaster.cs b/Projectiles/Gurumaster.cs index 7af427ca..1ab08acd 100644 --- a/Projectiles/Gurumaster.cs +++ b/Projectiles/Gurumaster.cs @@ -50,12 +50,12 @@ public override void Kill(int timeLeft) Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.position.X = projectile.position.X + projectile.width / 2; + projectile.position.Y = projectile.position.Y + projectile.height / 2; projectile.width = 80; projectile.height = 80; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.position.X = projectile.position.X - projectile.width / 2; + projectile.position.Y = projectile.position.Y - projectile.height / 2; for (int num628 = 0; num628 < 40; num628++) { int num629 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); @@ -63,7 +63,7 @@ public override void Kill(int timeLeft) if (Main.rand.Next(2) == 0) { Main.dust[num629].scale = 0.5f; - Main.dust[num629].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num629].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } for (int num630 = 0; num630 < 70; num630++) @@ -85,47 +85,47 @@ public override void Kill(int timeLeft) { scaleFactor10 = 1f; } - int num633 = 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 num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13E6D_cp_0 = Main.gore[num633]; expr_13E6D_cp_0.velocity.X = expr_13E6D_cp_0.velocity.X + 1f; Gore expr_13E8D_cp_0 = Main.gore[num633]; expr_13E8D_cp_0.velocity.Y = expr_13E8D_cp_0.velocity.Y + 1f; - num633 = 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), 2f); + num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 2f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13F30_cp_0 = Main.gore[num633]; expr_13F30_cp_0.velocity.X = expr_13F30_cp_0.velocity.X - 1f; Gore expr_13F50_cp_0 = Main.gore[num633]; expr_13F50_cp_0.velocity.Y = expr_13F50_cp_0.velocity.Y + 1f; - num633 = 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); + num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13FF3_cp_0 = Main.gore[num633]; expr_13FF3_cp_0.velocity.X = expr_13FF3_cp_0.velocity.X + 1f; Gore expr_14013_cp_0 = Main.gore[num633]; expr_14013_cp_0.velocity.Y = expr_14013_cp_0.velocity.Y - 1f; - num633 = 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); + num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_140B6_cp_0 = Main.gore[num633]; expr_140B6_cp_0.velocity.X = expr_140B6_cp_0.velocity.X - 1f; Gore expr_140D6_cp_0 = Main.gore[num633]; expr_140D6_cp_0.velocity.Y = expr_140D6_cp_0.velocity.Y - 1f; } - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.position.X = projectile.position.X + projectile.width / 2; + projectile.position.Y = projectile.position.Y + projectile.height / 2; projectile.width = 10; projectile.height = 10; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.position.X = projectile.position.X - projectile.width / 2; + projectile.position.Y = projectile.position.Y - projectile.height / 2; if (projectile.owner == Main.myPlayer) { int num220 = Main.rand.Next(3, 8); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("BoomCloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("BoomCloudPro"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } diff --git a/Projectiles/HallowedSprayPro.cs b/Projectiles/HallowedSprayPro.cs index f9c75bc5..4a399bb7 100644 --- a/Projectiles/HallowedSprayPro.cs +++ b/Projectiles/HallowedSprayPro.cs @@ -87,8 +87,7 @@ public override void AI() { projectile.ai[0] += 1f; } - projectile.rotation += 0.3f * (float)projectile.direction; - return; + projectile.rotation += 0.3f * projectile.direction; } public override bool OnTileCollide(Vector2 oldVelocity) { diff --git a/Projectiles/HellStormArrow.cs b/Projectiles/HellStormArrow.cs index 6bb6681d..a0ef1aa5 100644 --- a/Projectiles/HellStormArrow.cs +++ b/Projectiles/HellStormArrow.cs @@ -43,7 +43,7 @@ public override void Kill(int timeLeft) public override void AI() { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + 1.57f; projectile.frameCounter++; if (projectile.frameCounter > 4) { @@ -69,9 +69,9 @@ public override void AI() { if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1)) { - float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2); - float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2); - float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); + float num476 = Main.npc[num475].position.X + Main.npc[num475].width / 2; + float num477 = Main.npc[num475].position.Y + Main.npc[num475].height / 2; + float num478 = Math.Abs(projectile.position.X + projectile.width / 2 - num476) + Math.Abs(projectile.position.Y + projectile.height / 2 - num477); if (num478 < num474) { num474 = num478; @@ -84,16 +84,15 @@ public override void AI() if (flag17) { float num483 = 10f; - Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + Vector2 vector35 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); float num484 = num472 - vector35.X; float num485 = num473 - vector35.Y; - float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485)); + float num486 = (float)Math.Sqrt(num484 * num484 + num485 * num485); num486 = num483 / num486; num484 *= num486; num485 *= num486; projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f; projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f; - return; } } } diff --git a/Projectiles/HellStormProj.cs b/Projectiles/HellStormProj.cs index 3baf249f..b4fd57ac 100644 --- a/Projectiles/HellStormProj.cs +++ b/Projectiles/HellStormProj.cs @@ -56,7 +56,7 @@ public override void AI() int num4 = 6; projectile.ai[1] += 1f; bool flag = false; - if (projectile.ai[1] >= (float)(num3 - num4 * num2)) + if (projectile.ai[1] >= num3 - num4 * num2) { projectile.ai[1] = 0f; flag = true; @@ -86,10 +86,10 @@ public override void AI() { float scaleFactor = player.inventory[player.selectedItem].shootSpeed * projectile.scale; Vector2 value2 = vector; - Vector2 value3 = Main.screenPosition + new Vector2((float)Main.mouseX, (float)Main.mouseY) - value2; + Vector2 value3 = Main.screenPosition + new Vector2(Main.mouseX, Main.mouseY) - value2; if (player.gravDir == -1f) { - value3.Y = (float)(Main.screenHeight - Main.mouseY) + Main.screenPosition.Y - value2.Y; + value3.Y = Main.screenHeight - Main.mouseY + Main.screenPosition.Y - value2.Y; } Vector2 vector3 = Vector2.Normalize(value3); if (float.IsNaN(vector3.X) || float.IsNaN(vector3.Y)) @@ -105,7 +105,7 @@ public override void AI() int num6 = mod.ProjectileType("HellStormArrow"); float scaleFactor2 = 14f; int num7 = 7; - value2 = projectile.Center + new Vector2((float)Main.rand.Next(-num7, num7 + 1), (float)Main.rand.Next(-num7, num7 + 1)); + value2 = projectile.Center + new Vector2(Main.rand.Next(-num7, num7 + 1), 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)); if (float.IsNaN(spinningpoint.X) || float.IsNaN(spinningpoint.Y)) @@ -128,7 +128,7 @@ public override void AI() player.heldProj = projectile.whoAmI; player.itemTime = 2; player.itemAnimation = 2; - player.itemRotation = (float)Math.Atan2((double)(projectile.velocity.Y * (float)projectile.direction), (double)(projectile.velocity.X * (float)projectile.direction)); + player.itemRotation = (float)Math.Atan2(projectile.velocity.Y * projectile.direction, projectile.velocity.X * projectile.direction); } } } diff --git a/Projectiles/HolyJavelinPro.cs b/Projectiles/HolyJavelinPro.cs index dfd170d8..87b86835 100644 --- a/Projectiles/HolyJavelinPro.cs +++ b/Projectiles/HolyJavelinPro.cs @@ -49,13 +49,13 @@ public override void Kill(int timeLeft) int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 57, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); if (Main.rand.Next(3) == 0) { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].type++; } else { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 1.2f + Main.rand.Next(-10, 11) * 0.01f; } Main.dust[num159].noGravity = true; Main.dust[num159].velocity *= 2.5f; @@ -66,14 +66,14 @@ public override void Kill(int timeLeft) int num160 = Main.rand.Next(0, 0); for (int num161 = 0; num161 < num160; num161++) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); while (value12.X == 0f && value12.Y == 0f) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); } value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); + value12 *= Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + projectile.width / 2, projectile.oldPosition.Y + projectile.height / 2, value12.X, value12.Y, 400, (int)(projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); } } } @@ -106,7 +106,6 @@ public override void AI() if (projectile.wet && !projectile.lavaWet) { projectile.Kill(); - return; } } } diff --git a/Projectiles/IceBullet.cs b/Projectiles/IceBullet.cs index 154470b2..09fd89ee 100644 --- a/Projectiles/IceBullet.cs +++ b/Projectiles/IceBullet.cs @@ -46,7 +46,7 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) for (int k = 0; k < projectile.oldPos.Length; k++) { Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); - Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); + Color color = projectile.GetAlpha(lightColor) * ((projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); } return true; diff --git a/Projectiles/Igniter.cs b/Projectiles/Igniter.cs index 15a9a262..dbf57dd8 100644 --- a/Projectiles/Igniter.cs +++ b/Projectiles/Igniter.cs @@ -50,7 +50,6 @@ public override void AI() if (projectile.wet && !projectile.lavaWet) { projectile.Kill(); - return; } } } @@ -63,13 +62,13 @@ public override void Kill(int timeLeft) int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); if (Main.rand.Next(3) == 0) { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].type++; } else { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 1.2f + Main.rand.Next(-10, 11) * 0.01f; } Main.dust[num159].noGravity = true; Main.dust[num159].velocity *= 2.5f; @@ -80,14 +79,14 @@ public override void Kill(int timeLeft) int num160 = Main.rand.Next(3, 6); for (int num161 = 0; num161 < num160; num161++) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); while (value12.X == 0f && value12.Y == 0f) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); } value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); + value12 *= Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + projectile.width / 2, projectile.oldPosition.Y + projectile.height / 2, value12.X, value12.Y, 400, (int)(projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/InfernoPro.cs b/Projectiles/InfernoPro.cs index 64ebc041..e876ca24 100644 --- a/Projectiles/InfernoPro.cs +++ b/Projectiles/InfernoPro.cs @@ -1,5 +1,4 @@ using Microsoft.Xna.Framework; - using Terraria; using Terraria.ModLoader; @@ -37,8 +36,8 @@ public override void AI() Main.player[projectile.owner].direction = projectile.direction; Main.player[projectile.owner].heldProj = projectile.whoAmI; Main.player[projectile.owner].itemTime = Main.player[projectile.owner].itemAnimation; - 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.X = Main.player[projectile.owner].position.X + Main.player[projectile.owner].width / 2 - projectile.width / 2; + projectile.position.Y = Main.player[projectile.owner].position.Y + Main.player[projectile.owner].height / 2 - projectile.height / 2; projectile.position += projectile.velocity * projectile.ai[0]; if (projectile.ai[0] == 0f) { projectile.ai[0] = 3f; diff --git a/Projectiles/InfernoRift.cs b/Projectiles/InfernoRift.cs index 8120b0c6..520e556c 100644 --- a/Projectiles/InfernoRift.cs +++ b/Projectiles/InfernoRift.cs @@ -2,8 +2,8 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; -using Terraria.ModLoader; using Terraria.ID; +using Terraria.ModLoader; namespace Tremor.Projectiles { @@ -109,15 +109,15 @@ public override void AI() if (Main.player[projectile.owner].channel) { float num146 = 12f; - Vector2 vector10 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num147 = (float)Main.mouseX + Main.screenPosition.X - vector10.X; - float num148 = (float)Main.mouseY + Main.screenPosition.Y - vector10.Y; + Vector2 vector10 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); + float num147 = Main.mouseX + Main.screenPosition.X - vector10.X; + float num148 = Main.mouseY + Main.screenPosition.Y - vector10.Y; if (Main.player[projectile.owner].gravDir == -1f) { - num148 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector10.Y; + num148 = Main.screenPosition.Y + Main.screenHeight - Main.mouseY - vector10.Y; } - float num149 = (float)Math.Sqrt((double)(num147 * num147 + num148 * num148)); - num149 = (float)Math.Sqrt((double)(num147 * num147 + num148 * num148)); + float num149 = (float)Math.Sqrt(num147 * num147 + num148 * num148); + num149 = (float)Math.Sqrt(num147 * num147 + num148 * num148); if (num149 > num146) { num149 = num146 / num149; @@ -155,20 +155,20 @@ public override void AI() projectile.ai[0] = 1f; projectile.netUpdate = true; float num158 = 12f; - Vector2 vector11 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num159 = (float)Main.mouseX + Main.screenPosition.X - vector11.X; - float num160 = (float)Main.mouseY + Main.screenPosition.Y - vector11.Y; + Vector2 vector11 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); + float num159 = Main.mouseX + Main.screenPosition.X - vector11.X; + float num160 = Main.mouseY + Main.screenPosition.Y - vector11.Y; if (Main.player[projectile.owner].gravDir == -1f) { - num160 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector11.Y; + num160 = Main.screenPosition.Y + Main.screenHeight - Main.mouseY - vector11.Y; } - float num161 = (float)Math.Sqrt((double)(num159 * num159 + num160 * num160)); + float num161 = (float)Math.Sqrt(num159 * num159 + num160 * num160); if (num161 == 0f) { - vector11 = new Vector2(Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2), Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2)); - num159 = projectile.position.X + (float)projectile.width * 0.5f - vector11.X; - num160 = projectile.position.Y + (float)projectile.height * 0.5f - vector11.Y; - num161 = (float)Math.Sqrt((double)(num159 * num159 + num160 * num160)); + vector11 = new Vector2(Main.player[projectile.owner].position.X + Main.player[projectile.owner].width / 2, Main.player[projectile.owner].position.Y + Main.player[projectile.owner].height / 2); + num159 = projectile.position.X + projectile.width * 0.5f - vector11.X; + num160 = projectile.position.Y + projectile.height * 0.5f - vector11.Y; + num161 = (float)Math.Sqrt(num159 * num159 + num160 * num160); } num161 = num158 / num161; num159 *= num161; diff --git a/Projectiles/LeafBallPro.cs b/Projectiles/LeafBallPro.cs index 0dbc24f1..6365314c 100644 --- a/Projectiles/LeafBallPro.cs +++ b/Projectiles/LeafBallPro.cs @@ -1,8 +1,6 @@ using System; - using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; - using Terraria; using Terraria.ModLoader; @@ -31,17 +29,17 @@ public override void SetStaticDefaults() // Now this is where the chain magic happens. You don't have to try to figure this whole thing out. // Just make sure that you edit the first line (which starts with 'Texture2D texture') correctly. - public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Color lightColor) + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Texture2D texture = ModLoader.GetTexture("Tremor/Projectiles/LeafBall_Chain"); Vector2 position = projectile.Center; Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; - Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(); - Vector2 origin = new Vector2((float)texture.Width * 0.5f, (float)texture.Height * 0.5f); - float num1 = (float)texture.Height; + Rectangle? sourceRectangle = new Rectangle?(); + Vector2 origin = new Vector2(texture.Width * 0.5f, texture.Height * 0.5f); + float num1 = texture.Height; Vector2 vector2_4 = mountedCenter - position; - float rotation = (float)Math.Atan2((double)vector2_4.Y, (double)vector2_4.X) - 1.57f; + float rotation = (float)Math.Atan2(vector2_4.Y, vector2_4.X) - 1.57f; bool flag = true; if (float.IsNaN(position.X) && float.IsNaN(position.Y)) flag = false; @@ -49,7 +47,7 @@ public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch sprite flag = false; while (flag) { - if ((double)vector2_4.Length() < (double)num1 + 1.0) + if (vector2_4.Length() < num1 + 1.0) { flag = false; } @@ -59,7 +57,7 @@ public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch sprite vector2_1.Normalize(); position += vector2_1 * num1; vector2_4 = mountedCenter - position; - Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)position.X / 16, (int)((double)position.Y / 16.0)); + Color color2 = Lighting.GetColor((int)position.X / 16, (int)(position.Y / 16.0)); color2 = projectile.GetAlpha(color2); Main.spriteBatch.Draw(texture, position - Main.screenPosition, sourceRectangle, color2, rotation, origin, 1f, SpriteEffects.None, 0.0f); } diff --git a/Projectiles/LightningTome.cs b/Projectiles/LightningTome.cs index 75d1126d..f3a7e47f 100644 --- a/Projectiles/LightningTome.cs +++ b/Projectiles/LightningTome.cs @@ -48,7 +48,7 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) for (int k = 0; k < projectile.oldPos.Length; k++) { Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); - Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); + Color color = projectile.GetAlpha(lightColor) * ((projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); } return true; diff --git a/Projectiles/MagusBall.cs b/Projectiles/MagusBall.cs index 985fdf97..84aae2ad 100644 --- a/Projectiles/MagusBall.cs +++ b/Projectiles/MagusBall.cs @@ -29,8 +29,8 @@ public override bool PreAI() { for (int i = 0; i < 10; i++) { - float x = projectile.Center.X - projectile.velocity.X / 10f * (float)i; - float y = projectile.Center.Y - projectile.velocity.Y / 10f * (float)i; + float x = projectile.Center.X - projectile.velocity.X / 10f * i; + float y = projectile.Center.Y - projectile.velocity.Y / 10f * i; int dust = Dust.NewDust(new Vector2(x, y), 1, 1, 68, 0f, 0f, 0, default(Color), 1f); Main.dust[dust].alpha = projectile.alpha; Main.dust[dust].position.X = x; @@ -75,9 +75,9 @@ public override void Kill(int timeLeft) int num = Dust.NewDust(projectile.position, projectile.width, projectile.height, 68, 0f, -2f, 0, default(Color), 2f); Main.dust[num].noGravity = true; Dust expr_62_cp_0 = Main.dust[num]; - expr_62_cp_0.position.X = expr_62_cp_0.position.X + ((float)(Main.rand.Next(-50, 51) / 20) - 1.5f); + expr_62_cp_0.position.X = expr_62_cp_0.position.X + (Main.rand.Next(-50, 51) / 20 - 1.5f); Dust expr_92_cp_0 = Main.dust[num]; - expr_92_cp_0.position.Y = expr_92_cp_0.position.Y + ((float)(Main.rand.Next(-50, 51) / 20) - 1.5f); + expr_92_cp_0.position.Y = expr_92_cp_0.position.Y + (Main.rand.Next(-50, 51) / 20 - 1.5f); if (Main.dust[num].position != projectile.Center) { Main.dust[num].velocity = projectile.DirectionTo(Main.dust[num].position) * 6f; diff --git a/Projectiles/MagusBallF.cs b/Projectiles/MagusBallF.cs index d5050778..803f6971 100644 --- a/Projectiles/MagusBallF.cs +++ b/Projectiles/MagusBallF.cs @@ -29,8 +29,8 @@ public override bool PreAI() { for (int i = 0; i < 10; i++) { - float x = projectile.Center.X - projectile.velocity.X / 10f * (float)i; - float y = projectile.Center.Y - projectile.velocity.Y / 10f * (float)i; + float x = projectile.Center.X - projectile.velocity.X / 10f * i; + float y = projectile.Center.Y - projectile.velocity.Y / 10f * i; int dust = Dust.NewDust(new Vector2(x, y), 1, 1, 68, 0f, 0f, 0, default(Color), 1f); Main.dust[dust].alpha = projectile.alpha; Main.dust[dust].position.X = x; @@ -75,9 +75,9 @@ public override void Kill(int timeLeft) int num = Dust.NewDust(projectile.position, projectile.width, projectile.height, 68, 0f, -2f, 0, default(Color), 2f); Main.dust[num].noGravity = true; Dust expr_62_cp_0 = Main.dust[num]; - expr_62_cp_0.position.X = expr_62_cp_0.position.X + ((float)(Main.rand.Next(-50, 51) / 20) - 1.5f); + expr_62_cp_0.position.X = expr_62_cp_0.position.X + (Main.rand.Next(-50, 51) / 20 - 1.5f); Dust expr_92_cp_0 = Main.dust[num]; - expr_92_cp_0.position.Y = expr_92_cp_0.position.Y + ((float)(Main.rand.Next(-50, 51) / 20) - 1.5f); + expr_92_cp_0.position.Y = expr_92_cp_0.position.Y + (Main.rand.Next(-50, 51) / 20 - 1.5f); if (Main.dust[num].position != projectile.Center) { Main.dust[num].velocity = projectile.DirectionTo(Main.dust[num].position) * 6f; diff --git a/Projectiles/ManiacChainsawPro.cs b/Projectiles/ManiacChainsawPro.cs index c0f462d4..c36013a1 100644 --- a/Projectiles/ManiacChainsawPro.cs +++ b/Projectiles/ManiacChainsawPro.cs @@ -48,14 +48,14 @@ public override void AI() { num263 = Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].shootSpeed * projectile.scale; vector23 = vector22; - num264 = (float)Main.mouseX + Main.screenPosition.X - vector23.X - 20; - num265 = (float)Main.mouseY + Main.screenPosition.Y - vector23.Y; + num264 = Main.mouseX + Main.screenPosition.X - vector23.X - 20; + num265 = Main.mouseY + Main.screenPosition.Y - vector23.Y; if (Main.player[projectile.owner].gravDir == -1f) { - num265 = (float)(Main.screenHeight - Main.mouseY) + Main.screenPosition.Y - vector23.Y; + num265 = Main.screenHeight - Main.mouseY + Main.screenPosition.Y - vector23.Y; } - num266 = (float)Math.Sqrt((double)(num264 * num264 + num265 * num265)); - num266 = (float)Math.Sqrt((double)(num264 * num264 + num265 * num265)); + num266 = (float)Math.Sqrt(num264 * num264 + num265 * num265); + num266 = (float)Math.Sqrt(num264 * num264 + num265 * num265); num266 = num263 / num266; num264 *= num266; num265 *= num266; @@ -84,16 +84,16 @@ public override void AI() Main.player[projectile.owner].heldProj = projectile.whoAmI; Main.player[projectile.owner].itemTime = 2; Main.player[projectile.owner].itemAnimation = 2; - projectile.position.X = vector22.X - (float)(projectile.width / 2); - projectile.position.Y = vector22.Y - (float)(projectile.height / 2); - projectile.rotation = (float)(Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.5700000524520874); + projectile.position.X = vector22.X - projectile.width / 2; + projectile.position.Y = vector22.Y - projectile.height / 2; + projectile.rotation = (float)(Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + 1.5700000524520874); if (Main.player[projectile.owner].direction == 1) { - Main.player[projectile.owner].itemRotation = (float)Math.Atan2((double)(projectile.velocity.Y * (float)projectile.direction), (double)(projectile.velocity.X * (float)projectile.direction)); + Main.player[projectile.owner].itemRotation = (float)Math.Atan2(projectile.velocity.Y * projectile.direction, projectile.velocity.X * projectile.direction); } else { - Main.player[projectile.owner].itemRotation = (float)Math.Atan2((double)(projectile.velocity.Y * (float)projectile.direction), (double)(projectile.velocity.X * (float)projectile.direction)); + Main.player[projectile.owner].itemRotation = (float)Math.Atan2(projectile.velocity.Y * projectile.direction, projectile.velocity.X * projectile.direction); } projectile.frameCounter += 1; diff --git a/Projectiles/Minions/AntiqueStavePro.cs b/Projectiles/Minions/AntiqueStavePro.cs index 67d167df..1a6be1f1 100644 --- a/Projectiles/Minions/AntiqueStavePro.cs +++ b/Projectiles/Minions/AntiqueStavePro.cs @@ -1,3 +1,4 @@ +using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -39,9 +40,9 @@ public override void AI() { NPC target = Main.npc[i]; - float shootToX = target.position.X + (float)target.width * 0.5f - projectile.Center.X; - float shootToY = target.position.Y + (float)target.height * 0.5f - projectile.Center.Y; - float distance = (float)System.Math.Sqrt((double)(shootToX * shootToX + shootToY * shootToY)); + float shootToX = target.position.X + target.width * 0.5f - projectile.Center.X; + float shootToY = target.position.Y + target.height * 0.5f - projectile.Center.Y; + float distance = (float)Math.Sqrt(shootToX * shootToX + shootToY * shootToY); if (distance < 520f && !target.friendly && target.active) { diff --git a/Projectiles/Minions/Bramble.cs b/Projectiles/Minions/Bramble.cs index 60a9451e..ecaec565 100644 --- a/Projectiles/Minions/Bramble.cs +++ b/Projectiles/Minions/Bramble.cs @@ -1,3 +1,4 @@ +using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -39,9 +40,9 @@ public override void AI() { NPC target = Main.npc[i]; - float shootToX = target.position.X + (float)target.width * 0.5f - projectile.Center.X; - float shootToY = target.position.Y + (float)target.height * 0.5f - projectile.Center.Y; - float distance = (float)System.Math.Sqrt((double)(shootToX * shootToX + shootToY * shootToY)); + float shootToX = target.position.X + target.width * 0.5f - projectile.Center.X; + float shootToY = target.position.Y + target.height * 0.5f - projectile.Center.Y; + float distance = (float)Math.Sqrt(shootToX * shootToX + shootToY * shootToY); if (distance < 520f && !target.friendly && target.active) { diff --git a/Projectiles/Minions/HungryStaffPro.cs b/Projectiles/Minions/HungryStaffPro.cs index a854bd8e..5431236b 100644 --- a/Projectiles/Minions/HungryStaffPro.cs +++ b/Projectiles/Minions/HungryStaffPro.cs @@ -48,17 +48,17 @@ public override bool OnTileCollide(Vector2 oldVelocity) return false; } - public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Color lightColor) + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Texture2D texture = ModLoader.GetTexture("Tremor/Projectiles/HungryStaff_Chain"); Vector2 position = projectile.Center; Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; - Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(); - Vector2 origin = new Vector2((float)texture.Width * 0.5f, (float)texture.Height * 0.5f); - float num1 = (float)texture.Height; + Rectangle? sourceRectangle = new Rectangle?(); + Vector2 origin = new Vector2(texture.Width * 0.5f, texture.Height * 0.5f); + float num1 = texture.Height; Vector2 vector2_4 = mountedCenter - position; - float rotation = (float)Math.Atan2((double)vector2_4.Y, (double)vector2_4.X) - 1.57f; + float rotation = (float)Math.Atan2(vector2_4.Y, vector2_4.X) - 1.57f; bool flag = true; if (float.IsNaN(position.X) && float.IsNaN(position.Y)) flag = false; @@ -66,7 +66,7 @@ public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch sprite flag = false; while (flag) { - if ((double)vector2_4.Length() < (double)num1 + 1.0) + if (vector2_4.Length() < num1 + 1.0) { flag = false; } @@ -76,7 +76,7 @@ public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch sprite vector2_1.Normalize(); position += vector2_1 * num1; vector2_4 = mountedCenter - position; - Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)position.X / 16, (int)((double)position.Y / 16.0)); + Color color2 = Lighting.GetColor((int)position.X / 16, (int)(position.Y / 16.0)); color2 = projectile.GetAlpha(color2); Main.spriteBatch.Draw(texture, position - Main.screenPosition, sourceRectangle, color2, rotation, origin, 1f, SpriteEffects.None, 0.0f); } diff --git a/Projectiles/Minions/Hunter.cs b/Projectiles/Minions/Hunter.cs index 7fb16ee5..10b3917f 100644 --- a/Projectiles/Minions/Hunter.cs +++ b/Projectiles/Minions/Hunter.cs @@ -48,17 +48,17 @@ public override bool OnTileCollide(Vector2 oldVelocity) return false; } - public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Color lightColor) + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Texture2D texture = ModLoader.GetTexture("Tremor/Projectiles/Hunter_Chain"); Vector2 position = projectile.Center; Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; - Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(); - Vector2 origin = new Vector2((float)texture.Width * 0.5f, (float)texture.Height * 0.5f); - float num1 = (float)texture.Height; + Rectangle? sourceRectangle = new Rectangle?(); + Vector2 origin = new Vector2(texture.Width * 0.5f, texture.Height * 0.5f); + float num1 = texture.Height; Vector2 vector2_4 = mountedCenter - position; - float rotation = (float)Math.Atan2((double)vector2_4.Y, (double)vector2_4.X) - 1.57f; + float rotation = (float)Math.Atan2(vector2_4.Y, vector2_4.X) - 1.57f; bool flag = true; if (float.IsNaN(position.X) && float.IsNaN(position.Y)) flag = false; @@ -66,7 +66,7 @@ public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch sprite flag = false; while (flag) { - if ((double)vector2_4.Length() < (double)num1 + 1.0) + if (vector2_4.Length() < num1 + 1.0) { flag = false; } @@ -76,7 +76,7 @@ public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch sprite vector2_1.Normalize(); position += vector2_1 * num1; vector2_4 = mountedCenter - position; - Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)position.X / 16, (int)((double)position.Y / 16.0)); + Color color2 = Lighting.GetColor((int)position.X / 16, (int)(position.Y / 16.0)); color2 = projectile.GetAlpha(color2); Main.spriteBatch.Draw(texture, position - Main.screenPosition, sourceRectangle, color2, rotation, origin, 1f, SpriteEffects.None, 0.0f); } diff --git a/Projectiles/Minions/ShadowStaffPro.cs b/Projectiles/Minions/ShadowStaffPro.cs index 1a16e87b..c5068bfc 100644 --- a/Projectiles/Minions/ShadowStaffPro.cs +++ b/Projectiles/Minions/ShadowStaffPro.cs @@ -57,17 +57,17 @@ public override void OnHitNPC(NPC target, int damage, float knockback, bool crit } } - public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Color lightColor) + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Texture2D texture = ModLoader.GetTexture("Tremor/Projectiles/ShadowChain"); Vector2 position = projectile.Center; Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; - Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(); - Vector2 origin = new Vector2((float)texture.Width * 0.5f, (float)texture.Height * 0.5f); - float num1 = (float)texture.Height; + Rectangle? sourceRectangle = new Rectangle?(); + Vector2 origin = new Vector2(texture.Width * 0.5f, texture.Height * 0.5f); + float num1 = texture.Height; Vector2 vector2_4 = mountedCenter - position; - float rotation = (float)Math.Atan2((double)vector2_4.Y, (double)vector2_4.X) - 1.57f; + float rotation = (float)Math.Atan2(vector2_4.Y, vector2_4.X) - 1.57f; bool flag = true; if (float.IsNaN(position.X) && float.IsNaN(position.Y)) flag = false; @@ -75,7 +75,7 @@ public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch sprite flag = false; while (flag) { - if ((double)vector2_4.Length() < (double)num1 + 1.0) + if (vector2_4.Length() < num1 + 1.0) { flag = false; } @@ -85,7 +85,7 @@ public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch sprite vector2_1.Normalize(); position += vector2_1 * num1; vector2_4 = mountedCenter - position; - Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)position.X / 16, (int)((double)position.Y / 16.0)); + Color color2 = Lighting.GetColor((int)position.X / 16, (int)(position.Y / 16.0)); color2 = projectile.GetAlpha(color2); Main.spriteBatch.Draw(texture, position - Main.screenPosition, sourceRectangle, color2, rotation, origin, 1f, SpriteEffects.None, 0.0f); } diff --git a/Projectiles/MoltenWatcher.cs b/Projectiles/MoltenWatcher.cs index 0ac60cbf..9c632d85 100644 --- a/Projectiles/MoltenWatcher.cs +++ b/Projectiles/MoltenWatcher.cs @@ -100,7 +100,6 @@ public override void AI() if (projectile.wet && !projectile.lavaWet) { projectile.Kill(); - return; } } } diff --git a/Projectiles/MudShot.cs b/Projectiles/MudShot.cs index 7c308ea4..9d77220c 100644 --- a/Projectiles/MudShot.cs +++ b/Projectiles/MudShot.cs @@ -43,7 +43,7 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) for (int k = 0; k < projectile.oldPos.Length; k++) { Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); - Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); + Color color = projectile.GetAlpha(lightColor) * ((projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); } return true; diff --git a/Projectiles/MythrilBolt.cs b/Projectiles/MythrilBolt.cs index 7c754bdc..dcf179c7 100644 --- a/Projectiles/MythrilBolt.cs +++ b/Projectiles/MythrilBolt.cs @@ -1,3 +1,4 @@ +using System; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -31,7 +32,7 @@ public override void SetStaticDefaults() public override void AI() { - projectile.rotation = (float)System.Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + 1.57f; if(Main.rand.Next(1) == 0) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 61, projectile.velocity.X * 0.9f, projectile.velocity.Y * 1.9f); @@ -69,13 +70,13 @@ public override void Kill(int timeLeft) int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 61, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); if (Main.rand.Next(3) == 0) { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].type++; } else { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 1.2f + Main.rand.Next(-10, 11) * 0.01f; } Main.dust[num159].noGravity = true; Main.dust[num159].velocity *= 2.5f; @@ -86,14 +87,14 @@ public override void Kill(int timeLeft) int num160 = Main.rand.Next(0, 0); for (int num161 = 0; num161 < num160; num161++) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); while (value12.X == 0f && value12.Y == 0f) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); } value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); + value12 *= Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + projectile.width / 2, projectile.oldPosition.Y + projectile.height / 2, value12.X, value12.Y, 400, (int)(projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/NanoDronPro.cs b/Projectiles/NanoDronPro.cs index ec2bcc22..14f4ff4a 100644 --- a/Projectiles/NanoDronPro.cs +++ b/Projectiles/NanoDronPro.cs @@ -100,7 +100,6 @@ public override void AI() if (projectile.wet && !projectile.lavaWet) { projectile.Kill(); - return; } } } diff --git a/Projectiles/NightFuryPro.cs b/Projectiles/NightFuryPro.cs index c50ce454..9060260b 100644 --- a/Projectiles/NightFuryPro.cs +++ b/Projectiles/NightFuryPro.cs @@ -1,8 +1,6 @@ using System; - using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; - using Terraria; using Terraria.ModLoader; @@ -35,17 +33,17 @@ public override void AI() Main.dust[dust].noGravity = true; } - public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Color lightColor) + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Texture2D texture = ModLoader.GetTexture("Tremor/Projectiles/NightFury_Chain"); Vector2 position = projectile.Center; Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; - Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(); - Vector2 origin = new Vector2((float)texture.Width * 0.5f, (float)texture.Height * 0.5f); - float num1 = (float)texture.Height; + Rectangle? sourceRectangle = new Rectangle?(); + Vector2 origin = new Vector2(texture.Width * 0.5f, texture.Height * 0.5f); + float num1 = texture.Height; Vector2 vector2_4 = mountedCenter - position; - float rotation = (float)Math.Atan2((double)vector2_4.Y, (double)vector2_4.X) - 1.57f; + float rotation = (float)Math.Atan2(vector2_4.Y, vector2_4.X) - 1.57f; bool flag = true; if (float.IsNaN(position.X) && float.IsNaN(position.Y)) flag = false; @@ -53,7 +51,7 @@ public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch sprite flag = false; while (flag) { - if ((double)vector2_4.Length() < (double)num1 + 1.0) + if (vector2_4.Length() < num1 + 1.0) { flag = false; } @@ -63,7 +61,7 @@ public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch sprite vector2_1.Normalize(); position += vector2_1 * num1; vector2_4 = mountedCenter - position; - Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)position.X / 16, (int)((double)position.Y / 16.0)); + Color color2 = Lighting.GetColor((int)position.X / 16, (int)(position.Y / 16.0)); color2 = projectile.GetAlpha(color2); Main.spriteBatch.Draw(texture, position - Main.screenPosition, sourceRectangle, color2, rotation, origin, 1f, SpriteEffects.None, 0.0f); } diff --git a/Projectiles/NightmareBulletPro.cs b/Projectiles/NightmareBulletPro.cs index bbf44a4e..ddd09371 100644 --- a/Projectiles/NightmareBulletPro.cs +++ b/Projectiles/NightmareBulletPro.cs @@ -67,7 +67,7 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) for (int k = 0; k < projectile.oldPos.Length; k++) { Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); - Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); + Color color = projectile.GetAlpha(lightColor) * ((projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); } return true; diff --git a/Projectiles/OmnikronBeast.cs b/Projectiles/OmnikronBeast.cs index 95350938..b7056c66 100644 --- a/Projectiles/OmnikronBeast.cs +++ b/Projectiles/OmnikronBeast.cs @@ -100,7 +100,6 @@ public override void AI() if (projectile.wet && !projectile.lavaWet) { projectile.Kill(); - return; } } } diff --git a/Projectiles/OrichalcumBolt.cs b/Projectiles/OrichalcumBolt.cs index bbfa601d..620aa043 100644 --- a/Projectiles/OrichalcumBolt.cs +++ b/Projectiles/OrichalcumBolt.cs @@ -56,7 +56,6 @@ public override void AI() if (projectile.wet && !projectile.lavaWet) { projectile.Kill(); - return; } } } diff --git a/Projectiles/PainWheelPro.cs b/Projectiles/PainWheelPro.cs index a5f815e8..cbfb3e5a 100644 --- a/Projectiles/PainWheelPro.cs +++ b/Projectiles/PainWheelPro.cs @@ -1,8 +1,6 @@ using System; - using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; - using Terraria; using Terraria.ModLoader; @@ -35,17 +33,17 @@ public override void AI() Main.dust[dust].noGravity = true; } - public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Color lightColor) + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Texture2D texture = ModLoader.GetTexture("Tremor/Projectiles/PainWheel_Chain"); Vector2 position = projectile.Center; Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; - Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(); - Vector2 origin = new Vector2((float)texture.Width * 0.5f, (float)texture.Height * 0.5f); - float num1 = (float)texture.Height; + Rectangle? sourceRectangle = new Rectangle?(); + Vector2 origin = new Vector2(texture.Width * 0.5f, texture.Height * 0.5f); + float num1 = texture.Height; Vector2 vector2_4 = mountedCenter - position; - float rotation = (float)Math.Atan2((double)vector2_4.Y, (double)vector2_4.X) - 1.57f; + float rotation = (float)Math.Atan2(vector2_4.Y, vector2_4.X) - 1.57f; bool flag = true; if (float.IsNaN(position.X) && float.IsNaN(position.Y)) flag = false; @@ -53,7 +51,7 @@ public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch sprite flag = false; while (flag) { - if ((double)vector2_4.Length() < (double)num1 + 1.0) + if (vector2_4.Length() < num1 + 1.0) { flag = false; } @@ -63,7 +61,7 @@ public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch sprite vector2_1.Normalize(); position += vector2_1 * num1; vector2_4 = mountedCenter - position; - Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)position.X / 16, (int)((double)position.Y / 16.0)); + Color color2 = Lighting.GetColor((int)position.X / 16, (int)(position.Y / 16.0)); color2 = projectile.GetAlpha(color2); Main.spriteBatch.Draw(texture, position - Main.screenPosition, sourceRectangle, color2, rotation, origin, 1f, SpriteEffects.None, 0.0f); } diff --git a/Projectiles/PaladinHammerPro.cs b/Projectiles/PaladinHammerPro.cs index 8750aec8..dd2c1b0e 100644 --- a/Projectiles/PaladinHammerPro.cs +++ b/Projectiles/PaladinHammerPro.cs @@ -1,7 +1,7 @@ -using Terraria.ModLoader; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using Microsoft.Xna.Framework; using Terraria; +using Terraria.ModLoader; namespace Tremor.Projectiles { @@ -10,7 +10,7 @@ public class PaladinHammerPro : ModProjectile const float RotationSpeed = 0.05f; const float Distanse = 48; - float Rotation = 0; + float Rotation; public override void SetDefaults() { @@ -55,7 +55,7 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) for(int k = 0; k < projectile.oldPos.Length; k++) { Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); - Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); + Color color = projectile.GetAlpha(lightColor) * ((projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); } return true; diff --git a/Projectiles/PalladiumBolt.cs b/Projectiles/PalladiumBolt.cs index 38053cf2..1578ae3f 100644 --- a/Projectiles/PalladiumBolt.cs +++ b/Projectiles/PalladiumBolt.cs @@ -56,7 +56,6 @@ public override void AI() if (projectile.wet && !projectile.lavaWet) { projectile.Kill(); - return; } } } @@ -69,13 +68,13 @@ public override void Kill(int timeLeft) int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 64, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); if (Main.rand.Next(3) == 0) { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].type++; } else { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 1.2f + Main.rand.Next(-10, 11) * 0.01f; } Main.dust[num159].noGravity = true; Main.dust[num159].velocity *= 2.5f; @@ -86,14 +85,14 @@ public override void Kill(int timeLeft) int num160 = Main.rand.Next(0, 0); for (int num161 = 0; num161 < num160; num161++) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); while (value12.X == 0f && value12.Y == 0f) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); } value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); + value12 *= Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + projectile.width / 2, projectile.oldPosition.Y + projectile.height / 2, value12.X, value12.Y, 400, (int)(projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/PandemoniumBullet.cs b/Projectiles/PandemoniumBullet.cs index 7a2e1cc0..641af84d 100644 --- a/Projectiles/PandemoniumBullet.cs +++ b/Projectiles/PandemoniumBullet.cs @@ -76,7 +76,7 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) for (int k = 0; k < projectile.oldPos.Length; k++) { Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); - Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); + Color color = projectile.GetAlpha(lightColor) * ((projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); } return true; diff --git a/Projectiles/ParaxydeKnifePro.cs b/Projectiles/ParaxydeKnifePro.cs index 68553ec2..ef44e116 100644 --- a/Projectiles/ParaxydeKnifePro.cs +++ b/Projectiles/ParaxydeKnifePro.cs @@ -40,13 +40,13 @@ public override void Kill(int timeLeft) int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 27, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); if (Main.rand.Next(3) == 0) { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].type++; } else { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 1.2f + Main.rand.Next(-10, 11) * 0.01f; } Main.dust[num159].noGravity = true; Main.dust[num159].velocity *= 2.5f; @@ -57,14 +57,14 @@ public override void Kill(int timeLeft) int num160 = Main.rand.Next(0, 0); for (int num161 = 0; num161 < num160; num161++) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); while (value12.X == 0f && value12.Y == 0f) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); } value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); + value12 *= Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + projectile.width / 2, projectile.oldPosition.Y + projectile.height / 2, value12.X, value12.Y, 400, (int)(projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/PhantomSpear.cs b/Projectiles/PhantomSpear.cs index b981c00d..2d65548b 100644 --- a/Projectiles/PhantomSpear.cs +++ b/Projectiles/PhantomSpear.cs @@ -40,13 +40,13 @@ public override void Kill(int timeLeft) int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 27, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); if (Main.rand.Next(3) == 0) { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].type++; } else { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 1.2f + Main.rand.Next(-10, 11) * 0.01f; } Main.dust[num159].noGravity = true; Main.dust[num159].velocity *= 2.5f; @@ -57,14 +57,14 @@ public override void Kill(int timeLeft) int num160 = Main.rand.Next(0, 0); for (int num161 = 0; num161 < num160; num161++) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); while (value12.X == 0f && value12.Y == 0f) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); } value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); + value12 *= Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + projectile.width / 2, projectile.oldPosition.Y + projectile.height / 2, value12.X, value12.Y, 400, (int)(projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); } } } @@ -97,7 +97,6 @@ public override void AI() if (projectile.wet && !projectile.lavaWet) { projectile.Kill(); - return; } } } diff --git a/Projectiles/PirahnaPro.cs b/Projectiles/PirahnaPro.cs index 430c2095..05f260a7 100644 --- a/Projectiles/PirahnaPro.cs +++ b/Projectiles/PirahnaPro.cs @@ -35,13 +35,13 @@ public override void Kill(int timeLeft) int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); if (Main.rand.Next(3) == 0) { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].type++; } else { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 1.2f + Main.rand.Next(-10, 11) * 0.01f; } Main.dust[num159].noGravity = true; Main.dust[num159].velocity *= 2.5f; @@ -52,14 +52,14 @@ public override void Kill(int timeLeft) int num160 = Main.rand.Next(0, 0); for (int num161 = 0; num161 < num160; num161++) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); while (value12.X == 0f && value12.Y == 0f) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); } value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); + value12 *= Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + projectile.width / 2, projectile.oldPosition.Y + projectile.height / 2, value12.X, value12.Y, 400, (int)(projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/PlagueFlaskEvil.cs b/Projectiles/PlagueFlaskEvil.cs index 07a22c41..313d206b 100644 --- a/Projectiles/PlagueFlaskEvil.cs +++ b/Projectiles/PlagueFlaskEvil.cs @@ -36,10 +36,10 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(3, 5); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("AlchemasterPoisonCloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("AlchemasterPoisonCloudPro"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } //} } diff --git a/Projectiles/PoisonJavelinPro.cs b/Projectiles/PoisonJavelinPro.cs index 45e14868..abc39461 100644 --- a/Projectiles/PoisonJavelinPro.cs +++ b/Projectiles/PoisonJavelinPro.cs @@ -50,13 +50,13 @@ public override void Kill(int timeLeft) int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 2, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); if (Main.rand.Next(3) == 0) { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].type++; } else { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 1.2f + Main.rand.Next(-10, 11) * 0.01f; } Main.dust[num159].noGravity = true; Main.dust[num159].velocity *= 2.5f; @@ -67,14 +67,14 @@ public override void Kill(int timeLeft) int num160 = Main.rand.Next(0, 0); for (int num161 = 0; num161 < num160; num161++) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); while (value12.X == 0f && value12.Y == 0f) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); } value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); + value12 *= Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + projectile.width / 2, projectile.oldPosition.Y + projectile.height / 2, value12.X, value12.Y, 400, (int)(projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); } } } @@ -107,7 +107,6 @@ public override void AI() if (projectile.wet && !projectile.lavaWet) { projectile.Kill(); - return; } } } diff --git a/Projectiles/PumpkinPro.cs b/Projectiles/PumpkinPro.cs index 54259dbd..9844373a 100644 --- a/Projectiles/PumpkinPro.cs +++ b/Projectiles/PumpkinPro.cs @@ -58,7 +58,7 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) for(int k = 0; k < projectile.oldPos.Length; k++) { Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); - Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); + Color color = projectile.GetAlpha(lightColor) * ((projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); } return true; diff --git a/Projectiles/PurplePulsePro.cs b/Projectiles/PurplePulsePro.cs index 9debb82a..f9f982cd 100644 --- a/Projectiles/PurplePulsePro.cs +++ b/Projectiles/PurplePulsePro.cs @@ -34,10 +34,10 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(1, 1); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("PurpleBoomPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("PurpleBoomPro"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } @@ -69,7 +69,6 @@ public override void AI() if (projectile.wet && !projectile.lavaWet) { projectile.Kill(); - return; } } } diff --git a/Projectiles/RedPulsePro.cs b/Projectiles/RedPulsePro.cs index 167e9b49..6cacbb3e 100644 --- a/Projectiles/RedPulsePro.cs +++ b/Projectiles/RedPulsePro.cs @@ -33,10 +33,10 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(1, 1); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("RedBoomPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("RedBoomPro"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } @@ -68,7 +68,6 @@ public override void AI() if (projectile.wet && !projectile.lavaWet) { projectile.Kill(); - return; } } } diff --git a/Projectiles/RockminePro.cs b/Projectiles/RockminePro.cs index eeae61b8..4f36c042 100644 --- a/Projectiles/RockminePro.cs +++ b/Projectiles/RockminePro.cs @@ -54,12 +54,12 @@ public override bool OnTileCollide(Vector2 oldVelocity) public override void Kill(int timeLeft) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.position.X = projectile.position.X + projectile.width / 2; + projectile.position.Y = projectile.position.Y + projectile.height / 2; projectile.width = 80; projectile.height = 80; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.position.X = projectile.position.X - projectile.width / 2; + projectile.position.Y = projectile.position.Y - projectile.height / 2; for (int num628 = 0; num628 < 40; num628++) { int num629 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); @@ -67,7 +67,7 @@ public override void Kill(int timeLeft) if (Main.rand.Next(2) == 0) { Main.dust[num629].scale = 0.5f; - Main.dust[num629].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num629].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } for (int num630 = 0; num630 < 70; num630++) @@ -89,47 +89,47 @@ public override void Kill(int timeLeft) { scaleFactor10 = 1f; } - int num633 = 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 num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13E6D_cp_0 = Main.gore[num633]; expr_13E6D_cp_0.velocity.X = expr_13E6D_cp_0.velocity.X + 1f; Gore expr_13E8D_cp_0 = Main.gore[num633]; expr_13E8D_cp_0.velocity.Y = expr_13E8D_cp_0.velocity.Y + 1f; - num633 = 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), 2f); + num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 2f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13F30_cp_0 = Main.gore[num633]; expr_13F30_cp_0.velocity.X = expr_13F30_cp_0.velocity.X - 1f; Gore expr_13F50_cp_0 = Main.gore[num633]; expr_13F50_cp_0.velocity.Y = expr_13F50_cp_0.velocity.Y + 1f; - num633 = 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); + num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13FF3_cp_0 = Main.gore[num633]; expr_13FF3_cp_0.velocity.X = expr_13FF3_cp_0.velocity.X + 1f; Gore expr_14013_cp_0 = Main.gore[num633]; expr_14013_cp_0.velocity.Y = expr_14013_cp_0.velocity.Y - 1f; - num633 = 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); + num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_140B6_cp_0 = Main.gore[num633]; expr_140B6_cp_0.velocity.X = expr_140B6_cp_0.velocity.X - 1f; Gore expr_140D6_cp_0 = Main.gore[num633]; expr_140D6_cp_0.velocity.Y = expr_140D6_cp_0.velocity.Y - 1f; } - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.position.X = projectile.position.X + projectile.width / 2; + projectile.position.Y = projectile.position.Y + projectile.height / 2; projectile.width = 10; projectile.height = 10; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.position.X = projectile.position.X - projectile.width / 2; + projectile.position.Y = projectile.position.Y - projectile.height / 2; if (projectile.owner == Main.myPlayer) { int num220 = Main.rand.Next(3, 8); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("BoomCloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("BoomCloudPro"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } diff --git a/Projectiles/SacredCrossPro.cs b/Projectiles/SacredCrossPro.cs index 7440f144..8775f52e 100644 --- a/Projectiles/SacredCrossPro.cs +++ b/Projectiles/SacredCrossPro.cs @@ -53,7 +53,6 @@ public override void AI() if (projectile.wet && !projectile.lavaWet) { projectile.Kill(); - return; } } } @@ -66,13 +65,13 @@ public override void Kill(int timeLeft) int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 57, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 3.5f); if (Main.rand.Next(3) == 0) { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].type++; } else { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 1.2f + Main.rand.Next(-10, 11) * 0.01f; } Main.dust[num159].noGravity = true; Main.dust[num159].velocity *= 2.5f; @@ -83,14 +82,14 @@ public override void Kill(int timeLeft) int num160 = Main.rand.Next(0, 0); for (int num161 = 0; num161 < num160; num161++) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); while (value12.X == 0f && value12.Y == 0f) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); } value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 2.8f, projectile.owner, 0f, 0f); + value12 *= Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + projectile.width / 2, projectile.oldPosition.Y + projectile.height / 2, value12.X, value12.Y, 400, (int)(projectile.damage * 0.8), projectile.knockBack * 2.8f, projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/Sand.cs b/Projectiles/Sand.cs index ed6ad208..526b8f8c 100644 --- a/Projectiles/Sand.cs +++ b/Projectiles/Sand.cs @@ -1,3 +1,4 @@ +using System; using Terraria; using Terraria.ModLoader; @@ -24,7 +25,7 @@ public override void SetStaticDefaults() public override void AI() { - projectile.rotation = (float)System.Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + 1.57f; } public override void Kill(int timeLeft) diff --git a/Projectiles/SandstormMinion.cs b/Projectiles/SandstormMinion.cs index b2b3aca7..91db6225 100644 --- a/Projectiles/SandstormMinion.cs +++ b/Projectiles/SandstormMinion.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using System; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; @@ -23,11 +24,11 @@ public class SandstormMinion : ModProjectile // Если же: // ShootType = -1 а ShootTypeMod = "projVultureFeather" - стрелять будет пером вультура - int Frame = 0; + int Frame; int TimeToAnimation = AnimationRate; int TimeToShoot = ShootRate; - Rectangle FrameRect = new Rectangle(); + Rectangle FrameRect; public override void SetDefaults() { @@ -102,7 +103,7 @@ void Dust() { if (!dust.active) break; - if (projectile.Distance(dust.position) > System.Math.Max(projectile.width, projectile.height)) + if (projectile.Distance(dust.position) > Math.Max(projectile.width, projectile.height)) continue; if (dust.type == 217) { diff --git a/Projectiles/SaturatedDaggerPro.cs b/Projectiles/SaturatedDaggerPro.cs index 8ca886c7..b3745410 100644 --- a/Projectiles/SaturatedDaggerPro.cs +++ b/Projectiles/SaturatedDaggerPro.cs @@ -39,13 +39,13 @@ public override void Kill(int timeLeft) int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 27, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); if (Main.rand.Next(3) == 0) { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].type++; } else { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 1.2f + Main.rand.Next(-10, 11) * 0.01f; } Main.dust[num159].noGravity = true; Main.dust[num159].velocity *= 2.5f; @@ -56,14 +56,14 @@ public override void Kill(int timeLeft) int num160 = Main.rand.Next(0, 0); for (int num161 = 0; num161 < num160; num161++) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); while (value12.X == 0f && value12.Y == 0f) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); } value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); + value12 *= Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + projectile.width / 2, projectile.oldPosition.Y + projectile.height / 2, value12.X, value12.Y, 400, (int)(projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/ScorcherPro.cs b/Projectiles/ScorcherPro.cs index 9556a255..1357fd32 100644 --- a/Projectiles/ScorcherPro.cs +++ b/Projectiles/ScorcherPro.cs @@ -29,8 +29,8 @@ public override void AI() Main.player[projectile.owner].direction = projectile.direction; Main.player[projectile.owner].heldProj = projectile.whoAmI; Main.player[projectile.owner].itemTime = Main.player[projectile.owner].itemAnimation; - 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.X = Main.player[projectile.owner].position.X + Main.player[projectile.owner].width / 2 - projectile.width / 2; + projectile.position.Y = Main.player[projectile.owner].position.Y + Main.player[projectile.owner].height / 2 - projectile.height / 2; projectile.position += projectile.velocity * projectile.ai[0]; if (projectile.ai[0] == 0f) { @@ -61,7 +61,7 @@ public override void AI() } //Rotate spear - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 2.355f; + projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + 2.355f; if (projectile.spriteDirection == -1) { projectile.rotation -= 1.57f; diff --git a/Projectiles/ScorcherStar.cs b/Projectiles/ScorcherStar.cs index 38254260..a371b488 100644 --- a/Projectiles/ScorcherStar.cs +++ b/Projectiles/ScorcherStar.cs @@ -35,7 +35,7 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) for(int k = 0; k < projectile.oldPos.Length; k++) { Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); - Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); + Color color = projectile.GetAlpha(lightColor) * ((projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); } return true; @@ -48,13 +48,13 @@ public override void Kill(int timeLeft) int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.3f); if (Main.rand.Next(3) == 0) { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].type++; } else { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 1.2f + Main.rand.Next(-10, 11) * 0.01f; } Main.dust[num159].noGravity = true; Main.dust[num159].velocity *= 2.5f; @@ -65,14 +65,14 @@ public override void Kill(int timeLeft) int num160 = Main.rand.Next(1, 1); for (int num161 = 0; num161 < num160; num161++) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); while (value12.X == 0f && value12.Y == 0f) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); } value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 612, (int)((double)projectile.damage * 0.8), projectile.knockBack * 2.8f, projectile.owner, 0f, 0f); + value12 *= Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + projectile.width / 2, projectile.oldPosition.Y + projectile.height / 2, value12.X, value12.Y, 612, (int)(projectile.damage * 0.8), projectile.knockBack * 2.8f, projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/ScorcherTwo.cs b/Projectiles/ScorcherTwo.cs index 20636bfa..0b9b971b 100644 --- a/Projectiles/ScorcherTwo.cs +++ b/Projectiles/ScorcherTwo.cs @@ -30,13 +30,13 @@ public override void Kill(int timeLeft) int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.3f); if (Main.rand.Next(3) == 0) { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].type++; } else { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 1.2f + Main.rand.Next(-10, 11) * 0.01f; } Main.dust[num159].noGravity = true; Main.dust[num159].velocity *= 2.5f; @@ -47,14 +47,14 @@ public override void Kill(int timeLeft) int num160 = Main.rand.Next(1, 1); for (int num161 = 0; num161 < num160; num161++) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); while (value12.X == 0f && value12.Y == 0f) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); } value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 612, (int)((double)projectile.damage * 0.8), projectile.knockBack * 2.8f, projectile.owner, 0f, 0f); + value12 *= Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + projectile.width / 2, projectile.oldPosition.Y + projectile.height / 2, value12.X, value12.Y, 612, (int)(projectile.damage * 0.8), projectile.knockBack * 2.8f, projectile.owner, 0f, 0f); } } } @@ -84,10 +84,10 @@ public override void AI() num668++; } } - float num670 = (float)projectile.damage * 0.8f; + float num670 = projectile.damage * 0.8f; if (num668 > 100) { - float num671 = (float)(num668 - 100); + float num671 = num668 - 100; num671 = 1f - num671 / 100f; num670 *= num671; } @@ -139,9 +139,9 @@ public override void AI() { projectile.localAI[0] -= 7f; } - if (num670 > (float)projectile.damage * 0.1f) + if (num670 > projectile.damage * 0.1f) { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("ScorcherStar"), projectile.damage, projectile.knockBack * 0.55f, projectile.owner, 0f, (float)Main.rand.Next(2)); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("ScorcherStar"), projectile.damage, projectile.knockBack * 0.55f, projectile.owner, 0f, Main.rand.Next(2)); } } } diff --git a/Projectiles/ShadowCutterPro.cs b/Projectiles/ShadowCutterPro.cs index 79c3cb76..88f50c39 100644 --- a/Projectiles/ShadowCutterPro.cs +++ b/Projectiles/ShadowCutterPro.cs @@ -58,7 +58,7 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) for(int k = 0; k < projectile.oldPos.Length; k++) { Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); - Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); + Color color = projectile.GetAlpha(lightColor) * ((projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); } return true; diff --git a/Projectiles/ShockwavePro.cs b/Projectiles/ShockwavePro.cs index e26e3cc3..5085d642 100644 --- a/Projectiles/ShockwavePro.cs +++ b/Projectiles/ShockwavePro.cs @@ -1,3 +1,4 @@ +using System; using Terraria; using Terraria.ModLoader; @@ -23,7 +24,7 @@ public override void SetStaticDefaults() public override void AI() { - projectile.rotation = (float)System.Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + 1.57f; if(Main.rand.Next(1) == 0) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 60, projectile.velocity.X * 0.9f, projectile.velocity.Y * 0.9f); diff --git a/Projectiles/SlimeFlailPro.cs b/Projectiles/SlimeFlailPro.cs index a19a6b81..8b2f2161 100644 --- a/Projectiles/SlimeFlailPro.cs +++ b/Projectiles/SlimeFlailPro.cs @@ -1,8 +1,6 @@ using System; - using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; - using Terraria; using Terraria.ModLoader; @@ -29,17 +27,17 @@ public override void SetStaticDefaults() } - public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Color lightColor) + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Texture2D texture = ModLoader.GetTexture("Tremor/Projectiles/SlimeFlail_Chain"); Vector2 position = projectile.Center; Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; - Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(); - Vector2 origin = new Vector2((float)texture.Width * 0.5f, (float)texture.Height * 0.5f); - float num1 = (float)texture.Height; + Rectangle? sourceRectangle = new Rectangle?(); + Vector2 origin = new Vector2(texture.Width * 0.5f, texture.Height * 0.5f); + float num1 = texture.Height; Vector2 vector2_4 = mountedCenter - position; - float rotation = (float)Math.Atan2((double)vector2_4.Y, (double)vector2_4.X) - 1.57f; + float rotation = (float)Math.Atan2(vector2_4.Y, vector2_4.X) - 1.57f; bool flag = true; if (float.IsNaN(position.X) && float.IsNaN(position.Y)) flag = false; @@ -47,7 +45,7 @@ public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch sprite flag = false; while (flag) { - if ((double)vector2_4.Length() < (double)num1 + 1.0) + if (vector2_4.Length() < num1 + 1.0) { flag = false; } @@ -57,7 +55,7 @@ public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch sprite vector2_1.Normalize(); position += vector2_1 * num1; vector2_4 = mountedCenter - position; - Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)position.X / 16, (int)((double)position.Y / 16.0)); + Color color2 = Lighting.GetColor((int)position.X / 16, (int)(position.Y / 16.0)); color2 = projectile.GetAlpha(color2); Main.spriteBatch.Draw(texture, position - Main.screenPosition, sourceRectangle, color2, rotation, origin, 1f, SpriteEffects.None, 0.0f); } diff --git a/Projectiles/SparkingFlaskEvil.cs b/Projectiles/SparkingFlaskEvil.cs index 58467a13..eca8bfa1 100644 --- a/Projectiles/SparkingFlaskEvil.cs +++ b/Projectiles/SparkingFlaskEvil.cs @@ -36,10 +36,10 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(3, 5); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("SparkingFlaskEvilTwo"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("SparkingFlaskEvilTwo"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } //} } diff --git a/Projectiles/SparkingFlaskEvilTwo.cs b/Projectiles/SparkingFlaskEvilTwo.cs index 7c7f0d27..77cfc136 100644 --- a/Projectiles/SparkingFlaskEvilTwo.cs +++ b/Projectiles/SparkingFlaskEvilTwo.cs @@ -36,10 +36,10 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(3, 5); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("SparkingCloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("SparkingCloudPro"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } //} } diff --git a/Projectiles/SpearofJusticePro.cs b/Projectiles/SpearofJusticePro.cs index 6a1850c8..9047893f 100644 --- a/Projectiles/SpearofJusticePro.cs +++ b/Projectiles/SpearofJusticePro.cs @@ -40,13 +40,13 @@ public override void Kill(int timeLeft) int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 59, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); if (Main.rand.Next(3) == 0) { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].type++; } else { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 1.2f + Main.rand.Next(-10, 11) * 0.01f; } Main.dust[num159].noGravity = true; Main.dust[num159].velocity *= 2.5f; @@ -57,14 +57,14 @@ public override void Kill(int timeLeft) int num160 = Main.rand.Next(0, 0); for (int num161 = 0; num161 < num160; num161++) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); while (value12.X == 0f && value12.Y == 0f) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); } value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); + value12 *= Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + projectile.width / 2, projectile.oldPosition.Y + projectile.height / 2, value12.X, value12.Y, 400, (int)(projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); } } } @@ -97,7 +97,6 @@ public override void AI() if (projectile.wet && !projectile.lavaWet) { projectile.Kill(); - return; } } } diff --git a/Projectiles/SpectreTaroCard.cs b/Projectiles/SpectreTaroCard.cs index 7fed7908..76e4f2a2 100644 --- a/Projectiles/SpectreTaroCard.cs +++ b/Projectiles/SpectreTaroCard.cs @@ -58,7 +58,7 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) for(int k = 0; k < projectile.oldPos.Length; k++) { Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); - Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); + Color color = projectile.GetAlpha(lightColor) * ((projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); } return true; diff --git a/Projectiles/SporeExplosion.cs b/Projectiles/SporeExplosion.cs index a2a94780..778b9fc4 100644 --- a/Projectiles/SporeExplosion.cs +++ b/Projectiles/SporeExplosion.cs @@ -74,12 +74,12 @@ public override void AI() num461 *= 0.7f; projectile.ai[0] += 4f; int num462 = 0; - while ((float)num462 < num461) + while (num462 < num461) { - float num463 = (float)Main.rand.Next(-10, 11); - float num464 = (float)Main.rand.Next(-10, 11); - float num465 = (float)Main.rand.Next(3, 9); - float num466 = (float)Math.Sqrt((double)(num463 * num463 + num464 * num464)); + float num463 = Main.rand.Next(-10, 11); + float num464 = Main.rand.Next(-10, 11); + float num465 = Main.rand.Next(3, 9); + float num466 = (float)Math.Sqrt(num463 * num463 + num464 * num464); num466 = num465 / num466; num463 *= num466; num464 *= num466; @@ -88,14 +88,13 @@ public override void AI() Main.dust[num467].position.X = projectile.Center.X; Main.dust[num467].position.Y = projectile.Center.Y; Dust expr_149DF_cp_0 = Main.dust[num467]; - expr_149DF_cp_0.position.X = expr_149DF_cp_0.position.X + (float)Main.rand.Next(-10, 11); + expr_149DF_cp_0.position.X = expr_149DF_cp_0.position.X + Main.rand.Next(-10, 11); Dust expr_14A09_cp_0 = Main.dust[num467]; - expr_14A09_cp_0.position.Y = expr_14A09_cp_0.position.Y + (float)Main.rand.Next(-10, 11); + expr_14A09_cp_0.position.Y = expr_14A09_cp_0.position.Y + Main.rand.Next(-10, 11); Main.dust[num467].velocity.X = num463; Main.dust[num467].velocity.Y = num464; num462++; } - return; } } diff --git a/Projectiles/StarNestPro.cs b/Projectiles/StarNestPro.cs index d5fcfa63..25fde3c1 100644 --- a/Projectiles/StarNestPro.cs +++ b/Projectiles/StarNestPro.cs @@ -1,3 +1,4 @@ +using System; using Terraria; using Terraria.ModLoader; @@ -22,7 +23,7 @@ public override void SetStaticDefaults() public override void AI() { - projectile.rotation = (float)System.Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + 1.57f; if(Main.rand.Next(1) == 0) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 57, projectile.velocity.X * 0.9f, projectile.velocity.Y * 0.9f); diff --git a/Projectiles/StarminePro.cs b/Projectiles/StarminePro.cs index fec27c1d..90e5b7a8 100644 --- a/Projectiles/StarminePro.cs +++ b/Projectiles/StarminePro.cs @@ -44,7 +44,7 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) for(int k = 0; k < projectile.oldPos.Length; k++) { Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); - Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); + Color color = projectile.GetAlpha(lightColor) * ((projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); } return true; @@ -53,12 +53,12 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) public override void Kill(int timeLeft) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.position.X = projectile.position.X + projectile.width / 2; + projectile.position.Y = projectile.position.Y + projectile.height / 2; projectile.width = 80; projectile.height = 80; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.position.X = projectile.position.X - projectile.width / 2; + projectile.position.Y = projectile.position.Y - projectile.height / 2; for (int num628 = 0; num628 < 40; num628++) { int num629 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); @@ -66,7 +66,7 @@ public override void Kill(int timeLeft) if (Main.rand.Next(2) == 0) { Main.dust[num629].scale = 0.5f; - Main.dust[num629].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num629].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } for (int num630 = 0; num630 < 70; num630++) @@ -88,36 +88,36 @@ public override void Kill(int timeLeft) { scaleFactor10 = 1f; } - int num633 = 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), 1.5f); + int num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1.5f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13E6D_cp_0 = Main.gore[num633]; expr_13E6D_cp_0.velocity.X = expr_13E6D_cp_0.velocity.X + 1f; Gore expr_13E8D_cp_0 = Main.gore[num633]; expr_13E8D_cp_0.velocity.Y = expr_13E8D_cp_0.velocity.Y + 1f; - num633 = 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); + num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 0.5f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13F30_cp_0 = Main.gore[num633]; expr_13F30_cp_0.velocity.X = expr_13F30_cp_0.velocity.X - 1f; Gore expr_13F50_cp_0 = Main.gore[num633]; expr_13F50_cp_0.velocity.Y = expr_13F50_cp_0.velocity.Y + 1f; - num633 = 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), 1.5f); + num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1.5f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13FF3_cp_0 = Main.gore[num633]; expr_13FF3_cp_0.velocity.X = expr_13FF3_cp_0.velocity.X + 1f; Gore expr_14013_cp_0 = Main.gore[num633]; expr_14013_cp_0.velocity.Y = expr_14013_cp_0.velocity.Y - 1f; - num633 = 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); + num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 0.5f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_140B6_cp_0 = Main.gore[num633]; expr_140B6_cp_0.velocity.X = expr_140B6_cp_0.velocity.X - 1f; Gore expr_140D6_cp_0 = Main.gore[num633]; expr_140D6_cp_0.velocity.Y = expr_140D6_cp_0.velocity.Y - 1f; } - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.position.X = projectile.position.X + projectile.width / 2; + projectile.position.Y = projectile.position.Y + projectile.height / 2; projectile.width = 10; projectile.height = 10; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.position.X = projectile.position.X - projectile.width / 2; + projectile.position.Y = projectile.position.Y - projectile.height / 2; } }} diff --git a/Projectiles/StickyFlailPro.cs b/Projectiles/StickyFlailPro.cs index 8136827f..f7e0eb42 100644 --- a/Projectiles/StickyFlailPro.cs +++ b/Projectiles/StickyFlailPro.cs @@ -1,8 +1,6 @@ using System; - using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; - using Terraria; using Terraria.ModLoader; @@ -29,17 +27,17 @@ public override void SetStaticDefaults() } - public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Color lightColor) + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Texture2D texture = ModLoader.GetTexture("Tremor/Projectiles/StickyFlail_Chain"); Vector2 position = projectile.Center; Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; - Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(); - Vector2 origin = new Vector2((float)texture.Width * 0.5f, (float)texture.Height * 0.5f); - float num1 = (float)texture.Height; + Rectangle? sourceRectangle = new Rectangle?(); + Vector2 origin = new Vector2(texture.Width * 0.5f, texture.Height * 0.5f); + float num1 = texture.Height; Vector2 vector2_4 = mountedCenter - position; - float rotation = (float)Math.Atan2((double)vector2_4.Y, (double)vector2_4.X) - 1.57f; + float rotation = (float)Math.Atan2(vector2_4.Y, vector2_4.X) - 1.57f; bool flag = true; if (float.IsNaN(position.X) && float.IsNaN(position.Y)) flag = false; @@ -47,7 +45,7 @@ public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch sprite flag = false; while (flag) { - if ((double)vector2_4.Length() < (double)num1 + 1.0) + if (vector2_4.Length() < num1 + 1.0) { flag = false; } @@ -57,7 +55,7 @@ public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch sprite vector2_1.Normalize(); position += vector2_1 * num1; vector2_4 = mountedCenter - position; - Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)position.X / 16, (int)((double)position.Y / 16.0)); + Color color2 = Lighting.GetColor((int)position.X / 16, (int)(position.Y / 16.0)); color2 = projectile.GetAlpha(color2); Main.spriteBatch.Draw(texture, position - Main.screenPosition, sourceRectangle, color2, rotation, origin, 1f, SpriteEffects.None, 0.0f); } diff --git a/Projectiles/SuperBigCannonPro.cs b/Projectiles/SuperBigCannonPro.cs index 5d361d4a..f6540009 100644 --- a/Projectiles/SuperBigCannonPro.cs +++ b/Projectiles/SuperBigCannonPro.cs @@ -23,12 +23,12 @@ public override void SetStaticDefaults() public override void Kill(int timeLeft) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.position.X = projectile.position.X + projectile.width / 2; + projectile.position.Y = projectile.position.Y + projectile.height / 2; projectile.width = 80; projectile.height = 80; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.position.X = projectile.position.X - projectile.width / 2; + projectile.position.Y = projectile.position.Y - projectile.height / 2; for (int num628 = 0; num628 < 40; num628++) { int num629 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); @@ -36,7 +36,7 @@ public override void Kill(int timeLeft) if (Main.rand.Next(2) == 0) { Main.dust[num629].scale = 0.5f; - Main.dust[num629].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num629].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } for (int num630 = 0; num630 < 70; num630++) @@ -58,37 +58,37 @@ public override void Kill(int timeLeft) { scaleFactor10 = 1f; } - int num633 = 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 num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13E6D_cp_0 = Main.gore[num633]; expr_13E6D_cp_0.velocity.X = expr_13E6D_cp_0.velocity.X + 1f; Gore expr_13E8D_cp_0 = Main.gore[num633]; expr_13E8D_cp_0.velocity.Y = expr_13E8D_cp_0.velocity.Y + 1f; - num633 = 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); + num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13F30_cp_0 = Main.gore[num633]; expr_13F30_cp_0.velocity.X = expr_13F30_cp_0.velocity.X - 1f; Gore expr_13F50_cp_0 = Main.gore[num633]; expr_13F50_cp_0.velocity.Y = expr_13F50_cp_0.velocity.Y + 1f; - num633 = 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); + num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13FF3_cp_0 = Main.gore[num633]; expr_13FF3_cp_0.velocity.X = expr_13FF3_cp_0.velocity.X + 1f; Gore expr_14013_cp_0 = Main.gore[num633]; expr_14013_cp_0.velocity.Y = expr_14013_cp_0.velocity.Y - 1f; - num633 = 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); + num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_140B6_cp_0 = Main.gore[num633]; expr_140B6_cp_0.velocity.X = expr_140B6_cp_0.velocity.X - 1f; Gore expr_140D6_cp_0 = Main.gore[num633]; expr_140D6_cp_0.velocity.Y = expr_140D6_cp_0.velocity.Y - 1f; } - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.position.X = projectile.position.X + projectile.width / 2; + projectile.position.Y = projectile.position.Y + projectile.height / 2; projectile.width = 10; projectile.height = 10; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.position.X = projectile.position.X - projectile.width / 2; + projectile.position.Y = projectile.position.Y - projectile.height / 2; } }} diff --git a/Projectiles/TheBoogerBallPro.cs b/Projectiles/TheBoogerBallPro.cs index 029c9459..8c44f927 100644 --- a/Projectiles/TheBoogerBallPro.cs +++ b/Projectiles/TheBoogerBallPro.cs @@ -50,7 +50,6 @@ public override void AI() { projectile.alpha = 255; projectile.Kill(); - return; } } diff --git a/Projectiles/TheBoogerPro.cs b/Projectiles/TheBoogerPro.cs index 0b51d195..2ee4735b 100644 --- a/Projectiles/TheBoogerPro.cs +++ b/Projectiles/TheBoogerPro.cs @@ -1,8 +1,6 @@ using System; - using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; - using Terraria; using Terraria.ModLoader; @@ -78,23 +76,23 @@ public override void AI() { Vector2 vector64 = vector63 * -1f; vector64.Normalize(); - vector64 *= (float)Main.rand.Next(5, 25) * 0.9f; + vector64 *= Main.rand.Next(5, 25) * 0.9f; Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vector64.X, vector64.Y, mod.ProjectileType("TheBoogerBallPro"), projectile.damage/4, projectile.knockBack, projectile.owner, -10f, 0f); } } - public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Color lightColor) + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Texture2D texture = ModLoader.GetTexture("Tremor/Projectiles/TheBooger_Chain"); Vector2 position = projectile.Center; Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; - Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(); - Vector2 origin = new Vector2((float)texture.Width * 0.5f, (float)texture.Height * 0.5f); - float num1 = (float)texture.Height; + Rectangle? sourceRectangle = new Rectangle?(); + Vector2 origin = new Vector2(texture.Width * 0.5f, texture.Height * 0.5f); + float num1 = texture.Height; Vector2 vector2_4 = mountedCenter - position; - float rotation = (float)Math.Atan2((double)vector2_4.Y, (double)vector2_4.X) - 1.57f; + float rotation = (float)Math.Atan2(vector2_4.Y, vector2_4.X) - 1.57f; bool flag = true; if (float.IsNaN(position.X) && float.IsNaN(position.Y)) flag = false; @@ -102,7 +100,7 @@ public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch sprite flag = false; while (flag) { - if ((double)vector2_4.Length() < (double)num1 + 1.0) + if (vector2_4.Length() < num1 + 1.0) { flag = false; } @@ -112,7 +110,7 @@ public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch sprite vector2_1.Normalize(); position += vector2_1 * num1; vector2_4 = mountedCenter - position; - Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)position.X / 16, (int)((double)position.Y / 16.0)); + Color color2 = Lighting.GetColor((int)position.X / 16, (int)(position.Y / 16.0)); color2 = projectile.GetAlpha(color2); Main.spriteBatch.Draw(texture, position - Main.screenPosition, sourceRectangle, color2, rotation, origin, 1f, SpriteEffects.None, 0.0f); } diff --git a/Projectiles/TheCadenceProj.cs b/Projectiles/TheCadenceProj.cs index 0a6ca371..b438de5e 100644 --- a/Projectiles/TheCadenceProj.cs +++ b/Projectiles/TheCadenceProj.cs @@ -47,7 +47,7 @@ public override void AI() { Dust dust4 = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 172, projectile.velocity.X, projectile.velocity.Y, 100, default(Color), 1f)]; dust4.velocity = Vector2.Zero; - dust4.position -= projectile.velocity / 5f * (float)num121; + dust4.position -= projectile.velocity / 5f * num121; dust4.noGravity = true; dust4.scale = 0.8f; dust4.noLight = true; diff --git a/Projectiles/TheGhostClaymorePro.cs b/Projectiles/TheGhostClaymorePro.cs index dad1c7e4..4087c3d6 100644 --- a/Projectiles/TheGhostClaymorePro.cs +++ b/Projectiles/TheGhostClaymorePro.cs @@ -40,13 +40,13 @@ public override void Kill(int timeLeft) int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 59, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); if (Main.rand.Next(3) == 0) { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].type++; } else { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 1.2f + Main.rand.Next(-10, 11) * 0.01f; } Main.dust[num159].noGravity = true; Main.dust[num159].velocity *= 2.5f; @@ -57,14 +57,14 @@ public override void Kill(int timeLeft) int num160 = Main.rand.Next(0, 0); for (int num161 = 0; num161 < num160; num161++) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); while (value12.X == 0f && value12.Y == 0f) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); } value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); + value12 *= Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + projectile.width / 2, projectile.oldPosition.Y + projectile.height / 2, value12.X, value12.Y, 400, (int)(projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); } } } @@ -97,7 +97,6 @@ public override void AI() if (projectile.wet && !projectile.lavaWet) { projectile.Kill(); - return; } } } diff --git a/Projectiles/TikiSoulPro.cs b/Projectiles/TikiSoulPro.cs index 5fe8856b..2b07d73e 100644 --- a/Projectiles/TikiSoulPro.cs +++ b/Projectiles/TikiSoulPro.cs @@ -36,15 +36,15 @@ public override void AI() for (int num449 = 0; num449 < 4; num449++) { Vector2 vector34 = projectile.position; - vector34 -= projectile.velocity * ((float)num449 * 0.25f); + vector34 -= projectile.velocity * (num449 * 0.25f); projectile.alpha = 255; int num450 = Dust.NewDust(vector34, 1, 1, 62, 0f, 0f, 0, default(Color), 1f); Main.dust[num450].position = vector34; Dust expr_13F6C_cp_0 = Main.dust[num450]; - expr_13F6C_cp_0.position.X = expr_13F6C_cp_0.position.X + (float)(projectile.width / 2); + expr_13F6C_cp_0.position.X = expr_13F6C_cp_0.position.X + projectile.width / 2; Dust expr_13F90_cp_0 = Main.dust[num450]; - expr_13F90_cp_0.position.Y = expr_13F90_cp_0.position.Y + (float)(projectile.height / 2); - Main.dust[num450].scale = (float)Main.rand.Next(70, 110) * 0.013f; + expr_13F90_cp_0.position.Y = expr_13F90_cp_0.position.Y + projectile.height / 2; + Main.dust[num450].scale = Main.rand.Next(70, 110) * 0.013f; Main.dust[num450].velocity *= 0.2f; } } diff --git a/Projectiles/TremorProjectiles.cs b/Projectiles/TremorProjectiles.cs index 10f40fbb..391f0a71 100644 --- a/Projectiles/TremorProjectiles.cs +++ b/Projectiles/TremorProjectiles.cs @@ -1,6 +1,6 @@ +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.Projectiles { @@ -11,7 +11,7 @@ public override void SetDefaults(Projectile projectile) { if (Main.gameMenu) return; - if (projectile.minion == true && Main.player[Main.myPlayer].active && Main.player[Main.myPlayer].FindBuffIndex(mod.BuffType("ZephyrhornBuff")) != -1) + if (projectile.minion && Main.player[Main.myPlayer].active && Main.player[Main.myPlayer].FindBuffIndex(mod.BuffType("ZephyrhornBuff")) != -1) { projectile.scale = 1.5f; projectile.width *= (int)1.5f; diff --git a/Projectiles/TrueBladeOne.cs b/Projectiles/TrueBladeOne.cs index d82d56c1..eabc0aef 100644 --- a/Projectiles/TrueBladeOne.cs +++ b/Projectiles/TrueBladeOne.cs @@ -1,6 +1,6 @@ -using Terraria.ModLoader; -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ModLoader; namespace Tremor.Projectiles { @@ -9,7 +9,7 @@ public class TrueBladeOne : ModProjectile const float RotationSpeed = 0.05f; const float Distanse = 50; - float Rotation = 0; + float Rotation; public override void SetDefaults() { diff --git a/Projectiles/TrueBladeThree.cs b/Projectiles/TrueBladeThree.cs index 906e9482..c76bd6cb 100644 --- a/Projectiles/TrueBladeThree.cs +++ b/Projectiles/TrueBladeThree.cs @@ -1,6 +1,6 @@ -using Terraria.ModLoader; -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ModLoader; namespace Tremor.Projectiles { @@ -9,7 +9,7 @@ public class TrueBladeThree : ModProjectile const float RotationSpeed = 0.05f; const float Distanse = 150; - float Rotation = 0; + float Rotation; public override Color? GetAlpha(Color lightColor) { diff --git a/Projectiles/TrueBladeTwo.cs b/Projectiles/TrueBladeTwo.cs index 37a25710..7662341f 100644 --- a/Projectiles/TrueBladeTwo.cs +++ b/Projectiles/TrueBladeTwo.cs @@ -1,6 +1,6 @@ -using Terraria.ModLoader; -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ModLoader; namespace Tremor.Projectiles { @@ -9,7 +9,7 @@ public class TrueBladeTwo : ModProjectile const float RotationSpeed = 0.05f; const float Distanse = 100; - float Rotation = 0; + float Rotation; public override void SetDefaults() { diff --git a/Projectiles/TrueBloodCarnage.cs b/Projectiles/TrueBloodCarnage.cs index ce4b6c2d..0b8baa93 100644 --- a/Projectiles/TrueBloodCarnage.cs +++ b/Projectiles/TrueBloodCarnage.cs @@ -58,7 +58,7 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) for(int k = 0; k < projectile.oldPos.Length; k++) { Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); - Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); + Color color = projectile.GetAlpha(lightColor) * ((projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); } return true; diff --git a/Projectiles/TrueDeathSickleProj.cs b/Projectiles/TrueDeathSickleProj.cs index a0538504..21831109 100644 --- a/Projectiles/TrueDeathSickleProj.cs +++ b/Projectiles/TrueDeathSickleProj.cs @@ -52,10 +52,10 @@ public override void AI() Vector2 vector = player.RotatedRelativePoint(player.MountedCenter, true); float scaleFactor = player.inventory[player.selectedItem].shootSpeed * projectile.scale; Vector2 value2 = vector; - Vector2 value3 = Main.screenPosition + new Vector2((float)Main.mouseX, (float)Main.mouseY) - value2; + Vector2 value3 = Main.screenPosition + new Vector2(Main.mouseX, Main.mouseY) - value2; if (player.gravDir == -1f) { - value3.Y = (float)(Main.screenHeight - Main.mouseY) + Main.screenPosition.Y - value2.Y; + value3.Y = Main.screenHeight - Main.mouseY + Main.screenPosition.Y - value2.Y; } Vector2 vector3 = Vector2.Normalize(value3); if (float.IsNaN(vector3.X) || float.IsNaN(vector3.Y)) @@ -71,7 +71,7 @@ public override void AI() int num6 = 274; float scaleFactor2 = 14f; int num7 = 7; - value2 = projectile.Center + new Vector2((float)Main.rand.Next(-num7, num7 + 1), (float)Main.rand.Next(-num7, num7 + 1)); + value2 = projectile.Center + new Vector2(Main.rand.Next(-num7, num7 + 1), 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)); if (float.IsNaN(spinningpoint.X) || float.IsNaN(spinningpoint.Y)) diff --git a/Projectiles/TyphoonPro.cs b/Projectiles/TyphoonPro.cs index 1daf0d95..f55b3828 100644 --- a/Projectiles/TyphoonPro.cs +++ b/Projectiles/TyphoonPro.cs @@ -58,20 +58,20 @@ public override void AI() if (projectile.localAI[0] == 0f) { projectile.localAI[0] = 1f; - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); - projectile.scale = ((float)(num613 + num614) - projectile.ai[1]) * num615 / (float)(num614 + num613); - projectile.width = (int)((float)num616 * projectile.scale); - projectile.height = (int)((float)num617 * projectile.scale); - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.position.X = projectile.position.X + projectile.width / 2; + projectile.position.Y = projectile.position.Y + projectile.height / 2; + projectile.scale = (num613 + num614 - projectile.ai[1]) * num615 / (num614 + num613); + projectile.width = (int)(num616 * projectile.scale); + projectile.height = (int)(num617 * projectile.scale); + projectile.position.X = projectile.position.X - projectile.width / 2; + projectile.position.Y = projectile.position.Y - projectile.height / 2; projectile.netUpdate = true; } if (projectile.ai[1] != -1f) { - projectile.scale = ((float)(num613 + num614) - projectile.ai[1]) * num615 / (float)(num614 + num613); - projectile.width = (int)((float)num616 * projectile.scale); - projectile.height = (int)((float)num617 * projectile.scale); + projectile.scale = (num613 + num614 - projectile.ai[1]) * num615 / (num614 + num613); + projectile.width = (int)(num616 * projectile.scale); + projectile.height = (int)(num617 * projectile.scale); } if (!Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) { @@ -97,22 +97,21 @@ public override void AI() { projectile.netUpdate = true; Vector2 center = projectile.Center; - center.Y -= (float)num617 * projectile.scale / 2f; - float num618 = ((float)(num613 + num614) - projectile.ai[1] + 1f) * num615 / (float)(num614 + num613); - center.Y -= (float)num617 * num618 / 2f; + center.Y -= num617 * projectile.scale / 2f; + float num618 = (num613 + num614 - projectile.ai[1] + 1f) * num615 / (num614 + num613); + center.Y -= num617 * num618 / 2f; center.Y += 2f; Projectile.NewProjectile(center.X, center.Y, projectile.velocity.X, projectile.velocity.Y, projectile.type, projectile.damage, projectile.knockBack, projectile.owner, 10f, projectile.ai[1] - 1f); } if (projectile.ai[0] <= 0f) { float num622 = 0.104719758f; - float num623 = (float)projectile.width / 5f; - float num624 = (float)(Math.Cos((double)(num622 * -(double)projectile.ai[0])) - 0.5) * num623; - projectile.position.X = projectile.position.X - num624 * (float)(-(float)projectile.direction); + float num623 = projectile.width / 5f; + float num624 = (float)(Math.Cos(num622 * -(double)projectile.ai[0]) - 0.5) * num623; + projectile.position.X = projectile.position.X - num624 * -(float)projectile.direction; projectile.ai[0] -= 1f; - num624 = (float)(Math.Cos((double)(num622 * -(double)projectile.ai[0])) - 0.5) * num623; - projectile.position.X = projectile.position.X + num624 * (float)(-(float)projectile.direction); - return; + num624 = (float)(Math.Cos(num622 * -(double)projectile.ai[0]) - 0.5) * num623; + projectile.position.X = projectile.position.X + num624 * -(float)projectile.direction; } } diff --git a/Projectiles/VindicatorProj.cs b/Projectiles/VindicatorProj.cs index 41021107..1286462b 100644 --- a/Projectiles/VindicatorProj.cs +++ b/Projectiles/VindicatorProj.cs @@ -46,14 +46,14 @@ public override void AI() { num263 = Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].shootSpeed * projectile.scale; vector23 = vector22; - num264 = (float)Main.mouseX + Main.screenPosition.X - vector23.X - 20; - num265 = (float)Main.mouseY + Main.screenPosition.Y - vector23.Y; + num264 = Main.mouseX + Main.screenPosition.X - vector23.X - 20; + num265 = Main.mouseY + Main.screenPosition.Y - vector23.Y; if (Main.player[projectile.owner].gravDir == -1f) { - num265 = (float)(Main.screenHeight - Main.mouseY) + Main.screenPosition.Y - vector23.Y; + num265 = Main.screenHeight - Main.mouseY + Main.screenPosition.Y - vector23.Y; } - num266 = (float)Math.Sqrt((double)(num264 * num264 + num265 * num265)); - num266 = (float)Math.Sqrt((double)(num264 * num264 + num265 * num265)); + num266 = (float)Math.Sqrt(num264 * num264 + num265 * num265); + num266 = (float)Math.Sqrt(num264 * num264 + num265 * num265); num266 = num263 / num266; num264 *= num266; num265 *= num266; @@ -82,18 +82,18 @@ public override void AI() Main.player[projectile.owner].heldProj = projectile.whoAmI; Main.player[projectile.owner].itemTime = 2; Main.player[projectile.owner].itemAnimation = 2; - projectile.position.X = vector22.X - (float)(projectile.width / 2); - projectile.position.Y = vector22.Y - (float)(projectile.height / 2); - projectile.rotation = (float)(Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.5700000524520874); + projectile.position.X = vector22.X - projectile.width / 2; + projectile.position.Y = vector22.Y - projectile.height / 2; + projectile.rotation = (float)(Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + 1.5700000524520874); if (Main.player[projectile.owner].direction == 1) { - Main.player[projectile.owner].itemRotation = (float)Math.Atan2((double)(projectile.velocity.Y * (float)projectile.direction), (double)(projectile.velocity.X * (float)projectile.direction)); + Main.player[projectile.owner].itemRotation = (float)Math.Atan2(projectile.velocity.Y * projectile.direction, projectile.velocity.X * projectile.direction); } else { - Main.player[projectile.owner].itemRotation = (float)Math.Atan2((double)(projectile.velocity.Y * (float)projectile.direction), (double)(projectile.velocity.X * (float)projectile.direction)); + Main.player[projectile.owner].itemRotation = (float)Math.Atan2(projectile.velocity.Y * projectile.direction, projectile.velocity.X * projectile.direction); } - projectile.velocity.X = projectile.velocity.X * (1f + (float)Main.rand.Next(-3, 4) * 0.01f); + projectile.velocity.X = projectile.velocity.X * (1f + Main.rand.Next(-3, 4) * 0.01f); Player player = Main.player[projectile.owner]; float num = 1.57079637f; Vector2 vector = player.RotatedRelativePoint(player.MountedCenter, true); @@ -115,7 +115,7 @@ public override void AI() int num4 = 6; projectile.ai[1] += 1f; bool flag = false; - if (projectile.ai[1] >= (float)(num3 - num4 * num2)) + if (projectile.ai[1] >= num3 - num4 * num2) { projectile.ai[1] = 0f; flag = true; @@ -141,7 +141,7 @@ public override void AI() 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(projectile.rotation - 1.57079637f, default(Vector2)); Vector2 value = projectile.Center + vector2; for (int i = 0; i < 2; i++) { @@ -158,10 +158,10 @@ public override void AI() { float scaleFactor = player.inventory[player.selectedItem].shootSpeed * projectile.scale; Vector2 value2 = vector; - Vector2 value3 = Main.screenPosition + new Vector2((float)Main.mouseX, (float)Main.mouseY) - value2; + Vector2 value3 = Main.screenPosition + new Vector2(Main.mouseX, Main.mouseY) - value2; if (player.gravDir == -1f) { - value3.Y = (float)(Main.screenHeight - Main.mouseY) + Main.screenPosition.Y - value2.Y; + value3.Y = Main.screenHeight - Main.mouseY + Main.screenPosition.Y - value2.Y; } Vector2 vector3 = Vector2.Normalize(value3); if (float.IsNaN(vector3.X) || float.IsNaN(vector3.Y)) @@ -179,7 +179,7 @@ public override void AI() int num7 = 7; for (int j = 0; j < 2; j++) { - value2 = projectile.Center + new Vector2((float)Main.rand.Next(-num7, num7 + 1), (float)Main.rand.Next(-num7, num7 + 1)); + value2 = projectile.Center + new Vector2(Main.rand.Next(-num7, num7 + 1), 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)); if (float.IsNaN(spinningpoint.X) || float.IsNaN(spinningpoint.Y)) diff --git a/Projectiles/VoidBladePro.cs b/Projectiles/VoidBladePro.cs index f5395fa6..41bba13e 100644 --- a/Projectiles/VoidBladePro.cs +++ b/Projectiles/VoidBladePro.cs @@ -39,13 +39,13 @@ public override void Kill(int timeLeft) int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 226, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 1.5f); if (Main.rand.Next(3) == 0) { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].type++; } else { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 1.2f + Main.rand.Next(-10, 11) * 0.01f; } Main.dust[num159].noGravity = true; Main.dust[num159].velocity *= 2.5f; @@ -56,14 +56,14 @@ public override void Kill(int timeLeft) int num160 = Main.rand.Next(0, 0); for (int num161 = 0; num161 < num160; num161++) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); while (value12.X == 0f && value12.Y == 0f) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); } value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 2.8f, projectile.owner, 0f, 0f); + value12 *= Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + projectile.width / 2, projectile.oldPosition.Y + projectile.height / 2, value12.X, value12.Y, 400, (int)(projectile.damage * 0.8), projectile.knockBack * 2.8f, projectile.owner, 0f, 0f); } } } @@ -114,7 +114,7 @@ public override void AI() { Vector2 vector64 = vector63 * -1f; vector64.Normalize(); - vector64 *= (float)Main.rand.Next(5, 25) * 0.9f; + vector64 *= Main.rand.Next(5, 25) * 0.9f; Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vector64.X, vector64.Y, mod.ProjectileType("VoidRingPro"), projectile.damage/2, projectile.knockBack, projectile.owner, -10f, 0f); } @@ -128,7 +128,7 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) for(int k = 0; k < projectile.oldPos.Length; k++) { Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); - Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); + Color color = projectile.GetAlpha(lightColor) * ((projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); } return true; diff --git a/Projectiles/VoidRingPro.cs b/Projectiles/VoidRingPro.cs index 57d4f838..4f9fe6ac 100644 --- a/Projectiles/VoidRingPro.cs +++ b/Projectiles/VoidRingPro.cs @@ -35,7 +35,7 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) for(int k = 0; k < projectile.oldPos.Length; k++) { Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); - Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); + Color color = projectile.GetAlpha(lightColor) * ((projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); } return true; @@ -48,13 +48,13 @@ public override void Kill(int timeLeft) int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 226, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.3f); if (Main.rand.Next(3) == 0) { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].type++; } else { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 1.2f + Main.rand.Next(-10, 11) * 0.01f; } Main.dust[num159].noGravity = true; Main.dust[num159].velocity *= 2.5f; @@ -65,14 +65,14 @@ public override void Kill(int timeLeft) int num160 = Main.rand.Next(0, 0); for (int num161 = 0; num161 < num160; num161++) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); while (value12.X == 0f && value12.Y == 0f) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); } value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 2.8f, projectile.owner, 0f, 0f); + value12 *= Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + projectile.width / 2, projectile.oldPosition.Y + projectile.height / 2, value12.X, value12.Y, 400, (int)(projectile.damage * 0.8), projectile.knockBack * 2.8f, projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/VulcanBladePro.cs b/Projectiles/VulcanBladePro.cs index b9703c77..9a128139 100644 --- a/Projectiles/VulcanBladePro.cs +++ b/Projectiles/VulcanBladePro.cs @@ -38,13 +38,13 @@ public override void Kill(int timeLeft) int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 1.5f); if (Main.rand.Next(3) == 0) { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].type++; } else { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 1.2f + Main.rand.Next(-10, 11) * 0.01f; } Main.dust[num159].noGravity = true; Main.dust[num159].velocity *= 2.5f; @@ -55,14 +55,14 @@ public override void Kill(int timeLeft) int num160 = Main.rand.Next(0, 0); for (int num161 = 0; num161 < num160; num161++) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); while (value12.X == 0f && value12.Y == 0f) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); } value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 2.8f, projectile.owner, 0f, 0f); + value12 *= Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + projectile.width / 2, projectile.oldPosition.Y + projectile.height / 2, value12.X, value12.Y, 400, (int)(projectile.damage * 0.8), projectile.knockBack * 2.8f, projectile.owner, 0f, 0f); } } } @@ -113,7 +113,7 @@ public override void AI() { Vector2 vector64 = vector63 * -1f; vector64.Normalize(); - vector64 *= (float)Main.rand.Next(5, 25) * 0.9f; + vector64 *= Main.rand.Next(5, 25) * 0.9f; Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vector64.X, vector64.Y, mod.ProjectileType("VulcanBladeRing"), projectile.damage/2, projectile.knockBack, projectile.owner, -10f, 0f); } diff --git a/Projectiles/VulcanBladeRing.cs b/Projectiles/VulcanBladeRing.cs index 08cbc3c7..72cfc21f 100644 --- a/Projectiles/VulcanBladeRing.cs +++ b/Projectiles/VulcanBladeRing.cs @@ -36,7 +36,7 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) for(int k = 0; k < projectile.oldPos.Length; k++) { Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); - Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); + Color color = projectile.GetAlpha(lightColor) * ((projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); } return true; @@ -58,12 +58,12 @@ public override void AI() public override void Kill(int timeLeft) { - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.position.X = projectile.position.X + projectile.width / 2; + projectile.position.Y = projectile.position.Y + projectile.height / 2; projectile.width = 80; projectile.height = 80; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.position.X = projectile.position.X - projectile.width / 2; + projectile.position.Y = projectile.position.Y - projectile.height / 2; for (int num628 = 0; num628 < 40; num628++) { int num629 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); @@ -71,7 +71,7 @@ public override void Kill(int timeLeft) if (Main.rand.Next(2) == 0) { Main.dust[num629].scale = 0.5f; - Main.dust[num629].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num629].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } for (int num630 = 0; num630 < 70; num630++) @@ -93,47 +93,47 @@ public override void Kill(int timeLeft) { scaleFactor10 = 1f; } - int num633 = 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 num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13E6D_cp_0 = Main.gore[num633]; expr_13E6D_cp_0.velocity.X = expr_13E6D_cp_0.velocity.X + 1f; Gore expr_13E8D_cp_0 = Main.gore[num633]; expr_13E8D_cp_0.velocity.Y = expr_13E8D_cp_0.velocity.Y + 1f; - num633 = 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), 2f); + num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 2f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13F30_cp_0 = Main.gore[num633]; expr_13F30_cp_0.velocity.X = expr_13F30_cp_0.velocity.X - 1f; Gore expr_13F50_cp_0 = Main.gore[num633]; expr_13F50_cp_0.velocity.Y = expr_13F50_cp_0.velocity.Y + 1f; - num633 = 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); + num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_13FF3_cp_0 = Main.gore[num633]; expr_13FF3_cp_0.velocity.X = expr_13FF3_cp_0.velocity.X + 1f; Gore expr_14013_cp_0 = Main.gore[num633]; expr_14013_cp_0.velocity.Y = expr_14013_cp_0.velocity.Y - 1f; - num633 = 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); + num633 = Gore.NewGore(new Vector2(projectile.position.X + projectile.width / 2 - 24f, projectile.position.Y + projectile.height / 2 - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); Main.gore[num633].velocity *= scaleFactor10; Gore expr_140B6_cp_0 = Main.gore[num633]; expr_140B6_cp_0.velocity.X = expr_140B6_cp_0.velocity.X - 1f; Gore expr_140D6_cp_0 = Main.gore[num633]; expr_140D6_cp_0.velocity.Y = expr_140D6_cp_0.velocity.Y - 1f; } - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.position.X = projectile.position.X + projectile.width / 2; + projectile.position.Y = projectile.position.Y + projectile.height / 2; projectile.width = 10; projectile.height = 10; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.position.X = projectile.position.X - projectile.width / 2; + projectile.position.Y = projectile.position.Y - projectile.height / 2; if (projectile.owner == Main.myPlayer) { int num220 = Main.rand.Next(3, 8); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("BoomCloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("BoomCloudPro"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } diff --git a/Projectiles/VultureFeather.cs b/Projectiles/VultureFeather.cs index 788722f2..7492f3ce 100644 --- a/Projectiles/VultureFeather.cs +++ b/Projectiles/VultureFeather.cs @@ -1,12 +1,13 @@ using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Projectiles { public class VultureFeather : ModProjectile { - const int TileCollideDustType = Terraria.ID.DustID.Tin; + const int TileCollideDustType = DustID.Tin; const int TileCollideDustCount = 4; const float TileCollideDustSpeedMulti = 0.2f; diff --git a/Projectiles/WallOfShadowsFlask_Proj.cs b/Projectiles/WallOfShadowsFlask_Proj.cs index f37833fd..03063968 100644 --- a/Projectiles/WallOfShadowsFlask_Proj.cs +++ b/Projectiles/WallOfShadowsFlask_Proj.cs @@ -1,8 +1,8 @@ using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework.Graphics; namespace Tremor.Projectiles { @@ -33,7 +33,7 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) for (int k = 0; k < projectile.oldPos.Length; k++) { Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); - Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); + Color color = projectile.GetAlpha(lightColor) * ((projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); } return true; @@ -49,10 +49,10 @@ public override void Kill(int timeLeft) int num220 = Main.rand.Next(4, 10); for (int num221 = 0; num221 < num220; num221++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value17 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("WallOfShadowsBoom"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + value17 *= Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("WallOfShadowsBoom"), projectile.damage, 1f, projectile.owner, 0f, Main.rand.Next(-45, 1)); } } } diff --git a/Projectiles/WhiteGoldDagger.cs b/Projectiles/WhiteGoldDagger.cs index ba77a94d..63ce9af5 100644 --- a/Projectiles/WhiteGoldDagger.cs +++ b/Projectiles/WhiteGoldDagger.cs @@ -40,13 +40,13 @@ public override void Kill(int timeLeft) int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 57, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); if (Main.rand.Next(3) == 0) { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].type++; } else { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 1.2f + Main.rand.Next(-10, 11) * 0.01f; } Main.dust[num159].noGravity = true; Main.dust[num159].velocity *= 2.5f; @@ -57,14 +57,14 @@ public override void Kill(int timeLeft) int num160 = Main.rand.Next(0, 0); for (int num161 = 0; num161 < num160; num161++) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); while (value12.X == 0f && value12.Y == 0f) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); } value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); + value12 *= Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + projectile.width / 2, projectile.oldPosition.Y + projectile.height / 2, value12.X, value12.Y, 400, (int)(projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/WhiteGoldKnife.cs b/Projectiles/WhiteGoldKnife.cs index 09001f94..429cff8b 100644 --- a/Projectiles/WhiteGoldKnife.cs +++ b/Projectiles/WhiteGoldKnife.cs @@ -40,13 +40,13 @@ public override void Kill(int timeLeft) int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 57, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); if (Main.rand.Next(3) == 0) { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].type++; } else { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 1.2f + Main.rand.Next(-10, 11) * 0.01f; } Main.dust[num159].noGravity = true; Main.dust[num159].velocity *= 2.5f; @@ -57,14 +57,14 @@ public override void Kill(int timeLeft) int num160 = Main.rand.Next(0, 0); for (int num161 = 0; num161 < num160; num161++) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); while (value12.X == 0f && value12.Y == 0f) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); } value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); + value12 *= Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + projectile.width / 2, projectile.oldPosition.Y + projectile.height / 2, value12.X, value12.Y, 400, (int)(projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/WraithWrathPro.cs b/Projectiles/WraithWrathPro.cs index 6b940395..c3ba682d 100644 --- a/Projectiles/WraithWrathPro.cs +++ b/Projectiles/WraithWrathPro.cs @@ -50,7 +50,6 @@ public override void AI() if (projectile.wet && !projectile.lavaWet) { projectile.Kill(); - return; } } } @@ -63,13 +62,13 @@ public override void Kill(int timeLeft) int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 54, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); if (Main.rand.Next(3) == 0) { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].fadeIn = 1.1f + Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + Main.rand.Next(-10, 11) * 0.01f; Main.dust[num159].type++; } else { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 1.2f + Main.rand.Next(-10, 11) * 0.01f; } Main.dust[num159].noGravity = true; Main.dust[num159].velocity *= 2.5f; @@ -80,14 +79,14 @@ public override void Kill(int timeLeft) int num160 = Main.rand.Next(3, 6); for (int num161 = 0; num161 < num160; num161++) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); while (value12.X == 0f && value12.Y == 0f) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value12 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); } value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, mod.ProjectileType("WraithCloud"), (int)((double)projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); + value12 *= Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + projectile.width / 2, projectile.oldPosition.Y + projectile.height / 2, value12.X, value12.Y, mod.ProjectileType("WraithCloud"), (int)(projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/ZootalooRodPro.cs b/Projectiles/ZootalooRodPro.cs index 5ffd2fb9..021b9802 100644 --- a/Projectiles/ZootalooRodPro.cs +++ b/Projectiles/ZootalooRodPro.cs @@ -43,7 +43,6 @@ public override void AI() Main.dust[num458].velocity *= 0.5f; Main.dust[num458].velocity += projectile.velocity * 0.1f; } - return; } public override bool OnTileCollide(Vector2 oldVelocity) diff --git a/Projectiles/projClamperLaser.cs b/Projectiles/projClamperLaser.cs index 1c8c0b84..69f99e09 100644 --- a/Projectiles/projClamperLaser.cs +++ b/Projectiles/projClamperLaser.cs @@ -1,7 +1,7 @@ -using Terraria; -using Terraria.ModLoader; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; namespace Tremor.Projectiles { diff --git a/Projectiles/projDesertClaymore.cs b/Projectiles/projDesertClaymore.cs index 1842c6b1..36beca87 100644 --- a/Projectiles/projDesertClaymore.cs +++ b/Projectiles/projDesertClaymore.cs @@ -9,10 +9,10 @@ public class projDesertClaymore : ModProjectile const int SpeedMulti = 2; const int XOffset = 24; // На сколько блоков от игрока будет появлятся меч. (16ед. == 1 блок.) - int YOffset = 0; + int YOffset; int YOffsetStep = -1; bool UP = true; - float YPos = 0; + float YPos; public override void SetDefaults() { diff --git a/Projectiles/projEyeofInfinity.cs b/Projectiles/projEyeofInfinity.cs index d6be6906..4796048a 100644 --- a/Projectiles/projEyeofInfinity.cs +++ b/Projectiles/projEyeofInfinity.cs @@ -1,9 +1,10 @@ -using Microsoft.Xna.Framework; +using System.Collections.Generic; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; -using System.Collections.Generic; //////////////////// +//////////////////// namespace Tremor.Projectiles { @@ -63,7 +64,7 @@ void ImproveSpeed() List OldPositionsRight = new List(); List OldRotations = new List(); const int SavePosRate = 1; - int TimeToSavePos = 0; + int TimeToSavePos; void TestDrawing() { if (--TimeToSavePos <= 0) diff --git a/Projectiles/projGenie.cs b/Projectiles/projGenie.cs index e2951864..b41e9d2a 100644 --- a/Projectiles/projGenie.cs +++ b/Projectiles/projGenie.cs @@ -1,7 +1,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using Terraria.ModLoader; using Terraria; +using Terraria.ModLoader; namespace Tremor.Projectiles { diff --git a/Projectiles/projManaDagger.cs b/Projectiles/projManaDagger.cs index 99994b7a..d614eb93 100644 --- a/Projectiles/projManaDagger.cs +++ b/Projectiles/projManaDagger.cs @@ -7,7 +7,7 @@ namespace Tremor.Projectiles public class projManaDagger : ModProjectile { const int ManaPerHit = 2; // Маны за удар по мобу - int Mana = 0; // Сколько маны уже собрано + int Mana; // Сколько маны уже собрано int Hits = 3; // Лимит ударов с кражей маны bool NeedAddMana = true; // Системная переменная diff --git a/Projectiles/projMotherboardLaser.cs b/Projectiles/projMotherboardLaser.cs index d890f0c4..6dcfb054 100644 --- a/Projectiles/projMotherboardLaser.cs +++ b/Projectiles/projMotherboardLaser.cs @@ -1,7 +1,7 @@ -using Terraria; -using Terraria.ModLoader; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; namespace Tremor.Projectiles { diff --git a/Projectiles/projMotherboardSuperLaser.cs b/Projectiles/projMotherboardSuperLaser.cs index 970a8a80..ba828851 100644 --- a/Projectiles/projMotherboardSuperLaser.cs +++ b/Projectiles/projMotherboardSuperLaser.cs @@ -1,7 +1,8 @@ -using Terraria; -using Terraria.ModLoader; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; namespace Tremor.Projectiles { @@ -11,7 +12,7 @@ public class projMotherboardSuperLaser : ModProjectile const int XOffsetStep = 10; const int DustCount = 5; Color LaserColor = Color.Purple; - int XOffsetNow = 0; + int XOffsetNow; Vector2 endPoint { get { float X = Main.npc[(int)projectile.ai[0]].Center.X + XOffsetNow; @@ -55,7 +56,7 @@ public override void AI() } projectile.Center = new Vector2(Main.npc[(int)projectile.ai[0]].Center.X - 4, Main.npc[(int)projectile.ai[0]].Center.Y + 88f); for (int i = 0; i < DustCount; i++) - Dust.NewDust(new Vector2(endPoint.X - 10, endPoint.Y + 10), 20, 20, Terraria.ID.DustID.Shadowflame); + Dust.NewDust(new Vector2(endPoint.X - 10, endPoint.Y + 10), 20, 20, DustID.Shadowflame); if (projectile.ai[1] != 0) { XOffsetNow -= XOffsetStep; diff --git a/Projectiles/projSteampunkProbe.cs b/Projectiles/projSteampunkProbe.cs index eda44b67..a5cc28c6 100644 --- a/Projectiles/projSteampunkProbe.cs +++ b/Projectiles/projSteampunkProbe.cs @@ -1,7 +1,7 @@ using Microsoft.Xna.Framework; using Terraria; -using Terraria.ModLoader; using Terraria.ID; +using Terraria.ModLoader; namespace Tremor.Projectiles { @@ -67,10 +67,9 @@ int GetTarget() int GetDamage() { - if (STATIC_DAMAGE == -1) + if (STATIC_DAMAGE == -1) return (10 * ((int)Main.player[projectile.owner].magicDamage + (int)Main.player[projectile.owner].meleeDamage + (int)Main.player[projectile.owner].minionDamage + (int)Main.player[projectile.owner].rangedDamage + (int)Main.player[projectile.owner].thrownDamage)) + 15; - else - return STATIC_DAMAGE; + return STATIC_DAMAGE; } void Shoot(int Target, int Damage) @@ -78,8 +77,8 @@ void Shoot(int Target, int Damage) Vector2 velocity = Helper.VelocityToPoint(projectile.Center, Main.npc[Target].Center, ShootSpeed); for (int l = 0; l < ShootCount; l++) { - velocity.X = velocity.X + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - velocity.Y = velocity.Y + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.X = velocity.X + Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.Y = velocity.Y + Main.rand.Next(-spread, spread + 1) * spreadMult; int i = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, velocity.X, velocity.Y, ShootType, Damage, ShootKN, projectile.owner); } } diff --git a/Projectiles/projVultureFeather.cs b/Projectiles/projVultureFeather.cs index 03779fee..fb1a2815 100644 --- a/Projectiles/projVultureFeather.cs +++ b/Projectiles/projVultureFeather.cs @@ -1,12 +1,13 @@ using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.Projectiles { public class projVultureFeather : ModProjectile { - const int TileCollideDustType = Terraria.ID.DustID.Tin; + const int TileCollideDustType = DustID.Tin; const int TileCollideDustCount = 4; const float TileCollideDustSpeedMulti = 0.2f; diff --git a/Tiles/AlchematorTile.cs b/Tiles/AlchematorTile.cs index e3275a6e..ddc4428f 100644 --- a/Tiles/AlchematorTile.cs +++ b/Tiles/AlchematorTile.cs @@ -12,7 +12,7 @@ public override void SetDefaults() Main.tileFrameImportant[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4); - TileObjectData.newTile.CoordinateHeights = new int[]{16, 16, 16, 16}; + TileObjectData.newTile.CoordinateHeights = new[]{16, 16, 16, 16}; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 36; TileObjectData.addTile(Type); diff --git a/Tiles/AlchemyStationTile.cs b/Tiles/AlchemyStationTile.cs index 9c195dc9..fcaa249e 100644 --- a/Tiles/AlchemyStationTile.cs +++ b/Tiles/AlchemyStationTile.cs @@ -16,7 +16,7 @@ public override void SetDefaults() TileObjectData.newTile.StyleWrapLimit = 36; TileObjectData.addTile(Type); dustType = 7; - adjTiles = new int[]{13}; + adjTiles = new[]{13}; ModTranslation name = CreateMapEntryName(); name.SetDefault("Alchemy Station"); AddMapEntry(new Color(65, 43, 9), name); diff --git a/Tiles/AngeliteBarTile.cs b/Tiles/AngeliteBarTile.cs index d08a137b..c5bf7d3d 100644 --- a/Tiles/AngeliteBarTile.cs +++ b/Tiles/AngeliteBarTile.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1); TileObjectData.newTile.Height = 1; - TileObjectData.newTile.CoordinateHeights = new int[]{16}; + TileObjectData.newTile.CoordinateHeights = new[]{16}; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 111; TileObjectData.addTile(Type); diff --git a/Tiles/ArgiteBar.cs b/Tiles/ArgiteBar.cs index ed22c9eb..0da73b60 100644 --- a/Tiles/ArgiteBar.cs +++ b/Tiles/ArgiteBar.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1); TileObjectData.newTile.Height = 1; - TileObjectData.newTile.CoordinateHeights = new int[]{16}; + TileObjectData.newTile.CoordinateHeights = new[]{16}; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 111; TileObjectData.addTile(Type); diff --git a/Tiles/Armchair.cs b/Tiles/Armchair.cs index b9c51dd9..33b2c00c 100644 --- a/Tiles/Armchair.cs +++ b/Tiles/Armchair.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileNoAttach[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); - TileObjectData.newTile.CoordinateHeights = new int[]{16, 16}; + TileObjectData.newTile.CoordinateHeights = new[]{16, 16}; TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; TileObjectData.newTile.StyleWrapLimit = 2; //not really necessary but allows me to add more subtypes of chairs below the example chair texture TileObjectData.newTile.StyleMultiplier = 2; //same as above diff --git a/Tiles/BlizzardMusicBox.cs b/Tiles/BlizzardMusicBox.cs index 05356ddf..78a327ca 100644 --- a/Tiles/BlizzardMusicBox.cs +++ b/Tiles/BlizzardMusicBox.cs @@ -1,8 +1,8 @@ using Microsoft.Xna.Framework; using Terraria; +using Terraria.DataStructures; using Terraria.ModLoader; using Terraria.ObjectData; -using Terraria.DataStructures; namespace Tremor.Tiles { diff --git a/Tiles/BoneThrone.cs b/Tiles/BoneThrone.cs index 350838c4..ce295d08 100644 --- a/Tiles/BoneThrone.cs +++ b/Tiles/BoneThrone.cs @@ -12,7 +12,7 @@ public override void SetDefaults() Main.tileFrameImportant[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4); - TileObjectData.newTile.CoordinateHeights = new int[]{16, 16, 16, 16}; + TileObjectData.newTile.CoordinateHeights = new[]{16, 16, 16, 16}; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 36; TileObjectData.addTile(Type); diff --git a/Tiles/BorealWoodArmchair.cs b/Tiles/BorealWoodArmchair.cs index 0b6bfdd7..620b6188 100644 --- a/Tiles/BorealWoodArmchair.cs +++ b/Tiles/BorealWoodArmchair.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileNoAttach[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); - TileObjectData.newTile.CoordinateHeights = new int[]{16, 16}; + TileObjectData.newTile.CoordinateHeights = new[]{16, 16}; TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; TileObjectData.newTile.StyleWrapLimit = 2; //not really necessary but allows me to add more subtypes of chairs below the example chair texture TileObjectData.newTile.StyleMultiplier = 2; //same as above diff --git a/Tiles/Boss6MusicBox.cs b/Tiles/Boss6MusicBox.cs index 070686b7..69364a3f 100644 --- a/Tiles/Boss6MusicBox.cs +++ b/Tiles/Boss6MusicBox.cs @@ -1,8 +1,8 @@ using Microsoft.Xna.Framework; using Terraria; +using Terraria.DataStructures; using Terraria.ModLoader; using Terraria.ObjectData; -using Terraria.DataStructures; namespace Tremor.Tiles { diff --git a/Tiles/BrassBar.cs b/Tiles/BrassBar.cs index 80e3bc22..942abc0c 100644 --- a/Tiles/BrassBar.cs +++ b/Tiles/BrassBar.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1); TileObjectData.newTile.Height = 1; - TileObjectData.newTile.CoordinateHeights = new int[]{16}; + TileObjectData.newTile.CoordinateHeights = new[]{16}; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 111; TileObjectData.addTile(Type); diff --git a/Tiles/BronzeBar.cs b/Tiles/BronzeBar.cs index e002acda..56c30d1a 100644 --- a/Tiles/BronzeBar.cs +++ b/Tiles/BronzeBar.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1); TileObjectData.newTile.Height = 1; - TileObjectData.newTile.CoordinateHeights = new int[]{16}; + TileObjectData.newTile.CoordinateHeights = new[]{16}; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 111; TileObjectData.addTile(Type); diff --git a/Tiles/BulbTorch.cs b/Tiles/BulbTorch.cs index 4719aee7..091c3b46 100644 --- a/Tiles/BulbTorch.cs +++ b/Tiles/BulbTorch.cs @@ -23,11 +23,11 @@ public override void SetDefaults() TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); TileObjectData.newAlternate.CopyFrom(TileObjectData.StyleTorch); TileObjectData.newAlternate.AnchorLeft = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide | AnchorType.Tree | AnchorType.AlternateTile, TileObjectData.newTile.Height, 0); - TileObjectData.newAlternate.AnchorAlternateTiles = new int[]{ 124 }; + TileObjectData.newAlternate.AnchorAlternateTiles = new[]{ 124 }; TileObjectData.addAlternate(1); TileObjectData.newAlternate.CopyFrom(TileObjectData.StyleTorch); TileObjectData.newAlternate.AnchorRight = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide | AnchorType.Tree | AnchorType.AlternateTile, TileObjectData.newTile.Height, 0); - TileObjectData.newAlternate.AnchorAlternateTiles = new int[]{ 124 }; + TileObjectData.newAlternate.AnchorAlternateTiles = new[]{ 124 }; TileObjectData.addAlternate(2); TileObjectData.newAlternate.CopyFrom(TileObjectData.StyleTorch); TileObjectData.newAlternate.AnchorWall = true; @@ -95,9 +95,9 @@ public override void PostDraw(int i, int j, SpriteBatch spriteBatch) } for (int k = 0; k < 7; k++) { - float x = (float)Utils.RandomInt(ref randSeed, -10, 11) * 0.15f; - float y = (float)Utils.RandomInt(ref randSeed, -10, 1) * 0.35f; - Main.spriteBatch.Draw(mod.GetTexture("Tiles/BulbTorch_Flame"), new Vector2((float)(i * 16 - (int)Main.screenPosition.X) - (width - 16f) / 2f + x, (float)(j * 16 - (int)Main.screenPosition.Y + offsetY) + y) + zero, new Rectangle(frameX, frameY, width, height), color, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + float x = Utils.RandomInt(ref randSeed, -10, 11) * 0.15f; + float y = Utils.RandomInt(ref randSeed, -10, 1) * 0.35f; + Main.spriteBatch.Draw(mod.GetTexture("Tiles/BulbTorch_Flame"), new Vector2(i * 16 - (int)Main.screenPosition.X - (width - 16f) / 2f + x, j * 16 - (int)Main.screenPosition.Y + offsetY + y) + zero, new Rectangle(frameX, frameY, width, height), color, 0f, default(Vector2), 1f, SpriteEffects.None, 0f); } } } diff --git a/Tiles/CandyBarTile.cs b/Tiles/CandyBarTile.cs index 84104254..fcd87c82 100644 --- a/Tiles/CandyBarTile.cs +++ b/Tiles/CandyBarTile.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1); TileObjectData.newTile.Height = 1; - TileObjectData.newTile.CoordinateHeights = new int[]{16}; + TileObjectData.newTile.CoordinateHeights = new[]{16}; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 111; TileObjectData.addTile(Type); diff --git a/Tiles/ChaosBar.cs b/Tiles/ChaosBar.cs index 0ceace26..ab02c243 100644 --- a/Tiles/ChaosBar.cs +++ b/Tiles/ChaosBar.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1); TileObjectData.newTile.Height = 1; - TileObjectData.newTile.CoordinateHeights = new int[]{16}; + TileObjectData.newTile.CoordinateHeights = new[]{16}; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 111; TileObjectData.addTile(Type); diff --git a/Tiles/CogLordMusicBox.cs b/Tiles/CogLordMusicBox.cs index 95f527bb..569c4b78 100644 --- a/Tiles/CogLordMusicBox.cs +++ b/Tiles/CogLordMusicBox.cs @@ -1,8 +1,8 @@ using Microsoft.Xna.Framework; using Terraria; +using Terraria.DataStructures; using Terraria.ModLoader; using Terraria.ObjectData; -using Terraria.DataStructures; namespace Tremor.Tiles { diff --git a/Tiles/CollapsiumBarTile.cs b/Tiles/CollapsiumBarTile.cs index 138f5a5e..22e9e626 100644 --- a/Tiles/CollapsiumBarTile.cs +++ b/Tiles/CollapsiumBarTile.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1); TileObjectData.newTile.Height = 1; - TileObjectData.newTile.CoordinateHeights = new int[]{16}; + TileObjectData.newTile.CoordinateHeights = new[]{16}; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 111; TileObjectData.addTile(Type); diff --git a/Tiles/CometiteBarTile.cs b/Tiles/CometiteBarTile.cs index 477e764b..8e313636 100644 --- a/Tiles/CometiteBarTile.cs +++ b/Tiles/CometiteBarTile.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1); TileObjectData.newTile.Height = 1; - TileObjectData.newTile.CoordinateHeights = new int[]{16}; + TileObjectData.newTile.CoordinateHeights = new[]{16}; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 111; TileObjectData.addTile(Type); diff --git a/Tiles/Corn.cs b/Tiles/Corn.cs index 15f45016..b68c1860 100644 --- a/Tiles/Corn.cs +++ b/Tiles/Corn.cs @@ -13,9 +13,9 @@ public override void SetDefaults() Main.tileCut[Type] = true; Main.tileNoFail[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.StyleAlch); - TileObjectData.newTile.AnchorValidTiles = new int[] + TileObjectData.newTile.AnchorValidTiles = new[] { - 2, + 2 }; TileObjectData.addTile(Type); } diff --git a/Tiles/CreepyThrone.cs b/Tiles/CreepyThrone.cs index 0771b5e3..be93334e 100644 --- a/Tiles/CreepyThrone.cs +++ b/Tiles/CreepyThrone.cs @@ -12,7 +12,7 @@ public override void SetDefaults() Main.tileFrameImportant[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4); - TileObjectData.newTile.CoordinateHeights = new int[]{16, 16, 16, 16}; + TileObjectData.newTile.CoordinateHeights = new[]{16, 16, 16, 16}; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 36; TileObjectData.addTile(Type); diff --git a/Tiles/CrimstoneBathtub.cs b/Tiles/CrimstoneBathtub.cs index f0a1dbb3..d076ef67 100644 --- a/Tiles/CrimstoneBathtub.cs +++ b/Tiles/CrimstoneBathtub.cs @@ -13,7 +13,7 @@ public override void SetDefaults() Main.tileFrameImportant[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style4x2); //this style already takes care of direction for us - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); AddMapEntry(new Color(111, 22, 22)); diff --git a/Tiles/CrimstoneBed.cs b/Tiles/CrimstoneBed.cs index 8fc4f3f7..ad5f883e 100644 --- a/Tiles/CrimstoneBed.cs +++ b/Tiles/CrimstoneBed.cs @@ -13,7 +13,7 @@ public override void SetDefaults() Main.tileFrameImportant[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style4x2); //this style already takes care of direction for us - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.addTile(Type); AddMapEntry(new Color(111, 22, 22)); adjTiles = new int[]{ TileID.Beds }; diff --git a/Tiles/CrimstoneBench.cs b/Tiles/CrimstoneBench.cs index 0565b2f0..c6f5914f 100644 --- a/Tiles/CrimstoneBench.cs +++ b/Tiles/CrimstoneBench.cs @@ -14,7 +14,7 @@ public override void SetDefaults() Main.tileNoAttach[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsChair); AddMapEntry(new Color(111, 22, 22)); diff --git a/Tiles/CrimstoneBookcase.cs b/Tiles/CrimstoneBookcase.cs index d548d2af..e300cd26 100644 --- a/Tiles/CrimstoneBookcase.cs +++ b/Tiles/CrimstoneBookcase.cs @@ -16,7 +16,7 @@ public override void SetDefaults() Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16, 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16, 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); AddMapEntry(new Color(111, 22, 22)); diff --git a/Tiles/CrimstoneChair.cs b/Tiles/CrimstoneChair.cs index 4fd9ba43..5777f13f 100644 --- a/Tiles/CrimstoneChair.cs +++ b/Tiles/CrimstoneChair.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileNoAttach[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2); - TileObjectData.newTile.CoordinateHeights = new int[]{16, 16}; + TileObjectData.newTile.CoordinateHeights = new[]{16, 16}; TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; TileObjectData.newTile.StyleWrapLimit = 2; //not really necessary but allows me to add more subtypes of chairs below the example chair texture TileObjectData.newTile.StyleMultiplier = 2; //same as above diff --git a/Tiles/CrimstoneChest.cs b/Tiles/CrimstoneChest.cs index 90399485..fd918767 100644 --- a/Tiles/CrimstoneChest.cs +++ b/Tiles/CrimstoneChest.cs @@ -1,4 +1,3 @@ -using System; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -22,10 +21,10 @@ public override void SetDefaults() Main.tileValue[Type] = 500; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.newTile.Origin = new Point16(0, 1); - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 18 }; - TileObjectData.newTile.HookCheck = new PlacementHook(new Func(Chest.FindEmptyChest), -1, 0, true); - TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(new Func(Chest.AfterPlacement_Hook), -1, 0, false); - TileObjectData.newTile.AnchorInvalidTiles = new int[] { 127 }; + TileObjectData.newTile.CoordinateHeights = new[] { 16, 18 }; + TileObjectData.newTile.HookCheck = new PlacementHook(Chest.FindEmptyChest, -1, 0, true); + TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(Chest.AfterPlacement_Hook, -1, 0, false); + TileObjectData.newTile.AnchorInvalidTiles = new[] { 127 }; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.LavaDeath = false; TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); @@ -55,10 +54,7 @@ public string MapChestName(string name, int i, int j) { return name; } - else - { - return name + ": " + Main.chest[chest].name; - } + return name + ": " + Main.chest[chest].name; } public override void NumDust(int i, int j, bool fail, ref int num) @@ -115,7 +111,7 @@ public override void RightClick(int i, int j) } else { - NetMessage.SendData(31, -1, -1, null, left, (float)top, 0f, 0f, 0, 0, 0); + NetMessage.SendData(31, -1, -1, null, left, top, 0f, 0f, 0, 0, 0); Main.stackSplit = 600; } } diff --git a/Tiles/CrimstoneDoorClosed.cs b/Tiles/CrimstoneDoorClosed.cs index 8c4fed2c..3d83eec5 100644 --- a/Tiles/CrimstoneDoorClosed.cs +++ b/Tiles/CrimstoneDoorClosed.cs @@ -26,7 +26,7 @@ public override void SetDefaults() TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile, TileObjectData.newTile.Width, 0); TileObjectData.newTile.UsesCustomCanPlace = true; TileObjectData.newTile.LavaDeath = true; - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16, 16 }; TileObjectData.newTile.CoordinateWidth = 16; TileObjectData.newTile.CoordinatePadding = 2; TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); diff --git a/Tiles/CrimstoneDoorOpen.cs b/Tiles/CrimstoneDoorOpen.cs index abe176ec..203e7935 100644 --- a/Tiles/CrimstoneDoorOpen.cs +++ b/Tiles/CrimstoneDoorOpen.cs @@ -23,7 +23,7 @@ public override void SetDefaults() TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile, 1, 0); TileObjectData.newTile.UsesCustomCanPlace = true; TileObjectData.newTile.LavaDeath = true; - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16, 16 }; TileObjectData.newTile.CoordinateWidth = 16; TileObjectData.newTile.CoordinatePadding = 2; TileObjectData.newTile.StyleHorizontal = true; diff --git a/Tiles/CrimstoneDresser.cs b/Tiles/CrimstoneDresser.cs index 06cb7542..4d70763c 100644 --- a/Tiles/CrimstoneDresser.cs +++ b/Tiles/CrimstoneDresser.cs @@ -1,11 +1,10 @@ -using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.DataStructures; +using Terraria.Enums; using Terraria.ID; using Terraria.ModLoader; using Terraria.ObjectData; -using Terraria.Enums; -using Terraria.DataStructures; namespace Tremor.Tiles { @@ -21,10 +20,10 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); TileObjectData.newTile.Origin = new Point16(1, 1); - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16 }; - TileObjectData.newTile.HookCheck = new PlacementHook(new Func(Chest.FindEmptyChest), -1, 0, true); - TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(new Func(Chest.AfterPlacement_Hook), -1, 0, false); - TileObjectData.newTile.AnchorInvalidTiles = new int[] { 127 }; + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16 }; + TileObjectData.newTile.HookCheck = new PlacementHook(Chest.FindEmptyChest, -1, 0, true); + TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(Chest.AfterPlacement_Hook, -1, 0, false); + TileObjectData.newTile.AnchorInvalidTiles = new[] { 127 }; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.LavaDeath = false; TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); @@ -44,10 +43,10 @@ public override void RightClick(int i, int j) { Main.CancelClothesWindow(true); Main.mouseRightRelease = false; - int left = (int)(Main.tile[Player.tileTargetX, Player.tileTargetY].frameX / 18); + int left = Main.tile[Player.tileTargetX, Player.tileTargetY].frameX / 18; left %= 3; left = Player.tileTargetX - left; - int top = Player.tileTargetY - (int)(Main.tile[Player.tileTargetX, Player.tileTargetY].frameY / 18); + int top = Player.tileTargetY - Main.tile[Player.tileTargetX, Player.tileTargetY].frameY / 18; if (player.sign > -1) { Main.PlaySound(SoundID.MenuClose); @@ -76,7 +75,7 @@ public override void RightClick(int i, int j) } else { - NetMessage.SendData(31, -1, -1, null, left, (float)top, 0f, 0f, 0, 0, 0); + NetMessage.SendData(31, -1, -1, null, left, top, 0f, 0f, 0, 0, 0); Main.stackSplit = 600; } } @@ -132,7 +131,7 @@ public override void MouseOverFar(int i, int j) Tile tile = Main.tile[Player.tileTargetX, Player.tileTargetY]; int left = Player.tileTargetX; int top = Player.tileTargetY; - left -= (int)(tile.frameX % 54 / 18); + left -= tile.frameX % 54 / 18; if (tile.frameY % 36 != 0) { top--; @@ -174,7 +173,7 @@ public override void MouseOver(int i, int j) Tile tile = Main.tile[Player.tileTargetX, Player.tileTargetY]; int left = Player.tileTargetX; int top = Player.tileTargetY; - left -= (int)(tile.frameX % 54 / 18); + left -= tile.frameX % 54 / 18; if (tile.frameY % 36 != 0) { top--; diff --git a/Tiles/CrimstoneGrandfatherClock.cs b/Tiles/CrimstoneGrandfatherClock.cs index 70f1e4a7..481312fe 100644 --- a/Tiles/CrimstoneGrandfatherClock.cs +++ b/Tiles/CrimstoneGrandfatherClock.cs @@ -14,7 +14,7 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); TileObjectData.newTile.Height = 5; - TileObjectData.newTile.CoordinateHeights = new int[]{16, 16, 16, 16, 16}; + TileObjectData.newTile.CoordinateHeights = new[]{16, 16, 16, 16, 16}; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 36; TileObjectData.addTile(Type); diff --git a/Tiles/CrimstonePiano.cs b/Tiles/CrimstonePiano.cs index b3fb598a..c8b4d2de 100644 --- a/Tiles/CrimstonePiano.cs +++ b/Tiles/CrimstonePiano.cs @@ -16,7 +16,7 @@ public override void SetDefaults() Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style4x2); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); AddMapEntry(new Color(111, 22, 22)); diff --git a/Tiles/CrimstonePlatform.cs b/Tiles/CrimstonePlatform.cs index 1f2d736e..7d644dd2 100644 --- a/Tiles/CrimstonePlatform.cs +++ b/Tiles/CrimstonePlatform.cs @@ -17,7 +17,7 @@ public override void SetDefaults() Main.tileNoAttach[Type] = true; Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; - TileObjectData.newTile.CoordinateHeights = new int[]{ 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16 }; TileObjectData.newTile.CoordinateWidth = 16; TileObjectData.newTile.CoordinatePadding = 2; TileObjectData.newTile.StyleHorizontal = true; diff --git a/Tiles/CrimstoneSink.cs b/Tiles/CrimstoneSink.cs index 72f42db3..188baf33 100644 --- a/Tiles/CrimstoneSink.cs +++ b/Tiles/CrimstoneSink.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); AddMapEntry(new Color(111, 22, 22)); diff --git a/Tiles/CrimstoneTable.cs b/Tiles/CrimstoneTable.cs index cf05e0fb..8502b17b 100644 --- a/Tiles/CrimstoneTable.cs +++ b/Tiles/CrimstoneTable.cs @@ -16,7 +16,7 @@ public override void SetDefaults() Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); AddMapEntry(new Color(111, 22, 22)); diff --git a/Tiles/CrimstoneWorkbench.cs b/Tiles/CrimstoneWorkbench.cs index 01621103..ea11afa7 100644 --- a/Tiles/CrimstoneWorkbench.cs +++ b/Tiles/CrimstoneWorkbench.cs @@ -16,7 +16,7 @@ public override void SetDefaults() Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x1); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.addTile(Type); adjTiles = new int[]{ TileID.WorkBenches }; AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); diff --git a/Tiles/CyberKingMusicBox.cs b/Tiles/CyberKingMusicBox.cs index b2e39a55..6e7923b0 100644 --- a/Tiles/CyberKingMusicBox.cs +++ b/Tiles/CyberKingMusicBox.cs @@ -1,8 +1,8 @@ using Microsoft.Xna.Framework; using Terraria; +using Terraria.DataStructures; using Terraria.ModLoader; using Terraria.ObjectData; -using Terraria.DataStructures; namespace Tremor.Tiles { diff --git a/Tiles/DivineForgeTile.cs b/Tiles/DivineForgeTile.cs index 1af8e0dc..92b5c3d1 100644 --- a/Tiles/DivineForgeTile.cs +++ b/Tiles/DivineForgeTile.cs @@ -21,7 +21,7 @@ public override void SetDefaults() ModTranslation name = CreateMapEntryName(); name.SetDefault("Divine Forge"); AddMapEntry(new Color(255, 20, 147), name); - adjTiles = new int[]{412,133,16,17,134}; + adjTiles = new[]{412,133,16,17,134}; } public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) diff --git a/Tiles/EbonstoneBathtub.cs b/Tiles/EbonstoneBathtub.cs index 45cdaa27..ca6e7a98 100644 --- a/Tiles/EbonstoneBathtub.cs +++ b/Tiles/EbonstoneBathtub.cs @@ -13,7 +13,7 @@ public override void SetDefaults() Main.tileFrameImportant[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style4x2); //this style already takes care of direction for us - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); AddMapEntry(new Color(121, 14, 203)); diff --git a/Tiles/EbonstoneBed.cs b/Tiles/EbonstoneBed.cs index 7f60399d..bfb05be5 100644 --- a/Tiles/EbonstoneBed.cs +++ b/Tiles/EbonstoneBed.cs @@ -13,7 +13,7 @@ public override void SetDefaults() Main.tileFrameImportant[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style4x2); //this style already takes care of direction for us - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.addTile(Type); AddMapEntry(new Color(121, 14, 203)); adjTiles = new int[]{ TileID.Beds }; diff --git a/Tiles/EbonstoneBench.cs b/Tiles/EbonstoneBench.cs index 20b10eb4..552b3eac 100644 --- a/Tiles/EbonstoneBench.cs +++ b/Tiles/EbonstoneBench.cs @@ -14,7 +14,7 @@ public override void SetDefaults() Main.tileNoAttach[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsChair); AddMapEntry(new Color(121, 14, 203)); diff --git a/Tiles/EbonstoneBookcase.cs b/Tiles/EbonstoneBookcase.cs index c371c9e1..d290c313 100644 --- a/Tiles/EbonstoneBookcase.cs +++ b/Tiles/EbonstoneBookcase.cs @@ -16,7 +16,7 @@ public override void SetDefaults() Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16, 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16, 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); AddMapEntry(new Color(121, 14, 203)); diff --git a/Tiles/EbonstoneChair.cs b/Tiles/EbonstoneChair.cs index f18acf13..5184274f 100644 --- a/Tiles/EbonstoneChair.cs +++ b/Tiles/EbonstoneChair.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileNoAttach[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2); - TileObjectData.newTile.CoordinateHeights = new int[]{16, 16}; + TileObjectData.newTile.CoordinateHeights = new[]{16, 16}; TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; TileObjectData.newTile.StyleWrapLimit = 2; //not really necessary but allows me to add more subtypes of chairs below the example chair texture TileObjectData.newTile.StyleMultiplier = 2; //same as above diff --git a/Tiles/EbonstoneChest.cs b/Tiles/EbonstoneChest.cs index 3925b81c..2ca02bee 100644 --- a/Tiles/EbonstoneChest.cs +++ b/Tiles/EbonstoneChest.cs @@ -1,4 +1,3 @@ -using System; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -22,10 +21,10 @@ public override void SetDefaults() Main.tileValue[Type] = 500; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.newTile.Origin = new Point16(0, 1); - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 18 }; - TileObjectData.newTile.HookCheck = new PlacementHook(new Func(Chest.FindEmptyChest), -1, 0, true); - TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(new Func(Chest.AfterPlacement_Hook), -1, 0, false); - TileObjectData.newTile.AnchorInvalidTiles = new int[] { 127 }; + TileObjectData.newTile.CoordinateHeights = new[] { 16, 18 }; + TileObjectData.newTile.HookCheck = new PlacementHook(Chest.FindEmptyChest, -1, 0, true); + TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(Chest.AfterPlacement_Hook, -1, 0, false); + TileObjectData.newTile.AnchorInvalidTiles = new[] { 127 }; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.LavaDeath = false; TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); @@ -55,10 +54,7 @@ public string MapChestName(string name, int i, int j) { return name; } - else - { - return name + ": " + Main.chest[chest].name; - } + return name + ": " + Main.chest[chest].name; } public override void NumDust(int i, int j, bool fail, ref int num) @@ -115,7 +111,7 @@ public override void RightClick(int i, int j) } else { - NetMessage.SendData(31, -1, -1, null, left, (float)top, 0f, 0f, 0, 0, 0); + NetMessage.SendData(31, -1, -1, null, left, top, 0f, 0f, 0, 0, 0); Main.stackSplit = 600; } } diff --git a/Tiles/EbonstoneDoorClosed.cs b/Tiles/EbonstoneDoorClosed.cs index 446bfa83..7d6911b5 100644 --- a/Tiles/EbonstoneDoorClosed.cs +++ b/Tiles/EbonstoneDoorClosed.cs @@ -26,7 +26,7 @@ public override void SetDefaults() TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile, TileObjectData.newTile.Width, 0); TileObjectData.newTile.UsesCustomCanPlace = true; TileObjectData.newTile.LavaDeath = true; - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16, 16 }; TileObjectData.newTile.CoordinateWidth = 16; TileObjectData.newTile.CoordinatePadding = 2; TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); diff --git a/Tiles/EbonstoneDoorOpen.cs b/Tiles/EbonstoneDoorOpen.cs index 485a6f76..3bdff6bb 100644 --- a/Tiles/EbonstoneDoorOpen.cs +++ b/Tiles/EbonstoneDoorOpen.cs @@ -23,7 +23,7 @@ public override void SetDefaults() TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile, 1, 0); TileObjectData.newTile.UsesCustomCanPlace = true; TileObjectData.newTile.LavaDeath = true; - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16, 16 }; TileObjectData.newTile.CoordinateWidth = 16; TileObjectData.newTile.CoordinatePadding = 2; TileObjectData.newTile.StyleHorizontal = true; diff --git a/Tiles/EbonstoneDresser.cs b/Tiles/EbonstoneDresser.cs index adb9a582..a833fd78 100644 --- a/Tiles/EbonstoneDresser.cs +++ b/Tiles/EbonstoneDresser.cs @@ -1,11 +1,10 @@ -using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.DataStructures; +using Terraria.Enums; using Terraria.ID; using Terraria.ModLoader; using Terraria.ObjectData; -using Terraria.Enums; -using Terraria.DataStructures; namespace Tremor.Tiles { @@ -21,10 +20,10 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); TileObjectData.newTile.Origin = new Point16(1, 1); - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16 }; - TileObjectData.newTile.HookCheck = new PlacementHook(new Func(Chest.FindEmptyChest), -1, 0, true); - TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(new Func(Chest.AfterPlacement_Hook), -1, 0, false); - TileObjectData.newTile.AnchorInvalidTiles = new int[] { 127 }; + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16 }; + TileObjectData.newTile.HookCheck = new PlacementHook(Chest.FindEmptyChest, -1, 0, true); + TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(Chest.AfterPlacement_Hook, -1, 0, false); + TileObjectData.newTile.AnchorInvalidTiles = new[] { 127 }; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.LavaDeath = false; TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); @@ -44,10 +43,10 @@ public override void RightClick(int i, int j) { Main.CancelClothesWindow(true); Main.mouseRightRelease = false; - int left = (int)(Main.tile[Player.tileTargetX, Player.tileTargetY].frameX / 18); + int left = Main.tile[Player.tileTargetX, Player.tileTargetY].frameX / 18; left %= 3; left = Player.tileTargetX - left; - int top = Player.tileTargetY - (int)(Main.tile[Player.tileTargetX, Player.tileTargetY].frameY / 18); + int top = Player.tileTargetY - Main.tile[Player.tileTargetX, Player.tileTargetY].frameY / 18; if (player.sign > -1) { Main.PlaySound(SoundID.MenuClose); @@ -76,7 +75,7 @@ public override void RightClick(int i, int j) } else { - NetMessage.SendData(31, -1, -1, null, left, (float)top, 0f, 0f, 0, 0, 0); + NetMessage.SendData(31, -1, -1, null, left, top, 0f, 0f, 0, 0, 0); Main.stackSplit = 600; } } @@ -132,7 +131,7 @@ public override void MouseOverFar(int i, int j) Tile tile = Main.tile[Player.tileTargetX, Player.tileTargetY]; int left = Player.tileTargetX; int top = Player.tileTargetY; - left -= (int)(tile.frameX % 54 / 18); + left -= tile.frameX % 54 / 18; if (tile.frameY % 36 != 0) { top--; @@ -174,7 +173,7 @@ public override void MouseOver(int i, int j) Tile tile = Main.tile[Player.tileTargetX, Player.tileTargetY]; int left = Player.tileTargetX; int top = Player.tileTargetY; - left -= (int)(tile.frameX % 54 / 18); + left -= tile.frameX % 54 / 18; if (tile.frameY % 36 != 0) { top--; diff --git a/Tiles/EbonstoneGrandfatherClock.cs b/Tiles/EbonstoneGrandfatherClock.cs index 7040f17f..bfc0c994 100644 --- a/Tiles/EbonstoneGrandfatherClock.cs +++ b/Tiles/EbonstoneGrandfatherClock.cs @@ -14,7 +14,7 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); TileObjectData.newTile.Height = 5; - TileObjectData.newTile.CoordinateHeights = new int[]{16, 16, 16, 16, 16}; + TileObjectData.newTile.CoordinateHeights = new[]{16, 16, 16, 16, 16}; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 36; TileObjectData.addTile(Type); diff --git a/Tiles/EbonstonePiano.cs b/Tiles/EbonstonePiano.cs index cc9675d6..afaa67a5 100644 --- a/Tiles/EbonstonePiano.cs +++ b/Tiles/EbonstonePiano.cs @@ -16,7 +16,7 @@ public override void SetDefaults() Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style4x2); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); AddMapEntry(new Color(121, 14, 203)); diff --git a/Tiles/EbonstonePlatform.cs b/Tiles/EbonstonePlatform.cs index a48c4de9..8365096d 100644 --- a/Tiles/EbonstonePlatform.cs +++ b/Tiles/EbonstonePlatform.cs @@ -17,7 +17,7 @@ public override void SetDefaults() Main.tileNoAttach[Type] = true; Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; - TileObjectData.newTile.CoordinateHeights = new int[]{ 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16 }; TileObjectData.newTile.CoordinateWidth = 16; TileObjectData.newTile.CoordinatePadding = 2; TileObjectData.newTile.StyleHorizontal = true; diff --git a/Tiles/EbonstoneSink.cs b/Tiles/EbonstoneSink.cs index 391a901b..57ad3003 100644 --- a/Tiles/EbonstoneSink.cs +++ b/Tiles/EbonstoneSink.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); AddMapEntry(new Color(121, 14, 203)); diff --git a/Tiles/EbonstoneTable.cs b/Tiles/EbonstoneTable.cs index 03826cd5..4cc8926c 100644 --- a/Tiles/EbonstoneTable.cs +++ b/Tiles/EbonstoneTable.cs @@ -16,7 +16,7 @@ public override void SetDefaults() Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); AddMapEntry(new Color(121, 14, 203)); diff --git a/Tiles/EbonstoneWorkbench.cs b/Tiles/EbonstoneWorkbench.cs index db9d48c6..20f5fba8 100644 --- a/Tiles/EbonstoneWorkbench.cs +++ b/Tiles/EbonstoneWorkbench.cs @@ -16,7 +16,7 @@ public override void SetDefaults() Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x1); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.addTile(Type); adjTiles = new int[]{ TileID.WorkBenches }; AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); diff --git a/Tiles/EbonwoodArmchair.cs b/Tiles/EbonwoodArmchair.cs index f965daf9..a8cc130b 100644 --- a/Tiles/EbonwoodArmchair.cs +++ b/Tiles/EbonwoodArmchair.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileNoAttach[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); - TileObjectData.newTile.CoordinateHeights = new int[]{16, 16}; + TileObjectData.newTile.CoordinateHeights = new[]{16, 16}; TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; TileObjectData.newTile.StyleWrapLimit = 2; //not really necessary but allows me to add more subtypes of chairs below the example chair texture TileObjectData.newTile.StyleMultiplier = 2; //same as above diff --git a/Tiles/EvershinyBar.cs b/Tiles/EvershinyBar.cs index e881295e..f3217999 100644 --- a/Tiles/EvershinyBar.cs +++ b/Tiles/EvershinyBar.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1); TileObjectData.newTile.Height = 1; - TileObjectData.newTile.CoordinateHeights = new int[]{16}; + TileObjectData.newTile.CoordinateHeights = new[]{16}; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 111; TileObjectData.addTile(Type); diff --git a/Tiles/EvilCornMusicBox.cs b/Tiles/EvilCornMusicBox.cs index 0b830402..5acbdaf5 100644 --- a/Tiles/EvilCornMusicBox.cs +++ b/Tiles/EvilCornMusicBox.cs @@ -1,8 +1,8 @@ using Microsoft.Xna.Framework; using Terraria; +using Terraria.DataStructures; using Terraria.ModLoader; using Terraria.ObjectData; -using Terraria.DataStructures; namespace Tremor.Tiles { diff --git a/Tiles/EyeMonolithTile.cs b/Tiles/EyeMonolithTile.cs index c6da75a8..d26f7e0c 100644 --- a/Tiles/EyeMonolithTile.cs +++ b/Tiles/EyeMonolithTile.cs @@ -12,7 +12,7 @@ public override void SetDefaults() Main.tileFrameImportant[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4); - TileObjectData.newTile.CoordinateHeights = new int[]{16, 16, 16, 16}; + TileObjectData.newTile.CoordinateHeights = new[]{16, 16, 16, 16}; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 36; TileObjectData.addTile(Type); diff --git a/Tiles/FleshWorkstationTile.cs b/Tiles/FleshWorkstationTile.cs index 83874760..f03309fe 100644 --- a/Tiles/FleshWorkstationTile.cs +++ b/Tiles/FleshWorkstationTile.cs @@ -13,7 +13,7 @@ public override void SetDefaults() Main.tileNoAttach[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.addTile(Type); ModTranslation name = CreateMapEntryName(); name.SetDefault("Flesh Workstation"); diff --git a/Tiles/FrostoneBarTile.cs b/Tiles/FrostoneBarTile.cs index 211e445f..273d19f0 100644 --- a/Tiles/FrostoneBarTile.cs +++ b/Tiles/FrostoneBarTile.cs @@ -17,7 +17,7 @@ public override void SetDefaults() soundStyle = 2; TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1); TileObjectData.newTile.Height = 1; - TileObjectData.newTile.CoordinateHeights = new int[]{16}; + TileObjectData.newTile.CoordinateHeights = new[]{16}; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 111; TileObjectData.addTile(Type); diff --git a/Tiles/GlassDoorClosed.cs b/Tiles/GlassDoorClosed.cs index 6626997d..53eafcd9 100644 --- a/Tiles/GlassDoorClosed.cs +++ b/Tiles/GlassDoorClosed.cs @@ -24,7 +24,7 @@ public override void SetDefaults() TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile, TileObjectData.newTile.Width, 0); TileObjectData.newTile.UsesCustomCanPlace = true; TileObjectData.newTile.LavaDeath = true; - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16, 16 }; TileObjectData.newTile.CoordinateWidth = 16; TileObjectData.newTile.CoordinatePadding = 2; TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); diff --git a/Tiles/GlassDoorOpen.cs b/Tiles/GlassDoorOpen.cs index 59c1abc6..f5b2da08 100644 --- a/Tiles/GlassDoorOpen.cs +++ b/Tiles/GlassDoorOpen.cs @@ -23,7 +23,7 @@ public override void SetDefaults() TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile, 1, 0); TileObjectData.newTile.UsesCustomCanPlace = true; TileObjectData.newTile.LavaDeath = true; - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16, 16 }; TileObjectData.newTile.CoordinateWidth = 16; TileObjectData.newTile.CoordinatePadding = 2; TileObjectData.newTile.StyleHorizontal = true; diff --git a/Tiles/GloomstoneBathtub.cs b/Tiles/GloomstoneBathtub.cs index dceb8a71..cdfa656b 100644 --- a/Tiles/GloomstoneBathtub.cs +++ b/Tiles/GloomstoneBathtub.cs @@ -13,7 +13,7 @@ public override void SetDefaults() Main.tileFrameImportant[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style4x2); //this style already takes care of direction for us - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); AddMapEntry(new Color(8, 91, 146)); diff --git a/Tiles/GloomstoneBed.cs b/Tiles/GloomstoneBed.cs index 9b7a603f..b84e6052 100644 --- a/Tiles/GloomstoneBed.cs +++ b/Tiles/GloomstoneBed.cs @@ -13,7 +13,7 @@ public override void SetDefaults() Main.tileFrameImportant[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style4x2); //this style already takes care of direction for us - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.addTile(Type); AddMapEntry(new Color(8, 91, 146)); adjTiles = new int[]{ TileID.Beds }; diff --git a/Tiles/GloomstoneBench.cs b/Tiles/GloomstoneBench.cs index be1abff7..68672af7 100644 --- a/Tiles/GloomstoneBench.cs +++ b/Tiles/GloomstoneBench.cs @@ -14,7 +14,7 @@ public override void SetDefaults() Main.tileNoAttach[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsChair); AddMapEntry(new Color(8, 91, 146)); diff --git a/Tiles/GloomstoneBookcase.cs b/Tiles/GloomstoneBookcase.cs index c18740fe..ebec6aa5 100644 --- a/Tiles/GloomstoneBookcase.cs +++ b/Tiles/GloomstoneBookcase.cs @@ -16,7 +16,7 @@ public override void SetDefaults() Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16, 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16, 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); AddMapEntry(new Color(8, 91, 146)); diff --git a/Tiles/GloomstoneCandelabra.cs b/Tiles/GloomstoneCandelabra.cs index eb85338c..0c9b17b5 100644 --- a/Tiles/GloomstoneCandelabra.cs +++ b/Tiles/GloomstoneCandelabra.cs @@ -4,7 +4,6 @@ using Terraria.ModLoader; using Terraria.ObjectData; - namespace Tremor.Tiles { public class GloomstoneCandelabra : ModTile diff --git a/Tiles/GloomstoneChair.cs b/Tiles/GloomstoneChair.cs index c8efcd73..f31c5316 100644 --- a/Tiles/GloomstoneChair.cs +++ b/Tiles/GloomstoneChair.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileNoAttach[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2); - TileObjectData.newTile.CoordinateHeights = new int[]{16, 16}; + TileObjectData.newTile.CoordinateHeights = new[]{16, 16}; TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; TileObjectData.newTile.StyleWrapLimit = 2; //not really necessary but allows me to add more subtypes of chairs below the example chair texture TileObjectData.newTile.StyleMultiplier = 2; //same as above diff --git a/Tiles/GloomstoneChandelier.cs b/Tiles/GloomstoneChandelier.cs index dfa7cce5..43585718 100644 --- a/Tiles/GloomstoneChandelier.cs +++ b/Tiles/GloomstoneChandelier.cs @@ -16,7 +16,7 @@ public override void SetDefaults() TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2Top); TileObjectData.newTile.Height = 3; TileObjectData.newTile.Width = 3; - TileObjectData.newTile.CoordinateHeights = new int[]{16, 16, 16}; + TileObjectData.newTile.CoordinateHeights = new[]{16, 16, 16}; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 111; TileObjectData.addTile(Type); diff --git a/Tiles/GloomstoneChest.cs b/Tiles/GloomstoneChest.cs index 2478eba4..e5f4d0e3 100644 --- a/Tiles/GloomstoneChest.cs +++ b/Tiles/GloomstoneChest.cs @@ -1,4 +1,3 @@ -using System; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -22,10 +21,10 @@ public override void SetDefaults() Main.tileValue[Type] = 500; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.newTile.Origin = new Point16(0, 1); - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 18 }; - TileObjectData.newTile.HookCheck = new PlacementHook(new Func(Chest.FindEmptyChest), -1, 0, true); - TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(new Func(Chest.AfterPlacement_Hook), -1, 0, false); - TileObjectData.newTile.AnchorInvalidTiles = new int[] { 127 }; + TileObjectData.newTile.CoordinateHeights = new[] { 16, 18 }; + TileObjectData.newTile.HookCheck = new PlacementHook(Chest.FindEmptyChest, -1, 0, true); + TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(Chest.AfterPlacement_Hook, -1, 0, false); + TileObjectData.newTile.AnchorInvalidTiles = new[] { 127 }; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.LavaDeath = false; TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); @@ -55,10 +54,7 @@ public string MapChestName(string name, int i, int j) { return name; } - else - { - return name + ": " + Main.chest[chest].name; - } + return name + ": " + Main.chest[chest].name; } public override void NumDust(int i, int j, bool fail, ref int num) @@ -115,7 +111,7 @@ public override void RightClick(int i, int j) } else { - NetMessage.SendData(31, -1, -1, null, left, (float)top, 0f, 0f, 0, 0, 0); + NetMessage.SendData(31, -1, -1, null, left, top, 0f, 0f, 0, 0, 0); Main.stackSplit = 600; } } diff --git a/Tiles/GloomstoneDoorClosed.cs b/Tiles/GloomstoneDoorClosed.cs index 90b98a86..107c0637 100644 --- a/Tiles/GloomstoneDoorClosed.cs +++ b/Tiles/GloomstoneDoorClosed.cs @@ -26,7 +26,7 @@ public override void SetDefaults() TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile, TileObjectData.newTile.Width, 0); TileObjectData.newTile.UsesCustomCanPlace = true; TileObjectData.newTile.LavaDeath = true; - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16, 16 }; TileObjectData.newTile.CoordinateWidth = 16; TileObjectData.newTile.CoordinatePadding = 2; TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); diff --git a/Tiles/GloomstoneDoorOpen.cs b/Tiles/GloomstoneDoorOpen.cs index 36f474d2..f46bcfeb 100644 --- a/Tiles/GloomstoneDoorOpen.cs +++ b/Tiles/GloomstoneDoorOpen.cs @@ -23,7 +23,7 @@ public override void SetDefaults() TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile, 1, 0); TileObjectData.newTile.UsesCustomCanPlace = true; TileObjectData.newTile.LavaDeath = true; - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16, 16 }; TileObjectData.newTile.CoordinateWidth = 16; TileObjectData.newTile.CoordinatePadding = 2; TileObjectData.newTile.StyleHorizontal = true; diff --git a/Tiles/GloomstoneDresser.cs b/Tiles/GloomstoneDresser.cs index 2c8b49d7..90ecc786 100644 --- a/Tiles/GloomstoneDresser.cs +++ b/Tiles/GloomstoneDresser.cs @@ -1,11 +1,10 @@ -using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.DataStructures; +using Terraria.Enums; using Terraria.ID; using Terraria.ModLoader; using Terraria.ObjectData; -using Terraria.Enums; -using Terraria.DataStructures; namespace Tremor.Tiles { @@ -21,10 +20,10 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); TileObjectData.newTile.Origin = new Point16(1, 1); - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16 }; - TileObjectData.newTile.HookCheck = new PlacementHook(new Func(Chest.FindEmptyChest), -1, 0, true); - TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(new Func(Chest.AfterPlacement_Hook), -1, 0, false); - TileObjectData.newTile.AnchorInvalidTiles = new int[] { 127 }; + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16 }; + TileObjectData.newTile.HookCheck = new PlacementHook(Chest.FindEmptyChest, -1, 0, true); + TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(Chest.AfterPlacement_Hook, -1, 0, false); + TileObjectData.newTile.AnchorInvalidTiles = new[] { 127 }; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.LavaDeath = false; TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); @@ -44,10 +43,10 @@ public override void RightClick(int i, int j) { Main.CancelClothesWindow(true); Main.mouseRightRelease = false; - int left = (int)(Main.tile[Player.tileTargetX, Player.tileTargetY].frameX / 18); + int left = Main.tile[Player.tileTargetX, Player.tileTargetY].frameX / 18; left %= 3; left = Player.tileTargetX - left; - int top = Player.tileTargetY - (int)(Main.tile[Player.tileTargetX, Player.tileTargetY].frameY / 18); + int top = Player.tileTargetY - Main.tile[Player.tileTargetX, Player.tileTargetY].frameY / 18; if (player.sign > -1) { Main.PlaySound(SoundID.MenuClose); @@ -76,7 +75,7 @@ public override void RightClick(int i, int j) } else { - NetMessage.SendData(31, -1, -1, null, left, (float)top, 0f, 0f, 0, 0, 0); + NetMessage.SendData(31, -1, -1, null, left, top, 0f, 0f, 0, 0, 0); Main.stackSplit = 600; } } @@ -132,7 +131,7 @@ public override void MouseOverFar(int i, int j) Tile tile = Main.tile[Player.tileTargetX, Player.tileTargetY]; int left = Player.tileTargetX; int top = Player.tileTargetY; - left -= (int)(tile.frameX % 54 / 18); + left -= tile.frameX % 54 / 18; if (tile.frameY % 36 != 0) { top--; @@ -174,7 +173,7 @@ public override void MouseOver(int i, int j) Tile tile = Main.tile[Player.tileTargetX, Player.tileTargetY]; int left = Player.tileTargetX; int top = Player.tileTargetY; - left -= (int)(tile.frameX % 54 / 18); + left -= tile.frameX % 54 / 18; if (tile.frameY % 36 != 0) { top--; diff --git a/Tiles/GloomstoneGrandfatherClock.cs b/Tiles/GloomstoneGrandfatherClock.cs index 37c95bd8..b5eee400 100644 --- a/Tiles/GloomstoneGrandfatherClock.cs +++ b/Tiles/GloomstoneGrandfatherClock.cs @@ -14,7 +14,7 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); TileObjectData.newTile.Height = 5; - TileObjectData.newTile.CoordinateHeights = new int[]{16, 16, 16, 16, 16}; + TileObjectData.newTile.CoordinateHeights = new[]{16, 16, 16, 16, 16}; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 36; TileObjectData.addTile(Type); diff --git a/Tiles/GloomstoneLamp.cs b/Tiles/GloomstoneLamp.cs index ac27cc33..69add6f7 100644 --- a/Tiles/GloomstoneLamp.cs +++ b/Tiles/GloomstoneLamp.cs @@ -14,7 +14,7 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2); TileObjectData.newTile.Height = 3; - TileObjectData.newTile.CoordinateHeights = new int[]{16, 16, 16}; + TileObjectData.newTile.CoordinateHeights = new[]{16, 16, 16}; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 36; TileObjectData.addTile(Type); diff --git a/Tiles/GloomstoneLantern.cs b/Tiles/GloomstoneLantern.cs index 18ffdbaa..53bfc8ab 100644 --- a/Tiles/GloomstoneLantern.cs +++ b/Tiles/GloomstoneLantern.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2Top); TileObjectData.newTile.Height = 2; - TileObjectData.newTile.CoordinateHeights = new int[]{16, 16}; + TileObjectData.newTile.CoordinateHeights = new[]{16, 16}; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 111; TileObjectData.addTile(Type); diff --git a/Tiles/GloomstonePiano.cs b/Tiles/GloomstonePiano.cs index 6dec2570..a536c767 100644 --- a/Tiles/GloomstonePiano.cs +++ b/Tiles/GloomstonePiano.cs @@ -16,7 +16,7 @@ public override void SetDefaults() Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style4x2); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); AddMapEntry(new Color(8, 91, 146)); diff --git a/Tiles/GloomstonePlatform.cs b/Tiles/GloomstonePlatform.cs index f78a95a8..e9a40c2c 100644 --- a/Tiles/GloomstonePlatform.cs +++ b/Tiles/GloomstonePlatform.cs @@ -17,7 +17,7 @@ public override void SetDefaults() Main.tileNoAttach[Type] = true; Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; - TileObjectData.newTile.CoordinateHeights = new int[]{ 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16 }; TileObjectData.newTile.CoordinateWidth = 16; TileObjectData.newTile.CoordinatePadding = 2; TileObjectData.newTile.StyleHorizontal = true; diff --git a/Tiles/GloomstoneSink.cs b/Tiles/GloomstoneSink.cs index dbe2a01f..85900671 100644 --- a/Tiles/GloomstoneSink.cs +++ b/Tiles/GloomstoneSink.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); AddMapEntry(new Color(8, 91, 146)); diff --git a/Tiles/GloomstoneTable.cs b/Tiles/GloomstoneTable.cs index 9fd0570e..31aa1b00 100644 --- a/Tiles/GloomstoneTable.cs +++ b/Tiles/GloomstoneTable.cs @@ -16,7 +16,7 @@ public override void SetDefaults() Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); AddMapEntry(new Color(8, 91, 146)); diff --git a/Tiles/GloomstoneWorkbench.cs b/Tiles/GloomstoneWorkbench.cs index 155aaf91..6e9a46e7 100644 --- a/Tiles/GloomstoneWorkbench.cs +++ b/Tiles/GloomstoneWorkbench.cs @@ -16,7 +16,7 @@ public override void SetDefaults() Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x1); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.addTile(Type); adjTiles = new int[]{ TileID.WorkBenches }; AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); diff --git a/Tiles/GraniteMusicBox.cs b/Tiles/GraniteMusicBox.cs index 5fc2c730..89ffddad 100644 --- a/Tiles/GraniteMusicBox.cs +++ b/Tiles/GraniteMusicBox.cs @@ -1,8 +1,8 @@ using Microsoft.Xna.Framework; using Terraria; +using Terraria.DataStructures; using Terraria.ModLoader; using Terraria.ObjectData; -using Terraria.DataStructures; namespace Tremor.Tiles { diff --git a/Tiles/HardCometiteBarTile.cs b/Tiles/HardCometiteBarTile.cs index ab6c472f..24a1196a 100644 --- a/Tiles/HardCometiteBarTile.cs +++ b/Tiles/HardCometiteBarTile.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1); TileObjectData.newTile.Height = 1; - TileObjectData.newTile.CoordinateHeights = new int[]{16}; + TileObjectData.newTile.CoordinateHeights = new[]{16}; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 111; TileObjectData.addTile(Type); diff --git a/Tiles/Ladder.cs b/Tiles/Ladder.cs index a318ba97..a618751b 100644 --- a/Tiles/Ladder.cs +++ b/Tiles/Ladder.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x1); TileObjectData.newTile.Height = 1; - TileObjectData.newTile.CoordinateHeights = new int[]{16}; + TileObjectData.newTile.CoordinateHeights = new[]{16}; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 111; TileObjectData.addTile(Type); diff --git a/Tiles/MagmoniumBar.cs b/Tiles/MagmoniumBar.cs index 3652412b..8cb81ac0 100644 --- a/Tiles/MagmoniumBar.cs +++ b/Tiles/MagmoniumBar.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1); TileObjectData.newTile.Height = 1; - TileObjectData.newTile.CoordinateHeights = new int[]{16}; + TileObjectData.newTile.CoordinateHeights = new[]{16}; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 111; TileObjectData.addTile(Type); diff --git a/Tiles/MinersLampTile.cs b/Tiles/MinersLampTile.cs index 4f163e4b..b08c2ced 100644 --- a/Tiles/MinersLampTile.cs +++ b/Tiles/MinersLampTile.cs @@ -4,7 +4,6 @@ using Terraria.ModLoader; using Terraria.ObjectData; - namespace Tremor.Tiles { public class MinersLampTile : ModTile diff --git a/Tiles/MonsterBanner.cs b/Tiles/MonsterBanner.cs index 142a7120..92fe98c9 100644 --- a/Tiles/MonsterBanner.cs +++ b/Tiles/MonsterBanner.cs @@ -14,7 +14,7 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2Top); TileObjectData.newTile.Height = 3; - TileObjectData.newTile.CoordinateHeights = new int[]{16, 16, 16}; + TileObjectData.newTile.CoordinateHeights = new[]{16, 16, 16}; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 111; TileObjectData.addTile(Type); diff --git a/Tiles/NanoBar.cs b/Tiles/NanoBar.cs index b8ba5bfd..62d70b3b 100644 --- a/Tiles/NanoBar.cs +++ b/Tiles/NanoBar.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1); TileObjectData.newTile.Height = 1; - TileObjectData.newTile.CoordinateHeights = new int[]{16}; + TileObjectData.newTile.CoordinateHeights = new[]{16}; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 111; TileObjectData.addTile(Type); diff --git a/Tiles/NightmareBarTile.cs b/Tiles/NightmareBarTile.cs index aa0001a9..f121e6d5 100644 --- a/Tiles/NightmareBarTile.cs +++ b/Tiles/NightmareBarTile.cs @@ -17,7 +17,7 @@ public override void SetDefaults() soundStyle = 2; TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1); TileObjectData.newTile.Height = 1; - TileObjectData.newTile.CoordinateHeights = new int[]{16}; + TileObjectData.newTile.CoordinateHeights = new[]{16}; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 111; TileObjectData.addTile(Type); diff --git a/Tiles/PalmWoodArmchair.cs b/Tiles/PalmWoodArmchair.cs index 2b0c9703..f8e1419a 100644 --- a/Tiles/PalmWoodArmchair.cs +++ b/Tiles/PalmWoodArmchair.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileNoAttach[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); - TileObjectData.newTile.CoordinateHeights = new int[]{16, 16}; + TileObjectData.newTile.CoordinateHeights = new[]{16, 16}; TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; TileObjectData.newTile.StyleWrapLimit = 2; //not really necessary but allows me to add more subtypes of chairs below the example chair texture TileObjectData.newTile.StyleMultiplier = 2; //same as above diff --git a/Tiles/PearlwoodArmchair.cs b/Tiles/PearlwoodArmchair.cs index 845ae054..ffbd63e6 100644 --- a/Tiles/PearlwoodArmchair.cs +++ b/Tiles/PearlwoodArmchair.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileNoAttach[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); - TileObjectData.newTile.CoordinateHeights = new int[]{16, 16}; + TileObjectData.newTile.CoordinateHeights = new[]{16, 16}; TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; TileObjectData.newTile.StyleWrapLimit = 2; //not really necessary but allows me to add more subtypes of chairs below the example chair texture TileObjectData.newTile.StyleMultiplier = 2; //same as above diff --git a/Tiles/RedBrickChimney.cs b/Tiles/RedBrickChimney.cs index 9a65696a..332cd8b2 100644 --- a/Tiles/RedBrickChimney.cs +++ b/Tiles/RedBrickChimney.cs @@ -16,7 +16,7 @@ public override void SetDefaults() TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3); TileObjectData.addTile(Type); animationFrameHeight = 56; - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16, 18}; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16, 18}; AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); AddMapEntry(new Color(117, 117, 117)); } diff --git a/Tiles/RedSteelBar.cs b/Tiles/RedSteelBar.cs index a3108ba8..708e7959 100644 --- a/Tiles/RedSteelBar.cs +++ b/Tiles/RedSteelBar.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1); TileObjectData.newTile.Height = 1; - TileObjectData.newTile.CoordinateHeights = new int[]{16}; + TileObjectData.newTile.CoordinateHeights = new[]{16}; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 111; TileObjectData.addTile(Type); diff --git a/Tiles/RichMahoganyArmchair.cs b/Tiles/RichMahoganyArmchair.cs index 19bded66..6167ff20 100644 --- a/Tiles/RichMahoganyArmchair.cs +++ b/Tiles/RichMahoganyArmchair.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileNoAttach[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); - TileObjectData.newTile.CoordinateHeights = new int[]{16, 16}; + TileObjectData.newTile.CoordinateHeights = new[]{16, 16}; TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; TileObjectData.newTile.StyleWrapLimit = 2; //not really necessary but allows me to add more subtypes of chairs below the example chair texture TileObjectData.newTile.StyleMultiplier = 2; //same as above diff --git a/Tiles/RuinAltar.cs b/Tiles/RuinAltar.cs index d670028a..81fd217e 100644 --- a/Tiles/RuinAltar.cs +++ b/Tiles/RuinAltar.cs @@ -1,9 +1,9 @@ using Microsoft.Xna.Framework; using Terraria; +using Terraria.DataStructures; using Terraria.Enums; using Terraria.ModLoader; using Terraria.ObjectData; -using Terraria.DataStructures; namespace Tremor.Tiles { @@ -23,11 +23,11 @@ public override void SetDefaults() TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile, TileObjectData.newTile.Width, 0); TileObjectData.newTile.UsesCustomCanPlace = true; TileObjectData.newTile.LavaDeath = false; - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16 }; TileObjectData.newTile.CoordinateWidth = 16; TileObjectData.newTile.CoordinatePadding = 2; TileObjectData.addTile(Type); - this.AddMapEntry(Color.White); + AddMapEntry(Color.White); } public override bool CanKillTile(int i, int j, ref bool blockDamaged) diff --git a/Tiles/RuinChest.cs b/Tiles/RuinChest.cs index 6cec02e8..bf0394f3 100644 --- a/Tiles/RuinChest.cs +++ b/Tiles/RuinChest.cs @@ -1,4 +1,3 @@ -using System; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -22,10 +21,10 @@ public override void SetDefaults() Main.tileValue[Type] = 500; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.newTile.Origin = new Point16(0, 1); - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 18 }; - TileObjectData.newTile.HookCheck = new PlacementHook(new Func(Chest.FindEmptyChest), -1, 0, true); - TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(new Func(Chest.AfterPlacement_Hook), -1, 0, false); - TileObjectData.newTile.AnchorInvalidTiles = new int[] { 127 }; + TileObjectData.newTile.CoordinateHeights = new[] { 16, 18 }; + TileObjectData.newTile.HookCheck = new PlacementHook(Chest.FindEmptyChest, -1, 0, true); + TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(Chest.AfterPlacement_Hook, -1, 0, false); + TileObjectData.newTile.AnchorInvalidTiles = new[] { 127 }; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.LavaDeath = false; TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); @@ -55,10 +54,7 @@ public string MapChestName(string name, int i, int j) { return name; } - else - { - return name + ": " + Main.chest[chest].name; - } + return name + ": " + Main.chest[chest].name; } public override void NumDust(int i, int j, bool fail, ref int num) @@ -153,7 +149,7 @@ public override void RightClick(int i, int j) } else { - NetMessage.SendData(31, -1, -1, null, left, (float)top, 0f, 0f, 0, 0, 0); + NetMessage.SendData(31, -1, -1, null, left, top, 0f, 0f, 0, 0, 0); Main.stackSplit = 600; } } diff --git a/Tiles/RuneBarTile.cs b/Tiles/RuneBarTile.cs index 38f59ab2..6973c06f 100644 --- a/Tiles/RuneBarTile.cs +++ b/Tiles/RuneBarTile.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1); TileObjectData.newTile.Height = 1; - TileObjectData.newTile.CoordinateHeights = new int[]{16}; + TileObjectData.newTile.CoordinateHeights = new[]{16}; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 111; TileObjectData.addTile(Type); diff --git a/Tiles/SandstoneBar.cs b/Tiles/SandstoneBar.cs index 8a9eee59..b25798b3 100644 --- a/Tiles/SandstoneBar.cs +++ b/Tiles/SandstoneBar.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1); TileObjectData.newTile.Height = 1; - TileObjectData.newTile.CoordinateHeights = new int[]{16}; + TileObjectData.newTile.CoordinateHeights = new[]{16}; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 111; TileObjectData.addTile(Type); diff --git a/Tiles/SandstoneBathtub.cs b/Tiles/SandstoneBathtub.cs index 81e6c015..7050b019 100644 --- a/Tiles/SandstoneBathtub.cs +++ b/Tiles/SandstoneBathtub.cs @@ -13,7 +13,7 @@ public override void SetDefaults() Main.tileFrameImportant[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style4x2); //this style already takes care of direction for us - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); AddMapEntry(new Color(233, 211, 123)); diff --git a/Tiles/SandstoneBed.cs b/Tiles/SandstoneBed.cs index 6f37f8ea..5a8a9477 100644 --- a/Tiles/SandstoneBed.cs +++ b/Tiles/SandstoneBed.cs @@ -13,7 +13,7 @@ public override void SetDefaults() Main.tileFrameImportant[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style4x2); //this style already takes care of direction for us - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.addTile(Type); AddMapEntry(new Color(233, 211, 123)); adjTiles = new int[]{ TileID.Beds }; diff --git a/Tiles/SandstoneBench.cs b/Tiles/SandstoneBench.cs index 838e8c6b..fd993579 100644 --- a/Tiles/SandstoneBench.cs +++ b/Tiles/SandstoneBench.cs @@ -14,7 +14,7 @@ public override void SetDefaults() Main.tileNoAttach[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsChair); AddMapEntry(new Color(233, 211, 123)); diff --git a/Tiles/SandstoneBookcase.cs b/Tiles/SandstoneBookcase.cs index 6a54b609..d0458507 100644 --- a/Tiles/SandstoneBookcase.cs +++ b/Tiles/SandstoneBookcase.cs @@ -16,7 +16,7 @@ public override void SetDefaults() Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16, 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16, 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); AddMapEntry(new Color(233, 211, 123)); diff --git a/Tiles/SandstoneCandelabra.cs b/Tiles/SandstoneCandelabra.cs index 6fe6b7cd..64a667bc 100644 --- a/Tiles/SandstoneCandelabra.cs +++ b/Tiles/SandstoneCandelabra.cs @@ -4,7 +4,6 @@ using Terraria.ModLoader; using Terraria.ObjectData; - namespace Tremor.Tiles { public class SandstoneCandelabra : ModTile diff --git a/Tiles/SandstoneChair.cs b/Tiles/SandstoneChair.cs index 5fea63ae..24557a24 100644 --- a/Tiles/SandstoneChair.cs +++ b/Tiles/SandstoneChair.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileNoAttach[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2); - TileObjectData.newTile.CoordinateHeights = new int[]{16, 16}; + TileObjectData.newTile.CoordinateHeights = new[]{16, 16}; TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; TileObjectData.newTile.StyleWrapLimit = 2; //not really necessary but allows me to add more subtypes of chairs below the example chair texture TileObjectData.newTile.StyleMultiplier = 2; //same as above diff --git a/Tiles/SandstoneChandelier.cs b/Tiles/SandstoneChandelier.cs index 0dd416f2..7781fe0a 100644 --- a/Tiles/SandstoneChandelier.cs +++ b/Tiles/SandstoneChandelier.cs @@ -16,7 +16,7 @@ public override void SetDefaults() TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2Top); TileObjectData.newTile.Height = 3; TileObjectData.newTile.Width = 3; - TileObjectData.newTile.CoordinateHeights = new int[]{16, 16, 16}; + TileObjectData.newTile.CoordinateHeights = new[]{16, 16, 16}; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 111; TileObjectData.addTile(Type); diff --git a/Tiles/SandstoneChest.cs b/Tiles/SandstoneChest.cs index 7a020919..ee52fb0b 100644 --- a/Tiles/SandstoneChest.cs +++ b/Tiles/SandstoneChest.cs @@ -1,4 +1,3 @@ -using System; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -22,10 +21,10 @@ public override void SetDefaults() Main.tileValue[Type] = 500; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.newTile.Origin = new Point16(0, 1); - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 18 }; - TileObjectData.newTile.HookCheck = new PlacementHook(new Func(Chest.FindEmptyChest), -1, 0, true); - TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(new Func(Chest.AfterPlacement_Hook), -1, 0, false); - TileObjectData.newTile.AnchorInvalidTiles = new int[] { 127 }; + TileObjectData.newTile.CoordinateHeights = new[] { 16, 18 }; + TileObjectData.newTile.HookCheck = new PlacementHook(Chest.FindEmptyChest, -1, 0, true); + TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(Chest.AfterPlacement_Hook, -1, 0, false); + TileObjectData.newTile.AnchorInvalidTiles = new[] { 127 }; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.LavaDeath = false; TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); @@ -55,10 +54,7 @@ public string MapChestName(string name, int i, int j) { return name; } - else - { - return name + ": " + Main.chest[chest].name; - } + return name + ": " + Main.chest[chest].name; } public override void NumDust(int i, int j, bool fail, ref int num) @@ -115,7 +111,7 @@ public override void RightClick(int i, int j) } else { - NetMessage.SendData(31, -1, -1, null, left, (float)top, 0f, 0f, 0, 0, 0); + NetMessage.SendData(31, -1, -1, null, left, top, 0f, 0f, 0, 0, 0); Main.stackSplit = 600; } } diff --git a/Tiles/SandstoneDoorClosed.cs b/Tiles/SandstoneDoorClosed.cs index d81862e4..bc24ae51 100644 --- a/Tiles/SandstoneDoorClosed.cs +++ b/Tiles/SandstoneDoorClosed.cs @@ -26,7 +26,7 @@ public override void SetDefaults() TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile, TileObjectData.newTile.Width, 0); TileObjectData.newTile.UsesCustomCanPlace = true; TileObjectData.newTile.LavaDeath = true; - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16, 16 }; TileObjectData.newTile.CoordinateWidth = 16; TileObjectData.newTile.CoordinatePadding = 2; TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); diff --git a/Tiles/SandstoneDoorOpen.cs b/Tiles/SandstoneDoorOpen.cs index 36b8a536..b273bccc 100644 --- a/Tiles/SandstoneDoorOpen.cs +++ b/Tiles/SandstoneDoorOpen.cs @@ -23,7 +23,7 @@ public override void SetDefaults() TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile, 1, 0); TileObjectData.newTile.UsesCustomCanPlace = true; TileObjectData.newTile.LavaDeath = true; - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16, 16 }; TileObjectData.newTile.CoordinateWidth = 16; TileObjectData.newTile.CoordinatePadding = 2; TileObjectData.newTile.StyleHorizontal = true; diff --git a/Tiles/SandstoneDresser.cs b/Tiles/SandstoneDresser.cs index 5e16266a..d91bf825 100644 --- a/Tiles/SandstoneDresser.cs +++ b/Tiles/SandstoneDresser.cs @@ -1,11 +1,10 @@ -using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.DataStructures; +using Terraria.Enums; using Terraria.ID; using Terraria.ModLoader; using Terraria.ObjectData; -using Terraria.Enums; -using Terraria.DataStructures; namespace Tremor.Tiles { @@ -21,10 +20,10 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); TileObjectData.newTile.Origin = new Point16(1, 1); - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16 }; - TileObjectData.newTile.HookCheck = new PlacementHook(new Func(Chest.FindEmptyChest), -1, 0, true); - TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(new Func(Chest.AfterPlacement_Hook), -1, 0, false); - TileObjectData.newTile.AnchorInvalidTiles = new int[] { 127 }; + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16 }; + TileObjectData.newTile.HookCheck = new PlacementHook(Chest.FindEmptyChest, -1, 0, true); + TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(Chest.AfterPlacement_Hook, -1, 0, false); + TileObjectData.newTile.AnchorInvalidTiles = new[] { 127 }; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.LavaDeath = false; TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); @@ -44,10 +43,10 @@ public override void RightClick(int i, int j) { Main.CancelClothesWindow(true); Main.mouseRightRelease = false; - int left = (int)(Main.tile[Player.tileTargetX, Player.tileTargetY].frameX / 18); + int left = Main.tile[Player.tileTargetX, Player.tileTargetY].frameX / 18; left %= 3; left = Player.tileTargetX - left; - int top = Player.tileTargetY - (int)(Main.tile[Player.tileTargetX, Player.tileTargetY].frameY / 18); + int top = Player.tileTargetY - Main.tile[Player.tileTargetX, Player.tileTargetY].frameY / 18; if (player.sign > -1) { Main.PlaySound(SoundID.MenuClose); @@ -76,7 +75,7 @@ public override void RightClick(int i, int j) } else { - NetMessage.SendData(31, -1, -1, null, left, (float)top, 0f, 0f, 0, 0, 0); + NetMessage.SendData(31, -1, -1, null, left, top, 0f, 0f, 0, 0, 0); Main.stackSplit = 600; } } @@ -132,7 +131,7 @@ public override void MouseOverFar(int i, int j) Tile tile = Main.tile[Player.tileTargetX, Player.tileTargetY]; int left = Player.tileTargetX; int top = Player.tileTargetY; - left -= (int)(tile.frameX % 54 / 18); + left -= tile.frameX % 54 / 18; if (tile.frameY % 36 != 0) { top--; @@ -174,7 +173,7 @@ public override void MouseOver(int i, int j) Tile tile = Main.tile[Player.tileTargetX, Player.tileTargetY]; int left = Player.tileTargetX; int top = Player.tileTargetY; - left -= (int)(tile.frameX % 54 / 18); + left -= tile.frameX % 54 / 18; if (tile.frameY % 36 != 0) { top--; diff --git a/Tiles/SandstoneGrandfatherClock.cs b/Tiles/SandstoneGrandfatherClock.cs index bc56783d..97eb5a2f 100644 --- a/Tiles/SandstoneGrandfatherClock.cs +++ b/Tiles/SandstoneGrandfatherClock.cs @@ -14,7 +14,7 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); TileObjectData.newTile.Height = 5; - TileObjectData.newTile.CoordinateHeights = new int[]{16, 16, 16, 16, 16}; + TileObjectData.newTile.CoordinateHeights = new[]{16, 16, 16, 16, 16}; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 36; TileObjectData.addTile(Type); diff --git a/Tiles/SandstoneLamp.cs b/Tiles/SandstoneLamp.cs index 86897de7..440a77c8 100644 --- a/Tiles/SandstoneLamp.cs +++ b/Tiles/SandstoneLamp.cs @@ -14,7 +14,7 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2); TileObjectData.newTile.Height = 3; - TileObjectData.newTile.CoordinateHeights = new int[]{16, 16, 16}; + TileObjectData.newTile.CoordinateHeights = new[]{16, 16, 16}; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 36; TileObjectData.addTile(Type); diff --git a/Tiles/SandstoneLantern.cs b/Tiles/SandstoneLantern.cs index 8aeac062..367ade46 100644 --- a/Tiles/SandstoneLantern.cs +++ b/Tiles/SandstoneLantern.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2Top); TileObjectData.newTile.Height = 2; - TileObjectData.newTile.CoordinateHeights = new int[]{16, 16}; + TileObjectData.newTile.CoordinateHeights = new[]{16, 16}; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 111; TileObjectData.addTile(Type); diff --git a/Tiles/SandstonePiano.cs b/Tiles/SandstonePiano.cs index 3543a63b..e211f742 100644 --- a/Tiles/SandstonePiano.cs +++ b/Tiles/SandstonePiano.cs @@ -16,7 +16,7 @@ public override void SetDefaults() Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style4x2); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); AddMapEntry(new Color(233, 211, 123)); diff --git a/Tiles/SandstonePlatform.cs b/Tiles/SandstonePlatform.cs index 93b8d614..4c9ee41d 100644 --- a/Tiles/SandstonePlatform.cs +++ b/Tiles/SandstonePlatform.cs @@ -17,7 +17,7 @@ public override void SetDefaults() Main.tileNoAttach[Type] = true; Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; - TileObjectData.newTile.CoordinateHeights = new int[]{ 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16 }; TileObjectData.newTile.CoordinateWidth = 16; TileObjectData.newTile.CoordinatePadding = 2; TileObjectData.newTile.StyleHorizontal = true; diff --git a/Tiles/SandstoneSink.cs b/Tiles/SandstoneSink.cs index ba880659..29f0d6a5 100644 --- a/Tiles/SandstoneSink.cs +++ b/Tiles/SandstoneSink.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); AddMapEntry(new Color(200, 200, 200)); diff --git a/Tiles/SandstoneTable.cs b/Tiles/SandstoneTable.cs index e591f063..2f0e6eb7 100644 --- a/Tiles/SandstoneTable.cs +++ b/Tiles/SandstoneTable.cs @@ -16,7 +16,7 @@ public override void SetDefaults() Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); AddMapEntry(new Color(233, 211, 123)); diff --git a/Tiles/SandstoneWorkbench.cs b/Tiles/SandstoneWorkbench.cs index d137415b..bb09b263 100644 --- a/Tiles/SandstoneWorkbench.cs +++ b/Tiles/SandstoneWorkbench.cs @@ -16,7 +16,7 @@ public override void SetDefaults() Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x1); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.addTile(Type); adjTiles = new int[]{ TileID.WorkBenches }; AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); diff --git a/Tiles/Scarecrow.cs b/Tiles/Scarecrow.cs index 58f21ea8..8b56be95 100644 --- a/Tiles/Scarecrow.cs +++ b/Tiles/Scarecrow.cs @@ -14,7 +14,7 @@ public override void SetDefaults() Main.tileNoAttach[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4); - TileObjectData.newTile.CoordinateHeights = new int[]{16, 16, 16, 16}; + TileObjectData.newTile.CoordinateHeights = new[]{16, 16, 16, 16}; TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; TileObjectData.newTile.StyleWrapLimit = 2; //not really necessary but allows me to add more subtypes of chairs below the example chair texture TileObjectData.newTile.StyleMultiplier = 2; //same as above diff --git a/Tiles/ScaryDoorClosed.cs b/Tiles/ScaryDoorClosed.cs index a5f223d9..d6b3b09f 100644 --- a/Tiles/ScaryDoorClosed.cs +++ b/Tiles/ScaryDoorClosed.cs @@ -24,7 +24,7 @@ public override void SetDefaults() TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile, TileObjectData.newTile.Width, 0); TileObjectData.newTile.UsesCustomCanPlace = true; TileObjectData.newTile.LavaDeath = true; - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16, 16 }; TileObjectData.newTile.CoordinateWidth = 16; TileObjectData.newTile.CoordinatePadding = 2; TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); diff --git a/Tiles/ScaryDoorOpen.cs b/Tiles/ScaryDoorOpen.cs index 0b6872c0..f13a97fd 100644 --- a/Tiles/ScaryDoorOpen.cs +++ b/Tiles/ScaryDoorOpen.cs @@ -23,7 +23,7 @@ public override void SetDefaults() TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile, 1, 0); TileObjectData.newTile.UsesCustomCanPlace = true; TileObjectData.newTile.LavaDeath = true; - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16, 16 }; TileObjectData.newTile.CoordinateWidth = 16; TileObjectData.newTile.CoordinatePadding = 2; TileObjectData.newTile.StyleHorizontal = true; diff --git a/Tiles/ShadewoodArmchair.cs b/Tiles/ShadewoodArmchair.cs index 1235a0bc..5bed9242 100644 --- a/Tiles/ShadewoodArmchair.cs +++ b/Tiles/ShadewoodArmchair.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileNoAttach[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); - TileObjectData.newTile.CoordinateHeights = new int[]{16, 16}; + TileObjectData.newTile.CoordinateHeights = new[]{16, 16}; TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; TileObjectData.newTile.StyleWrapLimit = 2; //not really necessary but allows me to add more subtypes of chairs below the example chair texture TileObjectData.newTile.StyleMultiplier = 2; //same as above diff --git a/Tiles/SilkTentTile.cs b/Tiles/SilkTentTile.cs index 6387431b..6f7c20c8 100644 --- a/Tiles/SilkTentTile.cs +++ b/Tiles/SilkTentTile.cs @@ -17,7 +17,7 @@ public override void SetDefaults() Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; TileObjectData.newTile.StyleWrapLimit = 2; //not really necessary but allows me to add more subtypes of chairs below the example chair texture TileObjectData.newTile.StyleMultiplier = 2; //same as above diff --git a/Tiles/SlimeRainMusicBox.cs b/Tiles/SlimeRainMusicBox.cs index 61951455..202bb843 100644 --- a/Tiles/SlimeRainMusicBox.cs +++ b/Tiles/SlimeRainMusicBox.cs @@ -1,8 +1,8 @@ using Microsoft.Xna.Framework; using Terraria; +using Terraria.DataStructures; using Terraria.ModLoader; using Terraria.ObjectData; -using Terraria.DataStructures; namespace Tremor.Tiles { diff --git a/Tiles/StarBarTile.cs b/Tiles/StarBarTile.cs index 93e53e47..16ca91b6 100644 --- a/Tiles/StarBarTile.cs +++ b/Tiles/StarBarTile.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1); TileObjectData.newTile.Height = 1; - TileObjectData.newTile.CoordinateHeights = new int[]{16}; + TileObjectData.newTile.CoordinateHeights = new[]{16}; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 111; TileObjectData.addTile(Type); diff --git a/Tiles/StarvilTile.cs b/Tiles/StarvilTile.cs index 021ed9c6..7825903b 100644 --- a/Tiles/StarvilTile.cs +++ b/Tiles/StarvilTile.cs @@ -14,7 +14,7 @@ public override void SetDefaults() Main.tileNoAttach[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsChair); ModTranslation name = CreateMapEntryName(); diff --git a/Tiles/SteelBar.cs b/Tiles/SteelBar.cs index d0c3c9b2..41f95f0d 100644 --- a/Tiles/SteelBar.cs +++ b/Tiles/SteelBar.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1); TileObjectData.newTile.Height = 1; - TileObjectData.newTile.CoordinateHeights = new int[]{16}; + TileObjectData.newTile.CoordinateHeights = new[]{16}; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 111; TileObjectData.addTile(Type); diff --git a/Tiles/StoneBathtub.cs b/Tiles/StoneBathtub.cs index 7d873f24..05367b4f 100644 --- a/Tiles/StoneBathtub.cs +++ b/Tiles/StoneBathtub.cs @@ -13,7 +13,7 @@ public override void SetDefaults() Main.tileFrameImportant[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style4x2); //this style already takes care of direction for us - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); AddMapEntry(new Color(162, 162, 162)); diff --git a/Tiles/StoneBed.cs b/Tiles/StoneBed.cs index e5439198..6f29a7ad 100644 --- a/Tiles/StoneBed.cs +++ b/Tiles/StoneBed.cs @@ -13,7 +13,7 @@ public override void SetDefaults() Main.tileFrameImportant[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style4x2); //this style already takes care of direction for us - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.addTile(Type); AddMapEntry(new Color(162, 162, 162)); adjTiles = new int[]{ TileID.Beds }; diff --git a/Tiles/StoneBench.cs b/Tiles/StoneBench.cs index 0a1b324e..26d0635f 100644 --- a/Tiles/StoneBench.cs +++ b/Tiles/StoneBench.cs @@ -14,7 +14,7 @@ public override void SetDefaults() Main.tileNoAttach[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsChair); AddMapEntry(new Color(162, 162, 162)); diff --git a/Tiles/StoneBookcase.cs b/Tiles/StoneBookcase.cs index 4eed8cf7..53c7dd00 100644 --- a/Tiles/StoneBookcase.cs +++ b/Tiles/StoneBookcase.cs @@ -16,7 +16,7 @@ public override void SetDefaults() Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16, 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16, 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); AddMapEntry(new Color(162, 162, 162)); diff --git a/Tiles/StoneChair.cs b/Tiles/StoneChair.cs index ee1dac8b..b6530c0e 100644 --- a/Tiles/StoneChair.cs +++ b/Tiles/StoneChair.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileNoAttach[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2); - TileObjectData.newTile.CoordinateHeights = new int[]{16, 16}; + TileObjectData.newTile.CoordinateHeights = new[]{16, 16}; TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; TileObjectData.newTile.StyleWrapLimit = 2; //not really necessary but allows me to add more subtypes of chairs below the example chair texture TileObjectData.newTile.StyleMultiplier = 2; //same as above diff --git a/Tiles/StoneChest.cs b/Tiles/StoneChest.cs index 76fd5e64..303fb9fc 100644 --- a/Tiles/StoneChest.cs +++ b/Tiles/StoneChest.cs @@ -1,4 +1,3 @@ -using System; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -22,10 +21,10 @@ public override void SetDefaults() Main.tileValue[Type] = 500; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.newTile.Origin = new Point16(0, 1); - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 18 }; - TileObjectData.newTile.HookCheck = new PlacementHook(new Func(Chest.FindEmptyChest), -1, 0, true); - TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(new Func(Chest.AfterPlacement_Hook), -1, 0, false); - TileObjectData.newTile.AnchorInvalidTiles = new int[] { 127 }; + TileObjectData.newTile.CoordinateHeights = new[] { 16, 18 }; + TileObjectData.newTile.HookCheck = new PlacementHook(Chest.FindEmptyChest, -1, 0, true); + TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(Chest.AfterPlacement_Hook, -1, 0, false); + TileObjectData.newTile.AnchorInvalidTiles = new[] { 127 }; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.LavaDeath = false; TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); @@ -55,10 +54,7 @@ public string MapChestName(string name, int i, int j) { return name; } - else - { - return name + ": " + Main.chest[chest].name; - } + return name + ": " + Main.chest[chest].name; } public override void NumDust(int i, int j, bool fail, ref int num) @@ -115,7 +111,7 @@ public override void RightClick(int i, int j) } else { - NetMessage.SendData(31, -1, -1, null, left, (float)top, 0f, 0f, 0, 0, 0); + NetMessage.SendData(31, -1, -1, null, left, top, 0f, 0f, 0, 0, 0); Main.stackSplit = 600; } } diff --git a/Tiles/StoneDoorClosed.cs b/Tiles/StoneDoorClosed.cs index b41aae03..f8bf832b 100644 --- a/Tiles/StoneDoorClosed.cs +++ b/Tiles/StoneDoorClosed.cs @@ -26,7 +26,7 @@ public override void SetDefaults() TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile, TileObjectData.newTile.Width, 0); TileObjectData.newTile.UsesCustomCanPlace = true; TileObjectData.newTile.LavaDeath = true; - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16, 16 }; TileObjectData.newTile.CoordinateWidth = 16; TileObjectData.newTile.CoordinatePadding = 2; TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); diff --git a/Tiles/StoneDoorOpen.cs b/Tiles/StoneDoorOpen.cs index 5ebf0a54..8cfcb404 100644 --- a/Tiles/StoneDoorOpen.cs +++ b/Tiles/StoneDoorOpen.cs @@ -23,7 +23,7 @@ public override void SetDefaults() TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile, 1, 0); TileObjectData.newTile.UsesCustomCanPlace = true; TileObjectData.newTile.LavaDeath = true; - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16, 16 }; TileObjectData.newTile.CoordinateWidth = 16; TileObjectData.newTile.CoordinatePadding = 2; TileObjectData.newTile.StyleHorizontal = true; diff --git a/Tiles/StoneDresser.cs b/Tiles/StoneDresser.cs index 65b05076..831e9f81 100644 --- a/Tiles/StoneDresser.cs +++ b/Tiles/StoneDresser.cs @@ -1,11 +1,10 @@ -using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.DataStructures; +using Terraria.Enums; using Terraria.ID; using Terraria.ModLoader; using Terraria.ObjectData; -using Terraria.Enums; -using Terraria.DataStructures; namespace Tremor.Tiles { @@ -21,10 +20,10 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); TileObjectData.newTile.Origin = new Point16(1, 1); - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16 }; - TileObjectData.newTile.HookCheck = new PlacementHook(new Func(Chest.FindEmptyChest), -1, 0, true); - TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(new Func(Chest.AfterPlacement_Hook), -1, 0, false); - TileObjectData.newTile.AnchorInvalidTiles = new int[] { 127 }; + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16 }; + TileObjectData.newTile.HookCheck = new PlacementHook(Chest.FindEmptyChest, -1, 0, true); + TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(Chest.AfterPlacement_Hook, -1, 0, false); + TileObjectData.newTile.AnchorInvalidTiles = new[] { 127 }; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.LavaDeath = false; TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); @@ -44,10 +43,10 @@ public override void RightClick(int i, int j) { Main.CancelClothesWindow(true); Main.mouseRightRelease = false; - int left = (int)(Main.tile[Player.tileTargetX, Player.tileTargetY].frameX / 18); + int left = Main.tile[Player.tileTargetX, Player.tileTargetY].frameX / 18; left %= 3; left = Player.tileTargetX - left; - int top = Player.tileTargetY - (int)(Main.tile[Player.tileTargetX, Player.tileTargetY].frameY / 18); + int top = Player.tileTargetY - Main.tile[Player.tileTargetX, Player.tileTargetY].frameY / 18; if (player.sign > -1) { Main.PlaySound(SoundID.MenuClose); @@ -76,7 +75,7 @@ public override void RightClick(int i, int j) } else { - NetMessage.SendData(31, -1, -1, null, left, (float)top, 0f, 0f, 0, 0, 0); + NetMessage.SendData(31, -1, -1, null, left, top, 0f, 0f, 0, 0, 0); Main.stackSplit = 600; } } @@ -132,7 +131,7 @@ public override void MouseOverFar(int i, int j) Tile tile = Main.tile[Player.tileTargetX, Player.tileTargetY]; int left = Player.tileTargetX; int top = Player.tileTargetY; - left -= (int)(tile.frameX % 54 / 18); + left -= tile.frameX % 54 / 18; if (tile.frameY % 36 != 0) { top--; @@ -174,7 +173,7 @@ public override void MouseOver(int i, int j) Tile tile = Main.tile[Player.tileTargetX, Player.tileTargetY]; int left = Player.tileTargetX; int top = Player.tileTargetY; - left -= (int)(tile.frameX % 54 / 18); + left -= tile.frameX % 54 / 18; if (tile.frameY % 36 != 0) { top--; diff --git a/Tiles/StoneGrandfatherClock.cs b/Tiles/StoneGrandfatherClock.cs index 09eace9a..fcb47617 100644 --- a/Tiles/StoneGrandfatherClock.cs +++ b/Tiles/StoneGrandfatherClock.cs @@ -14,7 +14,7 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); TileObjectData.newTile.Height = 5; - TileObjectData.newTile.CoordinateHeights = new int[]{16, 16, 16, 16, 16}; + TileObjectData.newTile.CoordinateHeights = new[]{16, 16, 16, 16, 16}; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 36; TileObjectData.addTile(Type); diff --git a/Tiles/StonePiano.cs b/Tiles/StonePiano.cs index f4691ddd..78c80d68 100644 --- a/Tiles/StonePiano.cs +++ b/Tiles/StonePiano.cs @@ -16,7 +16,7 @@ public override void SetDefaults() Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style4x2); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); AddMapEntry(new Color(162, 162, 162)); diff --git a/Tiles/StonePlatform.cs b/Tiles/StonePlatform.cs index 10bed3fe..7f24b3a9 100644 --- a/Tiles/StonePlatform.cs +++ b/Tiles/StonePlatform.cs @@ -17,7 +17,7 @@ public override void SetDefaults() Main.tileNoAttach[Type] = true; Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; - TileObjectData.newTile.CoordinateHeights = new int[]{ 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16 }; TileObjectData.newTile.CoordinateWidth = 16; TileObjectData.newTile.CoordinatePadding = 2; TileObjectData.newTile.StyleHorizontal = true; diff --git a/Tiles/StoneSink.cs b/Tiles/StoneSink.cs index 0f2f3616..e6c8efdb 100644 --- a/Tiles/StoneSink.cs +++ b/Tiles/StoneSink.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); AddMapEntry(new Color(162, 162, 162)); diff --git a/Tiles/StoneTable.cs b/Tiles/StoneTable.cs index 671e8891..668dabf8 100644 --- a/Tiles/StoneTable.cs +++ b/Tiles/StoneTable.cs @@ -16,7 +16,7 @@ public override void SetDefaults() Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); AddMapEntry(new Color(162, 162, 162)); diff --git a/Tiles/StoneWorkbench.cs b/Tiles/StoneWorkbench.cs index e9ea6cdc..887d3392 100644 --- a/Tiles/StoneWorkbench.cs +++ b/Tiles/StoneWorkbench.cs @@ -16,7 +16,7 @@ public override void SetDefaults() Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x1); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.addTile(Type); adjTiles = new int[]{ TileID.WorkBenches }; AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); diff --git a/Tiles/TentTile.cs b/Tiles/TentTile.cs index 316a6058..7e24518a 100644 --- a/Tiles/TentTile.cs +++ b/Tiles/TentTile.cs @@ -24,7 +24,7 @@ public override void SetDefaults() TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; //allows me to place example chairs facing the same way as the player TileObjectData.addAlternate(1); //facing right will use the second texture style - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); AddMapEntry(new Color(181, 166, 124)); diff --git a/Tiles/TikiTotemMusicBox.cs b/Tiles/TikiTotemMusicBox.cs index 7f3e2f2f..a9f3d5a2 100644 --- a/Tiles/TikiTotemMusicBox.cs +++ b/Tiles/TikiTotemMusicBox.cs @@ -1,8 +1,8 @@ using Microsoft.Xna.Framework; using Terraria; +using Terraria.DataStructures; using Terraria.ModLoader; using Terraria.ObjectData; -using Terraria.DataStructures; namespace Tremor.Tiles { diff --git a/Tiles/TremorTiles.cs b/Tiles/TremorTiles.cs index c62ca137..c39114fe 100644 --- a/Tiles/TremorTiles.cs +++ b/Tiles/TremorTiles.cs @@ -1,6 +1,6 @@ using Terraria; -using Terraria.ModLoader; using Terraria.ID; +using Terraria.ModLoader; namespace Tremor { diff --git a/Tiles/TrinityMusicBox.cs b/Tiles/TrinityMusicBox.cs index 1214dd24..658792dc 100644 --- a/Tiles/TrinityMusicBox.cs +++ b/Tiles/TrinityMusicBox.cs @@ -1,8 +1,8 @@ using Microsoft.Xna.Framework; using Terraria; +using Terraria.DataStructures; using Terraria.ModLoader; using Terraria.ObjectData; -using Terraria.DataStructures; namespace Tremor.Tiles { diff --git a/Tiles/VoidBarTile.cs b/Tiles/VoidBarTile.cs index 61d5e391..9795a043 100644 --- a/Tiles/VoidBarTile.cs +++ b/Tiles/VoidBarTile.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1); TileObjectData.newTile.Height = 1; - TileObjectData.newTile.CoordinateHeights = new int[]{16}; + TileObjectData.newTile.CoordinateHeights = new[]{16}; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 111; TileObjectData.addTile(Type); diff --git a/Tiles/WhiteGoldBarTile.cs b/Tiles/WhiteGoldBarTile.cs index 319ce16f..4e02e8fd 100644 --- a/Tiles/WhiteGoldBarTile.cs +++ b/Tiles/WhiteGoldBarTile.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1); TileObjectData.newTile.Height = 1; - TileObjectData.newTile.CoordinateHeights = new int[]{16}; + TileObjectData.newTile.CoordinateHeights = new[]{16}; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 111; TileObjectData.addTile(Type); diff --git a/Tremor.cs b/Tremor.cs index fa0aa197..e530e632 100644 --- a/Tremor.cs +++ b/Tremor.cs @@ -4,14 +4,14 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; -using Terraria.ID; -using Terraria.ModLoader; using Terraria.Graphics.Effects; using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; using Terraria.UI; using Tremor.Invasion; -using Tremor.ZombieEvent; using Tremor.NovaPillar; +using Tremor.ZombieEvent; namespace Tremor { @@ -23,7 +23,7 @@ public class Tremor : Mod public Tremor() { - Properties = new ModProperties() + Properties = new ModProperties { Autoload = true, AutoloadGores = true, @@ -41,26 +41,11 @@ public static void Log(string format, params object[] args) ErrorLogger.Log(String.Format("[Tremor][{0}] {1}", DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), String.Format(format, args))); } - private Mod mod - { - get - { - return ModLoader.GetMod("Tremor"); - } - } + private Mod mod => ModLoader.GetMod("Tremor"); public override void AddRecipeGroups() { - RecipeGroup group = new RecipeGroup(() => Lang.misc[37] + " " + Lang.GetItemNameValue(ItemType("AmethystStaff")), new int[] - { - ItemType("AmethystStaff"), - ItemType("DiamondStaff"), - ItemType("RubyStaff"), - ItemType("TopazStaff"), - ItemType("SapphireStaff"), - ItemType("AmberStaff"), - ItemType("EmeraldStaff") - }); + RecipeGroup group = new RecipeGroup(() => Lang.misc[37] + " " + Lang.GetItemNameValue(ItemType("AmethystStaff")), ItemType("AmethystStaff"), ItemType("DiamondStaff"), ItemType("RubyStaff"), ItemType("TopazStaff"), ItemType("SapphireStaff"), ItemType("AmberStaff"), ItemType("EmeraldStaff")); RecipeGroup.RegisterGroup("Tremor:GemStaves", group); } @@ -73,9 +58,9 @@ public override void UpdateMusic(ref int music) TremorPlayer modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); int[] NoOverride = {MusicID.Boss1, MusicID.Boss2, MusicID.Boss3, MusicID.Boss4, MusicID.Boss5, MusicID.LunarBoss, MusicID.PumpkinMoon, MusicID.TheTowers, MusicID.FrostMoon, MusicID.GoblinInvasion, MusicID.Eclipse, MusicID.MartianMadness, - MusicID.PirateInvasion, this.GetSoundSlot(SoundType.Music, "Sounds/Music/CyberKing"), this.GetSoundSlot(SoundType.Music, "Sounds/Music/Boss6"), this.GetSoundSlot(SoundType.Music, "Sounds/Music/Trinity"), - this.GetSoundSlot(SoundType.Music, "Sounds/Music/SlimeRain"), this.GetSoundSlot(SoundType.Music, "Sounds/Music/EvilCorn"), this.GetSoundSlot(SoundType.Music, "Sounds/Music/TikiTotem"), this.GetSoundSlot(SoundType.Music, "Sounds/Music/CogLord"), - this.GetSoundSlot(SoundType.Music, "Sounds/Music/NightOfUndead"), this.GetSoundSlot(SoundType.Music, "Sounds/Music/CyberWrath")}; + MusicID.PirateInvasion, GetSoundSlot(SoundType.Music, "Sounds/Music/CyberKing"), GetSoundSlot(SoundType.Music, "Sounds/Music/Boss6"), GetSoundSlot(SoundType.Music, "Sounds/Music/Trinity"), + GetSoundSlot(SoundType.Music, "Sounds/Music/SlimeRain"), GetSoundSlot(SoundType.Music, "Sounds/Music/EvilCorn"), GetSoundSlot(SoundType.Music, "Sounds/Music/TikiTotem"), GetSoundSlot(SoundType.Music, "Sounds/Music/CogLord"), + GetSoundSlot(SoundType.Music, "Sounds/Music/NightOfUndead"), GetSoundSlot(SoundType.Music, "Sounds/Music/CyberWrath")}; bool playMusic = true; foreach (int n in NoOverride) { @@ -93,82 +78,82 @@ public override void UpdateMusic(ref int music) if (Main.player[Main.myPlayer].active && Main.player[Main.myPlayer].GetModPlayer(this).ZoneGranite && playMusic) { - music = this.GetSoundSlot(SoundType.Music, "Sounds/Music/Granite"); + music = GetSoundSlot(SoundType.Music, "Sounds/Music/Granite"); } if (ZWorld.ZInvasion && playMusic) { - music = this.GetSoundSlot(SoundType.Music, "Sounds/Music/NightOfUndead"); + music = GetSoundSlot(SoundType.Music, "Sounds/Music/NightOfUndead"); } CyberWrathInvasion modPlayer1 = Main.player[Main.myPlayer].GetModPlayer(mod); if (InvasionWorld.CyberWrath) { - music = this.GetSoundSlot(SoundType.Music, "Sounds/Music/CyberWrath"); + music = GetSoundSlot(SoundType.Music, "Sounds/Music/CyberWrath"); } - if (Main.player[Main.myPlayer].active && NPC.AnyNPCs(this.NPCType("CogLord"))) + if (Main.player[Main.myPlayer].active && NPC.AnyNPCs(NPCType("CogLord"))) { - music = this.GetSoundSlot(SoundType.Music, "Sounds/Music/CogLord"); + music = GetSoundSlot(SoundType.Music, "Sounds/Music/CogLord"); } if (Main.player[Main.myPlayer].active && NPC.AnyNPCs(50)) { - music = this.GetSoundSlot(SoundType.Music, "Sounds/Music/Boss6"); + music = GetSoundSlot(SoundType.Music, "Sounds/Music/Boss6"); } - if (Main.player[Main.myPlayer].active && (NPC.AnyNPCs(this.NPCType("TikiTotem")) || NPC.AnyNPCs(this.NPCType("HappySoul")) || NPC.AnyNPCs(this.NPCType("AngerSoul")) || NPC.AnyNPCs(this.NPCType("IndifferenceSoul")))) + if (Main.player[Main.myPlayer].active && (NPC.AnyNPCs(NPCType("TikiTotem")) || NPC.AnyNPCs(NPCType("HappySoul")) || NPC.AnyNPCs(NPCType("AngerSoul")) || NPC.AnyNPCs(NPCType("IndifferenceSoul")))) { - music = this.GetSoundSlot(SoundType.Music, "Sounds/Music/TikiTotem"); + music = GetSoundSlot(SoundType.Music, "Sounds/Music/TikiTotem"); } - if (Main.player[Main.myPlayer].active && NPC.AnyNPCs(this.NPCType("EvilCorn"))) + if (Main.player[Main.myPlayer].active && NPC.AnyNPCs(NPCType("EvilCorn"))) { - music = this.GetSoundSlot(SoundType.Music, "Sounds/Music/EvilCorn"); + music = GetSoundSlot(SoundType.Music, "Sounds/Music/EvilCorn"); } if (Main.player[Main.myPlayer].active && Main.invasionType == 2) { - music = this.GetSoundSlot(SoundType.Music, "Sounds/Music/Boss6"); + music = GetSoundSlot(SoundType.Music, "Sounds/Music/Boss6"); } if (Main.player[Main.myPlayer].active && Main.slimeRain && !NPC.AnyNPCs(50) && !Main.eclipse && playMusic) { - music = this.GetSoundSlot(SoundType.Music, "Sounds/Music/SlimeRain"); + music = GetSoundSlot(SoundType.Music, "Sounds/Music/SlimeRain"); } - if (Main.player[Main.myPlayer].active && NPC.AnyNPCs(this.NPCType("SoulofTruth"))) + if (Main.player[Main.myPlayer].active && NPC.AnyNPCs(NPCType("SoulofTruth"))) { - music = this.GetSoundSlot(SoundType.Music, "Sounds/Music/Trinity"); + music = GetSoundSlot(SoundType.Music, "Sounds/Music/Trinity"); } - if (Main.player[Main.myPlayer].active && NPC.AnyNPCs(this.NPCType("SoulofTrust"))) + if (Main.player[Main.myPlayer].active && NPC.AnyNPCs(NPCType("SoulofTrust"))) { - music = this.GetSoundSlot(SoundType.Music, "Sounds/Music/Trinity"); + music = GetSoundSlot(SoundType.Music, "Sounds/Music/Trinity"); } - if (Main.player[Main.myPlayer].active && NPC.AnyNPCs(this.NPCType("SoulofHope"))) + if (Main.player[Main.myPlayer].active && NPC.AnyNPCs(NPCType("SoulofHope"))) { - music = this.GetSoundSlot(SoundType.Music, "Sounds/Music/Trinity"); + music = GetSoundSlot(SoundType.Music, "Sounds/Music/Trinity"); } - if (Main.player[Main.myPlayer].active && NPC.AnyNPCs(this.NPCType("FrostKing"))) + if (Main.player[Main.myPlayer].active && NPC.AnyNPCs(NPCType("FrostKing"))) { - music = this.GetSoundSlot(SoundType.Music, "Sounds/Music/Boss6"); + music = GetSoundSlot(SoundType.Music, "Sounds/Music/Boss6"); } - if (Main.player[Main.myPlayer].active && NPC.AnyNPCs(this.NPCType("CyberKing"))) + if (Main.player[Main.myPlayer].active && NPC.AnyNPCs(NPCType("CyberKing"))) { - music = this.GetSoundSlot(SoundType.Music, "Sounds/Music/CyberKing"); + music = GetSoundSlot(SoundType.Music, "Sounds/Music/CyberKing"); } if (Main.cloudAlpha > 0f && - (double)Main.player[Main.myPlayer].position.Y < - Main.worldSurface * 16.0 + (double)(Main.screenHeight / 2) && Main.player[Main.myPlayer].ZoneSnow && playMusic) + Main.player[Main.myPlayer].position.Y < + Main.worldSurface * 16.0 + Main.screenHeight / 2 && Main.player[Main.myPlayer].ZoneSnow && playMusic) { - music = this.GetSoundSlot(SoundType.Music, "Sounds/Music/Snow2"); + music = GetSoundSlot(SoundType.Music, "Sounds/Music/Snow2"); } if (player.active && player.GetModPlayer(this).ZoneIce && !Main.gameMenu && playMusic) { - music = this.GetSoundSlot(SoundType.Music, "Sounds/Music/Snow2"); + music = GetSoundSlot(SoundType.Music, "Sounds/Music/Snow2"); } } @@ -251,7 +236,7 @@ public override void Load() TileType("GraniteMusicBox")); TremorGlowMask.Load(); - GameShaders.Armor.BindShader(ItemType("NovaDye"), new ArmorShaderData(Main.PixelShaderRef, "ArmorSolar")).UseColor(0.8f, 0.7f, 0.3f).UseSecondaryColor(0.8f, 0.7f, 0.3f); + GameShaders.Armor.BindShader(ItemType("NovaDye"), new ArmorShaderData(Main.PixelShaderRef, "ArmorSolar")).UseColor(0.8f, 0.7f, 0.3f).UseSecondaryColor(0.8f, 0.7f, 0.3f); NovaSky.PlanetTexture = GetTexture("NovaPillar/NovaPlanet"); Filters.Scene["Tremor:Nova"] = new Filter(new NovaData("FilterMiniTower").UseColor(0.8f, 0.7f, 0.3f).UseOpacity(0.82f), EffectPriority.VeryHigh); SkyManager.Instance["Tremor:Nova"] = new NovaSky(); diff --git a/TremorPlayer.cs b/TremorPlayer.cs index 9e063699..d1a8073d 100644 --- a/TremorPlayer.cs +++ b/TremorPlayer.cs @@ -5,9 +5,8 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.DataStructures; -using Terraria.ModLoader; using Terraria.Graphics.Shaders; - +using Terraria.ModLoader; namespace Tremor { @@ -15,61 +14,61 @@ namespace Tremor public class TremorPlayer : ModPlayer { - public bool heartAmulet = false; - public bool ZoneRuins = false; - public int healHurt = 0; - public bool dFear = false; - public bool creeperMinion = false; - public bool corruptorMinion = false; - public bool hungryMinion = false; - public bool meteorMinion = false; - public bool jellyfishMinion = false; - public bool cyberMinion = false; - public bool blueSakuraMinion = false; - public bool goblinMinion = false; - public bool shadowMinion = false; - public bool AnnoyingDog = false; - public bool vultureMinion = false; - public bool skeletonMinion = false; - public bool goldenWhale = false; - public bool vortexBee = false; - public bool nebulaJellyfish = false; - public bool solarMeteor = false; - public bool stardustSquid = false; - public bool mudDoll = false; + public bool heartAmulet; + public bool ZoneRuins; + public int healHurt; + public bool dFear; + public bool creeperMinion; + public bool corruptorMinion; + public bool hungryMinion; + public bool meteorMinion; + public bool jellyfishMinion; + public bool cyberMinion; + public bool blueSakuraMinion; + public bool goblinMinion; + public bool shadowMinion; + public bool AnnoyingDog; + public bool vultureMinion; + public bool skeletonMinion; + public bool goldenWhale; + public bool vortexBee; + public bool nebulaJellyfish; + public bool solarMeteor; + public bool stardustSquid; + public bool mudDoll; public bool Irradiated; - public bool Brutty = false; - public bool quetzalcoatlMinion = false; - public bool northWind = false; - public bool summonerPower = false; - public bool gurdPet = false; - public bool ancientVision = false; - public bool ZoneGranite = false; - public bool ZoneComet = false; - public bool whiteSakura = false; - public bool petZootaloo = false; + public bool Brutty; + public bool quetzalcoatlMinion; + public bool northWind; + public bool summonerPower; + public bool gurdPet; + public bool ancientVision; + public bool ZoneGranite; + public bool ZoneComet; + public bool whiteSakura; + public bool petZootaloo; public bool onHitShadaggers = false; - public bool LivingTombstone = false; - public bool miniCyber = false; - public bool cluster = false; - public bool ZoneIce = false; - public bool ancientPredator = false; - public bool starfishMinion = false; - public bool hauntpet = false; - public bool crabStaff = false; - public bool zombatMinion = false; - public bool huskyStaff = false; - public bool ruinAltar = false; - public bool emeraldy = false; - public bool hunterMinion = false; - public bool birbStaff = false; - public bool warkee = false; - public bool shadowArmSF = false; - - public bool zellariumHead = false; - public bool zellariumBody = false; - - public bool ZoneTowerNova = false; + public bool LivingTombstone; + public bool miniCyber; + public bool cluster; + public bool ZoneIce; + public bool ancientPredator; + public bool starfishMinion; + public bool hauntpet; + public bool crabStaff; + public bool zombatMinion; + public bool huskyStaff; + public bool ruinAltar; + public bool emeraldy; + public bool hunterMinion; + public bool birbStaff; + public bool warkee; + public bool shadowArmSF; + + public bool zellariumHead; + public bool zellariumBody; + + public bool ZoneTowerNova; public bool NovaMonolith = false; public override void UpdateDead() @@ -130,13 +129,13 @@ public override void PostUpdateEquips() } } - this.zellariumDash = 10; + zellariumDash = 10; player.dashDelay = 0; player.velocity.X = -(float)hitDirection * 2f; player.velocity.Y = -2f; player.immune = true; player.immuneTime = 7; - this.zellariumHit = i; + zellariumHit = i; } } } @@ -180,24 +179,24 @@ public override void PostUpdateEquips() if (flag2) { - player.velocity.X = 25f * (float)num21; - Point point3 = (player.Center + new Vector2((float)(num21 * player.width / 2 + 2), player.gravDir * -(float)player.height / 2f + player.gravDir * 2f)).ToTileCoordinates(); - Point point4 = (player.Center + new Vector2((float)(num21 * player.width / 2 + 2), 0f)).ToTileCoordinates(); + player.velocity.X = 25f * num21; + Point point3 = (player.Center + new Vector2(num21 * player.width / 2 + 2, player.gravDir * -(float)player.height / 2f + player.gravDir * 2f)).ToTileCoordinates(); + Point point4 = (player.Center + new Vector2(num21 * player.width / 2 + 2, 0f)).ToTileCoordinates(); if (WorldGen.SolidOrSlopedTile(point3.X, point3.Y) || WorldGen.SolidOrSlopedTile(point4.X, point4.Y)) { player.velocity.X = player.velocity.X / 2f; } player.dashDelay = -1; - this.zellariumDash = 15; + zellariumDash = 15; for (int num22 = 0; num22 < 100; num22++) { int num23 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 59, 0f, 0f, 100, default(Color), 2f); Dust dust3 = Main.dust[num23]; - dust3.position.X = dust3.position.X + (float)Main.rand.Next(-5, 6); + dust3.position.X = dust3.position.X + Main.rand.Next(-5, 6); Dust dust4 = Main.dust[num23]; - dust4.position.Y = dust4.position.Y + (float)Main.rand.Next(-5, 6); + dust4.position.Y = dust4.position.Y + Main.rand.Next(-5, 6); Main.dust[num23].velocity *= 0.2f; - Main.dust[num23].scale *= 1f + (float)Main.rand.Next(20) * 0.01f; + Main.dust[num23].scale *= 1f + Main.rand.Next(20) * 0.01f; Main.dust[num23].shader = GameShaders.Armor.GetSecondaryShader(player.shield, player); } } @@ -219,7 +218,7 @@ public override void PostUpdateEquips() num14 = Dust.NewDust(new Vector2(player.position.X, player.position.Y + (player.height / 2) - 8f), player.width, 16, 59, 0f, 0f, 100, default(Color), 1.4f); } Main.dust[num14].velocity *= 0.1f; - Main.dust[num14].scale *= 1f + (float)Main.rand.Next(20) * 0.01f; + Main.dust[num14].scale *= 1f + Main.rand.Next(20) * 0.01f; Main.dust[num14].shader = GameShaders.Armor.GetSecondaryShader(player.shoe, player); } @@ -245,7 +244,6 @@ public override void PostUpdateEquips() if (player.velocity.X > 0f) { player.velocity.X = maxSpeed; - return; } } } @@ -323,7 +321,7 @@ private struct LightPillar public Vector2 Position; public float Depth; } - private TremorPlayer.LightPillar[] _pillars; + private LightPillar[] _pillars; private Random _random = new Random(); public static int[] iceWidth = new int[3]; @@ -459,25 +457,25 @@ public void OnHit(float x, float y, Entity victim) if (onHitShadaggers && Main.rand.Next(4) == 0) { player.petalTimer = 20; - if (x < player.position.X + (float)(player.width / 2)) + if (x < player.position.X + player.width / 2) { } int direction = player.direction; float num = Main.screenPosition.X; if (direction < 0) { - num += (float)Main.screenWidth; + num += Main.screenWidth; } float num2 = Main.screenPosition.Y; - num2 += (float)Main.rand.Next(Main.screenHeight); + num2 += Main.rand.Next(Main.screenHeight); Vector2 vector = new Vector2(num, num2); float num3 = x - vector.X; float num4 = y - vector.Y; - num3 += (float)Main.rand.Next(-50, 51) * 0.1f; - num4 += (float)Main.rand.Next(-50, 51) * 0.1f; + num3 += Main.rand.Next(-50, 51) * 0.1f; + num4 += Main.rand.Next(-50, 51) * 0.1f; int num5 = 24; - float num6 = (float)Math.Sqrt((double)(num3 * num3 + num4 * num4)); - num6 = (float)num5 / num6; + float num6 = (float)Math.Sqrt(num3 * num3 + num4 * num4); + num6 = num5 / num6; num3 *= num6; num4 *= num6; Projectile.NewProjectile(num, num2, num3, num4, mod.ProjectileType("ParaxydeKnifePro"), 46, 0f, player.whoAmI, 0f, 0f); diff --git a/TremorWorld.cs b/TremorWorld.cs index b9de7619..ec0be125 100644 --- a/TremorWorld.cs +++ b/TremorWorld.cs @@ -1,42 +1,42 @@ using System; -using System.IO; using System.Collections.Generic; +using System.IO; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.GameContent.Generation; using Terraria.ID; using Terraria.ModLoader; -using Terraria.World.Generation; -using Microsoft.Xna.Framework; -using Terraria.GameContent.Generation; using Terraria.ModLoader.IO; +using Terraria.World.Generation; namespace Tremor { public class TremorWorld : ModWorld { private const int saveVersion = 0; - public static bool downedEvilCorn = false; - public static bool downedRukh = false; - public static bool downedSpaceWhale = false; - public static bool downedTrinity = false; - public static bool downedTremode = false; - public static bool downedTikiTotem = false; - public static bool downedStormJellyfish = false; - public static bool downedCyberKing = false; - public static bool downedHeaterofWorlds = false; - public static bool downedFrostKing = false; - public static bool downedDarkEmperor = false; - public static bool downedPixieQueen = false; - public static bool downedAlchemaster = false; - public static bool downedBrutallisk = false; - public static bool downedParadoxTitan = false; - public static bool downedCogLord = false; - public static bool downedWallofShadow = false; - public static bool downedMotherboard = false; - public static bool downedFungusBeetle = false; - public static bool downedAncientDragon = false; - public static bool downedAndas = false; - public static bool DownedNovaPillar = false; - public static bool downedWallOfShadow = false; + public static bool downedEvilCorn; + public static bool downedRukh; + public static bool downedSpaceWhale; + public static bool downedTrinity; + public static bool downedTremode; + public static bool downedTikiTotem; + public static bool downedStormJellyfish; + public static bool downedCyberKing; + public static bool downedHeaterofWorlds; + public static bool downedFrostKing; + public static bool downedDarkEmperor; + public static bool downedPixieQueen; + public static bool downedAlchemaster; + public static bool downedBrutallisk; + public static bool downedParadoxTitan; + public static bool downedCogLord; + public static bool downedWallofShadow; + public static bool downedMotherboard; + public static bool downedFungusBeetle; + public static bool downedAncientDragon; + public static bool downedAndas; + public static bool DownedNovaPillar; + public static bool downedWallOfShadow; public override void Initialize() { @@ -233,10 +233,10 @@ public override void NetReceive(BinaryReader reader) downedWallOfShadow = flags3[6]; } - public static int CometTiles = 0; - public static int GraniteTiles = 0; - public static int IceTiles = 0; - public static int RuinsTiles = 0; + public static int CometTiles; + public static int GraniteTiles; + public static int IceTiles; + public static int RuinsTiles; public override void ModifyWorldGenTasks(List tasks, ref float totalWeight) { @@ -254,7 +254,7 @@ public override void ModifyWorldGenTasks(List tasks, ref float totalWei { int i2 = WorldGen.genRand.Next(0, Main.maxTilesX); int j2 = WorldGen.genRand.Next((int)(Main.maxTilesY * .3f), (int)(Main.maxTilesY * .45f)); - WorldGen.OreRunner(i2, j2, (double)WorldGen.genRand.Next(3, 4), WorldGen.genRand.Next(3, 8), (ushort)mod.TileType("ArgiteOre")); + WorldGen.OreRunner(i2, j2, WorldGen.genRand.Next(3, 4), WorldGen.genRand.Next(3, 8), (ushort)mod.TileType("ArgiteOre")); } })); @@ -262,7 +262,7 @@ public override void ModifyWorldGenTasks(List tasks, ref float totalWei { progress.Message = "Generating glacier..."; IL_19: - int StartPositionX = WorldGen.genRand.Next(0, (int)Main.maxTilesX - 2); + int StartPositionX = WorldGen.genRand.Next(0, Main.maxTilesX - 2); int StartPositionY = (int)Main.worldSurface; int StartX = 0; int StartY = 0; @@ -315,11 +315,11 @@ public override void ModifyWorldGenTasks(List tasks, ref float totalWei } for (int k = 0; k < 1000; k++) { - int PositionX = WorldGen.genRand.Next(0, (int)Main.maxTilesX); - int PositionY = WorldGen.genRand.Next(0, (int)Main.maxTilesY); + int PositionX = WorldGen.genRand.Next(0, Main.maxTilesX); + int PositionY = WorldGen.genRand.Next(0, Main.maxTilesY); if (Main.tile[PositionX, PositionY].type == mod.TileType("IceBlock")) { - WorldGen.TileRunner(PositionX, PositionY, (double)WorldGen.genRand.Next(2, 8), WorldGen.genRand.Next(2, 8), (ushort)mod.TileType("IceOre"), false, 0f, 0f, false, true); + WorldGen.TileRunner(PositionX, PositionY, WorldGen.genRand.Next(2, 8), WorldGen.genRand.Next(2, 8), (ushort)mod.TileType("IceOre"), false, 0f, 0f, false, true); } } for (int k = 0; k < Main.maxTilesX; k++) @@ -330,7 +330,6 @@ public override void ModifyWorldGenTasks(List tasks, ref float totalWei { if (Main.tile[k + 1, i].active() && Main.tile[k, i - 1].active() && Main.tile[k - 1, i].active() && Main.tile[k, i + 1].active()) { - continue; } else { @@ -340,7 +339,7 @@ public override void ModifyWorldGenTasks(List tasks, ref float totalWei } } - while (!Main.tile[StartX, StartY].active() && (double)StartY < Main.worldSurface) + while (!Main.tile[StartX, StartY].active() && StartY < Main.worldSurface) { StartY++; } @@ -502,7 +501,7 @@ public static bool PlaceIceChest(int x, int y, ushort type = 21, bool notNearOth { int num = -1; TileObject toBePlaced; - if (TileObject.CanPlace(x, y, (int)type, style, 1, out toBePlaced, false)) + if (TileObject.CanPlace(x, y, type, style, 1, out toBePlaced, false)) { bool flag = true; if (notNearOtherChests && Chest.NearOtherChests(x - 1, y - 1)) @@ -637,7 +636,7 @@ public override void PostWorldGen() } //for (int i = 1; i < Main.rand.Next(1, 3); i++) //кол-во занятых слотов //{ - int[] itemsToPlaceInGlassChestsSecondary = new int[] { mod.ItemType("FrostLiquidFlask") }; //сами предметы + int[] itemsToPlaceInGlassChestsSecondary = { mod.ItemType("FrostLiquidFlask") }; //сами предметы int itemsToPlaceInGlassChestsSecondaryChoice = 0; for (int chestIndex = 0; chestIndex < 1000; chestIndex++) { @@ -658,7 +657,7 @@ public override void PostWorldGen() //for (int i = 1; i < Main.rand.Next(7, 10); i++) //тоже самое //{ - int[] itemsToPlaceInGlassChestsSecondary1 = new int[] { 73 }; + int[] itemsToPlaceInGlassChestsSecondary1 = { 73 }; int itemsToPlaceInGlassChestsSecondaryChoice1 = 0; for (int chestIndex = 0; chestIndex < 1000; chestIndex++) { @@ -677,7 +676,7 @@ public override void PostWorldGen() } //} //рандом. выбор предмета на 1 - int[] itemsToPlaceInGlassChests = new int[] { mod.ItemType("FrostLance"), mod.ItemType("FrozenPaxe"), mod.ItemType("FrostGuardian"), mod.ItemType("FrostWind") }; + int[] itemsToPlaceInGlassChests = { mod.ItemType("FrostLance"), mod.ItemType("FrozenPaxe"), mod.ItemType("FrostGuardian"), mod.ItemType("FrostWind") }; int itemsToPlaceInGlassChestsChoice = 0; for (int chestIndex = 0; chestIndex < 1000; chestIndex++) { @@ -699,7 +698,7 @@ public static bool AddLunarRoots(int i, int j) int k = j; while (k < Main.maxTilesY) { - if (Main.tile[i, k].active() && Main.tileSolid[(int)Main.tile[i, k].type]) + if (Main.tile[i, k].active() && Main.tileSolid[Main.tile[i, k].type]) { int num = k - 1; if (Main.tile[i, num - 1].lava() || Main.tile[i - 1, num - 1].lava()) @@ -710,17 +709,17 @@ public static bool AddLunarRoots(int i, int j) { return false; } - if (Main.wallDungeon[(int)Main.tile[i, num].wall]) + if (Main.wallDungeon[Main.tile[i, num].wall]) { return false; } Tile tile = Main.tile[i - 1, num + 1]; Tile tile2 = Main.tile[i, num + 1]; - if (!tile.nactive() || !Main.tileSolid[(int)tile.type]) + if (!tile.nactive() || !Main.tileSolid[tile.type]) { return false; } - if (!tile2.nactive() || !Main.tileSolid[(int)tile2.type]) + if (!tile2.nactive() || !Main.tileSolid[tile2.type]) { return false; } @@ -752,10 +751,7 @@ public static bool AddLunarRoots(int i, int j) Main.tile[i, num].frameY = 18; return true; } - else - { - k++; - } + k++; } return false; } @@ -776,12 +772,12 @@ public static void dropComet() } } int num = 0; - float num2 = (float)(Main.maxTilesX / 4200); + float num2 = Main.maxTilesX / 4200; int num3 = (int)(400f * num2); for (int j = 5; j < Main.maxTilesX - 5; j++) { int num4 = 5; - while ((double)num4 < Main.worldSurface) + while (num4 < Main.worldSurface) { if (Main.tile[j, num4].active() && Main.tile[j, num4].type == (ushort)ModLoader.GetMod("Tremor").TileType("CometiteOreTile")) { @@ -797,16 +793,16 @@ public static void dropComet() float num5 = 600f; while (!flag) { - float num6 = (float)Main.maxTilesX * 0.08f; + float num6 = Main.maxTilesX * 0.08f; int num7 = Main.rand.Next(150, Main.maxTilesX - 150); - while ((float)num7 > (float)Main.spawnTileX - num6 && (float)num7 < (float)Main.spawnTileX + num6) + while (num7 > Main.spawnTileX - num6 && num7 < Main.spawnTileX + num6) { num7 = Main.rand.Next(150, Main.maxTilesX - 150); } int k = (int)(Main.worldSurface * 0.3); while (k < Main.maxTilesY) { - if (Main.tile[num7, k].active() && Main.tileSolid[(int)Main.tile[num7, k].type]) + if (Main.tile[num7, k].active() && Main.tileSolid[Main.tile[num7, k].type]) { int num8 = 0; int num9 = 15; @@ -828,22 +824,18 @@ public static void dropComet() } } } - if ((float)num8 < num5) + if (num8 < num5) { num5 -= 0.5f; break; } - flag = TremorWorld.comet(num7, k); + flag = comet(num7, k); if (flag) { - break; } break; } - else - { - k++; - } + k++; } if (num5 < 100f) { @@ -867,7 +859,7 @@ public static bool comet(int i, int j) { if (Main.player[k].active) { - Rectangle value = new Rectangle((int)(Main.player[k].position.X + (float)(Main.player[k].width / 2) - (float)(NPC.sWidth / 2) - (float)NPC.safeRangeX), (int)(Main.player[k].position.Y + (float)(Main.player[k].height / 2) - (float)(NPC.sHeight / 2) - (float)NPC.safeRangeY), NPC.sWidth + NPC.safeRangeX * 2, NPC.sHeight + NPC.safeRangeY * 2); + Rectangle value = new Rectangle((int)(Main.player[k].position.X + Main.player[k].width / 2 - NPC.sWidth / 2 - NPC.safeRangeX), (int)(Main.player[k].position.Y + Main.player[k].height / 2 - NPC.sHeight / 2 - NPC.safeRangeY), NPC.sWidth + NPC.safeRangeX * 2, NPC.sHeight + NPC.safeRangeY * 2); if (rectangle.Intersects(value)) { return false; @@ -902,12 +894,12 @@ public static bool comet(int i, int j) { if (num3 > j + Main.rand.Next(-2, 3) - 5) { - float num4 = (float)Math.Abs(i - num2); - float num5 = (float)Math.Abs(j - num3); - float num6 = (float)Math.Sqrt((double)(num4 * num4 + num5 * num5)); - if ((double)num6 < (double)num * 0.9 + (double)Main.rand.Next(-4, 5)) + float num4 = Math.Abs(i - num2); + float num5 = Math.Abs(j - num3); + float num6 = (float)Math.Sqrt(num4 * num4 + num5 * num5); + if (num6 < num * 0.9 + Main.rand.Next(-4, 5)) { - if (!Main.tileSolid[(int)Main.tile[num2, num3].type]) + if (!Main.tileSolid[Main.tile[num2, num3].type]) { Main.tile[num2, num3].active(false); } @@ -923,10 +915,10 @@ public static bool comet(int i, int j) { if (num8 > j + Main.rand.Next(-2, 3) - 4) { - float num9 = (float)Math.Abs(i - num7); - float num10 = (float)Math.Abs(j - num8); - float num11 = (float)Math.Sqrt((double)(num9 * num9 + num10 * num10)); - if ((double)num11 < (double)num * 0.8 + (double)Main.rand.Next(-3, 4)) + float num9 = Math.Abs(i - num7); + float num10 = Math.Abs(j - num8); + float num11 = (float)Math.Sqrt(num9 * num9 + num10 * num10); + if (num11 < num * 0.8 + Main.rand.Next(-3, 4)) { Main.tile[num7, num8].active(false); } @@ -938,10 +930,10 @@ public static bool comet(int i, int j) { for (int num13 = j - num; num13 < j + num; num13++) { - float num14 = (float)Math.Abs(i - num12); - float num15 = (float)Math.Abs(j - num13); - float num16 = (float)Math.Sqrt((double)(num14 * num14 + num15 * num15)); - if ((double)num16 < (double)num * 0.7) + float num14 = Math.Abs(i - num12); + float num15 = Math.Abs(j - num13); + float num16 = (float)Math.Sqrt(num14 * num14 + num15 * num15); + if (num16 < num * 0.7) { if (Main.tile[num12, num13].type == 5 || Main.tile[num12, num13].type == 32 || Main.tile[num12, num13].type == 352) { @@ -971,10 +963,10 @@ public static bool comet(int i, int j) { if (num18 > j + WorldGen.genRand.Next(-3, 4) - 3 && Main.tile[num17, num18].active() && Main.rand.Next(10) == 0) { - float num19 = (float)Math.Abs(i - num17); - float num20 = (float)Math.Abs(j - num18); - float num21 = (float)Math.Sqrt((double)(num19 * num19 + num20 * num20)); - if ((double)num21 < (double)num * 0.8) + float num19 = Math.Abs(i - num17); + float num20 = Math.Abs(j - num18); + float num21 = (float)Math.Sqrt(num19 * num19 + num20 * num20); + if (num21 < num * 0.8) { if (Main.tile[num17, num18].type == 5 || Main.tile[num17, num18].type == 32 || Main.tile[num17, num18].type == 352) { @@ -993,10 +985,10 @@ public static bool comet(int i, int j) { if (num23 > j + WorldGen.genRand.Next(-2, 3) && Main.tile[num22, num23].active() && Main.rand.Next(20) == 0) { - float num24 = (float)Math.Abs(i - num22); - float num25 = (float)Math.Abs(j - num23); - float num26 = (float)Math.Sqrt((double)(num24 * num24 + num25 * num25)); - if ((double)num26 < (double)num * 0.85) + float num24 = Math.Abs(i - num22); + float num25 = Math.Abs(j - num23); + float num26 = (float)Math.Sqrt(num24 * num24 + num25 * num25); + if (num26 < num * 0.85) { if (Main.tile[num22, num23].type == 5 || Main.tile[num22, num23].type == 32 || Main.tile[num22, num23].type == 352) { diff --git a/ZombieEvent/Buffs/HauntPetBuff.cs b/ZombieEvent/Buffs/HauntPetBuff.cs index dd31a707..3ab981a9 100644 --- a/ZombieEvent/Buffs/HauntPetBuff.cs +++ b/ZombieEvent/Buffs/HauntPetBuff.cs @@ -28,7 +28,7 @@ public override void Update(Player player, ref int buffIndex) } if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer) { - Projectile.NewProjectile(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2), 0f, 0f, mod.ProjectileType("TheHauntPro"), 0, 0f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(player.position.X + player.width / 2, player.position.Y + player.height / 2, 0f, 0f, mod.ProjectileType("TheHauntPro"), 0, 0f, player.whoAmI, 0f, 0f); } } } diff --git a/ZombieEvent/Items/BookofRevelations.cs b/ZombieEvent/Items/BookofRevelations.cs index d529821f..6e88c4e0 100644 --- a/ZombieEvent/Items/BookofRevelations.cs +++ b/ZombieEvent/Items/BookofRevelations.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.ZombieEvent.Items diff --git a/ZombieEvent/Items/ChargedLamp.cs b/ZombieEvent/Items/ChargedLamp.cs index 987b5afb..b2979157 100644 --- a/ZombieEvent/Items/ChargedLamp.cs +++ b/ZombieEvent/Items/ChargedLamp.cs @@ -1,7 +1,7 @@ -using Terraria.ID; using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.ZombieEvent.Items @@ -19,8 +19,8 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX for (i = 0; i < 4; i++ ) { offsetAngle = (startAngle + deltaAngle * ( i + i * i ) / 2f ) + 32f * i; - Terraria.Projectile.NewProjectile(position.X, position.Y, (float)( Math.Sin(offsetAngle) * 5f ), (float)( Math.Cos(offsetAngle) * 5f ), item.shoot, damage, knockBack, item.owner); - Terraria.Projectile.NewProjectile(position.X, position.Y, (float)( -Math.Sin(offsetAngle) * 5f ), (float)( -Math.Cos(offsetAngle) * 5f ), item.shoot, damage, knockBack, item.owner); + Projectile.NewProjectile(position.X, position.Y, (float)( Math.Sin(offsetAngle) * 5f ), (float)( Math.Cos(offsetAngle) * 5f ), item.shoot, damage, knockBack, item.owner); + Projectile.NewProjectile(position.X, position.Y, (float)( -Math.Sin(offsetAngle) * 5f ), (float)( -Math.Cos(offsetAngle) * 5f ), item.shoot, damage, knockBack, item.owner); } return false; } diff --git a/ZombieEvent/Items/CursedCleaver.cs b/ZombieEvent/Items/CursedCleaver.cs index 32725abc..e8afe91e 100644 --- a/ZombieEvent/Items/CursedCleaver.cs +++ b/ZombieEvent/Items/CursedCleaver.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.ZombieEvent.Items diff --git a/ZombieEvent/Items/DeadBranch.cs b/ZombieEvent/Items/DeadBranch.cs index f5825430..f7f2d99d 100644 --- a/ZombieEvent/Items/DeadBranch.cs +++ b/ZombieEvent/Items/DeadBranch.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.ZombieEvent.Items diff --git a/ZombieEvent/Items/DeathHordeMusicBoxTile.cs b/ZombieEvent/Items/DeathHordeMusicBoxTile.cs index 9479cc2f..97dcce49 100644 --- a/ZombieEvent/Items/DeathHordeMusicBoxTile.cs +++ b/ZombieEvent/Items/DeathHordeMusicBoxTile.cs @@ -1,8 +1,8 @@ using Microsoft.Xna.Framework; using Terraria; +using Terraria.DataStructures; using Terraria.ModLoader; using Terraria.ObjectData; -using Terraria.DataStructures; namespace Tremor.ZombieEvent.Items { diff --git a/ZombieEvent/Items/HauntHat.cs b/ZombieEvent/Items/HauntHat.cs index 9ee2a25b..6e9255a4 100644 --- a/ZombieEvent/Items/HauntHat.cs +++ b/ZombieEvent/Items/HauntHat.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.ZombieEvent.Items diff --git a/ZombieEvent/Items/IchorCleaver.cs b/ZombieEvent/Items/IchorCleaver.cs index e3aad66c..69329afb 100644 --- a/ZombieEvent/Items/IchorCleaver.cs +++ b/ZombieEvent/Items/IchorCleaver.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.ZombieEvent.Items diff --git a/ZombieEvent/Items/PoisonousPhylactery.cs b/ZombieEvent/Items/PoisonousPhylactery.cs index f5f58fb4..936b4cac 100644 --- a/ZombieEvent/Items/PoisonousPhylactery.cs +++ b/ZombieEvent/Items/PoisonousPhylactery.cs @@ -74,8 +74,8 @@ void Shoot(int Target, int Damage) Vector2 velocity = Helper.VelocityToPoint(Main.player[item.owner].Center, Main.npc[Target].Center, ShootSpeed); for (int l = 0; l < ShootCount; l++) { - velocity.X = velocity.X + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - velocity.Y = velocity.Y + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.X = velocity.X + Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.Y = velocity.Y + Main.rand.Next(-spread, spread + 1) * spreadMult; int i = Projectile.NewProjectile(Main.player[item.owner].Center.X, Main.player[item.owner].Center.Y, velocity.X, velocity.Y, ShootType, Damage, ShootKN, item.owner); } } diff --git a/ZombieEvent/Items/RupicideCannon.cs b/ZombieEvent/Items/RupicideCannon.cs index 5cc2d26e..97884f56 100644 --- a/ZombieEvent/Items/RupicideCannon.cs +++ b/ZombieEvent/Items/RupicideCannon.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.ZombieEvent.Items diff --git a/ZombieEvent/Items/RupicideClub.cs b/ZombieEvent/Items/RupicideClub.cs index 3687b031..2329bbb1 100644 --- a/ZombieEvent/Items/RupicideClub.cs +++ b/ZombieEvent/Items/RupicideClub.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.ZombieEvent.Items diff --git a/ZombieEvent/Items/RupicideRepeater.cs b/ZombieEvent/Items/RupicideRepeater.cs index 6823e8a0..6163ff6d 100644 --- a/ZombieEvent/Items/RupicideRepeater.cs +++ b/ZombieEvent/Items/RupicideRepeater.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.ZombieEvent.Items diff --git a/ZombieEvent/Items/RupicideStaff.cs b/ZombieEvent/Items/RupicideStaff.cs index b1f7189d..7c0ff9fa 100644 --- a/ZombieEvent/Items/RupicideStaff.cs +++ b/ZombieEvent/Items/RupicideStaff.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.ZombieEvent.Items diff --git a/ZombieEvent/Items/SpecterHood.cs b/ZombieEvent/Items/SpecterHood.cs index 30da3b33..05854df3 100644 --- a/ZombieEvent/Items/SpecterHood.cs +++ b/ZombieEvent/Items/SpecterHood.cs @@ -1,7 +1,7 @@ +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace Tremor.ZombieEvent.Items { @@ -90,8 +90,8 @@ void Shoot(int Target, int Damage) Vector2 velocity = Helper.VelocityToPoint(Main.player[item.owner].Center, Main.npc[Target].Center, ShootSpeed); for (int l = 0; l < ShootCount; l++) { - velocity.X = velocity.X + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - velocity.Y = velocity.Y + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.X = velocity.X + Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.Y = velocity.Y + Main.rand.Next(-spread, spread + 1) * spreadMult; int i = Projectile.NewProjectile(Main.player[item.owner].Center.X, Main.player[item.owner].Center.Y, velocity.X, velocity.Y, 270, 100, ShootKN, item.owner); } } diff --git a/ZombieEvent/Items/WickedRing.cs b/ZombieEvent/Items/WickedRing.cs index 3a1fedaa..ba0c35d7 100644 --- a/ZombieEvent/Items/WickedRing.cs +++ b/ZombieEvent/Items/WickedRing.cs @@ -1,7 +1,7 @@ -using Terraria.ID; using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.ZombieEvent.Items @@ -19,8 +19,8 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX for (i = 0; i < 4; i++ ) { offsetAngle = (startAngle + deltaAngle * ( i + i * i ) / 2f ) + 32f * i; - Terraria.Projectile.NewProjectile(position.X, position.Y, (float)( Math.Sin(offsetAngle) * 5f ), (float)( Math.Cos(offsetAngle) * 5f ), item.shoot, damage, knockBack, item.owner); - Terraria.Projectile.NewProjectile(position.X, position.Y, (float)( -Math.Sin(offsetAngle) * 5f ), (float)( -Math.Cos(offsetAngle) * 5f ), item.shoot, damage, knockBack, item.owner); + Projectile.NewProjectile(position.X, position.Y, (float)( Math.Sin(offsetAngle) * 5f ), (float)( Math.Cos(offsetAngle) * 5f ), item.shoot, damage, knockBack, item.owner); + Projectile.NewProjectile(position.X, position.Y, (float)( -Math.Sin(offsetAngle) * 5f ), (float)( -Math.Cos(offsetAngle) * 5f ), item.shoot, damage, knockBack, item.owner); } return false; } diff --git a/ZombieEvent/Mobs/Almagron.cs b/ZombieEvent/Mobs/Almagron.cs index 0d5fad72..9a134445 100644 --- a/ZombieEvent/Mobs/Almagron.cs +++ b/ZombieEvent/Mobs/Almagron.cs @@ -36,16 +36,16 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if(Main.rand.Next(22) == 0) { @@ -68,7 +68,7 @@ public override void HitEffect(int hitDirection, double damage) { for(int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 31, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 31, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, 99, 1f); Gore.NewGore(npc.position, npc.velocity, 99, 1f); diff --git a/ZombieEvent/Mobs/Arsonist.cs b/ZombieEvent/Mobs/Arsonist.cs index 26a97961..ae5acdb9 100644 --- a/ZombieEvent/Mobs/Arsonist.cs +++ b/ZombieEvent/Mobs/Arsonist.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.ZombieEvent.Mobs @@ -34,8 +34,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void AI() @@ -53,7 +53,7 @@ public override void HitEffect(int hitDirection, double damage) { for(int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DeadlingHead1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DeadlingLeg"), 1f); @@ -75,8 +75,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if(Main.rand.Next(2) == 0) { diff --git a/ZombieEvent/Mobs/Corpse1.cs b/ZombieEvent/Mobs/Corpse1.cs index 23bbdc67..91669ffc 100644 --- a/ZombieEvent/Mobs/Corpse1.cs +++ b/ZombieEvent/Mobs/Corpse1.cs @@ -39,7 +39,7 @@ public override void HitEffect(int hitDirection, double damage) { for(int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CorpseGore1"), 0.8f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CorpseGore2"), 0.8f); diff --git a/ZombieEvent/Mobs/Corpse2.cs b/ZombieEvent/Mobs/Corpse2.cs index c3c6f232..dc93da8b 100644 --- a/ZombieEvent/Mobs/Corpse2.cs +++ b/ZombieEvent/Mobs/Corpse2.cs @@ -39,7 +39,7 @@ public override void HitEffect(int hitDirection, double damage) { for(int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CorpseGore4"), 0.8f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CorpseGore2"), 0.8f); diff --git a/ZombieEvent/Mobs/Cryptomage.cs b/ZombieEvent/Mobs/Cryptomage.cs index 950719fa..65483032 100644 --- a/ZombieEvent/Mobs/Cryptomage.cs +++ b/ZombieEvent/Mobs/Cryptomage.cs @@ -38,8 +38,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if(Main.rand.Next(1) == 0) { @@ -55,7 +55,7 @@ public override void HitEffect(int hitDirection, double damage) { for(int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CryptomageGore1"), 0.8f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CryptomageGore2"), 0.8f); diff --git a/ZombieEvent/Mobs/Dapperblook.cs b/ZombieEvent/Mobs/Dapperblook.cs index 1624c2c2..b7eddca1 100644 --- a/ZombieEvent/Mobs/Dapperblook.cs +++ b/ZombieEvent/Mobs/Dapperblook.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.ZombieEvent.Mobs @@ -13,7 +13,7 @@ public override void SetStaticDefaults() Main.npcFrameCount[npc.type] = 4; } - const int SpeedMulti = 3; // ⥫ ᪮ + const int SpeedMulti = 3; // �����⥫� ᪮��� public override void SetDefaults() { @@ -49,8 +49,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if(Main.rand.Next(4) == 0) { @@ -65,8 +65,8 @@ public override void NPCLoot() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) diff --git a/ZombieEvent/Mobs/Deadling1.cs b/ZombieEvent/Mobs/Deadling1.cs index 0708a53c..c658d645 100644 --- a/ZombieEvent/Mobs/Deadling1.cs +++ b/ZombieEvent/Mobs/Deadling1.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.ZombieEvent.Mobs @@ -34,8 +34,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -44,7 +44,7 @@ public override void HitEffect(int hitDirection, double damage) { for(int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DeadlingHead1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DeadlingLeg"), 1f); @@ -58,8 +58,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if(Main.rand.Next(10) == 0) { diff --git a/ZombieEvent/Mobs/Deadling2.cs b/ZombieEvent/Mobs/Deadling2.cs index ab5f443a..421eecfe 100644 --- a/ZombieEvent/Mobs/Deadling2.cs +++ b/ZombieEvent/Mobs/Deadling2.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.ZombieEvent.Mobs @@ -34,8 +34,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -44,7 +44,7 @@ public override void HitEffect(int hitDirection, double damage) { for(int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DeadlingHead2"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DeadlingLeg"), 1f); @@ -58,8 +58,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if(Main.rand.Next(10) == 0) { diff --git a/ZombieEvent/Mobs/Deadling3.cs b/ZombieEvent/Mobs/Deadling3.cs index d55d77ec..c4e4d7bf 100644 --- a/ZombieEvent/Mobs/Deadling3.cs +++ b/ZombieEvent/Mobs/Deadling3.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.ZombieEvent.Mobs @@ -34,8 +34,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -44,7 +44,7 @@ public override void HitEffect(int hitDirection, double damage) { for(int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DeadlingHead3"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DeadlingLeg"), 1f); @@ -58,8 +58,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if(Main.rand.Next(10) == 0) { diff --git a/ZombieEvent/Mobs/DiceZombie.cs b/ZombieEvent/Mobs/DiceZombie.cs index 131691c6..ecb8e070 100644 --- a/ZombieEvent/Mobs/DiceZombie.cs +++ b/ZombieEvent/Mobs/DiceZombie.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.ZombieEvent.Mobs @@ -34,8 +34,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -44,7 +44,7 @@ public override void HitEffect(int hitDirection, double damage) { for(int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DeadlingHead1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DeadlingLeg"), 1f); @@ -62,8 +62,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if(Main.rand.Next(1) == 0) { diff --git a/ZombieEvent/Mobs/Dopelganger.cs b/ZombieEvent/Mobs/Dopelganger.cs index a9d8c249..270e0308 100644 --- a/ZombieEvent/Mobs/Dopelganger.cs +++ b/ZombieEvent/Mobs/Dopelganger.cs @@ -38,8 +38,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if(Main.rand.Next(30) == 0 && !WorldGen.crimson) { @@ -75,7 +75,7 @@ public override void HitEffect(int hitDirection, double damage) { for(int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, 99, 0.8f); Gore.NewGore(npc.position, npc.velocity, 99, 0.8f); diff --git a/ZombieEvent/Mobs/FarmerZombie.cs b/ZombieEvent/Mobs/FarmerZombie.cs index c97e7c68..8190d02b 100644 --- a/ZombieEvent/Mobs/FarmerZombie.cs +++ b/ZombieEvent/Mobs/FarmerZombie.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.ZombieEvent.Mobs @@ -36,8 +36,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if(Main.rand.Next(4) == 0) { @@ -64,7 +64,7 @@ public override void HitEffect(int hitDirection, double damage) { for(int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FarmForkGore"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FarmGore1"), 1f); diff --git a/ZombieEvent/Mobs/FatSack.cs b/ZombieEvent/Mobs/FatSack.cs index c56ea8fc..b7e50c2f 100644 --- a/ZombieEvent/Mobs/FatSack.cs +++ b/ZombieEvent/Mobs/FatSack.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.ZombieEvent.Mobs @@ -34,8 +34,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -44,7 +44,7 @@ public override void HitEffect(int hitDirection, double damage) { for(int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FatSackGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FatSackGore2"), 1f); @@ -58,8 +58,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if(Main.rand.Next(1) == 0) { diff --git a/ZombieEvent/Mobs/GhoulOfficer.cs b/ZombieEvent/Mobs/GhoulOfficer.cs index ca415b3f..e2e7a3d6 100644 --- a/ZombieEvent/Mobs/GhoulOfficer.cs +++ b/ZombieEvent/Mobs/GhoulOfficer.cs @@ -34,8 +34,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -44,7 +44,7 @@ public override void HitEffect(int hitDirection, double damage) { for(int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GhoulOfficerGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GhoulOfficerGore2"), 1f); diff --git a/ZombieEvent/Mobs/Painmaker.cs b/ZombieEvent/Mobs/Painmaker.cs index a499bd1e..be4f167f 100644 --- a/ZombieEvent/Mobs/Painmaker.cs +++ b/ZombieEvent/Mobs/Painmaker.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.ZombieEvent.Mobs @@ -13,7 +13,7 @@ public override void SetStaticDefaults() Main.npcFrameCount[npc.type] = 4; } - const int SpeedMulti = 3; // ⥫ ᪮ + const int SpeedMulti = 3; // �����⥫� ᪮��� public override void SetDefaults() { @@ -40,8 +40,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if(Main.rand.Next(30) == 0) { @@ -52,8 +52,8 @@ public override void NPCLoot() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) diff --git a/ZombieEvent/Mobs/PetrifiedZombie1.cs b/ZombieEvent/Mobs/PetrifiedZombie1.cs index 3eabcdb9..934117ba 100644 --- a/ZombieEvent/Mobs/PetrifiedZombie1.cs +++ b/ZombieEvent/Mobs/PetrifiedZombie1.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.ZombieEvent.Mobs @@ -34,8 +34,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -44,7 +44,7 @@ public override void HitEffect(int hitDirection, double damage) { for(int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DeadlingHead1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DeadlingLeg"), 1f); @@ -59,8 +59,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if(Main.rand.Next(4) == 0) { diff --git a/ZombieEvent/Mobs/PetrifiedZombie2.cs b/ZombieEvent/Mobs/PetrifiedZombie2.cs index d3405004..0eacc50c 100644 --- a/ZombieEvent/Mobs/PetrifiedZombie2.cs +++ b/ZombieEvent/Mobs/PetrifiedZombie2.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.ZombieEvent.Mobs @@ -34,8 +34,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -44,7 +44,7 @@ public override void HitEffect(int hitDirection, double damage) { for(int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DeadlingHead1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DeadlingLeg"), 1f); @@ -59,8 +59,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if(Main.rand.Next(4) == 0) { diff --git a/ZombieEvent/Mobs/PetrifiedZombie3.cs b/ZombieEvent/Mobs/PetrifiedZombie3.cs index 5dd83197..8fc343bf 100644 --- a/ZombieEvent/Mobs/PetrifiedZombie3.cs +++ b/ZombieEvent/Mobs/PetrifiedZombie3.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.ZombieEvent.Mobs @@ -34,8 +34,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -44,7 +44,7 @@ public override void HitEffect(int hitDirection, double damage) { for(int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DeadlingHead1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DeadlingLeg"), 1f); @@ -59,8 +59,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if(Main.rand.Next(4) == 0) { diff --git a/ZombieEvent/Mobs/Scourge.cs b/ZombieEvent/Mobs/Scourge.cs index f3796587..c32311ee 100644 --- a/ZombieEvent/Mobs/Scourge.cs +++ b/ZombieEvent/Mobs/Scourge.cs @@ -46,8 +46,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if(Main.rand.Next(30) == 0 && !WorldGen.crimson) { @@ -83,7 +83,7 @@ public override void HitEffect(int hitDirection, double damage) { for(int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, 99, 0.8f); Gore.NewGore(npc.position, npc.velocity, 99, 0.8f); diff --git a/ZombieEvent/Mobs/SpearZombie.cs b/ZombieEvent/Mobs/SpearZombie.cs index 6d9fb377..e7ae1038 100644 --- a/ZombieEvent/Mobs/SpearZombie.cs +++ b/ZombieEvent/Mobs/SpearZombie.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.ZombieEvent.Mobs @@ -38,7 +38,7 @@ public override void HitEffect(int hitDirection, double damage) { for(int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieSpearHead"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DeadlingArm"), 1f); diff --git a/ZombieEvent/Mobs/SuperDapperblook.cs b/ZombieEvent/Mobs/SuperDapperblook.cs index 658d4057..d9cad626 100644 --- a/ZombieEvent/Mobs/SuperDapperblook.cs +++ b/ZombieEvent/Mobs/SuperDapperblook.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.ZombieEvent.Mobs @@ -13,7 +13,7 @@ public override void SetStaticDefaults() Main.npcFrameCount[npc.type] = 4; } - const int SpeedMulti = 3; // ⥫ ᪮ + const int SpeedMulti = 3; // �����⥫� ᪮��� public override void SetDefaults() { @@ -48,8 +48,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if(Main.rand.Next(4) == 0) { @@ -60,8 +60,8 @@ public override void NPCLoot() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) diff --git a/ZombieEvent/Mobs/SuperScourge.cs b/ZombieEvent/Mobs/SuperScourge.cs index 5e3c42b5..42b8b2de 100644 --- a/ZombieEvent/Mobs/SuperScourge.cs +++ b/ZombieEvent/Mobs/SuperScourge.cs @@ -46,8 +46,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if(Main.rand.Next(30) == 0 && !WorldGen.crimson) { @@ -78,7 +78,7 @@ public override void HitEffect(int hitDirection, double damage) { for(int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, 99, 0.8f); Gore.NewGore(npc.position, npc.velocity, 99, 0.8f); diff --git a/ZombieEvent/Mobs/SuperTheHaunt.cs b/ZombieEvent/Mobs/SuperTheHaunt.cs index d6295a9b..281dcdee 100644 --- a/ZombieEvent/Mobs/SuperTheHaunt.cs +++ b/ZombieEvent/Mobs/SuperTheHaunt.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.ZombieEvent.Mobs @@ -13,7 +13,7 @@ public override void SetStaticDefaults() Main.npcFrameCount[npc.type] = 4; } - const int SpeedMulti = 3; // ⥫ ᪮ + const int SpeedMulti = 3; // �����⥫� ᪮��� public override void SetDefaults() { @@ -48,8 +48,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if(Main.rand.Next(4) == 0) { @@ -60,8 +60,8 @@ public override void NPCLoot() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) diff --git a/ZombieEvent/Mobs/TheHaunt.cs b/ZombieEvent/Mobs/TheHaunt.cs index 005be34a..a80f192e 100644 --- a/ZombieEvent/Mobs/TheHaunt.cs +++ b/ZombieEvent/Mobs/TheHaunt.cs @@ -1,5 +1,5 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.ZombieEvent.Mobs @@ -13,7 +13,7 @@ public override void SetStaticDefaults() Main.npcFrameCount[npc.type] = 4; } - const int SpeedMulti = 3; // ⥫ ᪮ + const int SpeedMulti = 3; // �����⥫� ᪮��� public override void SetDefaults() { @@ -49,8 +49,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if(Main.rand.Next(4) == 0) { @@ -61,8 +61,8 @@ public override void NPCLoot() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) diff --git a/ZombieEvent/Mobs/Zombat.cs b/ZombieEvent/Mobs/Zombat.cs index a36a6e68..eb582242 100644 --- a/ZombieEvent/Mobs/Zombat.cs +++ b/ZombieEvent/Mobs/Zombat.cs @@ -1,8 +1,7 @@ -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; - namespace Tremor.ZombieEvent.Mobs { @@ -35,8 +34,8 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void HitEffect(int hitDirection, double damage) @@ -53,8 +52,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if(Main.rand.Next(25) == 0) { diff --git a/ZombieEvent/Mobs/Zombeast.cs b/ZombieEvent/Mobs/Zombeast.cs index 9c3dcec1..c7c56834 100644 --- a/ZombieEvent/Mobs/Zombeast.cs +++ b/ZombieEvent/Mobs/Zombeast.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.ZombieEvent.Mobs @@ -36,16 +36,16 @@ public override void SetDefaults() public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); + npc.lifeMax = npc.lifeMax * 1; + npc.damage = npc.damage * 1; } public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if(Main.rand.Next(1) == 0) { @@ -64,17 +64,17 @@ public override void HitEffect(int hitDirection, double damage) { for(int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.8f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.8f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombeastGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombeastGore2"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombeastGore2"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombeastGore3"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombeastGore3"), 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 2f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * hitDirection, -2.5f, 0, default(Color), 1f); } } diff --git a/ZombieEvent/Mobs/Zombomber.cs b/ZombieEvent/Mobs/Zombomber.cs index 25c4a73d..dc77c888 100644 --- a/ZombieEvent/Mobs/Zombomber.cs +++ b/ZombieEvent/Mobs/Zombomber.cs @@ -1,6 +1,6 @@ -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace Tremor.ZombieEvent.Mobs @@ -37,8 +37,8 @@ public override void NPCLoot() { if (Main.netMode != 1) { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int centerX = (int)(npc.position.X + npc.width / 2) / 16; + int centerY = (int)(npc.position.Y + npc.height / 2) / 16; int halfLength = npc.width / 2 / 16 + 1; if(Main.rand.Next(5) == 0) { @@ -57,7 +57,7 @@ public override void HitEffect(int hitDirection, double damage) { for(int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * hitDirection, -2.5f, 0, default(Color), 0.7f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombomberGore1"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombomberGore2"), 1f); diff --git a/ZombieEvent/Tiles/NecromaniacWorkbenchTile.cs b/ZombieEvent/Tiles/NecromaniacWorkbenchTile.cs index d62ec119..acbfff84 100644 --- a/ZombieEvent/Tiles/NecromaniacWorkbenchTile.cs +++ b/ZombieEvent/Tiles/NecromaniacWorkbenchTile.cs @@ -13,12 +13,12 @@ public override void SetDefaults() Main.tileNoAttach[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new[]{ 16, 16 }; TileObjectData.addTile(Type); ModTranslation name = CreateMapEntryName(); name.SetDefault("Necromaniac Workbench"); AddMapEntry(new Color(0, 77, 255), name); - adjTiles = new int[]{mod.TileType("FleshWorkstationTile")}; + adjTiles = new[]{mod.TileType("FleshWorkstationTile")}; } public override void KillMultiTile(int i, int j, int frameX, int frameY) diff --git a/ZombieEvent/Tiles/RupicideBar.cs b/ZombieEvent/Tiles/RupicideBar.cs index 71630bcf..c86bb9db 100644 --- a/ZombieEvent/Tiles/RupicideBar.cs +++ b/ZombieEvent/Tiles/RupicideBar.cs @@ -15,7 +15,7 @@ public override void SetDefaults() Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1); TileObjectData.newTile.Height = 1; - TileObjectData.newTile.CoordinateHeights = new int[]{16}; + TileObjectData.newTile.CoordinateHeights = new[]{16}; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.StyleWrapLimit = 111; TileObjectData.addTile(Type); diff --git a/ZombieEvent/ZWorld.cs b/ZombieEvent/ZWorld.cs index 96624d5b..912255d4 100644 --- a/ZombieEvent/ZWorld.cs +++ b/ZombieEvent/ZWorld.cs @@ -1,17 +1,17 @@ -using System.IO; using System.Collections.Generic; +using System.IO; using Terraria; using Terraria.ModLoader; -using Terraria.World.Generation; using Terraria.ModLoader.IO; +using Terraria.World.Generation; namespace Tremor.ZombieEvent { public class ZWorld : ModWorld { private const int saveVersion = 0; - public static int ZPoints = 0; - public static bool ZInvasion = false; + public static int ZPoints; + public static bool ZInvasion; public override void ModifyWorldGenTasks(List tasks, ref float totalWeight) { diff --git a/ZombieEvent/ZombieEventI.cs b/ZombieEvent/ZombieEventI.cs index a0fa63d7..a0294ea9 100644 --- a/ZombieEvent/ZombieEventI.cs +++ b/ZombieEvent/ZombieEventI.cs @@ -2,6 +2,7 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; + //using Terraria.Content.Fonts; namespace Tremor.ZombieEvent @@ -41,8 +42,8 @@ public override void UpdateDead() int eH = CyberWrathI.Height; int eW = CyberWrathI.Width; - int XX1 = (int)(((24 - iW1) / 2) + Main.screenWidth - sX1); - int YY1 = (int)(((24 - iH1) / 2) + sY1 + (int)(280 * 1.4) + (24 - iW1) * (-1) + 20); + int XX1 = ((24 - iW1) / 2) + Main.screenWidth - sX1; + int YY1 = ((24 - iH1) / 2) + sY1 + (int)(280 * 1.4) + (24 - iW1) * (-1) + 20; int eX = XX1 - 333; int eY = YY1 - 430 + (24 - eW) * (-1); diff --git a/ZombieEvent/ZombieSky.cs b/ZombieEvent/ZombieSky.cs index 763d9413..4d8e72fb 100644 --- a/ZombieEvent/ZombieSky.cs +++ b/ZombieEvent/ZombieSky.cs @@ -7,8 +7,8 @@ namespace Tremor.ZombieEvent { public class ZombieSky : CustomSky { - private bool isActive = false; - private float intensity = 0f; + private bool isActive; + private float intensity; private int CalIndex = -1; public override void Update(GameTime gameTime) @@ -25,12 +25,12 @@ public override void Update(GameTime gameTime) private float GetIntensity() { - if (this.UpdateCalIndex()) + if (UpdateCalIndex()) { float x = 0f; - if (this.CalIndex != -1) + if (CalIndex != -1) { - x = Vector2.Distance(Main.player[Main.myPlayer].Center, Main.npc[this.CalIndex].Center); + x = Vector2.Distance(Main.player[Main.myPlayer].Center, Main.npc[CalIndex].Center); } return 1f - Utils.SmoothStep(3000f, 6000f, x); } @@ -39,7 +39,7 @@ private float GetIntensity() public override Color OnTileColor(Color inColor) { - float intensity = this.GetIntensity(); + float intensity = GetIntensity(); return new Color(Vector4.Lerp(new Vector4(0.5f, 0.8f, 1f, 1f), inColor.ToVector4(), 1f - intensity)); } @@ -67,7 +67,7 @@ public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDept { if (maxDepth >= 0 && minDepth < 0) { - float intensity = this.GetIntensity(); + float intensity = GetIntensity(); spriteBatch.Draw(Main.blackTileTexture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.Black * intensity); } }