public List <BaseTechnologyData> InitializePlayerTech() { List <BaseTechnologyData> techData = new List <BaseTechnologyData>(); for (int i = 0; i < techStorage.technologies.Count; i++) { BaseTechnologyData tmp = new BaseTechnologyData().ConverToData(techStorage.technologies[i]); techData.Add(tmp); } return(techData); }
public int ObtainTechUpgradePrice(BaseTechnology thisTech) { int price = 100; // APPLY DISCOUNTS price = thisTech.goldLevelRequirements[thisTech.currentLevel]; BaseTechnologyData discountTech = PlayerGameManager.GetInstance.playerData.currentTechnologies.Find(x => x.improvedType == ResourceType.Coin && x.coinTechType == CoinTechType.IncreaseDiscount); int discountAmount = discountTech.bonusIncrement * discountTech.currentLevel; price -= discountAmount; return(price); }
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); } } }