Advertisement
Guest User

Untitled

a guest
Aug 21st, 2014
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.01 KB | None | 0 0
  1. (function() {
  2. //Global Variables
  3. var header = "Lab Report";
  4. var rndResearch = 2;
  5. var hwResearch = 0;
  6. var company = GameManager.company
  7. var r = Research;
  8. var Checks = {};
  9.  
  10. // Checks - Required
  11. var checkForLabResearch = function(company) {
  12. if (!company.flags.rndLabUnlocked)
  13. return;
  14. var msg = "";
  15. if (!company.flags.bigProjectsResearchActiveShown)
  16. company.flags.bigProjectsResearchActiveShown = [];
  17. for (var i = 0; i < r.bigProjects.length; i++) {
  18. var project = r.bigProjects[i];
  19. if (project.canResearch(company) && company.flags.bigProjectsResearchActiveShown.indexOf(project.id) == -1) {
  20. company.flags.bigProjectsResearchActiveShown.push(project.id);
  21. msg += "\n" + project.name
  22. console.log("Big check executed successfully")
  23. }
  24. }
  25. if (msg.length > 0) {
  26. var notification =
  27. new Notification("R&D lab".localize(), "New research available:".localize() + " \n" + msg);
  28. company.notifications.push(notification)
  29. console.log("New research available notification pushed")
  30. }
  31. var checkLabResearchItem = function(testingapi) {
  32. if (!(Checks.checkPropertiesPresent(testingapi, ['id', 'name', 'pointsCost', 'iconUri', 'description', 'targetZone']) && Checks.checkUniqueness(testingapi, 'id', Research.bigProjects)) && testingapi.pointsCost <= 0)
  33. return false;
  34. console.log("Valid Lab Research Check Worked")
  35. return true;
  36.  
  37. };
  38. Research.bigProjects.push(testingapi);
  39. }
  40. //Checks for LabResearch objects - one for each
  41. //Format
  42. /*var checkLabResearchItem = function(labResearch) {
  43. if (!(Checks.checkPropertiesPresent(labResearch, ['id', 'name', 'pointsCost', 'iconUri', 'description', 'targetZone']) && Checks.checkUniqueness(labResearch, 'id', Research.bigProjects)) && labResearch.pointsCost <= 0)
  44. return false;
  45.  
  46. return true;
  47. }; */
  48.  
  49. /*GDT.addLabResearchItem = function(testingapi) {
  50. if (!checkLabResearchItem(testingapi))
  51. return;
  52.  
  53.  
  54. console.log("Added testingapi successfully")
  55. }; */
  56. //Call the checks
  57. checkForLabResearch();
  58. // LabResearches
  59. var iconTest = exGDT_FireChaos.modPath + '/images/researches/lab/gridOpp.png';
  60. var testingapi = {
  61. id: "test",
  62. name: "Testing API".localize(),
  63. pointsCost: 600,
  64. canResearch: function(company) {
  65. return company.researchCompleted.indexOf(r.testingapi) == -1
  66. },
  67. iconUri: iconTest,
  68. description: "The internet will change our lives forever. This project will investigate how we can use the internet to make better games and deliver better experiences. Completing this project should unlock new options for research.".localize(),
  69. targetZone: rndResearch,
  70. complete: function(company) {
  71. company.researchCompleted.push(r.testingapi);
  72. var msg = "After careful examination we come to the conclusion that the internet is a huge opportunity in the gaming industry. We already see some small signs how successful multiplayer games can be but multiplayer is usually an additional feature to a game and not the main focus.{n}We think we could develop technologies to create a massively multiplayer online game (short MMO), a game where tens of thousands of players can play together. To create such an MMO more research is necessary.{n}The second discovery is that we could start developing an online distribution platform. Instead of players buying games in local stores they could download games directly from our servers. This would cut out the middle man and we could gain a large share of the market and additional income to fund our developments.".localize();
  73. var notification = new Notification(header, msg);
  74. company.notifications.push(notification)
  75. }
  76. };
  77. })
  78. /*
  79. //GRID Opportunities Specific
  80. var canResearchGRIDItems = false;
  81. var gridOppID = "exGDT_gridopportunities";
  82. var msggo = "And the results are in! We can now research engine parts such as GRID Trading, GRID Workshop, GRID Cloud Support and more! Our fans will be happy that our GRID platform is extended!".localize();
  83.  
  84. //GRID Opportunities
  85. a.gridOpp = {
  86. id: gridOppID,
  87. name: "GRID Opportunities".localize(),
  88. pointsCost: 1900,
  89. targetZone: rndResearch,
  90. canResearch: function (company) {
  91. company.researchCompleted.push(a.grid)
  92. }
  93. iconUri: "./mods/ExtendedGDT/images/researches/lab/gridOpp.png",
  94. description: "We have Researched our GRID Platform. Let's expand its features and see what we can do. We can allow Trading or a Workshop between players!".localize(),
  95. complete: function() {
  96. company.notifications.push(new Notification({
  97. header: header
  98. text: msggo
  99. image ""
  100. }))
  101. canResearchGRIDItems = true
  102. company.researchCompleted.push(r.grid)
  103. exGDT.addResearchItem(
  104. {
  105. id: "exGDT_gridtrading",
  106. name: "GRID Trading".localize(),
  107. v: 6,
  108. canResearch: function (company) {
  109. return canResearchGRIDItems;
  110. },
  111. category: "GRID",
  112. categoryDisplayName: "GRID"
  113. });
  114. exGDT.addResearchItem(
  115. {
  116. id: "exGDT_gridworkshop",
  117. name: "GRID Workshop".localize(),
  118. v: 6,
  119. canResearch: function (company) {
  120. return canResearchGRIDItems;
  121. },
  122. category: "GRID",
  123. categoryDisplayName: "GRID"
  124. });
  125. exGDT.addResearchItem(
  126. {
  127. id: "exGDT_gridservers",
  128. name: "GRID Servers".localize(),
  129. v: 6,
  130. canResearch: function (company) {
  131. return canResearchGRIDItems;
  132. },
  133. category: "GRID",
  134. categoryDisplayName: "GRID"
  135. });
  136. exGDT.addResearchItem(
  137. {
  138. id: "exGDT_gac",
  139. name: "Grid Anti-Cheat".localize(),
  140. v: 6,
  141. canResearch: function (company) {
  142. return canResearchGRIDItems;
  143. },
  144. category: "GRID",
  145. categoryDisplayName: "GRID"
  146. });
  147. exGDT.addResearchItem(
  148. {
  149. id: "exGDT_gridtrading",
  150. name: "GRID Trading".localize(),
  151. v: 6,
  152. canResearch: function (company) {
  153. return canResearchGRIDItems;
  154. },
  155. category: "GRID",
  156. categoryDisplayName: "GRID"
  157. });
  158. exGDT.addResearchItem(
  159. {
  160. id: "exGDT_gridleaderboards",
  161. name: "GRID Leaderboards".localize(),
  162. v: 6,
  163. canResearch: function (company) {
  164. return canResearchGRIDItems;
  165. },
  166. category: "GRID",
  167. categoryDisplayName: "GRID"
  168. });
  169. exGDT.addResearchItem(
  170. {
  171. id: "exGDT_gridtradingcards",
  172. name: "GRID Trading Cards".localize(),
  173. v: 2,
  174. canResearch: function (company) {
  175. return canResearchGRIDItems;
  176. },
  177. category: "GRID",
  178. categoryDisplayName: "GRID"
  179. });
  180. exGDT.addResearchItem(
  181. {
  182. id: "exGDT_includegriddemo",
  183. name: "Include GRID Demo".localize(),
  184. v: 4,
  185. canResearch: function (company) {
  186. return canResearchGRIDItems;
  187. },
  188. category: "GRID",
  189. categoryDisplayName: "GRID"
  190. });
  191. exGDT.addResearchItem(
  192. {
  193. id: "exGDT_gridoptimization",
  194. name: "GRID Optimization".localize(),
  195. v: 6,
  196. canResearch: function (company) {
  197. return canResearchGRIDItems;
  198. },
  199. category: "GRID",
  200. categoryDisplayName: "GRID"
  201. });
  202. exGDT.addResearchItem(
  203. {
  204. id: "exGDT_gridcloudsupport",
  205. name: "GRID Cloud Support".localize(),
  206. v: 6,
  207. canResearch: function (company) {
  208. return canResearchGRIDItems;
  209. },
  210. category: "GRID",
  211. categoryDisplayName: "GRID"
  212. });
  213. exGDT.addResearchItem(
  214. {
  215. id: "exGDT_gridscreenshots",
  216. name: "GRID Screenshots".localize(),
  217. v: 4,
  218. canResearch: function (company) {
  219. return canResearchGRIDItems;
  220. },
  221. category: "GRID",
  222. categoryDisplayName: "GRID"
  223. });
  224. exGDT.addResearchItem(
  225. {
  226. id: "exGDT_gridmarket",
  227. name: "GRID Market".localize(),
  228. v: 6,
  229. canResearch: function (company) {
  230. return canResearchGRIDItems;
  231. },
  232. category: "GRID",
  233. categoryDisplayName: "GRID"
  234. });
  235. }
  236. }
  237. })();
  238. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement