From c3da1c3b50d05af317b764253320e0b0d18a4657 Mon Sep 17 00:00:00 2001 From: swaqvalley Date: Wed, 15 Apr 2020 20:23:04 -0500 Subject: [PATCH 1/2] Start new colonies with some happiness --- default/scripting/species/common/happiness.macros | 13 ++++++++++++- default/stringtables/en.txt | 6 +++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/default/scripting/species/common/happiness.macros b/default/scripting/species/common/happiness.macros index 86426b9647b..953ad0340fc 100644 --- a/default/scripting/species/common/happiness.macros +++ b/default/scripting/species/common/happiness.macros @@ -10,7 +10,18 @@ AVERAGE_HAPPINESS effects = SetHappiness value = Value + min(abs(Value(Target.TargetHappiness) - Value), 1) * (1 - 2*(Statistic If condition = And [Target (Value > Value(Target.TargetHappiness))])) - + + EffectsGroup + scope = Source + activation = And [ + Planet + (Source.LastTurnConquered < CurrentTurn - 5) + ] + effects = SetHappiness value = max(Value, + 1*(Statistic If Condition = And [Target Planet environment = Poor]) + + 2*(Statistic If Condition = And [Target Planet environment = Adequate]) + + 4*(Statistic If Condition = And [Target Planet environment = Good])) + EffectsGroup scope = Source activation = Planet diff --git a/default/stringtables/en.txt b/default/stringtables/en.txt index 9fc5d6284e2..5d5abef7a96 100644 --- a/default/stringtables/en.txt +++ b/default/stringtables/en.txt @@ -5741,7 +5741,7 @@ METER_HAPPINESS_VALUE_LABEL Happiness METER_HAPPINESS_VALUE_DESC -'''The Happiness of a colony's population starts out low after initial colonization or after invasion, and may also be affected by other factors. A minimum Happiness of 5 is necessary for a colony to act as a source of settlers for colonizing other planets. Also [[metertype METER_INDUSTRY]] and [[metertype METER_RESEARCH]] only start growing if Happiness is at least 5. +'''The Happiness of a colony's population starts out between 1 and 5 after initial colonization depending on how suitable the planet's [[encyclopedia ENVIRONMENT_TITLE]] is for that species. Happiness is reduced to 0 after invasion and may also be affected by other factors. A minimum Happiness of 5 is necessary for a colony to act as a source of settlers for colonizing other planets. Also [[metertype METER_INDUSTRY]] and [[metertype METER_RESEARCH]] only start growing if Happiness is at least 5. The Target Happiness is the stable Happiness level a planet's population will approach, given the current factors influencing the planetary Happiness. Its value is connected to [[encyclopedia ENC_BUILDING_TYPE]]s built on the planet, [[encyclopedia ENC_TECH]] researched by the empire, [[encyclopedia ENC_SPECIAL]]s linked to the planet, and various other game effects. If these factors change, then the Target Happiness value is likely to shift.''' @@ -7451,7 +7451,7 @@ BEGINNER_HINT_14 14: Research [[metertype METER_SUPPLY]] improvements, like the [[tech CON_ORBITAL_CON]], to increase the distance from your systems that your supply lines reach. BEGINNER_HINT_15 -15: Most species start out with a [[metertype METER_HAPPINESS]] of 1 when you capture their planet, and this will normally increase by 1 per turn. Look out for [[encyclopedia XENOPHOBIC_SPECIES_TITLE]] species though! They don't like being near other species and this will effect the happiness and other values of both them and the other nearby species. +15: Most species start out with a [[metertype METER_HAPPINESS]] of 0 when you capture their planet, and this will normally increase by 1 per turn. Look out for [[encyclopedia XENOPHOBIC_SPECIES_TITLE]] species though! They don't like being near other species and this will effect the happiness and other values of both them and the other nearby species. BEGINNER_HINT_16 16: You may want to hold off on researching [[tech LRN_PSIONICS]] until your empire includes a species with [[encyclopedia TELEPATHIC_TITLE]]. @@ -11329,7 +11329,7 @@ CON_FRC_ENRG_STRC Force-Energy Structures CON_FRC_ENRG_STRC_DESC -'''Increases the growth of resource and infrastructure meters below target value to 3 per turn, and the decay of resource meters above target value to 5 per turn. [[metertype METER_INDUSTRY]] and [[metertype METER_RESEARCH]]l grow only if [[metertype METER_HAPPINESS]] is at least 5. +'''Increases the growth of resource and infrastructure meters below target value to 3 per turn, and the decay of resource meters above target value to 5 per turn. [[metertype METER_INDUSTRY]] and [[metertype METER_RESEARCH]] grow only if [[metertype METER_HAPPINESS]] is at least 5. The flexibility and versatility of force-energy structures permits a colonies buildings to be more easily re-tooled to suit new purposes, increasing the rate at which focus changes can take effect. From 2744033f62bc92dfcc86d99acff319adb2c1b2c1 Mon Sep 17 00:00:00 2001 From: swaqvalley <56489179+swaqvalley@users.noreply.github.com> Date: Thu, 16 Apr 2020 13:17:34 -0600 Subject: [PATCH 2/2] fixup! Affect new colonies only --- default/scripting/species/common/happiness.macros | 1 + 1 file changed, 1 insertion(+) diff --git a/default/scripting/species/common/happiness.macros b/default/scripting/species/common/happiness.macros index 953ad0340fc..1cf0dfb4c67 100644 --- a/default/scripting/species/common/happiness.macros +++ b/default/scripting/species/common/happiness.macros @@ -16,6 +16,7 @@ AVERAGE_HAPPINESS activation = And [ Planet (Source.LastTurnConquered < CurrentTurn - 5) + Stockpile high = 0 ] effects = SetHappiness value = max(Value, 1*(Statistic If Condition = And [Target Planet environment = Poor]) +