Beispiel #1
0
    public void Action(string player)
    {
        Rng rng = new Rng();

        actions.Add(player + " feels refreshed and gained a power-up:\nIgnore a drink");

        Misc.info.GetComponentInChildren <Text>().text = actions[rng.Range(0, actions.Count)];

        Power power = new Power();

        power.AddPowerUp(Player.turn, "Ignore a drink");
    }
Beispiel #2
0
    public void ChoosePlayer(int i)
    {
        if (Misc.phase == "ChoosePlayer")
        {
            chosenplayer = i;

            if (Action.currentAction == "Challenge")
            {
                Misc.phase = "Roll20";
            }

            else if (Action.currentAction == "Lighthouse")
            {
                turn = chosenplayer;
                Space space = new Space();
                space.MovePawn(chosenplayer, tiles[chosenplayer], tiles[chosenplayer] + ALighthouse.rndSpaces);
            }

            else if (Action.currentAction == "Treasure")
            {
                Power power = new Power();
                if (Power.powerUp0[i].GetComponentInChildren <Text>().text != null && Power.powerUp0[i].GetComponentInChildren <Text>().text != "")
                {
                    power.AddPowerUp(Player.turn, Power.powerUp0[i].GetComponentInChildren <Text>().text);
                }
                if (Power.powerUp1[i].GetComponentInChildren <Text>().text != null && Power.powerUp1[i].GetComponentInChildren <Text>().text != "")
                {
                    power.AddPowerUp(Player.turn, Power.powerUp1[i].GetComponentInChildren <Text>().text);
                }

                Power.powerUp0[i].GetComponentInChildren <Text>().text = null;
                Power.powerUp1[i].GetComponentInChildren <Text>().text = null;
                Player player = new Player();
                player.NewTurn();
            }
        }
    }
Beispiel #3
0
    public void OptionClicked(int i)
    {
        Player player = new Player();

        if (Misc.phase == "Done")
        {
            player.NewTurn();
        }

        else if (Misc.phase == "ChooseOption")
        {
            lastClicked = i;
            if (Action.currentAction == "Challenge")
            {
                player.NewTurn();
            }

            else if (Action.currentAction == "Treasure")
            {
                if (option[i].GetComponentInChildren <Text>().text == "Lose your Powers")
                {
                    Power.powerUp0[Player.turn].GetComponentInChildren <Text>().text = null;
                    Power.powerUp1[Player.turn].GetComponentInChildren <Text>().text = null;
                }
                else
                {
                    Power power = new Power();
                    power.AddPowerUp(Player.turn, option[i].GetComponentInChildren <Text>().text);
                }
                player.NewTurn();
            }

            else if (Action.currentAction == "Boat")
            {
                if (i == 0)
                {
                    Space space = new Space();
                    space.MovePawn(Player.turn, 24, 31);
                    option[0].GetComponentInChildren <Text>().text = "~";
                    option[1].GetComponentInChildren <Text>().text = "~";
                }
                else
                {
                    player.NewTurn();
                }
            }

            else if (Action.currentAction == "DemonDuck")
            {
                if (option[i].GetComponentInChildren <Text>().text == "Move to Star(t)")
                {
                    Space space = new Space();
                    space.MovePawn(Player.turn, 28, 0);
                }
                else
                {
                    if (option[i].GetComponentInChildren <Text>().text == "Lose your Passive effect")
                    {
                        Power.passives[Player.turn].GetComponentInChildren <Text>().text = null;
                    }
                    else
                    {
                        Power.passives[Player.turn].GetComponentInChildren <Text>().text = optionHidden[i];
                        for (int j = 0; j < 6; j++)
                        {
                            if (Player.demonDucked[j])
                            {
                                Power.passives[j].GetComponentInChildren <Text>().text = optionHidden[i];
                            }
                        }
                    }
                    player.NewTurn();
                }
            }

            else if (Action.currentAction == "Star")
            {
                if (option[i].GetComponentInChildren <Text>().text == "Move to the Demon Duck")
                {
                    Space space = new Space();
                    space.MovePawn(Player.turn, 0, 28);
                }
                else
                {
                    if (option[i].GetComponentInChildren <Text>().text == "Lose your Passive effect")
                    {
                        Power.passives[Player.turn].GetComponentInChildren <Text>().text = null;
                    }
                    else
                    {
                        Power.passives[Player.turn].GetComponentInChildren <Text>().text = optionHidden[i];
                        for (int j = 0; j < 6; j++)
                        {
                            if (Player.starred[j])
                            {
                                Power.passives[j].GetComponentInChildren <Text>().text = optionHidden[i];
                            }
                        }
                    }
                    player.NewTurn();
                }
            }
        }
    }