コード例 #1
0
        public override void NPCLoot(NPC npc)
        {
            int reaperPlayer = FindClosestReaper(npc);

            if (reaperPlayer != -1)
            {
                if ((soulReward > 1 || Main.rand.NextBool()) || Main.player[reaperPlayer].GetModPlayer <ReaperPlayer>().HuntedTarget == npc.whoAmI)
                {
                    if (Main.player[reaperPlayer].GetModPlayer <ReaperPlayer>().HuntedTarget == npc.whoAmI)
                    {
                        soulReward = (int)(soulReward * 1.5f);
                    }
                    if (soulReward > 0 && !npc.boss)
                    {
                        for (int i = 0; i < soulReward; i++)
                        {
                            Projectile.NewProjectile(npc.Center, new Vector2(Main.rand.NextFloat(-8, 8), Main.rand.NextFloat(-8, 8)), mod.ProjectileType("ReaperSoulProj"), ReaperPlayer.getSoulDamage(), 0, reaperPlayer);
                        }
                    }
                }
            }
        }
コード例 #2
0
 public void AddSoulReward(NPC npc, int reward, Player player)
 {
     if (npc.boss || soulReward > 5)
     {
         if (soulReward > 5)
         {
             reward = Main.rand.NextBool()? 1 : 0;
         }
         for (int i = 0; i < reward; i++)
         {
             Projectile.NewProjectile(npc.Center, new Vector2(Main.rand.NextFloat(-8, 8), Main.rand.NextFloat(-8, 8)), mod.ProjectileType("ReaperSoulProj"), ReaperPlayer.getSoulDamage(), 0, player.whoAmI);
         }
     }
     else
     {
         soulReward += reward;
     }
 }