The3vilM0nk3y

Monopoly

Aug 15th, 2017 (edited)
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 31.92 KB | None | 0 0
  1. -- Country Info
  2. function onLoad()
  3. tColor = {1,1,1}
  4. contReference = {
  5. alaska = "nAmerica",
  6. northwestterritory = "nAmerica",
  7. greenland = "nAmerica",
  8. alberta = "nAmerica",
  9. ontario = "nAmerica",
  10. quebec = "nAmerica",
  11. westernunitedstates = "nAmerica",
  12. easternunitedstates = "nAmerica",
  13. centralamerica = "nAmerica",
  14. venezuela = "sAmerica",
  15. brazil = "sAmerica",
  16. peru = "sAmerica",
  17. argentina = "sAmerica",
  18. iceland = "europe",
  19. scandinavia = "europe",
  20. ukrane = "europe",
  21. greatbritain = "europe",
  22. northerneurope = "europe",
  23. westerneurope = "europe",
  24. southerneurope = "europe",
  25. northafrica = "africa",
  26. egypt = "africa",
  27. eastafrica = "africa",
  28. congo = "africa",
  29. madagascar = "africa",
  30. southafrica = "africa",
  31. ural = "asia",
  32. siberia = "asia",
  33. yakutsk = "asia",
  34. kamchatka = "asia",
  35. irkutsk = "asia",
  36. mongolia = "asia",
  37. japan = "asia",
  38. afghanistan = "asia",
  39. china = "asia",
  40. middleeast = "asia",
  41. india = "asia",
  42. siam = "asia",
  43. indonesia = "australia",
  44. newguinea = "australia",
  45. westernaustralia = "australia",
  46. easternaustralia = "australia",
  47. }
  48. continents = {
  49. nAmerica = {
  50. alaska = {
  51. borders = {"northwestterritory","alberta","kamchatka"},
  52. owner = "test",
  53. units = 0,
  54. buttonindex = 0,
  55. button = {
  56. index = 0, click_function = 'alaska', function_owner = self,
  57. label = 'Alaska', position = {x = -1.2, y = 0.94, z = -0.62}, rotation = {x = 0, y = 0, z = 0},
  58. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  59. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}
  60. }
  61. },
  62. northwestterritory = {
  63. borders = {"alaska","alberta","ontario","greenland"},
  64. owner = nil,
  65. units = 0,
  66. buttonindex = 1,
  67. button = {
  68. index = 1, click_function = 'northwestterritory', function_owner = self,
  69. label = 'North West Territory', position = {x = -0.94, y = 0.94, z = -0.62}, rotation = {x = 0, y = 0, z = 0},
  70. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  71. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}
  72. }
  73. },
  74. greenland = {
  75. borders = {"northwestterritory","ontario","quebec","iceland"},
  76. owner = nil,
  77. units = 0,
  78. buttonindex = 2,
  79. button = {
  80. index = 2, click_function = 'greenland', function_owner = self,
  81. label = 'Greenland', position = {x = -0.41, y = 0.94, z = -0.72}, rotation = {x = 0, y = 0, z = 0},
  82. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  83. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}
  84. }
  85. },
  86. alberta = {
  87. borders = {"alaska","northwestterritory","ontario","westernunitedstates"},
  88. owner = nil,
  89. units = 0,
  90. buttonindex = 3,
  91. button = {
  92. index = 3, click_function = 'alberta', function_owner = self,
  93. label = 'Alberta', position = {x = -0.96, y = 0.94, z = -0.47}, rotation = {x = 0, y = 0, z = 0},
  94. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  95. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}
  96. }
  97. },
  98. ontario = {
  99. borders = {"northwestterritory","alberta","westernunitedstates","easternunitedstates","quebec","greenland"},
  100. owner = nil,
  101. units = 0,
  102. buttonindex = 4,
  103. button = {
  104. index = 4, click_function = 'ontario', function_owner = self,
  105. label = 'Ontario', position = {x = -0.78, y = 0.94, z = -0.43}, rotation = {x = 0, y = 0, z = 0},
  106. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  107. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
  108. },
  109. quebec = {
  110. borders = {"ontario","easternunitedstates","greenland"},
  111. owner = nil,
  112. units = 0,
  113. buttonindex = 5,
  114. button = {
  115. index = 5, click_function = 'quebec', function_owner = self,
  116. label = 'Quebec', position = {x = -0.59, y = 0.94, z = -0.43}, rotation = {x = 0, y = 0, z = 0},
  117. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  118. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
  119. },
  120. westernunitedstates = {
  121. borders = {"alberta","ontario","easternunitedstates","centralamerica"},
  122. owner = nil,
  123. units = 0,
  124. buttonindex = 6,
  125. button = {
  126. index = 6, click_function = 'westernunitedstates', function_owner = self,
  127. label = 'Western United States', position = {x = -0.95, y = 0.94, z = -0.27}, rotation = {x = 0, y = 0, z = 0},
  128. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  129. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
  130. },
  131. easternunitedstates = {
  132. borders = {"ontario","quebec","westernunitedstates","centralamerica"},
  133. owner = nil,
  134. units = 0,
  135. buttonindex = 7,
  136. button = {
  137. index = 7, click_function = 'easternunitedstates', function_owner = self,
  138. label = 'Eastern United States', position = {x = -0.76, y = 0.94, z = -0.18}, rotation = {x = 0, y = 0, z = 0},
  139. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  140. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
  141. },
  142. centralamerica = {
  143. borders = {"westernunitedstates","easternunitedstates","venezuela"},
  144. owner = nil,
  145. units = 0,
  146. buttonindex = 8,
  147. button = {
  148. index = 8, click_function = 'centralamerica', function_owner = self,
  149. label = 'Central America', position = {x = -0.87, y = 0.94, z = 0.01}, rotation = {x = 0, y = 0, z = 0},
  150. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  151. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
  152. },
  153. },
  154. sAmerica = {
  155. venezuela = {
  156. borders = {"centralamerica","peru","brazil"},
  157. owner = nil,
  158. units = 0,
  159. buttonindex = 9,
  160. button = {
  161. index = 9, click_function = 'venezuela', function_owner = self,
  162. label = 'Venezuela', position = {x = -0.75, y = 0.94, z = 0.14}, rotation = {x = 0, y = 0, z = 0},
  163. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  164. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
  165. },
  166. peru = {
  167. borders = {"venezuela","brazil","argentina"},
  168. owner = nil,
  169. units = 0,
  170. buttonindex = 10,
  171. button = {
  172. index = 10, click_function = 'peru', function_owner = self,
  173. label = 'Peru', position = {x = -0.68, y = 0.94, z = 0.39}, rotation = {x = 0, y = 0, z = 0},
  174. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  175. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
  176. },
  177. brazil = {
  178. borders = {"venezuela","peru","argentina","northafrica"},
  179. owner = nil,
  180. units = 0,
  181. buttonindex = 11,
  182. button = {
  183. index = 11, click_function = 'brazil', function_owner = self,
  184. label = 'Brazil', position = {x = -0.53, y = 0.94, z = 0.31}, rotation = {x = 0, y = 0, z = 0},
  185. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  186. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
  187. },
  188. argentina = {
  189. borders = {"peru","brazil"},
  190. owner = nil,
  191. units = 0,
  192. buttonindex = 12,
  193. button = {
  194. index = 12, click_function = 'argentina', function_owner = self,
  195. label = 'Argentina', position = {x = -0.64, y = 0.94, z = 0.58}, rotation = {x = 0, y = 0, z = 0},
  196. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  197. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
  198. },
  199. },
  200. europe = {
  201. iceland = {
  202. borders = {"greenland","scandinavia","greatbritain"},
  203. owner = nil,
  204. units = 0,
  205. buttonindex = 13,
  206. button = {
  207. index = 13, click_function = 'iceland', function_owner = self,
  208. label = 'Iceland', position = {x = -0.19, y = 0.94, z = -0.53}, rotation = {x = 0, y = 0, z = 0},
  209. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  210. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
  211. },
  212. scandinavia = {
  213. borders = {"iceland","ukrane","greatbritain","northerneurope"},
  214. owner = nil,
  215. units = 0,
  216. buttonindex = 14,
  217. button = {
  218. index = 14, click_function = 'scandinavia', function_owner = self,
  219. label = 'Scandinavia', position = {x = 0.04, y = 0.94, z = -0.59}, rotation = {x = 0, y = 0, z = 0},
  220. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  221. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
  222. },
  223. ukrane = {
  224. borders = {"scandinavia","northerneurope","southerneurope","middleeast","afghanistan","ural"},
  225. owner = nil,
  226. units = 0,
  227. buttonindex = 15,
  228. button = {
  229. index = 15, click_function = 'ukrane', function_owner = self,
  230. label = 'Ukrane', position = {x = 0.29, y = 0.94, z = -0.41}, rotation = {x = 0, y = 0, z = 0},
  231. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  232. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
  233. },
  234. greatbritain = {
  235. borders = {"iceland","scandinavia","northerneurope","westerneurope"},
  236. owner = nil,
  237. units = 0,
  238. buttonindex = 16,
  239. button = {
  240. index = 16, click_function = 'greatbritain', function_owner = self,
  241. label = 'Great Britain', position = {x = -0.23, y = 0.94, z = -0.3}, rotation = {x = 0, y = 0, z = 0},
  242. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  243. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
  244. },
  245. northerneurope = {
  246. borders = {"greatbritain","westerneurope","southerneurope","ukrane","scandinavia"},
  247. owner = nil,
  248. units = 0,
  249. buttonindex = 17,
  250. button = {
  251. index = 17, click_function = 'northerneurope', function_owner = self,
  252. label = 'Northern Europe', position = {x = 0.07, y = 0.94, z = -0.26}, rotation = {x = 0, y = 0, z = 0},
  253. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  254. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
  255. },
  256. westerneurope = {
  257. borders = {"greatbritain","northafrica","southerneurope","northerneurope"},
  258. owner = nil,
  259. units = 0,
  260. buttonindex = 18,
  261. button = {
  262. index = 18, click_function = 'westerneurope', function_owner = self,
  263. label = 'Western Europe', position = {x = -0.19, y = 0.94, z = 0}, rotation = {x = 0, y = 0, z = 0},
  264. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  265. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
  266. },
  267. southerneurope = {
  268. borders = {"northerneurope","westerneurope","northafrica","egypt","middleeast","ukrane"},
  269. owner = nil,
  270. units = 0,
  271. buttonindex = 19,
  272. button = {
  273. index = 19, click_function = 'southerneurope', function_owner = self,
  274. label = 'Southern Europe', position = {x = 0.07, y = 0.94, z = -0.12}, rotation = {x = 0, y = 0, z = 0},
  275. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  276. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
  277. },
  278. },
  279. africa = {
  280. northafrica = {
  281. borders = {"westerneurope","brazil","congo","eastafrica","egypt","southerneurope"},
  282. owner = nil,
  283. units = 0,
  284. buttonindex = 20,
  285. button = {
  286. index = 20, click_function = 'northafrica', function_owner = self,
  287. label = 'North Africa', position = {x = -0.07, y = 0.94, z = 0.28}, rotation = {x = 0, y = 0, z = 0},
  288. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  289. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
  290. },
  291. egypt = {
  292. borders = {"southerneurope","northafrica","eastafrica","middleeast"},
  293. owner = nil,
  294. units = 0,
  295. buttonindex = 21,
  296. button = {
  297. index = 21, click_function = 'egypt', function_owner = self,
  298. label = 'Egypt', position = {x = 0.13, y = 0.94, z = 0.18}, rotation = {x = 0, y = 0, z = 0},
  299. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  300. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
  301. },
  302. eastafrica = {
  303. borders = {"egypt","northafrica","congo","southafrica","madagascar","middleeast"},
  304. owner = nil,
  305. units = 0,
  306. buttonindex = 22,
  307. button = {
  308. index = 22, click_function = 'eastafrica', function_owner = self,
  309. label = 'East Africa', position = {x = 0.26, y = 0.94, z = 0.39}, rotation = {x = 0, y = 0, z = 0},
  310. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  311. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
  312. },
  313. congo = {
  314. borders = {"northafrica","southafrica","eastafrica"},
  315. owner = nil,
  316. units = 0,
  317. buttonindex = 23,
  318. button = {
  319. index = 23, click_function = 'congo', function_owner = self,
  320. label = 'Congo', position = {x = 0.14, y = 0.94, z = 0.5}, rotation = {x = 0, y = 0, z = 0},
  321. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  322. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
  323. },
  324. southafrica = {
  325. borders = {"congo","madagascar","eastafrica"},
  326. owner = nil,
  327. units = 0,
  328. buttonindex = 24,
  329. button = {
  330. index = 24, click_function = 'southafrica', function_owner = self,
  331. label = 'South Africa', position = {x = 0.15, y = 0.94, z = 0.78}, rotation = {x = 0, y = 0, z = 0},
  332. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  333. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
  334. },
  335. madagascar = {
  336. borders = {"southafrica","eastafrica"},
  337. owner = nil,
  338. units = 0,
  339. buttonindex = 25,
  340. button = {
  341. index = 25, click_function = 'madagascar', function_owner = self,
  342. label = 'Madagascar', position = {x = 0.38, y = 0.94, z = 0.69}, rotation = {x = 0, y = 0, z = 0},
  343. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  344. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
  345. },
  346. },
  347. asia = {
  348. ural = {
  349. borders = {"ukrane","afghanistan","china","siberia"},
  350. owner = nil,
  351. units = 0,
  352. buttonindex = 26,
  353. button = {
  354. index = 26, click_function = 'ural', function_owner = self,
  355. label = 'Ural', position = {x = 0.56, y = 0.94, z = -0.48}, rotation = {x = 0, y = 0, z = 0},
  356. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  357. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
  358. },
  359. siberia = {
  360. borders = {"ural","china","mongolia","irkutsk","yakutsk"},
  361. owner = nil,
  362. units = 0,
  363. buttonindex = 27,
  364. button = {
  365. index = 27, click_function = 'siberia', function_owner = self,
  366. label = 'Siberia', position = {x = 0.7, y = 0.94, z = -0.58}, rotation = {x = 0, y = 0, z = 0},
  367. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  368. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
  369. },
  370. yakutsk = {
  371. borders = {"siberia","irkutsk","kamchatka"},
  372. owner = nil,
  373. units = 0,
  374. buttonindex = 28,
  375. button = {
  376. index = 28, click_function = 'yakutsk', function_owner = self,
  377. label = 'Yakutsk', position = {x = 0.91, y = 0.94, z = -0.67}, rotation = {x = 0, y = 0, z = 0},
  378. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  379. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
  380. },
  381. kamchatka = {
  382. borders = {"yakutsk","irkutsk","mongolia","japan","alaska"},
  383. owner = nil,
  384. units = 0,
  385. buttonindex = 29,
  386. button = {
  387. index = 29, click_function = 'kamchatka', function_owner = self,
  388. label = 'Kamchatka', position = {x = 1.12, y = 0.94, z = -0.65}, rotation = {x = 0, y = 0, z = 0},
  389. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  390. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
  391. },
  392. irkutsk = {
  393. borders = {"yakutsk","siberia","mongolia","kamchatka","yakutsk"},
  394. owner = nil,
  395. units = 0,
  396. buttonindex = 30,
  397. button = {
  398. index = 30, click_function = 'irkutsk', function_owner = self,
  399. label = 'Irkutsk', position = {x = 0.88, y = 0.94, z = -0.43}, rotation = {x = 0, y = 0, z = 0},
  400. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  401. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
  402. },
  403. mongolia = {
  404. borders = {"irkutsk","siberia","china","japan","kamchatka"},
  405. owner = nil,
  406. units = 0,
  407. buttonindex = 31,
  408. button = {
  409. index = 31, click_function = 'mongolia', function_owner = self,
  410. label = 'Mongolia', position = {x = 0.9, y = 0.94, z = -0.26}, rotation = {x = 0, y = 0, z = 0},
  411. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  412. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
  413. },
  414. afghanistan = {
  415. borders = {"ukrane","middleeast","india","china","ural"},
  416. owner = nil,
  417. units = 0,
  418. buttonindex = 32,
  419. button = {
  420. index = 32, click_function = 'afghanistan', function_owner = self,
  421. label = 'Afghanistan', position = {x = 0.52, y = 0.94, z = -0.21}, rotation = {x = 0, y = 0, z = 0},
  422. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  423. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
  424. },
  425. japan = {
  426. borders = {"mongolia","kamchatka"},
  427. owner = nil,
  428. units = 0,
  429. buttonindex = 33,
  430. button = {
  431. index = 33, click_function = 'japan', function_owner = self,
  432. label = 'Japan', position = {x = 1.21, y = 0.94, z = -0.3}, rotation = {x = 0, y = 0, z = 0},
  433. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  434. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
  435. },
  436. china = {
  437. borders = {"siberia","ural","afghanistan","india","siam","mongolia"},
  438. owner = nil,
  439. units = 0,
  440. buttonindex = 34,
  441. button = {
  442. index = 34, click_function = 'china', function_owner = self,
  443. label = 'China', position = {x = 0.83, y = 0.94, z = -0.08}, rotation = {x = 0, y = 0, z = 0},
  444. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  445. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
  446. },
  447. middleeast = {
  448. borders = {"ukrane","southerneurope","egypt","eastafrica","india","afghanistan"},
  449. owner = nil,
  450. units = 0,
  451. buttonindex = 35,
  452. button = {
  453. index = 35, click_function = 'middleeast', function_owner = self,
  454. label = 'Middle East', position = {x = 0.38, y = 0.94, z = 0.02}, rotation = {x = 0, y = 0, z = 0},
  455. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  456. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
  457. },
  458. india = {
  459. borders = {"afghanistan","middleeast","siam","china"},
  460. owner = nil,
  461. units = 0,
  462. buttonindex = 36,
  463. button = {
  464. index = 36, click_function = 'india', function_owner = self,
  465. label = 'India', position = {x = 0.66, y = 0.94, z = 0.06}, rotation = {x = 0, y = 0, z = 0},
  466. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  467. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
  468. },
  469. siam = {
  470. borders = {"india","china","indonesia"},
  471. owner = nil,
  472. units = 0,
  473. buttonindex = 37,
  474. button = {
  475. index = 37, click_function = 'siam', function_owner = self,
  476. label = 'Siam', position = {x = 0.9, y = 0.94, z = 0.16}, rotation = {x = 0, y = 0, z = 0},
  477. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  478. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
  479. },
  480. },
  481. australia = {
  482. indonesia = {
  483. borders = {"siam","westernaustralia","newguinea"},
  484. owner = nil,
  485. units = 0,
  486. buttonindex = 38,
  487. button = {
  488. index = 38, click_function = 'indonesia', function_owner = self,
  489. label = 'Indonesia', position = {x = 1.02, y = 0.94, z = 0.48}, rotation = {x = 0, y = 0, z = 0},
  490. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  491. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
  492. },
  493. newguinea = {
  494. borders = {"indonesia","easternaustralia"},
  495. owner = nil,
  496. units = 0,
  497. buttonindex = 39,
  498. button = {
  499. index = 39, click_function = 'newguinea', function_owner = self,
  500. label = 'New Guinea', position = {x = 1.26, y = 0.94, z = 0.42}, rotation = {x = 0, y = 0, z = 0},
  501. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  502. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
  503. },
  504. westernaustralia = {
  505. borders = {"indonesia","easternaustralia"},
  506. owner = nil,
  507. units = 0,
  508. buttonindex = 40,
  509. button = {
  510. index = 40, click_function = 'westernaustralia', function_owner = self,
  511. label = 'Western Austrailia', position = {x = 1.06, y = 0.94, z = 0.64}, rotation = {x = 0, y = 0, z = 0},
  512. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  513. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
  514. },
  515. easternaustralia = {
  516. borders = {"newguinea","westernaustralia"},
  517. owner = nil,
  518. units = 0,
  519. buttonindex = 41,
  520. button = {
  521. index = 41, click_function = 'easternaustralia', function_owner = self,
  522. label = 'Eastern Austrailia', position = {x = 1.28, y = 0.94, z = 0.68}, rotation = {x = 0, y = 0, z = 0},
  523. scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
  524. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
  525. }
  526. }
  527. }
  528. pColors = {
  529. White = {{1,1,1},{0.25, 0.25, 0.25}},
  530. Brown = {{0.443, 0.231, 0.09},{0.25, 0.25, 0.25}},
  531. Red = {{0.856, 0.1, 0.094},{0.25, 0.25, 0.25}},
  532. Orange = {{0.956, 0.392, 0.113},{0.25, 0.25, 0.25}},
  533. Yellow = {{0.905, 0.898, 0.172},{0.25, 0.25, 0.25}},
  534. Green = {{0.192, 0.701, 0.168},{0.25, 0.25, 0.25}},
  535. Teal = {{0.129, 0.694, 0.607},{0.25, 0.25, 0.25}},
  536. Blue = {{0.118, 0.53, 1},{0.25, 0.25, 0.25}},
  537. Purple = {{0.627, 0.125, 0.941},{0.25, 0.25, 0.25}},
  538. Pink = {{0.96, 0.439, 0.807},{0.25, 0.25, 0.25}}
  539. }
  540. neutralColor = "Yellow"
  541. pList = {}
  542. territoryCount = {}
  543. -- holder variables
  544. phase = "pregame"
  545. currentturn = "pregame"
  546. --[[ Button numbers -
  547. 0 - 41 territories
  548. 42 start button
  549. ]]--
  550. startButton = {
  551. index = 42, click_function = 'setupTerritories', function_owner = self,
  552. label = 'Start Game', position = {x = 0.0, y = 1.0, z = 0.0}, rotation = {x = 0, y = 0, z = 0},
  553. scale = {x = 0.5, y = 1, z = 0.5}, width = 700, height = 120, font_size = 100,
  554. color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}
  555. }
  556. self.createButton(startButton)
  557. end
  558.  
  559. -- Setup
  560. function createTerritoryButtons()
  561. for i,c in pairs(continents) do
  562. for j,t in pairs(c) do
  563. self.createButton(t.button)
  564. end
  565. end
  566. end
  567. -- set up
  568. function setupTerritories()
  569. createTerritoryButtons()
  570. --count players and get colour and set starting unit count
  571. local pList = getSeatedPlayers()
  572. local numPlayers = #pList
  573. -- check for enough players
  574. if pList == nil or numPlayers < 1 then
  575. broadcastToAll("Not enough players seated to start the game!",tColor)
  576. return false
  577. end
  578. -- determine if there is a neutral player
  579. neutralPlayer = 0
  580. if numPlayers == 2 then
  581. neutralPlayer = 1
  582. table.insert(pList,neutralColor)
  583. end
  584. local t = {}
  585. -- initialize territory counts
  586. for i,v in pairs(pList) do
  587. territoryCount[v] = 0
  588. end
  589. -- get a list of territories
  590. for i,v in pairs(contReference) do
  591. table.insert(t,i)
  592. end
  593. local pIndex = 1
  594. --deal territory to players add 1 to all of the player owned territory
  595. repeat
  596. local rand = math.random(#t)
  597. updateTroopCount(t[rand],1)
  598. updateOwner(t[rand],pList[pIndex])
  599. territoryCount[pList[pIndex]] = territoryCount[pList[pIndex]] + 1
  600. pIndex = pIndex + 1
  601. if pIndex > numPlayers + neutralPlayer then
  602. pIndex = 1
  603. end
  604. table.remove(t,rand)
  605. until #t <= 0 or #t == nil
  606. local startUnits = {0,40,35,30,25,20}
  607. local unitsLeft = {}
  608. for i,v in pairs(pList) do
  609. unitsLeft[v] = startUnits[numPlayers] - territoryCount[v]
  610. broadcastToAll(v .. " has " .. unitsLeft[v] .. " units left to place.",tColor)
  611. end
  612. --roll for who goes 1st
  613. rand = math.random(numPlayers)
  614. currentturn = pList[rand]
  615. broadcastToAll(currentturn .. " gets first placement.",tColor)
  616. --players from 1st to last add to a territory clockwise until number for the game
  617. -- start up end
  618. end
  619. function territoryClicked(territory,color)
  620. if currentturn ~= color then
  621. broadcastToColor("Cannot do that. It is not your turn.",color,tColor)
  622. return
  623. end
  624. if phase == "pregame" then
  625. broadcastToColor("Cannot do that. The game has not been started.",color,tColor)
  626. return
  627. end
  628. broadcastToAll(getOwner(territory) .. "'s " .. territory .. " with " .. getUnitAmount(territory) .. " units was clicked by " .. color, tColor)
  629. end
  630.  
  631. --turn start
  632. --turn setup phase start
  633. --unit re-enforcement calculation
  634. --player may hand in complete sets/ if player has 5 or more cards in hand they must hand in set and set value is added to unit re-enforcement and set value is incremented
  635. --unit re-enforcement placement
  636. -- turn setup phase end
  637. --combat phase start
  638. --highlight country's that are valid to attack/if there is none end turn
  639. --highlight the country's that selected country can attack
  640.  
  641. -----------------------
  642. -- SUPPORT FUNCTIONS --
  643. -----------------------
  644. function st(t)
  645. broadcastToAll(t,tColor)
  646. end
  647. function updateTroopCount(territory,amount)
  648. --broadcastToAll("Got passed: territory - " .. territory .. " amount - " .. amount,tColor)
  649. continents[contReference[territory]][territory].button.label = amount
  650. continents[contReference[territory]][territory].units = amount
  651. self.editButton(continents[contReference[territory]][territory].button)
  652. end
  653. function updateOwner(territory,owner)
  654. --broadcastToAll("Got passed: territory - " .. territory,tColor)
  655. --broadcastToAll(" owner - " .. owner,tColor)
  656. continents[contReference[territory]][territory].owner = owner
  657. continents[contReference[territory]][territory].button.color = pColors[owner][1]
  658. continents[contReference[territory]][territory].button.font_color = pColors[owner][2]
  659. self.editButton(continents[contReference[territory]][territory].button)
  660. end
  661.  
  662. function getOwner(territory)
  663. return continents[contReference[territory]][territory].owner
  664. end
  665. function getUnitAmount(territory)
  666. return continents[contReference[territory]][territory].units
  667. end
  668. -- Button click re-reference functions
  669. function alaska(o,c) territoryClicked("alaska",c) end
  670. function northwestterritory(o,c) territoryClicked("northwestterritory",c) end
  671. function greenland(o,c) territoryClicked("greenland",c) end
  672. function alberta(o,c) territoryClicked("alberta",c) end
  673. function ontario(o,c) territoryClicked("ontario",c) end
  674. function quebec(o,c) territoryClicked("quebec",c) end
  675. function westernunitedstates(o,c) territoryClicked("westernunitedstates",c) end
  676. function easternunitedstates(o,c) territoryClicked("easternunitedstates",c) end
  677. function centralamerica(o,c) territoryClicked("centralamerica",c) end
  678. function venezuela(o,c) territoryClicked("venezuela",c) end
  679. function brazil(o,c) territoryClicked("brazil",c) end
  680. function peru(o,c) territoryClicked("peru",c) end
  681. function argentina(o,c) territoryClicked("argentina",c) end
  682. function iceland(o,c) territoryClicked("iceland",c) end
  683. function scandinavia(o,c) territoryClicked("scandinavia",c) end
  684. function ukrane(o,c) territoryClicked("ukrane",c) end
  685. function greatbritain(o,c) territoryClicked("greatbritain",c) end
  686. function northerneurope(o,c) territoryClicked("northerneurope",c) end
  687. function westerneurope(o,c) territoryClicked("westerneurope",c) end
  688. function southerneurope(o,c) territoryClicked("southerneurope",c) end
  689. function northafrica(o,c) territoryClicked("northafrica",c) end
  690. function egypt(o,c) territoryClicked("egypt",c) end
  691. function eastafrica(o,c) territoryClicked("eastafrica",c) end
  692. function congo(o,c) territoryClicked("congo",c) end
  693. function madagascar(o,c) territoryClicked("madagascar",c) end
  694. function southafrica(o,c) territoryClicked("southafrica",c) end
  695. function ural(o,c) territoryClicked("ural",c) end
  696. function siberia(o,c) territoryClicked("siberia",c) end
  697. function yakutsk(o,c) territoryClicked("yakutsk",c) end
  698. function kamchatka(o,c) territoryClicked("kamchatka",c) end
  699. function irkutsk(o,c) territoryClicked("irkutsk",c) end
  700. function mongolia(o,c) territoryClicked("mongolia",c) end
  701. function japan(o,c) territoryClicked("japan",c) end
  702. function afghanistan(o,c) territoryClicked("afghanistan",c) end
  703. function china(o,c) territoryClicked("china",c) end
  704. function middleeast(o,c) territoryClicked("middleeast",c) end
  705. function india(o,c) territoryClicked("india",c) end
  706. function siam(o,c) territoryClicked("siam",c) end
  707. function indonesia(o,c) territoryClicked("indonesia",c) end
  708. function newguinea(o,c) territoryClicked("newguinea",c) end
  709. function westernaustralia(o,c) territoryClicked("westernaustralia",c) end
  710. function easternaustralia(o,c) territoryClicked("easternaustralia",c) end
Advertisement
Add Comment
Please, Sign In to add comment