Debian Codegraph @

default/scripting/species/species_macros/supply.py

raw
1 from focs._effects import (
2 CurrentTurn,
3 EffectsGroup,
4 IsSource,
5 LocalCandidate,
6 MinOf,
7 Planet,
8 SetMaxSupply,
9 SetSupply,
10 Target,
11 Value,
12 )
13 from macros.priorities import AFTER_ALL_TARGET_MAX_METERS_PRIORITY
14
15 STANDARD_SUPPLY_GROWTH = EffectsGroup( # increase 1 per turn, up to max
16 scope=IsSource,
17 activation=Planet()
18 & (LocalCandidate.LastTurnConquered < CurrentTurn)
19 & (LocalCandidate.LastTurnAttackedByShip < CurrentTurn),
20 priority=AFTER_ALL_TARGET_MAX_METERS_PRIORITY,
21 effects=SetSupply(value=MinOf(float, Value(Target.MaxSupply), Value + 1)),
22 )
23
24
25 VERY_BAD_SUPPLY = [
26 EffectsGroup(
27 description="VERY_BAD_SUPPLY_DESC",
28 scope=IsSource,
29 activation=Planet(),
30 accountinglabel="VERY_BAD_SUPPLY_LABEL",
31 effects=SetMaxSupply(value=Value - 1),
32 ),
33 STANDARD_SUPPLY_GROWTH,
34 ]
35
36
37 BAD_SUPPLY = [
38 EffectsGroup(
39 description="BAD_SUPPLY_DESC",
40 scope=IsSource,
41 activation=Planet(),
42 accountinglabel="BAD_SUPPLY_LABEL",
43 effects=SetMaxSupply(value=Value + 0),
44 ),
45 STANDARD_SUPPLY_GROWTH,
46 ]
47
48
49 AVERAGE_SUPPLY = [
50 EffectsGroup(
51 scope=IsSource,
52 activation=Planet(),
53 accountinglabel="AVERAGE_SUPPLY_LABEL",
54 effects=SetMaxSupply(value=Value + 1),
55 ),
56 STANDARD_SUPPLY_GROWTH,
57 ]
58
59 GREAT_SUPPLY = [
60 EffectsGroup(
61 description="GREAT_SUPPLY_DESC",
62 scope=IsSource,
63 activation=Planet(),
64 accountinglabel="GREAT_SUPPLY_LABEL",
65 effects=SetMaxSupply(value=Value + 2),
66 ),
67 STANDARD_SUPPLY_GROWTH,
68 ]
69
70 ULTIMATE_SUPPLY = [
71 EffectsGroup(
72 description="ULTIMATE_SUPPLY_DESC",
73 scope=IsSource,
74 activation=Planet(),
75 accountinglabel="ULTIMATE_SUPPLY_LABEL",
76 effects=SetMaxSupply(value=Value + 3),
77 ),
78 STANDARD_SUPPLY_GROWTH,
79 ]