Skip to content

Commit

Permalink
- disable spawning of new wild monsters at monster nests when monster…
Browse files Browse the repository at this point in the history
… frequency galaxy setup option is the lowest two possible settings

- adding species likes and dislikes effects to apply moderate happiness bonus/malus for colonies being inside or close to liked or disliked fields
- prettier accounting labels for likes and dislikes using <i>italics</i>
  • Loading branch information
st-pa-fo committed Feb 13, 2022
1 parent 4dc4d8a commit 579c23f
Show file tree
Hide file tree
Showing 12 changed files with 127 additions and 51 deletions.
3 changes: 3 additions & 0 deletions default/scripting/fields/FLD_NEBULA_1.focs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ FieldType
CreateField type = "FLD_ACCRETION_DISC" size = 20
AddSpecial name = "ACCRETION_DISC_SPECIAL"
]

[[SPECIES_LIKES_OR_DISLIKES_FIELDS_STABILITY_EFFECTS]]

]
graphic = "fields/star_forming_nebula_1.png"

Expand Down
3 changes: 3 additions & 0 deletions default/scripting/fields/FLD_NEBULA_2.focs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ FieldType
description = "FLD_NEBULA_2_DESC"
stealth = 0.01
effectsgroups = [

[[SPECIES_LIKES_OR_DISLIKES_FIELDS_STABILITY_EFFECTS]]

EffectsGroup // shrink slowly when in no-star system
scope = Source
activation = And [
Expand Down
3 changes: 3 additions & 0 deletions default/scripting/fields/FLD_NEBULA_3.focs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ FieldType
description = "FLD_NEBULA_3_DESC"
stealth = 0.01
effectsgroups = [

[[SPECIES_LIKES_OR_DISLIKES_FIELDS_STABILITY_EFFECTS]]

EffectsGroup // shrink slowly when in no-star system
scope = Source
activation = And [
Expand Down
32 changes: 32 additions & 0 deletions default/scripting/fields/fields.macros
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,35 @@ EFFECT_CREATE_GASGIANT
type = GasGiant
planetsize = GasGiant
'''

STABILITY_PER_LIKED_OR_DISLIKED_FIELD
'''0.5 * [[SPECIES_LIKE_DISLIKE_SCALING]]'''

SPECIES_LIKES_OR_DISLIKES_FIELDS_STABILITY_EFFECTS
'''
// species likes a fields and is inside or close to it
EffectsGroup
scope = And [
Planet
Species
WithinDistance distance = Source.Size * 1.75 condition = Source
(SpeciesContentOpinion species = LocalCandidate.Species name = ThisField > 0)
]
accountinglabel = "LIKES_FIELD_LABEL"
effects =
SetTargetHappiness value = Value + [[STABILITY_PER_LIKED_OR_DISLIKED_FIELD]] * SpeciesContentOpinion species = Target.Species name = ThisField

// species dislikes a fields and is inside or close to it
EffectsGroup
scope = And [
Planet
Species
WithinDistance distance = Source.Size * 1.75 condition = Source
(SpeciesContentOpinion species = LocalCandidate.Species name = ThisField < 0)
]
accountinglabel = "DISLIKES_FIELD_LABEL"
effects =
SetTargetHappiness value = Value + [[STABILITY_PER_LIKED_OR_DISLIKED_FIELD]] * SpeciesContentOpinion species = Target.Species name = ThisField
'''

#include "/scripting/species/common/general.macros"
20 changes: 20 additions & 0 deletions default/scripting/ship_parts/General/SP_CORE_ROTTEN.focs.disabled
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Part
name = "SP_CORE_ROTTEN"
description = "SP_CORE_ROTTEN_DESC"
class = General
damage = 0
destroyFightersPerBattleMax = 0
mountableSlotTypes = Core
buildcost = 150 * [[FLEET_UPKEEP_MULTIPLICATOR]] * [[SHIP_PART_COST_MULTIPLIER]]
buildtime = 4
tags = [ "PEDIA_PC_GENERAL" ]
location = And [
Planet
OwnedBy empire = Source.Owner
]
icon = "icons/ship_parts/spinal_antimatter.png"

#include "shortrange.macros"

#include "/scripting/common/upkeep.macros"
#include "/scripting/ship_parts/targeting.macros"
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// parameter 3 is the monster spawn probability
MONSTER_NEST
'''
// when controlled, generate owned tame monsters
EffectsGroup
scope = Source
activation = And [
Expand All @@ -26,12 +27,15 @@ MONSTER_NEST
]
empire = Source.Owner
]

// when not controlled, generate wild monsters
EffectsGroup
scope = Source
activation = And [
Planet
Turn low = 10
Unowned
(GalaxyMonsterFrequency > 1) // only generate new wild monsters in non-lowest galaxy monster setup setting
Random probability = 0.12 * GalaxyMonsterFrequency / 2.0
]
stackinggroup = "@1@_NEST_STACK"
Expand Down
1 change: 0 additions & 1 deletion default/scripting/species/SP_EGASSEM.focs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ Species
"PLC_ENGINEERING"
"PLC_ENVIRONMENTALISM"
"PLC_NO_GROWTH"
"SP_PHINNERT" // TODO: remove after testing
"WORLDTREE_SPECIAL"
]

Expand Down
38 changes: 36 additions & 2 deletions default/scripting/species/SP_GEORGE.focs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,42 @@ Species
]

defaultfocus = "FOCUS_INDUSTRY"
likes = ["FOCUS_INDUSTRY" "SUCCULENT_BARNACLES_SPECIAL" "SPARK_FOSSILS_SPECIAL" "MONOPOLE_SPECIAL" "PROBIOTIC_SPECIAL" "GAIA_SPECIAL" "HONEYCOMB_SPECIAL" "PANOPTICON_SPECIAL" "PLC_ARTISAN_WORKSHOPS" "PLC_CHARGE" "PLC_EXPLORATION" "PLC_NATIVE_APPROPRIATION" "PLC_THE_HUNT" ]
dislikes = ["BLD_STARGATE" "BLD_GAS_GIANT_GEN" "BLD_SHIPYARD_CON_NANOROBO" "BLD_SHIPYARD_CON_GEOINT" "BLD_SHIPYARD_CON_ADV_ENGINE" "BLD_GATEWAY_VOID" "BLD_ENCLAVE_VOID" "PHILOSOPHER_SPECIAL" "ELERIUM_SPECIAL" "FRUIT_SPECIAL" "PLC_BUREAUCRACY" "PLC_CHECKPOINTS" "PLC_CONFORMANCE" "PLC_MODERATION" "PLC_NO_SUPPLY" ]
likes = [
"FOCUS_INDUSTRY"
"GAIA_SPECIAL"
"HONEYCOMB_SPECIAL"
"MONOPOLE_SPECIAL"
"PANOPTICON_SPECIAL"
"PLC_ARTISAN_WORKSHOPS"
"PLC_CHARGE"
"PLC_EXPLORATION"
"PLC_NATIVE_APPROPRIATION"
"PLC_THE_HUNT"
"PROBIOTIC_SPECIAL"
"SPARK_FOSSILS_SPECIAL"
"SUCCULENT_BARNACLES_SPECIAL"
]
dislikes = [
"BLD_ENCLAVE_VOID"
"BLD_GAS_GIANT_GEN"
"BLD_GATEWAY_VOID"
"BLD_SHIPYARD_CON_ADV_ENGINE"
"BLD_SHIPYARD_CON_GEOINT"
"BLD_SHIPYARD_CON_NANOROBO"
"BLD_STARGATE"
"ELERIUM_SPECIAL"
"FRUIT_SPECIAL"
"PHILOSOPHER_SPECIAL"
"PLC_BUREAUCRACY"
"PLC_CHECKPOINTS"
"PLC_CONFORMANCE"
"PLC_MODERATION"
"PLC_NO_SUPPLY"
"FLD_NEBULA_1" // TODO: remove after testing!
"FLD_NEBULA_2" // TODO: remove after testing!
"FLD_NEBULA_3" // TODO: remove after testing!
"SP_THENIAN" // TODO: remove after testing!
]

effectsgroups = [
[[GOOD_INDUSTRY]]
Expand Down
1 change: 0 additions & 1 deletion default/scripting/species/SP_PHINNERT.focs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ Species
"PLC_POPULATION"
"PLC_STOCKPILE_LIQUIDATION"
"SUCCULENT_BARNACLES_SPECIAL"
"SP_EGASSEM" // TODO: remove after testing
"TIDAL_LOCK_SPECIAL"
]
dislikes = [
Expand Down
4 changes: 4 additions & 0 deletions default/scripting/species/common/general.macros
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,7 @@ FAST_COLONIZATION

SLOW_COLONIZATION
'''[[DESCRIPTION_EFFECTSGROUP_MACRO(SLOW_COLONIZATION_DESC)]]'''


SPECIES_LIKE_DISLIKE_SCALING
'''1.0'''
37 changes: 2 additions & 35 deletions default/scripting/species/common/population.macros
Original file line number Diff line number Diff line change
Expand Up @@ -336,37 +336,6 @@ LIFECYCLE_MANIP_POPULATION_EFFECTS
]
'''



// // species like building in the same system
// EffectsGroup
// scope = And [
// Planet
// InSystem id = Source.SystemID
// Population low = 0.001
// Not Object id = Source.PlanetID // but not on same planet, which is covered by above case
// (SpeciesContentOpinion species = LocalCandidate.Species name = ThisBuilding < 0)
// ]
// accountinglabel = "DISLIKES_BUILDING_LABEL"
// effects =
// SetTargetHappiness value = Value + [[STABILITY_PER_LIKED_OR_DISLIKED_BUILDING_IN_SYSTEM]] * SpeciesContentOpinion species = Target.Species name = ThisBuilding

// // species dislike building in the same system
// EffectsGroup
// scope = And [
// Planet
// InSystem id = Source.SystemID
// Population low = 0.001
// Not Object id = Source.PlanetID // but not on same planet, which is covered by above case
// (SpeciesContentOpinion species = LocalCandidate.Species name = ThisBuilding > 0)
// ]
// accountinglabel = "LIKES_BUILDING_LABEL"
// effects =
// SetTargetHappiness value = Value + [[STABILITY_PER_LIKED_OR_DISLIKED_BUILDING_IN_SYSTEM]] * SpeciesContentOpinion species = Target.Species name = ThisBuilding

SPECIES_LIKE_DISLIKE_SCALING
'''1.0'''

STABILITY_PER_LIKED_OR_DISLIKED_SPECIES
'''0.5 * [[SPECIES_LIKE_DISLIKE_SCALING]]'''

Expand All @@ -379,7 +348,7 @@ SPECIES_LIKES_OR_DISLIKES_SPECIES_STABILITY_EFFECTS
InSystem id = Source.SystemID
Species
Not Source // but not on same planet because there can be only one species per planet
(SpeciesContentOpinion species = LocalCandidate.Species name = ThisSpecies < 0)
(SpeciesContentOpinion species = LocalCandidate.Species name = ThisSpecies > 0)
]
activation = Planet
accountinglabel = "LIKES_SPECIES_LABEL"
Expand All @@ -394,16 +363,14 @@ SPECIES_LIKES_OR_DISLIKES_SPECIES_STABILITY_EFFECTS
InSystem id = Source.SystemID
Species
Not Object id = Source.PlanetID // but not on same planet because there can be only one species per planet
(SpeciesContentOpinion species = LocalCandidate.Species name = ThisSpecies > 0)
(SpeciesContentOpinion species = LocalCandidate.Species name = ThisSpecies < 0)
]
accountinglabel = "DISLIKES_SPECIES_LABEL"
effects =
SetTargetHappiness value = Value + [[STABILITY_PER_LIKED_OR_DISLIKED_SPECIES]] * SpeciesContentOpinion species = Target.Species name = ThisSpecies

'''



#include "/scripting/species/common/advanced_focus.macros"
#include "/scripting/species/common/focus.macros"
#include "/scripting/species/common/general.macros"
32 changes: 20 additions & 12 deletions default/stringtables/en.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16962,57 +16962,65 @@ Likes Influence-Focused Artistic Species In System
# %1% name of empire
# %2% name of policy
LIKES_POLICY_LABEL
Likes %1% policy %2%
Likes %1% policy <i>%2%</i>

# %1% name of empire
# %2% name of policy
DISLIKES_POLICY_LABEL
Dislikes %1% policy %2%
Dislikes %1% policy <i>%2%</i>

# %1% name of planet
# %2% name of building
LIKES_BUILDING_LABEL
Likes %1% building %2%
Likes <i>%1%</i> building %2%

# %1% name of planet
# %2% name of building
DISLIKES_BUILDING_LABEL
Dislikes %1% building %2%
Dislikes <i>%1%</i> building %2%

# %1% name of planet
# %2% name of species on planet (not the focus!)
LIKES_FOCUS_LABEL
Likes %1% focus
Likes <i>%1%</i> focus

# %1% name of planet
# %2% name of species on planet (not the focus!)
DISLIKES_FOCUS_LABEL
Dislikes %1% focus
Dislikes <i>%1%</i> focus

# %1% name of planet
# %2% name of species
LIKES_SPECIES_LABEL
Likes %2% on %1%
Likes <i>%2%</i> on <i>%1%</i>

# %1% name of planet
# %2% name of special
# %2% name of species
DISLIKES_SPECIES_LABEL
Dislikes %2% on %1%
Dislikes <i>%2%</i> on <i>%1%</i>

# %1% name of field
LIKES_FIELD_LABEL
Likes being in <i>%1%</i>

# %1% name of field
DISLIKES_FIELD_LABEL
Dislikes being in <i>%2%</i>

# %1% name of planet
# %2% name of special
LIKES_SPECIAL_LABEL
Likes %1% %2%
Likes special <i>%2%</i> on <i>%1%</i>

# %1% name of planet
# %2% name of special
DISLIKES_SPECIAL_LABEL
Dislikes %1% %2%
Dislikes special <i>%2%</i> on <i>%1%</i>

# %1% name of planet
# %2% name of species on planet
FOCUS_PROTECTION_LABEL
%2% Protection Focus
<i>%2%</i> Protection Focus

# %1% FIXME
STANDARD_CONSTRUCTION_LABEL
Expand Down

0 comments on commit 579c23f

Please sign in to comment.