public override bool CheckDead(NPC npc) { Player player = Main.player[Main.myPlayer]; FargoSoulsPlayer modPlayer = player.GetModPlayer <FargoSoulsPlayer>(); if (TimeFrozen) { npc.life = 1; return(false); } // /*if (npc.boss && FargoSoulsUtil.BossIsAlive(ref mutantBoss, ModContent.NPCType<MutantBoss.MutantBoss>()) && npc.type != ModContent.NPCType<MutantBoss.MutantBoss>()) // { // npc.active = false; // SoundEngine.PlaySound(npc.DeathSound, npc.Center); // return false; // }*/ if (modPlayer.WoodEnchantActive) { //register extra kill per kill (2x as fast) Main.BestiaryTracker.Kills.RegisterKill(npc); } if (Needled && npc.lifeMax > 1 && npc.lifeMax != int.MaxValue) //super dummy { CactusEnchant.CactusProc(npc, player); } return(true); }
public override void UpdateAccessory(Player player, bool hideVisual) { FargoSoulsPlayer modPlayer = player.GetModPlayer <FargoSoulsPlayer>(); modPlayer.DarkArtistEffect(hideVisual); modPlayer.ApprenticeEffect(); }
public override void AI() { Player player = Main.player[Projectile.owner]; FargoSoulsPlayer modPlayer = player.GetModPlayer <FargoSoulsPlayer>(); if (Projectile.frame != 6) { Projectile.frameCounter++; if (Projectile.frameCounter >= 4) { Projectile.frameCounter = 0; Projectile.frame = (Projectile.frame + 1) % 7; } } if (modPlayer.TurtleShellHP <= 3) { Projectile.localAI[0] = 1; } if (!modPlayer.ShellHide) { Projectile.Kill(); } }
public override void UpdateAccessory(Player player, bool hideVisual) { FargoSoulsPlayer modPlayer = player.GetModPlayer <FargoSoulsPlayer>(); //crit effect improved modPlayer.TerraForce = true; CopperEnchant.CopperEffect(player); TinEnchant.TinEffect(player); LeadEnchant.LeadEffect(player); TungstenEnchant.TungstenEffect(player); //lava immune (obsidian) modPlayer.ObsidianEffect(); if (player.GetToggleValue("IronS")) { //shield modPlayer.IronEffect(); } //magnet if (player.GetToggleValue("IronM", false)) { modPlayer.IronEnchantActive = true; //player.treasureMagnet = true; } }
public static void PalmEffect(Player player) { FargoSoulsPlayer modPlayer = player.GetModPlayer <FargoSoulsPlayer>(); modPlayer.PalmEnchantActive = true; if (player.GetToggleValue("Palm") && player.whoAmI == Main.myPlayer && modPlayer.DoubleTap) { Vector2 mouse = Main.MouseWorld; if (player.ownedProjectileCounts[ModContent.ProjectileType <PalmTreeSentry>()] > 0) { for (int i = 0; i < Main.maxProjectiles; i++) { Projectile proj = Main.projectile[i]; if (proj.type == ModContent.ProjectileType <PalmTreeSentry>() && proj.owner == player.whoAmI) { proj.Kill(); } } } FargoSoulsUtil.NewSummonProjectile(player.GetSource_Misc(""), mouse - 10 * Vector2.UnitY, Vector2.Zero, ModContent.ProjectileType <PalmTreeSentry>(), modPlayer.WoodForce ? 45 : 15, 0f, player.whoAmI); } }
public override void ModifyHitByProjectile(NPC npc, Projectile projectile, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { Player player = Main.player[projectile.owner]; FargoSoulsPlayer modPlayer = player.GetModPlayer <FargoSoulsPlayer>(); ModifyHitByBoth(npc, player, ref damage); }
public static void FossilHurt(FargoSoulsPlayer modPlayer, int damage) { Player player = modPlayer.Player; player.immune = true; player.immuneTime = 60; if (player.GetToggleValue("Fossil")) { //spawn bones int damageCopy = damage; for (int i = 0; i < 5; i++) { if (damageCopy < 30) { break; } damageCopy -= 30; float velX = Main.rand.Next(-5, 6) * 3f; float velY = Main.rand.Next(-5, 6) * 3f; Projectile.NewProjectile(player.GetSource_Misc(""), player.position.X + velX, player.position.Y + velY, velX, velY, ModContent.ProjectileType <FossilBone>(), 0, 0f, player.whoAmI); } } }
public static void PumpkinEffect(Player player, Item accessorySource) { FargoSoulsPlayer modPlayer = player.GetModPlayer <FargoSoulsPlayer>(); if (player.GetToggleValue("Pumpkin") && (player.controlLeft || player.controlRight) && !modPlayer.IsStandingStill && player.whoAmI == Main.myPlayer) { if (modPlayer.PumpkinSpawnCD <= 0 && player.ownedProjectileCounts[ModContent.ProjectileType <GrowingPumpkin>()] < 10) { int x = (int)player.Center.X / 16; int y = (int)(player.position.Y + player.height - 1f) / 16; //if (Main.tile[x, y] == null) //{ // Main.tile[x, y] = new Tile(); //} if ((!Main.tile[x, y].HasTile && Main.tile[x, y].LiquidType == 0 && Main.tile[x, y + 1] != null && (WorldGen.SolidTile(x, y + 1) || Main.tile[x, y + 1].TileType == TileID.Platforms)) || modPlayer.LifeForce) { Projectile.NewProjectile(player.GetSource_Accessory(accessorySource), player.Center, Vector2.Zero, ModContent.ProjectileType <GrowingPumpkin>(), 0, 0, player.whoAmI); modPlayer.PumpkinSpawnCD = 300; } } } if (modPlayer.PumpkinSpawnCD > 0) { modPlayer.PumpkinSpawnCD--; } }
public static void GladiatorSpearDrop(FargoSoulsPlayer modPlayer, Item item, Projectile projectile, NPC target, int damage) { Player player = modPlayer.Player; int spearDamage = projectile != null ? projectile.damage : item != null ? item.damage : damage; spearDamage /= 4; if (spearDamage > 0) { if (!modPlayer.TerrariaSoul) { spearDamage = Math.Min(spearDamage, FargoSoulsUtil.HighestDamageTypeScaling(player, 300)); } for (int i = 0; i < 4; i++) { Vector2 spawn = new Vector2(target.Center.X + Main.rand.NextFloat(-300, 300), target.Center.Y - Main.rand.Next(600, 801)); Vector2 speed = target.Center + target.velocity * i * 5 * Main.rand.NextFloat(0.5f, 1.5f) - spawn; speed.Normalize(); speed *= 15f * Main.rand.NextFloat(0.8f, 1.2f); Projectile.NewProjectile(player.GetSource_Misc(""), spawn, speed, ModContent.ProjectileType <GladiatorJavelin>(), spearDamage, 4f, Main.myPlayer); } modPlayer.GladiatorCD = modPlayer.WillForce ? 10 : 30; } }
public static void CactusSelfProc(FargoSoulsPlayer modPlayer) { if (modPlayer.CactusProcCD == 0) { Player player = modPlayer.Player; int dmg = 20; int numNeedles = 8; if (modPlayer.LifeForce || modPlayer.WizardEnchantActive) { dmg = 75; numNeedles = 16; } Projectile[] projs = FargoSoulsUtil.XWay(numNeedles, player.GetSource_ItemUse(player.HeldItem), player.Center, ModContent.ProjectileType <CactusNeedle>(), 4, FargoSoulsUtil.HighestDamageTypeScaling(player, dmg), 5f); double randomRotation = Main.rand.NextDouble() * MathHelper.Pi * 2; for (int i = 0; i < projs.Length; i++) { if (projs[i] == null) { continue; } Projectile p = projs[i]; p.GetGlobalProjectile <FargoSoulsGlobalProjectile>().CanSplit = false; p.ai[0] = 1; //these needles can inflict enemies with needled p.velocity = p.velocity.RotatedBy(randomRotation); } modPlayer.CactusProcCD = 15; } }
protected override void Draw(ref PlayerDrawSet drawInfo) { if (drawInfo.shadow != 0f) { return; } Player drawPlayer = drawInfo.drawPlayer; FargoSoulsPlayer modPlayer = drawPlayer.GetModPlayer <FargoSoulsPlayer>(); if (modPlayer.MutantSetBonusItem != null) { if (modPlayer.frameCounter % 4 == 0) { if (++modPlayer.frameMutantAura >= 19) { modPlayer.frameMutantAura = 0; } } Texture2D texture = FargowiltasSouls.Instance.Assets.Request <Texture2D>("NPCs/MutantBoss/MutantAura", ReLogic.Content.AssetRequestMode.ImmediateLoad).Value; int frameSize = texture.Height / 19; int drawX = (int)(drawPlayer.MountedCenter.X - Main.screenPosition.X); int drawY = (int)(drawPlayer.MountedCenter.Y - Main.screenPosition.Y - 16 * drawPlayer.gravDir); DrawData data = new DrawData(texture, new Vector2(drawX, drawY), new Rectangle(0, frameSize * modPlayer.frameMutantAura, texture.Width, frameSize), Color.White, drawPlayer.gravDir < 0 ? MathHelper.Pi : 0, new Vector2(texture.Width / 2f, frameSize / 2f), 1f, drawPlayer.direction < 0 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); drawInfo.DrawDataCache.Add(data); } }
protected override void Draw(ref PlayerDrawSet drawInfo) { if (drawInfo.shadow != 0f) { return; } Player drawPlayer = drawInfo.drawPlayer; Mod mod = ModLoader.GetMod("FargowiltasSouls"); FargoSoulsPlayer modPlayer = drawPlayer.GetModPlayer <FargoSoulsPlayer>(); if (modPlayer.SnowVisual) { if (modPlayer.frameCounter % 5 == 0) { if (++modPlayer.frameSnow > 20) { modPlayer.frameSnow = 1; } } Texture2D texture = FargowiltasSouls.Instance.Assets.Request <Texture2D>("Projectiles/Souls/SnowBlizzard", ReLogic.Content.AssetRequestMode.ImmediateLoad).Value; int frameSize = texture.Height / 20; int drawX = (int)(drawPlayer.MountedCenter.X - Main.screenPosition.X); int drawY = (int)(drawPlayer.MountedCenter.Y - Main.screenPosition.Y); DrawData data = new DrawData(texture, new Vector2(drawX, drawY), new Rectangle(0, frameSize * modPlayer.frameSnow, texture.Width, frameSize), Lighting.GetColor((int)((drawInfo.Position.X + drawPlayer.width / 2f) / 16f), (int)((drawInfo.Position.Y + drawPlayer.height / 2f) / 16f)), drawPlayer.gravDir < 0 ? MathHelper.Pi : 0f, new Vector2(texture.Width / 2f, frameSize / 2f), 1f, SpriteEffects.None, 0); drawInfo.DrawDataCache.Add(data); } //GameShaders.Armor.Apply(GameShaders.Armor.GetShaderIdFromItemId(drawPlayer.dye[1].type, drawPlayer, data); }
public override void UpdateAccessory(Player player, bool hideVisual) { FargoSoulsPlayer modPlayer = player.GetModPlayer <FargoSoulsPlayer>(); //includes revive, both spectres, adamantite, and star heal modPlayer.TerrariaSoul = true; //WOOD ModContent.Find <ModItem>(Mod.Name, "TimberForce").UpdateAccessory(player, hideVisual); //TERRA ModContent.Find <ModItem>(Mod.Name, "TerraForce").UpdateAccessory(player, hideVisual); //EARTH ModContent.Find <ModItem>(Mod.Name, "EarthForce").UpdateAccessory(player, hideVisual); //NATURE ModContent.Find <ModItem>(Mod.Name, "NatureForce").UpdateAccessory(player, hideVisual); //LIFE ModContent.Find <ModItem>(Mod.Name, "LifeForce").UpdateAccessory(player, hideVisual); //SPIRIT ModContent.Find <ModItem>(Mod.Name, "SpiritForce").UpdateAccessory(player, hideVisual); //SHADOW ModContent.Find <ModItem>(Mod.Name, "ShadowForce").UpdateAccessory(player, hideVisual); //WILL ModContent.Find <ModItem>(Mod.Name, "WillForce").UpdateAccessory(player, hideVisual); //COSMOS ModContent.Find <ModItem>(Mod.Name, "CosmoForce").UpdateAccessory(player, hideVisual); }
public override void UpdateAccessory(Player player, bool hideVisual) { FargoSoulsPlayer modPlayer = player.GetModPlayer <FargoSoulsPlayer>(); modPlayer.RedRidingEffect(hideVisual); HuntressEnchant.HuntressEffect(player); }
public override void UpdateAccessory(Player player, bool hideVisual) { FargoSoulsPlayer modPlayer = player.GetModPlayer <FargoSoulsPlayer>(); //beetle bois modPlayer.BeetleEffect(); }
public override void UpdateAccessory(Player player, bool hideVisual) { FargoSoulsPlayer modPlayer = player.GetModPlayer <FargoSoulsPlayer>(); modPlayer.AncientShadowEffect(); modPlayer.ShadowEffect(hideVisual); }
public override void AI() { Player player = Main.player[Projectile.owner]; FargoSoulsPlayer modPlayer = player.GetModPlayer <FargoSoulsPlayer>(); if (player.dead) { modPlayer.BrainMinion = false; } if (modPlayer.BrainMinion) { Projectile.timeLeft = 2; } Projectile.frameCounter++; if (Projectile.frameCounter >= 8) { Projectile.frameCounter = 0; Projectile.frame = (Projectile.frame + 1) % 11; } Projectile.velocity = Vector2.Lerp(Projectile.velocity, Projectile.DirectionTo(player.Center), 0.05f); Projectile.ai[0]++; Projectile.alpha = (int)(Math.Cos(Projectile.ai[0] * MathHelper.TwoPi / 180) * 122.5 + 122.5); if (Projectile.ai[0] == 180) { Projectile.Center = player.Center + Main.rand.NextVector2CircularEdge(300, 300); Projectile.velocity = Projectile.DirectionTo(player.Center) * 8; Projectile.netUpdate = true; Projectile.ai[0] = 0; } }
public override void Update(Player player, ref int buffIndex) { if (player.whoAmI == Main.myPlayer) { FargoSoulsPlayer fargoPlayer = player.GetModPlayer <FargoSoulsPlayer>(); if (player.GetToggleValue("MasoAbom")) { fargoPlayer.AbomMinion = true; if (player.ownedProjectileCounts[ModContent.ProjectileType <AbomMinion>()] < 1) { FargoSoulsUtil.NewSummonProjectile(player.GetSource_Buff(buffIndex), player.Center, Vector2.Zero, ModContent.ProjectileType <AbomMinion>(), 900, 10f, player.whoAmI, -1); } } if (player.GetToggleValue("MasoRing")) { fargoPlayer.PhantasmalRing = true; if (player.ownedProjectileCounts[ModContent.ProjectileType <PhantasmalRing>()] < 1) { FargoSoulsUtil.NewSummonProjectile(player.GetSource_Buff(buffIndex), player.Center, Vector2.Zero, ModContent.ProjectileType <PhantasmalRing>(), 1700, 0f, player.whoAmI); } } } }
public static void TinEffect(Player player) { if (!player.GetToggleValue("Tin", false)) { return; } FargoSoulsPlayer modPlayer = player.GetModPlayer <FargoSoulsPlayer>(); modPlayer.TinEnchantActive = true; if (modPlayer.Eternity) { if (modPlayer.TinEternityDamage > 47.5f) { modPlayer.TinEternityDamage = 47.5f; } if (player.GetToggleValue("Eternity", false)) { player.GetDamage(DamageClass.Generic) += modPlayer.TinEternityDamage; player.statDefense += (int)(modPlayer.TinEternityDamage * 100); //10 defense per .1 damage } } if (modPlayer.TinProcCD > 0) { modPlayer.TinProcCD--; } }
public static void CopperProc(FargoSoulsPlayer modPlayer, NPC target) { if (modPlayer.Player.GetToggleValue("Copper") && modPlayer.CopperProcCD == 0) { target.AddBuff(BuffID.Electrified, 180); int dmg = 20; int maxTargets = 1; int cdLength = 300; if (modPlayer.TerraForce) { dmg = 100; maxTargets = 10; cdLength = 200; } List <int> npcIndexes = new List <int>(); float closestDist = 500f; NPC closestNPC; for (int i = 0; i < maxTargets; i++) { closestNPC = null; //find closest npc to target that has not been chained to yet for (int j = 0; j < Main.maxNPCs; j++) { NPC npc = Main.npc[j]; if (npc.active && npc.whoAmI != target.whoAmI && npc.CanBeChasedBy() && npc.Distance(target.Center) < closestDist && !npcIndexes.Contains(npc.whoAmI) && Collision.CanHitLine(npc.Center, 0, 0, target.Center, 0, 0)) { closestNPC = npc; closestDist = npc.Distance(target.Center); //break; } } if (closestNPC != null) { npcIndexes.Add(closestNPC.whoAmI); Vector2 ai = closestNPC.Center - target.Center; float ai2 = Main.rand.Next(100); Vector2 velocity = Vector2.Normalize(ai) * 20; Projectile p = FargoSoulsUtil.NewProjectileDirectSafe(modPlayer.Player.GetSource_ItemUse(modPlayer.Player.HeldItem), target.Center, velocity, ModContent.ProjectileType <CopperLightning>(), FargoSoulsUtil.HighestDamageTypeScaling(modPlayer.Player, dmg), 0f, modPlayer.Player.whoAmI, ai.ToRotation(), ai2); } else { break; } target = closestNPC; } modPlayer.CopperProcCD = cdLength; } }
public override void AI() { Player player = Main.player[Projectile.owner]; FargoSoulsPlayer modPlayer = player.GetModPlayer <FargoSoulsPlayer>(); if (player.dead) { modPlayer.MutantSpawn = false; } if (modPlayer.MutantSpawn) { Projectile.timeLeft = 2; } if (Projectile.tileCollide && Projectile.velocity.Y > 0) //pet updates twice per tick, this is called every tick; effectively gives it normal gravity when tangible { yFlip = !yFlip; if (yFlip) { Projectile.position.Y -= Projectile.velocity.Y; } } if (player.velocity == Vector2.Zero) //run code when not moving { BeCompanionCube(); } }
//reset crit public static void TinHurt(FargoSoulsPlayer modPlayer) { float oldCrit = modPlayer.TinCrit; if (modPlayer.Eternity) { modPlayer.TinCrit = 50; modPlayer.TinEternityDamage = 0; } else if (modPlayer.TerrariaSoul) { modPlayer.TinCrit = 20; } else if (modPlayer.TerraForce) { modPlayer.TinCrit = 10; } else { modPlayer.TinCrit = 5; } double diff = Math.Round(oldCrit - modPlayer.TinCrit, 1); if (diff > 0) { CombatText.NewText(modPlayer.Player.Hitbox, Color.OrangeRed, Language.GetTextValue("Mods.FargowiltasSouls.ItemExtra.TinCritReset", diff), true); } }
public override void Update(Player player, ref int buffIndex) { FargoSoulsPlayer fargoPlayer = player.GetModPlayer <FargoSoulsPlayer>(); player.poisoned = true; player.venom = true; player.ichor = true; player.onFire2 = true; player.electrified = true; fargoPlayer.OceanicMaul = true; fargoPlayer.CurseoftheMoon = true; if (fargoPlayer.FirstInfection) { fargoPlayer.MaxInfestTime = player.buffTime[buffIndex]; fargoPlayer.FirstInfection = false; } fargoPlayer.Infested = true; fargoPlayer.Rotting = true; fargoPlayer.MutantNibble = true; fargoPlayer.noDodge = true; fargoPlayer.noSupersonic = true; fargoPlayer.MutantPresence = true; fargoPlayer.MutantFang = true; player.moonLeech = true; player.potionDelay = player.buffTime[buffIndex]; /*if (FargowiltasSouls.Instance.MasomodeEXLoaded && !FargoSoulsWorld.downedFishronEX && player.buffTime[buffIndex] > 1 * && FargoSoulsUtil.BossIsAlive(ref EModeGlobalNPC.mutantBoss, ModContent.NPCType<MutantBoss>())) * { * player.AddBuff(ModLoader.GetMod("MasomodeEX").BuffType("MutantJudgement"), player.buffTime[buffIndex]); * player.buffTime[buffIndex] = 1; * }*/ }
public override void UpdateAccessory(Player player, bool hideVisual) { FargoSoulsPlayer modPlayer = player.GetModPlayer <FargoSoulsPlayer>(); //any new effects, brain of confusion modPlayer.ColossusSoul(Item, 100, 0.15f, 5, hideVisual); }
protected override void DrawSelf(SpriteBatch spriteBatch) { base.DrawSelf(spriteBatch); Vector2 position = GetDimensions().Position(); if (IsMouseHovering && Main.mouseLeft && Main.mouseLeftRelease) { Player player = Main.LocalPlayer; FargoSoulsPlayer modPlayer = player.GetModPlayer <FargoSoulsPlayer>(); modPlayer.Toggler.Toggles[Key].ToggleBool = !modPlayer.Toggler.Toggles[Key].ToggleBool; if (Main.netMode == NetmodeID.MultiplayerClient) { modPlayer.SyncToggle(Key); } } spriteBatch.Draw(FargowiltasSouls.UserInterfaceManager.CheckBox.Value, position, Color.White); if (Main.LocalPlayer.GetToggleValue(Key, false)) { spriteBatch.Draw(FargowiltasSouls.UserInterfaceManager.CheckMark.Value, position, Color.White); } string text = Language.GetTextValue($"Mods.FargowiltasSouls.{Key}Config"); position += new Vector2(Width.Pixels * Main.UIScale, 0); position += new Vector2(CheckboxTextSpace, 0); position += new Vector2(0, Font.MeasureString(text).Y * 0.175f); Utils.DrawBorderString(spriteBatch, text, position, Color.White); }
public override void UpdateAccessory(Player player, bool hideVisual) { FargoSoulsPlayer modPlayer = player.GetModPlayer <FargoSoulsPlayer>(); CactusEnchant.CactusEffect(player); modPlayer.TurtleEffect(hideVisual); }
public override void UpdateAccessory(Player player, bool hideVisual) { FargoSoulsPlayer modPlayer = player.GetModPlayer <FargoSoulsPlayer>(); modPlayer.SilverEnchantActive = true; modPlayer.AddMinion(Item, player.GetToggleValue("Silver"), ModContent.ProjectileType <SilverSword>(), 20, 0); }
public override void UpdateAccessory(Player player, bool hideVisual) { FargoSoulsPlayer fargoPlayer = player.GetModPlayer <FargoSoulsPlayer>(); player.statLifeMax2 += player.statLifeMax / 10; player.buffImmune[ModContent.BuffType <Buffs.Masomode.Bloodthirsty>()] = true; fargoPlayer.GuttedHeart = true; }
public override void UpdateAccessory(Player player, bool hideVisual) { FargoSoulsPlayer modPlayer = player.GetModPlayer <FargoSoulsPlayer>(); //crystal modPlayer.ChloroEffect(Item, hideVisual); modPlayer.JungleEnchantActive = true; }
public override void UpdateAccessory(Player player, bool hideVisual) { FargoSoulsPlayer modPlayer = player.GetModPlayer <FargoSoulsPlayer>(); //solar shields and flare debuff //flare debuff modPlayer.SolarEnchantActive = true; }