• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ModLoader.NPCSpawnInfo类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Terraria.ModLoader.NPCSpawnInfo的典型用法代码示例。如果您正苦于以下问题:C# NPCSpawnInfo类的具体用法?C# NPCSpawnInfo怎么用?C# NPCSpawnInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



NPCSpawnInfo类属于Terraria.ModLoader命名空间,在下文中一共展示了NPCSpawnInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CanSpawn

 public override float CanSpawn(NPCSpawnInfo spawnInfo)
 {
     return Main.bloodMoon && spawnInfo.spawnTileY < Main.rockLayer && !Main.dayTime ? 0.1f : 0f;
 }
开发者ID:ColinAV516,项目名称:EnergyMod,代码行数:4,代码来源:BloodrockElemental.cs


示例2: CanSpawn

 public override float CanSpawn(NPCSpawnInfo spawnInfo)
 {
     //Needs to be adjusted later
     return 0f;
 }
开发者ID:ColinAV516,项目名称:Spirit-Mod,代码行数:5,代码来源:UnstableWisp.cs


示例3: CanSpawn

 public override float CanSpawn(NPCSpawnInfo spawnInfo)
 {
     int x = spawnInfo.spawnTileX;
     int y = spawnInfo.spawnTileY;
     int tile = (int)Main.tile[x, y].type;
     return (ExampleMod.NormalSpawn(spawnInfo) && (tile == 53 || tile == 112 || tile == 116 || tile == 234) && ExampleMod.NoZoneAllowWater(spawnInfo) && spawnInfo.water) && y < Main.rockLayer && (x < 250 || x > Main.maxTilesX - 250) && !spawnInfo.playerSafe && NPC.downedGolemBoss ? 0.5f : 0f;
 }
开发者ID:digitalseraphim,项目名称:tModLoader,代码行数:7,代码来源:Octopus.cs


示例4: CanSpawn

 public override float CanSpawn(NPCSpawnInfo spawnInfo)
 {
     int x = spawnInfo.spawnTileX;
     int y = spawnInfo.spawnTileY;
     int tile = (int)Main.tile[x, y].type;
     return (tile == 2) && spawnInfo.spawnTileY < Main.rockLayer && !Main.dayTime ? 0.01f : 0f;
 }
开发者ID:ColinAV516,项目名称:EnergyMod,代码行数:7,代码来源:KillerBunny.cs


示例5: CanSpawn

 public override float CanSpawn(NPCSpawnInfo spawnInfo)
 {
     int x = spawnInfo.spawnTileX;
     int y = spawnInfo.spawnTileY;
     int tile = (int)Main.tile[x, y].type;
     return spawnInfo.player.ZoneJungle && spawnInfo.spawnTileY < Main.rockLayer && (tile == 60) && !Main.dayTime ? 0.1f : 0f;
 }
开发者ID:ColinAV516,项目名称:EnergyMod,代码行数:7,代码来源:MudMonster.cs


示例6: CanSpawn

 public override float CanSpawn(NPCSpawnInfo spawnInfo)
 {
     int x = spawnInfo.spawnTileX;
     int y = spawnInfo.spawnTileY;
     int tile = (int)Main.tile[x, y].type;
     return (tile == 147) && !Main.bloodMoon && spawnInfo.player.ZoneSnow && spawnInfo.spawnTileY < Main.rockLayer && !Main.dayTime ? 0.1f : 0f;
 }
开发者ID:ColinAV516,项目名称:EnergyMod,代码行数:7,代码来源:BorealTreeMan.cs


示例7: CanSpawn

        public override float CanSpawn(NPCSpawnInfo spawnInfo)
        {
            if (NPC.AnyNPCs(mod.NPCType("WispQueen")) && Gyrolite.NoBiome(spawnInfo))
                return 10;
            if (Gyrolite.NoInvasion(spawnInfo) && Gyrolite.NoBiome(spawnInfo))
                return 0.5F;

            return 0;
        }
开发者ID:Eldrazi,项目名称:Gyrolite,代码行数:9,代码来源:WoodWisp.cs


示例8: CanSpawn

        public override float CanSpawn(NPCSpawnInfo spawnInfo)
        {
            if (NPC.AnyNPCs(mod.NPCType("WispQueen")) && spawnInfo.player.ZoneDesert)
                return 10;
            if (Gyrolite.NoInvasion(spawnInfo) && spawnInfo.player.ZoneDesert)
                return 0.5F;

            return 0;
        }
开发者ID:Eldrazi,项目名称:Gyrolite,代码行数:9,代码来源:PalmwoodWisp.cs


示例9: CanSpawn

 public override float CanSpawn(NPCSpawnInfo spawnInfo)
 {
     Tile tile = Main.tile[spawnInfo.spawnTileX, spawnInfo.spawnTileY];
     return ExampleMod.NoZoneNormalSpawn(spawnInfo) && (tile.type == 53 || tile.type == 112 || tile.type == 116 || tile.type == 234 || spawnInfo.desertCave) && !spawnInfo.playerSafe && NPC.downedGolemBoss ? 0.5f : 0f;
 }
开发者ID:digitalseraphim,项目名称:tModLoader,代码行数:5,代码来源:Sarcophagus.cs


示例10: CanSpawn

 public override float CanSpawn(NPCSpawnInfo spawnInfo)
 {
     return 0;
 }
开发者ID:Eldrazi,项目名称:Gyrolite,代码行数:4,代码来源:Jeruasashin.cs


示例11: EditSpawnPool

		public virtual void EditSpawnPool(IDictionary<int, float> pool, NPCSpawnInfo spawnInfo)
		{
		}
开发者ID:JavidPack,项目名称:TerraCustom,代码行数:3,代码来源:GlobalNPC.cs


示例12: NoBiome

 public static bool NoBiome(NPCSpawnInfo spawnInfo)
 {
     Player player = spawnInfo.player;
     return !player.ZoneJungle && !player.ZoneDungeon && !player.ZoneCorrupt && !player.ZoneCrimson && !player.ZoneHoly && !player.ZoneSnow && !player.ZoneUndergroundDesert;
 }
开发者ID:Eldrazi,项目名称:Gyrolite,代码行数:5,代码来源:Gyrolite.cs


示例13: NoZoneNormalSpawn

 public static bool NoZoneNormalSpawn(NPCSpawnInfo spawnInfo)
 {
     return NormalSpawn(spawnInfo) && NoZone(spawnInfo);
 }
开发者ID:trekko727,项目名称:tModLoader,代码行数:4,代码来源:ExampleMod.cs


示例14: NoZoneAllowWater

 public static bool NoZoneAllowWater(NPCSpawnInfo spawnInfo)
 {
     return !spawnInfo.sky && !spawnInfo.player.ZoneMeteor && !spawnInfo.spiderCave;
 }
开发者ID:trekko727,项目名称:tModLoader,代码行数:4,代码来源:ExampleMod.cs


示例15: NoZone

 public static bool NoZone(NPCSpawnInfo spawnInfo)
 {
     return NoZoneAllowWater(spawnInfo) && !spawnInfo.water;
 }
开发者ID:trekko727,项目名称:tModLoader,代码行数:4,代码来源:ExampleMod.cs


示例16: NormalSpawn

 public static bool NormalSpawn(NPCSpawnInfo spawnInfo)
 {
     return !spawnInfo.playerInTown && NoInvasion(spawnInfo);
 }
开发者ID:trekko727,项目名称:tModLoader,代码行数:4,代码来源:ExampleMod.cs


示例17: CanSpawn

 public virtual float CanSpawn(NPCSpawnInfo spawnInfo)
 {
     return 0f;
 }
开发者ID:guyde2011,项目名称:tModLoader,代码行数:4,代码来源:ModNPC.cs


示例18: NoZoneNormalSpawnAllowWater

 public static bool NoZoneNormalSpawnAllowWater(NPCSpawnInfo spawnInfo)
 {
     return NormalSpawn(spawnInfo) && NoZoneAllowWater(spawnInfo);
 }
开发者ID:trekko727,项目名称:tModLoader,代码行数:4,代码来源:ExampleMod.cs


示例19: NoInvasion

 public static bool NoInvasion(NPCSpawnInfo spawnInfo)
 {
     return !spawnInfo.invasion && ((!Main.pumpkinMoon && !Main.snowMoon) || spawnInfo.spawnTileY > Main.worldSurface || Main.dayTime) && (!Main.eclipse || spawnInfo.spawnTileY > Main.worldSurface || !Main.dayTime);
 }
开发者ID:Eldrazi,项目名称:Gyrolite,代码行数:4,代码来源:Gyrolite.cs


示例20: ChooseSpawn

 //in Terraria.NPC.SpawnNPC after initializing variables and before actual spawning add
 //  int? spawnChoice = NPCLoader.ChooseSpawn(spawnInfo); if(!spawnChoice.HasValue) { return; }
 //  int spawn = spawnChoice.Value; if(spawn != 0) { goto endVanillaSpawn; }
 internal static int? ChooseSpawn(NPCSpawnInfo spawnInfo)
 {
     IDictionary<int, float> pool = new Dictionary<int, float>();
     pool[0] = 1f;
     foreach (ModNPC npc in npcs.Values)
     {
         float weight = npc.CanSpawn(spawnInfo);
         if (weight > 0f)
         {
             pool[npc.npc.type] = weight;
         }
     }
     foreach (GlobalNPC globalNPC in globalNPCs)
     {
         globalNPC.EditSpawnPool(pool, spawnInfo);
     }
     float totalWeight = 0f;
     foreach (int type in pool.Keys)
     {
         totalWeight += pool[type];
     }
     float choice = (float)Main.rand.NextDouble() * totalWeight;
     foreach (int type in pool.Keys)
     {
         float weight = pool[type];
         if (choice < weight)
         {
             return type;
         }
         choice -= weight;
     }
     return null;
 }
开发者ID:Evarenis,项目名称:tModLoader,代码行数:36,代码来源:NPCLoader.cs



注:本文中的Terraria.ModLoader.NPCSpawnInfo类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# UI.UIElement类代码示例发布时间:2022-05-26
下一篇:
C# ModLoader.ModRecipe类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap