public void SetupHero(BaseHeroInformationData baseHeroInformationData) { heroName.text = baseHeroInformationData.unitInformation.attackType.ToString(); if (baseHeroInformationData.skillsList != null && baseHeroInformationData.skillsList.Count > 0) { SetupSkillSet(baseHeroInformationData.skillsList[0]); } else { SetupSkillSet(null); } List <float> tmpStats = new List <float>(); UnitInformationData tmp = baseHeroInformationData.unitInformation; tmpStats.Add(tmp.maxHealth); tmpStats.Add(tmp.maxDamage); float visualSpd = tmp.RealSpeed * 10; tmpStats.Add(visualSpd); tmpStats.Add(tmp.range); SetupFillIcons(tmpStats); }
public void SetupHeroSkillset(BaseHeroInformationData thisHero) { currentHero = new BaseHeroInformationData(); currentHero = thisHero; if (currentHero == null) { return; } if (currentHero.skillsList == null && currentHero.skillsList.Count <= 0) { return; } for (int i = 0; i < skillSlotList.Count; i++) { skillSlotList[i].myController = this; if (i <= currentHero.skillsList.Count - 1) { skillSlotList[i].skillIdx = i; skillSlotList[i].SetAsSkill(); } else { skillSlotList[i].skillIdx = i; skillSlotList[i].SetAsEmpty(); } } }
// BUTTON public void SendUnits() { for (int i = 0; i < subOptionsList.Count; i++) { unitsToSend[i] = subOptionsList[i].amountToSell; } if (leaderHandler.IsHeroChosen()) { Debug.Log("A Hero Is Chosen and is now Added!"); heroesSent = new List <BaseHeroInformationData>(); BaseHeroInformationData tmp = new BaseHeroInformationData(); tmp = leaderHandler.availableHeroes[leaderHandler.idx]; heroesSent.Add(tmp); } else { heroesSent.Clear(); } List <TroopsInformation> troopsToSend = new List <TroopsInformation>(); for (int i = 0; i < curPlayerUnits.Count; i++) { TroopsInformation tmp = new TroopsInformation(); tmp.unitInformation = new UnitInformationData(); tmp.unitInformation = curPlayerUnits[i].unitInformation; tmp.totalUnitCount = unitsToSend[i]; troopsToSend.Add(tmp); } Debug.Log("Clicekd Send Units"); if (myController.currentMapPoint.myPointInformation.ownedBy != TerritoryOwners.Player) { PlayerGameManager.GetInstance.SendThisUnits(troopsToSend, heroesSent, true); myController.SendTroopsToBattle(); } else { Debug.Log("Sending Units As Reinforcement!"); myController.currentMapPoint.myPointInformation.ReceiveReinforcementUnits(troopsToSend); for (int i = 0; i < troopsToSend.Count; i++) { PlayerGameManager.GetInstance.RemoveTroops(troopsToSend[i].totalUnitCount, troopsToSend[i].unitInformation.unitName); } ResourceInformationController.GetInstance.UpdateCurrentPanel(); myController.UpdateShownPointInformation(myController.currentMapPoint); StartCoroutine(myPanel.WaitAnimationForAction(myPanel.closeAnimationName, myWindow.CloseWindow)); if (SaveData.SaveLoadManager.GetInstance != null) { SaveData.SaveLoadManager.GetInstance.SaveCurrentCampaignData(); } } }
public void StartBattle() { gameConditionPanel.SetActive(false); BaseHeroInformationData thisHero = BattlefieldSpawnManager.GetInstance.unitStorage.heroStorage[curAtkIdx]; attackingCommander.heroesCarried.Add(thisHero); BattlefieldSpawnManager.GetInstance.SetupAttackingCommander(attackingCommander); BaseHeroInformationData newHero = BattlefieldSpawnManager.GetInstance.unitStorage.heroStorage[curDefIdx]; defendingCommander.heroesCarried.Add(newHero); BattlefieldSpawnManager.GetInstance.SetupDefendingCommander(defendingCommander); BattlefieldSceneManager.GetInstance.PreBattleStart(); }
public void Start() { if (PlayerGameManager.GetInstance.playerData.myHeroes == null || PlayerGameManager.GetInstance.playerData.myHeroes.Count <= 0) { return; } if (playerHeroList != null && playerHeroList.Count > 0) { playerHeroList.Clear(); } playerHeroList = new List <BaseHeroInformationData>(); playerHeroList.AddRange(PlayerGameManager.GetInstance.playerData.myHeroes); currentIdx = 0; currentHero = playerHeroList[currentIdx]; }
public void UpdatePlayerHero() { BaseHeroInformationData playerAsHero = new BaseHeroInformationData(); playerAsHero = TransitionManager.GetInstance.unitStorage.ObtainHeroBaseInformation(temporaryKingdom.wieldedWeapon); playerAsHero.unitInformation.unitName = "Player"; playerAsHero.unitInformation.prefabDataPath = "Assets/Resources/Prefabs/Unit and Items/Player.prefab"; temporaryKingdom.myHeroes = new List <BaseHeroInformationData>(); temporaryKingdom.tavernHeroes = new List <BaseHeroInformationData>(); BaseHeroInformationData tmp = new BaseHeroInformationData(); tmp.unitInformation = playerAsHero.unitInformation; tmp.heroLevel = playerAsHero.heroLevel; tmp.heroRarity = playerAsHero.heroRarity; tmp.healthGrowthRate = playerAsHero.healthGrowthRate; tmp.damageGrowthRate = playerAsHero.damageGrowthRate; tmp.speedGrowthRate = playerAsHero.speedGrowthRate; tmp.skillsList = new List <BaseSkillInformationData>(); for (int i = 0; i < playerAsHero.skillsList.Count; i++) { BaseSkillInformationData tmpSkill = new BaseSkillInformationData(); tmpSkill = playerAsHero.skillsList[i]; tmp.skillsList.Add(tmpSkill); } if (!TransitionManager.GetInstance.isNewGame) { temporaryKingdom.myHeroes.Add(tmp); } else { temporaryKingdom.myHeroes.Add(tmp); PlayerGameManager.GetInstance.playerData.myHeroes = new List <BaseHeroInformationData>(); PlayerGameManager.GetInstance.playerData.myHeroes.Add(tmp); } }
public BaseTravellerData GenerateRandomMerchantTraveller(int unitCount, float newRelationship) { BaseTravellerData tmp = new BaseTravellerData(); // INITIALIZATION OF DATA tmp.weekSpawned = ObtainPlayerWeeklyCount(); tmp.troopsCarried = new List <TroopsInformation>(); // LEADER INFORMATION int randLdrIdx = UnityEngine.Random.Range(0, unitStorage.merchantStorage.Count); tmp.leaderUnit = new List <BaseHeroInformationData>(); BaseHeroInformationData newLeader = new BaseHeroInformationData(); newLeader.unitInformation = new UnitInformationData(); newLeader = TransitionManager.GetInstance.unitStorage.ObtainHeroBaseInformation(WieldedWeapon.Bow); // TODO : CHANGE ON NEW HERO PREFABS newLeader.unitInformation.prefabDataPath = "Assets/Resources/Prefabs/Unit and Items/Player.prefab"; newLeader.unitInformation.wieldedWeapon = WieldedWeapon.Bow; tmp.leaderUnit.Add(newLeader); tmp.UpdateRelationship(newRelationship); // TRAVELLER SPEED tmp.travellerSpeed = 0.025f; // TROOPS CARRIED tmp.troopsCarried.AddRange(unitStorage.GenerateBasicWarband(unitCount)); TravellerFlavourPhrase flavourTmp = new TravellerFlavourPhrase(); flavourTmp.relationshipGauge = 0; flavourTmp.flavourText = "We're here to make some profits!"; tmp.flavourTexts = new List <TravellerFlavourPhrase>(); tmp.flavourTexts.Add(flavourTmp); return(tmp); }
public void SetupAvailableHeroes(List <BaseHeroInformationData> thisHeroes) { currentHeroSpriteList = new List <Sprite>(); idx = 0; currentHeroSpriteList.Add(noHeroIcon); BaseHeroInformationData temp = new BaseHeroInformationData(); availableHeroes = new List <BaseHeroInformationData>(); availableHeroes.Add(temp); availableHeroes.AddRange(thisHeroes); for (int i = 0; i < thisHeroes.Count; i++) { Sprite tmp = myController.myController.unitStorage.GetUnitIcon(thisHeroes[i].unitInformation.unitName); currentHeroSpriteList.Add(tmp); } UpdateHeroVisualChoice(); }
public void ShortcutTest() { PlayerGameManager.GetInstance.ReceiveTroops(25, "Recruit"); PlayerGameManager.GetInstance.ReceiveTroops(15, "Archer"); PlayerGameManager.GetInstance.ReceiveTroops(20, "Swordsman"); PlayerGameManager.GetInstance.ReceiveTroops(20, "Spearman"); ResourceInformationController.GetInstance.UpdateCurrentPanel(); BaseHeroInformationData playerAsHero = new BaseHeroInformationData(); playerAsHero = TransitionManager.GetInstance.unitStorage.ObtainHeroBaseInformation(WieldedWeapon.Spear); playerAsHero.unitInformation.unitName = "Player"; playerAsHero.unitInformation.prefabDataPath = "Assets/Resources/Prefabs/Unit and Items/Player.prefab"; PlayerGameManager.GetInstance.playerData.myHeroes = new List <BaseHeroInformationData>(); PlayerGameManager.GetInstance.playerData.tavernHeroes = new List <BaseHeroInformationData>(); BaseHeroInformationData tmp = new BaseHeroInformationData(); tmp.unitInformation = playerAsHero.unitInformation; tmp.heroLevel = playerAsHero.heroLevel; tmp.heroRarity = playerAsHero.heroRarity; tmp.healthGrowthRate = playerAsHero.healthGrowthRate; tmp.damageGrowthRate = playerAsHero.damageGrowthRate; tmp.speedGrowthRate = playerAsHero.speedGrowthRate; tmp.skillsList = new List <BaseSkillInformationData>(); for (int i = 0; i < playerAsHero.skillsList.Count; i++) { BaseSkillInformationData tmpSkill = new BaseSkillInformationData(); tmpSkill = playerAsHero.skillsList[i]; tmp.skillsList.Add(tmpSkill); } PlayerGameManager.GetInstance.playerData.myHeroes.Add(tmp); }
public void NextHeroInformation(bool isAttacker) { if (isAttacker) { if (curAtkIdx >= TransitionManager.GetInstance.unitStorage.heroStorage.Count - 1) { curAtkIdx = 0; } else { curAtkIdx += 1; } BaseHeroInformationData newHero = BattlefieldSpawnManager.GetInstance.unitStorage.heroStorage[curAtkIdx]; // TEMPORARY UNTIL PREFABS FOR UNIQUE HEROES ARE CREATED newHero.unitInformation.unitName = "Player"; newHero.unitInformation.prefabDataPath = "Assets/Resources/Prefabs/Unit and Items/Player.prefab"; attackingLeader.SetupHero(newHero); } else { if (curDefIdx >= TransitionManager.GetInstance.unitStorage.heroStorage.Count - 1) { curDefIdx = 0; } else { curDefIdx += 1; } BaseHeroInformationData newHero = BattlefieldSpawnManager.GetInstance.unitStorage.heroStorage[curDefIdx]; // TEMPORARY UNTIL PREFABS FOR UNIQUE HEROES ARE CREATED newHero.unitInformation.unitName = "Player"; newHero.unitInformation.prefabDataPath = "Assets/Resources/Prefabs/Unit and Items/Player.prefab"; defendingLeader.SetupHero(newHero); } }
public void ResetCustomBattlePanel() { attackingCommander = new BattlefieldCommander(); curAtkIdx = 0; attackerControlIdx = 2; attackerControl.SwitchToThisControl((PlayerControlType)attackerControlIdx); BaseHeroInformationData newHero = BattlefieldSpawnManager.GetInstance.unitStorage.heroStorage[curAtkIdx]; // TEMPORARY UNTIL PREFABS FOR UNIQUE HEROES ARE CREATED newHero.unitInformation.unitName = "Player"; newHero.unitInformation.prefabDataPath = "Assets/Resources/Prefabs/Unit and Items/Player.prefab"; attackingLeader.SetupHero(newHero); attackingCommander.SetupBasicCommander(); defendingCommander = new BattlefieldCommander(); curAtkIdx = 0; defenderControlIdx = 0; defenderControl.SwitchToThisControl((PlayerControlType)defenderControlIdx); BaseHeroInformationData startHero = BattlefieldSpawnManager.GetInstance.unitStorage.heroStorage[curDefIdx]; // TEMPORARY UNTIL PREFABS FOR UNIQUE HEROES ARE CREATED startHero.unitInformation.unitName = "Player"; startHero.unitInformation.prefabDataPath = "Assets/Resources/Prefabs/Unit and Items/Player.prefab"; defendingLeader.SetupHero(startHero); defendingCommander.SetupBasicCommander(); gameConditionPanel.SetActive(false); SetupCustomBattlePanel(); }
// UPDATE BARRACKS NEEDS MORE DATA (HERO AND UNIT INFORMATION DATA) public void UpdateBarracks() { TroopResourceBehavior troopsBehavior = PlayerGameManager.GetInstance.troopBehavior; KingdomUnitStorage unitStorage = myController.unitStorage; if (cardIdx == 0) // TRAIN NEW SOLDIER { // Placeholders, need proper Unit Storage later on float hp = unitStorage.GetUnitInformation("Recruit").maxHealth; float dmg = unitStorage.GetUnitInformation("Recruit").maxDamage; float spd = unitStorage.GetUnitInformation("Recruit").origSpeed; spd *= 10; if (PlayerGameManager.GetInstance != null) { hp += PlayerGameManager.GetInstance.troopBehavior.techHealth; dmg += PlayerGameManager.GetInstance.troopBehavior.techDmg; } int recruitCount = 0; if (playerData.troopsList == null) { playerData.troopsList = new List <TroopsInformation>(); } if (playerData.troopsList.Find(x => x.unitInformation.unitName == "Recruit") != null) { recruitCount = playerData.troopsList.Find(x => x.unitInformation.unitName == "Recruit").totalUnitCount; } List <float> tmp = new List <float>(); tmp.Add(recruitCount);; tmp.Add(hp); tmp.Add(spd); tmp.Add(dmg); currentPage.informationPanelList[0].SetMultiCounter(tmp, "Recruits"); // HP DAMAGE SPEED string secondDescription = "Max trained units the barracks can support [" + playerData.barracksCapacity + "]"; currentPage.informationPanelList[1].SetSingleCounter(playerData.barracksCapacity, secondDescription, "Barracks Capacity"); // BARRACKS CAPACITY string thirdDescription = "Training cost to arm a person."; currentPage.informationPanelList[2].SetSingleCounter(troopsBehavior.GetRecruitCoins, thirdDescription, "Training Cost"); // TRAINING COST } else if (cardIdx == 2) // HEROES { if (PlayerGameManager.GetInstance != null) { if (PlayerGameManager.GetInstance.playerData.myHeroes != null && PlayerGameManager.GetInstance.playerData.myHeroes.Count > 0) { BaseHeroInformationData curHero = PlayerGameManager.GetInstance.playerData.myHeroes[selectedHeroIdx]; currentPage.informationPanelList[0].SetGrowthCounter((int)curHero.unitInformation.maxHealth, curHero.healthGrowthRate, "HEALTH", curHero.unitInformation.unitName); currentPage.informationPanelList[1].SetGrowthCounter((int)curHero.unitInformation.maxDamage, curHero.damageGrowthRate, "DAMAGE"); currentPage.informationPanelList[2].SetGrowthCounter((int)curHero.unitInformation.origSpeed, curHero.speedGrowthRate, "SPEED"); } else { myController.ShowInfoBlocker("Recruit Hero in Tavern"); } } } else if (cardIdx == 1) // TRAIN SOLDIERS { // Placeholders, need proper Unit Storage later on float Sprhp = unitStorage.GetUnitInformation("Spearman").maxHealth, Sprdmg = unitStorage.GetUnitInformation("Spearman").maxDamage, Sprspd = unitStorage.GetUnitInformation("Spearman").origSpeed; float Swdhp = unitStorage.GetUnitInformation("Swordsman").maxHealth, Swddmg = unitStorage.GetUnitInformation("Swordsman").maxDamage, Swdspd = unitStorage.GetUnitInformation("Swordsman").origSpeed; float Archp = unitStorage.GetUnitInformation("Archer").maxHealth, Arcdmg = unitStorage.GetUnitInformation("Archer").maxDamage, Arcspd = unitStorage.GetUnitInformation("Archer").origSpeed; Sprspd *= 10; Arcspd *= 10; Swdspd *= 10; if (PlayerGameManager.GetInstance != null) { Sprhp += PlayerGameManager.GetInstance.troopBehavior.techHealth; Swdhp += PlayerGameManager.GetInstance.troopBehavior.techHealth; Archp += PlayerGameManager.GetInstance.troopBehavior.techHealth; Sprdmg += PlayerGameManager.GetInstance.troopBehavior.techDmg; Swddmg += PlayerGameManager.GetInstance.troopBehavior.techDmg; Arcdmg += PlayerGameManager.GetInstance.troopBehavior.techDmg; } List <float> tmp = new List <float>(); for (int i = 0; i < currentPage.informationPanelList.Count; i++) { if (i == 0) { int count = 0; if (playerData.troopsList == null) { playerData.troopsList = new List <TroopsInformation>(); } if (playerData.troopsList.Find(x => x.unitInformation.unitName == "Swordsman") != null) { count = playerData.troopsList.Find(x => x.unitInformation.unitName == "Swordsman").totalUnitCount; } tmp.Add(count); tmp.Add(Swdhp); tmp.Add(Swdspd); tmp.Add(Swddmg); currentPage.informationPanelList[i].SetMultiCounter(tmp, "Swordsman"); currentPage.informationPanelList[i].panelIcon.sprite = TransitionManager.GetInstance.unitStorage.GetUnitIcon("Swordsman"); } else if (i == 1) { int count = 0; if (playerData.troopsList == null) { playerData.troopsList = new List <TroopsInformation>(); } if (playerData.troopsList.Find(x => x.unitInformation.unitName == "Spearman") != null) { count = playerData.troopsList.Find(x => x.unitInformation.unitName == "Spearman").totalUnitCount; } tmp.Add(count); tmp.Add(Sprhp); tmp.Add(Sprspd); tmp.Add(Sprdmg); currentPage.informationPanelList[i].SetMultiCounter(tmp, "Spearman"); currentPage.informationPanelList[i].panelIcon.sprite = TransitionManager.GetInstance.unitStorage.GetUnitIcon("Spearman"); } else if (i == 2) { int count = 0; if (playerData.troopsList == null) { playerData.troopsList = new List <TroopsInformation>(); } if (playerData.troopsList.Find(x => x.unitInformation.unitName == "Archer") != null) { count = playerData.troopsList.Find(x => x.unitInformation.unitName == "Archer").totalUnitCount; } tmp.Add(count); tmp.Add(Archp); tmp.Add(Arcspd); tmp.Add(Arcdmg); currentPage.informationPanelList[i].SetMultiCounter(tmp, "Archer"); currentPage.informationPanelList[i].panelIcon.sprite = TransitionManager.GetInstance.unitStorage.GetUnitIcon("Archer"); } tmp.Clear(); } } }
public BaseTravellerData GenerateRandomWarbandTraveller(int unitCount, float newRelationship) { BaseTravellerData tmp = new BaseTravellerData(); tmp.weekSpawned = ObtainPlayerWeeklyCount(); tmp.troopsCarried = new List <TroopsInformation>(); if (newRelationship < 0) { tmp.affiliatedTeam = Maps.TerritoryOwners.FurKhan; } else { tmp.affiliatedTeam = Maps.TerritoryOwners.Neutral; } int randLdrIdx = UnityEngine.Random.Range(0, unitStorage.heroStorage.Count); tmp.leaderUnit = new List <BaseHeroInformationData>(); BaseHeroInformationData newLeader = new BaseHeroInformationData(); newLeader = TransitionManager.GetInstance.unitStorage.ObtainHeroBaseInformation(WieldedWeapon.Bow); // TODO : CHANGE ON NEW HERO PREFABS newLeader.unitInformation.prefabDataPath = "Assets/Resources/Prefabs/Unit and Items/Player.prefab"; tmp.leaderUnit.Add(newLeader); tmp.UpdateRelationship(newRelationship); // TroopTypes List <int> troopTypes = new List <int>(); troopTypes.Add(0); troopTypes.Add(0); troopTypes.Add(0); troopTypes.Add(0); for (int i = 0; i < unitCount; i++) { int rand = UnityEngine.Random.Range(0, troopTypes.Count); troopTypes[rand] += 1; } TroopsInformation recruit = TroopsInformation.ConvertToTroopsInformation(unitStorage.GetUnitInformation("Recruit"), troopTypes[0]); TroopsInformation swordsman = TroopsInformation.ConvertToTroopsInformation(unitStorage.GetUnitInformation("Swordsman"), troopTypes[1]); TroopsInformation spearman = TroopsInformation.ConvertToTroopsInformation(unitStorage.GetUnitInformation("Spearman"), troopTypes[2]); TroopsInformation archer = TroopsInformation.ConvertToTroopsInformation(unitStorage.GetUnitInformation("Archer"), troopTypes[3]); tmp.troopsCarried.Add(recruit); tmp.troopsCarried.Add(swordsman); tmp.troopsCarried.Add(spearman); tmp.troopsCarried.Add(archer); TravellerFlavourPhrase flavourTmp = new TravellerFlavourPhrase(); flavourTmp.relationshipGauge = -50; flavourTmp.flavourText = "100 coins is not enough, we know you're hiding more there!"; TravellerFlavourPhrase flavourTmp1 = new TravellerFlavourPhrase(); flavourTmp1.relationshipGauge = -30; flavourTmp1.flavourText = "100 coins, you should give more!"; TravellerFlavourPhrase flavourTmp2 = new TravellerFlavourPhrase(); flavourTmp2.relationshipGauge = 0; flavourTmp2.flavourText = "100 coins might make us stay a week or two.."; tmp.flavourTexts = new List <TravellerFlavourPhrase>(); tmp.flavourTexts.Add(flavourTmp); tmp.flavourTexts.Add(flavourTmp1); tmp.flavourTexts.Add(flavourTmp2); return(tmp); }
public void SpawnHero(BaseHeroInformationData heroInformation, ScenePointBehavior spawnPoint) { }
public void UpdateCurrentHero() { currentHero = playerHeroList[currentIdx]; }
public void ReceiveData(PlayerKingdomData newData) { playerData._fileName = newData._fileName; playerData.fileData = newData.fileData; playerData.kingdomsName = newData.kingdomsName; playerData.dynastyName = newData.dynastyName; playerData.level = newData.level; playerData.weekCount = newData.weekCount; playerData.finishedStories = newData.finishedStories; if (newData.queuedDataEventsList != null && newData.queuedDataEventsList.Count > 0) { if (playerData.queuedDataEventsList == null) { playerData.queuedDataEventsList = new List <EventDecisionData>(); } playerData.queuedDataEventsList.AddRange(newData.queuedDataEventsList); } playerData.curDataEvent = newData.curDataEvent; playerData.curDataStory = newData.curDataStory; playerData.eventFinished = newData.eventFinished; Debug.Log("-------[Events Finished: " + playerData.eventFinished + " NewData Finish : " + newData.eventFinished + "]-------"); playerData.barracksCapacity = newData.barracksCapacity; playerData.troopsLoyalty = newData.troopsLoyalty; playerData.troopsList = new List <TroopsInformation>(); if (newData.troopsList != null && newData.troopsList.Count > 0) { for (int i = 0; i < newData.troopsList.Count; i++) { playerData.troopsList.Add(newData.troopsList[i]); } } playerData.troopsMercList = new List <TroopsInformation>(); if (newData.troopsMercList != null && newData.troopsMercList.Count > 0) { for (int i = 0; i < newData.troopsMercList.Count; i++) { playerData.troopsMercList.Add(newData.troopsMercList[i]); } } playerData.population = newData.population; playerData.safePopulation = newData.safePopulation; playerData.pouplationLoyalty = newData.pouplationLoyalty; playerData.curTaxWeeksCounter = newData.curTaxWeeksCounter; playerData.canReceiveTax = newData.canReceiveTax; playerData.farmerCount = newData.farmerCount; playerData.herdsmanCount = newData.herdsmanCount; playerData.storageKeeperCount = newData.storageKeeperCount; playerData.populationBurst = newData.populationBurst; playerData.potentialRefugee = newData.potentialRefugee; playerData.potentialMerchantArrival = newData.potentialMerchantArrival; playerData.balconyBuildingsAdded = newData.balconyBuildingsAdded; playerData.buildingInformationData = newData.buildingInformationData; playerData.potentialGoodsMerchant = newData.potentialGoodsMerchant; playerData.potentialExoticMerchant = newData.potentialExoticMerchant; playerData.potentialEquipsMerchant = newData.potentialEquipsMerchant; playerData.potentialCommonHero = newData.potentialCommonHero; playerData.potentialRareHero = newData.potentialRareHero; playerData.potentialLegHero = newData.potentialLegHero; playerData.potentialMercenary = newData.potentialMercenary; playerData.myHeroes = new List <BaseHeroInformationData>(); if (newData.myHeroes != null && newData.myHeroes.Count > 0) { Debug.Log("Temporary Kingdom Heroes Count: " + newData.myHeroes.Count + " And Skill Count: " + newData.myHeroes[0].skillsList.Count); for (int i = 0; i < newData.myHeroes.Count; i++) { BaseHeroInformationData tmp = new BaseHeroInformationData(); tmp.damageGrowthRate = newData.myHeroes[i].damageGrowthRate; tmp.healthGrowthRate = newData.myHeroes[i].healthGrowthRate; tmp.speedGrowthRate = newData.myHeroes[i].speedGrowthRate; tmp.unitInformation = newData.myHeroes[i].unitInformation; tmp.equipments = newData.myHeroes[i].equipments; tmp.skillsList = new List <BaseSkillInformationData>(); tmp.skillsList.AddRange(newData.myHeroes[i].skillsList); playerData.myHeroes.Add(tmp); } } playerData.tavernHeroes = new List <BaseHeroInformationData>(); if (newData.tavernHeroes != null && newData.tavernHeroes.Count > 0) { for (int i = 0; i < newData.tavernHeroes.Count; i++) { BaseHeroInformationData tmp = new BaseHeroInformationData(); tmp.damageGrowthRate = newData.tavernHeroes[i].damageGrowthRate; tmp.healthGrowthRate = newData.tavernHeroes[i].healthGrowthRate; tmp.speedGrowthRate = newData.tavernHeroes[i].speedGrowthRate; tmp.unitInformation = newData.tavernHeroes[i].unitInformation; tmp.equipments = newData.tavernHeroes[i].equipments; playerData.tavernHeroes.Add(tmp); } } playerData.myItems = new List <ItemInformationData>(); if (newData.myItems != null && newData.myItems.Count > 0) { for (int i = 0; i < newData.myItems.Count; i++) { GameItems.ItemInformationData tmp = newData.myItems[i]; playerData.myItems.Add(tmp); } } playerData.currentShopMerchants = new List <BaseMerchantInformationData>(); if (newData.currentShopMerchants != null) { for (int i = 0; i < newData.currentShopMerchants.Count; i++) { BaseMerchantInformationData tmp = new BaseMerchantInformationData(); tmp.merchantName = newData.currentShopMerchants[i].merchantName; tmp.itemsSold = newData.currentShopMerchants[i].itemsSold; playerData.currentShopMerchants.Add(tmp); } } Debug.Log("Food Count Before: " + newData.foods); playerData.foods = newData.foods; Debug.Log("Food Count After: " + newData.foods); playerData.safeFood = newData.safeFood; playerData.cows = newData.cows; playerData.safeCows = newData.safeCows; playerData.barnExpansion = newData.barnExpansion; playerData.curGrainWeeksCounter = newData.curGrainWeeksCounter; playerData.canReceiveGrainProduce = newData.canReceiveGrainProduce; playerData.curCowBirthCounter = newData.curCowBirthCounter; playerData.canReceiveNewCows = newData.canReceiveNewCows; playerData.coins = newData.coins; playerData.coinsCapacity = newData.coinsCapacity; playerData.curMonthTaxCounter = newData.curMonthTaxCounter; playerData.canReceiveMonthlyTax = newData.canReceiveMonthlyTax; playerData.currentTechnologies = new List <BaseTechnologyData>(); if (newData.currentTechnologies != null && newData.currentTechnologies.Count > 0) { for (int i = 0; i < newData.currentTechnologies.Count; i++) { BaseTechnologyData tmp = new BaseTechnologyData(); tmp.technologyName = newData.currentTechnologies[i].technologyName; tmp.improvedType = newData.currentTechnologies[i].improvedType; tmp.goldLevelRequirements = newData.currentTechnologies[i].goldLevelRequirements; tmp.currentLevel = newData.currentTechnologies[i].currentLevel; tmp.goldRequirement = newData.currentTechnologies[i].goldRequirement; tmp.curGold = newData.currentTechnologies[i].curGold; tmp.bonusIncrement = newData.currentTechnologies[i].bonusIncrement; tmp.troopTechType = newData.currentTechnologies[i].troopTechType; tmp.popTechType = newData.currentTechnologies[i].popTechType; tmp.foodTechType = newData.currentTechnologies[i].foodTechType; tmp.coinTechType = newData.currentTechnologies[i].coinTechType; tmp.effectMesg = newData.currentTechnologies[i].effectMesg; tmp.wittyMesg = newData.currentTechnologies[i].wittyMesg; playerData.currentTechnologies.Add(tmp); } } }
public void SetAttackerLeaderSkills(BaseHeroInformationData attackerHero) { Debug.Log("Setting up Hero Skills for Attacker!"); attackerPanel.skillSlotHandler.SetupHeroSkillset(attackerHero); }
public void SetDefenderLeaderSkill(BaseHeroInformationData defenderHero) { defenderPanel.skillSlotHandler.SetupHeroSkillset(defenderHero); }
public BaseTravellerData ObtainTraveller(BaseHeroInformationData thisTraveller) { BaseTravellerData tmp = campaignData.travellerList.Find(x => x.leaderUnit.Contains(thisTraveller)); return(tmp); }