forked from tModLoader/tModLoader
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9b06672
commit 63d38df
Showing
6 changed files
with
220 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace Terraria.ModLoader { | ||
public class ModNPC | ||
{ | ||
//add modNPC property to Terraria.NPC (internal set) | ||
//set modNPC to null at beginning of Terraria.NPC.SetDefaults | ||
public NPC npc | ||
{ | ||
get; | ||
internal set; | ||
} | ||
public Mod mod | ||
{ | ||
get; | ||
internal set; | ||
} | ||
internal string texture; | ||
public ModNPC() | ||
{ | ||
npc = new NPC(); | ||
} | ||
|
||
public virtual bool Autoload(ref string name, ref string texture) | ||
{ | ||
return mod.Properties.Autoload; | ||
} | ||
|
||
internal void SetupNPC(NPC npc) | ||
{ | ||
ModNPC newNPC = (ModNPC)Activator.CreateInstance(GetType()); | ||
newNPC.npc = npc; | ||
npc.modNPC = newNPC; | ||
newNPC.mod = mod; | ||
newNPC.SetDefaults(); | ||
} | ||
|
||
public virtual void SetDefaults() { } | ||
}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters