예제 #1
0
    void Start()
    {
        logger = new QuestGame.Logger();
        logger.info("GameManager.cs :: Initializing Game...");

        gameUsers  = new Users(textBoxInput, 0);
        totalUsers = gameUsers.getNumberOfUsers();
        logger.info("GameManager.cs :: Calling AdventureDeck...");
        advDeck.populateDeck();
        logger.info("GameManager.cs :: Calling StoryDeck...");
        storyDeck.populateDeck();
        passed = new bool[4] {
            false, false, false, false
        };

////		storyDeck.populateEventsDeck ();
//		PickUpAdventureCards (0, 12);
//		PickUpAdventureCards (1, 15);
//		PickUpAdventureCards (2, 12);
//		PickUpAdventureCards (3, 12);

        for (int i = 0; i < textBoxInput; i++)
        {
            PickUpAdventureCards(i, 12);
        }

        logger.info("GameManager.cs :: Game has been created with " + totalUsers + " players.");
        togglePlayerCanvas(playerTurn);
    }
예제 #2
0
 public string getRank()
 {
     if (12 > this.shields && this.shields >= 5)
     {
         logger.info("User.cs :: Ranking Up: " + this.user_name);
         this.rank = "Knight";
         this.gameObject.transform.GetChild(1).GetComponent <Image> ().sprite = Knight;
     }
     else if (22 > this.shields && this.shields >= 12)
     {
         logger.info("User.cs :: Ranking Up: " + this.user_name);
         this.gameObject.transform.GetChild(1).GetComponent <Image> ().sprite = ChampionKnight;
         this.rank = "Champion Knight";
     }
     else if (this.shields >= 22)
     {
         logger.info("User.cs :: Ranking Up: " + this.user_name);
         this.rank = "Knight Of the Round Table";
     }
     this.gameObject.transform.GetChild(4).GetComponent <Text>().text = ("Rank: " + this.rank);
     return(this.rank);
 }
예제 #3
0
//	protected Sprite KnightOfTheRoundTable = (Resources.Load("sprites/") as Sprite);


    //public GameObject user_rank_ui;
    //public GameObject hand; //canvas for their hand

    /*public User(string user_name){
     *      this.user_name = user_name;
     *      this.shields = 0;
     *      this.baseAttack = 5;
     *      this.rank = RANK_NAME [0];
     * }*/

    public void Initialize(string user_name, bool ai)
    {
        logger          = new QuestGame.Logger();
        this.user_name  = user_name;
        this.shields    = 0;
        this.baseAttack = 5;
        this.rank       = RANK_NAME [0];
        this.ai         = ai;
        this.hand_ally  = new List <AdventureCard> ();
        Squire          = (Resources.Load <Sprite>("sprites/Squire") as Sprite);
        Knight          = (Resources.Load <Sprite>("sprites/Knight") as Sprite);
        ChampionKnight  = (Resources.Load <Sprite>("sprites/Champion Knight") as Sprite);
        this.gameObject.transform.GetChild(3).GetComponent <Text>().text     = ("Player: " + this.user_name);
        this.gameObject.transform.GetChild(4).GetComponent <Text>().text     = ("Rank: " + this.rank);
        this.gameObject.transform.GetChild(5).GetComponent <Text>().text     = ("Shields: " + this.shields);
        this.gameObject.transform.GetChild(6).GetComponent <Text>().text     = ("BattlePoints: " + this.baseAttack);
        this.gameObject.transform.GetChild(1).GetComponent <Image> ().sprite = Squire;
        logger.info("User.cs :: Initializing Player... " + this.user_name);
    }
    public void beginTournament(User currentUser, Users Players)
    {
        participants = Players.getNumberOfUsers();
        logger.info("TournamentManager.cs :: Beginning Tournament.");
        foreach (GameObject currentPlayer in Players.getUsers())
        {
            logger.test("TournamentManager.cs :: Executing Tournament with players " + currentPlayer.GetComponent <User>().getName());
            SubmissionZone = Resources.Load("PreFabs/aStage") as GameObject;
            SubmitButton   = Resources.Load("Prefabs/TournamentSubmit") as GameObject;
            SubmissionZone = Instantiate(SubmissionZone, currentPlayer.transform);
            SubmitButton   = Instantiate(SubmitButton, currentPlayer.transform);

            if (currentPlayer != currentUser.gameObject)
            {
                SubmissionZone.gameObject.SetActive(false);
                SubmitButton.gameObject.SetActive(false);
            }
        }
    }
예제 #5
0
    public void populateEventsDeck()
    {
        logger.info("StoryDeck.cs :: Populating Deck with Event Cards.");

        List <string> RList1 = new List <string> {
            "King's Recognition", "Queen's Favor"
        };
        List <string> RList4 = new List <string> {
            "Prosperity Throughout the Realm", "King's Call to Arms"
        };
        List <string> RList3 = new List <string> {
            "Court Called to Camelot", "Pox"
        };
        List <string> RList5 = new List <string> {
            "Plague", "Chivalrous Deed"
        };
    }
예제 #6
0
    void Start()
    {
        gameUsers  = new Users(textBoxInput, 0);
        totalUsers = gameUsers.getNumberOfUsers();
        advDeck.populateDeck();

        //storyDeck.populateDeck ();
        passed = new bool[4] {
            false, false, false, false
        };

        logger = new QuestGame.Logger();



        logger.info("GameManager.cs :: Game has been created with " + totalUsers + " players.");
        logger.info("GameManager.cs :: Adventure advDeck has been created. with sizes of " + advDeck.getSizeOfDeck());
        logger.info("GameManager.cs :: Story storyDeck has been created. with sizes of " + storyDeck.getSizeOfDeck());

        logger.info("GameManager.cs :: Game has been created with " + totalUsers + " players.");
        logger.info("GameManager.cs :: Adventure advDeck has been created. with sizes of " + advDeck.getSizeOfDeck());
        logger.info("GameManager.cs :: Story storyDeck has been created. with sizes of " + storyDeck.getSizeOfDeck());

        PickUpAdventureCard(0, "Saxons");
        PickUpAdventureCard(0, "Boar");
        PickUpAdventureCard(0, "Dagger");
        PickUpAdventureCard(0, "Sword");

        PickUpAdventureCard(1, "Sword");

        PickUpAdventureCard(2, "Horse");
        PickUpAdventureCard(2, "Excalibur");
        PickUpAdventureCard(2, "Amour");

        PickUpAdventureCard(3, "Battle-ax");
        PickUpAdventureCard(3, "Lance");
        PickUpAdventureCard(3, "Thieves");

        PickUpAdventureCards(0, 8);
        PickUpAdventureCards(1, 11);
        PickUpAdventureCards(2, 9);
        PickUpAdventureCards(3, 9);

        togglePlayerCanvas(playerTurn);
    }
예제 #7
0
    void displayUsersInfo()
    {
        string names       = "";
        string ranks       = "";
        string shields     = "";
        string battlePoint = "";
        string cardsinHand = "";


//		User cc = gameUsers.findByUserName ("Player" + userInfoTurn).GetComponent<User> ();		// Get User.
        int numUsers = gameUsers.getUsers().Count;

        foreach (GameObject i in gameUsers.getUsers())
        {
            names       += (i.GetComponent <User>().getName());
            names       += "\n";
            ranks       += (i.GetComponent <User>().getRank());
            ranks       += "\n";
            shields     += (i.GetComponent <User>().getShields());
            shields     += "\n";
            battlePoint += (i.GetComponent <User>().getbaseAttack());
            battlePoint += "\n";
            cardsinHand += (i.GetComponent <User>().getHand().transform.childCount);
            cardsinHand += "\n";

//			for(int k = 0; k < numUsers; k++){
//				for(int j = 0; j < i.GetComponent<User>().getHand().transform.childCount; j++){
//					GameObject temp = Instantiate (Resources.Load ("PreFabs/SmallCard") as GameObject, new Vector2 (k, j), Quaternion.identity);
//					temp.transform.SetParent (GameObject.Find("MainUI").transform);
//				}
//			}

//			shields.Add (i.GetComponent<User>().getShields ());
//			battlePoints.Add (i.GetComponent<User>().getbaseAttack ());
//			cardsinHand.Add (i.GetComponent<User>().getHand().transform.childCount);
        }

        PlayerStats.transform.GetChild(0).GetComponent <Text>().text = "Player: " + names;
        PlayerStats.transform.GetChild(1).GetComponent <Text>().text = "Rank: " + ranks;
        PlayerStats.transform.GetChild(2).GetComponent <Text>().text = "Shields: " + shields;
        PlayerStats.transform.GetChild(3).GetComponent <Text>().text = "Base Points: " + battlePoint;
        PlayerStats.transform.GetChild(4).GetComponent <Text>().text = "Cards In Hand: " + cardsinHand;
        logger.info("GameManager.cs ::" + "Players: " + names);
        logger.info("GameManager.cs ::" + "Rank: " + ranks);
        logger.info("GameManager.cs ::" + "Shields: " + shields);
        logger.info("GameManager.cs ::" + "Base Points: " + battlePoint);
        logger.info("GameManager.cs ::" + "Cards In Hand: " + cardsinHand);
    }
예제 #8
0
 // Use this for initialization
 void Start()
 {
     logger.info("HandManager.cs :: Initialzing HandManager.");
     layout = this.GetComponent <HorizontalLayoutGroup> ();
 }
예제 #9
0
    public void Playthrough(GameObject participant, int stage)
    {
        bool          foeStage  = false;
        bool          testStage = false;
        AdventureCard testCard  = null;

        logger.info("QuestManager.cs :: Playthrough :: Starting Playthrough at beginning stage: " + stage);
        Debug.Log("Starting PLAYTHROUGH");
        Debug.Log("The stage beginning is: " + stage);
        //GameObject tempDisplay = null;
        //change between participants, knock them out, continue through stages
        for (int x = 0; x < numStages; x++)
        {
            Debug.Log("Stage: " + x);
            foreach (AdventureCard c in currentQuest[x])
            {
                Debug.Log(c.getName());
            }
        }

        List <AdventureCard> tempList = currentQuest[stage];

        foreach (AdventureCard c in tempList)
        {
            if (c.getType() == "Foe")
            {
                foeStage = true;
                logger.info("QuestManager.cs :: Playthrough :: Card is of type: " + c.getType());

                Debug.Log("foeStage is true");
            }
            else if (c.getType() == "Test")
            {
                testStage = true;
                testCard  = c;
                logger.info("QuestManager.cs :: Playthrough :: Card is of type: " + c.getType());

                Debug.Log("testStage is true");
            }
        }
        if (foeStage)
        {
            //display a foe background image
            Debug.Log("starting the foe stage");
            logger.info("QuestManager.cs :: Playthrough :: Initialzing Foe Stage");

            //tempDisplay = DisplayStage(testCard);
            runThroughFoeStage(participant, currentQuest[stage]);
            //StartCoroutine (runThroughFoeStage (stage));
            //participants = runThroughFoeStage (participants, stage);
        }
        else if (testStage)
        {
            //display the test image and the current bid score
            Debug.Log("starting the test stage");
            //tempDisplay = DisplayStage(testCard);
            logger.info("QuestManager.cs :: Playthrough :: Initialzing Test Stage.");

            //participants = biddingWar(participants, testCard);
        }
        //destroy stages and displayedCard
        //Destroy(tempDisplay);
        //draw card for each participant
        //drawCards(participants);
    }
예제 #10
0
    //check for allies, tests, weapons, foes etc.......
    public void submitCardsQuest()
    {
        logger.info("SubmitCards.cs :: Checking the current submission of cards for a quest");
        listOfStages = new List <List <AdventureCard> > ();
        //get num stages and stage objects
        test = false;
        Quest storycard = GameObject.FindGameObjectWithTag("StoryCard").GetComponent <Quest>();
        int   numStages = storycard.getStages();

        GameObject[] stages = GameObject.FindGameObjectsWithTag("Stage");

        //check each stage submit is correct
        for (int i = 0; i < numStages; i++)
        {
            logger.info("SubmitCards.cs :: Checking if stage " + i + " is eligible for submission");
            //Debug.Log(stages[i].GetComponent<RectTransform>().position.x);  <-----------Goes negative to positive
            bool foe = false;
            bool testCurrentStage = false;
            bool weapons          = false;

            //make a list of children (cards)
            List <AdventureCard> cards = new List <AdventureCard>();
            foreach (Transform j in stages[i].transform)
            {
                //if contains a weapon
                Debug.Log(j.gameObject.GetComponent <AdventureCard> ().getType());
                if (j.gameObject.GetComponent <AdventureCard> ().getType() == "Weapon")
                {
                    //check if duplicates of weapons
                    logger.info("SubmitCards.cs :: There is a " + j.gameObject.GetComponent <AdventureCard> ().getName() + " card");
                    weapons = true;
                    if (sameName(j.gameObject.GetComponent <AdventureCard> ().getName(), cards))
                    {
                        logger.warn("SubmitCards.cs :: There are weapons of the same name. This submission is not eligible");
                        return;
                    }
                }
                //check if multiple tests in one stage and across all stages
                if (j.gameObject.GetComponent <AdventureCard> ().getType() == "Test" && testCurrentStage == true)
                {
                    logger.warn("SubmitCards.cs :: There are multiple 'Test' cards in this stage. This submission is not eligible");
                    return;
                }
                else if (j.gameObject.GetComponent <AdventureCard> ().getType() == "Test" && test == true)
                {
                    logger.warn("SubmitCards.cs :: There are multiple 'Test' cards among all stages. This submission is not eligible");
                    return;
                }
                else if (j.gameObject.GetComponent <AdventureCard> ().getType() == "Test" && test == false)
                {
                    test             = true;
                    testCurrentStage = true;
                    logger.info("SubmitCards.cs :: There is a " + j.gameObject.GetComponent <AdventureCard> ().getName() + " card");
                }

                //check if multiple foes are in single stage
                if (j.gameObject.GetComponent <AdventureCard> ().getType() == "Foe" && foe == true)
                {
                    logger.warn("SubmitCards.cs :: There are multiple 'Foe' cards in this stage. This submission is not eligible");
                    return;
                }
                else if (j.gameObject.GetComponent <AdventureCard> ().getType() == "Foe" && foe == false)
                {
                    logger.info("SubmitCards.cs :: There is a " + j.gameObject.GetComponent <AdventureCard> ().getName() + " card");
                    foe = true;
                }

                //if contains an ally then return
                if (j.gameObject.GetComponent <AdventureCard> ().getType() == "Ally")
                {
                    logger.info("SubmitCards.cs :: This stage contains an 'Ally'. This submission is not eligible");
                    return;
                }

                cards.Add(j.gameObject.GetComponent <AdventureCard>());
                logger.info("SubmitCards.cs :: Adding the card " + j.gameObject.GetComponent <AdventureCard> ().getName() + " to the current stage");
                //Debug.Log (j.gameObject.GetComponent<AdventureCard>().getName());
            }
            //return if both a foe and test are present or neither are present
            if (testCurrentStage && foe)
            {
                logger.warn("SubmitCards.cs :: This stage contains a 'Foe' and a 'Test' card. This submission is not elligible");
                return;
            }
            else if (!testCurrentStage && !foe)
            {
                logger.warn("SubmitCards.cs :: This stage does not contain a 'Foe' or 'Test' card. This submission is not elligible");
                return;
            }

            if (testCurrentStage && weapons)
            {
                logger.warn("SubmitCards.cs :: This stage contains a 'Test' and a 'Weapon' card. This submission is not eligible");
                return;
            }

            logger.info("SubmitCards.cs :: Adding the current stage to the quest");
            listOfStages.Insert(i, cards);
        }
        int[] bpps = new int[numStages];

        for (int y = 0; y < numStages; y++)
        {
            bpps[y] = 0;
        }

        foreach (List <AdventureCard> k in listOfStages)
        {
            foreach (AdventureCard h in k)
            {
                logger.info("SubmitCards.cs :: Calculating battle points for the current stage");
                if (h.getType() == "Test")
                {
                    bpps [listOfStages.IndexOf(k)] = 0;
                    logger.info("SubmitCards.cs :: This stage has a 'Test' and requires no battle points");
                }
                else
                {
                    if (h.getType() == "Weapon")
                    {
                        bpps [listOfStages.IndexOf(k)] += h.getBattlePoints();
                    }
                    else if (h.getType() == "Foe")
                    {
                        if (storycard.getBonusFoe() == h.getName() || storycard.getBonusFoe() == "All")
                        {
                            logger.info("SubmitCards.cs :: the 'Foe' name and bonus foe of the 'Quest' match. Using the higher of the two battle points");
                            bpps [listOfStages.IndexOf(k)] += h.getBonusBattlePoints();
                        }
                        else
                        {
                            bpps [listOfStages.IndexOf(k)] += h.getBattlePoints();
                            logger.info("SubmitCards.cs :: the 'Foe' '" + h.getName() + "' does not match the bonus foe of the 'Quest'. Using the lower of the two battle points");
                        }
                    }
                }
            }
            Debug.Log("bpps = " + bpps[listOfStages.IndexOf(k)]);
        }

        for (int t = 1; t < numStages + 1; t++)
        {
            if (bpps[t - 1] != 0)
            {
                if (t < bpps.Length)
                {
                    if (bpps[t - 1] > bpps[t])
                    {
                        return;
                    }
                }
            }
        }

        Debug.Log("adding stages");
        foreach (List <AdventureCard> s in listOfStages)
        {
            foreach (AdventureCard a in s)
            {
                GameObject.FindGameObjectWithTag("GameController").GetComponent <GameManager> ().advDeck.GetComponent <AdventureDeck> ().adventureDeck.Add(a.getName());
            }
        }
        GameObject.Find("QuestManager").GetComponent <QuestManager> ().setStages(listOfStages);
        foreach (GameObject k in stages)
        {
            Destroy(k);
        }
        GameObject.Find("QuestManager").GetComponent <QuestManager> ().setToggle(true);
        GameManager gm = GameObject.Find("GameManager").GetComponent <GameManager> ();

        gm.playerTurn++;
        if (gm.playerTurn > 3)
        {
            gm.playerTurn = 0;
        }
        gm.togglePlayerCanvas(gm.playerTurn);
        gm.questInProgress = true;
        Destroy(this.gameObject);
        //get cards attatched to each stage
        //create each respective stage (number to beat , or test)
    }
예제 #11
0
    public void populateDeck()
    {
        List <string> RList1 = new List <string>()
        {
            "Sword", "Saxon Knight", "Battle-ax", "Dagger", "Dragon", "Sir Lancelot", "Lance", "Boar", "Horse", "Test of Valor", "Boar", "Mordred", "Black Knight", "Horse", "Amour", "Sword", "Robber Knight", "Battle-ax", "Thieves"
        };
        List <string> RList2 = new List <string>()
        {
            "Horse", "Boar", "Sword", "Saxon Knight", "Horse", "Dagger", "King Pellinore", "Dagger", "Sir Percival", "Giant", "Amour", "Dagger", "Robber Knight", "Sword", "Evil Knight", "Thieves", "Sword"
        };
        List <string> RList3 = new List <string>()
        {
            "Queen Iseult", "Saxon Knight", "Sword", "Merlin", "Giant", "Thieves", "Mordred", "Horse", "Saxons", "Amour", "Dagger", "Lance", "Robber Knight", "Battle-ax", "Evil Knight", "Thieves", "Sword"
        };
        List <string> RList4 = new List <string>()
        {
            "Battle-ax", "Battle-ax", "Queen Guinevere", "Sword", "Saxon Knight", "Test of Temptation", "Green Knight", "Saxons", "Horse", "Amour", "Amour", "Lance", "Robber Knight", "Battle-ax", "Sword"
        };
        List <string> RList5 = new List <string>()
        {
            "Mordred", "King Arthur", "Lance", "Saxons", "Test of Temptation", "Sword", "Saxon Knight", "Green Knight", "Mordred", "Dagger", "Evil Knight", "Sword", "Evil Knight", "Thieves", "Sword"
        };
        List <string> RList6 = new List <string>()
        {
            "Sir Gawain", "Excalibur", "Amour", "Horse", "Test of Morgan Le Fey", "Black Knight", "Sword", "Saxon Knight", "Battle-ax", "Horse", "Saxons", "Robber Knight", "Thieves"
        };
        List <string> RList7 = new List <string>()
        {
            "Sir Galahad", "Horse", "Excalibur", "Boar", "Test of Morgan Le Fey", "Robber Knight", "Horse", "Amour", "Sword", "Saxon Knight", "Saxons", "Sword", "Battle-ax", "Evil Knight", "Thieves"
        };
        List <string> RList8 = new List <string>()
        {
            "Sir Tristan", "Test of Valor", "Lance", "Evil Knight", "Thieves", "Test of the Questing Beast", "Test of the Questing Beast", "Sword", "Saxon Knight", "Lance", "Black Knight", "Horse", "Amour", "Robber Knight"
        };

        logger.info("AdventureDeck.cs :: Populating Deck with cards.");

        int ranStart = 0;

        while (RList1.Count != 0 && RList2.Count != 0 && RList3.Count != 0 && RList4.Count != 0 && RList5.Count != 0 && RList6.Count != 0 && RList7.Count != 0 && RList8.Count != 0)
        {
            ranStart = Random.Range(1, 8);

            if (ranStart == 1)
            {
                if (RList1.Count >= 1)
                {
                    int Ran = Random.Range(0, RList1.Count);
//					Debug.Log (RList1[Ran]);
                    adventureDeck.Add(RList1[Ran]);
                    RList1.RemoveAt(Ran);
                }
                else
                {
                    ranStart = 2;
                }
            }

            if (ranStart == 2)
            {
                if (RList2.Count >= 1)
                {
                    int Ran = Random.Range(0, RList2.Count);
//					Debug.Log (RList2[Ran]);
                    adventureDeck.Add(RList2[Ran]);
                    RList2.RemoveAt(Ran);
                }
                else
                {
                    ranStart = 3;
                }
            }
            if (ranStart == 3)
            {
                if (RList3.Count >= 1)
                {
                    int Ran = Random.Range(0, RList3.Count);
                    adventureDeck.Add(RList3[Ran]);
                    RList3.RemoveAt(Ran);
                }
                else
                {
                    ranStart = 4;
                }
            }
            if (ranStart == 4)
            {
                if (RList4.Count >= 1)
                {
                    int Ran = Random.Range(0, RList4.Count);
                    adventureDeck.Add(RList4[Ran]);
                    RList4.RemoveAt(Ran);
                }
                else
                {
                    ranStart = 5;
                }
            }
            if (ranStart == 5)
            {
                if (RList1.Count >= 1)
                {
                    int Ran = Random.Range(0, RList5.Count);
                    adventureDeck.Add(RList5[Ran]);
                    RList5.RemoveAt(Ran);
                }
                else
                {
                    ranStart = 6;
                }
            }
            if (ranStart == 6)
            {
                if (RList6.Count >= 1)
                {
                    int Ran = Random.Range(0, RList6.Count);
                    adventureDeck.Add(RList6[Ran]);
                    RList6.RemoveAt(Ran);
                }
                else
                {
                    ranStart = 7;
                }
            }
            if (ranStart == 7)
            {
                if (RList7.Count >= 1)
                {
                    int Ran = Random.Range(0, RList7.Count);
                    adventureDeck.Add(RList7[Ran]);
                    RList7.RemoveAt(Ran);
                }
                else
                {
                    ranStart = 8;
                }
            }
            if (ranStart == 8)
            {
                if (RList8.Count >= 1)
                {
                    int Ran = Random.Range(0, RList8.Count);
                    adventureDeck.Add(RList8[Ran]);
                    RList8.RemoveAt(Ran);
                }
                else
                {
                    break;
                }
            }

            /*
             * adventureDeck.Add("Saxon Knight", 8);
             * adventureDeck.Add("Sir Gawain", 1);
             * adventureDeck.Add("Test of Temptation", 2);
             * adventureDeck.Add("Sir Percival", 1);
             * adventureDeck.Add("Test of the Questing Beast", 2);
             * adventureDeck.Add("Sir Lancelot", 1);
             * adventureDeck.Add("Sir Tristan", 1);
             * adventureDeck.Add("Lance", 6);
             * adventureDeck.Add("Merlin", 1);
             * adventureDeck.Add("Test of Morgan Le Fey", 2);
             * adventureDeck.Add("Dagger", 6);
             * adventureDeck.Add("Sir Galahad", 1);
             * adventureDeck.Add ("Amour", 8);
             * adventureDeck.Add("Mordred", 4);
             * adventureDeck.Add("Horse", 11);
             * adventureDeck.Add("King Arthur", 1);
             * adventureDeck.Add("Thieves", 8);
             * adventureDeck.Add("Boar", 4);
             * adventureDeck.Add("Sword", 16);
             * adventureDeck.Add("Robber Knight", 7);
             * adventureDeck.Add("Green Knight", 2);
             * adventureDeck.Add("Giant", 2);
             * adventureDeck.Add("Queen Guinevere", 1);
             * adventureDeck.Add("Test of Valor", 2);
             * adventureDeck.Add("Queen Iseult", 1);
             * adventureDeck.Add("King Pellinore", 1);
             * adventureDeck.Add("Saxons", 5);
             * adventureDeck.Add("Excalibur", 2);
             * adventureDeck.Add("Dragon", 1);
             * adventureDeck.Add("Evil Knight", 6);
             * adventureDeck.Add("Battle-ax", 8);
             * adventureDeck.Add("Black Knight", 3);
             */
        }
        logger.test("AdventureDeck.cs :: Adventure advDeck has been created. with sizes of " + getSizeOfDeck());
    }
예제 #12
0
    // 1. King's Recoginition
    // - This next player(s) to complete a Quest will receive 2 extra shields.
    public void Kings_Recoginition(User player, Users players)
    {
        logger.test("EventsManager.cs :: Event :: Running King's Recoginition.");
        int shields = player.getShields() + 2;

        GameObject.Find("GameManager").GetComponent <GameManager> ().KingsRecognition = true;
        logger.info("EventsManager.cs :: " + player.getName() + " number of shields: " + shields);
        player.setShields(shields);
        logger.info("EventsManager.cs :: " + player.getName() + " number of shields: " + shields);
    }
예제 #13
0
    public void handleStoryCards(User currentUser)
    {
        if (StoryCard.GetComponent <Event> () != null)
        {
            Event evnt = StoryCard.GetComponent <Event> ();
            if (evnt.getName() == "King's Recognition")
            {
                logger.info("GameManager.cs :: Player " + playerTurn + " number of shields. " + currentUser.getShields());
                logger.test("GameManager.cs :: Event :: Running King's Recognition...");
                Events.Kings_Recoginition(currentUser, gameUsers);
                logger.info("GameManager.cs :: Player " + playerTurn + " number of shields. " + currentUser.getShields());
            }
            else if (evnt.getName() == "Queen's Favor")
            {
                logger.test("GameManager.cs :: Event :: Running Queen's Favor.");
                PickUpAdventureCardsTest(Events.Queens_Favor(gameUsers), 2);
            }
            else if (evnt.getName() == "Court Called to Camelot")
            {
                logger.info("GameManager.cs :: Player " + playerTurn + " Base Attack. " + currentUser.getbaseAttack());
                logger.info("GameManager.cs :: Running Court Called to Camelot.");
                Events.Court_Called_To_Camelot(gameUsers);
                logger.info("GameManager.cs :: Player " + playerTurn + " Base Attack. " + currentUser.getbaseAttack());
            }
            else if (evnt.getName() == "Pox")
            {
                logger.info("GameManager.cs :: Player " + playerTurn + " number of shields. " + currentUser.getShields());
                logger.test("GameManager.cs :: Running Pox.");
                Events.Pox(currentUser, gameUsers);
                logger.info("GameManager.cs :: Player " + playerTurn + " number of shields. " + currentUser.getShields());
            }
            else if (evnt.getName() == "Plague")
            {
                logger.info("GameManager.cs :: Player " + playerTurn + " number of shields. " + currentUser.getShields());
                logger.test("GameManager.cs :: Running Plague.");
                Events.Plague(currentUser);
                logger.info("GameManager.cs :: Player " + playerTurn + " number of shields. " + currentUser.getShields());
            }
            else if (evnt.getName() == "Chivalrous Deed")
            {
                logger.info("GameManager.cs :: Player " + playerTurn + " number of shields. " + currentUser.getShields());
                logger.test("GameManager.cs :: Running Chivalrous Deed.");
                Events.Chivalrous_Deed(currentUser, gameUsers);
                logger.info("GameManager.cs :: Player " + playerTurn + " number of shields. " + currentUser.getShields());
            }
            else if (evnt.getName() == "Prosperity Throughout the Realm")
            {
                logger.test("GameManager.cs :: Running Prosperity Throughout the Realm.");
                PickUpAdventureCardsTest(Events.Prosperity_Throughout_The_Realm(gameUsers), 2);
            }
            else if (evnt.getName() == "King's Call to Arms")
            {
                logger.test("GameManager.cs :: Running King's Call to Arms. (IN PROGRESS)");
            }
        }
        else if (StoryCard.GetComponent <Quest> () != null)
        {
            Quest quest = StoryCard.GetComponent <Quest> ();
            //Debug.Log ("Players turn = " + playerTurn);
            //Quests.Setup(gameUsers.findByUserName ("Player" + playerTurn).gameObject);
            questInPlay = true;
            //keepPlaying = true;
            stageInt = 0;


            logger.test("GameManager.cs :: Quest Name: " + quest.getName());
        }
        else if (StoryCard.GetComponent <Tournament> () != null)
        {
            Tournament tournament = StoryCard.GetComponent <Tournament> ();
            logger.test("GameManager.cs :: Tournament Name: " + tournament.getName());
            Debug.Log("GameManager.cs :: Running Tournament : " + tournament.getName());

//			for (int n = 0; n < totalUsers; n++) {
//				if (Input.GetKeyDown ("y")) {
//
//					n++;
//				} else if (Input.GetKeyDown ("n")) {
//					n++;
//				}
//			}
//
            Tournaments.gameObject.GetComponent <TournamentManager> ().beginTournament(currentUser.gameObject);
//			Tournaments.gameObject.GetComponent<TournamentManager> ().beginTournament(gameUsers);

//			if (TournamentManager.gameObject.GetComponent<TournamentManager> ().getTieBreaker () == true) {
//
//			}
        }
    }