Пример #1
0
    private void SetupModActiveAbility()
    {
        hackerModAbilityDescription.text = item.GetItemAbilityDescription();
        HackerMod hackerMod = item as HackerMod;

        string slotString = hackerMod.GetMaxSlotCount().ToString();

        switch (hackerMod.GetItemType())
        {
        case Item.ItemTypes.NeuralImplant:
            slotString += " Wetware";
            break;

        case Item.ItemTypes.Rig:
            slotString += " Software";
            break;

        case Item.ItemTypes.Uplink:
            slotString += " Chipsets";
            break;
        }
        slotsField.text = slotString;

        string path = "Icons/ActiveAbilityIcons/Ability" + hackerMod.GetActiveAbilityId().ToString();

        hackerModAbilityIcon.sprite = Resources.Load <Sprite>(path);
        string uses = " use";

        if (hackerMod.GetActiveAbilityUses() > 1)
        {
            uses = " uses";
        }
        hackerModAbilityUseCount.text = hackerMod.GetActiveAbilityUses().ToString() + uses;
    }
    public void EquipRecreatedItem(HackerMod hackerMod)
    {
        switch (hackerMod.GetItemType())
        {
        case Item.ItemTypes.Rig:
            rig = hackerMod;
            break;

        case Item.ItemTypes.NeuralImplant:
            neuralImplant = hackerMod;
            break;

        case Item.ItemTypes.Uplink:
            uplink = hackerMod;
            break;
        }
    }
    public void EquipItem(HackerMod hackerMod)
    {
        Debug.Log("Hackermod stuff");
        List <HackerModChip> equippedChips = new List <HackerModChip>();

        switch (hackerMod.GetItemType())
        {
        case Item.ItemTypes.NeuralImplant:
            equippedChips = neuralImplant.GetAttachedChips();
            if (equippedChips.Count < hackerMod.GetCurrentLevelSlotCount())
            {
                equippedChips.AddRange(FillEmptySlotsWithInventoryItems(Item.ItemTypes.Wetware, hackerMod.GetCurrentLevelSlotCount() - equippedChips.Count));
            }
            neuralImplant = hackerMod;
            break;

        case Item.ItemTypes.Rig:
            equippedChips = rig.GetAttachedChips();
            if (equippedChips.Count < hackerMod.GetCurrentLevelSlotCount())
            {
                equippedChips.AddRange(FillEmptySlotsWithInventoryItems(Item.ItemTypes.Software, hackerMod.GetCurrentLevelSlotCount() - equippedChips.Count));
            }
            rig = hackerMod;
            break;

        case Item.ItemTypes.Uplink:
            equippedChips = uplink.GetAttachedChips();
            if (equippedChips.Count < hackerMod.GetCurrentLevelSlotCount())
            {
                equippedChips.AddRange(FillEmptySlotsWithInventoryItems(Item.ItemTypes.Chipset, hackerMod.GetCurrentLevelSlotCount() - equippedChips.Count));
            }
            uplink = hackerMod;
            break;
        }

        for (int i = 0; i < hackerMod.GetCurrentLevelSlotCount(); i++)
        {
            hackerMod.InstallChip(equippedChips[i], i);
        }
    }
Пример #4
0
    public void OpenMenu()
    {
        gameObject.SetActive(true);
        FindObjectOfType <CheckClickController>().SetOverlayState();
        AbilityButton[] abilityButtons = FindObjectsOfType <AbilityButton>();
        foreach (AbilityButton abilityButton in abilityButtons)
        {
            HackerMod hackerMod = abilityButton.GetHackerMod();
            switch (hackerMod.GetItemType())
            {
            case Item.ItemTypes.NeuralImplant:
                neuralImplantAbilityHolder.SetupAbilityHolder(hackerMod, abilityButton);
                break;

            case Item.ItemTypes.Rig:
                rigAbilityHolder.SetupAbilityHolder(hackerMod, abilityButton);
                break;

            case Item.ItemTypes.Uplink:
                uplinkAbilityHolder.SetupAbilityHolder(hackerMod, abilityButton);
                break;
            }
        }
    }