File: PSY_DOM.focs.py

package info (click to toggle)
freeorion 0.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 194,940 kB
  • sloc: cpp: 186,508; python: 40,969; ansic: 1,164; xml: 719; makefile: 32; sh: 7
file content (74 lines) | stat: -rw-r--r-- 2,381 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
from focs._effects import (
    ContainedBy,
    Contains,
    EffectsGroup,
    Focus,
    GenerateSitRepMessage,
    HasTag,
    Monster,
    OwnedBy,
    OwnerHasTech,
    Planet,
    Random,
    SetOwner,
    Ship,
    Source,
    System,
    Target,
    VisibleToEmpire,
)
from focs._tech import *
from macros.base_prod import TECH_COST_MULTIPLIER

Tech(
    name="LRN_PSY_DOM",
    description="LRN_PSY_DOM_DESC",
    short_description="MIND_CONTROL_SHORT_DESC",
    category="LEARNING_CATEGORY",
    researchcost=1050 * TECH_COST_MULTIPLIER,
    researchturns=7,
    tags=["PEDIA_LEARNING_CATEGORY"],
    prerequisites=["LRN_UNIF_CONC", "LRN_TIME_MECH"],
    effectsgroups=[
        EffectsGroup(
            scope=Ship
            & ~OwnedBy(empire=Source.Owner)
            & VisibleToEmpire(empire=Source.Owner)
            & Random(probability=0.1)
            & ~Monster
            &
            # @content_tag{TELEPATHIC} For ships with this tag, prevents chance of ownership loss to suitable planet
            ~HasTag(name="TELEPATHIC")
            & ~OwnerHasTech(name="LRN_PSY_DOM")
            & ContainedBy(
                System
                & Contains(
                    Planet()
                    & OwnedBy(empire=Source.Owner)
                    &
                    # @content_tag{TELEPATHIC} On owned planet with focus FOCUS_DOMINATION and this tag, chance of taking ownership of suitable ships
                    HasTag(name="TELEPATHIC")
                    & Focus(type=["FOCUS_DOMINATION"])
                )
            ),
            effects=[
                GenerateSitRepMessage(
                    message="EFFECT_PSY_DOM",
                    label="EFFECT_PSY_DOM_LABEL",
                    icon="icons/sitrep/ship_produced.png",
                    parameters={"empire": Target.Owner, "ship": Target.ID},
                    empire=Target.Owner,
                ),
                GenerateSitRepMessage(
                    message="EFFECT_PSY_DOM",
                    label="EFFECT_PSY_DOM_LABEL",
                    icon="icons/sitrep/ship_produced.png",
                    parameters={"empire": Target.Owner, "ship": Target.ID},
                    empire=Source.Owner,
                ),
                SetOwner(empire=Source.Owner),
            ],
        )
    ],
    graphic="icons/tech/psychogenic_domination.png",
)