private void _in_UpdateProcessing_Forge_UpdateMats(SovereignWpn w) { if (!materialsNeededSection.activeInHierarchy) { materialsNeededSection.SetActive(true); } if (w.wpnLevel > 1) { materialsNeededBrick.SetActive(false); materialsNeededMetal.SetActive(false); materialsNeededPlanks.SetActive(false); materialsNeededMana.SetActive(true); manaResCounter.text = ForgePopup.lv2cost.ToString(); } else { materialsNeededBrick.SetActive(true); materialsNeededMetal.SetActive(true); materialsNeededPlanks.SetActive(true); materialsNeededMana.SetActive(false); string s; if (w.wpnLevel > 0) { s = ForgePopup.lv1cost.ToString(); } else { s = ForgePopup.lv0cost.ToString(); } bricksResCounter.text = metalResCounter.text = planksResCounter.text = s; } }
public static void UpdateTextFieldWithWpnInfo(SovereignWpn o, ref SovereignWpn cachedSovereignWpn, ref string[] strings, ref Text sovereignWpnArea) { if (o != null) { cachedSovereignWpn = o; string l0 = cachedSovereignWpn.wpnName + System.Environment.NewLine; string l1 = strings[2] + cachedSovereignWpn.HP + dividerString + strings[3] + cachedSovereignWpn.Martial + dividerString + strings[4] + cachedSovereignWpn.Magic + dividerString + strings[5] + cachedSovereignWpn.Speed + System.Environment.NewLine; string l2 = string.Empty; for (int i = 0; i < cachedSovereignWpn.attacks.Length; i++) { if (cachedSovereignWpn.attacks[i] != BattlerAction.UninitializedVal && cachedSovereignWpn.attacks[i] != BattlerAction.None) { l2 = l2 + BattlerActionData.get(cachedSovereignWpn.attacks[i]).name + System.Environment.NewLine; } } string l3 = string.Empty; switch (cachedSovereignWpn.wpnType) { case WpnType.Knives: l3 = strings[31]; break; case WpnType.Mace: l3 = strings[32]; break; case WpnType.Staff: l3 = strings[33]; break; } sovereignWpnArea.text = l0 + l1 + l2 + l3; } }
public GameDataManager_DataStore() { lastScene = SceneIDType.OverworldScene; yourTownName = "Citysburg"; fakeTownNames = new string[] { "Town A", "Town No. 2", "Tertiary Town" }; pendingUpgrade_Docks = false; pendingUpgrade_Mason = false; pendingUpgrade_Sawmill = false; pendingUpgrade_Smith = false; unlock_sovSpe_CalledShots = false; unlock_sovSpe_HammerSmash = false; unlock_sovSpe_Protect = false; adventureLevel = 0; buildingLv_Docks = 0; buildingLv_Mason = 0; buildingLv_Sawmill = 0; buildingLv_Smith = 0; buildingLv_WizardsTower = 1; nextRandomAdventureAnte = 2; resBricks = 0; resBricks_max = 999; // we actually recalc these immediately, lol resBricks_maxUpgrades = 0; resMetal = 0; resMetal_max = 999; resMetal_maxUpgrades = 0; resPlanks = 0; resPlanks_max = 999; resPlanks_maxUpgrades = 0; resMana = 0; resMana_max = manaCap; pendingUpgradeTimer_Docks = 0; pendingUpgradeTimer_Mason = 0; pendingUpgradeTimer_Sawmill = 0; pendingUpgradeTimer_Smith = 0; lastInspectedAdventurerIndex = 0; partyAdventurer0Index = 0; partyAdventurer1Index = 1; partyAdventurer2Index = 2; sovereignFirstName = "Dude"; sovereignLastName = "Huge"; housingLevel = 0; housingUnitUpgrades = new bool[housingLevelCap]; houseAdventurers = new Adventurer[housingLevelCap]; for (int i = 0; i < houseAdventurers.Length; i++) { houseAdventurers[i] = new Adventurer(); } sovereignAdventurer = new Adventurer(); sovereignTactic = BattlerAction.GetBehindMe; sovereignSkill = AdventurerSpecial.None; sovereignMugshot = AdventurerMugshot.Sovereign0; progressionFlags = 0; buyable0 = null; buyable1 = null; unlockedMysticPromotes = MysticPromotes.None; unlockedWarriorPromotes = WarriorPromotes.None; peddlerIsPresent = false; peddlerPrice = 25; }
public void PushWpnToSovereign() { if (GameDataManager.Instance.dataStore.sovereignAdventurer != this) { throw new System.Exception("Tried to update an adventurer that's not the Sovereign with weapon data!"); } SovereignWpn w = GameDataManager.Instance.dataStore.sovWpn_Set; attacks = new BattlerAction[w.attacks.Length + 1]; w.attacks.CopyTo(attacks, 0); attacks[attacks.Length - 1] = GameDataManager.Instance.dataStore.sovereignTactic; HP = w.HP; Martial = w.Martial; Magic = w.Magic; Speed = w.Speed; }
static void _HandleWpnButton(ref SovereignWpn buyable, ref SovereignWpn cWpn, ref Button wpnBtn, ref Text wpnBtnText, ref Text typeLabel, ref Text wpnBtnManaReq, ref Text[] wpnBtnStdMatsReqs, ref string[] wpnsStrings, ref string[] strings) { if (buyable == null || buyable.wpnType == WpnType.None) { wpnBtn.interactable = false; cWpn = null; wpnBtnText.text = strings[0]; typeLabel.text = ""; } else if (buyable != cWpn) { wpnBtn.interactable = true; SovereignInfoPanel.UpdateTextFieldWithWpnInfo(buyable, ref cWpn, ref wpnsStrings, ref wpnBtnText); typeLabel.text = SovereignWpn.GetWpnTypeString(cWpn.wpnType); if (cWpn.wpnLevel > 1) { wpnBtnManaReq.text = lv2cost.ToString(); wpnBtnManaReq.transform.parent.gameObject.SetActive(true); for (int i = 0; i < wpnBtnStdMatsReqs.Length; i++) { wpnBtnStdMatsReqs[i].transform.parent.gameObject.SetActive(false); } } else { wpnBtnManaReq.transform.parent.gameObject.SetActive(false); for (int i = 0; i < wpnBtnStdMatsReqs.Length; i++) { if (cWpn.wpnLevel == 0) { wpnBtnStdMatsReqs[i].text = lv0cost.ToString(); } else { wpnBtnStdMatsReqs[i].text = lv1cost.ToString(); } wpnBtnStdMatsReqs[i].transform.parent.gameObject.SetActive(true); } } } }