Ejemplo n.º 1
0
    public void setRightClaw(ClawItem equipment)
    {
        ItemInventorySlot slot = new ItemInventorySlot();

        if (equipment == null)
        {
            slot.setSlot(null, 0);
        }
        else
        {
            slot.setSlot(equipment, 1);
        }

        this.rightClaw.setSlotBackingInfo(slot);
    }
Ejemplo n.º 2
0
    public override void Deserialize(NetworkReader reader)
    {
        belt = new BeltInventory(0);
        belt.Deserialize(reader);

        backpack  = Item.ReadItem(reader) as BackpackItem;
        helmet    = Item.ReadItem(reader) as HelmetItem;
        upperBody = Item.ReadItem(reader) as UpperBodyItem;
        lowerBody = Item.ReadItem(reader) as LowerBodyItem;
        boots     = Item.ReadItem(reader) as BootsItem;
        leftClaw  = Item.ReadItem(reader) as ClawItem;
        rightClaw = Item.ReadItem(reader) as ClawItem;

        cursorSlot = new ItemInventorySlot();
        cursorSlot.Deserialize(reader);
    }
Ejemplo n.º 3
0
    private static bool smartEquip(Item equip, PlayerInfo info, BackpackInventoryUI invUI)
    {
        if (equip is BackpackItem)
        {
            BackpackItem backpack = equip as BackpackItem;
            if (info.backpack == null)
            {
                info.backpack = backpack;
                if (invUI != null)
                {
                    invUI.loadInventory(info.backpack.inventory);
                }
                return(true);
            }
            return(false);
        }
        else if (equip is HelmetItem)
        {
            HelmetItem helmet = equip as HelmetItem;
            if (info.helmet == null)
            {
                info.helmet = helmet;
                return(true);
            }
            return(false);
        }
        else if (equip is UpperBodyItem)
        {
            UpperBodyItem upperBody = equip as UpperBodyItem;
            if (info.upperBody == null)
            {
                info.upperBody = upperBody;
                return(true);
            }
            return(false);
        }
        else if (equip is LowerBodyItem)
        {
            LowerBodyItem lowerBody = equip as LowerBodyItem;
            if (info.lowerBody == null)
            {
                info.lowerBody = lowerBody;
                return(true);
            }
            return(false);
        }
        else if (equip is BootsItem)
        {
            BootsItem boots = equip as BootsItem;
            if (info.boots == null)
            {
                info.boots = boots;
                return(true);
            }
            return(false);
        }
        else if (equip is ClawItem)
        {
            ClawItem claw = equip as ClawItem;
            if (info.rightClaw == null)
            {
                info.rightClaw = claw;
                return(true);
            }
            else if (info.leftClaw == null)
            {
                info.leftClaw = claw;
            }
            else
            {
                return(false);
            }
        }

        return(false);
    }