Debian Codegraph @

test-scripting/species/species_macros/research.py

raw
1 from macros.base_prod import RESEARCH_PER_POP
2 from macros.priorities import (
3 TARGET_AFTER_SCALING_PRIORITY,
4 TARGET_EARLY_BEFORE_SCALING_PRIORITY,
5 TARGET_SCALING_PRIORITY,
6 )
7
8 try:
9 from focs._effects import (
10 EffectsGroup,
11 Focus,
12 GalaxyMaxAIAggression,
13 Happiness,
14 IsHuman,
15 IsSource,
16 Planet,
17 SetTargetResearch,
18 Target,
19 Value,
20 )
21 except ModuleNotFoundError:
22 pass
23
24 from macros.multiplier import BAD_MULTIPLIER
25
26 # NO_RESEARCH
27 # '''[[DESCRIPTION_EFFECTSGROUP_MACRO(NO_RESEARCH_DESC)]]'''
28
29 BASIC_RESEARCH = [
30 EffectsGroup(
31 scope=IsSource,
32 activation=Planet() & Focus(type=["FOCUS_RESEARCH"]) & Happiness(low=0),
33 accountinglabel="FOCUS_RESEARCH_LABEL",
34 priority=TARGET_EARLY_BEFORE_SCALING_PRIORITY,
35 effects=SetTargetResearch(value=Value + Target.Population * RESEARCH_PER_POP),
36 ),
37 EffectsGroup( # gives human bonuses when AI Aggression set to Beginner
38 scope=IsSource,
39 activation=Planet() & IsHuman & (GalaxyMaxAIAggression == 0), # human player, not human species
40 accountinglabel="DIFFICULTY",
41 priority=TARGET_AFTER_SCALING_PRIORITY,
42 effects=SetTargetResearch(value=Value * 2),
43 ),
44 ]
45
46 # VERY_BAD_RESEARCH
47 # '''[[BASIC_RESEARCH]]
48
49 # EffectsGroup
50 # description = "VERY_BAD_RESEARCH_DESC"
51 # scope = Source
52 # activation = And [
53 # Planet
54 # Focus type = "FOCUS_RESEARCH"
55 # ]
56 # accountinglabel = "VERY_BAD_RESEARCH_LABEL"
57 # priority = [[TARGET_SCALING_PRIORITY]]
58 # effects = SetTargetResearch value = Value*[[VERY_BAD_MULTIPLIER]]
59 # '''
60
61 BAD_RESEARCH = [
62 *BASIC_RESEARCH,
63 EffectsGroup(
64 description="BAD_RESEARCH_DESC",
65 scope=IsSource,
66 activation=Planet() & Focus(type=["FOCUS_RESEARCH"]),
67 accountinglabel="BAD_RESEARCH_LABEL",
68 priority=TARGET_SCALING_PRIORITY,
69 effects=SetTargetResearch(value=Value * BAD_MULTIPLIER),
70 ),
71 ]
72
73 # AVERAGE_RESEARCH
74 # '''[[BASIC_RESEARCH]]
75 # '''
76
77 # GOOD_RESEARCH
78 # '''[[BASIC_RESEARCH]]
79
80 # EffectsGroup
81 # description = "GOOD_RESEARCH_DESC"
82 # scope = Source
83 # activation = And [
84 # Planet
85 # Focus type = "FOCUS_RESEARCH"
86 # Happiness low = 2
87 # ]
88 # accountinglabel = "GOOD_RESEARCH_LABEL"
89 # priority = [[TARGET_SCALING_PRIORITY]]
90 # effects = SetTargetResearch value = Value*[[GOOD_MULTIPLIER]]
91 # '''
92
93 # GREAT_RESEARCH
94 # '''[[BASIC_RESEARCH]]
95
96 # EffectsGroup
97 # description = "GREAT_RESEARCH_DESC"
98 # scope = Source
99 # activation = And [
100 # Planet
101 # Focus type = "FOCUS_RESEARCH"
102 # Happiness low = 0
103 # ]
104 # accountinglabel = "GREAT_RESEARCH_LABEL"
105 # priority = [[TARGET_SCALING_PRIORITY]]
106 # effects = SetTargetResearch value = Value*[[GREAT_MULTIPLIER]]
107 # '''
108
109 # ULTIMATE_RESEARCH
110 # '''[[BASIC_RESEARCH]]
111
112 # EffectsGroup
113 # description = "ULTIMATE_RESEARCH_DESC"
114 # scope = Source
115 # activation = And [
116 # Planet
117 # Focus type = "FOCUS_RESEARCH"
118 # ]
119 # accountinglabel = "ULTIMATE_RESEARCH_LABEL"
120 # priority = [[TARGET_SCALING_PRIORITY]]
121 # effects = SetTargetResearch value = Value*[[ULTIMATE_MULTIPLIER]]
122 # '''