Exemple #1
0
        public override void UpdateInventory(Player player)
        {
            PokePlayer pokePlayer = player.GetModPlayer(mod, "PokePlayer") as PokePlayer;

            if (pokePlayer != null)
            {
                pokePlayer.trainerCard = true;
            }
        }
Exemple #2
0
        private void DrawUpdateExtraAccessories(SpriteBatch spriteBatch)
        {
            if (Main.playerInventory && Main.EquipPage == 2)
            {
                Point     value = new Point(Main.mouseX, Main.mouseY);
                Rectangle r     = new Rectangle(0, 0, (int)((float)Main.inventoryBackTexture.Width * Main.inventoryScale), (int)((float)Main.inventoryBackTexture.Height * Main.inventoryScale));

                PokePlayer pp = Main.player[Main.myPlayer].GetModPlayer <PokePlayer>(mod);
                for (int i = 0; i < 6; i++)
                {
                    Main.inventoryScale = 0.85f;
                    Item accItem = pp.ExtraAccessories[i];

                    int mH = 0;
                    if (Main.mapEnabled)
                    {
                        if (!Main.mapFullscreen && Main.mapStyle == 1)
                        {
                            mH = 256;
                        }
                        if (mH + 600 > Main.screenHeight)
                        {
                            mH = Main.screenHeight - 600;
                        }
                    }

                    int num17 = Main.screenWidth - 92 - (47 * 3);
                    int num18 = mH + 174;
                    if (Main.netMode == 1)
                    {
                        num17 -= 47;
                    }
                    r.X = num17;
                    r.Y = num18 + (0 + i) * 47;

                    if (r.Contains(value))
                    {
                        Main.player[Main.myPlayer].mouseInterface = true;
                        Main.armorHide     = true;
                        singleSlotArray[0] = accItem;
                        ItemSlot.Handle(singleSlotArray, ItemSlot.Context.EquipPet, 0);
                        accItem = singleSlotArray[0];
                    }
                    singleSlotArray[0] = accItem;
                    ItemSlot.Draw(spriteBatch, singleSlotArray, 13, 0, new Vector2(r.X, r.Y));
                    accItem = singleSlotArray[0];

                    pp.ExtraAccessories[i] = accItem;
                }
            }
        }
Exemple #3
0
        public override bool UseItem(Player player)
        {
            PokePlayer modPlayer = (PokePlayer)player.GetModPlayer(mod, "PokePlayer");

            // need to put a limiter on this, max 1 per item
            if (player.HasBuff(mod.BuffType(Name + "Buff")) < 0 && player.itemTime == 0 && player.itemAnimation > 0 && player.controlUseItem)
            {
                if (Main.netMode != 1)
                {
                    NPC.ReleaseNPC((int)player.position.X, (int)player.position.Y, (int)item.makeNPC, item.placeStyle, player.whoAmI);
                }
            }
            return(true);
        }