public void StartCombatStateMachine(EncounterConfig combatConfig, Player p) { useAI = true; currentConfig = combatConfig; playerDiscardPile = new CombatDeck(); playerExilePile = new CombatDeck(); playerHand = new CombatHand(); Main.instance.ShufflePlayerCurrentCombatDeck(p); playerSideDeck = new CombatDeck(p.GetCurrentCombatDeck()); //TODO: Load Combat Configs and init enemies enemies.Clear(); foreach (var enemy in combatConfig.enemies) { //UnityEngine.Debug.Log(ConfigHandler.enemyConfigs[enemy].type); Enemy e = new Enemy(); e.Init(ConfigHandler.enemyConfigs[enemy]); enemies.Add(e); } MainUIController.instance.ActivateEnemyCanvas(enemies); DrawInitialHands(p.GetStartingCardCount(), 3); //TODO: Config Enemy Starting Hands turn = 0; isPlayerTurn = true; isActive = true; }
//deprecated public override void GenerateCombatStartDeck() { int size = 4; currentCharacterDeck = new CombatDeck(); CombatCard[] startingDeckCards = assignedMerc.GetCombatDeck().DrawCards(size).ToArray(); currentCharacterDeck.AddCards(startingDeckCards); handManager.AssignDeck(currentCharacterDeck); assignedMerc.GetCombatDeck().DiscardCards(startingDeckCards); }
void ClearHands() { //UnityEngine.Debug.Log("clearing hand"); playerHand.Clear(); foreach (Enemy e in enemies) { e.GetCurrentHand().Clear(); } Main.instance.ClearHands(); playerSideDeck = null; }
public override void Init() { health = new Health(); health.Init(); mana = new Mana(); mana.Init(); action = new Action(); action.Init(); deck = new CombatDeck(); deck.Init(); currentHand = new CombatHand(); discardHand = new CombatHand(); exileHand = new CombatHand(); }
public override void Init() { level = 1; health = new Health(); health.Init(); action = new Action(); action.Init(); mana = new Mana(); mana.Init(); UpdateStatsUI(); deck = new CombatDeck(); deck.Init(); currentDeck = new CombatDeck(deck); equippedTrinkets = new List <Enums.Trinket>(); unEquippedItems = new List <Enums.Equipment>(); appliedEffects = new Dictionary <Enums.AppliedEffect, int>(); isDead = false; }
public void StartTimelineStateMachine(EncounterConfig timelineConfig, Player p) { useAI = false; currentConfig = timelineConfig; playerDiscardPile = new CombatDeck(); playerExilePile = new CombatDeck(); playerHand = new CombatHand(); playerSideDeck = new CombatDeck(p.GetCurrentCombatDeck()); enemies.Clear(); foreach (var enemy in timelineConfig.enemies) { //UnityEngine.Debug.Log(ConfigHandler.enemyConfigs[enemy].type); Enemy e = new Enemy(); e.Init(ConfigHandler.enemyConfigs[enemy]); enemies.Add(e); } isPlayerTurn = false; isActive = true; }
public static CombatDeck GetClassCards() { CombatDeck result = new CombatDeck(); /* result.AddCards(typeof(Pistolwhip)); result.AddCards(typeof(Hipfire),2); result.AddCards(typeof(BurstFire)); result.AddCards(typeof(FullAuto)); result.AddCards(typeof(Camo)); result.AddCards(typeof(Tripmine)); result.AddCards(typeof(LimbShot)); result.AddCards(typeof(HollowPoint)); result.AddCards(typeof(PersonalSpace)); */ result.AddCards(typeof(DetonateAmmo)); result.AddCards(typeof(Hipfire)); result.AddCards(typeof(DoubleTap)); result.AddCards(typeof(Tripmine)); result.AddCards(typeof(FullAuto)); return result; }
public void Init(EnemyConfig config) { enemyType = config.type; name = config.name; health = new Health(); health.Init(config.health); mana = new Mana(); mana.Init(config.mana); action = new Action(); action.Init(config.action); deck = new CombatDeck(); deck.Init(config.deck); deck.Shuffle(); currentHand = new CombatHand(); discardHand = new CombatHand(); exileHand = new CombatHand(); appliedEffects = new Dictionary <Enums.AppliedEffect, int>(); isDead = false; }
public static CombatDeck GetClassCards() { CombatDeck result = new CombatDeck(); /* result.AddCards(typeof(SuckerPunch)); result.AddCards(typeof(Roundhouse),2); result.AddCards(typeof(Kick)); result.AddCards(typeof(LightsOut),2); result.AddCards(typeof(Throw)); result.AddCards(typeof(Execution)); result.AddCards(typeof(SprayNPray)); result.AddCards(typeof(Sidearm)); */ //result.AddCards(typeof(GangUp)); //result.AddCards(typeof(NoRest)); result.AddCards(typeof(MobMentality)); result.AddCards(typeof(SuckerPunch)); result.AddCards(typeof(Kick)); result.AddCards(typeof(SprayNPray)); result.AddCards(typeof(LightsOut)); return result; }
public void RPCSendDeckIds(int[] viewIds) { List<Page> deckList = new List<Page>(); foreach (int i in viewIds) { PhotonView pagePhotonView = PhotonView.Find(i); Page page = pagePhotonView.GetComponent<Page>(); deckList.Add(page); } m_playerDeck = new CombatDeck(deckList); StartCoroutine(_waitForPawnId()); }
public void CreateDeck(PlayerInventory playerInventory) { CombatDeck pawnDeck = _initializePlayerDeck(playerInventory); int[] pageViewIds = pawnDeck.GetPageViewIds(); m_playerDeck = pawnDeck; DrawStartingHand(); SendDeckPageViewIds(pageViewIds); }
static CombatDeck GenerateClassCombatDeck(MercClass mercClass) { CombatDeck result = new CombatDeck(); if (mercClass == MercClass.Soldier) result = SoldierCards.GetClassCards(); if (mercClass == MercClass.Bandit) result = BanditCards.GetClassCards(); if (mercClass == MercClass.Gunman) result = GunmanCards.GetClassCards(); if (mercClass==MercClass.Mercenary) result = MercenaryCards.GetClassCards(); //result = new CombatDeck(); //result.AddCards(typeof(Headshot),2); //result.AddCards(typeof(Hipfire), 2); return result; }
void GeneratePartyMember(string memberName) { MapRegion startingRegion = MapManager.main.GetTown(); var classtypes=System.Enum.GetValues(typeof(MercClass)); myClass = (MercClass)classtypes.GetValue(Random.Range(0,classtypes.Length)); combatDeck = GenerateClassCombatDeck(myClass); classPrepCards = GenerateClassPrepCards(myClass); weaponPrepCards = GenerateDefaultWeaponPrepCards(); SetClassStats(myClass); //Pick color out of ones left //worldCoords=startingCoords; currentRegion=startingRegion; startingRegion.localPartyMembers.Add(this); color = GetPortraitColor(); //Randomly pick out a specialty List<Trait> possibleSpecialtyPerks=Trait.GenerateRandomSkillTree(5); //Pick out a starting specialty perk Skill startingLearnedSkill=possibleSpecialtyPerks[Random.Range(0,possibleSpecialtyPerks.Count)] as Skill; startingLearnedSkill.learned=true; traits.Add(startingLearnedSkill); //Fill out trait list List<Trait> possibleGenericPerks=Trait.GetTraitList(); //Deactivate the opposite traits of the starting perk foreach(Trait genericPerk in possibleGenericPerks) { if (genericPerk.GetType()==startingLearnedSkill.oppositePerk) { if (possibleGenericPerks.Contains(genericPerk)) possibleGenericPerks.Remove(genericPerk); break; } } //Randomly pick out generic perks int necessaryPerkCount=2; int addedPerksCount=0; while (addedPerksCount<necessaryPerkCount && possibleGenericPerks.Count>0) { Trait newPerk=possibleGenericPerks[Random.Range(0,possibleGenericPerks.Count)]; traits.Add(newPerk); addedPerksCount++; possibleGenericPerks.Remove(newPerk); if (newPerk.oppositePerk!=null) { foreach (Trait possibleGenericPerk in possibleGenericPerks) { if (possibleGenericPerk.GetType()==newPerk.oppositePerk) { if (possibleGenericPerks.Contains(possibleGenericPerk)) possibleGenericPerks.Remove(possibleGenericPerk); break; } } foreach (Trait possibleSpecialtyPerk in possibleSpecialtyPerks) { if (possibleSpecialtyPerk.GetType()==newPerk.oppositePerk) { if (possibleSpecialtyPerks.Contains(possibleSpecialtyPerk)) possibleSpecialtyPerks.Remove(possibleSpecialtyPerk); break; } } } } name=memberName; baseMaxStamina=10; armorValue=0; maxCarryCapacity=4;// hasLight=false; isCook=false; isMedic=false; isLockExpert=false; isScout=false; foreach (Trait myPerk in traits) { if (myPerk.GetType().BaseType==typeof(Trait)) myPerk.ActivateEffect(this); else { Skill mySkill=myPerk as Skill; if (mySkill.learned) mySkill.ActivateEffect(this); } } //make sure perks trigger before these to properly use modified values of maxHealth and maxStamina health = healthMax; currentMaxStamina=baseMaxStamina; UpdateCurrentCarryCapacity(); equippedRangedWeapon=null; }
public static CombatDeck GetClassCards() { CombatDeck result = new CombatDeck(); /* result.AddCards(typeof(Grenade)); result.AddCards(typeof(Diversion)); result.AddCards(typeof(MarkTarget)); result.AddCards(typeof(Sacrifice)); result.AddCards(typeof(Defillade),2); result.AddCards(typeof(Smokescreen)); result.AddCards(typeof(PickOff)); result.AddCards(typeof(BurstFire)); result.AddCards(typeof(Camaraderie)); */ result.AddCards(typeof(TakeCover)); result.AddCards(typeof(Sacrifice)); result.AddCards(typeof(AllForOne)); result.AddCards(typeof(Smokescreen)); result.AddCards(typeof(Regroup)); return result; }
public override void GenerateCombatStartDeck() { currentCharacterDeck = new CombatDeck(); handManager.AssignDeck(currentCharacterDeck); ApplyVariationCardsToBasicDeck(1); }
void CreateCombatStartDeck() { List<CombatCard> allCombatCards = GenericCombatCards.GetDefaultCommonDeckCards();//new List<CombatCard>(); /* foreach (CharacterGraphic character in characterManager.GetMercGraphics()) { MercGraphic merc = character as MercGraphic; CombatDeck newDeck = merc.GetCharactersCombatDeck(); allCombatCards.AddRange(newDeck.GetDeckCards()); }*/ CombatDeck commonDeck = new CombatDeck(); commonDeck.AddCards(allCombatCards.ToArray()); AssignDeck(commonDeck); }
private CombatDeck _initializePlayerDeck(PlayerInventory playerInventory) { BaseStorybookGame game = GameManager.GetInstance<BaseStorybookGame>(); List<Page> deckPages = new List<Page>(); for (int i = 0; i < game.DeckSize; i++) { Page page = (Page)playerInventory[i].SlotItem; deckPages.Add(page); } CombatDeck playerDeck = new CombatDeck(deckPages); playerDeck.ShuffleDeck(); return playerDeck; }
public CombatDeck(CombatDeck deck) { randomShuffler = new Random(); cards = new List <Card>(); deck.cards.ForEach((x) => { cards.Add(x); }); }
//CharacterGraphic handOwner; public void AssignDeck(CombatDeck deck) { assignedDeck = deck; }
public static CombatDeck GetClassCards() { CombatDeck result = new CombatDeck(); /* result.AddCards(typeof(TakeCover),2); result.AddCards(typeof(Hipfire)); result.AddCards(typeof(BurstFire)); result.AddCards(typeof(Overconfidence),2); result.AddCards(typeof(RunAndGun),2); result.AddCards(typeof(LastStand)); result.AddCards(typeof(Gambit)); */ result.AddCards(typeof(SuicideCharge)); result.AddCards(typeof(Diversion)); result.AddCards(typeof(ToughAsNails)); result.AddCards(typeof(Gambit)); result.AddCards(typeof(CoveringFire)); return result; }