public void showLocationInfo() { if (GraphicalMap.selectedHex == null || GraphicalMap.selectedHex.location == null) { locInfoTitle.text = "No location selected"; locInfoBody.text = "No location selected"; locNumsBody.text = ""; locNumsNumbers.text = ""; locFlavour.text = ""; infiltrationText.text = "No Infiltration Possible"; infiltrationVals.text = ""; securityDescText.text = ""; personShadowAndEvidenceVals.text = ""; } else { Map map = World.staticMap; Location loc = GraphicalMap.selectedHex.location; locInfoTitle.text = loc.getName(); string bodyText = ""; double hab = loc.hex.getHabilitability() - map.param.mapGen_minHabitabilityForHumans; hab *= 1d / (1 - map.param.mapGen_minHabitabilityForHumans); string valuesBody = ""; string valuesNumbers = ""; infiltrationText.text = "No Infiltration Possible"; securityDescText.text = ""; Hex hex = loc.hex; bodyText += "\nProvince: " + hex.province.name; foreach (EconTrait t in hex.province.econTraits) { bodyText += "\nIndustry: " + t.name; } if (hex.location != null) { if (hex.location.settlement != null) { if (hex.location.settlement.title != null) { if (hex.location.settlement.title.heldBy != null) { bodyText += "\nTitle held by: " + hex.location.settlement.title.heldBy.getFullName(); } else { bodyText += "\nTitle currently unheld"; } } valuesBody += "\nPrestige:"; valuesNumbers += "\n" + Eleven.toMaxLen(hex.location.settlement.getPrestige(), 4); valuesBody += "\nBase Prestige:"; valuesNumbers += "\n" + Eleven.toMaxLen(hex.location.settlement.basePrestige, 4); valuesBody += "\nMilitary Cap Add:"; valuesNumbers += "\n" + hex.location.settlement.getMilitaryCap(); valuesBody += "\nMilitary Regen"; valuesNumbers += "\n" + hex.location.settlement.militaryRegenAdd; } } if (loc.settlement != null) { if (loc.soc != null && loc.soc is Society) { List <ReasonMsg> reasons = new List <ReasonMsg>(); int sec = loc.settlement.getSecurity(reasons); infiltrationText.text = "Infiltration:\nSecurity Level:"; infiltrationVals.text = "" + (int)(100 * loc.settlement.infiltration) + "%\n" + (int)(sec); securityDescText.text = "Security Level: " + sec; foreach (ReasonMsg msg in reasons) { string sign = "+"; if (msg.value < 0) { sign = ""; } securityDescText.text += "\n" + sign + (int)(msg.value) + " from " + msg.msg; } } locFlavour.text = loc.settlement.getFlavour(); if (loc.settlement is SettlementHuman) { valuesBody += "\n" + ((SettlementHuman)loc.settlement).getStatsDesc(); valuesNumbers += "\n" + ((SettlementHuman)loc.settlement).getStatsValues(); } if (hex.location.settlement.embeddedUnit != null) { bodyText += "\nARMY IN GARRISON (Strength " + hex.location.settlement.embeddedUnit.hp + ")"; } } valuesBody += "\nTemperature "; valuesNumbers += "\n" + (int)(loc.hex.getTemperature() * 100) + "%"; valuesBody += "\nHabilitability "; valuesNumbers += "\n" + (int)(hab * 100) + "%"; locNumsBody.text = valuesBody; locNumsNumbers.text = valuesNumbers; locInfoBody.text = bodyText; } }
public void showLocationInfo() { if (GraphicalMap.selectedHex == null || GraphicalMap.selectedHex.location == null) { locInfoTitle.text = "No location selected"; locInfoBody.text = "No location selected"; locNumsBody.text = ""; locNumsNumbers.text = ""; locFlavour.text = ""; } else { Map map = World.staticMap; Location loc = GraphicalMap.selectedHex.location; locInfoTitle.text = loc.getName(); string bodyText = ""; double hab = loc.hex.getHabilitability() - map.param.mapGen_minHabitabilityForHumans; hab *= 1d / (1 - map.param.mapGen_minHabitabilityForHumans); string valuesBody = ""; string valuesNumbers = ""; Hex hex = loc.hex; bodyText += "\nProvince: " + hex.province.name; foreach (EconTrait t in hex.province.econTraits) { bodyText += "\nIndustry: " + t.name; } if (hex.location != null) { if (hex.location.settlement != null) { if (hex.location.settlement.title != null) { if (hex.location.settlement.title.heldBy != null) { bodyText += "\nTitle held by: " + hex.location.settlement.title.heldBy.getFullName(); } else { bodyText += "\nTitle currently unheld"; } } valuesBody += "\nPrestige:"; valuesNumbers += "\n" + Eleven.toMaxLen(hex.location.settlement.getPrestige(), 4); valuesBody += "\nBase Prestige:"; valuesNumbers += "\n" + Eleven.toMaxLen(hex.location.settlement.basePrestige, 4); valuesBody += "\nMilitary Cap Add:"; valuesNumbers += "\n" + hex.location.settlement.getMilitaryCap(); valuesBody += "\nMilitary Regen"; valuesNumbers += "\n" + hex.location.settlement.militaryRegenAdd; } } if (loc.settlement != null) { locFlavour.text = loc.settlement.getFlavour(); if (loc.settlement is Set_City) { valuesBody += "\n" + ((Set_City)loc.settlement).getStatsDesc(); valuesNumbers += "\n" + ((Set_City)loc.settlement).getStatsValues(); } } valuesBody += "\nTemperature "; valuesNumbers += "\n" + (int)(loc.hex.getTemperature() * 100) + "%"; valuesBody += "\nHabilitability "; valuesNumbers += "\n" + (int)(hab * 100) + "%"; locNumsBody.text = valuesBody; locNumsNumbers.text = valuesNumbers; locInfoBody.text = bodyText; } }