Advertisement
Guest User

Untitled

a guest
Apr 30th, 2017
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.50 KB | None | 0 0
  1. using System;
  2. using System.IO;
  3. using Microsoft.Xna.Framework;
  4. using Microsoft.Xna.Framework.Graphics;
  5. using Terraria;
  6. using Terraria.ID;
  7. using Terraria.ModLoader;
  8.  
  9. namespace ENUFsGloveMod.NPCs.Boss
  10. {
  11. public class TrueStoneGuard : ModNPC
  12. {
  13. public override void SetDefaults()
  14. {
  15. npc.name = "TrueStoneGuard";
  16. npc.displayName = "True Stone Guard";
  17. npc.aiStyle = 5; //5 is the flying AI
  18. npc.lifeMax = 2500; //boss life
  19. npc.damage = 30; //boss damage
  20. npc.defense = 10; //boss defense
  21. npc.knockBackResist = 0f;
  22. npc.width = 100;
  23. npc.height = 100;
  24. animationType = NPCID.EyeofCthulhu; //this boss will behavior like the DemonEye
  25. npc.value = Item.buyPrice(0, 40, 75, 45);
  26. npc.npcSlots = 1f;
  27. npc.boss = true;
  28. npc.lavaImmune = true;
  29. npc.noGravity = true;
  30. npc.noTileCollide = true;
  31. npc.HitSound = SoundID.NPCHit1;
  32. npc.DeathSound = SoundID.NPCDeath1;
  33. npc.buffImmune[24] = true;
  34. music = MusicID.Boss2;
  35. npc.netAlways = true;
  36. Main.npcFrameCount[npc.type] = 4;
  37. }
  38. public override void FindFrame(int frameHeight)
  39. {
  40. npc.frameCounter++;
  41. if (npc.frameCounter >= 240)
  42. {
  43. npc.frame.Y += frameHeight;
  44.  
  45. if (npc.frame.Y >= Main.npcFrameCount[npc.type] * frameHeight)
  46. {
  47. npc.frame.Y = 0;
  48. }
  49.  
  50. npc.frameCounter = 0;
  51. }
  52. }
  53.  
  54. public override void AutoloadHead(ref string headTexture, ref string bossHeadTexture)
  55. {
  56. bossHeadTexture = "ENUFsGloveMod/NPCs/Boss/TrueStoneGuard_Head_Boss"; //the boss head texture
  57. }
  58. public override void BossLoot(ref string name, ref int potionType)
  59. {
  60. potionType = ItemID.LesserHealingPotion; //boss drops
  61. Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TrueStone"), Main.rand.Next(20,50));
  62. }
  63. public override void ScaleExpertStats(int numPlayers, float bossLifeScale)
  64. {
  65. npc.lifeMax = (int)(npc.lifeMax * 0.579f * bossLifeScale); //boss life scale in expertmode
  66. npc.damage = (int)(npc.damage * 0.6f); //boss damage increase in expermode
  67. }
  68. }
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement