| 1 |
from macros.misc import SHIP_SHIELD_FACTOR |
| 2 |
from macros.priorities import AFTER_ALL_TARGET_MAX_METERS_PRIORITY, DEFAULT_PRIORITY |
| 3 |
|
| 4 |
try: |
| 5 |
from focs._effects import ( |
| 6 |
CurrentTurn, |
| 7 |
EffectsGroup, |
| 8 |
GalaxyMaxAIAggression, |
| 9 |
IsHuman, |
| 10 |
IsSource, |
| 11 |
LocalCandidate, |
| 12 |
SetMaxShield, |
| 13 |
SetShield, |
| 14 |
Ship, |
| 15 |
Target, |
| 16 |
Value, |
| 17 |
) |
| 18 |
except ModuleNotFoundError: |
| 19 |
pass |
| 20 |
|
| 21 |
|
| 22 |
STANDARD_SHIP_SHIELDS = [ |
| 23 |
EffectsGroup( # gives human bonuses when AI Aggression set to Beginner |
| 24 |
scope=IsSource, |
| 25 |
activation=IsHuman & (GalaxyMaxAIAggression == 0) & Ship, # human player, not human species |
| 26 |
accountinglabel="DIFFICULTY", |
| 27 |
priority=DEFAULT_PRIORITY, |
| 28 |
effects=SetMaxShield(value=Value + (1 * SHIP_SHIELD_FACTOR)), |
| 29 |
), |
| 30 |
EffectsGroup( # increase to max when not in battle |
| 31 |
scope=IsSource, |
| 32 |
activation=Ship & (LocalCandidate.LastTurnActiveInBattle < CurrentTurn), |
| 33 |
stackinggroup="SHIELD_REGENERATION_EFFECT", |
| 34 |
priority=AFTER_ALL_TARGET_MAX_METERS_PRIORITY, |
| 35 |
effects=SetShield(value=Target.MaxShield), |
| 36 |
), |
| 37 |
] |
| 38 |
|
| 39 |
# BAD_SHIP_SHIELDS |
| 40 |
# '''[[STANDARD_SHIP_SHIELDS]] |
| 41 |
|
| 42 |
# EffectsGroup |
| 43 |
# description = "BAD_SHIP_SHIELD_DESC" |
| 44 |
# scope = And [ |
| 45 |
# Source |
| 46 |
# Ship |
| 47 |
# ] |
| 48 |
# effects = SetMaxShield value = Value |
| 49 |
# - (0.5 * [[SHIP_SHIELD_FACTOR]] * (Statistic If condition = And [ Source DesignHasPart name = "SH_DEFENSE_GRID"])) |
| 50 |
# - (1.0 * [[SHIP_SHIELD_FACTOR]] * (Statistic If condition = And [ Source DesignHasPart name = "SH_DEFLECTOR"])) |
| 51 |
# - (1.5 * [[SHIP_SHIELD_FACTOR]] * (Statistic If condition = And [ Source DesignHasPart name = "SH_PLASMA"])) |
| 52 |
# - (2.0 * [[SHIP_SHIELD_FACTOR]] * (Statistic If condition = And [ Source DesignHasPart name = "SH_MULTISPEC"])) |
| 53 |
# - (2.5 * [[SHIP_SHIELD_FACTOR]] * (Statistic If condition = And [ Source DesignHasPart name = "SH_BLACK"])) |
| 54 |
# ''' |
| 55 |
|
| 56 |
# GOOD_SHIP_SHIELDS |
| 57 |
# '''[[STANDARD_SHIP_SHIELDS]] |
| 58 |
|
| 59 |
# EffectsGroup |
| 60 |
# description = "GOOD_SHIP_SHIELD_DESC" |
| 61 |
# scope = And [ |
| 62 |
# Source |
| 63 |
# Ship |
| 64 |
# ] |
| 65 |
# effects = SetMaxShield value = Value |
| 66 |
# + (0.5 * [[SHIP_SHIELD_FACTOR]] * (Statistic If condition = And [ Source DesignHasPart name = "SH_DEFENSE_GRID"])) |
| 67 |
# + (1.0 * [[SHIP_SHIELD_FACTOR]] * (Statistic If condition = And [ Source DesignHasPart name = "SH_DEFLECTOR"])) |
| 68 |
# + (1.5 * [[SHIP_SHIELD_FACTOR]] * (Statistic If condition = And [ Source DesignHasPart name = "SH_PLASMA"])) |
| 69 |
# + (2.0 * [[SHIP_SHIELD_FACTOR]] * (Statistic If condition = And [ Source DesignHasPart name = "SH_MULTISPEC"])) |
| 70 |
# + (2.5 * [[SHIP_SHIELD_FACTOR]] * (Statistic If condition = And [ Source DesignHasPart name = "SH_BLACK"])) |
| 71 |
# ''' |
| 72 |
|
| 73 |
# GREAT_SHIP_SHIELDS |
| 74 |
# '''[[STANDARD_SHIP_SHIELDS]] |
| 75 |
|
| 76 |
# EffectsGroup |
| 77 |
# description = "GREAT_SHIP_SHIELD_DESC" |
| 78 |
# scope = And [ |
| 79 |
# Source |
| 80 |
# Ship |
| 81 |
# ] |
| 82 |
# effects = SetMaxShield value = Value |
| 83 |
# + (1.0 * [[SHIP_SHIELD_FACTOR]] * (Statistic If condition = And [ Source DesignHasPart name = "SH_DEFENSE_GRID"])) |
| 84 |
# + (2.0 * [[SHIP_SHIELD_FACTOR]] * (Statistic If condition = And [ Source DesignHasPart name = "SH_DEFLECTOR"])) |
| 85 |
# + (3.0 * [[SHIP_SHIELD_FACTOR]] * (Statistic If condition = And [ Source DesignHasPart name = "SH_PLASMA"])) |
| 86 |
# + (4.0 * [[SHIP_SHIELD_FACTOR]] * (Statistic If condition = And [ Source DesignHasPart name = "SH_MULTISPEC"])) |
| 87 |
# + (5.0 * [[SHIP_SHIELD_FACTOR]] * (Statistic If condition = And [ Source DesignHasPart name = "SH_BLACK"])) |
| 88 |
# ''' |
| 89 |
|
| 90 |
# ULTIMATE_SHIP_SHIELDS |
| 91 |
# '''[[STANDARD_SHIP_SHIELDS]] |
| 92 |
|
| 93 |
# EffectsGroup |
| 94 |
# description = "ULTIMATE_SHIP_SHIELD_DESC" |
| 95 |
# scope = And [ |
| 96 |
# Source |
| 97 |
# Ship |
| 98 |
# ] |
| 99 |
# effects = SetMaxShield value = Value |
| 100 |
# + (1.5 * [[SHIP_SHIELD_FACTOR]] * (Statistic If condition = And [ Source DesignHasPart name = "SH_DEFENSE_GRID"])) |
| 101 |
# + (3.0 * [[SHIP_SHIELD_FACTOR]] * (Statistic If condition = And [ Source DesignHasPart name = "SH_DEFLECTOR"])) |
| 102 |
# + (4.5 * [[SHIP_SHIELD_FACTOR]] * (Statistic If condition = And [ Source DesignHasPart name = "SH_PLASMA"])) |
| 103 |
# + (6.0 * [[SHIP_SHIELD_FACTOR]] * (Statistic If condition = And [ Source DesignHasPart name = "SH_MULTISPEC"])) |
| 104 |
# + (7.5 * [[SHIP_SHIELD_FACTOR]] * (Statistic If condition = And [ Source DesignHasPart name = "SH_BLACK"])) |
| 105 |
# ''' |
| 106 |
|
| 107 |
# #include "../macros/misc.macros" |