Init Commit because im an Init Twat
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Microsoft.Xna.Framework;
|
||||
|
||||
namespace ForgottenWawiTech.Content.NPCs.OriginalLexy
|
||||
{
|
||||
[AutoloadBossHead]
|
||||
public class Lexy : ModNPC
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
// DisplayName.SetDefault("Original Lexy");
|
||||
Main.npcFrameCount[NPC.type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
NPC.width = 40;
|
||||
NPC.height = 40;
|
||||
NPC.damage = 1786;
|
||||
NPC.defense = 290;
|
||||
NPC.lifeMax = 1000000;
|
||||
NPC.HitSound = SoundID.NPCHit1;
|
||||
NPC.DeathSound = SoundID.NPCDeath1;
|
||||
NPC.knockBackResist = 0f;
|
||||
NPC.boss = true;
|
||||
NPC.aiStyle = -1;
|
||||
NPC.value = Item.buyPrice(0, 1, 0, 0);
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
// For now, the boss instantly dies
|
||||
NPC.life = 0;
|
||||
NPC.checkDead();
|
||||
}
|
||||
|
||||
public override void OnKill()
|
||||
{
|
||||
/* // Spawn LexyNPC when killed
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
NPC.NewNPC(NPC.GetSource_Death(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType<LexyNPC>());
|
||||
}
|
||||
else
|
||||
{
|
||||
NetMessage.SendData(MessageID.SpawnNPC, number: ModContent.NPCType<LexyNPC>(), number2: NPC.whoAmI);
|
||||
} */
|
||||
// Set a world flag or similar to indicate Lexy has been defeated
|
||||
WorldDefeatedBosses.Lexy = true;
|
||||
// Immediate sync of world flags
|
||||
WorldDefeatedBosses.Sync(ModContent.GetInstance<ForgottenWawiTech>());
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 504 B |
@@ -0,0 +1,125 @@
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.GameContent.Personalities;
|
||||
using Terraria.Localization;
|
||||
|
||||
namespace ForgottenWawiTech.Content.NPCs.OriginalLexy
|
||||
{
|
||||
[AutoloadHead]
|
||||
public class LexyNPC : ModNPC
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
// DisplayName.SetDefault("Lexy");
|
||||
Main.npcFrameCount[NPC.type] = 25;
|
||||
|
||||
NPCID.Sets.ExtraFramesCount[NPC.type] = 9;
|
||||
NPCID.Sets.AttackFrameCount[NPC.type] = 4;
|
||||
NPCID.Sets.DangerDetectRange[NPC.type] = 700;
|
||||
NPCID.Sets.AttackType[NPC.type] = 0;
|
||||
NPCID.Sets.AttackTime[NPC.type] = 90;
|
||||
NPCID.Sets.AttackAverageChance[NPC.type] = 30;
|
||||
NPCID.Sets.HatOffsetY[NPC.type] = 4;
|
||||
|
||||
NPCID.Sets.NPCBestiaryDrawModifiers drawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0)
|
||||
{
|
||||
Velocity = 1f,
|
||||
Direction = 1
|
||||
};
|
||||
|
||||
NPCID.Sets.NPCBestiaryDrawOffset.Add(Type, drawModifiers);
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
NPC.townNPC = true;
|
||||
NPC.friendly = true;
|
||||
NPC.width = 18;
|
||||
NPC.height = 40;
|
||||
NPC.aiStyle = 7;
|
||||
NPC.damage = 10;
|
||||
NPC.defense = 15;
|
||||
NPC.lifeMax = 250;
|
||||
NPC.HitSound = SoundID.NPCHit1;
|
||||
NPC.DeathSound = SoundID.NPCDeath1;
|
||||
NPC.knockBackResist = 0.5f;
|
||||
|
||||
AnimationType = NPCID.Guide;
|
||||
}
|
||||
|
||||
public override bool CanTownNPCSpawn(int numTownNPCs)
|
||||
{
|
||||
return WorldDefeatedBosses.Lexy;
|
||||
}
|
||||
|
||||
public override List<string> SetNPCNameList()
|
||||
{
|
||||
return new List<string>() {
|
||||
"Lexy"
|
||||
};
|
||||
}
|
||||
|
||||
public override void SetChatButtons(ref string button, ref string button2)
|
||||
{
|
||||
button = Language.GetTextValue("LegacyInterface.28"); // "Shop"
|
||||
}
|
||||
|
||||
public override void OnChatButtonClicked(bool firstButton, ref string shop)
|
||||
{
|
||||
if (firstButton)
|
||||
{
|
||||
shop = "Shop";
|
||||
}
|
||||
}
|
||||
|
||||
public override void AddShops()
|
||||
{
|
||||
var npcShop = new NPCShop(Type)
|
||||
.Add(ItemID.LightningBug)
|
||||
.Add(ItemID.Sunflower);
|
||||
|
||||
npcShop.Register();
|
||||
}
|
||||
|
||||
public override string GetChat()
|
||||
{
|
||||
switch (Main.rand.Next(4))
|
||||
{
|
||||
case 0:
|
||||
return "Time to cause some chaos!";
|
||||
case 1:
|
||||
return "Want to see a magic trick?";
|
||||
case 2:
|
||||
return "Everything's more fun with explosions!";
|
||||
default:
|
||||
return "Let's make things interesting...";
|
||||
}
|
||||
}
|
||||
|
||||
public override void TownNPCAttackStrength(ref int damage, ref float knockback)
|
||||
{
|
||||
damage = 20;
|
||||
knockback = 4f;
|
||||
}
|
||||
|
||||
public override void TownNPCAttackCooldown(ref int cooldown, ref int randExtraCooldown)
|
||||
{
|
||||
cooldown = 30;
|
||||
randExtraCooldown = 30;
|
||||
}
|
||||
|
||||
public override void TownNPCAttackProj(ref int projType, ref int attackDelay)
|
||||
{
|
||||
projType = ProjectileID.MagicMissile;
|
||||
attackDelay = 1;
|
||||
}
|
||||
|
||||
public override void TownNPCAttackProjSpeed(ref float multiplier, ref float gravityCorrection, ref float randomOffset)
|
||||
{
|
||||
multiplier = 12f;
|
||||
randomOffset = 2f;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 504 B |
Binary file not shown.
|
After Width: | Height: | Size: 504 B |
Binary file not shown.
|
After Width: | Height: | Size: 504 B |
Reference in New Issue
Block a user