forked from GabeHasWon/spritersguildwip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Helper.cs
40 lines (37 loc) · 1.17 KB
/
Helper.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace StarlightRiver
{
public static class Helper
{
/// <summary>
/// Kills the NPC.
/// </summary>
/// <param name="npc"></param>
public static void Kill(this NPC npc)
{
bool modNPCDontDie = npc.modNPC != null && !npc.modNPC.CheckDead();
if (modNPCDontDie)
return;
npc.life = 0;
npc.checkDead();
npc.HitEffect();
npc.active = false;
}
public static void PlaceMultitile(int width, int height, int xPos, int yPos, int type)
{
for (int multiN = 0; multiN < width; multiN++)
{
for (int multiM = 0; multiM < height; multiM++)
{
Tile tileAt = Main.tile[multiN + xPos, multiM + yPos];
//WorldGen.PlaceTile(multiN + xPos, multiM + yPos, type, false, true);
tileAt.type = (ushort)type;
tileAt.frameX = (short)(multiN * 18);
tileAt.frameY = (short)(multiM * 18);
}
}
}
}
}