-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathKerbalAcademyFieldScience.cfg
144 lines (122 loc) · 4.37 KB
/
KerbalAcademyFieldScience.cfg
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
CONTRACT_TYPE
{
name = KerbalAcademyFieldScience
title = Kerbal Academy: Field Science
group = KerbalAcademy
description = It seems that @/trainee is ready to improve their scientific knowledge. A training simulation has been proposed.
genericDescription = One of our scientists is ready to improve their scientific knowledge. Complete the mission and they will advance a level.
synopsis = Complete the training mission with @/trainee .
completedMessage = Mission Success! @/trainee is feeling more experienced already.
agent = Kerbal Academy
minExpiry = 1
maxExpiry = 7
cancellable = true
maxSimultaneous = 1
declinable = true
prestige = Significant
targetBody = HomeWorld()
rewardScience = 0.0
rewardReputation = 0.0
rewardFunds = 0
failureReputation = 0
failureFunds = 0
advanceFunds = @/trainingCost
DATA
{
type = Kerbal
uniquenessCheck = CONTRACT_ACTIVE
mentor = AllKerbals().Where(m => m.ExperienceTrait() == Scientist && m.ExperienceLevel()>=2 && m.Type() == Crew && m.RosterStatus() == Available).Random()
trainee = AllKerbals().Where(m => m.ExperienceTrait() == Scientist && m.Type() == Crew && m.RosterStatus() == Available && m.ExperienceLevel()>0 && m.ExperienceLevel()<5).Random()
title = Must have a scientist who is level 1 or higher.
}
DATA
{
type = int
levelGain = @/mentor.ExperienceLevel() - @/trainee.ExperienceLevel()
newLevel = Random(1, @/mentor.ExperienceLevel()-1)
mentorLevel = @/trainee.ExperienceLevel()+1
hidden = true
}
DATA
{
type = List<Kerbal>
requiredValue = false
aliveKerbals = AllKerbals().Where(a => a.RosterStatus() == Available || a.RosterStatus() == Assigned)
mentorList = @aliveKerbals.Where(m => m.ExperienceTrait() == Scientist && m.Type() == Crew && m.ExperienceLevel() > @/mentorLevel)
}
DATA
{
type = double
rewardMultiplier = Random(@/newLevel, @/levelGain)
trainingCost = @/rewardMultiplier*-100000
expAward = @newLevel == 5 ? 32 : @newLevel == 4 ? 16 : @newLevel == 3 ? 8 : @newLevel == 2 ? 6 : 2
hidden = true
}
DATA
{
type = List<CelestialBody>
requiredValue = false
notKerbin = AllBodies().Where(b=> b.IsHomeWorld())
notMoon = HomeWorld().Children()
l5Body1 = OrbitedBodies().ExcludeAll(@notKerbin)
l5BodyList = @/l5Body1.ExcludeAll(@notMoon)
}
DATA
{
type = CelestialBody
requiredValue = false
orbited = OrbitedBodies().Where(b => !b.IsHomeWorld()).Random()
landed = LandedBodies().Where(b => !b.IsHomeWorld()).Random()
l5Bodies = @/l5BodyList.Random()
}
DATA
{
type = List<Biome>
requiredValue = false
KSC = KSCBiomes().ExcludeAll(MainKSCBiomes())
HomeBiomeList = HomeWorld().Biomes().Where(r => r.RemainingScience() >= Science())
L2BiomeList = @/HomeBiomeList.ExcludeAll(@KSC)
L3BiomeList = @/orbited.Biomes().Where(r => r.RemainingScience() >= Science())
L4BiomeList = @/landed.Biomes().Where(r => r.RemainingScience() >= Science())
L5BiomeList = @/l5Bodies.Biomes().Where(r => r.RemainingScience() >= Science())
}
DATA
{
type = Biome
biome = @/newLevel == 5 ? @/L5BiomeList.Random() : @/newLevel == 4 ? @/L4BiomeList.Random() : @/newLevel == 3 ? @/L3BiomeList.Random() : @/L2BiomeList.Random()
hidden = true
}
DATA
{
type = ScienceSubject
experiment = AllScienceSubjectsByBiome([@biome]).Where(e => e.RemainingScience() >0).Random()
title = Must have an experiment available which meets the training courses requirements.
}
BEHAVIOUR
{
name = AwardExperience
type = AwardExperience
kerbal = @/trainee
experience = @/expAward
}
PARAMETER
{
name = HasCrew
type = HasCrew
kerbal = @/trainee
}
PARAMETER
{
name = CollectScience
type = CollectScience
subject = @/experiment
recoveryMethod = None
}
REQUIREMENT
{
name = Expression
type = Expression
expression = (@/trainee.RosterStatus() == Available && @/trainee.ExperienceTrait() == Scientist && @/trainee.ExperienceLevel() < @/newLevel)
title = Scientist must be eligible for the Advanced Program (if this fails, but a valid trainee is found, they are eligible for Scientific Principles)
}
}