private void Awake() { //Modulok beállítása this.modules = Module_Controller.CreateModuleController(this, factory, client); //Interakciók beállítása this.interactions = new Interactions(this, modules); //Játékfázisok beállítása this.orderChangeState = new OrderChangeState(modules, this, interactions); this.preparationState = new PreparationState(modules, this, interactions); this.starterDrawState = new StarterDrawState(modules, this, interactions); this.settingRoleState = new SettingRoleState(modules, this, interactions); this.selectFightTypeState = new SelectFightTypeState(modules, this, interactions); this.summonState = new SummonState(modules, this, interactions); this.revealCardsState = new RevealCardsState(modules, this, interactions); this.quickSkillState = new QuickSkillState(modules, this, interactions); this.mainSkillState = new MainSkillState(modules, this, interactions); this.compareState = new CompareState(modules, this, interactions); this.lateSkillState = new LateSkillState(modules, this, interactions); this.cardPutAwayState = new CardPutAwayState(modules, this, interactions); this.blindMatchState = new BlindMatchState(modules, this, interactions); this.resultState = new ResultState(modules, this, interactions); //Játékfázisok és státuszok alapértékezése this.currentPhase = MainGameStates.SetupGame; this.currentStat = CardStatType.NotDecided; this.currentAction = SkillEffectAction.None; this.currentSelectionType = CardListTarget.None; this.currentKey = -1; this.currentActiveCard = -1; this.lastWinnerKey = -1; this.phaseChange = true; this.firstRound = true; this.displayedMessageStatus = false; this.blindMatch = false; this.actionFinished = true; this.turnFinished = true; this.skillFinished = true; this.changedOrder = false; this.lateSkillKeys = new List <int>(); this.instantWin = false; this.negatedSkills = false; rng = new System.Random(); }
public List <Card> GetCardsFromPlayer(int playerKey, CardListTarget target, CardListFilter filter = CardListFilter.None, int limit = 0) { List <Card> cardList = new List <Card>(); List <Card> resultList = new List <Card>(); switch (target) { case CardListTarget.Hand: cardList = GetPlayerWithKey(playerKey).GetCardsInHand(); break; case CardListTarget.Field: cardList = GetPlayerWithKey(playerKey).GetCardsOnField(); break; case CardListTarget.Losers: cardList = GetPlayerWithKey(playerKey).GetLosers(); break; case CardListTarget.Deck: cardList = GetPlayerWithKey(playerKey).GetDeck(limit); break; case CardListTarget.Winners: cardList = GetPlayerWithKey(playerKey).GetWinners(); break; default: return(null); } foreach (Card card in cardList) { resultList.Add(card); } if (filter != CardListFilter.None) { resultList = GetFilteredList(resultList, playerKey, filter); } return(resultList); }
public Card GetCardFromPlayer(int playerKey, int position, CardListTarget target) { switch (target) { case CardListTarget.Hand: return(this.playerDictionary[playerKey].GetCardFromHand(position)); case CardListTarget.Field: return(this.playerDictionary[playerKey].GetCardFromField(position)); case CardListTarget.Losers: return(this.playerDictionary[playerKey].GetCardFromLosers(position)); case CardListTarget.Deck: return(this.playerDictionary[playerKey].GetCardFromDeck(position)); default: return(null); } }
public IEnumerator CardAmountCheck() { //Ha több mint 7 lap van a kezünkben, le kell dobni egy szabadon választottat. if (modules.GetDataModule().GetCardsFromPlayer(currentKey, CardListTarget.Hand).Count > 7) { currentAction = SkillEffectAction.TossCard; currentSelectionType = CardListTarget.Hand; modules.GetSkillModule().MakePlayerChooseCard(); yield return(new WaitForSeconds((GameSettings_Controller.drawTempo) / 2)); ActionFinished(); } else { yield return(new WaitForSeconds((GameSettings_Controller.drawTempo) / 2)); ActionFinished(); } }
public void DisplayCards(int type) { //Csak egyszerre egyszer lehessen megjeleníteni if (!client.GetCardListStatus()) { CardListTarget listType = CardListTarget.None; switch (type) { case 0: listType = CardListTarget.Losers; break; case 1: listType = CardListTarget.Winners; break; default: break; } //Csak akkor jelenítsük meg, ha van mit megjeleníteni. if ((listType == CardListTarget.Winners && winAmount > 0) || (listType == CardListTarget.Losers && lostAmount > 0)) { client.ReportDisplayRequest(listType, positionID); } } }
public void ReportDisplayRequest(CardListTarget listType, int playerKey) { List <Card> cardList = new List <Card>(); string msg; switch (listType) { case CardListTarget.Winners: cardList = modules.GetDataModule().GetPlayerWithKey(playerKey).GetWinners(); msg = "Győztesek:"; break; case CardListTarget.Losers: cardList = modules.GetDataModule().GetPlayerWithKey(playerKey).GetLosers(); msg = "Vesztesek:"; break; default: msg = "Hibás kérés"; break; } //Lélekrablás esetén saját vesztes lapokat nem választhatunk ki, illetve mások győztes lapjait sem if (playerKey == modules.GetGameModule().GetCurrentKey() && modules.GetGameModule().GetCurrentAction() == SkillEffectAction.SkillUse && listType == CardListTarget.Losers) { msg = "Válaszd ki, hogy melyik lap képességét használod fel!"; modules.GetClientModule().CardChoice(cardList, SkillEffectAction.None, modules.GetGameModule().GetCurrentKey(), msg); } else { modules.GetClientModule().CardChoice(cardList, modules.GetGameModule().GetCurrentAction(), playerKey, msg); } }
public void ReportDisplayRequest(CardListTarget listType, int positionID) { inputModule.ReportDisplayRequest(listType, playerFields.Keys.ElementAt(positionID)); }
public void SetSwitchType(CardListTarget type) { currentSelectionType = type; }