Skip to content

Commit

Permalink
Refactor stringtables and focs to use RULE_FIRST_COMBAT_ROUND_IN_CLOS…
Browse files Browse the repository at this point in the history
…E_TARGETING_RANGE
  • Loading branch information
Axel Groß committed Feb 26, 2021
1 parent e471e6b commit c64deab
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 22 deletions.
2 changes: 2 additions & 0 deletions default/scripting/common/named_values.focs.txt
Expand Up @@ -14,5 +14,7 @@ NamedInteger name = "NUM_COMBAT_ROUNDS" value = (GameRule name = "RULE_NUM_COMBA

NamedInteger name = "NUM_COMBAT_ROUNDS_FIGHTERS" value = (GameRule name = "RULE_NUM_COMBAT_ROUNDS") - 1

NamedInteger name = "FIRST_COMBAT_ROUND_IN_CLOSE_TARGETING_RANGE" value = (GameRule name = "RULE_FIRST_COMBAT_ROUND_IN_CLOSE_TARGETING_RANGE")

#include "/scripting/common/misc.macros"
#include "/scripting/common/base_prod.macros"
9 changes: 9 additions & 0 deletions default/scripting/game_rules.focs.txt
Expand Up @@ -133,3 +133,12 @@ GameRule
category = "MULTIPLAYER"
type = Toggle
default = Off

GameRule
name = "RULE_FIRST_COMBAT_ROUND_IN_CLOSE_TARGETING_RANGE"
description = "RULE_FIRST_COMBAT_ROUND_IN_CLOSE_TARGETING_RANGE_DESC"
category = "BALANCE"
type = Integer
default = 3
min = 1
max = 20
2 changes: 1 addition & 1 deletion default/scripting/ship_parts/ShortRange/SR_JAWS.focs.txt
Expand Up @@ -4,7 +4,7 @@ Part
class = ShortRange
damage = 10
combatTargets = And [
(CombatBout > 2)
(CombatBout >= NamedIntegerLookup name = "FIRST_COMBAT_ROUND_IN_CLOSE_TARGETING_RANGE")
[[COMBAT_TARGETS_VISIBLE_ENEMY]]
Or [
[[COMBAT_TARGETS_NOT_DESTROYED_SHIP]]
Expand Down
2 changes: 1 addition & 1 deletion default/scripting/ship_parts/ShortRange/SR_SPINES.focs.txt
Expand Up @@ -4,7 +4,7 @@ Part
class = ShortRange
damage = 40
combatTargets = And [
(CombatBout > 2)
(CombatBout >= NamedIntegerLookup name = "FIRST_COMBAT_ROUND_IN_CLOSE_TARGETING_RANGE")
[[COMBAT_TARGETS_VISIBLE_ENEMY]]
Or [
[[COMBAT_TARGETS_NOT_DESTROYED_SHIP]]
Expand Down
17 changes: 9 additions & 8 deletions default/scripting/ship_parts/ShortRange/SR_TENTACLE.focs.txt
Expand Up @@ -5,26 +5,27 @@ Part
damage = 5
shots = 2
combatTargets = And [
(CombatBout > 1)
[[COMBAT_TARGETS_VISIBLE_ENEMY]]
OrderedAlternativesOf [
And [
// Attack fighters in bout 2
(CombatBout = 2)
[[COMBAT_TARGETS_VISIBLE_ENEMY]] Fighter
]
And [
(CombatBout > 2) // Ships are also in reach starting from bout 3
// Ships are also in reach starting from bout 3
(CombatBout >= NamedIntegerLookup name = "FIRST_COMBAT_ROUND_IN_CLOSE_TARGETING_RANGE")
[[COMBAT_TARGETS_VISIBLE_ENEMY]] [[COMBAT_TARGETS_NOT_DESTROYED_SHIP]]
]
And [
(CombatBout > 2) // if no ships, fighters and planets are fair game
// if no ships, fighters and planets are fair game
(CombatBout >= NamedIntegerLookup name = "FIRST_COMBAT_ROUND_IN_CLOSE_TARGETING_RANGE")
[[COMBAT_TARGETS_VISIBLE_ENEMY]]
Or [
Fighter
[[COMBAT_TARGETS_PLANET_WITH_DEFENSE]]
]
]
And [
// Attack fighters in bout 2
(CombatBout = 2)
[[COMBAT_TARGETS_VISIBLE_ENEMY]] Fighter
]
]
]
mountableSlotTypes = External
Expand Down
Expand Up @@ -5,7 +5,7 @@ Part
damage = 1
shots = 10
combatTargets = And [
(CombatBout > 2)
(CombatBout >= NamedIntegerLookup name = "FIRST_COMBAT_ROUND_IN_CLOSE_TARGETING_RANGE")
[[COMBAT_TARGETS_VISIBLE_ENEMY]]
Or [
Fighter
Expand Down
28 changes: 17 additions & 11 deletions default/stringtables/en.txt
Expand Up @@ -1124,6 +1124,18 @@ Combat Rounds
RULE_NUM_COMBAT_ROUNDS_DESC
How many rounds of combat occur each turn.

RULE_FIRST_COMBAT_ROUND_IN_SHORT_TARGETING_RANGE
Short Range Targeting Combat Round

RULE_FIRST_COMBAT_ROUND_IN_SHORT_TARGETING_RANGE_DESC
The first combat round in which short range weapons are able to shoot at targets.

RULE_FIRST_COMBAT_ROUND_IN_CLOSE_TARGETING_RANGE
Close Range Targeting Combat Round

RULE_FIRST_COMBAT_ROUND_IN_CLOSE_TARGETING_RANGE_DESC
The first combat round in which close range weapons are able to shoot at targets.

RULE_AGGRESSIVE_SHIPS_COMBAT_VISIBLE
Aggressive Ships Combat Visible

Expand Down Expand Up @@ -14266,12 +14278,6 @@ Krill Swarm
FT_BAY_KRILL_DESC
When Krill swarms are big enough, single Krill leave the swarm to attack ships the swarm encounters.

SHORT_RANGE_COMBAT_ROUND
2

CLOSE_RANGE_COMBAT_ROUND
3

SR_WEAPON_0_1
Flak Cannon

Expand Down Expand Up @@ -14344,39 +14350,39 @@ Graviton Pulsar
SR_GRAV_PULSE_DESC
'''Graviton pulse causing damage to hull integrity to every target caught in the blast. While still deadly to fighters if the blast is spread, it causes only minor damage to ships or planet defenses.

Graviton pulse inflicts [[encyclopedia DAMAGE_TITLE]] only once in combat, in combat round [[SHORT_RANGE_COMBAT_ROUND]].'''
Graviton pulse inflicts [[encyclopedia DAMAGE_TITLE]] only once in combat, in combat round [[value FIRST_COMBAT_ROUND_IN_SHORT_TARGETING_RANGE]].'''

SR_JAWS
Jaws

SR_JAWS_DESC
'''Jaws of a space monster, can damage ships and planets. Huge space monsters are even capable of eating entire fleets.

Jaws can inflict [[encyclopedia DAMAGE_TITLE]] starting from combat round [[CLOSE_RANGE_COMBAT_ROUND]] as the targets are too far away in earlier rounds.'''
Jaws can inflict [[encyclopedia DAMAGE_TITLE]] starting from combat round [[value FIRST_COMBAT_ROUND_IN_CLOSE_TARGETING_RANGE]] as the targets are too far away in earlier rounds.'''

SR_SPINES
Spines

SR_SPINES_DESC
'''Spines of a space monster, a powerful strike of the space monster can deal big damage to a ship.

Spines inflict [[encyclopedia DAMAGE_TITLE]] starting from combat round [[CLOSE_RANGE_COMBAT_ROUND]] as the targets are too far away in earlier rounds.'''
Spines inflict [[encyclopedia DAMAGE_TITLE]] starting from combat round [[value FIRST_COMBAT_ROUND_IN_CLOSE_TARGETING_RANGE]] as the targets are too far away in earlier rounds.'''

SR_TENTACLE
Tentacle

SR_TENTACLE_DESC
'''Tentacle of a kraken, primarily do damage to ships. Is also able to attack fighters and planets.

Tentacles can inflict [[encyclopedia DAMAGE_TITLE]] to ships starting from combat round [[CLOSE_RANGE_COMBAT_ROUND]] as the targets are too far away in earlier rounds. Tentacles start to destroy fighters when they come in range in [[SHORT_RANGE_COMBAT_ROUND]]. Tentacles only attack fighters or planets if there are no ships to target.'''
Tentacles can inflict [[encyclopedia DAMAGE_TITLE]] to ships starting from combat round [[value FIRST_COMBAT_ROUND_IN_CLOSE_TARGETING_RANGE]] as the targets are too far away in earlier rounds. Tentacles start to destroy fighters when they come in range in combat round 2. Tentacles only attack fighters or planets if there are no ships to target.'''

SR_THRASHING_BODY
Thrashing Body

SR_THRASHING_BODY_DESC
'''The fast moving body of a space monster, crushes fighters and low structure ships in its way.

A thrashing body can inflict [[encyclopedia DAMAGE_TITLE]] starting from combat round [[CLOSE_RANGE_COMBAT_ROUND]] as the targets are too far away in earlier rounds.'''
A thrashing body can inflict [[encyclopedia DAMAGE_TITLE]] starting from combat round [[value FIRST_COMBAT_ROUND_IN_CLOSE_TARGETING_RANGE]] as the targets are too far away in earlier rounds.'''

SR_PLASMA_DISCHARGE
Plasma Discharge
Expand Down

0 comments on commit c64deab

Please sign in to comment.