Advertisement
Guest User

Untitled

a guest
Dec 16th, 2016
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.07 KB | None | 0 0
  1. CONTRACT_TYPE
  2. {
  3. name = KLOSat
  4. group = SCORE_Satellites
  5.  
  6. DATA_EXPAND
  7. {
  8. type = int
  9. index = [0, 1, 2]
  10. }
  11.  
  12. BEHAVIOUR
  13. {
  14. name = OrbitGenerator
  15. type = OrbitGenerator
  16.  
  17. FIXED_ORBIT
  18. {
  19. ORBIT
  20. {
  21. SMA = (Prestige() == Trivial ? Random(50000, 200000) : (Prestige() == Significant ? Random(200000, 1000000) : Random(1000000, 10000000))) + @/targetBody.Radius() + @/targetBody.AtmosphereAltitude()
  22. ECC = Prestige() == Trivial ? Random(0, 0.05) : (Prestige() == Significant ? Random(0, 0.1) : Random(0, 0.3))
  23. INC = Prestige() == Trivial ? 0 : (Prestige() == Significant ? Random(-30, 30) : Random(-90, 90))
  24. LPE = Random(-180, 180)
  25. LAN = Random(-180, 180)
  26. MNA = 0
  27. EPH = 0
  28. REF = 1
  29. }
  30.  
  31. deviationWindow = Prestige() == Trivial ? 10 : (Prestige() == Significant ? 5 : 2.5)
  32. }
  33. }
  34.  
  35. DATA
  36. {
  37. type = AvailablePart
  38. thermometer = AvailablePart(sensorThermometer)
  39. barometer = AvailablePart(sensorBarometer)
  40. gravimeter = AvailablePart(sensorGravimeter)
  41. accelerometer = AvailablePart(sensorAccelerometer)
  42. goo = AvailablePart(GooExperiment)
  43. materialBay = AvailablePart(science_module)
  44. }
  45.  
  46. DATA
  47. {
  48. type = int
  49.  
  50. partMultipler = Prestige() == Trivial ? 1 : (Prestige() == Significant ? 2 : 3)
  51. partMultipler2 = @partMultipler * @partMultipler
  52.  
  53. t1 = Random(0, 4)
  54. t2 = Random(0, 4)
  55. t3 = Random(0, 4)
  56. t4 = Random(0, 4)
  57. t5 = Random(0, 10)
  58. t6 = Random(0, 10)
  59.  
  60. hasThermometer = @/thermometer.IsUnlocked() ? (@t1 < @partMultipler ? 1 : 0) : 0
  61. hasBarometer = @/barometer.IsUnlocked() ? (@t2 < @partMultipler ? 1 : 0) : 0
  62. hasGravimeter = @/gravimeter.IsUnlocked() ? (@t3 < @partMultipler ? 1 : 0) : 0
  63. hasAccelerometer = @/accelerometer.IsUnlocked() ? (@t4 < @partMultipler ? 1 : 0) : 0
  64. hasGoo = @/goo.IsUnlocked() ? (@t5 < @partMultipler2 ? 1 : 0) : 0
  65. hasMaterialBay = @/materialBay.IsUnlocked() ? (@t6 < @partMultipler2 ? 1 : 0) : 0
  66.  
  67. thermometerCost = @hasThermometer * @/thermometer.Cost()
  68. barometerCost = @hasBarometer * @/barometer.Cost()
  69. gravimeterCost = @hasGravimeter * @/gravimeter.Cost()
  70. accelerometerCost = @hasAccelerometer * @/accelerometer.Cost()
  71. gooCost = @hasGoo * @/goo.Cost()
  72. materialBayCost = @hasMaterialBay * @/materialBay.Cost()
  73.  
  74. totalExtraCost = @thermometerCost + @barometerCost + @gravimeterCost + @accelerometerCost + @gooCost + @materialBayCost
  75. }
  76.  
  77. DATA
  78. {
  79. type = int
  80. deadline_days = Prestige() == Exceptional ? 15 : (Prestige() == Significant ? 30 : 60)
  81. }
  82.  
  83. title = Put a satellite onto a specific orbit of @targetBody.
  84. description = We hope to put a satellite onto a specific orbit of @targetBody for scientific and communication purposes.
  85.  
  86. genericTitle = Put a satellite onto a specific orbit of our planet.
  87. genericDescription = We hope to put a satellite onto a specific orbit of our planet for scientific and communication purposes.
  88.  
  89. synopsis = Put a satellite onto a specific orbit of @targetBody.
  90. completedMessage = Mission accomplished! The satellite is working well and moving.
  91.  
  92. maxSimultaneous = 1
  93.  
  94. minExpiry = 3
  95. maxExpiry = 5
  96.  
  97. deadline = @/deadline_days * 2 * Random(0.9, 1.1)
  98.  
  99. prestige = @d_prestige
  100.  
  101. targetBody = HomeWorld()
  102.  
  103. advanceFunds = 24000 * Random(0.9, 1.1) + @/totalExtraCost * 1.1
  104. rewardFunds = 48000 * Random(0.9, 1.1) + @/totalExtraCost * 2.2
  105. rewardReputation = 5.33 * Random(0.9, 1.1)
  106. rewardScience = 10.67 * Random(0.9, 1.1)
  107. failureFunds = 12000 * Random(0.9, 1.1) + @/totalExtraCost * 0.55
  108. failureReputation = 24 * Random(0.9, 1.1)
  109.  
  110. PARAMETER
  111. {
  112. name = VesselParameterGroup
  113. type = VesselParameterGroup
  114.  
  115. duration = Round(Random(6d, 18d), 1d)
  116.  
  117. defineList = SCORE_KLOSat
  118.  
  119. PARAMETER
  120. {
  121. name = NewVessel
  122. type = NewVessel
  123. }
  124.  
  125. PARAMETER
  126. {
  127. name = HasCrewCapacity
  128. type = HasCrewCapacity
  129.  
  130. maxCapacity = 0
  131. }
  132.  
  133. PARAMETER
  134. {
  135. name = hasAntenna
  136. type = PartValidation
  137.  
  138. partModuleType = Antenna
  139.  
  140. minCount = 1
  141.  
  142. title = The vessel must have an antenna
  143. }
  144.  
  145. PARAMETER
  146. {
  147. name = hasPanels
  148. type = PartValidation
  149.  
  150. partModule = ModuleDeployableSolarPanel
  151.  
  152. minCount = 1
  153.  
  154. title = The vessel must have solar panels.
  155. }
  156.  
  157. PARAMETER
  158. {
  159. name = ReachSpecificOrbit
  160. type = ReachSpecificOrbit
  161.  
  162. index = 0
  163.  
  164. deviationWindow = Prestige() == Trivial ? 10 : (Prestige() == Significant ? 5 : 2.5)
  165. }
  166.  
  167. PARAMETER
  168. {
  169. name = NeedThermometer
  170. type = PartValidation
  171.  
  172. part = @/thermometer
  173.  
  174. minCount = 1
  175.  
  176. REQUIREMENT
  177. {
  178. name = checkVarNeedThermometer
  179. type = Expression
  180.  
  181. expression = @/hasThermometer == 1
  182. }
  183. }
  184.  
  185. PARAMETER
  186. {
  187. name = NeedBarometer
  188. type = PartValidation
  189.  
  190. part = @/barometer
  191.  
  192. minCount = 1
  193.  
  194. REQUIREMENT
  195. {
  196. name = checkVarNeedBarometer
  197. type = Expression
  198.  
  199. expression = @/hasBarometer == 1
  200. }
  201. }
  202.  
  203. PARAMETER
  204. {
  205. name = NeedGravimeter
  206. type = PartValidation
  207.  
  208. part = @/gravimeter
  209.  
  210. minCount = 1
  211.  
  212. REQUIREMENT
  213. {
  214. name = checkVarNeedGravimeter
  215. type = Expression
  216.  
  217. expression = @/hasGravimeter == 1
  218. }
  219. }
  220.  
  221. PARAMETER
  222. {
  223. name = NeedAccelerometer
  224. type = PartValidation
  225.  
  226. part = @/accelerometer
  227.  
  228. minCount = 1
  229.  
  230. REQUIREMENT
  231. {
  232. name = checkVarNeedAccelerometer
  233. type = Expression
  234.  
  235. expression = @/hasAccelerometer == 1
  236. }
  237. }
  238.  
  239. PARAMETER
  240. {
  241. name = NeedGoo
  242. type = PartValidation
  243.  
  244. part = @/goo
  245.  
  246. minCount = 1
  247.  
  248. REQUIREMENT
  249. {
  250. name = checkVarNeedGoo
  251. type = Expression
  252.  
  253. expression = @/hasGoo == 1
  254. }
  255. }
  256.  
  257. PARAMETER
  258. {
  259. name = NeedMaterialBay
  260. type = PartValidation
  261.  
  262. part = @/materialBay
  263.  
  264. minCount = 1
  265.  
  266. REQUIREMENT
  267. {
  268. name = checkVarNeedMaterialBay
  269. type = Expression
  270.  
  271. expression = @/hasMaterialBay == 1
  272. }
  273. }
  274. }
  275.  
  276. REQUIREMENT
  277. {
  278. name = HasAntennaUnlocked
  279. type = PartModuleTypeUnlocked
  280.  
  281. partModuleType = Antenna
  282. }
  283.  
  284. REQUIREMENT
  285. {
  286. name = Orbit
  287. type = Orbit
  288. }
  289.  
  290. DATA
  291. {
  292. type = int
  293. rng = Random(1, 100)
  294. rng2 = Random(1, 100)
  295.  
  296. t_p1 = (Reputation() - -400) / 10
  297. t_p2 = (Reputation() - 100) / 10
  298.  
  299. t_pres = @rng < @t_p2 ? 3 : (@rng < @t_p1 ? 2 : 1)
  300. }
  301.  
  302. DATA
  303. {
  304. type = ContractPrestige
  305. d_prestige = @/t_pres == 1 ? Trivial : (@/t_pres == 2 ? Significant : Exceptional)
  306. }
  307.  
  308. DATA
  309. {
  310. type = int
  311. reputationReq = Prestige() == Trivial ? -900 : (Prestige() == Significant ? -400 : 100)
  312. }
  313.  
  314. REQUIREMENT
  315. {
  316. name = Reputation
  317. type = Reputation
  318.  
  319. minReputation = @/reputationReq
  320.  
  321. title = Agency must be reputable.
  322. }
  323.  
  324. DATA
  325. {
  326. type = int
  327. thr = Min((Reputation() - @/reputationReq) / 10, @/index * 50 + 50) - ($SCORE_Progress - 5) * 20
  328. }
  329.  
  330. REQUIREMENT
  331. {
  332. name = rngCheck
  333. type = Expression
  334.  
  335. expression = @SCORE_Satellites:rng2 < @/thr
  336. checkOnActiveContract = false
  337.  
  338. title = The RNG must like you.
  339. }
  340.  
  341. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement