private void RefreshLabels() { BuildingNameText.text = _building.ReadableName + " - " + System.String.Format(StringsTranslator.GetString("building_level_info"), _building.Level.ToString());; BuildingDescriptionText.text = _building.Description; BuildingCurrentProductionText.text = _building.ProductionInfo(); BuildingNextBigUpgradeText.text = string.Format(StringsTranslator.GetString("building_next_upgrade"), _building.BigUpgrade.ToString()); }
protected override void OnUpdate() { base.OnUpdate(); // TekstZlota.text = TlumaczCiagow.PodajCiag("Zloto") + ((int) MenedzerGry.InstancjaMenedzeraGry.ObiektGracza.PobierzAtrybut("Zloto")).ToString(); ReactInputRaw(); if (_licznikCzasuMalegoInfo >= 0) { _licznikCzasuMalegoInfo -= Time.deltaTime; if (_licznikCzasuMalegoInfo <= 0) { foreach (Text t in _tekstyMalegoInfo) { t.text = ""; } KanwaMalegoInfo.gameObject.SetActive(false); } } if (InventoryObject.ActiveSceneItem != HandsController.UsedItem) { HandsController.StartUsingItem(InventoryObject.ActiveSceneItem); } HealthText.text = StringsTranslator.GetString("res_Health") + ": " + CharactersModuleManager.Instance.ThePlayer.getSkillScreenValue("Health"); FoodText.text = StringsTranslator.GetString("res_Food") + ": " + CharactersModuleManager.Instance.ThePlayer.getSkillScreenValue("Food"); ThirstText.text = StringsTranslator.GetString("res_Thirst") + ": " + CharactersModuleManager.Instance.ThePlayer.getSkillScreenValue("Thirst"); DiseasesText.text = CharactersModuleManager.Instance.ThePlayer.InternalPatient.EventsDump(false); RefreshAccuracyIcons(); }
public string EventsDump(bool debug) { StringBuilder log = new StringBuilder(); log.Append(string.Format("{0}: {1} \n\r", StringsTranslator.GetString("res_Vitality"), FloatToStr(_character.getSkillValue("Vitality")))); foreach (MedicalItemDataAddon przedmiotL in _treatmentItems) { log.Append(string.Format(" % {0} {1} \n\r", StringsTranslator.GetString("PrzedmiotLeczacy"), StringsTranslator.GetString("ItemName" + przedmiotL.Type))); } foreach (BodyPart wykluczonaCzescCiala in _amputatedPlaces) { log.Append(string.Format(" # {0}: {1} \n\r", StringsTranslator.GetString("Amputowano"), wykluczonaCzescCiala)); } if (debug) { foreach (MedicalEvent zdarzenie in _currentEvents) { log.Append(" * " + zdarzenie.FriendlyName() + " " + FloatToStr(zdarzenie.Strength) + " (" + FloatToStr(zdarzenie.Intensity) + ")\n\r"); } } else { foreach (MedicalEvent zdarzenie in _currentEvents) { log.Append(" * " + zdarzenie.FriendlyName() + ", " + StringsTranslator.GetString("Zagrozenie") + zdarzenie.StrengthFriendly() + "\n\r"); } } return(log.ToString()); }
public void ButtonUpgradeClicked() { if (_selectedButton == ButtonP1) { _building.LevelUp(1); } else if (_selectedButton == ButtonP10) { _building.LevelUp(10); } else if (_selectedButton == ButtonP100) { _building.LevelUp(100); } else if (_selectedButton == ButtonPMax) { _building.LevelUp(_calulatedMaxLevels); } _calulatedMaxLevels = IdleGameModuleManager.Instance.LevelsForResources(_building); _building.TheLabel.RefreshLabelText(); ButtonPMax.GetComponentInChildren <Text>().text = StringsTranslator.GetString("button_max"); if (_selectedButton == ButtonPMax) { _selectedButton = ButtonP1; } RefreshLabels(); RefreshButtons(); }
public void OnDeath() { if (DeathSpeech != null && DeathSpeech != "") { FPPUIManager.Instance.PokazMaleInfo(StringsTranslator.GetString(DeathSpeech)); } DoEvents(true); }
public void HandleInteraction() { if (TouchSpeech != null && TouchSpeech != "") { FPPUIManager.Instance.PokazMaleInfo(StringsTranslator.GetString(TouchSpeech)); } DoEvents(true); }
private void RefreshLabels() { BuildingNameText.text = _buildingStub.ReadableName(); BuildingDescriptionText.text = _buildingStub.Description(); BuildingBuildInfoText.text = string.Format(StringsTranslator.GetString("building_build_cost"), _buildingStub.BuildCostsAsString()); if (!_buildingStub.RequiredBuildinsBuilt()) { BuildingBuildInfoText.text += string.Format(StringsTranslator.GetString("building_build_requires"), _buildingStub.BuildRequiresAsString()); } }
public void Show(SceneStub stub) { _buildingStub = stub; ButtonBuild.GetComponentInChildren <Text>().text = StringsTranslator.GetString("button_build"); ButtonClose.GetComponentInChildren <Text>().text = StringsTranslator.GetString("button_close"); gameObject.SetActive(true); RefreshLabels(); RefreshButtons(); }
public void Show(BaseSceneBuilding building) { _building = building; gameObject.SetActive(true); ButtonPMax.GetComponentInChildren <Text>().text = StringsTranslator.GetString("button_max"); ButtonUpgrade.GetComponentInChildren <Text>().text = StringsTranslator.GetString("button_upgrade"); ButtonClose.GetComponentInChildren <Text>().text = StringsTranslator.GetString("button_close"); RefreshLabels(); ButtonP1Clicked(); }
public string Description() { if (RequiredBuildinsBuilt()) { return(StringsTranslator.GetString("BuildingDesc" + TheTargetData.Type)); } else { return(StringsTranslator.GetString("building_unavailable")); } }
private void HourlyEventChanges(MedicalEvent anEvent) { foreach (Harm change in anEvent.GeneralHarm) { float wielkoscWplywu = change.Value * anEvent.Strength * BodyPartMechanics.BodyPartMultiplier(anEvent.Place); if (wielkoscWplywu <= -MINIMUM_WAZNEGO_ZDARZENIA && change.ResName == "Health") { ImportantEvents.Add(StringsTranslator.GetString("PowaznyWplyw") + anEvent.FriendlyName()); } _character.SetSkillValue(change.ResName, _character.getSkillValue(change.ResName) + wielkoscWplywu); } }
public string BuildRequiresAsString() { string retStr = ""; foreach (string requiredBuildingType in _requires) { if (!IdleGameModuleManager.Instance.IsBuiltBuildingType(requiredBuildingType)) { retStr += (retStr == "" ? "" : ", ") + StringsTranslator.GetString("BuildingName" + requiredBuildingType); } } return(retStr); }
public string ReadableName() { bool requiresMet = RequiredBuildinsBuilt(); TheLabel.TheLabelText.color = EnoughResources() ? Color.green : Color.red; if (requiresMet) { return(string.Format(StringsTranslator.GetString("build_now"), StringsTranslator.GetString("BuildingName" + TheTargetData.Type))); } else { return(StringsTranslator.GetString("building_unavailable")); } }
public string FriendlyName() { if (StringsTranslator.HasString(Type + Place)) { return(StringsTranslator.GetString(Type + Place)); } else if (StringsTranslator.HasString(Type) && StringsTranslator.HasString(Place + "dop")) { return(StringsTranslator.GetString(Type) + " " + StringsTranslator.GetString(Place + "dop")); } else { return("<" + Type + " " + Place + ">"); } }
private void RefreshButtons() { _calulatedMaxLevels = IdleGameModuleManager.Instance.LevelsForResources(_building); ButtonP1.image.color = _selectedButton == ButtonP1 ? Color.green : Color.red; ButtonP10.image.color = _selectedButton == ButtonP10 ? Color.green : Color.red; ButtonP100.image.color = _selectedButton == ButtonP100 ? Color.green : Color.red; ButtonPMax.image.color = _selectedButton == ButtonPMax ? Color.green : Color.red; bool upgradeEnabled = false; if (_selectedButton == ButtonP1 && _calulatedMaxLevels >= 1) { upgradeEnabled = true; } else if (_selectedButton == ButtonP10 && _calulatedMaxLevels >= 10) { upgradeEnabled = true; } else if (_selectedButton == ButtonP100 && _calulatedMaxLevels >= 100) { upgradeEnabled = true; } else if (_selectedButton == ButtonPMax && _calulatedMaxLevels >= 1) { upgradeEnabled = true; } if (_selectedButton == ButtonP1) { BuildingUpgradeInfoText.text = string.Format(StringsTranslator.GetString("building_cost1"), ResourceData.ListToString(_building.GetCostOfAllLevels(1))); } else if (_selectedButton == ButtonP10) { BuildingUpgradeInfoText.text = string.Format(StringsTranslator.GetString("building_cost"), 10, ResourceData.ListToString(_building.GetCostOfAllLevels(10))); } else if (_selectedButton == ButtonP100) { BuildingUpgradeInfoText.text = string.Format(StringsTranslator.GetString("building_cost"), 100, ResourceData.ListToString(_building.GetCostOfAllLevels(100))); } else if (_selectedButton == ButtonPMax) { BuildingUpgradeInfoText.text = string.Format(StringsTranslator.GetString("building_cost"), _calulatedMaxLevels > 0 ? _calulatedMaxLevels.ToString() : "1", ResourceData.ListToString(_building.GetCostOfAllLevels(_calulatedMaxLevels > 0 ? _calulatedMaxLevels : 1))); } else { BuildingUpgradeInfoText.text = ""; } ButtonUpgrade.image.color = upgradeEnabled ? Color.green : Color.red; ButtonUpgrade.enabled = upgradeEnabled; }
public string StrengthFriendly() { if (Strength < 0.25f) { return(StringsTranslator.GetString("ZdarzenieNiskie")); } if (Strength < 0.5f) { return(StringsTranslator.GetString("ZdarzenieSrednie")); } if (Strength < 0.75f) { return(StringsTranslator.GetString("ZdarzeniePowazne")); } return(StringsTranslator.GetString("ZdarzenieKrytyczne")); }
public override void DoEvents(bool doAnimEvents) { if (MultiUse || !_eventsAlreadyFired) { GameManager.Instance.TheGameState.SetKey(gameObject.name + "io", 1); if (ActivationSpeech != null && ActivationSpeech != "") { FPPUIManager.Instance.PokazMaleInfo(StringsTranslator.GetString(ActivationSpeech)); } BaseEvent[] events = GetComponents <BaseEvent>(); foreach (BaseEvent ev in events) { ev.FireEvent(this); } _eventsAlreadyFired = true; //Debug.Log("event hit: " + gameObject.name); } }
public string GetGamePhaseInfoText() { switch (CurrentGamePhase) { case GamePhase.INIT_STATE: return(StringsTranslator.GetString("game_init")); case GamePhase.AB_LOADING: return(StringsTranslator.GetString("game_loadingabs")); case GamePhase.SCENE_NOT_CONFIGURED: return(StringsTranslator.GetString("game_configure")); case GamePhase.SCENE_NOT_INITIALIZED: return(StringsTranslator.GetString("game_initializing")); case GamePhase.SCENE_INITIALIZED_NO_LOAD: return(StringsTranslator.GetString("game_loading") + " " + _mainSceneRoot.GetComponent <GameManager>().LoadingProgress + "%"); default: return(StringsTranslator.GetString("game_inprogress")); } }
//string with readable level information public virtual string LevelInfo() { return(String.Format(StringsTranslator.GetString("building_level_info"), Level.ToString())); }
public override string ProductionInfo() { return(String.Format(StringsTranslator.GetString("building_current_prod"), Level.ToString(), ProductionToString(Level), _outputInterval)); }