コード例 #1
0
ファイル: Census.cs プロジェクト: JavidPack/Census
        public override void Load()
        {
            /*
             * WorldGen.spawnDelay controls when TrySpawningTownNPC->SpawnTownNPC is called. 20 ticks in updateworld. random tiles until a house is found.
             *
             *
             *
             * WorldGen.prioritizedTownNPC seems to be next to spawn
             * UpdateTime_SpawnTownNPCs has some conditions we can adapt, order also. called each frame during daytime. Main.checkForSpawns means check only happens every 7200 ticks. Every 2 min.
             * Main.townNPCCanSpawn means conditions met.
             * SpawnTownNPC first checks IsThereASpawnablePrioritizedTownNPC which fixes prioritizedTownNPC if it needs to
             *
             * Show Green -> in town,
             * blue next
             * yellow conditions met.
             * Red townNPCCanSpawn false
             *
             * if (npc.npc.townNPC && NPC.TypeToHeadIndex(npc.npc.type) >= 0  --> Real check for townNPC
             *
             * or checkmark, x mark, over townnpc heads?
             *
             *
             * Order: TownNPC and then `foreach (ModNPC npc in npcs) {`
             *
             */
            instance   = this;
            calculated = false;
            //modTownNPCsInfos = new List<TownNPCInfo>();

            IL.Terraria.Main.UpdateTime_SpawnTownNPCs += Main_UpdateTime_SpawnTownNPCs;
        }
コード例 #2
0
ファイル: Census.cs プロジェクト: JavidPack/Census
 public override void Unload()
 {
     instance = null;
     CensusConfigClient.Instance = null;
     //townTracker = null;
 }