public void showStage(ActiveQuest activeQuest) { clearGameObjectArray(cardsToShow); clearGameObjectArray(currButtons); if (activeQuest.getQuest() == null) { gm.setUserInputState(state.STANDBY); clearGameObjectArray(cardsToShow); } changeHeaderMessage(activePlayer.getName() + "'s turn", headerCurrPlayer); if (Object.ReferenceEquals(activeQuest.getCurrentStage().GetType(), typeof(Foe))) { showCard(activeQuest.getQuest()); Destroy(currentBid); Destroy(highestBid); if (playerBP == null) { playerBP = createHeaderMessage(panelPosX - panelWidth / 3, panelHeight / 2, new Vector3(0, 0, 0), " "); } if (activeQuest != null) { changeHeaderMessage("Player BP: " + activePlayer.getBP(activeQuest.getQuest().getName()), playerBP); } else { changeHeaderMessage("Player BP: " + activePlayer.getBP("null"), playerBP); } changeHeaderMessage("Select the cards you wish to play in this stage", instructionHeader); //createButtonMessage(panelPosX, panelPosY - panelHeight/10, "FIGHT"); gm.setUserInputState(state.ASKINGFORCARDSINQUEST); } else if (Object.ReferenceEquals(activeQuest.getCurrentStage().GetType(), typeof(Test))) { showCard(activeQuest.getCurrentStage()); if (currentBid == null) { currentBid = createHeaderMessage(panelPosX - panelWidth / 3, panelHeight / 2, new Vector3(0, 0, 0), " "); } if (highestBid == null) { highestBid = createHeaderMessage(panelPosX + panelWidth / 3, panelHeight / 2, new Vector3(0, 0, 0), " "); } changeHeaderMessage("Current bid: " + activeQuest.getCurrentPlayerFreeBids(), currentBid); changeHeaderMessage("Highest bid: " + activeQuest.getHighestBid(), highestBid); gm.setUserInputState(state.ASKINGFORCARDSINBID); } createButtonMessage(panelPosX - panelWidth / 5, panelPosY + panelHeight / 5, "Give up"); }
public void startStageWeaponSetup() { if (Object.ReferenceEquals(activeQuest.getStage(activeQuest.getCurrentStageNum()).GetType(), typeof(Test))) { if (activeQuest.getCurrentStageNum() == activeQuest.getStageNum()) { endStageWeaponSetup(null); } else { //activeQuest.setStage(getCurrentStageNum+1); endStageWeaponSetup(null); return; } } else { userInputState = state.ASKINGFORSTAGEWEAPONS; ui.askForCards( activeQuest.getSponsor(), activeQuest, GameState.state.ASKINGFORSTAGEWEAPONS, "Select weapons to enhance this stage", "Done", "null", false, true, false, false, false, false ); ui.showCard(activeQuest.getCurrentStage()); } }
public void foeReveal(ActiveQuest activeQuest) { if (enemyBP == null) { enemyBP = createHeaderMessage(panelPosX + panelWidth / 3, panelHeight / 2, new Vector3(0, 0, 0), " "); } Destroy(playerBP); clearGameObjectArray(cardsToShow); clearGameObjectArray(currButtons); showCards(activeQuest.getStageWeapons(activeQuest.getCurrentStageNum()), new Vector2(panelPosX + panelWidth / 10, panelPosY), new Vector2(10, 10)); showCard(activeQuest.getCurrentStage()); stageWinners = new GameObject[activeQuest.getPlayerNum() + 1]; stageWinners[0] = createHeaderMessage(panelPosX - panelWidth / 3, panelHeight / 2, new Vector3(0, 0, 0), "Winners"); createButtonMessage(panelPosX, panelPosY - panelHeight / 10, "OK"); for (int i = 1; i < activeQuest.getPlayerNum() + 1; i++) { stageWinners[i] = createHeaderMessage(panelPosX - panelWidth / 3, panelHeight / 2 - i * (panelHeight / 15), new Vector3(0, 0, 0), activeQuest.getPlayer(i - 1).getName()); } }
//AI submits cards for current quest stage (as a player). public override Card[] playQuestStage(ActiveQuest quest) { if (quest.getCurrentStage().getType().Equals("test")) { return(nextBid(quest)); } Card[] submit = null; int BPhurdle = 0; int count = 0; //hand = sortHand (); //hand = sortHandByType (); Card [] weaponHand = getOnlyType("weapon"); weaponHand = sortHand(weaponHand); Card [] amourHand = getOnlyType("amour"); amourHand = sortHand(amourHand); Card [] allyHand = getOnlyType("ally"); allyHand = sortHand(allyHand); int weaponHandLength = 0; int allyHandLength = 0; int amourHandLength = 0; if (weaponHand != null) { weaponHandLength = weaponHand.Length; } if (allyHand != null) { allyHandLength = allyHand.Length; } if (amourHand != null) { amourHandLength = amourHand.Length; } if (allyHandLength > 0) { for (int i = 0; i < allyHandLength; i++) { submit = hp.addCard(submit, allyHand[i]); } } else if (amourHandLength > 0) { for (int i = 0; i < amourHandLength; i++) { submit = hp.addCard(submit, amourHand[i]); } } if (submit.Length < 2) { for (int i = 0; i < weaponHandLength; i++) { submit = hp.addCard(submit, weaponHand[i]); if (submit.Length == 2) { break; } } } player.discardCard(submit); return(submit); }
//AI submits cards for current quest stage (as a player). public override Card[] playQuestStage(ActiveQuest quest) { if (quest.getCurrentStage().getType().Equals("test")) { return(nextBid(quest)); } Card[] submit = null; int BPhurdle = 0; int count = 0; //hand = sortHand (); //hand = sortHandByType (); Card [] weaponHand = getOnlyType("weapon"); weaponHand = sortHand(weaponHand); Card [] amourHand = getOnlyType("amour"); amourHand = sortHand(amourHand); Card [] allyHand = getOnlyType("ally"); allyHand = sortHand(allyHand); int bp = 0; BPhurdle = quest.getCurrentStageNum() + 1 * 10; if (amourHand != null) { for (int i = 0; i < amourHand.Length; i++) { if (bp >= BPhurdle) { player.discardCard(submit); return(submit); } submit = hp.addCard(submit, amourHand[i]); if (quest.getCurrentStageNum() < quest.getStageNum() - 1) { bp = bp + amourHand[i].getBP(); } } } if (allyHand != null) { for (int i = 0; i < allyHand.Length; i++) { if (bp >= BPhurdle) { player.discardCard(submit); return(submit); } submit = hp.addCard(submit, allyHand[i]); if (quest.getCurrentStageNum() < quest.getStageNum() - 1) { bp = bp + allyHand[i].getBP(); } } } if (weaponHand != null) { for (int i = 0; i < weaponHand.Length; i++) { if (bp >= BPhurdle) { player.discardCard(submit); return(submit); } if (!hp.checkIfArrayContainsCard(submit, weaponHand[i])) { submit = hp.addCard(submit, weaponHand[i]); if (quest.getCurrentStageNum() < quest.getStageNum() - 1) { bp = bp + weaponHand[i].getBP(); } } } } player.discardCard(submit); return(submit); }