protected static string GenerateResultEffectsString_DecreasePreference(Polity polity, string preferenceId) { Faction dominantFaction = polity.DominantFaction; CulturalPreference preference = dominantFaction.Culture.GetPreference(preferenceId); return(polity.GetNameAndTypeStringBold().FirstLetterToUpper() + ": " + dominantFaction.GetNameAndTypeStringBold().AddPossApos() + " preference decreases to: " + preference.Value.ToString("0.00")); }
protected static string GenerateResultEffectsString_DecreaseRelationship(Polity polity, Polity targetPolity) { Faction dominantFaction = polity.DominantFaction; Faction targetdominantFaction = targetPolity.DominantFaction; float value = dominantFaction.GetRelationshipValue(targetdominantFaction); return(polity.GetNameAndTypeStringBold().FirstLetterToUpper() + ": " + dominantFaction.GetNameAndTypeStringBold().AddPossApos() + " relationship with " + targetdominantFaction.GetNameAndTypeWithPolityStringBold() + " decreases to: " + value.ToString("0.00")); }
protected static string GenerateEffectsString_DecreaseRelationship(Polity polity, Polity targetPolity, float minPercentChange, float maxPercentChange) { float charismaFactor = polity.CurrentLeader.Charisma / 10f; float wisdomFactor = polity.CurrentLeader.Wisdom / 15f; float attributesFactor = Mathf.Max(charismaFactor, wisdomFactor); attributesFactor = Mathf.Clamp(attributesFactor, 0.5f, 2f); float modMinPercentChange = minPercentChange / attributesFactor; float modMaxPercentChange = maxPercentChange / attributesFactor; Faction dominantFaction = polity.DominantFaction; Faction targetdominantFaction = targetPolity.DominantFaction; float originalValue = dominantFaction.GetRelationshipValue(targetdominantFaction); float minValChange = MathUtility.DecreaseByPercent(originalValue, modMinPercentChange); float maxValChange = MathUtility.DecreaseByPercent(originalValue, modMaxPercentChange); return(polity.GetNameAndTypeStringBold().FirstLetterToUpper() + ": " + dominantFaction.GetNameAndTypeStringBold().AddPossApos() + " relationship with " + targetdominantFaction.GetNameAndTypeWithPolityStringBold() + " (" + originalValue.ToString("0.00") + ") decreases to: " + minValChange.ToString("0.00") + " - " + maxValChange.ToString("0.00")); }
protected static string GenerateEffectsString_DecreasePreference(Polity polity, string preferenceId, float minPercentChange, float maxPercentChange) { float charismaFactor = polity.CurrentLeader.Charisma / 10f; float wisdomFactor = polity.CurrentLeader.Wisdom / 15f; float attributesFactor = Mathf.Max(charismaFactor, wisdomFactor); attributesFactor = Mathf.Clamp(attributesFactor, 0.5f, 2f); float modMinPercentChange = minPercentChange / attributesFactor; float modMaxPercentChange = maxPercentChange / attributesFactor; Faction dominantFaction = polity.DominantFaction; CulturalPreference preference = dominantFaction.Culture.GetPreference(preferenceId); float originalValue = preference.Value; float minValChange = MathUtility.DecreaseByPercent(originalValue, modMinPercentChange); float maxValChange = MathUtility.DecreaseByPercent(originalValue, modMaxPercentChange); return(polity.GetNameAndTypeStringBold().FirstLetterToUpper() + ": " + dominantFaction.GetNameAndTypeStringBold().AddPossApos() + " " + preference.Name.ToLower() + " preference (" + originalValue.ToString("0.00") + ") decreases to: " + minValChange.ToString("0.00") + " - " + maxValChange.ToString("0.00")); }
protected static string GenerateResultEffectsString_DecreaseInfluence(Faction faction, Polity polity) { return(faction.GetNameAndTypeStringBold().FirstLetterToUpper() + ": influence within the " + polity.GetNameAndTypeStringBold() + " decreases to: " + faction.Influence.ToString("P")); }
protected static void GenerateEffectsString_TransferInfluence( Faction sourceFaction, Faction targetFaction, Polity polity, float minPercentChange, float maxPercentChange, out string effectStringSourceFaction, out string effectStringTargetFaction) { float charismaFactor = sourceFaction.CurrentLeader.Charisma / 10f; float wisdomFactor = sourceFaction.CurrentLeader.Wisdom / 15f; float attributesFactor = Mathf.Max(charismaFactor, wisdomFactor); attributesFactor = Mathf.Clamp(attributesFactor, 0.5f, 2f); float modMinPercentChange = minPercentChange / attributesFactor; float modMaxPercentChange = maxPercentChange / attributesFactor; float oldSourceInfluenceValue = sourceFaction.Influence; float minSourceValChange = oldSourceInfluenceValue * (1f - modMinPercentChange); float maxSourceValChange = oldSourceInfluenceValue * (1f - modMaxPercentChange); float oldTargetInfluenceValue = targetFaction.Influence; float minTargetValChange = oldTargetInfluenceValue + oldSourceInfluenceValue - minSourceValChange; float maxTargetValChange = oldTargetInfluenceValue + oldSourceInfluenceValue - maxSourceValChange; effectStringSourceFaction = sourceFaction.GetNameAndTypeStringBold().FirstLetterToUpper() + ": influence within the " + polity.GetNameAndTypeStringBold() + " (" + oldSourceInfluenceValue.ToString("P") + ") decreases to: " + minSourceValChange.ToString("P") + " - " + maxSourceValChange.ToString("P"); effectStringTargetFaction = targetFaction.GetNameAndTypeStringBold().FirstLetterToUpper() + ": influence within the " + polity.GetNameAndTypeStringBold() + " (" + oldTargetInfluenceValue.ToString("P") + ") increases to: " + minTargetValChange.ToString("P") + " - " + maxTargetValChange.ToString("P"); }
public string GetNameAndTypeWithPolityStringBold() { return(GetNameAndTypeStringBold() + " of " + Polity.GetNameAndTypeStringBold()); }