Ejemplo n.º 1
0
    // UPGRADE PART

    public void SomeFaceHovered(InteractableElt target, bool isHovered)
    {
        if (currentlySelectedFace == null)
        {
            bool isCursed = false; target.myFaceRef.effects.ForEach(x => isCursed = isCursed || (x.nameEffect == "Cursed"));

            DisplayFace(target.gameObject, isHovered);
            if (isHovered && !isCursed)
            {
                myUpgradedFacesDisplayer.DisplayDice(GenerateUpgrades(target.myFaceRef));
            }
            else
            {
                myUpgradedFacesDisplayer.Hide();
            }
        }
    }
Ejemplo n.º 2
0
    public void InitializeLoot(Character monster)
    {
        followerTab.SetActive(false);
        GameObject.Find("Background").GetComponent <LoreHandler>().ExecuteFromTrigger("Kill_" + monster.myInfo.myName, followerTab);

        List <Item> choices = new List <Item>();

        if (forceLoot == null || forceLoot == "")
        {
            myLootDiceDisplayer.DisplayDice(lootDice);

            List <DiceFace> selected = lootDice.rollDistinctFaces(monster.myInfo.lootChoices);

            foreach (DiceFace aFace in selected)
            {
                Item newItem = null;
                switch (aFace.faceName)
                {
                case "GOLD":
                    ItemContent content = new ItemContent(); content.myName = "Gold"; content.goldValue = monster.myInfo.lootValue;
                    newItem = new Item(content);
                    break;

                case "ITEM":
                    newItem = SpawnRandomItem((monster.myInfo.myRarity == " - Champion") ? "Rare" : "Common");
                    newItem.SetOwner(thePlayer);
                    break;
                }
                if (newItem.myInfo.myType == "Weapon" && Random.Range(0f, 1f) < 0.1f)
                {
                    newItem.SetCurse();
                }
                choices.Add(newItem);
            }
        }
        else
        {
            Item newItem = new Item(allItems[forceLoot]); newItem.SetOwner(thePlayer);
            choices.Add(newItem);
            forceLoot = null;
        }
        myLootChoiceDisplayer.DisplayItemCollection(choices);
    }
Ejemplo n.º 3
0
    public void DisplayConditions()
    {
        Dice myDiceConditions = new Dice(new List <string>());

        myDiceConditions.isConditionDice = true;

        DiceFace aFace;

        foreach (Effect eff in myConditions)
        {
            if (eff.nameEffect != null && eff.nameEffect != "")
            {
                aFace = new DiceFace(eff.nameEffect);

                if (new List <string> {
                    "Weak", "LightPoison"
                }.Contains(eff.nameEffect))
                {
                    aFace.value = eff.duration;
                }
                if (new List <string> {
                    "Vulnerable"
                }.Contains(eff.nameEffect))
                {
                    aFace.value = eff.effectValues[0];
                }

                myDiceConditions.myFaces.Add(aFace);
            }
        }
        if (myInfo.immunities != null)
        {
            foreach (string name in myInfo.immunities)
            {
                aFace = new DiceFace("Immune" + name);
                myDiceConditions.myFaces.Add(aFace);
            }
        }

        myConditionsDisplayer.DisplayDice(myDiceConditions);
    }