ReserveNPCID() static private method

static private ReserveNPCID ( ) : int
return int
Esempio n. 1
0
        public void AddNPC(string name, ModNPC npc, string texture)
        {
            int id = NPCLoader.ReserveNPCID();

            npc.npc.name       = name;
            npc.npc.type       = id;
            npcs[name]         = npc;
            NPCLoader.npcs[id] = npc;
            npc.texture        = texture;
            npc.mod            = this;
        }
Esempio n. 2
0
        protected sealed override void Register()
        {
            ModTypeLookup <ModNPC> .Register(this);

            npc.type    = NPCLoader.ReserveNPCID();
            DisplayName = Mod.GetOrCreateTranslation($"Mods.{Mod.Name}.NPCName.{Name}");

            NPCLoader.npcs.Add(this);

            Type type         = GetType();
            var  autoloadHead = type.GetAttribute <AutoloadHead>();

            if (autoloadHead != null)
            {
                Mod.AddNPCHeadTexture(npc.type, HeadTexture);
            }
            var autoloadBossHead = type.GetAttribute <AutoloadBossHead>();

            if (autoloadBossHead != null)
            {
                Mod.AddBossHeadTexture(BossHeadTexture, npc.type);
            }
        }