| 1 |
from focs._effects import ( |
| 2 |
EffectsGroup, |
| 3 |
Full, |
| 4 |
HasSpecies, |
| 5 |
IsSource, |
| 6 |
OwnedBy, |
| 7 |
Planet, |
| 8 |
SetDetection, |
| 9 |
SetVisibility, |
| 10 |
Ship, |
| 11 |
Source, |
| 12 |
Unowned, |
| 13 |
Value, |
| 14 |
) |
| 15 |
from macros.priorities import DEFAULT_PRIORITY |
| 16 |
|
| 17 |
BAD_DETECTION = [ |
| 18 |
EffectsGroup( |
| 19 |
description="BAD_DETECTION_DESC", |
| 20 |
scope=IsSource, |
| 21 |
activation=~Ship, |
| 22 |
effects=SetDetection(value=Value - 20), |
| 23 |
), |
| 24 |
EffectsGroup(scope=IsSource, activation=Ship, effects=SetDetection(value=Value - 9)), |
| 25 |
] |
| 26 |
|
| 27 |
|
| 28 |
GOOD_DETECTION = [ |
| 29 |
EffectsGroup( |
| 30 |
description="GOOD_DETECTION_DESC", |
| 31 |
scope=IsSource, |
| 32 |
effects=SetDetection(value=Value + 25), |
| 33 |
), |
| 34 |
] |
| 35 |
|
| 36 |
GREAT_DETECTION = [ |
| 37 |
EffectsGroup( |
| 38 |
description="GREAT_DETECTION_DESC", |
| 39 |
scope=IsSource, |
| 40 |
effects=SetDetection(value=Value + 50), |
| 41 |
), |
| 42 |
] |
| 43 |
|
| 44 |
|
| 45 |
ULTIMATE_DETECTION = [ |
| 46 |
EffectsGroup( |
| 47 |
description="ULTIMATE_DETECTION_DESC", |
| 48 |
scope=IsSource, |
| 49 |
effects=SetDetection(value=Value + 100), |
| 50 |
) |
| 51 |
] |
| 52 |
|
| 53 |
|
| 54 |
def NATIVE_PLANETARY_DETECTION(detection): |
| 55 |
return EffectsGroup( |
| 56 |
scope=IsSource, |
| 57 |
activation=Planet() & Unowned, |
| 58 |
accountinglabel="NATIVE_PLANETARY_DETECTION_LABEL", |
| 59 |
priority=DEFAULT_PRIORITY, |
| 60 |
effects=SetDetection(value=Value + detection), |
| 61 |
) |
| 62 |
|
| 63 |
|
| 64 |
def COMMUNAL_VISION(species: str): |
| 65 |
return EffectsGroup( |
| 66 |
description="COMMUNAL_VISION_DESC", |
| 67 |
scope=Planet() |
| 68 |
& HasSpecies(name=[species]) |
| 69 |
& ~OwnedBy(empire=Source.Owner), # would be redundant to re-assign visbility to own planets |
| 70 |
activation=Planet() & ~Unowned, |
| 71 |
effects=SetVisibility(empire=Source.Owner, visibility=Full), |
| 72 |
) |