using System.Collections.Generic; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; namespace FabusMod; public class FabuPlayer : ModPlayer { public class WeaponAbilityPlayerEffects : ModPlayer { public bool activated; public bool activated2; public bool activated3; public bool activated4; public bool activated5; public bool activated6; public bool activated7; public bool activated8; public bool activated9; public bool activated10; public bool activated11; public bool activated12; public bool activated13; public bool activated14; public bool activated15; public bool activated16; public bool activated17; public bool activated18; public bool activated19; public bool activated20; public bool activated21; public bool activated22; public bool activated23; public bool activated24; public bool activated25; public bool activated26; public bool activated27; public bool activated28; public bool activated29; public bool activated30; public bool activated31; public bool activated32; public bool activated33; public bool activated34; public bool activated35; public bool activated36; public bool soundPlayed; public override void PreUpdate() { if (Player.HasBuff(ModContent.BuffType())) { activated = true; } else if (activated) { Player.AddBuff(ModContent.BuffType(), 3000, true); activated = false; } if (Player.HasBuff(ModContent.BuffType())) { activated2 = true; } else if (activated2) { SoundEngine.PlaySound(SoundID.Unlock); CombatText.NewText(Player.Hitbox, new Color(0, 255, 0), "Shattered Moon's Blessing ready!"); activated2 = false; } if (Player.HasBuff(ModContent.BuffType()) && !soundPlayed) { if (Main.rand.NextBool(5)) { SoundEngine.PlaySound(SoundID.Item13); } soundPlayed = true; } if (!Player.HasBuff(ModContent.BuffType())) { soundPlayed = false; } if (Player.HasBuff(ModContent.BuffType())) { activated3 = true; } else if (activated3) { Player.AddBuff(ModContent.BuffType(), 600, true); activated3 = false; } if (Player.HasBuff(ModContent.BuffType())) { activated4 = true; } else if (activated4) { Player.AddBuff(ModContent.BuffType(), 3000, true); activated4 = false; } if (Player.HasBuff(ModContent.BuffType())) { activated5 = true; } else if (activated5) { SoundEngine.PlaySound(SoundID.Unlock); CombatText.NewText(Player.Hitbox, new Color(0, 255, 0), "Spectral Moonlight ready!"); activated5 = false; } if (Player.HasBuff(ModContent.BuffType()) && !soundPlayed) { if (Main.rand.NextBool(5)) { SoundEngine.PlaySound(SoundID.Item13); } soundPlayed = true; } if (!Player.HasBuff(ModContent.BuffType())) { soundPlayed = false; } if (Player.HasBuff(ModContent.BuffType())) { activated6 = true; } else if (activated6) { Player.AddBuff(ModContent.BuffType(), 600, true); activated6 = false; } if (Player.HasBuff(ModContent.BuffType())) { activated7 = true; } else if (activated7) { Player.AddBuff(ModContent.BuffType(), 3000, true); activated7 = false; } if (Player.HasBuff(ModContent.BuffType())) { activated8 = true; } else if (activated8) { SoundEngine.PlaySound(SoundID.Unlock); CombatText.NewText(Player.Hitbox, new Color(0, 255, 0), "Blossom ready!"); activated8 = false; } if (Player.HasBuff(ModContent.BuffType())) { activated9 = true; } else if (activated9) { Player.AddBuff(ModContent.BuffType(), 3000, true); activated9 = false; } if (Player.HasBuff(ModContent.BuffType())) { activated10 = true; } else if (activated10) { SoundEngine.PlaySound(SoundID.Unlock); CombatText.NewText(Player.Hitbox, new Color(0, 255, 0), "Spectral Blossom ready!"); activated10 = false; } if (!Player.HasBuff(ModContent.BuffType())) { activated11 = true; } else if (activated11) { SoundEngine.PlaySound(SoundID.Item4); CombatText.NewText(Player.Hitbox, new Color(190, 60, 60), "Absorbed a soul!"); activated11 = false; } if (!Player.HasBuff(ModContent.BuffType())) { activated12 = true; } else if (activated12) { SoundEngine.PlaySound(SoundID.Item4); CombatText.NewText(Player.Hitbox, new Color(190, 60, 60), "Absorbed two souls!"); activated12 = false; } if (!Player.HasBuff(ModContent.BuffType())) { activated13 = true; } else if (activated13) { SoundEngine.PlaySound(SoundID.Item4); CombatText.NewText(Player.Hitbox, new Color(190, 60, 60), "Absorbed three souls!"); activated13 = false; } if (!Player.HasBuff(ModContent.BuffType())) { activated14 = true; } else if (activated14) { SoundEngine.PlaySound(SoundID.Item4); CombatText.NewText(Player.Hitbox, new Color(190, 60, 60), "Absorbed four souls!"); activated14 = false; } if (!Player.HasBuff(ModContent.BuffType())) { activated15 = true; } else if (activated15) { SoundEngine.PlaySound(SoundID.Item4); CombatText.NewText(Player.Hitbox, new Color(92, 229, 237), "Absorbed five souls!"); activated15 = false; } if (!Player.HasBuff(ModContent.BuffType())) { activated16 = true; } else if (activated16) { SoundEngine.PlaySound(SoundID.Item4); CombatText.NewText(Player.Hitbox, new Color(210, 210, 90), "Absorbed a soul!"); activated16 = false; } if (!Player.HasBuff(ModContent.BuffType())) { activated17 = true; } else if (activated17) { SoundEngine.PlaySound(SoundID.Item4); CombatText.NewText(Player.Hitbox, new Color(210, 210, 90), "Absorbed two souls!"); activated17 = false; } if (!Player.HasBuff(ModContent.BuffType())) { activated18 = true; } else if (activated18) { SoundEngine.PlaySound(SoundID.Item4); CombatText.NewText(Player.Hitbox, new Color(210, 210, 90), "Absorbed three souls!"); activated18 = false; } if (!Player.HasBuff(ModContent.BuffType())) { activated19 = true; } else if (activated19) { SoundEngine.PlaySound(SoundID.Item4); CombatText.NewText(Player.Hitbox, new Color(210, 210, 90), "Absorbed four souls!"); activated19 = false; } if (!Player.HasBuff(ModContent.BuffType())) { activated20 = true; } else if (activated20) { SoundEngine.PlaySound(SoundID.Item4); CombatText.NewText(Player.Hitbox, new Color(92, 229, 237), "Absorbed five souls!"); activated20 = false; } if (!Player.HasBuff(ModContent.BuffType())) { activated21 = true; } else if (activated21) { SoundEngine.PlaySound(SoundID.Item4); CombatText.NewText(Player.Hitbox, new Color(255, 82, 220), "Sapped a dream!"); activated21 = false; } if (!Player.HasBuff(ModContent.BuffType())) { activated22 = true; } else if (activated22) { SoundEngine.PlaySound(SoundID.Item4); CombatText.NewText(Player.Hitbox, new Color(255, 82, 220), "Sapped two dreams!"); activated22 = false; } if (!Player.HasBuff(ModContent.BuffType())) { activated23 = true; } else if (activated23) { SoundEngine.PlaySound(SoundID.Item4); CombatText.NewText(Player.Hitbox, new Color(255, 82, 220), "Sapped three dreams!"); activated23 = false; } if (!Player.HasBuff(ModContent.BuffType())) { activated24 = true; } else if (activated24) { SoundEngine.PlaySound(SoundID.Item4); CombatText.NewText(Player.Hitbox, new Color(255, 82, 220), "Sapped four dreams!"); activated24 = false; } if (!Player.HasBuff(ModContent.BuffType())) { activated25 = true; } else if (activated25) { SoundEngine.PlaySound(SoundID.Item4); CombatText.NewText(Player.Hitbox, new Color(255, 82, 220), "Sapped five dreams!"); activated25 = false; } if (!Player.HasBuff(ModContent.BuffType())) { activated26 = true; } else if (activated26) { SoundEngine.PlaySound(SoundID.Item4); CombatText.NewText(Player.Hitbox, new Color(255, 61, 0), "Enraged!"); activated26 = false; } if (Player.HasBuff(ModContent.BuffType())) { activated27 = true; } else if (activated27) { Player.AddBuff(ModContent.BuffType(), 480, true); activated27 = false; } if (Player.HasBuff(ModContent.BuffType())) { activated28 = true; } else if (activated28) { Player.AddBuff(ModContent.BuffType(), 2400, true); activated28 = false; } if (Player.HasBuff(ModContent.BuffType())) { activated29 = true; } else if (activated29) { SoundEngine.PlaySound(SoundID.Unlock); CombatText.NewText(Player.Hitbox, new Color(0, 255, 0), "Ready to Hypercharge!"); activated29 = false; } if (Player.HasBuff(ModContent.BuffType()) && !soundPlayed) { if (Main.rand.NextBool(5)) { SoundEngine.PlaySound(SoundID.Item13); } soundPlayed = true; } if (!Player.HasBuff(ModContent.BuffType())) { soundPlayed = false; } if (!Player.HasBuff(ModContent.BuffType())) { activated30 = true; } else if (activated30) { SoundEngine.PlaySound(SoundID.Item4); CombatText.NewText(Player.Hitbox, new Color(255, 61, 0), "Hypercharged!"); activated30 = false; } if (Player.HasBuff(ModContent.BuffType())) { activated31 = true; } else if (activated31) { CombatText.NewText(Player.Hitbox, new Color(138, 138, 138), "No longer Hypercharged!"); activated31 = false; } if (Player.HasBuff(ModContent.BuffType())) { activated32 = true; } else if (activated32) { Player.AddBuff(ModContent.BuffType(), 480, true); activated32 = false; } if (Player.HasBuff(ModContent.BuffType())) { activated33 = true; } else if (activated33) { Player.AddBuff(ModContent.BuffType(), 2400, true); activated33 = false; } if (Player.HasBuff(ModContent.BuffType())) { activated34 = true; } else if (activated34) { SoundEngine.PlaySound(SoundID.Unlock); CombatText.NewText(Player.Hitbox, new Color(0, 255, 0), "Ready to Ultracharge!"); activated34 = false; } if (Player.HasBuff(ModContent.BuffType()) && !soundPlayed) { if (Main.rand.NextBool(5)) { SoundEngine.PlaySound(SoundID.Item13); } soundPlayed = true; } if (!Player.HasBuff(ModContent.BuffType())) { soundPlayed = false; } if (!Player.HasBuff(ModContent.BuffType())) { activated35 = true; } else if (activated35) { SoundEngine.PlaySound(SoundID.Item4); CombatText.NewText(Player.Hitbox, new Color(255, 61, 0), "Ultracharged!"); activated35 = false; } if (Player.HasBuff(ModContent.BuffType())) { activated36 = true; } else if (activated36) { CombatText.NewText(Player.Hitbox, new Color(138, 138, 138), "No longer Ultracharged!"); activated36 = false; } } } private const int saveVersion = 0; public bool foxPet; public bool pinkFoxPet; public bool kregPet; public bool fabuLightPet; public bool fabu; public bool goddessMinion; public override void ResetEffects() { foxPet = false; pinkFoxPet = false; kregPet = false; fabuLightPet = false; fabu = false; goddessMinion = false; } public override IEnumerable AddStartingItems(bool mediumCoreDeath) { return new[] { new Item(ModContent.ItemType()) }; } }