Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spatial flux rework #3600

Merged
merged 13 commits into from Nov 14, 2021
Binary file added default/data/art/icons/ship_parts/flux-lance.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 15 additions & 1 deletion default/scripting/common/named_values.focs.txt
Expand Up @@ -10,7 +10,7 @@ NamedReal name = "ANCIENT_RUINS_MIN_STABILITY" value = 12

NamedReal name = "IMPERIAL_GARRISON_MAX_TROOPS_FLAT" value = 6

NamedReal name = "SHP_REINFORCED_HULL_BONUS" value = (5 * [[SHIP_STRUCTURE_FACTOR]])
NamedReal name = "SHP_REINFORCED_HULL_BONUS" value = (5 * [[SHIP_STRUCTURE_FACTOR]])

NamedInteger name = "NUM_COMBAT_ROUNDS" value = (GameRule name = "RULE_NUM_COMBAT_ROUNDS")

Expand All @@ -27,5 +27,19 @@ NamedInteger name = "MIN_COLONY_SIZE" value = [[MIN_RECOLONIZING_SIZE]]

NamedInteger name = "MIN_COLONY_HAPPINESS" value = [[MIN_RECOLONIZING_HAPPINESS]]

// Spatial Flux Stealth section
NamedReal name = "SPATIAL_FLUX_STEALTH_HULL_BASE" value = [[SPATIAL_FLUX_STEALTH_HULL_BASE]]
NamedReal name = "SPATIAL_FLUX_STEALTH_ARRIVAL_MALUS" value = 30
NamedReal name = "SPATIAL_FLUX_STEALTH_NON_AGGRESSIVE_BONUS" value = [[SPATIAL_FLUX_STEALTH_NON_AGGRESSIVE_BONUS]]
NamedReal name = "SPATIAL_FLUX_STEALTH_NON_AGGRESSIVE" value = [[SPATIAL_FLUX_STEALTH_HULL_BASE]] + [[SPATIAL_FLUX_STEALTH_NON_AGGRESSIVE_BONUS]]
NamedReal name = "SPATIAL_FLUX_STEALTH_TECH_BONUS" value = 10

SPATIAL_FLUX_STEALTH_HULL_BASE
'''15'''

SPATIAL_FLUX_STEALTH_NON_AGGRESSIVE_BONUS
'''10'''


#include "/scripting/common/misc.macros"
#include "/scripting/common/base_prod.macros"
@@ -0,0 +1,6 @@
Article
name = "HULL_LINE_SPATIAL_FLUX"
category = "ENC_SHIP_HULL"
short_description = "HULL_LINE_SPATIAL_FLUX"
description = "HULL_LINE_SPATIAL_FLUX_DESC"
icon = "icons/ship_hulls/bulk_freighter_hull_small.png"
Expand Up @@ -5,11 +5,11 @@ Hull
fuel = 6
NoDefaultFuelEffect
stealth = 15
structure = 19
structure = 17
slots = Slot type = Internal position = (0.50, 0.50)
buildcost = 17 * [[FLEET_UPKEEP_MULTIPLICATOR]] * [[SHIP_HULL_COST_MULTIPLIER]]
buildcost = 14 * [[FLEET_UPKEEP_MULTIPLICATOR]] * [[SHIP_HULL_COST_MULTIPLIER]]
buildtime = 2
tags = [ "ROBOTIC_HULL" "PEDIA_HULL_LINE_ROBOTIC" "GREAT_FUEL_EFFICIENCY" ]
tags = [ "PEDIA_HULL_LINE_SPATIAL_FLUX" "GREAT_FUEL_EFFICIENCY" ]
location = And [
Planet
OwnedBy empire = Source.Owner
Expand All @@ -23,21 +23,7 @@ Hull
]
]
effectsgroups = [
EffectsGroup
scope = Source
activation = Not Stationary
accountinglabel = "SPATIAL_FLUX_MALUS"
effects = SetStealth value = Value - 30

EffectsGroup
scope = Source
activation = Not Aggressive
accountinglabel = "SPATIAL_FLUX_BONUS"
effects = SetStealth value = Value + 10 +
(10 * Statistic If condition = And [ Source OwnerHasTech name = "SPY_STEALTH_PART_1" ]) +
(10 * Statistic If condition = And [ Source OwnerHasTech name = "SPY_STEALTH_PART_2" ]) +
(10 * Statistic If condition = And [ Source OwnerHasTech name = "SPY_STEALTH_PART_3" ]) +
(10 * Statistic If condition = And [ Source OwnerHasTech name = "SPY_STEALTH_4" ])
[[SPATIAL_FLUX_STEALTH_EFFECTS]]

[[GREAT_FUEL_EFFICIENCY]]
[[ADD_HULL_FUEL_TO_MAX_FUEL_METER]]
Expand All @@ -50,7 +36,7 @@ Hull
icon = "icons/ship_hulls/bulk_freighter_hull_small.png"
graphic = "hulls_design/bulk_freighter_hull.png"

#include "robotic.macros"
#include "spatial_flux.macros"

#include "../ship_hulls.macros"

Expand Down
@@ -0,0 +1,48 @@
Hull
name = "SH_SPACE_FLUX_COMPOSITE"
description = "SH_SPACE_FLUX_COMPOSITE_DESC"
speed = 80
fuel = 4
NoDefaultFuelEffect
stealth = 15
structure = 50
slots = [
Slot type = External position = (0.70, 0.30)
Slot type = Internal position = (0.40, 0.50)
Slot type = Core position = (0.55, 0.50)
]
buildcost = 40 * [[FLEET_UPKEEP_MULTIPLICATOR]] * [[SHIP_HULL_COST_MULTIPLIER]]
buildtime = 2
tags = [ "PEDIA_HULL_LINE_SPATIAL_FLUX" "GOOD_FUEL_EFFICIENCY" ]
location = And [
Planet
OwnedBy empire = Source.Owner
Contains And [
Building name = "BLD_SHIPYARD_BASE"
OwnedBy empire = Source.Owner
]
Contains And [
Building name = "BLD_SHIPYARD_ORBITAL_DRYDOCK"
OwnedBy empire = Source.Owner
]
]
effectsgroups = [
[[SPATIAL_FLUX_STEALTH_EFFECTS]]

[[GOOD_FUEL_EFFICIENCY]]
[[ADD_HULL_FUEL_TO_MAX_FUEL_METER]]
[[AVERAGE_BASE_FUEL_REGEN]]
[[REGULAR_HULL_DETECTION]]
[[SCAVANGE_FUEL_UNOWNED]]
[[UNOWNED_GOOD_VISION]]
[[UNOWNED_MOVE]]
]
// FIXME graphic and icon
icon = "icons/ship_hulls/agregate_asteroid_hull_small.png"
graphic = "hulls_design/agregate_asteroid_hull.png"

#include "spatial_flux.macros"

#include "../ship_hulls.macros"

#include "/scripting/common/upkeep.macros"
Expand Up @@ -12,7 +12,7 @@ Hull
]
buildcost = 11 * [[FLEET_UPKEEP_MULTIPLICATOR]] * [[SHIP_HULL_COST_MULTIPLIER]]
buildtime = 2
tags = [ "PEDIA_HULL_LINE_ROBOTIC" "GREAT_FUEL_EFFICIENCY" ]
tags = [ "PEDIA_HULL_LINE_SPATIAL_FLUX" "GREAT_FUEL_EFFICIENCY" ]
location = And [
Planet
OwnedBy empire = Source.Owner
Expand All @@ -26,21 +26,7 @@ Hull
]
]
effectsgroups = [
EffectsGroup
scope = Source
activation = Not Stationary
accountinglabel = "SPATIAL_FLUX_MALUS"
effects = SetStealth value = Value - 30

EffectsGroup
scope = Source
activation = Not Aggressive
accountinglabel = "SPATIAL_FLUX_BONUS"
effects = SetStealth value = Value + 10 +
(10 * Statistic If condition = And [ Source OwnerHasTech name = "SPY_STEALTH_PART_1" ]) +
(10 * Statistic If condition = And [ Source OwnerHasTech name = "SPY_STEALTH_PART_2" ]) +
(10 * Statistic If condition = And [ Source OwnerHasTech name = "SPY_STEALTH_PART_3" ]) +
(10 * Statistic If condition = And [ Source OwnerHasTech name = "SPY_STEALTH_4" ])
[[SPATIAL_FLUX_STEALTH_EFFECTS]]

[[GREAT_FUEL_EFFICIENCY]]
[[ADD_HULL_FUEL_TO_MAX_FUEL_METER]]
Expand All @@ -53,7 +39,7 @@ Hull
icon = "icons/ship_hulls/spatial_flux_hull_small.png"
graphic = "hulls_design/spatial_flux_hull.png"

#include "robotic.macros"
#include "spatial_flux.macros"

#include "../ship_hulls.macros"

Expand Down
17 changes: 17 additions & 0 deletions default/scripting/ship_hulls/spatial_flux/spatial_flux.macros
@@ -0,0 +1,17 @@
SPATIAL_FLUX_STEALTH_EFFECTS
'''EffectsGroup
scope = Source
activation = (Source.ArrivedOnTurn >= CurrentTurn - 1)
accountinglabel = "SPATIAL_FLUX_MALUS"
effects = SetStealth value = Value - NamedRealLookup name = "SPATIAL_FLUX_STEALTH_ARRIVAL_MALUS"

EffectsGroup
scope = Source
activation = Not Aggressive
accountinglabel = "SPATIAL_FLUX_BONUS"
effects = SetStealth value = Value + NamedRealLookup name = "SPATIAL_FLUX_STEALTH_NON_AGGRESSIVE_BONUS" + ( NamedRealLookup name = "SPATIAL_FLUX_STEALTH_TECH_BONUS" *
(Statistic If condition = And [ Source OwnerHasTech name = "SPY_STEALTH_PART_1" ]) +
(Statistic If condition = And [ Source OwnerHasTech name = "SPY_STEALTH_PART_2" ]) +
(Statistic If condition = And [ Source OwnerHasTech name = "SPY_STEALTH_PART_3" ]) +
(Statistic If condition = And [ Source OwnerHasTech name = "SPY_STEALTH_4" ]) )
'''
56 changes: 56 additions & 0 deletions default/scripting/ship_parts/ShortRange/SR_FLUX_LANCE.focs.txt
@@ -0,0 +1,56 @@
Part
name = "SR_FLUX_LANCE"
description = "SR_FLUX_LANCE_DESC"
exclusions = [
"SR_FLUX_LANCE"
]
class = ShortRange
damage = 2
shots = 1
// destroyFightersPerBattleMax = default, can shoot fighters starting from bout 2
damageStructurePerBattleMax =
max(0,ShipPartMeter part = "SR_FLUX_LANCE" meter = Capacity object = Source.ID - Value(Target.Shield))
* ShipPartMeter part = "SR_FLUX_LANCE" meter = SecondaryStat object = Source.ID
* ( NamedRealLookup name = "NUM_REAL_COMBAT_ROUNDS_IN_CLOSE_TARGETING_RANGE" + [[ONE_IF_CHARGING]] )

combatTargets = And [
Not System
Not Fleet
[[COMBAT_TARGETS_VISIBLE_ENEMY]]
OrderedAlternativesOf [
And [
// Both Ships and fighters are in reach starting from bout 3 (or bout 2 if charging)
(CombatBout >= ( NamedIntegerLookup name = "FIRST_COMBAT_ROUND_IN_CLOSE_TARGETING_RANGE" - [[ONE_IF_CHARGING]] ) )
[[COMBAT_TARGETS_VISIBLE_ENEMY]]
Or [
Fighter
[[COMBAT_TARGETS_NOT_DESTROYED_SHIP]]
]
]
And [
// Attack fighters starting from bout 2 until FIRST_COMBAT_ROUND_IN_CLOSE_TARGETING_RANGE
(CombatBout >= 2)
[[COMBAT_TARGETS_VISIBLE_ENEMY]]
Fighter
]
]
]
mountableSlotTypes = Internal
buildcost = 4 * [[FLEET_UPKEEP_MULTIPLICATOR]] * [[SHIP_PART_COST_MULTIPLIER]]
buildtime = 2
tags = [ "PEDIA_PC_DIRECT_WEAPON" ]
location = And [
Planet
OwnedBy empire = Source.Owner
]
icon = "icons/ship_parts/flux-lance.png"
agrrr3 marked this conversation as resolved.
Show resolved Hide resolved

ONE_IF_CHARGING
'''( Statistic If condition = And [ Source EmpireHasAdoptedPolicy empire = Source.Owner name = "PLC_CHARGE" ] )
'''


#include "shortrange.macros"

#include "/scripting/common/upkeep.macros"
#include "/scripting/ship_parts/targeting.macros"
Expand Up @@ -3,11 +3,11 @@ Tech
description = "SHP_CONTGRAV_MAINT_DESC"
short_description = "SHIP_HULL_UNLOCK_SHORT_DESC"
category = "SHIP_HULLS_CATEGORY"
researchcost = 250 * [[TECH_COST_MULTIPLIER]]
researchturns = 5
researchcost = 300 * [[TECH_COST_MULTIPLIER]]
researchturns = 7
tags = [ "PEDIA_ROBOTIC_HULL_TECHS" ]
prerequisites = [
"SHP_SPACE_FLUX_DRIVE"
"SHP_MIL_ROBO_CONT"
"CON_ARCH_MONOFILS"
]
unlock = [
Expand Down
Expand Up @@ -4,10 +4,10 @@ Tech
short_description = "SHIP_HULL_UNLOCK_SHORT_DESC"
category = "SHIP_HULLS_CATEGORY"
researchcost = 400 * [[TECH_COST_MULTIPLIER]]
researchturns = 8
researchturns = 10
tags = [ "PEDIA_ROBOTIC_HULL_TECHS" ]
prerequisites = [
"SHP_SPACE_FLUX_DRIVE"
"SHP_MIL_ROBO_CONT"
"PRO_NANOTECH_PROD"
]
unlock = [
Expand Down
Expand Up @@ -7,8 +7,7 @@ Tech
researchturns = 3
tags = [ "PEDIA_ROBOTIC_HULL_TECHS" ]
prerequisites = [
"CON_ASYMP_MATS"
"PRO_ROBOTIC_PROD"
"SHP_SPACE_FLUX_BASICS"
]
unlock = Item type = ShipHull name = "SH_SPACE_FLUX_BUBBLE"
graphic = "icons/ship_hulls/bulk_freighter_hull_small.png"
Expand Down
@@ -0,0 +1,17 @@
Tech
name = "SHP_SPACE_FLUX_COMPOSITION"
description = "SHP_SPACE_FLUX_COMPOSITION_DESC"
short_description = "SHIP_HULL_UNLOCK_SHORT_DESC"
category = "SHIP_HULLS_CATEGORY"
researchcost = 60 * [[TECH_COST_MULTIPLIER]]
researchturns = 6
tags = [ "PEDIA_ROBOTIC_HULL_TECHS" ]
prerequisites = [
"SHP_SPACE_FLUX_BUBBLE"
"SHP_SPACE_FLUX_DRIVE"
]
unlock = Item type = ShipHull name = "SH_SPACE_FLUX_COMPOSITE"
// FIXME graphic
graphic = "icons/ship_hulls/agregate_asteroid_hull_small.png"

#include "/scripting/common/base_prod.macros"
Expand Up @@ -3,10 +3,12 @@ Tech
description = "SHP_SPACE_FLUX_DRIVE_DESC"
short_description = "SHIP_HULL_UNLOCK_SHORT_DESC"
category = "SHIP_HULLS_CATEGORY"
researchcost = 25 * [[TECH_COST_MULTIPLIER]]
researchcost = 20 * [[TECH_COST_MULTIPLIER]]
researchturns = 4
tags = [ "PEDIA_ROBOTIC_HULL_TECHS" ]
prerequisites = "SHP_MIL_ROBO_CONT"
prerequisites = [
"SHP_SPACE_FLUX_BASICS"
]
unlock = Item type = ShipHull name = "SH_SPATIAL_FLUX"
graphic = "icons/ship_hulls/spatial_flux_hull_small.png"

Expand Down
@@ -0,0 +1,13 @@
Tech
name = "SHP_SPACE_FLUX_BASICS"
description = "SHP_SPACE_FLUX_BASICS_DESC"
short_description = "SHIP_WEAPON_UNLOCK_SHORT_DESC"
category = "SHIP_WEAPONS_CATEGORY"
researchcost = 4 * [[TECH_COST_MULTIPLIER]]
researchturns = 2
tags = [ "PEDIA_SR_WEAPON_TECHS" ]
prerequisites = "SHP_ROOT_AGGRESSION"
unlock = Item type = ShipPart name = "SR_FLUX_LANCE"
graphic = "icons/ship_parts/flux-lance.png"

#include "/scripting/common/base_prod.macros"