Debian Codegraph @

default/scripting/techs/ship_parts/damage_control/SHP_FLEET_REPAIR.focs.py

raw
1 from focs._effects import (
2 AllyOf,
3 EffectsGroup,
4 EmpireHasAdoptedPolicy,
5 InSystem,
6 IsSource,
7 LocalCandidate,
8 OwnedBy,
9 ResourceSupplyConnected,
10 SetStructure,
11 Ship,
12 Source,
13 Stationary,
14 Structure,
15 Target,
16 Turn,
17 Value,
18 )
19 from focs._tech import *
20 from macros.base_prod import TECH_COST_MULTIPLIER
21
22 Tech(
23 name="SHP_FLEET_REPAIR",
24 description="SHP_FLEET_REPAIR_DESC",
25 short_description="SHIP_REPAIR_DESC",
26 category="SHIP_PARTS_CATEGORY",
27 researchcost=130 * TECH_COST_MULTIPLIER,
28 researchturns=10,
29 tags=["PEDIA_DAMAGE_CONTROL_PART_TECHS"],
30 prerequisites=["SHP_INTSTEL_LOG", "SHP_BASIC_DAM_CONT"],
31 effectsgroups=[
32 EffectsGroup(
33 scope=Ship
34 & InSystem()
35 & Stationary
36 & (
37 OwnedBy(empire=Source.Owner)
38 |
39 # either ally providing repair or owner of ship beign repaired must adopt policy to share repairs
40 (
41 EmpireHasAdoptedPolicy(empire=Source.Owner, name="PLC_ALLIED_REPAIR")
42 | EmpireHasAdoptedPolicy(empire=LocalCandidate.Owner, name="PLC_ALLIED_REPAIR")
43 )
44 & OwnedBy(affiliation=AllyOf, empire=Source.Owner)
45 )
46 & Turn(low=LocalCandidate.System.LastTurnBattleHere + 1)
47 & Structure(high=LocalCandidate.MaxStructure - 0.001)
48 & ResourceSupplyConnected(empire=Source.Owner, condition=IsSource),
49 stackinggroup="FLEET_REPAIR",
50 effects=SetStructure(value=Value + (Target.MaxStructure / 10)),
51 )
52 ],
53 graphic="icons/tech/fleet_field_repair.png",
54 )