예제 #1
0
 public override bool OnPickup(Item item, Player player)
 {
     //if (player.GetModPlayer<PlayerMod>().IsCompanionParty)
     //    return false;
     if (item.type > 0)
     {
         if (player.GetModPlayer <PlayerMod>().Guardian.Active)
         {
             if (item.type == Terraria.ID.ItemID.Heart || item.type == Terraria.ID.ItemID.CandyApple || item.type == Terraria.ID.ItemID.CandyCane)
             {
                 player.GetModPlayer <PlayerMod>().ShareHealthReplenishWithGuardians(20);
             }
             if (item.type == Terraria.ID.ItemID.Star || item.type == Terraria.ID.ItemID.SoulCake || item.type == Terraria.ID.ItemID.SugarPlum)
             {
                 player.GetModPlayer <PlayerMod>().ShareManaReplenishWithGuardians(100);
             }
         }
         if (Main.npcShop <= 0 && item.rare > Terraria.ID.ItemRarityID.Green)
         {
             GuardianGlobalInfos.AddFeat(FeatMentioning.FeatType.FoundSomethingGood,
                                         player.name, item.Name, 8, item.rare,
                                         GuardianGlobalInfos.GetGuardiansInTheWorld());
         }
     }
     return(base.OnPickup(item, player));
 }
예제 #2
0
        public override void SetDefaults(Projectile projectile)
        {
            SpawnClearOwnership = true;
            MyParent            = ProjParent;
            if (projectile.whoAmI > -1 && GuardianProj.ContainsKey(projectile.whoAmI))
            {
                GuardianProj.Remove(projectile.whoAmI);
            }
            switch (projectile.type)
            {
            case Terraria.ID.ProjectileID.BoneJavelin:
            case Terraria.ID.ProjectileID.JavelinFriendly:
                projectile.melee  = false;
                projectile.thrown = true;
                break;

            case Terraria.ID.ProjectileID.CoinPortal:
                if (!Main.gameMenu)
                {
                    GuardianGlobalInfos.AddFeat(FeatMentioning.FeatType.CoinPortalSpawned,
                                                Main.player[Main.myPlayer].name, "", 12, 10,
                                                GuardianGlobalInfos.GetGuardiansInTheWorld());
                }
                break;
            }
        }
예제 #3
0
 public override void RightClick(int i, int j, int type)
 {
     if (type == 10)
     {
         Tile tile = Main.tile[i, j];
         if (tile.frameY >= 594 && tile.frameY <= 646 && Main.player[Main.myPlayer].HasItem(1141))
         {
             GuardianGlobalInfos.AddFeat(FeatMentioning.FeatType.OpenedTemple,
                                         Main.player[Main.myPlayer].name, Main.worldName, 8, 10,
                                         GuardianGlobalInfos.GetGuardiansInTheWorld());
         }
     }
 }