Пример #1
0
    public override void SpellCast(SpellCaster player)
    {
        if (player.inventory.Count <= 0)
        {
            PanelHolder.instance.displayNotify("No Items!", "You have no items to sacrifice to cast this spell.", "OK");
        }
        // cast spell for free if Umbra's Eclipse is active
        else if (SpellTracker.instance.CheckUmbra())
        {
            string itemName;
            // take a random index from the inventory of items and remove it
            List <ItemObject> playerInventory = new List <ItemObject>(player.inventory);
            if (playerInventory.Count <= 1)
            {
                itemName = playerInventory[0].name;
                player.RemoveFromInventory(playerInventory[0]);
            }
            else
            {
                int rIndex = (int)UnityEngine.Random.Range(0, playerInventory.Count);
                itemName = playerInventory[rIndex].name;
                player.RemoveFromInventory(playerInventory[rIndex]);
            }

            PanelHolder.instance.displayNotify(sSpellName, "You destroyed " + itemName + ". Discard 2 of your runes and choose 2 runes of your choice from the deck.", "MainPlayerScene");

            player.numSpellsCastThisTurn++;
            SpellTracker.instance.lastSpellCasted = this;
        }
        else if (player.iMana < iManaCost)
        {
            PanelHolder.instance.displayNotify("Not enough Mana!", "You do not have enough mana to cast this spell.", "OK");
        }
        else
        {
            // subtract mana
            player.iMana -= iManaCost;

            string itemName;
            // take a random index from the inventory of items and remove it
            List <ItemObject> playerInventory = new List <ItemObject>(player.inventory);
            if (playerInventory.Count <= 1)
            {
                itemName = playerInventory[0].name;
                player.RemoveFromInventory(playerInventory[0]);
            }
            else
            {
                int rIndex = (int)UnityEngine.Random.Range(0, playerInventory.Count);
                itemName = playerInventory[rIndex].name;
                player.RemoveFromInventory(playerInventory[rIndex]);
            }

            PanelHolder.instance.displayNotify(sSpellName, "You destroyed " + itemName + ". Discard 2 of your runes and choose 2 runes of your choice from the deck.", "MainPlayerScene");

            player.numSpellsCastThisTurn++;
            SpellTracker.instance.lastSpellCasted = this;
        }
    }
Пример #2
0
    public override void SpellCast(SpellCaster player)
    {
        if (player.inventory.Count < 2)
        {
            PanelHolder.instance.displayNotify("Not enough Items!", "You need 2 items to cast this spell.", "OK");
        }
        // cast spell for free if Umbra's Eclipse is active
        else if (SpellTracker.instance.CheckUmbra())
        {
            // destroy 2 random items from inventory
            ItemObject item1 = player.inventory[Random.Range(0, player.inventory.Count)];
            player.RemoveFromInventory(item1);
            ItemObject item2 = player.inventory[Random.Range(0, player.inventory.Count)];
            player.RemoveFromInventory(item2);

            // get a random item
            string[]   items   = new string[] { "Mimetic Vellum", "Crystal Mirror", "Rift Talisman" };
            ItemObject newItem = GameObject.Find("ItemList").GetComponent <ItemList>().GetItemFromName(items[Random.Range(0, 3)]);

            player.AddToInventory(newItem);
            PanelHolder.instance.displayBoardScan("Rigel's Ascension", "You destroyed " + item1.name + " and " + item2.name + " and gained " + newItem.name + "!", newItem.sprite, "MainPlayerScene");

            player.numSpellsCastThisTurn++;
            SpellTracker.instance.lastSpellCasted = this;
        }
        else if (player.iMana < iManaCost)
        {
            PanelHolder.instance.displayNotify("Not enough Mana!", "You do not have enough mana to cast this spell.", "OK");
        }
        else
        {
            // subtract mana and glyph costs
            player.iMana -= iManaCost;

            // destroy 2 random items from inventory
            ItemObject item1 = player.inventory[Random.Range(0, player.inventory.Count)];
            player.RemoveFromInventory(item1);
            ItemObject item2 = player.inventory[Random.Range(0, player.inventory.Count)];
            player.RemoveFromInventory(item2);

            // get a random item
            string[]   items   = new string[] { "Mimetic Vellum", "Crystal Mirror", "Rift Talisman" };
            ItemObject newItem = GameObject.Find("ItemList").GetComponent <ItemList>().GetItemFromName(items[Random.Range(0, 3)]);

            player.AddToInventory(newItem);
            PanelHolder.instance.displayBoardScan("Rigel's Ascension", "You destroyed " + item1.name + " and " + item2.name + " and gained " + newItem.name + "!", newItem.sprite, "MainPlayerScene");

            player.numSpellsCastThisTurn++;
            SpellTracker.instance.lastSpellCasted = this;
        }
    }
Пример #3
0
    public override void UseItem(SpellCaster player)
    {
        if (player.chapter.spellsCollected.Count <= 0)
        {
            PanelHolder.instance.displayNotify("No Spells Collected", "You do not have any spells that can be stored in the cabochon.", "OK");
        }
        else
        {
            // check to see if they have at least 1 non combat spell to put in
            bool hasNonCombatSpell = false;
            foreach (Spell spell in player.chapter.spellsCollected)
            {
                if (!spell.combatSpell)
                {
                    hasNonCombatSpell = true;
                    break;
                }
            }

            if (!hasNonCombatSpell)
            {
                PanelHolder.instance.displayNotify("No Spells Collected", "You do not have any spells that can be stored in the cabochon.", "OK");
            }
            else
            {
                SoundManager.instance.PlaySingle(SoundManager.hollowCabochon);
                player.RemoveFromInventory(this);

                player.AddToInventory(new GlimmeringCabochon());
                PanelHolder.instance.displayNotify("Hollow Cabochon", "Your Hollow Cabochon has turned into a Glimmering Cabochon!", "InventoryScene");
            }
        }
    }
Пример #4
0
    public override void UseItem(SpellCaster player)
    {
        SoundManager.instance.PlaySingle(SoundManager.mimeticVellum);
        player.RemoveFromInventory(this);

        PanelHolder.instance.displayNotify("Mimetic Vellum", "Choose a rune from your hand and duplicate it. Discard a rune to keep the duplicate.", "InventoryScene");
    }
Пример #5
0
    public override void UseItem(SpellCaster player)
    {
        SoundManager.instance.PlaySingle(SoundManager.glimmeringCabochon);
        player.RemoveFromInventory(this);

        List <Spell> spells = new List <Spell>();

        // only include spell if it's non-combat
        foreach (Spell s in player.chapter.spellsCollected)
        {
            if (!s.combatSpell)
            {
                if (!s.sSpellName.Equals("Deja Vu"))     // don't allow cabochon to cast Deja vu (too complicated)
                {
                    spells.Add(s);
                }
            }
        }

        Spell spell = spells[Random.Range(0, spells.Count)];

        if (spell is IAllyCastable)
        {
            IAllyCastable spellToCast = (IAllyCastable)spell;

            // cast the spell
            spellToCast.RecieveCastFromAlly(player);
        }
        else
        {
            player.CollectMana(spell.iManaCost);
            spell.SpellCast(player);
        }
    }
    public override void UseItem(SpellCaster player)
    {
        SoundManager.instance.PlaySingle(SoundManager.aromaticTeaLeaves);
        player.RemoveFromInventory(this);

        PanelHolder.instance.displayNotify("Aromatic Tea Leaves", "Discard your runes and draw 4 new runes from the low tier deck.", "InventoryScene");
    }
Пример #7
0
    public override void UseItem(SpellCaster player)
    {
        SoundManager.instance.PlaySingle(SoundManager.crystalMirror);
        player.RemoveFromInventory(this);

        PanelHolder.instance.displayNotify("Crystal Mirror", "Discard all runes on the board and replace them with runes from the high tier deck.", "InventoryScene");
    }
Пример #8
0
    public override void UseItem(SpellCaster player)
    {
        SoundManager.instance.PlaySingle(SoundManager.waxCandle);
        player.RemoveFromInventory(this);

        player.waxCandleUsed = true;
        PanelHolder.instance.displayNotify("Wax Candle", "The candle is lit. Next time you're in the forest, you will find duplicate items.", "InventoryScene");
    }
Пример #9
0
    public override void UseItem(SpellCaster player)
    {
        SoundManager.instance.PlaySingle(SoundManager.mysticTranslocator);
        player.RemoveFromInventory(this);

        player.locationItemUsed = true;
        PanelHolder.instance.displayNotify("Mystic Translocator", "Swap locations with another wizard (both wizards must be on a location space).", "VuforiaScene");
    }
    public override void UseItem(SpellCaster player)
    {
        SoundManager.instance.PlaySingle(SoundManager.glowingMushroom);
        player.RemoveFromInventory(this);

        player.HealDamage(2);
        PanelHolder.instance.displayNotify("Glowing Mushroom", "You ate the mushroom and healed 2 health. You feel a little funny, though...", "InventoryScene");
    }
Пример #11
0
    public override void UseItem(SpellCaster player)
    {
        SoundManager.instance.PlaySingle(SoundManager.riftTalisman);
        player.RemoveFromInventory(this);

        CrisisHandler.instance.roundsUntilCrisis++;
        NetworkManager.s_Singleton.ModifyRoundsUntilNextCrisis(1);
        PanelHolder.instance.displayNotify("Rift Talisman", "The " + CrisisHandler.instance.currentCrisis + " will be delayed by 1 round.", "InventoryScene");
    }
Пример #12
0
    public override void UseItem(SpellCaster player)
    {
        SoundManager.instance.PlaySingle(SoundManager.opalAmmonite);
        player.RemoveFromInventory(this);

        int randMana = Random.Range(800, 2600);

        player.CollectMana(randMana);

        PanelHolder.instance.displayNotify("Opal Ammonite", "The Opal Ammonite granted you " + randMana + " mana!", "InventoryScene");
    }
Пример #13
0
    public override void UseItem(SpellCaster player)
    {
        SoundManager.instance.PlaySingle(SoundManager.abyssalOre);
        player.RemoveFromInventory(this);

        // give player a random dice
        int randSides = Random.Range(4, 8);

        if (player.tempDice.ContainsKey("D" + randSides.ToString()))
        {
            player.tempDice["D" + randSides.ToString()] += 1;
        }
        else
        {
            player.tempDice.Add("D" + randSides.ToString(), 1);
        }

        PanelHolder.instance.displayNotify("Abyssal Ore", "The Abyssal Ore gave you a D" + randSides.ToString() + "!", "InventoryScene");
    }
Пример #14
0
    public override void UseItem(SpellCaster player)
    {
        SoundManager.instance.PlaySingle(SoundManager.infusedSapphire);
        player.RemoveFromInventory(this);

        GameObject locationContainer = GameObject.Find("LocationContainer");

        player.locationItemUsed = true;
        string[] locations = new string[9] {
            "Forest", "Swamp", "Crystal Mines", "Regulus", "Zandria", "Meridea", "Sarissa", "Parados", "Andromeda"
        };
        string randLocation = locations[Random.Range(0, 9)];

        Sprite locationSprite;

        switch (randLocation)
        {
        case "Forest":
            locationSprite = locationContainer.transform.Find("Forest").GetComponent <SpriteRenderer>().sprite;
            PanelHolder.instance.displayBoardScan("Infused Sapphire", "The Infused Sapphire teleported you to the " + randLocation + "!", locationSprite, "ForestScene");
            break;

        case "Swamp":
            locationSprite = locationContainer.transform.Find("Swamp").GetComponent <SpriteRenderer>().sprite;
            PanelHolder.instance.displayBoardScan("Infused Sapphire", "The Infused Sapphire teleported you to the " + randLocation + "!", locationSprite, "SwampScene");
            break;

        case "Crystal Mines":
            locationSprite = locationContainer.transform.Find("Mines").GetComponent <SpriteRenderer>().sprite;
            PanelHolder.instance.displayBoardScan("Infused Sapphire", "The Infused Sapphire teleported you to the " + randLocation + "!", locationSprite, "MineScene");
            break;

        case "Regulus":
            locationSprite = locationContainer.transform.Find("Regulus").GetComponent <SpriteRenderer>().sprite;
            PanelHolder.instance.displayBoardScan("Infused Sapphire", "The Infused Sapphire teleported you to " + randLocation + "!", locationSprite, "AlchemyTownScene");
            break;

        case "Zandria":
            locationSprite = locationContainer.transform.Find("Zandria").GetComponent <SpriteRenderer>().sprite;
            PanelHolder.instance.displayBoardScan("Infused Sapphire", "The Infused Sapphire teleported you to the " + randLocation + "!", locationSprite, "ArcaneTownScene");
            break;

        case "Meridea":
            locationSprite = locationContainer.transform.Find("Meridea").GetComponent <SpriteRenderer>().sprite;
            PanelHolder.instance.displayBoardScan("Infused Sapphire", "The Infused Sapphire teleported you to the " + randLocation + "!", locationSprite, "ChronomancyTownScene");
            break;

        case "Sarissa":
            locationSprite = locationContainer.transform.Find("Sarissa").GetComponent <SpriteRenderer>().sprite;
            PanelHolder.instance.displayBoardScan("Infused Sapphire", "The Infused Sapphire teleported you to the " + randLocation + "!", locationSprite, "ElementalTownScene");
            break;

        case "Parados":
            locationSprite = locationContainer.transform.Find("Parados").GetComponent <SpriteRenderer>().sprite;
            PanelHolder.instance.displayBoardScan("Infused Sapphire", "The Infused Sapphire teleported you to the " + randLocation + "!", locationSprite, "IllusionTownScene");
            break;

        case "Andromeda":
            locationSprite = locationContainer.transform.Find("Andromeda").GetComponent <SpriteRenderer>().sprite;
            PanelHolder.instance.displayBoardScan("Infused Sapphire", "The Infused Sapphire teleported you to the " + randLocation + "!", locationSprite, "SummonerTownScene");
            break;

        default:
            break;
        }
    }