Advertisement
Unlocker001_TFM

Untitled

Oct 26th, 2017
18,901
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 288.80 KB | None | 0 0
  1. --[[ src/before.lua ]]--
  2.  
  3. -- Script to initialise variables necessary for the module to run
  4.  
  5. moduleName="utility"
  6. players={}
  7. notifyOrder={}
  8. map={}
  9. currentTime=0
  10. SPAWNEDOBJS = {}
  11. _S = {}
  12.  
  13. ranks={
  14. -- Contributors
  15. Shamousey=5,
  16. Evilsantah=5,
  17. Moduleapi=5,
  18. Jamesqwartz=5,
  19. Velspar=5,
  20. Eshkation=5,
  21. }
  22.  
  23. RANKS={
  24. STAFF=5,
  25. ROOM_OWNER=4,
  26. ROOM_ADMIN=3,
  27. ANY=1
  28. }
  29.  
  30. modes={
  31. tribe="mapMode_tribe",
  32. tribehouse="mapMode_tribe",
  33. bootcamp="mapMode_bootcamp",
  34. shaman="mapMode_shaman",
  35. sham="mapMode_shaman",
  36. dual="mapMode_dual_shaman",
  37. all="mapMode_all_shaman",
  38. vampire="mapMode_vampire",
  39. vamp="mapMode_vampire",
  40. racing="mapMode_racing",
  41. survivor="mapMode_survivor",
  42. }
  43.  
  44. translations = {}
  45. maps = {}
  46.  
  47. toRespawn={}
  48.  
  49. mapInfo={
  50. lastLoad=os.time()-5000,
  51. queue={},
  52. }
  53. map={}
  54.  
  55. KEYS={
  56. LEFT=0,
  57. UP=1,
  58. RIGHT=2,
  59. DOWN=3,
  60. BACKSPACE=8,
  61. SHIFT=16,
  62. CTRL=17,
  63. ALT=18,
  64. CAPS=20,
  65. ESCAPE=27,
  66. SPACE=32,
  67. PAGEUP=33,
  68. PAGEDOWN=34,
  69. END=35,
  70. HOME=36,
  71. LEFT_ARROW=37,
  72. UP_ARROW=38,
  73. RIGHT_ARROW=39,
  74. DOWN_ARROW=40,
  75. DELETE=46,
  76. [0]=48,
  77. [1]=49,
  78. [2]=50,
  79. [3]=51,
  80. [4]=52,
  81. [5]=53,
  82. [6]=54,
  83. [7]=55,
  84. [8]=56,
  85. [9]=57,
  86. A=65,
  87. B=66,
  88. C=67,
  89. D=68,
  90. E=69,
  91. F=70,
  92. G=71,
  93. H=72,
  94. I=73,
  95. K=75,
  96. J=74,
  97. L=76,
  98. M=77,
  99. N=78,
  100. O=79,
  101. P=80,
  102. Q=81,
  103. R=82,
  104. S=83,
  105. T=84,
  106. U=85,
  107. V=86,
  108. W=87,
  109. X=88,
  110. Y=89,
  111. Z=90,
  112. ["WINDOWS"]=91,
  113. ["CONTEXT"]=93,
  114. ["NUMPAD 0"]=96,
  115. ["NUMPAD 1"]=97,
  116. ["NUMPAD 2"]=98,
  117. ["NUMPAD 3"]=99,
  118. ["NUMPAD 4"]=100,
  119. ["NUMPAD 5"]=101,
  120. ["NUMPAD 6"]=102,
  121. ["NUMPAD 7"]=103,
  122. ["NUMPAD 8"]=104,
  123. ["NUMPAD 9"]=105,
  124. ["F1"]=112,
  125. ["F2"]=113,
  126. ["F3"]=114,
  127. ["F4"]=115,
  128. ["F5"]=116,
  129. ["F6"]=117,
  130. ["F7"]=118,
  131. ["F8"]=119,
  132. ["F9"]=120,
  133. ["F10"]=121,
  134. ["F11"]=122,
  135. ["F12"]=123,
  136. ["NUMLOCK"]=144,
  137. [";"]=186,
  138. ["="]=187,
  139. [","]=188,
  140. ["-"]=189,
  141. ["."]=190,
  142. ["/"]=191,
  143. ["'"]=192,
  144. ["["]=219,
  145. ["\\"]=220,
  146. ["]"]=221,
  147. ["#"]=222,
  148. ["`"]=223,
  149. }
  150.  
  151. -- Particle IDs for fireworks
  152. REDWHITEBLUE = {13,0,-1}
  153.  
  154. tfm.exec.disableAutoShaman(true)
  155. tfm.exec.disableAutoTimeLeft(true)
  156. tfm.exec.disableAutoNewGame(true)
  157. tfm.exec.disableAutoScore(true)
  158. tfm.exec.disableAfkDeath(true)
  159.  
  160. _,_,suffix=string.find((tfm.get.room.name:sub(1,2)=="e2" and tfm.get.room.name:sub(3)) or tfm.get.room.name,"%d+(.+)$")
  161. local roomSuffix = string.match(tfm.get.room.name, "%d+(.-)$")
  162.  
  163.  
  164. --[[ src/config.lua ]]--
  165.  
  166. SETTINGS={
  167. VOTE_TIME={
  168. votes={},
  169. maxVotes=6,
  170. timeToAdd=30
  171. },
  172. VOTE_SKIP={
  173. votes={}
  174. },
  175. SKILLS=true,
  176. ROTATION={tribehouse=true},
  177. DISABLEAUTONEWGAME=nil,
  178. QUICKRESPAWN=true,
  179. }
  180.  
  181.  
  182. --[[ src/translations/br.lua ]]--
  183.  
  184. translations.br = {
  185. groundList={[0]="Madeira","Gelo","Trampolim","Lava","Chocolate","Tera","Grama","Areia","Nuvem","Água","Pedra","Neve","Retângulo","Círculo","Teia"},
  186. id="ID",
  187. type="Tipo",
  188. color="Cor",
  189. friction="Fricção",
  190. restitution="Restituição",
  191. x="X",
  192. y="Y",
  193. length="Comprimento",
  194. height="Altura",
  195. rotation="Rotação",
  196. dynamic="Dinâmico",
  197. mass="Massa",
  198. greetings = {
  199. "Hey fofo *-*",
  200. "Hey, preparado para bons momentos? :)",
  201. "Você é a Betty? Eu sou a betty",
  202. "MEU DEUS, é você! Posso ter um autógrafo?",
  203. "Se você tocar na minha morsa mais uma vez, Eu juro por Deus...",
  204. "Perdi vários contatos, várias combinações, socorro, SOCORRO!",
  205. "Senti sua falta!!!",
  206. "PA-NI-FI-CA-DO-RA AL-FA!",
  207. "Bonjour, bonjour, bon jour!",
  208. "Oh, olá, não tinha visto você aqui...",
  209. "Ano que vem eu quero estar na praia, vendendo as coisas que a natureza dá pra gente\nNOSSA",
  210. "Girando girando vai girando",
  211. "Pindobel, pindobel, leu leu leu!",
  212. "Estava a sua espera, Sr. Bond...",
  213. "Você é o visitante número um milhão!!! Você ganhou um IPHONE 8 GRÁTIS!",
  214. "Saudações meu amigo didático.",
  215. "Alô alô vocês sabem que eu sou?",
  216. "Eu quero closer, eu quero beleza! 5 MINUTOS DE BELEZA"
  217. },
  218. all="Todos",
  219. none="Ninguém",
  220. meepremovednextround="O meep será removido no próximo mapa",
  221. invalidargument="Argumento inválido",
  222. meow="Miau",
  223. alreadyqueued="Este mapa já foi adicionado a fila",
  224. noqueue="Não existem mapas na fila",
  225. addedtoqueue="O mapa %s foi adicionado a fila na posição #%s",
  226. submittedby="#%s - %s enviado por %s",
  227. addedtime="%s adicionou %s segundos para o mapa atual",
  228. cantaddtime="Você não pode votar para adicionar tempo para o mapa atual",
  229. votedtoskip="%s votou para pular o mapa atual",
  230. roundskipped="O mapa atual está sendo pulado",
  231. alreadyvotedtoskip="Você já votou para pular este mapa",
  232. skillsdisabled="As habilidades de shaman foram desativadas",
  233. skillsenabled="As habilidades de shaman foram ativadas",
  234. noadmins="Não há administradores de sala",
  235. isnowadmin="%s agora é um administrador da sala!",
  236. isnoadmin="%s não é mais um administrador da sala",
  237. hashigherrank="%s possui um rank igual ou maior ao seu",
  238. roomlimit="O limite da sala foi mudado para <b>%s jogador(es)</b>",
  239. enterobjectid="Por favor escolha um id de objeto shaman",
  240. colorchanged="Cor mudada para %s",
  241. brushchanged="Tamanho do pincel mudado para %s",
  242. pickacolor="Escolha uma cor",
  243. offsetschanged="Offsets mudados para X:%s Y:%s",
  244. doge={"wow", "muito rato", "super racer", "wow", "wow", "tipo morte", "1 like para 1 rezador", "p1 pls", "tipo shaman", "muito queijo", "avalia meu mapa"},
  245. joinedroom="%s entrou na sala",
  246. leftroom="%s saiu da sala",
  247. nocmdperms="Você não tem permissão para utilizar este comando",
  248. changelogtitle="<b>Changelog</b> - digite !changelog para ver mais",
  249. loadingmap="Carregando mapa %s enviado por %s",
  250. peteating="Você deve esperar seu pet terminar de comer.",
  251. }
  252.  
  253.  
  254. --[[ src/translations/en.lua ]]--
  255.  
  256. translations.en = {
  257. groundList={[0]="Wood","Ice","Trampoline","Lava","Chocolate","Earth","Grass","Sand","Cloud","Water","Stone","Snow","Rectangle","Circle","Cobweb"},
  258. id="ID",
  259. type="Type",
  260. color="Color",
  261. friction="Friction",
  262. restitution="Restitution",
  263. x="X",
  264. y="Y",
  265. length="Length",
  266. height="Height",
  267. rotation="Rotation",
  268. dynamic="Dynamic",
  269. mass="Mass",
  270. greetings={
  271. "Hey qt *-*",
  272. "What's shakin bacon?",
  273. "Hey hot stuff, ready for a good time? ;)",
  274. "Go lick a duck and call yourself Shirley.",
  275. "OMG it's you!! kan i get your autografph?!",
  276. "If you touch my walrus one more time, I swear to god...",
  277. "How you doin'? ;)",
  278. "I've missed you!!!",
  279. "Well hello, I didn't see you there..",
  280. "I've been expecting you, Mr Bond...",
  281. "You are the 1 MILLIONTH VISITOR!!!! You win a FREE IPHONE 8!",
  282. "Well hello, handsome ;)",
  283. "Salutations my didactic friend.",
  284. "Care for a cup of tea and scones, guvna'?",
  285. },
  286. all="All",
  287. none="None",
  288. meepremovednextround="Meep will be removed next round.",
  289. invalidargument="Invalid argument.",
  290. meow="Meow",
  291. alreadyqueued="This map is already in the queue.",
  292. noqueue="There are no maps in the queue.",
  293. addedtoqueue="Map %s added to the queue in position #%s",
  294. submittedby="#%s - %s submitted by %s",
  295. addedtime="%s added %s seconds to the current round.",
  296. cantaddtime="You can't currently vote to add time to the current round.",
  297. votedtoskip="%s voted to skip the current map.",
  298. roundskipped="The current round is being skipped.",
  299. alreadyvotedtoskip="You've already voted to skip the current round.",
  300. skillsdisabled="Shaman skills have been disabled.",
  301. skillsenabled="Shaman skills have been enabled.",
  302. noadmins="There are no room admins.",
  303. isnowadmin="%s is now a room admin!",
  304. isnoadmin="%s is no longer a room admin.",
  305. hashigherrank="%s has a higher or equal rank to you.",
  306. roomlimit="The room limit has been changed to <b>%s player(s)</b>.",
  307. enterobjectid="Please enter a shaman object ID.",
  308. colorchanged="Color changed to %s",
  309. brushchanged="Brush size changed to %s",
  310. pickacolor="Pick a color",
  311. offsetschanged="Offsets changed to X:%s Y:%s",
  312. doge={"wow", "very mouse", "such race", "wow", "wow", "much death", "1 like for 1 prayer", "p1 pls", "much shaman", "many cheese"},
  313. joinedroom="%s joined the room.",
  314. leftroom="%s left the room.",
  315. nocmdperms="You don't have permission to use this command.",
  316. changelogtitle="<b>Changelog</b> - Type !changelog to see more.",
  317. loadingmap="Loading map %s queued by %s",
  318. peteating="You have to wait your pet eat the treat",
  319. }
  320.  
  321.  
  322. --[[ src/staff.lua ]]--
  323.  
  324. -- This is an automatically generated list of all staff members, scraped from atelier801.com/staff
  325.  
  326. staff = {}
  327. staff["admins"] = {}
  328. staff["mods"] = {}
  329. staff["sentinels"] = {}
  330. staff["mapcrew"] = {}
  331. staff["funcorp"] = {}
  332. staff["admins"]["Adrazaelle"] = true
  333. staff["admins"]["Azrou"] = true
  334. staff["admins"]["Dayan"] = true
  335. staff["admins"]["Dm_atropos"] = true
  336. staff["admins"]["Galaktine"] = true
  337. staff["admins"]["Gimnir"] = true
  338. staff["admins"]["Lyra_purple"] = true
  339. staff["admins"]["Stardev7"] = true
  340. staff["admins"]["Streaxx"] = true
  341. staff["admins"]["Yoshiki"] = true
  342. staff["admins"]["Melibellule"] = true
  343. staff["admins"]["Pikashu"] = true
  344. staff["admins"]["Tigrounette"] = true
  345. staff["mods"]["Aewing"] = true
  346. staff["mods"]["Archaeron"] = true
  347. staff["mods"]["Celeius"] = true
  348. staff["mods"]["Christouffe"] = true
  349. staff["mods"]["Darthmod"] = true
  350. staff["mods"]["Denadir"] = true
  351. staff["mods"]["Djealvi"] = true
  352. staff["mods"]["Eita"] = true
  353. staff["mods"]["Harshy"] = true
  354. staff["mods"]["Hikariblabla"] = true
  355. staff["mods"]["Hohojosco"] = true
  356. staff["mods"]["Irishcow"] = true
  357. staff["mods"]["Jjangg"] = true
  358. staff["mods"]["Kalhyra"] = true
  359. staff["mods"]["Kamelotepica"] = true
  360. staff["mods"]["Kittenblep"] = true
  361. staff["mods"]["Klauszhang"] = true
  362. staff["mods"]["Loganfrio"] = true
  363. staff["mods"]["Makinit"] = true
  364. staff["mods"]["Meekoru"] = true
  365. staff["mods"]["Modojack"] = true
  366. staff["mods"]["Modquack"] = true
  367. staff["mods"]["Null"] = true
  368. staff["mods"]["Plkzc"] = true
  369. staff["mods"]["Pyjin"] = true
  370. staff["mods"]["Sukelaci"] = true
  371. staff["mods"]["Teoodora"] = true
  372. staff["mods"]["Tyyphoon"] = true
  373. staff["mods"]["Vivons"] = true
  374. staff["mods"]["Warfenixkill"] = true
  375. staff["mods"]["Yosska"] = true
  376. staff["mods"]["Fiarb"] = true
  377. staff["mods"]["Ginkyu"] = true
  378. staff["mods"]["Killerlux"] = true
  379. staff["mods"]["Miwakiko"] = true
  380. staff["mods"]["Modokapi"] = true
  381. staff["mods"]["Duura"] = true
  382. staff["mods"]["Feikusha"] = true
  383. staff["mods"]["Lord_oleg"] = true
  384. staff["mods"]["Toratyan"] = true
  385. staff["mods"]["Being_evil"] = true
  386. staff["mods"]["Explanado"] = true
  387. staff["mods"]["Outra"] = true
  388. staff["mods"]["Outro"] = true
  389. staff["mods"]["Scarmander"] = true
  390. staff["mods"]["Se7e"] = true
  391. staff["mods"]["Softmode"] = true
  392. staff["mods"]["Zoommod"] = true
  393. staff["mods"]["Crashark"] = true
  394. staff["mods"]["Draxterpin"] = true
  395. staff["mods"]["Makiiiiis"] = true
  396. staff["mods"]["Mimiiigirl"] = true
  397. staff["mods"]["Ratacp"] = true
  398. staff["mods"]["Toritomm"] = true
  399. staff["mods"]["Doraemons"] = true
  400. staff["mods"]["Piratearthur"] = true
  401. staff["mods"]["Xiezi"] = true
  402. staff["mods"]["Shaumbra"] = true
  403. staff["mods"]["Visne"] = true
  404. staff["mods"]["Arleen"] = true
  405. staff["mods"]["Arcanacra"] = true
  406. staff["mods"]["E_330"] = true
  407. staff["mods"]["Staszekowaty"] = true
  408. staff["mods"]["Esoisdown"] = true
  409. staff["mods"]["Cheeselicious"] = true
  410. staff["mods"]["Distances"] = true
  411. staff["mods"]["Flareress"] = true
  412. staff["mods"]["Jordynl"] = true
  413. staff["mods"]["Kimmowimmo"] = true
  414. staff["mods"]["Bestialman"] = true
  415. staff["mods"]["Tarmacadam"] = true
  416. staff["mods"]["Mrslouzifer"] = true
  417. staff["mods"]["Sweetphoenix"] = true
  418. staff["mods"]["Cheesuschrist"] = true
  419. staff["mods"]["Faiory"] = true
  420. staff["mods"]["Hainkeru"] = true
  421. staff["mods"]["Jacobbbbbbb"] = true
  422. staff["mods"]["Leafe"] = true
  423. staff["mods"]["Lostchicken"] = true
  424. staff["mods"]["Luxurz"] = true
  425. staff["mods"]["Mariexo"] = true
  426. staff["mods"]["Nidoranne"] = true
  427. staff["mods"]["No_0ne"] = true
  428. staff["mods"]["Orangelighthouse"] = true
  429. staff["mods"]["Poomph"] = true
  430. staff["mods"]["Secretive"] = true
  431. staff["mods"]["Veralidaine"] = true
  432. staff["mods"]["Welshnutter"] = true
  433. staff["mods"]["Worsnoplover"] = true
  434. staff["mods"]["Bembija"] = true
  435. staff["mods"]["Layora"] = true
  436. staff["sentinels"]["A_801"] = true
  437. staff["sentinels"]["Altercorp"] = true
  438. staff["sentinels"]["Archaeron"] = true
  439. staff["sentinels"]["Bogkitty"] = true
  440. staff["sentinels"]["Buddyrich"] = true
  441. staff["sentinels"]["Celeius"] = true
  442. staff["sentinels"]["Centinela_es"] = true
  443. staff["sentinels"]["Christouffe"] = true
  444. staff["sentinels"]["Flumazenil"] = true
  445. staff["sentinels"]["Kamelotepica"] = true
  446. staff["sentinels"]["Lemodile"] = true
  447. staff["sentinels"]["Modquack"] = true
  448. staff["sentinels"]["Momobelly"] = true
  449. staff["sentinels"]["Mousiinelle"] = true
  450. staff["sentinels"]["Shamachamp"] = true
  451. staff["sentinels"]["Tyyphoon"] = true
  452. staff["sentinels"]["Eleniah"] = true
  453. staff["sentinels"]["Hollya"] = true
  454. staff["sentinels"]["Mlledebby"] = true
  455. staff["sentinels"]["Nitenrock"] = true
  456. staff["sentinels"]["Sentinonyme"] = true
  457. staff["sentinels"]["Thallium"] = true
  458. staff["sentinels"]["Vvarriorw"] = true
  459. staff["sentinels"]["Feikusha"] = true
  460. staff["sentinels"]["Mitropolit"] = true
  461. staff["sentinels"]["Wercade"] = true
  462. staff["sentinels"]["Claumiau"] = true
  463. staff["sentinels"]["Excasr"] = true
  464. staff["sentinels"]["Grastfetry"] = true
  465. staff["sentinels"]["Helderum"] = true
  466. staff["sentinels"]["Kinhusxd"] = true
  467. staff["sentinels"]["Kirbyfleur"] = true
  468. staff["sentinels"]["Qtmari"] = true
  469. staff["sentinels"]["Shirowalda"] = true
  470. staff["sentinels"]["Wolfycatt"] = true
  471. staff["sentinels"]["Belkano"] = true
  472. staff["sentinels"]["Ratacp"] = true
  473. staff["sentinels"]["Ultraspeedy"] = true
  474. staff["sentinels"]["Doraemons"] = true
  475. staff["sentinels"]["Xiezi"] = true
  476. staff["sentinels"]["Arhcies"] = true
  477. staff["sentinels"]["Deneyfaresi"] = true
  478. staff["sentinels"]["Shaumbra"] = true
  479. staff["sentinels"]["Visne"] = true
  480. staff["sentinels"]["Amegake"] = true
  481. staff["sentinels"]["Coska"] = true
  482. staff["sentinels"]["E_330"] = true
  483. staff["sentinels"]["Mesmera"] = true
  484. staff["sentinels"]["Milkycoffee"] = true
  485. staff["sentinels"]["Rekichan"] = true
  486. staff["sentinels"]["Wooferx"] = true
  487. staff["sentinels"]["Flareress"] = true
  488. staff["sentinels"]["Jordynl"] = true
  489. staff["sentinels"]["Methusalah"] = true
  490. staff["sentinels"]["Tarmacadam"] = true
  491. staff["sentinels"]["Xiaojiemei"] = true
  492. staff["sentinels"]["Mrslouzifer"] = true
  493. staff["sentinels"]["Sweetphoenix"] = true
  494. staff["sentinels"]["Calysis"] = true
  495. staff["sentinels"]["Jacobbbbbbb"] = true
  496. staff["sentinels"]["Katburger"] = true
  497. staff["sentinels"]["Luxurz"] = true
  498. staff["sentinels"]["Mausibiene"] = true
  499. staff["sentinels"]["Orangelighthouse"] = true
  500. staff["sentinels"]["Riannaleo"] = true
  501. staff["sentinels"]["Rutabega"] = true
  502. staff["sentinels"]["Safwanrockz"] = true
  503. staff["sentinels"]["Shamousey"] = true
  504. staff["sentinels"]["Veralidaine"] = true
  505. staff["sentinels"]["Vulli"] = true
  506. staff["sentinels"]["Nanjxyz"] = true
  507. staff["sentinels"]["Bembija"] = true
  508. staff["sentinels"]["Layora"] = true
  509. staff["mapcrew"]["+Goondad"] = true
  510. staff["mapcrew"]["A_801"] = true
  511. staff["mapcrew"]["Atinesta"] = true
  512. staff["mapcrew"]["Bogkitty"] = true
  513. staff["mapcrew"]["Chibi0"] = true
  514. staff["mapcrew"]["Epoki"] = true
  515. staff["mapcrew"]["Kurtwild"] = true
  516. staff["mapcrew"]["Leetinsanity"] = true
  517. staff["mapcrew"]["N3x"] = true
  518. staff["mapcrew"]["Sebaisseba"] = true
  519. staff["mapcrew"]["Sharpiepoops"] = true
  520. staff["mapcrew"]["Killerlux"] = true
  521. staff["mapcrew"]["Vvarriorw"] = true
  522. staff["mapcrew"]["Kinhusxd"] = true
  523. staff["mapcrew"]["Kirbyfleur"] = true
  524. staff["mapcrew"]["Wangan"] = true
  525. staff["mapcrew"]["Describe"] = true
  526. staff["mapcrew"]["Mervynpeake"] = true
  527. staff["mapcrew"]["Reshman"] = true
  528. staff["mapcrew"]["Shamousey"] = true
  529. staff["mapcrew"]["Xelidoni"] = true
  530. staff["funcorp"]["Aewing"] = true
  531. staff["funcorp"]["Archaeron"] = true
  532. staff["funcorp"]["Atinesta"] = true
  533. staff["funcorp"]["Becerritomm"] = true
  534. staff["funcorp"]["Bogkitty"] = true
  535. staff["funcorp"]["Celeius"] = true
  536. staff["funcorp"]["Chibi0"] = true
  537. staff["funcorp"]["Chizuko"] = true
  538. staff["funcorp"]["Denadir"] = true
  539. staff["funcorp"]["Epoki"] = true
  540. staff["funcorp"]["Flipgraham"] = true
  541. staff["funcorp"]["Giovaniiii"] = true
  542. staff["funcorp"]["Harshy"] = true
  543. staff["funcorp"]["Hikariblabla"] = true
  544. staff["funcorp"]["Irishcow"] = true
  545. staff["funcorp"]["Kalhyra"] = true
  546. staff["funcorp"]["Kamelotepica"] = true
  547. staff["funcorp"]["Lemodile"] = true
  548. staff["funcorp"]["Loganfrio"] = true
  549. staff["funcorp"]["Makinit"] = true
  550. staff["funcorp"]["Meekoru"] = true
  551. staff["funcorp"]["Modquack"] = true
  552. staff["funcorp"]["Momobelly"] = true
  553. staff["funcorp"]["Noedles"] = true
  554. staff["funcorp"]["Null"] = true
  555. staff["funcorp"]["Pathynnha"] = true
  556. staff["funcorp"]["Pisciina"] = true
  557. staff["funcorp"]["Podoko"] = true
  558. staff["funcorp"]["Sebaisseba"] = true
  559. staff["funcorp"]["Shamachamp"] = true
  560. staff["funcorp"]["Sharpiepoops"] = true
  561. staff["funcorp"]["Sukelaci"] = true
  562. staff["funcorp"]["Tyyphoon"] = true
  563. staff["funcorp"]["Warfenixkill"] = true
  564. staff["funcorp"]["Yosska"] = true
  565. staff["funcorp"]["Ginkyu"] = true
  566. staff["funcorp"]["Killerlux"] = true
  567. staff["funcorp"]["Miwakiko"] = true
  568. staff["funcorp"]["Nitenrock"] = true
  569. staff["funcorp"]["Thallium"] = true
  570. staff["funcorp"]["Duura"] = true
  571. staff["funcorp"]["Feikusha"] = true
  572. staff["funcorp"]["Lord_oleg"] = true
  573. staff["funcorp"]["Mitropolit"] = true
  574. staff["funcorp"]["Toratyan"] = true
  575. staff["funcorp"]["Wercade"] = true
  576. staff["funcorp"]["Claumiau"] = true
  577. staff["funcorp"]["Ervyor"] = true
  578. staff["funcorp"]["Excasr"] = true
  579. staff["funcorp"]["Explanado"] = true
  580. staff["funcorp"]["Grastfetry"] = true
  581. staff["funcorp"]["Helderum"] = true
  582. staff["funcorp"]["Kinhusxd"] = true
  583. staff["funcorp"]["Kirbyfleur"] = true
  584. staff["funcorp"]["Nukualofa"] = true
  585. staff["funcorp"]["Qtmari"] = true
  586. staff["funcorp"]["Shirowalda"] = true
  587. staff["funcorp"]["Softmode"] = true
  588. staff["funcorp"]["Zoommod"] = true
  589. staff["funcorp"]["Draxterpin"] = true
  590. staff["funcorp"]["Makiiiiis"] = true
  591. staff["funcorp"]["Plubio"] = true
  592. staff["funcorp"]["Ratacp"] = true
  593. staff["funcorp"]["Ultraspeedy"] = true
  594. staff["funcorp"]["Yunowears"] = true
  595. staff["funcorp"]["Doraemons"] = true
  596. staff["funcorp"]["Piratearthur"] = true
  597. staff["funcorp"]["Wangan"] = true
  598. staff["funcorp"]["Arhcies"] = true
  599. staff["funcorp"]["Deneyfaresi"] = true
  600. staff["funcorp"]["Ediz"] = true
  601. staff["funcorp"]["Shaumbra"] = true
  602. staff["funcorp"]["Shebnem"] = true
  603. staff["funcorp"]["Visne"] = true
  604. staff["funcorp"]["Arleen"] = true
  605. staff["funcorp"]["Arcanacra"] = true
  606. staff["funcorp"]["E_330"] = true
  607. staff["funcorp"]["Mesmera"] = true
  608. staff["funcorp"]["Milkycoffee"] = true
  609. staff["funcorp"]["Rekichan"] = true
  610. staff["funcorp"]["Staszekowaty"] = true
  611. staff["funcorp"]["Cheeselicious"] = true
  612. staff["funcorp"]["Distances"] = true
  613. staff["funcorp"]["Flareress"] = true
  614. staff["funcorp"]["Jordynl"] = true
  615. staff["funcorp"]["Kimmowimmo"] = true
  616. staff["funcorp"]["Shinyday"] = true
  617. staff["funcorp"]["Tarmacadam"] = true
  618. staff["funcorp"]["Xiaojiemei"] = true
  619. staff["funcorp"]["Mrslouzifer"] = true
  620. staff["funcorp"]["Anneasaurus"] = true
  621. staff["funcorp"]["Bloodsyn"] = true
  622. staff["funcorp"]["Describe"] = true
  623. staff["funcorp"]["Faiory"] = true
  624. staff["funcorp"]["Hainkeru"] = true
  625. staff["funcorp"]["Icewolfbob"] = true
  626. staff["funcorp"]["Jacobbbbbbb"] = true
  627. staff["funcorp"]["Lostchicken"] = true
  628. staff["funcorp"]["Luxurz"] = true
  629. staff["funcorp"]["Mariexo"] = true
  630. staff["funcorp"]["Mervynpeake"] = true
  631. staff["funcorp"]["Nidoranne"] = true
  632. staff["funcorp"]["Plisette"] = true
  633. staff["funcorp"]["Reshman"] = true
  634. staff["funcorp"]["Riannaleo"] = true
  635. staff["funcorp"]["Rutabega"] = true
  636. staff["funcorp"]["Safwanrockz"] = true
  637. staff["funcorp"]["Secretive"] = true
  638. staff["funcorp"]["Shamousey"] = true
  639. staff["funcorp"]["Veralidaine"] = true
  640. staff["funcorp"]["Vulli"] = true
  641. staff["funcorp"]["Welshnutter"] = true
  642. staff["funcorp"]["Nanjxyz"] = true
  643. staff["funcorp"]["Bembija"] = true
  644. staff["funcorp"]["Layora"] = true
  645.  
  646.  
  647.  
  648. --[[ src/changelog.lua ]]--
  649.  
  650. function showChangelog(days,num,player)
  651. days=days or 7
  652. num=num or 5
  653. local str=translate("changelogtitle",player.lang)
  654. local toshow=0
  655. for i,log in ipairs(changelog) do
  656. local d=dateToTimestamp(log.date)
  657. if (not log.modules or log.modules[module]) and os.time()-d < day*days then
  658. str=str.."\n"..log.date.." - "..table.concat(log.changes,"\n"..log.date.." - ")
  659. toshow=toshow+1
  660. end
  661. if i==num then break end
  662. end
  663. if toshow==0 then
  664. return nil
  665. end
  666. return str
  667. end
  668.  
  669. changelog={
  670. {
  671. date = "01/04/2017",
  672. changes = {"#utility 2.0 is now open source!"}
  673. },
  674. }
  675.  
  676.  
  677. --[[ src/maps/801.lua ]]--
  678.  
  679. maps["801"] = { 6355426 }
  680.  
  681.  
  682. --[[ src/maps/adventure.lua ]]--
  683.  
  684. maps.adventure = {
  685. associative=true,
  686. [1] = 6480752,
  687. [2] = 6480645,
  688. [3] = 6480772,
  689. [4] = 6482254,
  690. [5] = 6497747,
  691. [6] = 6512277,
  692. [7] = 6524720,
  693. [8] = 6538639,
  694. }
  695.  
  696.  
  697. --[[ src/maps/blank.lua ]]--
  698.  
  699. maps.blank = { 4075911 }
  700.  
  701.  
  702. --[[ src/maps/bubbles.lua ]]--
  703.  
  704. maps.bubbles = {4161885,4166873}
  705.  
  706.  
  707. --[[ src/maps/disco.lua ]]--
  708.  
  709. maps.disco = {1958106,3926952,3334000,3333999,2500412,1612690,3920302,2121577}
  710.  
  711.  
  712. --[[ src/maps/lines.lua ]]--
  713.  
  714. maps.lines = { 6411001 }
  715.  
  716.  
  717. --[[ src/maps/mouse.lua ]]--
  718.  
  719. maps.mouse = { 4372664 }
  720.  
  721.  
  722. --[[ src/maps/perm.lua ]]--
  723.  
  724. -- Perm categories. These commands do NOT work in tribe houses
  725.  
  726. if string.byte(tfm.get.room.name,2)~=3 then
  727. maps.p0={name="Unprotected","#0"}
  728. maps.p1={name="Protected","#1"}
  729. maps.p2={name="Prime","#2"}
  730. maps.p3={name="Bootcamp","#3"}
  731. maps.p4={name="Shaman","#4"}
  732. maps.p5={name="Art","#5"}
  733. maps.p6={name="Mechanism","#6"}
  734. maps.p7={name="No-Shaman","#7"}
  735. maps.p8={name="Dual Shaman","#8"}
  736. maps.p9={name="Miscelleneous","#9"}
  737. maps.p10={name="Survivor","#10"}
  738. maps.p11={name="Vampire Survivor","#11"}
  739. maps.p13={name="Bootcamp","#13"}
  740. maps.p17={name="Racing","#17"}
  741. maps.p18={name="Defilante","#18"}
  742. maps.p19={name="Music","#19"}
  743. maps.p20={name="Survivor Testing","#20"}
  744. maps.p21={name="Vampire Survivor Testing","#21"}
  745. maps.p22={name="Tribe House","#22"}
  746. maps.p24={name="Dual Shaman Survivor","#24"}
  747. maps.p32={name="Dual Shaman Testing","#32"}
  748. maps.p38={name="Rato Leve","#38"}
  749. maps.p41={name="Module","#41"}
  750. maps.p42={name="No-Shaman Testing","#42"}
  751. maps.p44={name="Deleted","#44"}
  752. end
  753.  
  754.  
  755. --[[ src/maps/pictionary.lua ]]--
  756.  
  757. maps.pictionary = {3809991,3810344,3810362,3810493,3621335,3594930,3815744,3834347,3836086,3834417,3835637,3836259,3838082,3838388,3835617,3834446,3849161,3851384,3851443,3852901,3846731,3864813,3871198,3873223,3886710,3817093,3894926,3910584,3936597,3941239,3952771,3936597,3403045,3596474,3983884,3576182,3601046,3579658,3992302,3993003,3986667,1335279,4006983,3999371,4014899,4086580,4083062,4207549,4101904,4170946,4173716,3997708,4000298}
  758.  
  759.  
  760. --[[ src/maps/playground.lua ]]--
  761.  
  762. -- Maps containing typicial playground items like swings, see-saws and slides. These are NOT maps for the module #playground
  763.  
  764. maps.playground = {3678549,2799512,1602423,2659611,3234179,3382192,4181916,4216638,4130672,3982570,2937173,2541758,2022909}
  765.  
  766.  
  767. --[[ src/maps/prophunt.lua ]]--
  768.  
  769. maps.prophunt = {4388319,4384778,4229685,4388248,4388430,4388541,1086788,1630128,4390788,4392485,1492060,2241886,4391574,4323387,4137198,4388705,3288012,4404369,4329978,4412126,4413691,4415711,4416615,4431668,1089904,4416211,4412155,4418469,4548574,4550652,4547683,4464906,4546078,4579538,4650301,4650639,4296322,4565774,4675995,4737903,4661876,4716310,4739815,4740381,5395569,5361369,5263590,5208188,5148031,3704277,4035119,5022567,5070858,5077197,5003201,4830225,4831088,4447699,4789606,4790376,4757794,4738138,4440887,5501229,4360147,1222731,2334233,5377664,4326708,4328189,4776570,5730891,5517105,5730596}
  770.  
  771.  
  772. --[[ src/maps/retro.lua ]]--
  773.  
  774. maps.retro = {
  775. associative=true,
  776. [0]=960958,
  777. [5]=4386926,
  778. [9]=961029,
  779. [10]=4377126,
  780. [11]=1723255,
  781. [12]=4384018,
  782. [16]=4385979,
  783. [17]=4384202,
  784. [18]=3266729,
  785. [21]=4357108,
  786. [22]=1101299,
  787. [23]=1166835,
  788. [25]=1643218,
  789. [26]={4387359,4387365,4387368,4387373},
  790. [27]=917700,
  791. [31]=961004,
  792. [32]=1544013,
  793. [34]=4359292,
  794. [38]=4397108,
  795. [39]=4397119,
  796. [42]=4386708,
  797. [43]=1316770,
  798. [44]=4397075,
  799. [45]=4396834,
  800. [46]=4396936,
  801. [47]=4391188,
  802. [48]=4393191,
  803. [49]=4432906,
  804. [50]=4397028,
  805. [51]=4432930,
  806. [52]=4393422,
  807. [53]=4396896,
  808. [59]=4407652,
  809. [62]=4444510,
  810. [63]=4386972,
  811. [64]=4386973,
  812. [65]=4386982,
  813. [66]=4386997,
  814. [67]=501416,
  815. [70]=1167279,
  816. [71]=1315192,
  817. [72]=339931,
  818. [74]=4375096,
  819. [79]=353232,
  820. [80]=4383781,
  821. [82]=904352,
  822. [83]=4383981,
  823. [84]=1544173,
  824. [85]=1544347,
  825. [86]=1636769,
  826. [87]=4384001,
  827. [88]=4374508,
  828. [90]=4386112,
  829. [91]=4386101,
  830. [94]=1696031,
  831. [96]=1637053,
  832. [97]=1167664,
  833. [98]=4386324,
  834. [99]={4386426,4386501,4386504,4386509,4387632,4387640},
  835. [555]=4388074,
  836. [560]=4407570,
  837. [666]=6449323,
  838. [777]=4380317,
  839. [888]=4377612,
  840. [1027]=1689093,
  841. [1062]=4444732,
  842. [1067]=4387753,
  843. [1087]=4387783,
  844. [1088]=4387761,
  845. ["fishing"]=4377875,
  846. ["halloween2011"]=4334401,
  847. ["halloween2012"]={4333107,4332385},
  848. ["halloween2013"]={4399273},
  849. ["christmas"]=4384281,
  850. ["boat"]=4416773,
  851. ["mansion"]=4399576,
  852. ["valentines"]=3607870
  853. }
  854.  
  855.  
  856. --[[ src/maps/retrobootcamp.lua ]]--
  857.  
  858. maps.retrobootcamp = {150813,154066,155517,155541,156118,156510,157035,157098,158053,158598,159116,159145,161016,163080,163133,163181,163758,165263,165896,166041,166829,167333,169093,170007,170483,171775,173223,174065,174725,175454,176463,176555,176614,176615,177154,177652,178297,179629,180365,182681,185527,186368,186855,187035,187478,187694,189354,190574,191916,192112,192208,192255,192519,192560,193213,195160,195453,195672,197368,198991,199516,199705,200363,201125,201172,202186,203883,204472,204892,205038,205156,205237,205449,205473,206233,208548,209030,209040,210603,212322,212954,212983,213562,215526,215852,215933,216088,216140,216659,217628,219800,219956,220013,222472,222779,222787,223476,223560,223577,223785,225484,225745,226930,227013,227093,229802,231109,231895,232068,232385,232675,233967,233971,234647,235717,236188,236618,236660,236804,236948,237119,237303,238029,238032,238487,238660,238951,239673,239698,239971,242291,242351,244887,244901,245908,246005,247311,249003,249760,249998,250912,252142,253469,254880,255261,255943,257035,257092,258054,258142,258289,259029,259903,259952,260345,260600,261443,261784,262196,262533,263883,263922,264295,266002,266398,268137,268224,268499,268673,268794,268919,269904,269993,270309,270355,270576,270650,270655,270681,270745,270970,271193,271470,271794,271807,271877,271890,272179,272183,272997,273373,273935,274293,275604,275626,275629,275667,275739,275747,275897,277043,277631,277665,277835,279238,279332,279502,279611,280949,281668,281985,282332,283757,283893,283935,284184,284522,285196,285589,285673,285961,286591,287656,287695,287799,287815,288022,288106,288284,288402,289157,289445,290763,290770,291513,292003,292473,292627,292668,292808,292809,292827,293306,293472,293559,293658,293675,294249,294478,294523,295465,295487,295620,296251,296579,297361,297450,297630,298424,299871,299872,300796,301193,301195,301309,301559,301775,301959,302070,302432,302624,303038,305452,305680,305709,305723,305826,306145,306418,306579,306629,306639,307465,308728,308964,309017,309526,309691,310534,310873,311313,312311,313089,313117,313139,313214,315155,315283,315868,316033,316520,317400,317971,318952,319073,319286,319445,319627,319953,320058,320342,320502,320607,321187,321693,321944,321999,322026,322282,322596,322649,322905,322922,323307,323602,324807,326600,326870,327272,327605,327712,328098,328351,328397,328665,329052,329196,329201,329230,329244,329246,329269,329345,330601,330841,331399,332040,332297,332405,333388,334234,335043,335391,336281,336437,336728,338063,339057,339345,339839,341429,342200,342640,343392,343875,346684,346719,346830,347077,347669,348302,349233,350508,350598,350888,351589,352925,353356,353441,354159,354643,354784,355332,355336,355936,356135,356262,356676,357814,357892,358014,358075,360040,360629,361979,362400,362544,362620,362964,363036,365337,366343,366809,367891,369468,370586,371206,371235,371579,372583,373620,373804,374058,374542,374995,375225,376703,377909,378002,378106,379201,383602,383812,385707,387985,392235,392386,392434,392861,393486,395965,397258,397530,397533,404881,405284,405878,408590,408895,410053,417799,419198,423139,424528,424609,429635,430794,431624,431873,437120,437558,439128,440367,441615,446982,447816,449285,451146,452908,455499,458528,459530,462004,462035,472870,477960,478550,478712,482311,485943,487307,491126,495981,496610,497754,499403,500868,501622,502299,503358,503496,503679,505445,507341,507884,514604,515684,518064,521120,522095,528782,534644,534872,535533,541247,542022,542848,543186,544304,544695,544697,546478,548524,549129,549574,549666,552861,554154,556724,559517,560722,571124,578640,588955,591528,593003,597348,600432,612542,623417,624656,836190,889697,889714,889731,889879,889891,889900,889914,889928,889949,889972,890027,890033,890039,890053,890075,890086,890136,890147,890160,890192,911578,1096608,1132417,1212675,1266330}
  859.  
  860.  
  861. --[[ src/maps/retrosurvivor.lua ]]--
  862.  
  863. maps.retrosurvivor = {6367075, 6367088, 6367090, 6367092, 6367093, 6367094, 6367095, 6367096, 6367102, 6367103, 6367105, 6367106, 6367108}
  864.  
  865.  
  866. --[[ src/maps/sports.lua ]]--
  867.  
  868. maps.sports = {2512062,2591509,2504921,2838853,2483033,2838852,3133327,2729274,4266293,6157962}
  869.  
  870.  
  871. --[[ src/maps/tribehouse.lua ]]--
  872.  
  873. maps.tribehouse = {1062966,2875278,3350212,2945258,3715006,3692897,2875713,898690,2942796,3998605,2977496,4013395,3770902,813111,4057390,1781199,2977808,4013312,1562120,2845278,3357337,3340742,3033235,2708641,3807907,3917456,2735276,3440956,3385527,3387601,1201078,3361756,3478060,1252318,2026183,1867004,3792574,3161243,1564662,3178265,3490516,3493510,3241180,805739,3359366,2574774,3308994,3173473,3186856,3344330,3188681,3709376,3601296,3225320,3052771,2631990,3210727,3813742,3866169,2076649,4229685,3027387,4330286,1435432,939741,943383,4384778,1100267,964711,4667449,4000002,2999997,4995506,4158519,5100507,4942685,5165396,4881124,5139956,5008162,4983947,5070570,4994050,988050,5157999,3412288,4657185,1890739,3515460,2777198,5058219}
  874.  
  875.  
  876. --[[ src/maps/turnaround.lua ]]--
  877.  
  878. maps.turnaround = {841796,837314,836847,836583,836582,836580,836577,836572,836141,835956,835942,835898,835884,835871,835043,2785817}
  879.  
  880.  
  881. --[[ src/maps/vanillasolo.lua ]]--
  882.  
  883. -- A list of vanilla maps that can be completed by mice with no shaman intervention
  884.  
  885. maps.vanillasolo = {2,8,10,11,12,19,22,24,40,44,45,50,52,53,55,66,67,69,70,71,74,79,80,86,88,100,119,123,138,142}
  886.  
  887.  
  888. --[[ src/maps/videos.lua ]]--
  889.  
  890. maps.videos = {2014863,2020312,1984227,2025918,2036532,2086429,2161612,2151951,2874626,2877114,957820,2016000,3392011,2117780,2056314,1057928,4064250,2968510,3480015,3005022,2995503,4097144,4102138,1583750,23993912093300,3218740,201975,2334844,2852174,2543916,3918365,4133788,4014899,4663903,4946081,3500899,800561,2114341,2020199}
  891.  
  892.  
  893. --[[ src/maps/wedding.lua ]]--
  894.  
  895. maps.wedding = {5056279,5014080,2779766,3470307,4184182}
  896.  
  897.  
  898. --[[ src/lib/2d-vector.lua ]]--
  899.  
  900. -- 2D Vector class
  901.  
  902. Vector = {}
  903. Vector.__index = Vector
  904.  
  905. Vector.__add = function(a, b)
  906. if type(a) == "number" then
  907. return Vector(b.x + a, b.y + a)
  908. elseif type(b) == "number" then
  909. return Vector(a.x + b, a.y + b)
  910. else
  911. return Vector(a.x + b.x, a.y + b.y)
  912. end
  913. end
  914.  
  915. Vector.__sub = function(a, b)
  916. if type(a) == "number" then
  917. return Vector(a - b.x, a - b.y)
  918. elseif type(b) == "number" then
  919. return Vector(a.x - b, a.y - b)
  920. else
  921. return Vector(a.x - b.x, a.y - b.y)
  922. end
  923. end
  924.  
  925. Vector.__mul = function(a, b)
  926. if type(a) == "number" then
  927. return Vector(b.x * a, b.y * a)
  928. elseif type(b) == "number" then
  929. return Vector(a.x * b, a.y * b)
  930. else
  931. return Vector(a.x * b.x, a.y * b.y)
  932. end
  933. end
  934.  
  935. Vector.__div = function(a, b)
  936. if type(a) == "number" then
  937. return Vector(a / b.x, a / b.y)
  938. elseif type(b) == "number" then
  939. return Vector(a.x / b, a.y / b)
  940. else
  941. return Vector(a.x / b.x, a.y / b.y)
  942. end
  943. end
  944.  
  945. Vector.__eq = function(a, b)
  946. return a.x == b.x and a.y == b.y
  947. end
  948.  
  949. Vector.__lt = function(a, b)
  950. return a.x < b.x or (a.x == b.x and a.y < b.y)
  951. end
  952.  
  953. Vector.__le = function(a, b)
  954. return a.x <= b.x and a.y <= b.y
  955. end
  956.  
  957. Vector.__tostring = function(a)
  958. return "(" .. a.x .. ", " .. a.y .. ")"
  959. end
  960.  
  961. setmetatable(Vector, {
  962. __call = classCall
  963. })
  964.  
  965. function Vector:new(x, y)
  966. self.x = x or 0
  967. self.y = y or 0
  968. end
  969.  
  970. function Vector.distance(a, b)
  971. return (b - a):len()
  972. end
  973.  
  974. function Vector:clone()
  975. return Vector(self.x, self.y)
  976. end
  977.  
  978. function Vector:unpack()
  979. return self.x, self.y
  980. end
  981.  
  982. function Vector:len()
  983. return math.sqrt(self.x * self.x + self.y * self.y)
  984. end
  985.  
  986. function Vector:lenSq()
  987. return self.x * self.x + self.y * self.y
  988. end
  989.  
  990. function Vector:normalize()
  991. local len = self:len()
  992. self.x = self.x / len
  993. self.y = self.y / len
  994. return self
  995. end
  996.  
  997. function Vector:normalized()
  998. return self / self:len()
  999. end
  1000.  
  1001. function Vector:floored()
  1002. return Vector(math.floor(self.x), math.floor(self.y))
  1003. end
  1004.  
  1005. function Vector:rotate(phi)
  1006. local c = math.cos(phi)
  1007. local s = math.sin(phi)
  1008. self.x = c * self.x - s * self.y
  1009. self.y = s * self.x + c * self.y
  1010. return self
  1011. end
  1012.  
  1013. function Vector:rotated(phi)
  1014. return self:clone():rotate(phi)
  1015. end
  1016.  
  1017. function Vector:perpendicular()
  1018. return Vector(-self.y, self.x)
  1019. end
  1020.  
  1021. function Vector:projectOn(other)
  1022. return (self * other) * other / other:lenSq()
  1023. end
  1024.  
  1025. function Vector:cross(other)
  1026. return self.x * other.y - self.y * other.x
  1027. end
  1028.  
  1029. function Vector:dot(other)
  1030. return self.x * other.x + self.y * other.y
  1031. end
  1032.  
  1033.  
  1034.  
  1035. --[[ src/lib/library.lua ]]--
  1036.  
  1037. function inSquare(x1,y1,x2,y2,r)
  1038. return x1>x2-r and x1<x2+r and y1>y2-r and y1<y2+r
  1039. end
  1040.  
  1041. function string.split(str,s)
  1042. if not str then
  1043. return nil
  1044. end
  1045. local res = {}
  1046. for part in string.gmatch(str, "[^" .. s .. "]+") do
  1047. table.insert(res, part)
  1048. end
  1049. return res
  1050. end
  1051.  
  1052. function table.getl(rawTable)
  1053. local count = 0
  1054. for index in pairs(rawTable) do
  1055. count = count+1
  1056. end
  1057. return count
  1058. end
  1059.  
  1060. function unpack(t,i,j) local i,j=i or 1,j or #t if i<=j then return t[i],unpack(t,i+1,j) end end
  1061.  
  1062. function table.random(t,recursive,associative)
  1063. local tbl={}
  1064. if associative then
  1065. for k,v in pairs(t) do
  1066. table.insert(tbl,v)
  1067. end
  1068. else
  1069. for k,v in ipairs(t) do
  1070. table.insert(tbl,v)
  1071. end
  1072. end
  1073. local val=tbl[math.random(#tbl)]
  1074. if recursive and type(val)=="table" then
  1075. return table.random(t,true)
  1076. else
  1077. return val
  1078. end
  1079. end
  1080.  
  1081. function pythag(x1,y1,x2,y2,r)
  1082. local x=x2-x1
  1083. local y=y2-y1
  1084. local r=r+r
  1085. return x*x+y*y<r*r
  1086. end
  1087.  
  1088. function distance(x1,y1,x2,y2)
  1089. return math.sqrt((x2-x1)^2+(y2-y1)^2)
  1090. end
  1091.  
  1092. function upper(str)
  1093. if not str then return nil end
  1094. return equalAny(str:sub(1,1), "+", "*") and str:sub(1,2):upper()..str:sub(3):lower() or str:sub(1,1):upper()..str:sub(2):lower()
  1095. end
  1096.  
  1097. function equalAny(v, ...)
  1098. for _, a in pairs({...}) do
  1099. if a == v then
  1100. return true
  1101. end
  1102. end
  1103. end
  1104.  
  1105. function dateToTimestamp(timeToConvert)
  1106. local pattern = "(%d+)/(%d+)/(%d+)"
  1107. local runday, runmonth, runyear = timeToConvert:match(pattern)
  1108. return os.time({year=runyear,month=runmonth,day=runday,hour=0,min=0,sec=0})
  1109. end
  1110. day=86400000
  1111.  
  1112. function printInfo(tbl, value, name, tabs)
  1113. tabs=tabs or ""
  1114. local t=type(value)
  1115. print(tabs .. t .. " " .. tostring(tbl) .. " = " .. tostring(value),name)
  1116. if t=="table" then
  1117. for n,v in pairs(value) do
  1118. if v==value then
  1119. print(tabs.."\tself "..n,name)
  1120. else
  1121. printInfo(n,v,name,tabs.."\t")
  1122. end
  1123. end
  1124. end
  1125. end
  1126.  
  1127.  
  1128. --[[ src/lib/linked-list.lua ]]--
  1129.  
  1130. -- Doubly linked list implementation
  1131.  
  1132. rawnext = next
  1133. function next(t,k)
  1134. local m = getmetatable(t)
  1135. local n = m and m.__next or rawnext
  1136. return n(t,k)
  1137. end
  1138. function pairs(t) return next, t, nil end
  1139.  
  1140. function classCall(cls, ...)
  1141. local self = setmetatable({}, cls)
  1142. self:new(...)
  1143. return self
  1144. end
  1145.  
  1146. local LLIterator = {}
  1147. LLIterator.__index = LLIterator
  1148. LLIterator.__next = function(it, key)
  1149. if key and key >= it:get().size then
  1150. return nil
  1151. end
  1152. return it:next()
  1153. end
  1154.  
  1155. setmetatable(LLIterator, {
  1156. __call = classCall
  1157. })
  1158.  
  1159. function LLIterator:new(ll)
  1160. self.ll = ll
  1161. self.currentIndex = 0
  1162. self.current = nil
  1163. end
  1164.  
  1165. function LLIterator:get()
  1166. return self.ll
  1167. end
  1168.  
  1169. function LLIterator:next()
  1170. local ind = self.currentIndex + 1
  1171.  
  1172. if ind == 1 then
  1173. self.current = self.ll.head
  1174. else
  1175. self.current = self.current.next
  1176. end
  1177. self.currentIndex = ind
  1178.  
  1179. return ind, self.current.value
  1180. end
  1181.  
  1182. local LinkedList = {}
  1183. LinkedList.__index = function(ll, key)
  1184. if type(key) == 'number' and key % 1 == 0 then
  1185. return ll:get(key)
  1186. else
  1187. return rawget(LinkedList, key)
  1188. end
  1189. end
  1190. LinkedList.__tostring = function(ll)
  1191. local str = ''
  1192. for i,v in pairs(ll:iterator()) do
  1193. if #str > 0 then
  1194. str = str .. ','
  1195. end
  1196. str = str .. tostring(v)
  1197. end
  1198. return string.format('(%s)', str)
  1199. end
  1200.  
  1201. setmetatable(LinkedList, {
  1202. __call = classCall
  1203. })
  1204.  
  1205. function LinkedList:new(...)
  1206. self.head = nil
  1207. self.tail = nil
  1208. self.size = 0
  1209. end
  1210.  
  1211. -- add to the front
  1212. function LinkedList:addFirst(val)
  1213. local v = {
  1214. value = val,
  1215. next = self.head,
  1216. prev = nil
  1217. }
  1218. if not self.tail then -- empty
  1219. self.tail = v
  1220. end
  1221. if self.head then
  1222. self.head.prev = v
  1223. end
  1224. self.head = v
  1225. self.size = self.size + 1
  1226. end
  1227.  
  1228. -- add to the back
  1229. function LinkedList:add(val)
  1230. local v = {
  1231. value = val,
  1232. next = nil,
  1233. prev = self.tail
  1234. }
  1235. if self.tail and self.head then
  1236. self.tail.next = v
  1237. else
  1238. self.head = v
  1239. end
  1240. self.tail = v
  1241. self.size = self.size + 1
  1242. end
  1243.  
  1244. -- add to the back
  1245. function LinkedList:push(val)
  1246. self:add(val)
  1247. end
  1248.  
  1249. -- get head
  1250. function LinkedList:peek()
  1251. if self.head then
  1252. return self.head.value
  1253. else
  1254. error("LinkedList is empty.")
  1255. end
  1256. end
  1257.  
  1258. -- get tail
  1259. function LinkedList:peekLast()
  1260. if self.tail then
  1261. return self.tail.value
  1262. else
  1263. error("LinkedList is empty.")
  1264. end
  1265. end
  1266.  
  1267. -- remove and return head
  1268. function LinkedList:poll()
  1269. local ret = self:peek()
  1270. self.head = self.head.next
  1271. if not self.head then
  1272. self.tail = nil
  1273. else
  1274. self.head.prev = nil
  1275. end
  1276. self.size = self.size - 1
  1277. return ret
  1278. end
  1279.  
  1280. -- remove and return tail
  1281. function LinkedList:pop()
  1282. local ret = self:peekLast()
  1283. self.tail = self.tail.prev
  1284. if not self.tail then
  1285. self.head = nil
  1286. else
  1287. self.tail.next = nil
  1288. end
  1289. self.size = self.size - 1
  1290. return ret
  1291. end
  1292.  
  1293. -- get i-th element
  1294. function LinkedList:get(i)
  1295. if i < 1 or i > self.size then
  1296. error("Out of bounds.")
  1297. end
  1298. if i == 1 then return self.head.value end
  1299. if i == self.size then return self.tail.value end
  1300. local left = i <= math.ceil(self.size / 2)
  1301. local incr = left and 1 or -1
  1302.  
  1303. local j = left and 1 or self.size
  1304. local ret = left and self.head or self.tail
  1305. while j ~= i do
  1306. ret = left and ret.next or ret.prev
  1307. j = j + incr
  1308. end
  1309. return ret.value
  1310. end
  1311.  
  1312. function LinkedList:iterator()
  1313. return LLIterator(self)
  1314. end
  1315.  
  1316. function LinkedList:toList()
  1317. local tbl = {}
  1318. for i,v in pairs(self:iterator()) do
  1319. tbl[i] = v
  1320. end
  1321. return tbl
  1322. end
  1323.  
  1324.  
  1325. --[[ src/lib/maps.lua ]]--
  1326.  
  1327. function randomMap(tbl)
  1328. if tbl.associative then
  1329. local t={}
  1330. for k,v in pairs(tbl) do
  1331. if k~="associative" then
  1332. table.insert(t,v)
  1333. end
  1334. end
  1335. local m=t[math.random(#t)]
  1336. if type(m)=="table" then
  1337. return m[math.random(#m)]
  1338. else
  1339. return m
  1340. end
  1341. else
  1342. return tbl[math.random(#tbl)]
  1343. end
  1344. end
  1345.  
  1346. function selectMap(map,category)
  1347. if map then
  1348. if category and maps[category] and (maps[category][tonumber(map)] or maps[category][map]) then
  1349. local m=maps[category][tonumber(map)] or maps[category][map]
  1350. if type(m)=="table" then m=table.random(m,false,true) end
  1351. playMap(m)
  1352. elseif category and maps[category] then
  1353. playMap(randomMap(maps[category]))
  1354. elseif category and modes[tostring(category):lower()] then
  1355. tempMode=category:lower()
  1356. playMap(map)
  1357. elseif maps[map] then
  1358. playMap(randomMap(maps[map]))
  1359. else
  1360. playMap(map)
  1361. end
  1362. else
  1363. if mapInfo.queue[1] then
  1364. playMap(mapInfo.queue[1].map)
  1365. tfm.exec.chatMessagePublic("loadingmap",players,mapInfo.queue[1].map,mapInfo.queue[1].name)
  1366. table.remove(mapInfo.queue,1)
  1367. else
  1368. local tbl={} for k,v in pairs(SETTINGS.ROTATION) do table.insert(tbl,k) end
  1369. local category=tbl[math.random(#tbl)]
  1370. playMap(randomMap(maps[category]) or 0)
  1371. end
  1372. end
  1373. end
  1374.  
  1375. function playMap(map)
  1376. local timeSinceLastLoad=os.time()-mapInfo.lastLoad
  1377. if timeSinceLastLoad<=3000 then
  1378. --tfm.exec.chatMessage("Error. Map trying to reload: "..map)
  1379. local timeUntilNextLoad=3000-timeSinceLastLoad
  1380. if timeUntilNextLoad<1000 then timeUntilNextLoad=1000 end
  1381. if mapInfo.timer then system.removeTimer(mapInfo.timer) mapInfo.timer=nil end
  1382. mapInfo.timer=system.newTimer(function(...)
  1383. local arg={...}
  1384. --tfm.exec.chatMessage("Reloading "..tostring(arg[2]))
  1385. playMap(arg[2])
  1386. end,timeUntilNextLoad,false,map,map)
  1387. else
  1388. --tfm.exec.chatMessage("Map "..map.." loaded!")
  1389. tfm.exec.newGame(map,false)
  1390. mapInfo.lastLoad=os.time()
  1391. end
  1392. end
  1393.  
  1394. function parseMapXML()
  1395. local m={
  1396. loaded=false,
  1397. segments={},
  1398. grounds={},
  1399. decorations={},
  1400. spawns={},
  1401. shamspawns={},
  1402. holes={},
  1403. cheese={},
  1404. length=800,
  1405. height=400,
  1406. code=tonumber(string.match(tfm.get.room.currentMap,"%d+")) or 0,
  1407. wind=0,
  1408. gravity=10,
  1409. }
  1410. if #tostring(m.code)<=3 and tfm.get.room.currentMap~="@0" then
  1411. m.mode="vanilla"
  1412. else
  1413. m.xml=tfm.get.room.xmlMapInfo.xml
  1414. local g=getValueFromXML
  1415. local P=m.xml:match('<C><P (.-) /><Z>') or ""
  1416. m.perm=tfm.get.room.xmlMapInfo.permCode
  1417. m.author=g(P,"author") or tfm.get.room.xmlMapInfo.author or "Tigrounette"
  1418. m.title=g(P,"title")
  1419. m.id=g(P,"id")
  1420. m.length=g(P,"L") or 800
  1421. m.height=g(P,"H") or 400
  1422. m.reload=g(P,"reload") and true or false
  1423. local bg=g(P,"bg")
  1424. if bg then m.bg=getBackgrounds(bg,".jpg") end
  1425. local bg=g(P,"bg")
  1426. if fg then m.bg=getBackgrounds(fg,".png") end
  1427. local wg=g(P,"G")
  1428. if wg and #wg>2 then
  1429. wg=string.split(wg,",")
  1430. m.wind=tonumber(wg[1]) or 0
  1431. m.gravity=tonumber(wg[2]) or 10
  1432. end
  1433. local segmentstr=g(P,"segments")
  1434. if segmentstr then
  1435. for k,v in pairs(string.split(segmentstr,",")) do
  1436. m.segments[v]=true
  1437. end
  1438. end
  1439. m.collision=g(P,"C") and true
  1440. m.soulmate=g(P,"A") and true
  1441. m.nightmode=g(P,"N") and true
  1442. m.aie=g(P,"aie") and true
  1443. m.portals=g(P,"P") and true
  1444. m.mgoc=g(P,"mgoc")
  1445. for ground in m.xml:gmatch("<S [^/]+/>") do
  1446. local P=string.split(g(ground,"P"),",")
  1447. table.insert(m.grounds,{
  1448. id=#m.grounds+1,
  1449. x=g(ground,"X"),
  1450. y=g(ground,"Y"),
  1451. height=g(ground,"H"),
  1452. length=g(ground,"L"),
  1453. type=g(ground,"T"),
  1454. color=g(ground,"o"),
  1455. dynamic=tonumber(P[1]),
  1456. mass=tonumber(P[2]),
  1457. friction=tonumber(P[3]),
  1458. restitution=tonumber(P[4]),
  1459. rotation=tonumber(P[5]),
  1460. })
  1461. end
  1462. local openingP=true
  1463. for decoration in m.xml:gmatch("<P[^/]+/>") do
  1464. if not openingP then
  1465. local P=string.split(g(decoration,"P"),",")
  1466. table.insert(m.decorations,{
  1467. id=g(decoration,"T"),
  1468. x=g(decoration,"X"),
  1469. y=g(decoration,"Y"),
  1470. color=C,
  1471. flip=P[2]=="1" and true or nil
  1472. })
  1473. end
  1474. openingP=nil
  1475. end
  1476. for spawn in m.xml:gmatch("<DS [^/]+/>") do
  1477. table.insert(m.spawns,{
  1478. x=g(spawn,"X"),
  1479. y=g(spawn,"Y"),
  1480. })
  1481. end
  1482. --[[
  1483. local multispawns=g(P,"DS")
  1484. if multispawns then
  1485. multispawns=string.split(multispawns,",")
  1486. for i=1,#multispawns,2 do
  1487. if tonumber(multispawns[i]) and tonumber(multispawns[i+1]) then
  1488. tableinsert(m.spawns,{
  1489. x=tonumber(multispawns[i]),
  1490. y=tonumber(multispawns[i+1])
  1491. })
  1492. end
  1493. end
  1494. end
  1495. ]]
  1496. for spawn in m.xml:gmatch("<DC [^/]+/>") do
  1497. table.insert(m.shamspawns,{
  1498. x=g(spawn,"X"),
  1499. y=g(spawn,"Y"),
  1500. })
  1501. end
  1502. for spawn in m.xml:gmatch("<DC2 [^/]+/>") do
  1503. table.insert(m.shamspawns,{
  1504. x=g(spawn,"X"),
  1505. y=g(spawn,"Y"),
  1506. })
  1507. end
  1508. for hole in m.xml:gmatch("<T [^/]+/>") do
  1509. table.insert(m.holes,{
  1510. x=g(hole,"X"),
  1511. y=g(hole,"Y"),
  1512. })
  1513. end
  1514. end
  1515. return m
  1516. end
  1517.  
  1518. function getValueFromXML(str,attribute)
  1519. return tonumber(str:match(('%s="([^"]+)"'):format(attribute))) or str:match(('%s="([^"]+)"'):format(attribute)) or str:match(('%s=""'):format(attribute))
  1520. end
  1521.  
  1522. function getBackgrounds(str,extension)
  1523. local imgs={}
  1524. for _,bg in ipairs(string.split(str,";")) do
  1525. local t={img="",x=0,y=0}
  1526. for i,s in ipairs(string.split(bg,",")) do
  1527. if i==1 then t.img=s
  1528. elseif i==2 and tonumber(s) then t.x=tonumber(s)
  1529. elseif i==3 and tonumber(s) then t.y=tonumber(s) end
  1530. end
  1531. if not t.img:find("%.") then
  1532. t.img=t.img..extension
  1533. end
  1534. --if #t.img>11 then
  1535. table.insert(imgs,t)
  1536. --end
  1537. end
  1538. return #imgs>0 and imgs or nil
  1539. end
  1540.  
  1541. function setMapName()
  1542. if map.id then
  1543. ui.setMapName("<J>"..map.id)
  1544. elseif map.title and map.author then
  1545. ui.setMapName("<J>"..map.title.." <BL>- "..map.author)
  1546. elseif map.title then
  1547. ui.setMapName("<J>"..map.title)
  1548. elseif map.author and map.author~=tfm.get.room.xmlMapInfo.author then
  1549. ui.setMapName("<J>"..map.author.." <BL>- "..map.code)
  1550. end
  1551. end
  1552.  
  1553.  
  1554. --[[ src/lib/misc.lua ]]--
  1555.  
  1556.  
  1557. function hexColorEntering(letter)
  1558. local fn=function(player,down,x,y)
  1559. if ranks[player.name]>=RANKS.ROOM_ADMIN and down and player.draw.enteringColor then
  1560. _S.draw.addHexCharToColor(player,letter)
  1561. end
  1562. end
  1563. return fn
  1564. end
  1565.  
  1566. function highscore()
  1567. local hiscore={0}
  1568. for name,player in pairs(tfm.get.room.playerList) do
  1569. if player.score>=hiscore[1] then
  1570. hiscore={player.score,name}
  1571. end
  1572. end
  1573. return hiscore[2]
  1574. end
  1575.  
  1576. function hearts(player)
  1577. local width=16
  1578. for i=1,#hearts do
  1579. tfm.exec.removeImage(hearts[i])
  1580. end
  1581. player.hearts={}
  1582. if player.hearts then
  1583. local s=#player.hearts.count*(width+3)
  1584. for i=1,#player.hearts do
  1585. table.insert(player.hearts,tfm.exec.addImage("ndStXBw.png","$"..player.name,-(s/2)+(i*(width+3))-((width/2)*i),-50))
  1586. end
  1587. end
  1588. end
  1589.  
  1590. function translate(str,lang)
  1591. lang=lang or "en"
  1592. return translations[lang] and translations[lang][str] or translations["en"][str] or str or "Error"
  1593. end
  1594.  
  1595. function tfm.exec.chatMessagePublic(str,players,...)
  1596. local arg={...}
  1597. if arg and arg[1] then
  1598. for n,p in pairs(players) do
  1599. tfm.exec.chatMessage(translate(str,p.lang):format(...),p.name)
  1600. end
  1601. else
  1602. for n,p in pairs(players) do
  1603. tfm.exec.chatMessage(translate(str,p.lang),p.name)
  1604. end
  1605. end
  1606. end
  1607.  
  1608. function getColor(color)
  1609. if color and color:sub(1,1)=="#" then color=color:sub(2) end
  1610. if color and tonumber(color,16) then
  1611. color=tonumber(color,16)
  1612. if color==0 then color=1 end
  1613. return color
  1614. elseif color and _S.draw.colors[color:lower()] then
  1615. return _S.draw.colors[color:lower()].color
  1616. end
  1617. end
  1618.  
  1619. function sortScores()
  1620. local tbl={}
  1621. for k,v in pairs(tfm.get.room.playerList) do
  1622. table.insert(tbl,{name=v.playerName,score=v.score})
  1623. end
  1624. table.sort(tbl,function(i,v) return i.score>v.score end)
  1625. return tbl
  1626. end
  1627.  
  1628. function playersAlive()
  1629. local i=0
  1630. for n,p in pairs(tfm.get.room.playerList) do
  1631. if not p.isDead then
  1632. i=i+1
  1633. end
  1634. end
  1635. return i
  1636. end
  1637.  
  1638.  
  1639. --[[ src/lib/notify-listeners.lua ]]--
  1640.  
  1641. -- Notify each active segment that an event has occured
  1642.  
  1643. function initNotifyOrder(event)
  1644. local segmentNames={}
  1645. for sn,s in pairs(_S) do
  1646. if s.callbacks[event] then
  1647. local niceness=s.callbacks[event].pr or 20
  1648. table.insert(segmentNames, {sn, niceness})
  1649. end
  1650. end
  1651. table.sort(segmentNames, function(a,b)
  1652. return a[2] < b[2]
  1653. end)
  1654. notifyOrder[event]=segmentNames
  1655. end
  1656.  
  1657. function notifyListeners(f,prioritized)
  1658. if prioritized then
  1659. for _,no in ipairs(notifyOrder[prioritized]) do
  1660. local sn=no[1]
  1661. local s=_S[sn]
  1662. if f(sn,s) then break end
  1663. end
  1664. else
  1665. local stop=f("global",_S.global)
  1666. for sn,s in pairs(_S) do
  1667. if stop then break end
  1668. if sn~="global" then
  1669. stop=f(sn,s)
  1670. end
  1671. end
  1672. end
  1673. end
  1674.  
  1675. function notifyNameListeners(name,f,prioritized)
  1676. local player=players[name]
  1677. if prioritized then
  1678. for _,no in ipairs(notifyOrder[prioritized]) do
  1679. local sn=no[1]
  1680. local s=_S[sn]
  1681. if player and (player.activeSegments[sn] or (map.segments and map.segments[sn])) then
  1682. if f(player,sn,s) then break end
  1683. end
  1684. end
  1685. else
  1686. local stop=f(player,"global",_S.global)
  1687. for sn,s in pairs(_S) do
  1688. if stop then break end
  1689. if sn~="global" then
  1690. if player and (player.activeSegments[sn] or (map and map.segments and map.segments[sn])) then
  1691. stop=f(player,sn,s)
  1692. end
  1693. end
  1694. end
  1695. end
  1696. end
  1697.  
  1698.  
  1699. --[[ src/lib/segments.lua ]]--
  1700.  
  1701. function toggleSegment(name,segment,active)
  1702. if active then
  1703. activateSegment(name,segment)
  1704. else
  1705. deactivateSegment(name,segment)
  1706. end
  1707. end
  1708.  
  1709. function activateSegment(name,segment)
  1710. local s=_S[segment]
  1711. if s.callbacks.keyboard then
  1712. for key in pairs(s.callbacks.keyboard) do
  1713. system.bindKeyboard(name,key,true,true)
  1714. system.bindKeyboard(name,key,false,true)
  1715. end
  1716. end
  1717. if s.onEnable then
  1718. s.onEnable(players[name])
  1719. end
  1720. players[name].activeSegments[segment]=true
  1721. _S.global.showMenu(name)
  1722. end
  1723.  
  1724. function deactivateSegment(name,segment)
  1725. local s=_S[segment]
  1726. local mouse
  1727. local keys={}
  1728. if s.callbacks.keyboard then
  1729. for key in pairs(s.callbacks.keyboard) do
  1730. keys[key]=true
  1731. end
  1732.  
  1733. -- See if anything else needs to use it, if so it won't unbind.
  1734. for seg in pairs(players[name].activeSegments) do
  1735. if _S[seg] and _S[seg].callbacks then
  1736. if _S[seg].callbacks.keyboard then
  1737. for key in pairs(_S[seg].callbacks.keyboard) do
  1738. if keys[key] then
  1739. keys[key]=nil
  1740. end
  1741. end
  1742. end
  1743. if _S[seg].callbacks.mouse then
  1744. mouse=true
  1745. end
  1746. end
  1747. end
  1748. for key in pairs(keys) do
  1749. system.bindKeyboard(name,key,true,false)
  1750. system.bindKeyboard(name,key,false,false)
  1751. end
  1752. end
  1753. if s.onDisable then
  1754. s.onDisable(players[name])
  1755. end
  1756. players[name].activeSegments[segment]=nil
  1757. _S.global.showMenu(name)
  1758. end
  1759.  
  1760. function bindChatCommands()
  1761. for _,segment in pairs(_S) do
  1762. if segment.callbacks and segment.callbacks.chatCommand then
  1763. for cmd in pairs(segment.callbacks.chatCommand) do
  1764. system.disableChatCommandDisplay(cmd,true)
  1765. end
  1766. end
  1767. end
  1768. end
  1769.  
  1770. function defaultToggleSegmentChatCallback(segment)
  1771. local fn=function(player,...)
  1772. local arg={...}
  1773. if arg[1] and (arg[1] == "on" or arg[1] == "off") then
  1774. table.insert(arg, 1, "all") -- insert "all" at 1, moving "on" or "off" to index 2
  1775. executeCommand(player, function(a, enable)
  1776. toggleSegment(a,segment,enable == "on")
  1777. end, arg)
  1778. else
  1779. executeCommand(player, function(a)
  1780. toggleSegment(a,segment,not players[a].activeSegments[segment])
  1781. end, arg)
  1782. end
  1783. end
  1784. return fn
  1785. end
  1786.  
  1787. function executeCommand(player,f,arg)
  1788. local getTargets = function()
  1789. local ret = {}
  1790. local addMe = function(args)
  1791. ret[player.name] = args
  1792. end
  1793. local str = arg[1]
  1794. if str then
  1795. if str == "all" or str == "*" then
  1796. table.remove(arg, 1)
  1797. for n in pairs(players) do
  1798. ret[n] = arg
  1799. end
  1800. elseif str == "me" then
  1801. table.remove(arg, 1)
  1802. addMe(arg)
  1803. else
  1804. local i = 0
  1805. for j,a in ipairs(arg) do
  1806. local n = tonumber(a) or upper(a)
  1807. if players[n] then
  1808. ret[n] = true
  1809. else
  1810. break
  1811. end
  1812. i = j
  1813. end
  1814. if i == 0 then
  1815. addMe(arg)
  1816. else
  1817. local tmp = {}
  1818. for k = 1, #arg - i do
  1819. tmp[k] = arg[i + k]
  1820. end
  1821. for n in pairs(ret) do
  1822. ret[n] = tmp
  1823. end
  1824. end
  1825. end
  1826. else
  1827. addMe(arg)
  1828. end
  1829. return ret
  1830. end
  1831. local targets = getTargets() -- of the shape {name1={rest of the arguments}, name2={...}, name3={...}, ...}
  1832. -- if there are no more non-name arguments it will be {name1=true, name2=true, name3=true} mesa thinks
  1833. for t,args in pairs(targets) do
  1834. f(t, unpack(args)) -- t is targetName, followed by rest of arguments
  1835. end
  1836. return targets
  1837. end
  1838.  
  1839.  
  1840. --[[ src/events/eventChatCommand.lua ]]--
  1841.  
  1842. function eventChatCommand(name,message)
  1843. local args = string.split(message, "%s")
  1844. local cmd = table.remove(args, 1)
  1845.  
  1846. notifyNameListeners(name, function(player,sn,s)
  1847. if s.callbacks.chatCommand then
  1848. local cb=s.callbacks.chatCommand[cmd]
  1849. if cb then
  1850. local privLevel=cb.rank or 1
  1851. if ranks[name]>=privLevel then
  1852. if not cb.hide then
  1853. for pn,r in pairs(ranks) do
  1854. if players[pn] and r>=RANKS.ROOM_ADMIN then
  1855. tfm.exec.chatMessage("<font color='#AAAAAA'>&#926; ["..name.."] !"..message.."</font>",pn)
  1856. end
  1857. end
  1858. end
  1859. cb.fnc(player, unpack(args))
  1860. else
  1861. tfm.exec.chatMessage(translate("nocmdperms",player.lang),name)
  1862. end
  1863. end
  1864. end
  1865. end)
  1866. end
  1867.  
  1868.  
  1869. --[[ src/events/eventChatMessage.lua ]]--
  1870.  
  1871. function eventChatMessage(name,message)
  1872. -- Notify listeners
  1873. notifyNameListeners(name, function(player,sn,s)
  1874. local cb=s.callbacks.chatMessage
  1875. if cb then
  1876. cb(player)
  1877. end
  1878. end)
  1879.  
  1880. -- Dad jokes galore!
  1881. if math.random(1,200)==1 then
  1882. local lowermessage=message:lower()
  1883. for _,im in ipairs({"i'm ","im ","i'm","im"}) do
  1884. local found=lowermessage:find(im)
  1885. if found and #message>#im then
  1886. tfm.exec.chatMessage("<V>[Dad] <N>Hi "..message:sub(found+#im)..", I'm dad!</b>",name)
  1887. break
  1888. end
  1889. end
  1890. end
  1891. end
  1892.  
  1893.  
  1894. --[[ src/events/eventColorPicked.lua ]]--
  1895.  
  1896. function eventColorPicked(id, name, color)
  1897. -- Notify listeners
  1898. notifyNameListeners(name, function(player,sn,s)
  1899. if s.callbacks.colorPicked then
  1900. local cb=s.callbacks.colorPicked
  1901. if cb then
  1902. cb(player,id,color)
  1903. end
  1904. end
  1905. end)
  1906. end
  1907.  
  1908.  
  1909. --[[ src/events/eventEmotePlayed.lua ]]--
  1910.  
  1911. function eventEmotePlayed(name,emote,param)
  1912. -- Notify listeners
  1913. notifyNameListeners(name, function(player,sn,s)
  1914. local cb=s.callbacks.emotePlayed
  1915. if cb then
  1916. cb(player,emote,param)
  1917. end
  1918. end)
  1919. end
  1920.  
  1921.  
  1922. --[[ src/events/eventKeyboard.lua ]]--
  1923.  
  1924. function eventKeyboard(name,key,down,x,y)
  1925. -- Notify listeners
  1926. notifyNameListeners(name, function(player,sn,s)
  1927. if s.callbacks.keyboard then
  1928. local cb=s.callbacks.keyboard[key]
  1929. if cb then
  1930. cb(player,down,x,y)
  1931. end
  1932. end
  1933. end)
  1934. end
  1935.  
  1936.  
  1937. --[[ src/events/eventLoop.lua ]]--
  1938.  
  1939. function eventLoop(time,remaining)
  1940. currentTime=remaining
  1941. -- Notify listeners
  1942. notifyListeners(function(sn,s)
  1943. if not s.disabled or (map.segments and map.segments[sn]) then
  1944. local cb=s.callbacks.eventLoop
  1945. if cb then
  1946. cb(time,remaining)
  1947. end
  1948. end
  1949. end)
  1950. if not SETTINGS.DISABLEAUTONEWGAME and remaining<=0 and not map.mode == "tribehouse" then
  1951. selectMap()
  1952. end
  1953. if SETTINGS.QUICKRESPAWN and not (map.reload and tfm.get.room.currentMap~=0) and time>=3000 then
  1954. local tbl={}
  1955. for n,t in pairs(toRespawn) do
  1956. if t<=os.time()-1000 then
  1957. tfm.exec.respawnPlayer(n)
  1958. else
  1959. tbl[n]=t
  1960. end
  1961. end
  1962. toRespawn=tbl
  1963. end
  1964. for key,segment in pairs(_S) do
  1965. if segment.toDespawn then
  1966. for i = #segment.toDespawn, 1, -1 do
  1967. local object = segment.toDespawn[i]
  1968. if object.despawn<=os.time() then
  1969. tfm.exec.removeObject(object.id)
  1970. table.remove(segment.toDespawn,i)
  1971. end
  1972. end
  1973. end
  1974. end
  1975. end
  1976.  
  1977.  
  1978. --[[ src/events/eventMouse.lua ]]--
  1979.  
  1980. function eventMouse(name,x,y)
  1981. -- Initialize notify order
  1982. if not notifyOrder.mouse then
  1983. initNotifyOrder("mouse")
  1984. end
  1985. -- Notify listeners
  1986. notifyNameListeners(name, function(player,sn,s)
  1987. local cb=s.callbacks.mouse
  1988. if cb then
  1989. if cb.fnc(player,x,y) then return true end
  1990. end
  1991. return false
  1992. end, "mouse")
  1993. end
  1994.  
  1995.  
  1996. --[[ src/events/eventNewGame.lua ]]--
  1997.  
  1998. function eventNewGame()
  1999. if timerID then
  2000. system.removeTimer(timerID)
  2001. end
  2002. map=parseMapXML()
  2003. if tempMode then map.mode=tempMode end
  2004. if map.reload and (map.code and map.code~=0) then
  2005. system.newTimer(function() selectMap(tfm.get.room.xmlMapInfo.xml) end,3000,false)
  2006. else
  2007. if map.mode and modes[map.mode] then
  2008. map.segments[modes[map.mode]]=true
  2009. end
  2010. end
  2011. if not map.mode then map.mode="tribehouse" end
  2012. tempMode=nil
  2013. for name,player in pairs(players) do
  2014. player.facingRight=true
  2015. player.lastSpawn=os.time()
  2016. end
  2017.  
  2018. if SETTINGS.VOTE_TIME then
  2019. SETTINGS.VOTE_TIME.votes={}
  2020. end
  2021.  
  2022. if SETTINGS.VOTE_SKIP then
  2023. SETTINGS.VOTE_SKIP.votes={}
  2024. SETTINGS.VOTE_SKIP.skipped=nil
  2025. end
  2026.  
  2027. -- Notify listeners
  2028. notifyListeners(function(sn,s)
  2029. if not s.disabled or (map.segments and map.segments[sn]) then
  2030. local cb=s.callbacks.newGame
  2031. if cb then
  2032. cb()
  2033. end
  2034. end
  2035. end)
  2036. for key,segment in pairs(_S) do
  2037. if segment.toDespawn then
  2038. segment.toDespawn={}
  2039. end
  2040. end
  2041. setMapName()
  2042.  
  2043. if map.bg then for i,image in pairs(map.bg) do tfm.exec.addImage(image.img,"?"..(1-i),image.x,image.y) end end
  2044. if map.fg then for i,image in pairs(map.fg) do tfm.exec.addImage(image.img,"!"..(50+i),image.x,image.y) end end
  2045. end
  2046.  
  2047.  
  2048. --[[ src/events/eventNewPlayer.lua ]]--
  2049.  
  2050. function eventNewPlayer(name)
  2051. local player={
  2052. activeSegments={},
  2053. name=name,
  2054. lang=tfm.get.room.playerList[name].community or "en"
  2055. }
  2056. if not ranks[name] then
  2057. ranks[name]=1
  2058. end
  2059. -- Combine defaultPlayer with player
  2060. for _,s in pairs(_S) do
  2061. if s.defaultPlayer then
  2062. s.defaultPlayer(player)
  2063. end
  2064. end
  2065. players[name]=player
  2066. tfm.exec.lowerSyncDelay(name)
  2067.  
  2068. -- Activates segments
  2069. for sn,s in pairs(_S) do
  2070. if player.activeSegments[sn] then
  2071. activateSegment(name,sn)
  2072. end
  2073. end
  2074.  
  2075. -- Show recent changelog
  2076. if showChangelog(7,3,player) then
  2077. tfm.exec.chatMessage(showChangelog(7,3,player),name)
  2078. end
  2079.  
  2080. -- Show random greeting message
  2081. local greets=translate("greetings",player.lang)
  2082. tfm.exec.chatMessage("<J>"..greets[math.random(#greets)],name)
  2083.  
  2084. -- Ranks
  2085. local tribeName=tfm.get.room.playerList[name].tribeName
  2086. if tribeName then
  2087. if string.byte(tfm.get.room.name,2)==3 and (tfm.get.room.name:lower()):match(tfm.get.room.playerList[name].tribeName:lower())then
  2088. ranks[name]=4
  2089. elseif suffix and ((suffix:lower()):match(name:lower()) or (suffix:lower()):match(tfm.get.room.playerList[name].tribeName:lower())) then
  2090. ranks[name]=4
  2091. end
  2092. end
  2093. if not ranks[name] then
  2094. ranks[name]=1
  2095. end
  2096. if ranks[name]>=RANKS.ROOM_ADMIN then
  2097. for n,r in pairs(ranks) do
  2098. if r>=RANKS.ROOM_ADMIN and players[n]then
  2099. tfm.exec.chatMessage("<font color='#AAAAAA'>&#926; ["..upper(moduleName).."] "..(translate("joinedroom",players[n].lang):format(name)).."</font>",n)
  2100. end
  2101. end
  2102. end
  2103.  
  2104. system.bindMouse(name,true)
  2105.  
  2106. -- Notify listeners
  2107. notifyListeners(function(sn,s)
  2108. if not s.disabled or (map.segments and map.segments[sn]) then
  2109. local cb=s.callbacks.newPlayer
  2110. if cb then
  2111. cb(player)
  2112. end
  2113. end
  2114. end)
  2115. if SETTINGS.QUICKRESPAWN then
  2116. toRespawn[name]=os.time()
  2117. end
  2118. if _S.global.tempMapName then
  2119. ui.setMapName("<J>".._S.global.tempMapName)
  2120. else
  2121. setMapName()
  2122. end
  2123. if map.bg then for i,image in pairs(map.bg) do tfm.exec.addImage(image.img,"?"..(1-i),image.x,image.y) end end
  2124. if map.fg then for i,image in pairs(map.fg) do tfm.exec.addImage(image.img,"!"..(50+i),image.x,image.y) end end
  2125. end
  2126.  
  2127.  
  2128. --[[ src/events/eventPlayerDied.lua ]]--
  2129.  
  2130. function eventPlayerDied(name)
  2131. -- Notify listeners
  2132. notifyNameListeners(name, function(player,sn,s)
  2133. local cb=s.callbacks.playerDied
  2134. if cb then
  2135. cb(player)
  2136. end
  2137. end)
  2138. if SETTINGS.QUICKRESPAWN then
  2139. toRespawn[name]=os.time()
  2140. end
  2141. end
  2142.  
  2143.  
  2144. --[[ src/events/eventPlayerGetCheese.lua ]]--
  2145.  
  2146. function eventPlayerGetCheese(name)
  2147. -- Notify listeners
  2148. notifyNameListeners(name, function(player,sn,s)
  2149. local cb=s.callbacks.playerGetCheese
  2150. if cb then
  2151. cb(player)
  2152. end
  2153. end)
  2154. end
  2155.  
  2156.  
  2157. --[[ src/events/eventPlayerLeft.lua ]]--
  2158.  
  2159. function eventPlayerLeft(name)
  2160. -- Notify listeners
  2161. notifyNameListeners(name, function(player,sn,s)
  2162. local cb=s.callbacks.playerLeft
  2163. if cb then
  2164. cb(player)
  2165. end
  2166. end)
  2167. if ranks[name]>=RANKS.ROOM_ADMIN then
  2168. for n,r in pairs(ranks) do
  2169. if r>=RANKS.ROOM_ADMIN and players[n] then
  2170. tfm.exec.chatMessage("<font color='#AAAAAA'>&#926; ["..upper(moduleName).."] "..(translate("leftroom",players[n].lang):format(name)).."</font>",n)
  2171. end
  2172. end
  2173. end
  2174. players[name]=nil
  2175. end
  2176.  
  2177.  
  2178. --[[ src/events/eventPlayerRespawn.lua ]]--
  2179.  
  2180. function eventPlayerRespawn(name)
  2181. players[name].facingRight=true
  2182. players[name].lastSpawn=os.time()
  2183. -- Notify listeners
  2184. notifyNameListeners(name, function(player,sn,s)
  2185. local cb=s.callbacks.playerRespawn
  2186. if cb then
  2187. cb(player)
  2188. end
  2189. end)
  2190. end
  2191.  
  2192.  
  2193. --[[ src/events/eventPlayerVampire.lua ]]--
  2194.  
  2195. function eventPlayerVampire(name)
  2196. -- Notify listeners
  2197. notifyNameListeners(name, function(player,sn,s)
  2198. local cb=s.callbacks.playerVampire
  2199. if cb then
  2200. cb(player)
  2201. end
  2202. end)
  2203. end
  2204.  
  2205.  
  2206. --[[ src/events/eventPlayerWon.lua ]]--
  2207.  
  2208. function eventPlayerWon(name)
  2209. -- Notify listeners
  2210. notifyNameListeners(name, function(player,sn,s)
  2211. local cb=s.callbacks.playerWon
  2212. if cb then
  2213. cb(player)
  2214. end
  2215. end)
  2216. if SETTINGS.QUICKRESPAWN then
  2217. toRespawn[name]=os.time()
  2218. end
  2219. end
  2220.  
  2221.  
  2222. --[[ src/events/eventRoundEnd.lua ]]--
  2223.  
  2224. -- Execute the eventRoundEnd() function to act as a pseudo-event whenever tfm.exec.newGame is executed
  2225.  
  2226. _newGame=tfm.exec.newGame
  2227. function tfm.exec.newGame(map,flip) eventRoundEnd() _newGame(map,flip) end
  2228.  
  2229. function eventRoundEnd()
  2230. notifyListeners(function(sn,s)
  2231. if not s.disabled or (map.segments and map.segments[sn]) then
  2232. local cb=s.callbacks.roundEnd
  2233. if cb then
  2234. cb()
  2235. end
  2236. end
  2237. end)
  2238. end
  2239.  
  2240.  
  2241. --[[ src/events/eventSummoningEnd.lua ]]--
  2242.  
  2243. function eventSummoningEnd(name, type, x, y, ang, other)
  2244. -- Notify listeners
  2245. SPAWNEDOBJS[other.id] = true
  2246. notifyNameListeners(name, function(player,sn,s)
  2247. local cb=s.callbacks.summoningEnd
  2248. if cb then
  2249. cb(player,type,x,y,ang,other)
  2250. end
  2251. end)
  2252. end
  2253.  
  2254.  
  2255. --[[ src/events/eventSummoningStart.lua ]]--
  2256.  
  2257. function eventSummoningStart(name, type, x, y, ang)
  2258. -- Notify listeners
  2259. notifyNameListeners(name, function(player,sn,s)
  2260. local cb=s.callbacks.summoningStart
  2261. if cb then
  2262. cb(player,type,x,y,ang)
  2263. end
  2264. end)
  2265. end
  2266.  
  2267.  
  2268. --[[ src/events/eventTextAreaCallback.lua ]]--
  2269.  
  2270. function eventTextAreaCallback(id,name,callback)
  2271. local arg = string.split(callback, "%s")
  2272. if arg[1] and _S[arg[1]] then
  2273. local s=_S[arg[1]]
  2274. local cb=s.callbacks.textArea
  2275. if cb and cb[arg[2]] then
  2276. cb[arg[2]](id,name,arg)
  2277. end
  2278. end
  2279. end
  2280.  
  2281.  
  2282. --[[ src/segments/addspawn.lua ]]--
  2283.  
  2284. _S.addspawn = {
  2285. toSpawn={},
  2286. toDespawn={},
  2287. callbacks={
  2288. newGame=function()
  2289. _S.addspawn.toSpawn={}
  2290. end,
  2291. summoningStart=function(player,type,x,y,ang)
  2292. table.insert(_S.addspawn.toSpawn, {name=player.name, type=type, x=x,y=y, ang=ang, vx=0, vy=0, interval=6, tick=0, despawn=120})
  2293. end,
  2294. eventLoop=function(time,remaining)
  2295. for k,v in pairs(_S.addspawn.toSpawn) do
  2296. if v.tick>=v.interval then
  2297. table.insert(_S.addspawn.toDespawn,{id=tfm.exec.addShamanObject(v.type, v.x, v.y, v.ang, v.vx or 0, v.vy or 0),despawn=os.time()+(v.despawn*500)})
  2298. v.tick=0
  2299. end
  2300. v.tick=v.tick+1
  2301. end
  2302. end
  2303. }
  2304. }
  2305.  
  2306.  
  2307. --[[ src/segments/adventure.lua ]]--
  2308.  
  2309. _S.adventure = {
  2310. disabled=true,
  2311. id=0,
  2312. players={},
  2313. callbacks={
  2314. newGame=function()
  2315. local adventureId = getValueFromXML(tfm.get.room.xmlMapInfo.xml, "advId") or 1
  2316. ui.setMapName(string.format("<J>Transformice<BL> - @200%s", (adventureId-1 or 1)))
  2317. _S.adventure.id = adventureId
  2318. if adventureId == 2 then
  2319. local fromagnus = tfm.exec.addShamanObject(6300, 1780, 300)
  2320. tfm.exec.addImage("15265a4df9d.png", "#"..fromagnus, -15, -50, nil)
  2321. elseif adventureId == 3 then
  2322. for player, data in pairs(tfm.get.room.playerList) do
  2323. _S.adventure.players[player] = {up = false}
  2324. end
  2325. elseif adventureId == 4 then
  2326. local colors = {0xFB4047, 0xFE9926, 0xE7E433, 0xB9E52A, 0x89EAF9, 0x2E8BD8, 0x8E3F97}
  2327. local id = math.random(#colors)
  2328. local color1 = colors[id]
  2329. table.remove(colors, id)
  2330. id = math.random(#colors)
  2331. local color2 = colors[id]
  2332. local playerLen = table.getl(tfm.get.room.playerList)
  2333. local count = 0
  2334. for player, data in pairs(tfm.get.room.playerList) do
  2335. count = count+1
  2336. if count < playerLen then
  2337. tfm.exec.setNameColor(player, color1)
  2338. else
  2339. tfm.exec.setNameColor(player, color2)
  2340. tfm.exec.movePlayer(player, 5340, 0, false, 0, 0, false)
  2341. end
  2342. end
  2343. end
  2344. end,
  2345. eventLoop = function()
  2346. if _S.adventure.id == 3 then
  2347. for player, data in pairs(tfm.get.room.playerList) do
  2348. if _S.adventure.players[player] then
  2349. if _S.adventure.players[player].up then
  2350. tfm.exec.movePlayer(player, 0, 0, false, 0, -5, false)
  2351. else
  2352. tfm.exec.movePlayer(player, 0, 0, false, 0, 5, false)
  2353. end
  2354. _S.adventure.players[player].up = not _S.adventure.players[player].up
  2355. end
  2356. end
  2357. end
  2358. end
  2359. },
  2360. }
  2361.  
  2362.  
  2363. --[[ src/segments/ballexplosion.lua ]]--
  2364.  
  2365. _S.ballExplosion = {
  2366. disabled=true,
  2367. defaultPlayer=function(player)
  2368. player.activeSegments.ballExplosion=true
  2369. end,
  2370. power=70,
  2371. objects={},
  2372. time=3000,
  2373. range=70,
  2374. callbacks={
  2375. summoningEnd=function(player,objectType,x,y,ang,other)
  2376. if objectType > 100 then objectType=objectType/100 end
  2377. if objectType >= 6 and objectType < 7 then -- all balls
  2378. table.insert(_S.ballExplosion.objects, {id=other.id,spawn=os.time(),range=_S.ballExplosion.range,explode=_S.ballExplosion.time,power=_S.ballExplosion.power})
  2379. end
  2380. end,
  2381. eventLoop=function()
  2382. local toRemove={}
  2383. for index, data in pairs(_S.ballExplosion.objects) do
  2384. if data.spawn < os.time()-data.explode then
  2385. coord = tfm.get.room.objectList[data.id] or {x=-5000,y=-5000}
  2386. tfm.exec.removeObject(data.id)
  2387. _S.ballExplosion.explodeLocal(data.power,data.range,coord.x,coord.y)
  2388. table.insert(toRemove, index)
  2389. end
  2390. end
  2391. for _,i in ipairs(toRemove) do
  2392. _S.ballExplosion.objects[i]=nil
  2393. end
  2394. end,
  2395. },
  2396. explodeLocal=function(power,range,x,y)
  2397. tfm.exec.explosion(x,y,power,range,false)
  2398. for i=0,20 do
  2399. local angle=math.random(-180, 180)
  2400. local velX=math.cos(angle)
  2401. local velY=math.sin(angle)
  2402. tfm.exec.displayParticle(math.random(4), x+math.random(-velX, velX), y+math.random(-velY, velY), velX, velY, math.random(-0.11, 0.11), math.random(-0.11, 0.11), nil)
  2403. end
  2404. end
  2405. }
  2406.  
  2407.  
  2408. --[[ src/segments/bubbles.lua ]]--
  2409.  
  2410. _S.bubbles = {
  2411. disabled=true,
  2412. ticks=0,
  2413. callbacks={
  2414. newGame=function()
  2415. _S.bubbles.grounds = {}
  2416. _S.bubbles.shamanObjects = {}
  2417. for _, ground in pairs(map.grounds) do
  2418. if ground.type == 9 then
  2419. table.insert(_S.bubbles.grounds, {ground.x, ground.y, ground.length, ground.height})
  2420. end
  2421. end
  2422. end,
  2423. eventLoop=function(time,remaining)
  2424. _S.bubbles.ticks=_S.bubbles.ticks+1
  2425. if _S.bubbles.grounds then
  2426. x = math.random()*map.length
  2427. y = math.random()*map.height
  2428. for _, ground in pairs(_S.bubbles.grounds) do
  2429. for i = 10, 0, -1 do
  2430. x = math.random(ground[1]-(ground[3]/2), ground[1]+(ground[3]/2))
  2431. y = math.random(ground[2]-(ground[4]/2), ground[2]+(ground[4]/2))
  2432. tfm.exec.displayParticle(14, x, y, 0, math.random(-2, -1), 0, 0)
  2433. end
  2434. if _S.bubbles.ticks%3==0 then
  2435. table.insert(_S.bubbles.shamanObjects, tfm.exec.addShamanObject(59, x, y))
  2436. end
  2437. end
  2438. end
  2439. end
  2440. }
  2441. }
  2442.  
  2443.  
  2444. --[[ src/segments/checkpoints.lua ]]--
  2445.  
  2446. _S.checkpoints = {
  2447. callbacks={
  2448. playerRespawn=function(player)
  2449. if player.checkpoint then
  2450. tfm.exec.movePlayer(player.name,player.checkpoint.x,player.checkpoint.y)
  2451. if player.checkpoint.id then system.removeTimer(player.checkpoint.id) end
  2452. if player.checkpoint.cheese then
  2453. player.checkpoint.id=system.newTimer(function()
  2454. if player and player.checkpoint then
  2455. tfm.exec.giveCheese(player.name)
  2456. player.checkpoint.id=nil
  2457. end
  2458. end,1000,false)
  2459. end
  2460. end
  2461. end,
  2462. playerDied=function(player)
  2463. if player.checkpoint then
  2464. if player.checkpoint.id then system.removeTimer(player.checkpoint.id) end
  2465. end
  2466. end,
  2467. playerWon=function(player)
  2468. if player.checkpoint then
  2469. player.checkpoint=nil
  2470. ui.removeTextArea(-1,player.name)
  2471. end
  2472. end,
  2473. newGame=function()
  2474. for n,p in pairs(players) do
  2475. if p.checkpoint then
  2476. p.checkpoint=nil
  2477. ui.removeTextArea(-1,p.name)
  2478. end
  2479. end
  2480. end,
  2481. keyboard={
  2482. [KEYS.E]=function(player,down,x,y)
  2483. if player.lastSpawn and player.lastSpawn+3000<=os.time() and (not player.checkpoint or player.checkpoint.timestamp+3000<=os.time()) then
  2484. player.checkpoint={
  2485. timestamp=os.time(),
  2486. x=x,
  2487. y=y,
  2488. cheese=tfm.get.room.playerList[player.name].hasCheese
  2489. }
  2490. ui.addTextArea(-1,"",player.name,x-2,y-2,4,4,0x44cc44,0xffffff,0.5)
  2491. end
  2492. end,
  2493. [KEYS.DELETE]=function(player,down,x,y)
  2494. if player.checkpoint then
  2495. player.checkpoint=nil
  2496. ui.removeTextArea(-1,player.name)
  2497. end
  2498. end
  2499. }
  2500. }
  2501. }
  2502.  
  2503.  
  2504. --[[ src/segments/conj.lua ]]--
  2505.  
  2506. _S.conj = {
  2507. callbacks={
  2508. mouse={
  2509. pr=3,
  2510. fnc=function(player,x,y)
  2511. tfm.exec.addConjuration(x/10,y/10,player.conjTime*1000)
  2512. end
  2513. }
  2514. }
  2515. }
  2516.  
  2517.  
  2518. --[[ src/segments/dash.lua ]]--
  2519.  
  2520. _S.dash = {
  2521. callbacks={
  2522. keyboard={
  2523. [KEYS.LEFT]=function(player,down,x,y)
  2524. if down then
  2525. if player.dash and player.dash.direction=="left" and player.dash.time>os.time()-250 and (player.lastDash and player.lastDash<os.time()-5000 or not player.lastDash) then
  2526. tfm.exec.movePlayer(player.name, 0, 0, false, -100, 0, false)
  2527. player.lastDash=os.time()
  2528. end
  2529. player.dash={time=os.time(),direction="left"}
  2530. end
  2531. end,
  2532. [KEYS.RIGHT]=function(player,down,x,y)
  2533. if down then
  2534. if player.dash and player.dash.direction=="right" and player.dash.time>os.time()-250 and (player.lastDash and player.lastDash<os.time()-5000 or not player.lastDash) then
  2535. tfm.exec.movePlayer(player.name, 0, 0, false, 100, 0, false)
  2536. player.lastDash=os.time()
  2537. end
  2538. player.dash={time=os.time(),direction="right"}
  2539. end
  2540. end,
  2541. }
  2542. }
  2543. }
  2544.  
  2545.  
  2546. --[[ src/segments/debug.lua ]]--
  2547.  
  2548. _S.debug = {
  2549. mapinfo=" ",
  2550. callbacks={
  2551. newGame=function()
  2552. _S.debug.mapinfo=" "
  2553. for k,v in ipairs({{"collision","C"},{"soulmate","S"},{"night","N"},{"portal","P"},{"aie","AIE"},{"mgoc","MGOC"},{"wind","W%s"},{"gravity","G%s"}}) do
  2554. if map[v[1] ] then
  2555. if tonumber(map[v[1] ]) then
  2556. if not (v[1]=="wind" and map[v[1] ]==0) and not (v[1]=="gravity" and map[v[1] ]==10) then
  2557. _S.debug.mapinfo=_S.debug.mapinfo..(v[2]:format(tonumber(map[v[1] ]))).." "
  2558. end
  2559. else
  2560. _S.debug.mapinfo=_S.debug.mapinfo..v[2].." "
  2561. end
  2562. end
  2563. end
  2564. for name,player in pairs(players) do
  2565. if player.activeSegments.debug then
  2566. _S.debug.showMapInfo(player.name)
  2567. end
  2568. end
  2569. end
  2570. },
  2571. showMapInfo=function(name)
  2572. if #_S.debug.mapinfo>2 then
  2573. ui.addTextArea(-18,_S.debug.mapinfo,name,5,380,nil,16,nil,nil,0.5,true)
  2574. else
  2575. ui.removeTextArea(-18,name)
  2576. end
  2577. end
  2578. }
  2579.  
  2580.  
  2581. --[[ src/segments/disco.lua ]]--
  2582.  
  2583. _S.disco = {
  2584. disabled=true,
  2585. callbacks={
  2586. eventLoop=function(time,remaining)
  2587. for n,p in pairs(tfm.get.room.playerList) do
  2588. tfm.exec.setNameColor(n,math.random(0,0xFFFFFF))
  2589. end
  2590. end
  2591. }
  2592. }
  2593.  
  2594.  
  2595. --[[ src/segments/doge.lua ]]--
  2596.  
  2597. _S.doge = {
  2598. disabled=true,
  2599. callbacks={
  2600. eventLoop=function(time,remaining)
  2601. for n,p in pairs(players) do
  2602. local phrases=translate("doge",p.lang)
  2603. ui.addTextArea(-50, "<font face='Comic sans MS' color='#"..string.format("%X",math.random(0,0xFFFFFF)).."' size='17'>"..phrases[math.random(#phrases)].."</font>", nil, math.random(100,map.length-100), math.random(40,map.height-40), nil, nil, 0)
  2604. end
  2605. end
  2606. }
  2607. }
  2608.  
  2609.  
  2610. --[[ src/segments/doll.lua ]]--
  2611.  
  2612. _S.doll = {
  2613. move=function(player,direction)
  2614. if player.dolls then
  2615. for k,v in pairs(player.dolls) do
  2616. tfm.exec.movePlayer(v,0,0,true,
  2617. direction=="left" and -40 or direction=="right" and 40 or 0,
  2618. direction=="up" and -50 or direction=="down" and 40 or 0,
  2619. false)
  2620. end
  2621. end
  2622. end,
  2623. callbacks={
  2624. keyboard={
  2625. [KEYS.U]=function(player,down,x,y)
  2626. if down then _S.doll.move(player,"up") end
  2627. end,
  2628. [KEYS.J]=function(player,down,x,y)
  2629. if down then _S.doll.move(player,"down") end
  2630. end,
  2631. [KEYS.H]=function(player,down,x,y)
  2632. if down then _S.doll.move(player,"left") end
  2633. end,
  2634. [KEYS.K]=function(player,down,x,y)
  2635. if down then _S.doll.move(player,"right") end
  2636. end
  2637. },
  2638. }
  2639. }
  2640.  
  2641.  
  2642.  
  2643. --[[ src/segments/draw.lua ]]--
  2644.  
  2645. -- Drawing segment
  2646.  
  2647. _S.draw = {
  2648. redraw=true,
  2649. _={
  2650. minBrushSize=1,
  2651. maxBrushSize=25
  2652. },
  2653. defaultPlayer=function(player)
  2654. player.activeSegments.draw=false
  2655. player.draw={
  2656. tool="line",
  2657. size=10,
  2658. color=0xFFFFFF,
  2659. pickerId=0,
  2660. alpha=100,
  2661. lastClick=nil,
  2662. nextDraw=nil,
  2663. history={},
  2664. bezierPath=nil,
  2665. foreground=true,
  2666. enteringColor=nil
  2667. }
  2668. end,
  2669. menu=function(player)
  2670. return {
  2671. --title="Drawing",
  2672. {callback="draw tool line",icon="|",color=player.draw.tool=="line" and 0xCCCCCC or nil},
  2673. --{callback="draw tool curve",icon="~",color=player.draw.tool=="curve" and 0xCCCCCC or nil},
  2674. {callback="draw tool circle",icon="o",color=player.draw.tool=="circle" and 0xCCCCCC or nil},
  2675. {callback="draw tool brush",icon="b",color=player.draw.tool=="brush" and 0xCCCCCC or nil},
  2676. {callback="draw picker",icon=" ",color=player.draw.color or 0xFFFFFF},
  2677. {callback="draw tool eraser",icon="e",color=player.draw.tool=="eraser" and 0xCCCCCC or nil},
  2678. {callback="draw clear",icon="c"},
  2679. {callback="draw undo",icon="u"},
  2680. {custom="<p align='center'><a href='event:draw size -3'>-</a> "..player.draw.size.."px <a href='event:draw size 3'>+</a></p>",width=65},
  2681. {custom="<p align='center'><a href='event:draw alpha -10'>-</a> "..player.draw.alpha.."% <a href='event:draw alpha 10'>+</a></p>",width=65},
  2682. {custom="<p align='center'><a href='event:draw foreground'>"..(player.draw.foreground and "fg" or "bg").."</a></p>",width=30},
  2683. }
  2684. end,
  2685. menuCondition=function(player) return player.activeSegments.draw end,
  2686. colors={
  2687. red={title="Red",color=0xFF0000},
  2688. green={title="Green",color=0x00FF00},
  2689. blue={title="Blue",color=0x0000FF},
  2690. orange={title="Orange",color=0xFF6600},
  2691. background={title="Background Blue",color=0x6A7495},
  2692. brown={title="Brown",color=0x78583A},
  2693. skin={title="Skin Yellow",color=0xE3C07E},
  2694. white={title="White",color=0xFFFFFF},
  2695. silver={title="Silver",color=0xC0C0C0},
  2696. gray={title="Gray",color=0x808080},
  2697. black={title="Black",color=0x000001},
  2698. maroon={title="Maroon",color=0x800000},
  2699. yellow={title="Yellow",color=0xFFFF00},
  2700. olive={title="Olive",color=0x808000},
  2701. lime={title="Lime",color=0x00FF00},
  2702. green={title="Green",color=0x008000},
  2703. aqua={title="Aqua",color=0x00FFFF},
  2704. teal={title="Teal",color=0x008080},
  2705. navy={title="Navy",color=0x000080},
  2706. fuchsia={title="Fuchsia",color=0xFF00FF},
  2707. purple={title="Purple",color=0x800080},
  2708. pink={title="Pink",color=0xFF69B4}
  2709. },
  2710. onEnable=function(player,manual)
  2711. if manual==nil then manual=false end
  2712. local keys={KEYS.A, KEYS.B, KEYS.D, KEYS.E, KEYS.F}
  2713. for i = 0, 9 do
  2714. table.insert(keys, KEYS["NUMPAD "..i])
  2715. end
  2716. for _,key in ipairs(keys) do
  2717. system.bindKeyboard(player.name,key,true,manual)
  2718. system.bindKeyboard(player.name,key,false,manual)
  2719. end
  2720. end,
  2721. addHexCharToColor=function(player,letter)
  2722. table.insert(player.draw.enteringColor, letter)
  2723. if #player.draw.enteringColor==6 then
  2724. local c=table.concat(player.draw.enteringColor, '')
  2725. c=getColor(c)
  2726. if c then
  2727. player.draw.color=c
  2728. -- c=string.format("%06X",c)
  2729. -- tfm.exec.chatMessage(translate("colorchanged",player.lang):format("[<font color='#"..c.."'>#"..(c:upper()).."</font>]"),player.name)
  2730. end
  2731. player.draw.enteringColor=nil
  2732. _S.draw.onEnable(player,false)
  2733. end
  2734. end,
  2735. callbacks={
  2736. newGame=function()
  2737. _S.draw.ids={}
  2738. _S.draw.physicObject()
  2739. end,
  2740. newPlayer=function(player)
  2741. _S.draw.physicObject()
  2742. if _S.draw.redraw then
  2743. --local tbl=_S.draw.ids
  2744. --_S.draw.ids={}
  2745. for _,joint in ipairs(_S.draw.ids) do
  2746. if not joint.removed then
  2747. _S.draw.addJoint(joint.id,joint.coords1,joint.coords2,joint.name,joint.line,joint.color,joint.alpha,joint.foreground)
  2748. end
  2749. end
  2750. end
  2751. end,
  2752. keyboard={
  2753. [KEYS.Z]=function(player,down,x,y)
  2754. if down and player.ctrl then
  2755. _S.draw.undo(player.name)
  2756. end
  2757. end,
  2758. [KEYS.W]=function(player,down,x,y)
  2759. _S.draw.callbacks.keyboard[KEYS.Z](player,down,x,y)
  2760. end,
  2761. [KEYS.C]=function(player,down,x,y)
  2762. if ranks[player.name]>=RANKS.ROOM_ADMIN and down then
  2763. if player.shift then
  2764. player.draw.enteringColor={}
  2765. _S.draw.onEnable(player,true)
  2766. elseif player.draw.enteringColor then
  2767. _S.draw.addHexCharToColor(player,'C')
  2768. end
  2769. end
  2770. end,
  2771. [KEYS.A]=hexColorEntering('A'),
  2772. [KEYS.B]=hexColorEntering('B'),
  2773. [KEYS.D]=hexColorEntering('D'),
  2774. [KEYS.E]=hexColorEntering('E'),
  2775. [KEYS.F]=hexColorEntering('F'),
  2776. [KEYS['NUMPAD 0']]=hexColorEntering('0'),
  2777. [KEYS['NUMPAD 1']]=hexColorEntering('1'),
  2778. [KEYS['NUMPAD 2']]=hexColorEntering('2'),
  2779. [KEYS['NUMPAD 3']]=hexColorEntering('3'),
  2780. [KEYS['NUMPAD 4']]=hexColorEntering('4'),
  2781. [KEYS['NUMPAD 5']]=hexColorEntering('5'),
  2782. [KEYS['NUMPAD 6']]=hexColorEntering('6'),
  2783. [KEYS['NUMPAD 7']]=hexColorEntering('7'),
  2784. [KEYS['NUMPAD 8']]=hexColorEntering('8'),
  2785. [KEYS['NUMPAD 9']]=hexColorEntering('9')
  2786. },
  2787. mouse={
  2788. pr=3,
  2789. fnc=function(player,x,y)
  2790. if player.activeSegments.draw and not player.omo then
  2791. if player.draw.nextDraw or (player.shift and player.draw.lastClick) then
  2792. _S.draw.tool[player.draw.tool](player.draw.lastClick,{x=x,y=y},player.name)
  2793. else
  2794. player.draw.nextDraw=true
  2795. end
  2796. player.draw.lastClick={x=x,y=y}
  2797. end
  2798. end
  2799. },
  2800. chatCommand={
  2801. color={
  2802. rank=RANKS.ANY,
  2803. fnc=function(player,color,target)
  2804. target=target and upper(target) or player.name
  2805. if color then
  2806. local c=getColor(color)
  2807. if c then
  2808. players[target].draw.color=c
  2809. c=string.format("%06X",c)
  2810. tfm.exec.chatMessage(translate("colorchanged",player.lang):format("[<font color='#"..c.."'>#"..(c:upper()).."</font>]"),player.name)
  2811. else
  2812. tfm.exec.chatMessage(translate("invalidargument",player.lang),player.name)
  2813. end
  2814. else
  2815. _S.draw.callbacks.textArea.picker(1,player.name)
  2816. end
  2817. end
  2818. },
  2819. brush={
  2820. rank=RANKS.ANY,
  2821. fnc=function(player,size,target)
  2822. target=target and upper(target) or player.name
  2823. size=tonumber(size) or 10
  2824. players[target].draw.size=math.max(_S.draw._.minBrushSize,math.min(_S.draw._.maxBrushSize,size))
  2825. _S.global.showMenu(target)
  2826. tfm.exec.chatMessage(translate("brushchanged",player.lang):format(size),player.name)
  2827. end
  2828. },
  2829. clear={
  2830. rank=RANKS.ROOM_ADMIN,
  2831. fnc=function(player,target)
  2832. target=target and upper(target) or player.name
  2833. if target=="All" or target=="*" then target=nil end
  2834. _S.draw.clear(target)
  2835. end
  2836. },
  2837. jointxml={
  2838. rank=RANKS.ROOM_ADMIN,
  2839. fnc=function(player)
  2840. local str=""
  2841. for _,joint in pairs(_S.draw.ids) do
  2842. if not joint.removed then
  2843. local j=[[&lt;JD P1="%s"P2="%s"c="%s,%s,1,0"/&gt;]]
  2844. str=str..(j:format(
  2845. joint.coords1.x..","..joint.coords1.y,
  2846. joint.coords2.x..","..joint.coords2.y,
  2847. string.format("%X",joint.color),
  2848. joint.line)
  2849. )
  2850. end
  2851. end
  2852. local splitnum=800
  2853. for i=1,#str,splitnum do
  2854. tfm.exec.chatMessage("<font size='8'>"..string.sub(str,i,i+splitnum-1).."</font>",player.name)
  2855. end
  2856. end
  2857. },
  2858. },
  2859. textArea={
  2860. tool=function(id,name,arg)
  2861. local t = arg[3]
  2862. if t and _S.draw.tool[t] then
  2863. local player=players[name]
  2864. player.draw.tool=t
  2865. _S.global.showMenu(name)
  2866. player.draw.lastClick=nil
  2867. player.draw.nextDraw=nil
  2868. if t=="brush" or t=="eraser" then
  2869. player.draw.nextDraw=true
  2870. end
  2871. end
  2872. end,
  2873. clear=function(id,name,arg)
  2874. _S.draw.clear(name)
  2875. end,
  2876. undo=function(id,name,arg)
  2877. _S.draw.undo(name)
  2878. end,
  2879. size=function(id,name,arg)
  2880. local player=players[name]
  2881. local size=player.draw.size
  2882. size=math.max(_S.draw._.minBrushSize,math.min(_S.draw._.maxBrushSize,size+(arg[3] or 1)))
  2883. player.draw.size=size
  2884. _S.global.showMenu(name)
  2885. end,
  2886. alpha=function(id,name,arg)
  2887. local player=players[name]
  2888. local alpha=player.draw.alpha
  2889. alpha=math.min(100,math.max(10,alpha+(arg[3] or 0)))
  2890. player.draw.alpha=tonumber(alpha)
  2891. _S.global.showMenu(name)
  2892. end,
  2893. foreground=function(id,name,arg)
  2894. local player=players[name]
  2895. player.draw.foreground=not player.draw.foreground
  2896. _S.global.showMenu(name)
  2897. end,
  2898. color=function(id,name,arg)
  2899. local player=players[name]
  2900. local color = tonumber(arg[3]) or 1
  2901. player.draw.color=color
  2902. _S.global.showMenu(name)
  2903. end,
  2904. picker=function(id,name,arg)
  2905. --[[
  2906. local i=0
  2907. for k,c in pairs(_S.draw.colors) do
  2908. ui.addTextArea(600+i,"<a href='event:draw colorpicker "..c.color.."'>"..c.title or c.color.."</a>",name,150,60+(i*24),100,18,c.color,0x212F36,1,true)
  2909. i=i+1
  2910. end
  2911. ]]
  2912. local player=players[name]
  2913. local id=player.draw.pickerId+1
  2914. player.draw.pickerId=id
  2915. ui.showColorPicker(id, name, player.draw.color, translate("pickacolor",players[name].lang))
  2916. end,
  2917. colorpicker=function(id,name,arg)
  2918. ui.showColorPicker(id, name, arg[3], translate("pickacolor",players[name].lang))
  2919. end
  2920. },
  2921. colorPicked=function(player,id,color)
  2922. if color==0 then color=1 end
  2923. if color==-1 then
  2924. --[[
  2925. for i=600,620 do
  2926. ui.removeTextArea(i,player.name)
  2927. end
  2928. ]]
  2929. elseif id==player.draw.pickerId then
  2930. player.draw.color=color
  2931. _S.global.showMenu(player.name)
  2932. end
  2933. end
  2934. },
  2935. ids={},
  2936. physicObject=function()
  2937. tfm.exec.addPhysicObject(1,400,-600,{type=13,width=10,height=10,foreground=true,friction=0.3,restitution=0,dynamic=false,miceCollision=false,groundCollision=false})
  2938. end,
  2939. addJoint=function(id,coords1,coords2,name,size,color,alpha,foreground)
  2940. id=id or #_S.draw.ids+1
  2941. local tbl={
  2942. id=id,
  2943. coords={x=(coords1.x+coords2.x)/2,y=(coords1.y+coords2.y)/2},
  2944. coords1=coords1,
  2945. coords2=coords2,
  2946. point1=coords1.x..","..coords1.y,
  2947. point2=coords2.x..","..coords2.y,
  2948. name=name,
  2949. line=size or 10,
  2950. color=color or 0xFFFFFF,
  2951. alpha=alpha or 1,
  2952. frequency=10,
  2953. type=0,
  2954. damping=0.2,
  2955. foreground=foreground
  2956. }
  2957. tfm.exec.addJoint(id,1,1,tbl)
  2958. _S.draw.ids[id]=tbl
  2959. return id
  2960. end,
  2961. readdJoint=function(index,update)
  2962. local joint=_S.draw.ids[index]
  2963. if joint then
  2964. joint.removed=false
  2965. tfm.exec.addJoint(joint.id,1,1,joint)
  2966. if update then _S.draw.blankJoint() end
  2967. end
  2968. end,
  2969. removeJointByIndex=function(index,update)
  2970. local joint=_S.draw.ids[index]
  2971. if joint then
  2972. tfm.exec.removeJoint(joint.id)
  2973. joint.removed=true
  2974. if update then _S.draw.blankJoint() end
  2975. end
  2976. end,
  2977. removeJoint=function(id)
  2978. for _,joint in ipairs(_S.draw.ids) do
  2979. if joint.id==id then
  2980. tfm.exec.removeJoint(id)
  2981. joint.removed=true
  2982. end
  2983. end
  2984. _S.draw.blankJoint()
  2985. end,
  2986. blankJoint=function()
  2987. tfm.exec.addJoint(0,1,1,{
  2988. type=0,
  2989. point1="0,0",
  2990. point2="0,1",
  2991. frequency=10,
  2992. damping=0.2,
  2993. line=1,
  2994. color=0xFFFFFF,
  2995. alpha=0,
  2996. foreground=false
  2997. })
  2998. end,
  2999. clear=function(name)
  3000. local action={}
  3001. for _,joint in ipairs(_S.draw.ids) do
  3002. if (name and joint.name==name or not name) and not joint.removed then
  3003. table.insert(action,joint.id)
  3004. tfm.exec.removeJoint(joint.id)
  3005. joint.removed=true
  3006. end
  3007. end
  3008. if not name then -- !clear all : not undoable (this is to clear memory mainly if the room is getting laggy)
  3009. _S.draw.ids={}
  3010. for _,p in pairs(players) do
  3011. p.draw.history={}
  3012. end
  3013. elseif players[name] then
  3014. _S.draw.addHistoryAction(name,false,action)
  3015. end
  3016. _S.draw.blankJoint()
  3017. end,
  3018. undo=function(name)
  3019. local player=players[name]
  3020. local hist=player.draw.history
  3021. local i=#hist
  3022.  
  3023. if i>0 then
  3024. local action=table.remove(hist,i)
  3025. local additive=action.additive
  3026. local lastJointIndex=nil
  3027.  
  3028. for _,v in ipairs(action) do
  3029. if type(v)=='number' then
  3030. if additive then -- the action added new joints, so we will remove them
  3031. _S.draw.removeJointByIndex(v)
  3032. else -- the action removed joints, so we will re-add them
  3033. _S.draw.readdJoint(v)
  3034. lastJointIndex=v
  3035. end
  3036. else
  3037. for _,w in ipairs(v) do
  3038. if additive then -- the action added new joints, so we will remove them
  3039. _S.draw.removeJointByIndex(w)
  3040. else -- the action removed joints, so we will re-add them
  3041. _S.draw.readdJoint(w)
  3042. lastJointIndex=w
  3043. end
  3044. end
  3045. end
  3046. end
  3047. if additive and #hist>0 then
  3048. -- Get coords from last join of action before this one
  3049. action=hist[#hist]
  3050. lastJointIndex=action[#action]
  3051. if type(lastJointIndex)=='table' then
  3052. lastJointIndex=lastJointIndex[#lastJointIndex]
  3053. end
  3054. end
  3055. if lastJointIndex then
  3056. -- Set lastClick based on coords of lastJointIndex
  3057. local joint=_S.draw.ids[lastJointIndex]
  3058. if joint then
  3059. player.draw.lastClick=joint.coords2
  3060. end
  3061. end
  3062. _S.draw.blankJoint()
  3063. end
  3064. end,
  3065. addHistoryAction=function(name,additive,...)
  3066. local player=players[name]
  3067. local arg={...}
  3068. arg.additive=additive
  3069. table.insert(player.draw.history,arg)
  3070. end,
  3071. tool={
  3072. line=function(coords1,coords2,name)
  3073. local player=players[name]
  3074. local action=_S.draw.addJoint(nil,coords1,coords2,name,player.draw.size,player.draw.color,player.draw.alpha/100,player.draw.foreground)
  3075. _S.draw.addHistoryAction(name,true,action)
  3076. if name then
  3077. player.draw.nextDraw=nil
  3078. end
  3079. end,
  3080. brush=function(coords1,coords2,name)
  3081. local player=players[name]
  3082. local action=_S.draw.addJoint(nil,coords2,{x=coords2.x,y=coords2.y+1},name,player.draw.size,player.draw.color,player.draw.alpha/100,player.draw.foreground)
  3083. _S.draw.addHistoryAction(name,true,action)
  3084. end,
  3085. circle=function(coords1,coords2,name)
  3086. local player=players[name]
  3087. local action=_S.draw.addJoint(nil,coords1,{x=coords1.x,y=coords1.y+1},name,distance(coords1.x,coords1.y,coords2.x,coords2.y)*2,player.draw.color,player.draw.alpha/100,player.draw.foreground)
  3088. _S.draw.addHistoryAction(name,true,action)
  3089. if name then
  3090. player.draw.nextDraw=nil
  3091. end
  3092. end,
  3093. eraser=function(coords1,coords2,name)
  3094. local dist=10
  3095. local action={}
  3096. for i,joint in pairs(_S.draw.ids) do
  3097. if name and joint.name==name or not name then
  3098. -- TODO: separate distance function for each shape (line, dot, circle, curve)
  3099. if pythag(coords2.x,coords2.y,joint.coords.x,joint.coords.y,dist) then
  3100. table.insert(action,i)
  3101. tfm.exec.removeJoint(joint.id)
  3102. joint.removed=true
  3103. end
  3104. end
  3105. end
  3106. -- _S.draw.addHistoryAction(name,false,action)
  3107. _S.draw.blankJoint()
  3108. end,
  3109. curve=function(coords1,coords2,name)
  3110. -- TODO: should convert all {x, y} tables in this file to Vector(x, y)
  3111. --[[ local player=players[name]
  3112. local bp = player.draw.bezierPath
  3113. if coords1 then coords1 = Vector(coords1.x, coords1.y) end
  3114. if coords2 then coords2 = Vector(coords2.x, coords2.y) end
  3115. if not bp then
  3116. bp = BezierPath()
  3117. bp:add(coords1)
  3118. bp:add(coords2)
  3119. player.draw.bezierPath = bp
  3120. elseif bp:size() >= 2 then
  3121. bp:add(coords2)
  3122. local action = {}
  3123. local tesPoints = bp:draw()
  3124. for i = 2, #tesPoints - 1 do
  3125. local p1, p2 = tesPoints[i - 1]:floored(), tesPoints[i]:floored()
  3126. table.insert(action, _S.draw.addJoint(nil,p1,p2,name,player.draw.size,player.draw.color,player.draw.alpha/100,player.draw.foreground))
  3127. end
  3128. _S.draw.addHistoryAction(name,true,action)
  3129. end]]
  3130. end
  3131. }
  3132. }
  3133.  
  3134.  
  3135. --[[ src/segments/drawonme.lua ]]--
  3136.  
  3137. _S.drawOnMe = {
  3138. defaultPlayer=function(player)
  3139. player.activeSegments.drawOnMe=false
  3140. player.drawOnMe={
  3141. imgs={},
  3142. lastFacing="right"
  3143. }
  3144. end,
  3145. redraw=function(player,direction)
  3146. for _,dot in ipairs(player.drawOnMe.imgs) do
  3147. tfm.exec.removeImage(dot.img)
  3148. dot.img=tfm.exec.addImage("151469722d4.png","$"..player.name,direction=="right" and dot.x*-1 or dot.x,dot.y)
  3149. end
  3150. player.drawOnMe.lastFacing=direction
  3151. end,
  3152. callbacks={
  3153. mouse={
  3154. pr=2,
  3155. fnc=function(player,x,y)
  3156. local p=tfm.get.room.playerList[player.name]
  3157. if pythag(p.x,p.y,x,y,25) then
  3158. local xoff=x-p.x
  3159. local yoff=y-p.y
  3160. table.insert(player.drawOnMe.imgs,{
  3161. img=tfm.exec.addImage("151469722d4.png","$"..player.name,xoff,yoff),
  3162. x=player.facingRight and xoff*-1 or xoff,
  3163. y=yoff
  3164. })
  3165. end
  3166. end
  3167. },
  3168. keyboard={
  3169. [KEYS.LEFT]=function(player,down,x,y)
  3170. if down then
  3171. if player.drawOnMe.imgs and player.drawOnMe.lastFacing=="right" then
  3172. _S.drawOnMe.redraw(player,"left")
  3173. end
  3174. end
  3175. end,
  3176. [KEYS.RIGHT]=function(player,down,x,y)
  3177. if down then
  3178. if player.drawOnMe.imgs and player.drawOnMe.lastFacing=="left" then
  3179. _S.drawOnMe.redraw(player,"right")
  3180. end
  3181. end
  3182. end,
  3183. },
  3184. newGame=function()
  3185. for name in pairs(tfm.get.room.playerList) do
  3186. local player=players[name]
  3187. _S.drawOnMe.redraw(player,"right")
  3188. end
  3189. end,
  3190. playerRespawn=function(player)
  3191. _S.drawOnMe.redraw(player,"right")
  3192. end,
  3193. chatCommand={
  3194. clear={
  3195. rank=RANKS.ANY,
  3196. fnc=function(player)
  3197. for _,dot in ipairs(player.drawOnMe.imgs) do
  3198. tfm.exec.removeImage(dot.img)
  3199. end
  3200. player.drawOnMe.imgs={}
  3201. end
  3202. }
  3203. }
  3204. }
  3205. }
  3206.  
  3207.  
  3208. --[[ src/segments/explosion.lua ]]--
  3209.  
  3210. _S.explosion = {
  3211. callbacks={
  3212. mouse={
  3213. pr=1,
  3214. fnc=function(player,x,y)
  3215. tfm.exec.explosion(x,y,50,100)
  3216. end
  3217. }
  3218. }
  3219. }
  3220.  
  3221.  
  3222. --[[ src/segments/ffa.lua ]]--
  3223.  
  3224. _S.ffa = {
  3225. toDespawn={},
  3226. defaultPlayer=function(player)
  3227. player.activeSegments.ffa=false
  3228. player.ffa={
  3229. object=17,
  3230. power=10,
  3231. timestamp=0,
  3232. cooldown=1000,
  3233. spawnLength=2000,
  3234. offset={
  3235. x=2,
  3236. y=10,
  3237. },
  3238. }
  3239. end,
  3240. callbacks={
  3241. keyboard={
  3242. [KEYS.DOWN]=function(player,down,x,y)
  3243. if down and not tfm.get.room.playerList[player.name].isDead then
  3244. if player.ffa.timestamp<=os.time()-player.ffa.cooldown then
  3245. local angle=(player.facingRight and 90 or 270)+(player.ffa.object==17 and 0 or -90)
  3246. table.insert(_S.ffa.toDespawn,{
  3247. id=tfm.exec.addShamanObject(player.ffa.object,player.facingRight and x+player.ffa.offset.x or x-player.ffa.offset.x,y+player.ffa.offset.y,angle,player.ffa.power*math.cos(math.rad(angle)),player.ffa.power*math.sin(math.rad(angle))),
  3248. despawn=os.time()+player.ffa.spawnLength
  3249. })
  3250. player.ffa.timestamp=os.time()
  3251. end
  3252. end
  3253. end,
  3254. },
  3255. chatCommand={
  3256. off={
  3257. rank=RANKS.ANY,
  3258. fnc=function(player,x,y)
  3259. local newx,newy
  3260. if tonumber(x) and tonumber(y) then
  3261. newx=x
  3262. newy=y
  3263. elseif x=="dom" then
  3264. newx=-10
  3265. newy=15
  3266. elseif x=="def" then
  3267. newx=2
  3268. newy=10
  3269. else
  3270. tfm.exec.chatMessage(translate("invalidargument",player.lang),player.name)
  3271. end
  3272. if newx and newy then
  3273. player.ffa.offset={x=tonumber(newx),y=tonumber(newy)}
  3274. tfm.exec.chatMessage(translate("offsetschanged",player.lang):format(newx,newy),player.name)
  3275. end
  3276. end
  3277. }
  3278. }
  3279. },
  3280. }
  3281.  
  3282.  
  3283. --[[ src/segments/fireworks.lua ]]--
  3284.  
  3285. _S.fireworks = {
  3286. disabled=true,
  3287. counter=0,
  3288. timedEvents={},
  3289. players={},
  3290. defaultPlayer=function(player)
  3291. _S.fireworks.players[player] = os.time()
  3292. end,
  3293. spawnPoints = {
  3294. -- {1=x, 2=y, 3=chance, 4=speed, 5=progress, 6=imageX, 7=imageY, 8=imageId, 9=activateDist, 10=baseVx, 11=maxOffsetVx}
  3295. {20, 340, 0.3, 1.5, 1, 130, 333, -1, 60, 3.5, 1},
  3296. {295, 340, 0.4, 2.5, 1, 348, 336, -1, 80, -2.5, 1},
  3297. {480, 340, 0.4, 2.5, 1, 604, 232, -1, 80, 2.5, 1},
  3298. {777, 340, 0.3, 1.5, 1, 604, 232, -1, 80, -3.5, 1}
  3299. },
  3300. explosionData = {
  3301. --[[ FORMAT START
  3302. {
  3303. function(trailParticleId,extraParticles,centerX,centerY)
  3304. -- trailParticleId is the particle id from the trail
  3305. -- extraParticles gets passed on from this table to this function
  3306. -- centerX is the center X coordinate from the explosion
  3307. -- centerY ............. Y .............................
  3308. -- do stuff here
  3309. end,
  3310. extraParticles,
  3311. timeBeforeExplosion
  3312. }
  3313. FORMAT END ]]--
  3314. {function(id,p,x,y) -- Star shaped, same color as trail
  3315. _S.fireworks.drawParam2({x, y, 7.0, 0.4, 10, {id}})
  3316. end, {}, 1000},
  3317. {function(id,p,x,y) -- Default firework, same color as trail
  3318. _S.fireworks.defaultEffect(id,p,x,y,true)
  3319. end, {0,2}, 1000},
  3320. {function(id,p,x,y)
  3321. _S.fireworks.defaultEffect(id,p,x,y,true)
  3322. end, REDWHITEBLUE, 1000},
  3323. {function(id,p,x,y)
  3324. _S.fireworks.defaultEffect(id,p,x,y,false)
  3325. end, REDWHITEBLUE, 1000}
  3326. },
  3327. fireworkSets={
  3328. --[[ FORMAT START
  3329. {
  3330. trailId or {trailId1, trailId2}, -- if it's a number, it will pick that, if it's a table, it will pick a random one
  3331. explosionIndex, -- index in explosionData
  3332. probability
  3333. }
  3334. FORMAT END]]--
  3335. {REDWHITEBLUE, 4, 50}, -- red white blue default firework
  3336. {REDWHITEBLUE, 3, 25}, -- red white blue default firework
  3337. {{0, 2}, 2, 15}, -- white and gold default firework
  3338. {REDWHITEBLUE, 1, 3}, -- Star shaped, same color as trail
  3339. },
  3340. setPositions=function()
  3341. _S.fireworks.spawnPoints={}
  3342. for i=100,(map.length or 800),200 do
  3343. tfm.exec.chatMessage(i)
  3344. table.insert(_S.fireworks.spawnPoints,{i, (map.height or 400)-20, 0.1, math.random(15,25)/10, 1, math.random(350,650), math.random(350,650), -1, 80, math.random(-35,35)/10, 1})
  3345. end
  3346. end,
  3347. callbacks={
  3348. --newGame=function()
  3349. -- _S.fireworks.setPositions()
  3350. --end,
  3351. eventLoop=function(time,remaining)
  3352. if _S.fireworks.counter % 3 == 0 then
  3353. local b = 1000
  3354. local e = b + 3000
  3355. for i,sp in pairs(_S.fireworks.spawnPoints) do
  3356. for j = b, e, 1000 / (sp[4] + (sp[5] - 0.5) * 3) do
  3357. _S.fireworks.timedEvent(j, false, function(i)
  3358. _S.fireworks.fireIt(i)
  3359. end, i)
  3360. end
  3361. end
  3362. end
  3363. local tR = {}
  3364. for i,t in pairs(_S.fireworks.timedEvents) do
  3365. if t[1] < os.time() then
  3366. t[3](unpack(t[4]))
  3367. if t[2] == true then
  3368. t[1] = t[1] + t[5]
  3369. else
  3370. tR[i] = true
  3371. end
  3372. end
  3373. end
  3374. for i in pairs(tR) do
  3375. _S.fireworks.timedEvents[i] = nil
  3376. end
  3377. _S.fireworks.counter = _S.fireworks.counter + 0.5
  3378. end,
  3379. keyboard={
  3380. [KEYS.SPACE]=function(player,down,x,y)
  3381. if down then
  3382. if _S.fireworks.players[player] < os.time()-500 then
  3383. _S.fireworks.players[player] = os.time()
  3384. _S.fireworks.selectAndFire(x,y)
  3385. end
  3386. end
  3387. end,
  3388. },
  3389. },
  3390. timedEvent=function(ms, r, f, ...)
  3391. _S.fireworks.timedEvents[#_S.fireworks.timedEvents + 1] = {os.time()+ms,r,f,arg,ms}
  3392. end,
  3393. fireIt=function(spI)
  3394. local sp = _S.fireworks.spawnPoints[spI]
  3395. if math.random() < sp[3] * sp[5] then
  3396. local vx = sp[10] + math.random(-sp[11], sp[11])
  3397. _S.fireworks.selectAndFire(sp[1], sp[2], vx)
  3398. end
  3399. end,
  3400. selectAndFire=function(x, y, vx, setI)
  3401. vx = vx == nil and math.random(-3, 3) or vx
  3402. if setI == nil then
  3403. -- calculate a random set based on probabilities
  3404. local total = 0
  3405. for _,s in ipairs(_S.fireworks.fireworkSets) do
  3406. total = total + s[3]
  3407. end
  3408. local r = math.random(0, total - 1)
  3409. total = 0
  3410. for i,s in ipairs(_S.fireworks.fireworkSets) do
  3411. total = total + s[3]
  3412. if total > r then
  3413. setI = i
  3414. break
  3415. end
  3416. end
  3417. end
  3418. local fireworkSet = _S.fireworks.fireworkSets[setI]
  3419. if fireworkSet ~= nil then
  3420. local id = fireworkSet[1]
  3421. if type(id) == 'table' then
  3422. id = id[math.random(#id)]
  3423. end
  3424. _S.fireworks.firework(id, x, y, vx, -20, 0, math.random(8, 9) / 10, 5, 30, _S.fireworks.explosionData[fireworkSet[2]])
  3425. end
  3426. end,
  3427. firework=function(id, initX, initY, vx, vy, ax, ay, magnitude, length, explosion)
  3428. local params = nil
  3429. local xMultiplier = 3
  3430. if explosion == nil then
  3431. xMultiplier = 5
  3432. end
  3433. -- Launch firework
  3434. for i = magnitude, 1, -1 do
  3435. local timeT = xMultiplier * (-i / magnitude)
  3436. local velX = timeT * ax + vx
  3437. local velY = timeT * ay + vy
  3438. local x = initX + (velX + vx) / 2 * timeT
  3439. local y = initY + (velY + vy) / 2 * timeT
  3440. if params == nil then
  3441. params = {x, y, velX, velY, ax, ay, id} -- we use these to calculate our explosion position
  3442. end
  3443. for j = 1, magnitude - i do
  3444. if id == -1 then
  3445. tfm.exec.displayParticle(9, x, y, velX, velY, ax, ay, nil)
  3446. tfm.exec.displayParticle(1, x, y, velX, velY, ax, ay, nil)
  3447. else
  3448. tfm.exec.displayParticle(id, x, y, velX, velY, ax, ay, nil)
  3449. end
  3450. end
  3451. end
  3452. if explosion ~= nil then
  3453. system.newTimer(function(timerId, expl, params)
  3454. -- local tx = expl[3] / (math.pi * 10) -- guesstimation
  3455. local t = explosion[3] / (math.pi * 10)
  3456. local dx = params[3] * t + 0.5 * params[5] * t^2 -- change in x = vxi*changeintime+0.5*ax*t^2
  3457. local x = params[1] + dx
  3458. local dy = params[4] * t + 0.5 * params[6] * t^2 -- change in y = vyi*changeintime+0.5*ay*t^2
  3459. local y = params[2] + dy
  3460.  
  3461. local f = explosion[1]
  3462. local particles = explosion[2]
  3463. f(params[7], particles, x, y)
  3464. system.removeTimer(timerId)
  3465. end, math.max(explosion[3], 1000), false, explosion, params)
  3466. end
  3467. end,
  3468. defaultEffect=function(id,p,x,y,rand)
  3469. local minDist = 1
  3470. local outerBorder = 20
  3471. local maxDist = 30
  3472. local totalParticles = rand and 40 or (id == -1 and 35 or 75)
  3473. for i = 1, totalParticles do
  3474. if rand then
  3475. id = p[math.random(#p)]
  3476. end
  3477. local dist = math.min(math.random(minDist, maxDist), outerBorder)
  3478. local angle = math.random(0, 360)
  3479. local r = math.rad(angle)
  3480. local dx = math.cos(r)
  3481. local dy = math.sin(r)
  3482. local vx = dist * dx / 10
  3483. local vy = dist * dy / 10
  3484. local ax = -vx / dist / 15
  3485. local ay = (-vy / dist / 15) + 0.05
  3486. if id == -1 then
  3487. tfm.exec.displayParticle(9, x + dx, y + dy, vx, vy, ax, ay, nil)
  3488. tfm.exec.displayParticle(1, x + dx, y + dy, vx, vy, ax, ay, nil)
  3489. else
  3490. tfm.exec.displayParticle(id, x + dx, y + dy, vx, vy, ax, ay, nil)
  3491. end
  3492. end
  3493. end,
  3494. drawParam2=function(arg)
  3495. local x,y,k,a,m,particles=arg[1],arg[2],arg[3],arg[4],arg[5],arg[6]
  3496. local b=a/k
  3497. local dx,dy=0,0
  3498. for t=0,math.pi*2,math.pi/36 do -- step math.pi/18 is every 10 degrees
  3499. dx=x+((a-b)*math.cos(t)+b*math.cos(t*((a/b)-1)))*m
  3500. dy=y+((a-b)*math.sin(t)-b*math.sin(t*((a/b)-1)))*m
  3501. _S.fireworks.velocityEffect(x,y,dx,dy,particles)
  3502. end
  3503. end,
  3504. velocityEffect=function(x,y,dx,dy,particles)
  3505. local dist = distance(x, y, dx, dy)
  3506. local angle = math.atan2(dy - y, dx - x)
  3507. local vx = dist * math.cos(angle)
  3508. local vy = dist * math.sin(angle)
  3509. local ax = -vx / dist / 15
  3510. local ay = (-vy / dist / 15) + 0.05 -- +0.05 for gravity
  3511. for _,p in ipairs(particles) do
  3512. if p == -1 then
  3513. tfm.exec.displayParticle(9, dx, dy, vx, vy, ax, ay, nil)
  3514. tfm.exec.displayParticle(1, dx, dy, vx, vy, ax, ay, nil)
  3515. else
  3516. tfm.exec.displayParticle(p, dx, dy, vx, vy, ax, ay, nil)
  3517. end
  3518. end
  3519. end
  3520. }
  3521.  
  3522.  
  3523. --[[ src/segments/flames.lua ]]--
  3524.  
  3525. _S.flames = {
  3526. disabled=true,
  3527. defaultPlayer=function(player)
  3528. player.activeSegments.flames=true
  3529. end,
  3530. decorations={},
  3531. onFire={},
  3532. ids={2, 13},
  3533. lamps={
  3534. [44]={x=0,y=-70},
  3535. [46]={x=0,y=-65},
  3536. [55]={x=0,y=-10},
  3537. [71]={x=0,y=-25},
  3538. [96]={x=0,y=0},
  3539. [97]={x=0,y=-60},
  3540. [102]={x=0,y=30},
  3541. },
  3542. callbacks={
  3543. newGame=function()
  3544. _S.flames.onFire={}
  3545. _S.flames.decorations={}
  3546. for _,deco in pairs(map.decorations) do
  3547. if _S.flames.lamps[deco.id] then
  3548. table.insert(_S.flames.decorations,deco)
  3549. end
  3550. end
  3551. end,
  3552. eventLoop=function(time,remaining)
  3553. for i,deco in pairs(_S.flames.decorations) do
  3554. _S.flames.fireParticles(deco.x+_S.flames.lamps[deco.id].x,deco.y+_S.flames.lamps[deco.id].y)
  3555. if i==10 then break end
  3556. end
  3557. local toremove={}
  3558. for name,time in pairs(_S.flames.onFire) do
  3559. _S.flames.fireParticles(tfm.get.room.playerList[name].x,tfm.get.room.playerList[name].y)
  3560. if time<os.time()-15000 then
  3561. toremove[name]=true
  3562. end
  3563. end
  3564. for k in pairs(toremove) do _S.flames.onFire[k]=nil end
  3565. end,
  3566. emotePlayed=function(player,emote,param)
  3567. if emote==tfm.enum.emote.confetti or (emote==tfm.enum.emote.flag and param=="us") then
  3568. local x=tfm.get.room.playerList[player.name].x
  3569. local y=tfm.get.room.playerList[player.name].y
  3570. for k,v in pairs(_S.flames.decorations) do
  3571. local x2=v.x+_S.flames.lamps[v.id].x
  3572. local y2=v.y+_S.flames.lamps[v.id].y
  3573. if inSquare(x+(player.facingRight and 50 or -50),y,x2,y2,40) then
  3574. if param=="us" then tfm.exec.chatMessage("Please stop burning the US flag :(",player.name) end
  3575. _S.flames.onFire[player.name]=os.time()
  3576. break
  3577. end
  3578. end
  3579. end
  3580. end,
  3581. },
  3582. fireParticles=function(x,y)
  3583. for i = 1, 5 do
  3584. local x = x + math.random(-15, 15)
  3585. local y = y - math.random(0, 10) - 5
  3586. local vx = math.random(-1, 1) / 10
  3587. local vy = -(math.random(50, 100) / 100)
  3588. for j = 1, 2 do
  3589. tfm.exec.displayParticle(_S.flames.ids[math.random(#_S.flames.ids)], x, y, vx, vy, 0, 0, nil)
  3590. end
  3591. end
  3592. end
  3593. }
  3594.  
  3595.  
  3596. --[[ src/segments/fly.lua ]]--
  3597.  
  3598. _S.fly = {
  3599. callbacks={
  3600. keyboard={
  3601. [KEYS.SPACE]=function(player,down,x,y)
  3602. if down then
  3603. tfm.exec.movePlayer(player.name,0,0,true,0,-50,true)
  3604. end
  3605. end,
  3606. },
  3607. },
  3608. }
  3609.  
  3610.  
  3611. --[[ src/segments/hide.lua ]]--
  3612.  
  3613. _S.hide = {
  3614. hidden={},
  3615. movePlayer=function(player)
  3616. if not player then return end --temp
  3617. local p=tfm.get.room.playerList[player.name]
  3618. local x=0
  3619. if p.x<5 then x=400 elseif p.x>map.length-5 then x=map.length-400 end
  3620. tfm.exec.movePlayer(player.name,x,-400,false,0,-5,false)
  3621. end,
  3622. callbacks={
  3623. newGame=function()
  3624. _S.hide.hidden={}
  3625. end,
  3626. playerLeft=function(player)
  3627. _S.hide.hidden[player.name]=nil
  3628. end,
  3629. eventLoop=function(time,remaining)
  3630. for n,p in pairs(_S.hide.hidden) do
  3631. _S.hide.movePlayer(players[n])
  3632. end
  3633. end
  3634. }
  3635. }
  3636.  
  3637.  
  3638. --[[ src/segments/images.lua ]]--
  3639.  
  3640. _S.images = {
  3641. defaultPlayer=function(player)
  3642. player.activeSegments.images=true
  3643. end,
  3644. sprites={
  3645. main={
  3646. troll={img="1507b048307",x=-50,y=-65},
  3647. monkey={left={img="1507b04923a",x=-24,y=-46},right={img="1507b04b231",x=-32,y=-46},forecheese={"main","banana"}},
  3648. pony={left={img="1507b04d0ae",x=-25,y=-40},right={img="1507b04dfdd",x=-25,y=-40}},
  3649. silverpony={left={img="1507b04ef3b",x=-35,y=-55},right={img="1507b04fe9d",x=-35,y=-55}},
  3650. mj={left={img="1507b050e24",x=-11,y=-37},right={img="1507b051d5e",x=-11,y=-37}},
  3651. br={left={img="1507b052ccc",x=-25,y=-25},right={img="1507b053c28",x=-25,y=-25}},
  3652. tr={left={img="1507b054b9c",x=-25,y=-35},right={img="1507b055ae6",x=-25,y=-35}},
  3653. banana={left={img="1507b04a18d",x=-25,y=-40},right={img="1507b04a18d",x=-15,y=-40},forecheese={"main","monkey"}},
  3654. pusheen={left={img="1511d5ae9f6",x=-40,y=-32},right={img="1511d5b3ee0",x=-40,y=-32},
  3655. action=function(player) _S.images.selectImage(player,"pusheensitting","misc") end,forecheese={"misc","pusheenfish"},
  3656. petaction=function(pet) tfm.exec.removeImage(pet.sprite.img) pet.sprite.category="misc" pet.sprite.id="pusheensitting" _S.pet.showImage(pet,pet.direction) end,
  3657. },
  3658. pusheentoast={left={img="1514f3c049f",x=-40,y=-32},right={img="1514f3cb928",x=-40,y=-32}},
  3659. ace={left={img="151368b0460",x=-45,y=-42},right={img="151368ae6b2",x=-45,y=-42},forecheese={"misc","acebone"},
  3660. action=function(player) _S.images.selectImage(player,"acesitting","misc") end,
  3661. petaction=function(pet) tfm.exec.removeImage(pet.sprite.img) pet.sprite.category="misc" pet.sprite.id="acesitting" _S.pet.showImage(pet,pet.direction) end,
  3662. },
  3663. miniace={left={img="1515465248d",x=-25,y=-10},right={img="15154661304",x=-25,y=-10},forecheese={"misc","miniacebone"},
  3664. action=function(player) _S.images.selectImage(player,"miniacesitting","misc") end,
  3665. petaction=function(pet) tfm.exec.removeImage(pet.sprite.img) pet.sprite.category="misc" pet.sprite.id="miniacesitting" _S.pet.showImage(pet,pet.direction) end,
  3666. },
  3667. spurdo={left={img="1511d5ba0f1",x=-25,y=-25},right={img="1511d5bf92c",x=-25,y=-25}},
  3668. penguin={left={img="1511d5c48e1",x=-32,y=-48},right={img="1511d5c9df3",x=-32,y=-48}},
  3669. },
  3670. misc={
  3671. circle80={img="150c9c27dfa",x=-41,y=-41},
  3672. circle100={img="150c9c2b2e9",x=-51,y=-51},
  3673. circle160={img="150c9c2d90d",x=-81,y=-81},
  3674. circle240={img="150c9bb6632",x=-121,y=-121},
  3675. pusheensitting={left={img="15136acc31e",x=-40,y=-32},right={img="15136ace601",x=-30,y=-32},forecheese={"misc","pusheenfish"},
  3676. action=function(player) _S.images.selectImage(player,"pusheen","main") end,
  3677. petaction=function(pet) tfm.exec.removeImage(pet.sprite.img) pet.sprite.category="main" pet.sprite.id="pusheen" _S.pet.showImage(pet,pet.direction) end,
  3678. },
  3679. acesitting={left={img="151368a96cb",x=-45,y=-37},right={img="151368ac201",x=-45,y=-37},forecheese={"misc","acesittingbone"},
  3680. action=function(player) _S.images.selectImage(player,"ace","main") end,
  3681. petaction=function(pet) tfm.exec.removeImage(pet.sprite.img) pet.sprite.category="main" pet.sprite.id="ace" _S.pet.showImage(pet,pet.direction) end,
  3682. },
  3683. miniacesitting={left={img="151549c842b",x=-25,y=-7},right={img="151549cdaa8",x=-25,y=-7},forecheese={"misc","miniacesittingbone"},
  3684. action=function(player) _S.images.selectImage(player,"miniace","main") end,
  3685. petaction=function(pet) tfm.exec.removeImage(pet.sprite.img) pet.sprite.category="main" pet.sprite.id="miniace" _S.pet.showImage(pet,pet.direction) end,
  3686. },
  3687. acebone={left={img="15136c25de5",x=-45,y=-42},right={img="15136c2d6ec",x=-45,y=-42}},
  3688. miniacebone={left={img="15154679858",x=-25,y=-10},right={img="1515468146c",x=-25,y=-10}},
  3689. acesittingbone={left={img="15136c25de5",x=-45,y=-37},right={img="15136c2d6ec",x=-45,y=-37}},
  3690. miniacesittingbone={left={img="151549eff5e",x=-25,y=-7},right={img="151549f3aad",x=-25,y=-7}},
  3691. pusheenfish={left={img="15136c3cb06",x=-40,y=-32},right={img="15136c40261",x=-40,y=-32}},
  3692. },
  3693. transformice={
  3694. meli={img="1507b11647d",x=-40,y=-40},
  3695. meli2={img="1507b1175bb",x=-40,y=-40},
  3696. meli3={img="1507b11865a",x=-40,y=-40},
  3697. meli4={img="1507b1196d0",x=-40,y=-40},
  3698. meli5={img="1507b11a716",x=-40,y=-40},
  3699. tig={left={img="1516f2005ab",x=-46,y=-60},right={img="1516f1f53d2",x=-46,y=-60}},
  3700. retrohole={img="15141167cf4",x=-21,y=-17},
  3701. cheese={left={img="1507b11b7aa",x=-23,y=-9},right={img="1507b11c813",x=-23,y=-9}},
  3702. hole={left={img="1507b11d89b",x=-20,y=-15},right={img="1507b11e927",x=-20,y=-15}},
  3703. shaman={left={img="1507b11f9df",x=-25,y=-47},right={img="1507b121ae7",x=-25,y=-47,},cheese={"transformice","cheese"}},
  3704. mouse={left={img="1507b123bd4",x=-21,y=-30},right={img="1507b125cf9",x=-21,y=-30},cheese={"transformice","cheese"}},
  3705. boat={left={img="1507b127e61",x=-144,y=-242},right={img="1507b129045",x=-144,y=-242}},
  3706. transformice={img="1507b12a1f0",x=-109,y=-35},
  3707. bouboum={img="1507b12b366",x=-70,y=-60},
  3708. ghost={left={img="149c0689433",x=-21,y=-28},right={img="149c068e42f",x=-21,y=-28}},
  3709. shamousey={img="1507b18e69d",x=-40,y=-52},
  3710. evilsantah={img="15121b35ce9",x=-36,y=-51},
  3711. silverbea={img="1507b18f7fb",x=-37,y=-57},
  3712. hybinkunduz={img="1511d5daf3c",x=-48,y=-77},
  3713. emote1={img="150ab0c288e",x=-15,y=-10},
  3714. emote2={img="150ab0c4bd0",x=-15,y=-10},
  3715. emote3={img="150ab0c6e66",x=-15,y=-10},
  3716. emote4={img="150ab0d3ac2",x=-15,y=-10},
  3717. emote5={img="150ab0cd43a",x=-15,y=-10},
  3718. emote6={img="150ab0d18c5",x=-15,y=-10},
  3719. emote7={img="150ab0cb1d1",x=-15,y=-10},
  3720. emote8={img="150ab0c9044",x=-15,y=-10},
  3721. emote9={img="150ab0cf763",x=-15,y=-10},
  3722. emote0={img="150ab0d5da4",x=-15,y=-10},
  3723. airballoon={left={img="15246f784c0",x=-50,y=-80,l="$"},right={img="15246f7b3f6",x=-50,y=-80,l="$"}},
  3724. broom={left={img="151c067545f",x=-38,y=-42},right={img="151c067ad92",x=-38,y=-42},cheese={"transformice","cheese"}},
  3725. cupid={left={img="151c07d7df0",x=-32,y=-38},right={img="151c07cf5ab",x=-32,y=-38}},
  3726. },
  3727. memes={
  3728. doge={left={img="1507b1a432a",x=-30,y=-43},right={img="1507b1a54a9",x=-30,y=-43}},
  3729. pffftch={img="1507b1a6609",x=-25,y=-25},
  3730. pokerface={img="1507b1a76d7",x=-25,y=-25},
  3731. pokerface2={img="1507b1a8772",x=-25,y=-25},
  3732. rage={img="1507b1a98c7",x=-25,y=-25},
  3733. sadface={img="1507b1aa996",x=-25,y=-25},
  3734. suspicious={img="1507b1aba24",x=-25,y=-25},
  3735. sweetjesus={img="1507b1acab8",x=-25,y=-25},
  3736. troll2={img="1507b1adc13",x=-25,y=-25},
  3737. truestory={img="1507b1aee88",x=-25,y=-25},
  3738. unimpressed={img="1507b1aff31",x=-25,y=-25},
  3739. badass={img="1507b1b0ffb",x=-25,y=-25},
  3740. what={img="1507b1b20c3",x=-25,y=-25},
  3741. youdontsay={img="1507b1b314f",x=-25,y=-25},
  3742. yuno={img="1507b1b4200",x=-25,y=-25},
  3743. actually={img="1507b1b52a7",x=-25,y=-25},
  3744. areyoufuckingkiddingme={img="1507b1b6340",x=-25,y=-25},
  3745. areyouserious={img="1507b1b73d8",x=-25,y=-25},
  3746. awwyeah={img="1507b1b8475",x=-25,y=-25},
  3747. bitchplease={img="1507b1b94f9",x=-25,y=-25},
  3748. cereal={img="1507b1ba583",x=-25,y=-25},
  3749. challengeaccepted={img="1507b1bb693",x=-25,y=-25},
  3750. confident={img="1507b1bc76c",x=-25,y=-25},
  3751. derp={img="1507b1bd80d",x=-25,y=-25},
  3752. epic={img="1507b1be8c3",x=-25,y=-25},
  3753. epicrage={img="1507b1bfa13",x=-25,y=-25},
  3754. betterthanexpected={img="1507b1c0a9d",x=-25,y=-25},
  3755. foreveralone={img="1507b1c1b6e",x=-25,y=-25},
  3756. happyderp={img="1507b1c2c6a",x=-25,y=-25},
  3757. happytroll={img="1507b1c3d31",x=-25,y=-25},
  3758. herp={img="1507b1c4dcb",x=-25,y=-25},
  3759. ilied={img="1507b1c5e8e",x=-25,y=-25},
  3760. itsnotok={img="1507b1c5e8e",x=-25,y=-25},
  3761. likeasir={img="1507b1c803d",x=-25,y=-25},
  3762. listening={img="1507b1c90c8",x=-25,y=-25},
  3763. lol={img="1507b1ca194",x=-25,y=-25},
  3764. megusta={img="1507b1cb245",x=-25,y=-25},
  3765. motherofgod={img="1507b1cc438",x=-25,y=-25},
  3766. notbad={img="1507b1cd4f2",x=-25,y=-25},
  3767. nothingtodohere={img="1507b1ce598",x=-25,y=-25},
  3768. notsureifmegusta={img="1507b1cf647",x=-25,y=-25},
  3769. ohgodwhy={img="1507b1d0768",x=-25,y=-25},
  3770. ohno={img="1507b1d17ef",x=-25,y=-25},
  3771. okay={img="1507b1d289c",x=-25,y=-25},
  3772. },
  3773. props={
  3774. [0]={name="Bush",left={img="1507c123d24"},right={img="1507c125b72"},x=-30,y=-11},
  3775. {name="Tree 1",left={img="1507c1279f1"},right={img="1507c1298ca"},x=-71,y=-190},
  3776. {name="Fern",left={img="1507c12b63d"},right={img="1507c12d45c"},x=-19,y=-17},
  3777. {name="Blue Flower",left={img="1507c12f284"},right={img="1507c130f4a"},x=-7,y=-3},
  3778. {name="Sign",left={img="1507c132d38"},right={img="1507c134aad"},x=-24,y=-40},
  3779. {name="Grass",left={img="1507c1367c8"},right={img="1507c1386ff"},x=-33,y=-28},
  3780. {name="Palm Tree",left={img="1507c13a4dc",x=-83},right={img="1507c13c643",x=-23},y=-142},
  3781. {name="Umbrella",left={img="1507c13e427"},right={img="1507c140363"},x=-51,y=-55},
  3782. {name="Sand Castle",left={img="1507c1427a1"},right={img="1507c1445c8"},x=-25,y=-12},
  3783. {name="Shovel",left={img="1507c146315"},right={img="1507c1480ec"},x=-15,y=3},
  3784. {name="Sand Bucket",left={img="1507c2fa50e"},right={img="1507c14a0f0"},x=-10,y=-5},
  3785. {name="Red Flower",left={img="1507c14bcc9"},right={img="1507c14da5c"},x=-7,y=-9},
  3786. {name="Thorns",left={img="1507c14f8ad"},right={img="1507c151e4d"},x=-31,y=-4},
  3787. {name="Fence",left={img="1507c153f8f"},right={img="1507c155f52"},x=-24,y=-35},
  3788. {name="Window"},
  3789. {name="2-seater Sofa",left={img="1507c157eb1"},right={img="1507c159ee1"},x=-87,y=-47},
  3790. {name="Chair",left={img="1507c15be7f"},right={img="1507c15dde5"},x=-20,y=-49},
  3791. {name="Table 1",left={img="1507c15fcf4"},right={img="1507c161d35"},x=-60,y=-22},
  3792. {name="Vase of Flowers 1",left={img="1507c163dc6"},right={img="1507c165e4c"},x=-20,y=-33},
  3793. {name="Sofa with 1 Place",left={img="1507c167eea"},right={img="1507c169e6e"},x=-34,y=-44},
  3794. {name="Vase of Flowers 2",left={img="1507c16be63"},right={img="1507c16e01e"},x=-22,y=-53},
  3795. {name="Roast Chicken",left={img="1507c170081"},right={img="1507c172145"},x=-25,y=-34},
  3796. {name="Bookcase 1",left={img="1507c174292"},right={img="1507c17632b"},x=-36,y=-121},
  3797. {name="Poster",left={img="1507c1786c7"},right={img="1507c17a7f8"},x=-70,y=-95},
  3798. {name="Bed",left={img="1507c17d006"},right={img="1507c17f54d"},x=-67,y=-55},
  3799. {name="Radio",left={img="1507c2fc489"},right={img="1507c2fe292"},x=-22,y=-30},
  3800. {name="Teddy",left={img="1507c3005f6"},right={img="150c9cc7c5e"},x=-34,y=-47},
  3801. {name="Lamp",left={img="1507c1859b9"},right={img="1507c187c74"},x=-29,y=-148},
  3802. {name="Refrigerator",left={img="1507c18a288"},right={img="1507c18c97e"},x=-34,y=-99},
  3803. {name="Wardrobes",left={img="1507c18f145"},right={img="1507c19183e"},x=-52,y=-111},
  3804. {name="TV with Stand",left={img="1507c193ea7"},right={img="1507c196527"},x=-45,y=-70},
  3805. {name="Soda",left={img="1507c198b62"},right={img="1507c19afbf"},x=-6,y=-16},
  3806. {name="Vase of Flowers 3",left={img="1507c19d5cd"},right={img="1507c19fb5a"},x=-17,y=-23},
  3807. {name="Nightstand",left={img="1507c1a482e"},right={img="1507c1a225e"},x=-17,y=-27},
  3808. {name="Background"},
  3809. {name="Range of Halloween 1",left={img="1507c3028bb"},right={img="1507c30501b"},x=-127,y=-51},
  3810. {name="Range of Halloween 2",left={img="1507c1a7f36"},right={img="1507c1aa5b2"},x=-137,y=-54},
  3811. {name="Broom",left={img="1507c1aca48"},right={img="1507c1aed89"},x=-33,y=-75},
  3812. {name="Skeleton",left={img="1507c1b13a7"},right={img="1507c1b3901"},x=-54,y=-145},
  3813. {name="Halloween Poster",left={img="1507c1b5ee8"},right={img="1507c1b8898"},x=-72,y=-102},
  3814. {name="Balloons Halloween",left={img="1507c1bd1ac"},right={img="1507c1bae44"},x=-39,y=-129},
  3815. {name="Web with Spider",left={img="1507c3078f5"},right={img="1507c309c45"},x=-29,y=-105},
  3816. {name="Autumn Tree",left={img="1507c1c0644"},right={img="1507c1c2bb7"},x=-72,y=-190},
  3817. {name="Bats",left={img="1507c1c51cc"},right={img="1507c1c7834"},x=-74,y=-45},
  3818. {name="Torch",left={img="1507c1c9e1b"},right={img="1507c1cc31d"},x=-35,y=-114},
  3819. {name="Cemetery Background"},
  3820. {name="Torch 2",left={img="1507c1ceba0"},right={img="1507c1d1245"},x=-33,y=-107},
  3821. {name="Fencing",left={img="150c9e4e11a"},right={img="1507c1d388e"},x=-77,y=-54},
  3822. {name="Pumpkin 1",left={img="1507c30c10d"},right={img="1507c30e7e0"},x=-34,y=-38},
  3823. {name="Pumpkin 2",left={img="1507c310c65"},right={img="1507c312f44"},x=-93,y=-115},
  3824. {name="Snowmouse",left={img="1507c3151f4"},right={img="1507c1da0e8"},x=-38,y=-59},
  3825. {name="Snowy Tree",left={img="1507c1dc550"},right={img="1507c1deaaf"},x=-72,y=-194},
  3826. {name="Cookies with Milk",left={img="1507c3174c8"},right={img="1507c31992b"},x=-36,y=-5},
  3827. {name="Garland",left={img="1507c31bd94"},right={img="1507c31e28c"},x=-42,y=-71},
  3828. {name="Stocking",left={img="1507c3206f2"},right={img="1507c322bf8"},x=-13,y=-38},
  3829. {name="Candle 1",left={img="1507c324fe9"},right={img="1507c32759a"},x=-12,y=-22},
  3830. {name="Band Christmas",left={img="1507c329e3f"},right={img="1507c32c440"},x=-125,y=-55},
  3831. {name="Christmas Tree",left={img="1507c32ec28"},right={img="1507c33126c"},x=-83,y=-190},
  3832. {name="Ice Stalactites",left={img="1507c3335cb"},right={img="1507c335bc1"},x=-40,y=-21},
  3833. {name="Mistletoe",left={img="1507c33802d"},right={img="1507c33a3fa"},x=-46,y=-67},
  3834. {name="Ballball",left={img="1507c33c8de"},right={img="1507c33ec72"},x=-13,y=-22},
  3835. {name="Fairy Lights",left={img="1507c3411a5"},right={img="1507c3430f3"},x=-58,y=-32},
  3836. {name="Present",left={img="1507c345573"},right={img="1507c347926"},x=-18,y=-21},
  3837. {name="Gifts",left={img="1507c349d56"},right={img="1507c34c178"},x=-63,y=-49},
  3838. {name="Santah's Sleigh",left={img="1507c350a97"},right={img="1507c34e568"},x=-67,y=-50},
  3839. {name="Ribbon",left={img="1507c3b3600"},right={img="1507c3b5b08"},x=-27,y=-34},
  3840. {name="Umbrella Valentine's Day",left={img="1507c3b81c3"},right={img="1507c3ba7d4"},x=-63,y=-129},
  3841. {name="Chair Valentine's Day",left={img="1507c354d75"},right={img="1507c357241"},x=-22,y=-50},
  3842. {name="Table Valentine's Day",left={img="1507c3595e6"},right={img="1507c35da96"},x=-30,y=-25},
  3843. {name="Valentine's Day Menu",left={img="1507c35ff1d"},right={img="150c9ec0917"},x=-34,y=-60},
  3844. {name="Valentine's Day Gift",left={img="1507c3bcd67"},right={img="1507c3bf520"},x=-18,y=-5},
  3845. {name="Candle 2",left={img="1507c3c15a3"},right={img="1507c3c3a91"},x=-6,y=-36},
  3846. {name="Vase of Flowers 4",left={img="1507c3c5de1"},right={img="1507c3c844b"},x=-25,y=-34},
  3847. {name="Flower in Vase",left={img="1507c3ca981"},right={img="1507c3cce28"},x=-9,y=-25},
  3848. {name="Ribbons with Hearts",left={img="1507c3cf44e"},right={img="1507c3d18a5"},x=-33,y=-95},
  3849. {name="Balloon Heart",left={img="1507c3d3ac8"},right={img="1507c3d5e56"},x=-22,y=-70},
  3850. {name="Window Valentine's Day",left={img="1507c3d83c3"},right={img="1507c3da899"},x=-59,y=-68},
  3851. {name="Heart Pendant",left={img="150c9ee0c4f"},right={img="1507c427f52"},x=-19,y=-42},
  3852. {name="Stones with Algae",left={img="1507c42a0ef"},right={img="1507c42c3f7"},x=-32,y=-19},
  3853. {name="Algae 1",left={img="1507c20e9d5"},right={img="1507c21124b"},x=-24,y=-65},
  3854. {name="Chest",left={img="1507c42e7ab"},right={img="1507c430927"},x=-32,y=-31},
  3855. {name="Starfish",left={img="1507c432aec"},right={img="1507c434afd"},x=-16,y=8},
  3856. {name="Shell",left={img="1507c436b00"},right={img="1507c438f88"},x=-18,y=-2},
  3857. {name="Stones",left={img="1507c43b38d"},right={img="1507c43d4e5"},x=-50,y=-2},
  3858. {name="Stones with Algae 2",left={img="1507c43f6f6"},right={img="1507c4418e7"},x=-90,y=-42},
  3859. {name="Coral 1",left={img="1507c4438df"},right={img="1507c445508"},x=-26,y=-19},
  3860. {name="Coral 2",left={img="1507c44740d"},right={img="1507c20bada"},x=-48,y=-61},
  3861. {name="Algae 2",left={img="1507c20e9d5"},right={img="1507c21124b"},x=-25,y=-66},
  3862. {name="Broken Vase",left={img="150c9f0916c"},right={img="1507c4492b0"},x=-27,y=-28},
  3863. {name="Big Screen"},
  3864. {name="Small Screen"},
  3865. {name="Alchemy Pot",left={img="1507c44b0fb"},right={img="1507c218f50"},x=-10,y=-28},
  3866. {name="Objects of Alchemy 1",left={img="1507c21dc38"},right={img="1507c21b5f6"},x=-55,y=-70},
  3867. {name="Objects of Alchemy 2",left={img="1507c22220b"},right={img="1507c21fcef"},x=-40,y=-47},
  3868. {name="Bookshelf 2",left={img="1507c2248af"},right={img="1507c22720b"},x=-53,y=-148},
  3869. {name="Piano",left={img="1507c22927c"},right={img="1507c22b197"},x=-68,y=-78},
  3870. {name="Fireplace",left={img="1507c22d068"},right={img="1507c22ef09"},x=-62,y=-73},
  3871. {name="Candelebra",left={img="150c9f2fa3c"},right={img="1507c230ba2"},x=-22,y=-62},
  3872. {name="Coffin",left={img="1507c44ce09"},right={img="1507c44ec3d"},x=-31,y=-110},
  3873. {name="Altar",left={img="1507c450b25"},right={img="1507c452a6c"},x=-30,y=-75},
  3874. {name="Bottle with Substance 1",left={img="1507c454922"},right={img="1507c4567e0"},x=-13,y=-23},
  3875. {name="Bottle with Substance 2",left={img="1507c458796"},right={img="1507c45a662"},x=-7,y=-6},
  3876. {name="Chandelier",left={img="1507c45e425"},right={img="1507c45c4c4"},x=-44,y=-102},
  3877. {name="Barrel",left={img="1507cbc6847"},right={img="1507cbc8e33"},x=-26,y=-47},
  3878. {name="Table 2",left={img="150c9f48c07"},right={img="1507cbcb54e"},x=-88,y=-25},
  3879. {name="Chair 2",left={img="1507c463ad0"},right={img="1507c465932"},x=-22,y=-58},
  3880. {name="Skull",left={img="1507c469398"},right={img="1507c4677ef"},x=-15,y=-8},
  3881. {name="Cobweb 1",left={img="1507c46b204"},right={img="1507c46d0e8"},x=-26,y=-43},
  3882. {name="Cobweb 2",left={img="1507c46ef14"},right={img="1507c470d94"},x=-76,y=-37},
  3883. {name="Cobweb 3",left={img="1507c472bb5"},right={img="1507c4749e2"},x=-70,y=-65},
  3884. {name="Cobweb 4",left={img="1507c47680b"},right={img="1507c478661"},x=-30,y=-68},
  3885. {name="Cobweb 5",left={img="1507c47a4b5"},right={img="1507c47c30f"},x=-20,y=-58},
  3886. {name="Vampire Portrait",left={img="1507c47e1d9"},right={img="1507c4800f6"},x=-44,y=-92},
  3887. {name="Fruit Bowl",left={img="1507c482093"},right={img="1507c483f84"},x=-16,y=-23},
  3888. {name="Mirror",left={img="150c9f6f48a"},right={img="1507c485ec8"},x=-43,y=-121},
  3889. {name="Tombstone of Elise",left={img="1507c487f03"},right={img="1507c489dea"},x=-21,y=-43},
  3890. {name="Crucifix",left={img="1507c24de51"},right={img="1507c24fed6"},x=-27,y=-57},
  3891. {name="Background 2"},
  3892. {name="RIP Tombstone",left={img="1507c252411"},right={img="1507c2549ab"},x=-21,y=-42},
  3893. {name="Toilet",left={img="1507c256bcc"},right={img="1507c258fe8"},x=-23,y=-41},
  3894. {name="Bath",left={img="1507c25b770"},right={img="1507c25dc34"},x=-55,y=-90},
  3895. {name="Sink",left={img="1507c2601d3"},right={img="1507c26281d"},x=-23,y=-26},
  3896. {name="Mirror",left={img="1507c48bd17"},right={img="1507c265302"},x=-24,y=-39},
  3897. {name="Pan Rack",left={img="1507c2676f9"},right={img="1507c269dc3"},x=-38,y=-29},
  3898. {name="Oven",left={img="1507c26c534"},right={img="1507c26e9c4"},x=-26,y=-39},
  3899. {name="Rocking Chair",left={img="1507c270f9a"},right={img="1507c273508"},x=-38,y=-61},
  3900. {name="Pan",left={img="1507c48dbdc"},right={img="1507c48fa91"},x=-20,y=-10},
  3901. {name="Stool",left={img="1507c491936"},right={img="1507c2771fc"},x=-15,y=-26},
  3902. {name="Cupboard",left={img="1507c27975f"},right={img="1507c27bcc9"},x=-26,y=-35},
  3903. {name="Drawers",left={img="1507c27e26c"},right={img="1507c280726"},x=-26,y=-35},
  3904. {name="Lava Lamp",left={img="150c9fac35e"},right={img="1507c493939"},x=-11,y=-35},
  3905. {name="Checkpoint"}
  3906. },
  3907. pokemon={
  3908. --[[ POKEMON ]]--
  3909. pokeball={img="1507b1faa2a",x=-8,y=-9},
  3910. egg={img="1507b1fbc31",x=-40,y=-40},
  3911. missingno1={img="1507b1fcd7a",x=-40,y=-40},
  3912. missingno2={img="1507b1fde7a",x=-28,y=-28},
  3913. missingno3={img="1507b1fef38",x=-30,y=-30},
  3914. missingno4={img="1507b2002ac",x=-30,y=-30},
  3915.  
  3916. rhydon={left={img="1507b5108b3"},right={img="1507b511ba9"}},
  3917. murkrow={left={img="1507b82d3a3"},right={img="1507b82eaf6"}},
  3918. thundurus={left={img="1507be64f7a"},right={img="1507be66cd5"}},
  3919. sunkern={left={img="1507b818284"},right={img="1507b819889"}},
  3920. venusaur={left={img="1507b2de388"},right={img="1507b2df4a5"}},
  3921. shellos={left={img="1507bc4e99a"},right={img="1507bc5049c"}},
  3922. leafeon={left={img="1507bceb1c9"},right={img="1507bcecd82"}},
  3923. natu={left={img="1507b618aab"},right={img="1507b61a04f"}},
  3924. granbull={left={img="1507b84cba6"},right={img="1507b84e47f"}},
  3925. totodile={left={img="1507b5e45f6"},right={img="1507b5e5c1a"}},
  3926. wartortle={left={img="1507b2e8fbc"},right={img="1507b2ea17b"}},
  3927. lucario={left={img="1507bca2275"},right={img="1507bca3d7b"}},
  3928. igglybuff={left={img="1507b61072c"},right={img="1507b611d28"}},
  3929. girafarig={left={img="1507b987b81"},right={img="1507b83b1a5"}},
  3930. giratina={left={img="1507bd22764"},right={img="1507bd242a3"}},
  3931. swampert={left={img="1507b89b085"},right={img="1507b9f9e9a"}},
  3932. exeggutor={left={img="1507b4fb1d4"},right={img="1507b4fc4da"}},
  3933. bagon={left={img="1507b74f97b"},right={img="1507b751067"}},
  3934. audino={left={img="1507bdb7f3b"},right={img="1507bdb9a8a"}},
  3935. meditite={left={img="1507b92d822"},right={img="1507b92eff8"}},
  3936. meloetta={left={img="1507c06abd6"},right={img="1507c06c9ef"}},
  3937. hippowdon={left={img="1507bca8a84"},right={img="1507bcaa4c8"}},
  3938. toxicroak={left={img="1507bcb5d04"},right={img="1507bcb7860"}},
  3939. dodrio={left={img="1507b4cfd99"},right={img="1507b4d1497"}},
  3940. drilbur={left={img="1507beb8897"},right={img="1507beba5e2"}},
  3941. cradily={left={img="1507b93ea3d"},right={img="1507b9402b2"}},
  3942. sharpedo={left={img="1507b6dc4f7"},right={img="1507b6ddb35"}},
  3943. jumpluff={left={img="1507b811ff8"},right={img="1507b813732"}},
  3944. bouffalant={left={img="1507be2ce03"},right={img="1507be2e985"}},
  3945. goldeen={left={img="1507b51eb7d"},right={img="1507b51ffb4"}},
  3946. bellossom={left={img="1507b6264f6"},right={img="1507b627b0a"}},
  3947. shroomish={left={img="1507b8e4fe8"},right={img="1507b8e695d"}},
  3948. whismur={left={img="1507b8ffaa5"},right={img="1507b90136e"}},
  3949. azurill={left={img="1507b910640"},right={img="1507b911eba"}},
  3950. larvesta={left={img="1507be4ee30"},right={img="1507be50bca"}},
  3951. spoink={left={img="1507b6ee019"},right={img="1507b6efd6d"}},
  3952. zoroark={left={img="1507bf46044"},right={img="1507bf47eca"}},
  3953. rhyhorn={left={img="1507b50edd7"},right={img="1507b58ae69"}},
  3954. rayquaza={left={img="1507ba3e696"},right={img="1507ba803dc"}},
  3955. metapod={left={img="1507b2ef738"},right={img="1507b2f086b"}},
  3956. seviper={left={img="1507b70e326"},right={img="1507b70fb3f"}},
  3957. marshtomp={left={img="1507b8980d4"},right={img="1507b89984e"}},
  3958. tangrowth={left={img="1507bcda7dd"},right={img="1507bcdc2a4"}},
  3959. darumaka={left={img="1507bf0aa6b"},right={img="1507bf0c84d"}},
  3960. sableye={left={img="1507b91e51b"},right={img="1507b91fda5"}},
  3961. xatu={left={img="1507b61b625"},right={img="1507b61cbf6"}},
  3962. starly={left={img="1507bbf8047"},right={img="1507bbf9ce9"}},
  3963. slaking={left={img="1507b8f19eb"},right={img="1507b8f3269"}},
  3964. donphan={left={img="1507b9c16d2"},right={img="1507b9c2f77"}},
  3965. suicune={left={y=-55,img="1507b9ea1b4"},right={y=-55,img="1507b9ebaa3"}},
  3966. torkoal={left={img="1507b6eafd4"},right={img="1507b6ec7af"}},
  3967. gible={left={img="1507bc91931"},right={img="1507bc932b8"}},
  3968. shellgon={left={img="1507b75279e"},right={img="1507b753ea4"}},
  3969. flaffy={left={img="1507b620da8"},right={img="1507b62237c"}},
  3970. jynx={left={img="1507b52e733"},right={img="1507b52fa4f"}},
  3971. raticate={left={img="1507b3034b5"},right={img="1507b3046ba"}},
  3972. sandslash={left={img="1507b316727"},right={img="1507b3178eb"}},
  3973. magneton={left={img="1507b5883b8"},right={img="1507b4c9c6e"}},
  3974. pidove={left={img="1507bd9098c"},right={img="1507bd925ad"}},
  3975. grimer={left={img="1507b4d7248"},right={img="1507b4d84d2"}},
  3976. munchlax={left={img="1507bc9b8bf"},right={img="1507bc9d33e"}},
  3977. zubat={left={img="1507b33389a"},right={img="1507b334a1f"}},
  3978. beautifly={left={img="1507b8af127"},right={img="1507b8b09cd"}},
  3979. tyrogue={left={img="1507b9ce1c2"},right={img="1507b9cfabe"}},
  3980. servine={left={img="1507bd41b04"},right={img="1507bd435d1"}},
  3981. lugia={left={img="1507b87b728"},right={img="1507b87d0f1"}},
  3982. hitmonlee={left={img="1507b5026d2"},right={img="1507b503bca"}},
  3983. gastrodon={left={img="1507bc51f18"},right={img="1507bc53946"}},
  3984. snorlax={left={y=-60,img="1507b55e189"},right={y=-60,img="1507b55f564"}},
  3985. mimejr={left={y=-60,img="1507bc8443c"},right={y=-60,img="1507bc85eeb"}},
  3986. slowking={left={img="1507b830196"},right={img="1507b831942"}},
  3987. cottonee={left={img="1507beed5c3"},right={img="1507beef2ec"}},
  3988. floatzel={left={img="1507bc45fa8"},right={img="1507bc47980"}},
  3989. accelgor={left={img="1507c04a520"},right={img="1507c04c31c"}},
  3990. klang={left={img="1507c01a9c2"},right={img="1507c01c907"}},
  3991. lumineon={left={img="1507bcbfe8e"},right={img="1507bcc1982"}},
  3992. snorunt={left={img="1507ba11258"},right={img="1507ba12aba"}},
  3993. stunky={left={img="1507bc7356d"},right={img="1507bc75062"}},
  3994. dwebble={left={img="1507bff5e6c"},right={img="1507bff7e50"}},
  3995. misdreavus={left={img="1507b83316b"},right={img="1507b834918"}},
  3996. electrike={left={img="1507b933b3b"},right={img="1507b935493"}},
  3997. numel={left={img="1507b6e4c6a"},right={img="1507b6e6203"}},
  3998. ampharos={left={img="1507b62398d"},right={img="1507b624f47"}},
  3999. golurk={left={img="1507c0616cd"},right={img="1507c06336a"}},
  4000. scyther={left={img="1507b52bfb1"},right={img="1507b52d35b"}},
  4001. nidorina={left={img="1507b31ae1f"},right={img="1507b31bf36"}},
  4002. pidgeotto={left={img="1507b2fcfe2"},right={img="1507b2fe0da"}},
  4003. weedle={left={img="1507b2f3d7c"},right={img="1507b2f51da"}},
  4004. armaldo={left={img="1507b944d89"},right={img="1507b94614d"}},
  4005. prinplup={left={img="1507bbf08ea"},right={img="1507bbf26c8"}},
  4006. croagunk={left={img="1507bcb27fc"},right={img="1507bcb4288"}},
  4007. magby={left={img="1507b9da64f"},right={img="1507b9dbfcd"}},
  4008. solrock={left={img="1507b714624"},right={img="1507b715d97"}},
  4009. slakoth={left={img="1507b8eb323"},right={img="1507b8ecca8"}},
  4010. torchic={left={img="1507b9f865e"},right={img="1507b88c384"}},
  4011. gengar={left={img="1507b4e53af"},right={img="1507b4e6631"}},
  4012. zangoose={left={img="1507b70b3f3"},right={img="1507b70cb19"}},
  4013. skitty={left={img="1507b9168e0"},right={img="1507b918165"}},
  4014. meganium={left={img="1507b5d9478"},right={img="1507b5dac92"}},
  4015. hoppip={left={img="1507b80c456"},right={img="1507b80dba6"}},
  4016. ralts={left={img="1507b8d68ab"},right={img="1507b8d81d3"}},
  4017. garbodor={left={img="1507bf3ebb4"},right={img="1507bf4090c"}},
  4018. voltorb={left={y=-55,img="1507b4f3c5f"},right={y=-55,img="1507b4f5104"}},
  4019. pidgey={left={img="1507b2facd2"},right={img="1507b2fbe1e"}},
  4020. grovyle={left={y=-55,img="1507b8862d4"},right={y=-55,img="1507b887a44"}},
  4021. golett={left={img="1507c05dbcb"},right={img="1507c05fa31"}},
  4022. seedot={left={img="1507b8c0bf9"},right={img="1507b8c2496"}},
  4023. clefable={left={img="1507b3284cf"},right={img="1507b32962d"}},
  4024. wigglytuff={left={img="1507b3312e0"},right={img="1507b3326dc"}},
  4025. manaphy={left={img="1507bd2cd60"},right={img="1507bd2e99b"}},
  4026. noctowl={left={img="1507b5f4dec"},right={img="1507b5f63b6"}},
  4027. golem={left={y=-55,img="1507b4baf72"},right={y=-55,img="1507b587027"}},
  4028. lopunny={left={img="1507bc6089c"},right={img="1507bc62345"}},
  4029. cryogonal={left={img="1507bfb0bed"},right={img="1507bfb2b88"}},
  4030. porygon2={left={img="1507b9c4918"},right={img="1507b9c62a5"}},
  4031. arbok={left={y=-55,img="1507b30dba4"},right={y=-55,img="1507b30ed0f"}},
  4032. psyduck={left={img="1507b43d426"},right={img="1507b43e7af"}},
  4033. ekans={left={img="1507b309d85"},right={img="1507b30c9e9"}},
  4034. feraligatr={left={img="1507b5e9dc7"},right={img="1507b5eb384"}},
  4035. gabite={left={img="1507bc94dab"},right={img="1507bc9686c"}},
  4036. mienshao={left={img="1507c056110"},right={img="1507c057fd9"}},
  4037. kingler={left={img="1507b4f158b"},right={img="1507b4f294b"}},
  4038. taillow={left={img="1507b8ca2bd"},right={img="1507b8cbbb4"}},
  4039. glaceon={left={img="1507bcee886"},right={img="1507bcf02bd"}},
  4040. zweilous={left={img="1507be47bfb"},right={img="1507be49847"}},
  4041. torterra={left={img="1507bbdd839"},right={img="1507bbdf699"}},
  4042. darmanitan={left={img="1507bf0e594"},right={img="1507bf10396"}},
  4043. nidoranm={left={img="1507b31f67f"},right={img="1507b320811"}},
  4044. mewtwo={left={y=-60,img="1507b56d539"},right={y=-60,img="1507b5924c2"}},
  4045. kabutops={left={img="1507b55920c"},right={img="1507b55a5a5"}},
  4046. patrat={left={img="1507bd5c9c6"},right={img="1507bd5e507"}},
  4047. whirlipede={left={img="1507bee5fc0"},right={img="1507bee7da7"}},
  4048. kadabra={left={y=-55,img="1507b4541cd"},right={y=-55,img="1507b455315"}},
  4049. ludicolo={left={img="1507b8bdb1d"},right={img="1507b8bf2e4"}},
  4050. empoleon={left={img="1507bbf43bc"},right={img="1507bbf62c9"}},
  4051. kricketune={left={img="1507beab9d2"},right={img="1507bc0eb0c"}},
  4052. fearow={left={img="1507b3079d9"},right={img="1507b308b1d"}},
  4053. musharna={left={img="1507bd8d1c4"},right={img="1507bd8ed44"}},
  4054. nidoqueen={img="1507b31d216"},
  4055. carvahna={left={img="1507b6d8c13"},right={img="1507b6da1a1"}},
  4056. seismitoad={left={img="1507becc898"},right={img="1507bece80a"}},
  4057. skarmory={left={img="1507b9b1e22"},right={img="1507b9b3713"}},
  4058. nuzleaf={left={img="1507b8c3dbb"},right={img="1507b8c560c"}},
  4059. meowth={left={img="1507b4389ea"},right={img="1507b439ac6"}},
  4060. charmander={left={img="1507b2e05b6"},right={img="1507b2e16b2"}},
  4061. exeggcute={left={img="1507b4f8b8f"},right={img="1507b4f9ef4"}},
  4062. alakazam={left={y=-60,img="1507b456476"},right={y=-60,img="1507b457651"}},
  4063. cyndaquil={left={img="1507b5dc239"},right={img="1507b5dd806"}},
  4064. simipour={left={img="1507bd8626a"},right={img="1507bd87e24"}},
  4065. watchog={left={img="1507bd6000f"},right={img="1507bd61b0f"}},
  4066. dratini={left={img="1507b58ebc5"},right={img="1507b58fccb"}},
  4067. sawsbuck={left={img="1507bf7cb8f"},right={img="1507bf7ec39"}},
  4068. glameow={left={img="1507bc6968a"},right={img="1507bc6b077"}},
  4069. happiny={left={img="1507bc879c9"},right={img="1507bc894c9"}},
  4070. electrode={left={img="1507b4f643a"},right={img="1507b4f786a"}},
  4071. sudowoodo={left={img="1507b806688"},right={img="1507b807db1"}},
  4072. smoochum={left={img="1507b9d4654"},right={img="1507b9d5fee"}},
  4073. monferno={left={img="1507bbe518d"},right={img="1507bbe7175"}},
  4074. koffing={left={img="1507b509ea9"},right={img="1507b50b31b"}},
  4075. klink={left={img="1507c0168fb"},right={img="1507c0188e4"}},
  4076. sylveon={left={img="1507c0728cf"},right={img="1507c0745d4"}},
  4077. spheal={left={img="1507ba1755d"},right={img="1507ba18de0"}},
  4078. lickitung={left={img="1507b50783a"},right={img="1507b508b66"}},
  4079. rapidash={left={img="1507b4bf63a"},right={img="1507b4c097a"}},
  4080. silcoon={left={img="1507b8ab799"},right={img="1507b8acff3"}},
  4081. galvantula={left={img="1507c00afb6"},right={img="1507c00cea1"}},
  4082. serperior={left={img="1507bd45127"},right={img="1507bd46c00"}},
  4083. aron={left={y=-45,img="1507b92430f"},right={y=-45,img="1507b925b50"}},
  4084. magmar={left={img="1507b5337ef"},right={img="1507b534b93"}},
  4085. zapdos={left={y=-60,img="1507b5630b1"},right={y=-60,img="1507b564459"}},
  4086. uxie={left={img="1507bd0a8de"},right={img="1507bd0c425"}},
  4087. dewgong={left={img="1507b4d4cc5"},right={img="1507b4d5fb0"}},
  4088. drifloon={left={img="1507beaf764"},right={img="1507beb160d"}},
  4089. slowbro={left={img="1507b4c4208"},right={img="1507b4c55d1"}},
  4090. dugtrio={left={img="1507b43604f"},right={img="1507b43715f"}},
  4091. gorebyss={left={img="1507b746d21"},right={img="1507b7485bb"}},
  4092. quilfish={left={img="1507b84fd60"},right={img="1507b851479"}},
  4093. wobbuffet={left={img="1507b838d67"},right={img="1507b9862eb"}},
  4094. charizard={left={y=-65,img="1507b2e4abb"},right={y=-65,img="1507b2e5c4c"}},
  4095. mesprit={left={img="1507bd0df9e"},right={img="1507bd0fb82"}},
  4096. poliwhirl={left={img="1507b44d942"},right={img="1507b44ea34"}},
  4097. zebstrika={left={img="1507bd9e5d3"},right={img="1507bda0344"}},
  4098. clefairy={left={img="1507b3260e1"},right={img="1507b327362"}},
  4099. togetic={left={img="1507b615ec5"},right={img="1507b6174b8"}},
  4100. blissey={left={img="1507b9e0aad"},right={img="1507b9e23ae"}},
  4101. amoonguss={left={img="1507bf9015d"},right={img="1507bf920db"}},
  4102. wooper={left={img="1507b820b7b"},right={img="1507b8222f6"}},
  4103. cherubi={left={img="1507beadac7"},right={img="1507bc498e8"}},
  4104. tornadus={left={img="1507be61666"},right={img="1507be632e4"}},
  4105. honchkrow={left={img="1507bc6754d"},right={img="1507beb34d9"}},
  4106. porygonZ={left={img="1507bcf88db"},right={img="1507beb52ed"}},
  4107. yveltal={left={img="1507c07638c"},right={img="1507c0780da"}},
  4108. heracross={left={img="1507ba7cf7d"},right={img="1507b98ba2b"}},
  4109. nidoranf={left={img="1507b318a84"},right={img="1507b319c2b"}},
  4110. shedinja={left={img="1507b8fc6cb"},right={img="1507b8fe180"}},
  4111. walrein={left={img="1507ba1df04"},right={img="1507ba1f74d"}},
  4112. ninjask={left={img="1507b8f9361"},right={img="1507b8facca"}},
  4113. manectric={left={img="1507b936cff"},right={img="1507b6c1408"}},
  4114. swanna={left={img="1507bffbb94"},right={img="1507bf6b140"}},
  4115. chinchou={left={img="1507b6056da"},right={img="1507b606cef"}},
  4116. ledyba={left={img="1507b5f79c4"},right={img="1507b5f8fe3"}},
  4117. relicanth={left={img="1507b749d55"},right={img="1507b74b4ca"}},
  4118. corphish={left={img="1507b71d629"},right={img="1507b71eec2"}},
  4119. butterfree={left={y=-55,img="1507b2f1946"},right={y=-55,img="1507b2f2a45"}},
  4120. riolu={left={img="1507bc9ecc9"},right={img="1507bca0746"}},
  4121. cacturne={left={img="1507b7040c3"},right={img="1507b7059ea"}},
  4122. sandile={left={img="1507beff93c"},right={img="1507bf016e9"}},
  4123. shiftry={left={img="1507b8c6e2e"},right={img="1507b8c896b"}},
  4124. simisage={left={img="1507bd7871c"},right={img="1507bd7a25d"}},
  4125. omastar={left={img="1507b554fa5"},right={img="1507b5562f7"}},
  4126. kakuna={left={img="1507b2f640f"},right={img="1507b2f7961"}},
  4127. ivysaur={left={img="1507b2dbec0"},right={img="1507b2dd037"}},
  4128. budew={left={img="1507bc1aaea"},right={img="1507bc1c6fb"}},
  4129. gloom={left={img="1507b33a57f"},right={img="1507b33b818"}},
  4130. tentacruel={left={img="1507b4b36cf"},right={img="1507b4b4a96"}},
  4131. buneary={left={img="1507bc5d20f"},right={img="1507bc5ed6a"}},
  4132. hoothoot={left={img="1507b5f21c6"},right={img="1507b5f381f"}},
  4133. roggenrola={left={img="1507bda1f25"},right={img="1507bda3a74"}},
  4134. phanpy={left={img="1507b9be52c"},right={img="1507b9bfe0d"}},
  4135. bonsly={left={img="1507bc80e68"},right={img="1507bc8292a"}},
  4136. whiscash={left={img="1507b71a5c1"},right={img="1507b71bdad"}},
  4137. krokorok={left={img="1507bf03492"},right={img="1507bf051a8"}},
  4138. muk={left={img="1507b4d978b"},right={img="1507b4daa5e"}},
  4139. ponyta={left={img="1507b4bcff0"},right={img="1507b4be3da"}},
  4140. burmy={left={img="1507bc2f1b3"},right={img="1507bc30b7c"}},
  4141. bellsprout={left={img="1507b4a9a50"},right={img="1507b4aad95"}},
  4142. bronzong={left={img="1507bc7d918"},right={img="1507bc7f3ea"}},
  4143. swalot={left={img="1507b6d5d28"},right={img="1507b6d74a3"}},
  4144. seadra={left={img="1507b51c3ba"},right={img="1507b51d7a4"}},
  4145. virizion={left={img="1507be5db9c"},right={img="1507be5f999"}},
  4146. rattata={left={img="1507b30130c"},right={img="1507b3023f9"}},
  4147. stunfish={left={img="1507c04e123"},right={img="1507c050091"}},
  4148. oddish={left={img="1507b3380a3"},right={img="1507b339370"}},
  4149. ledian={left={img="1507b5fa5ea"},right={img="1507b5fbc5e"}},
  4150. cinccino={left={img="1507bf4d7ab"},right={img="1507bf4f4d6"}},
  4151. houndour={left={img="1507b9b5019"},right={img="1507b9b691e"}},
  4152. horsea={left={img="1507b519ce4"},right={img="1507b51b0cd"}},
  4153. bisharp={left={img="1507be2954e"},right={img="1507be2b245"}},
  4154. kyurem={left={img="1507be73917"},right={img="1507be75613"}},
  4155. woobat={left={img="1507bdac571"},right={img="1507bdae0c8"}},
  4156. vileplume={left={img="1507b33ccde"},right={img="1507b33df69"}},
  4157. staraptor={left={img="1507bbffb5d"},right={img="1507bc01db1"}},
  4158. combee={left={img="1507bc38d51"},right={img="1507bc3a72f"}},
  4159. liepard={left={img="1507bd71201"},right={img="1507bd733ef"}},
  4160. ambipom={left={img="1507bc552e7"},right={img="1507bc56c6c"}},
  4161. machoke={left={img="1507b45ad23"},right={img="1507b4a8662"}},
  4162. barboach={left={img="1507b71754a"},right={img="1507b718c47"}},
  4163. spinda={left={img="1507b6f49fd"},right={img="1507b6f6218"}},
  4164. vanillish={left={img="1507bf70f94"},right={img="1507bf72ebe"}},
  4165. gigalith={left={img="1507bda8d61"},right={img="1507bdaa931"}},
  4166. pignite={left={img="1507bd4bd70"},right={img="1507bd4d8ac"}},
  4167. graveler={left={img="1507b4b825e"},right={img="1507b4b9921"}},
  4168. pansage={left={img="1507bd74f99"},right={img="1507bd76b75"}},
  4169. feebas={left={img="1507b9478ac"},right={img="1507b949059"}},
  4170. poliwrath={left={img="1507b44fb79"},right={img="1507b450d43"}},
  4171. petilil={left={img="1507bef4c2f"},right={img="1507bef6981"}},
  4172. sealeo={left={img="1507ba1a686"},right={img="1507ba1c6bf"}},
  4173. solosis={left={img="1507bf5c8ed"},right={img="1507bf5e7a5"}},
  4174. snover={left={img="1507bcc69a3"},right={img="1507bcc84c0"}},
  4175. electivire={left={img="1507bcddd0b"},right={img="1507bcdf943"}},
  4176. magnemite={left={img="1507b4c69df"},right={img="1507b4c7d42"}},
  4177. reuniclus={left={img="1507bf64254"},right={img="1507bf660db"}},
  4178. camerupt={left={img="1507b6e799b"},right={img="1507b6e9142"}},
  4179. azelf={left={img="1507bd11591"},right={img="1507bd1319a"}},
  4180. darkrai={left={img="1507bd30517"},right={img="1507bd32052"}},
  4181. banette={left={img="1507b956b54"},right={img="1507b9583eb"}},
  4182. heatran={left={img="1507bd1bb21"},right={img="1507bd1d6b4"}},
  4183. machop={left={img="1507b458774"},right={img="1507b4599e7"}},
  4184. mamoswine={left={img="1507bcf5355"},right={img="1507bcf6e30"}},
  4185. haunter={left={img="1507b4e2e49"},right={img="1507b4e40e7"}},
  4186. baltoy={left={img="150c9a44ee9"},right={img="1507b726119"}},
  4187. espeon={left={img="1507b8268e0"},right={img="1507b828066"}},
  4188. bibarel={left={img="1507bc072ce"},right={img="1507bc08d82"}},
  4189. mareep={left={img="1507b61e22f"},right={img="1507b61f784"}},
  4190. aipom={left={img="1507b81504e"},right={y=-55,img="1507b816c34"}},
  4191. lileep={left={img="1507b93ba5d"},right={img="1507b93d210"}},
  4192. registeel={left={y=-60,img="1507ba30445"},right={y=-60,img="1507ba31ca6"}},
  4193. jigglypuff={left={img="1507b32ef94"},right={img="1507b33015d"}},
  4194. persian={left={img="1507b43ad35"},right={img="1507b43c179"}},
  4195. cascoon={left={img="1507b8b21b3"},right={img="1507b8b3981"}},
  4196. nincada={left={img="1507b8f6257"},right={img="1507b8f7ad1"}},
  4197. blitzle={left={img="1507bd9ae65"},right={img="1507bd9c9e0"}},
  4198. jellicent={left={img="1507bfff8d6"},right={img="1507c001726"}},
  4199. marill={left={img="150c9a32436"},right={img="1507b802f49"}},
  4200. golbat={left={img="1507b335c14"},right={img="1507b336e87"}},
  4201. smeargle={left={img="1507b9caf06"},right={img="1507b9cc860"}},
  4202. gallade={left={img="1507beb6a97"},right={img="1507bcfb590"}},
  4203. octillery={left={img="1507b9a8752"},right={img="1507b9aa011"}},
  4204. oshawott={left={img="1507bd52ab4"},right={img="1507bd541f7"}},
  4205. charmeleon={left={img="1507b2e27c9"},right={img="1507b2e3922"}},
  4206. squirtle={left={img="1507b2e6d73"},right={img="1507b2e7ee0"}},
  4207. skiploom={left={img="1507b80f200"},right={img="1507b810999"}},
  4208. yamask={left={img="1507bf2422c"},right={img="1507bf25fd2"}},
  4209. articuno={left={y=-65,img="1507b56090d"},right={y=-65,img="1507b561ca7"}},
  4210. magikarp={left={img="1507b53aded"},right={img="1507b53c440"}},
  4211. groudon={left={img="1507ba3b4d2"},right={img="1507ba3cdfd"}},
  4212. carnivine={left={img="1507bcb93e9"},right={img="1507bcbae5b"}},
  4213. munna={left={img="1507bd899a8"},right={img="1507bd8b546"}},
  4214. electabuzz={left={img="1507b530f63"},right={img="1507b53236f"}},
  4215. nidorino={left={img="1507b321979"},right={img="1507b322b01"}},
  4216. onix={left={y=-65,img="1507b4e7901"},right={y=-65,img="1507b4e8ba4"}},
  4217. breloom={left={img="1507b8e81be"},right={img="1507b8e9b35"}},
  4218. ghastly={left={img="1507b4e083a"},right={img="1507b4e1bb5"}},
  4219. hippopotas={left={img="1507bca57e5"},right={img="1507bca6fa2"}},
  4220. cresselia={left={img="1507bd25eb1"},right={img="1507bd279d1"}},
  4221. croconaw={left={img="1507b5e725b"},right={img="1507b5e87b0"}},
  4222. litwick={left={img="1507c031f05"},right={img="1507c033c11"}},
  4223. spearow={left={y=-53,img="1507b30579d"},right={y=-53,img="1507b3068d2"}},
  4224. crobat={left={img="1507b602b40"},right={img="1507b604120"}},
  4225. typhlosion={left={img="1507b5e1a42"},right={img="1507b5e300f"}},
  4226. abra={left={img="1507b451ed3"},right={img="1507b45307d"}},
  4227. chimecho={left={img="1507ba08166"},right={img="1507ba09987"}},
  4228. bronzor={left={img="1507bc7a1cf"},right={img="1507bc7bcde"}},
  4229. ducklett={left={img="1507bf67fc6"},right={img="1507bff9d0f"}},
  4230. krabby={left={img="1507b4eeb7a"},right={img="1507b4efe8b"}},
  4231. seaking={left={img="1507b52130a"},right={img="1507b522692"}},
  4232. ditto={left={img="1507b54367d"},right={img="1507b544c50"},action=function(player,x,y)
  4233. local closest
  4234. for n,p in pairs(players) do
  4235. if p.sprite and pythag(x,y,tfm.get.room.playerList[n].x,tfm.get.room.playerList[n].y,20) then
  4236. local d=distance(tfm.get.room.playerList[n].x,tfm.get.room.playerList[n].y,x,y)
  4237. if not closest or d<closest.distance then
  4238. closest={category=p.sprite.category,id=p.sprite.id,distance=d}
  4239. end
  4240. end
  4241. end
  4242. if closest then
  4243. _S.images.selectImage(player,closest.id,closest.category)
  4244. end
  4245. end},
  4246. cubchoo={left={img="1507cbc4269"},right={img="1507c0472d1"}},
  4247. grumpig={left={img="1507b6f1669"},right={img="1507b6f2f59"}},
  4248. dragonite={left={y=-65,img="1507b56adb3"},right={y=-65,img="1507b56c17e"}},
  4249. doduo={left={img="1507b4cd653"},right={img="1507b4ce96d"}},
  4250. tirtouga={left={img="1507bf2b9d1"},right={img="1507bf2d81d"}},
  4251. farfetchd={left={img="1507b4caf7f"},right={img="1507b4cc204"}},
  4252. staravia={left={img="1507bbfbb99"},right={img="1507bbfdc21"}},
  4253. seel={left={img="1507b4d2701"},right={img="1507b4d3990"}},
  4254. celebi={left={img="1507b881637"},right={img="1507b882d35"}},
  4255. vigoroth={left={img="1507b8ee798"},right={img="1507b8efffc"}},
  4256. shuckle={left={img="150cac53a9f"},right={img="1507b98949e"}},
  4257. treecko={left={img="1507b884009"},right={img="1507b9f6dca"}},
  4258. growlithe={left={img="1507b446807"},right={img="1507b447bd5"}},
  4259. genesect={left={img="1507c06e86a"},right={img="1507c0708a3"}},
  4260. chandelure={left={img="1507c03906e"},right={img="1507c03ac39"}},
  4261. landorus={left={img="1507be6ff0c"},right={img="1507be71b77"}},
  4262. tyranitar={left={img="1507b9f3a5b"},right={img="1507b9f544c"}},
  4263. zekrom={left={img="1507be6c4df"},right={img="1507be6e11e"}},
  4264. venomoth={left={img="1507b431ae8"},right={img="1507b432c36"}},
  4265. reshiram={left={img="1507be6898b"},right={img="1507be6a7fc"}},
  4266. piloswine={left={img="1507b99f0a9"},right={img="1507b9a0a5d"}},
  4267. poochyena={left={img="1507ba7ea31"},right={img="1507b9fbfeb"}},
  4268. lanturn={left={img="1507b60834d"},right={img="1507b609960"}},
  4269. togepi={left={img="1507b6132e2"},right={img="1507b6148a6"}},
  4270. cobalion={left={img="1507be566c9"},right={img="1507be5840c"}},
  4271. aerodactyl={left={y=-60,img="1507b55b9ac"},right={y=-60,img="1507b55cdcc"}},
  4272. karrablast={left={img="1507bf84992"},right={img="1507bf8684a"}},
  4273. maractus={left={img="1507bf12097"},right={img="1507bff3eb5"}},
  4274. glalie={left={img="1507ba14321"},right={img="1507ba15d02"}},
  4275. azumarill={left={img="1507b98483d"},right={img="1507b804f4d"}},
  4276. kecleon={left={img="1507b950d58"},right={img="1507b952588"}},
  4277. volcarona={left={img="1507be52859"},right={img="1507be54923"}},
  4278. ferrothorn={left={img="1507c012b53"},right={img="1507c014a9c"}},
  4279. hydreigon={left={img="1507be4b53c"},right={img="1507be4d176"}},
  4280. deino={left={img="1507be455f6"},right={img="1507c066d2b"}},
  4281. diglett={left={y=-55,img="1507b433d39"},right={y=-55,img="1507b434f1f"}},
  4282. ursaring={left={img="1507b993529"},right={img="1507b994dbd"}},
  4283. archen={left={img="1507bf33321"},right={img="1507bf350fc"}},
  4284. durant={left={img="1507be41e49"},right={img="1507be43afe"}},
  4285. pineco={left={img="1507b83c9bf"},right={img="1507b83e236"}},
  4286. heatmor={left={img="1507be3e610"},right={img="1507be4028d"}},
  4287. mandibuzz={left={img="1507be3aabb"},right={img="1507be3c74a"}},
  4288. cherrim={left={img="1507bc4b3be"},right={img="1507bc4cdac"}},
  4289. moltres={left={y=-65,img="1507b565845"},right={y=-65,img="1507b566a1f"}},
  4290. snubbull={left={img="1507b849d06"},right={img="1507b84b43a"}},
  4291. vullaby={left={img="1507be373b9"},right={img="1507be38f06"}},
  4292. braviary={left={img="1507be33ba6"},right={img="1507be35765"}},
  4293. spinarak={left={img="1507b5fd229"},right={img="1507b5fe80c"}},
  4294. spiritomb={left={img="1507bc8e427"},right={img="1507bc8fe6e"}},
  4295. sawk={left={img="1507bed3f37"},right={img="1507bed5c0e"}},
  4296. druddigon={left={img="1507c059ee0"},right={img="1507c05bb57"}},
  4297. loudred={left={img="1507b902c99"},right={img="1507b904652"}},
  4298. mienfoo={left={img="1507c052166"},right={img="1507c054102"}},
  4299. hypno={left={img="1507b4ec591"},right={img="1507b4ed873"}},
  4300. shaymin={left={img="1507bd33c0d"},right={img="1507bd35821"}},
  4301. arceus={left={y=-60,img="1507bd3749f"},right={y=-60,img="1507bd3911b"}},
  4302. beartic={left={img="1507c0489be"},right={img="1507bfae561"}},
  4303. unown={left={img="1507b835fb5"},right={img="1507b83762a"}},
  4304. pidgeot={left={img="1507b2ff1b9"},right={img="1507b30026f"}},
  4305. haxorus={left={img="1507c043596"},right={img="1507c045126"}},
  4306. excadrill={left={img="1507bdb4927"},right={img="1507bdb649a"}},
  4307. beheeyem={left={img="1507c02e301"},right={img="1507c030114"}},
  4308. fraxure={left={img="1507c03fdcf"},right={img="1507c0419d0"}},
  4309. axew={left={img="1507c03c7f0"},right={img="1507c03e413"}},
  4310. blastoise={left={img="1507b2eb27f"},right={img="1507b2ec390"}},
  4311. medicham={left={img="1507b9309df"},right={img="1507b9322a6"}},
  4312. yanmega={left={img="1507bce7cdf"},right={img="1507bce96f9"}},
  4313. vaporeon={left={img="1507b5488de"},right={img="1507b549c81"}},
  4314. magnezone={left={img="1507bcd0be8"},right={img="1507bcd2568"}},
  4315. keldeo={left={img="150c9a64ae5"},right={img="1507c068d30"}},
  4316. teddiursa={left={img="1507b9903c7"},right={img="1507b991c2a"}},
  4317. jolteon={left={img="1507b54b0e0"},right={img="1507b54c481"}},
  4318. lapment={left={img="1507c0358a1"},right={img="1507c03748b"}},
  4319. krookodile={left={img="1507bf06f40"},right={img="1507bf08c0f"}},
  4320. elgyem={left={img="1507c02bce1"},right={img="1507cbc1bf5"}},
  4321. pupitar={left={img="1507b9f0798"},right={img="1507b9f20fc"}},
  4322. pawniard={left={img="1507c06504d"},right={img="1507be24f7b"}},
  4323. eelektrik={left={img="1507cbbc94c"},right={img="1507cbbf466"}},
  4324. tynamo={left={img="1507c022240"},right={img="1507c0241f2"}},
  4325. klinklang={left={img="1507c01e3d5"},right={img="1507c02048b"}},
  4326. raichu={left={img="1507b31213d"},right={img="1507b313303"}},
  4327. ferroseed={left={img="1507c00ed4c"},right={img="1507c010bf9"}},
  4328. mismagius={left={img="1507bc63d04"},right={img="1507bc658cd"}},
  4329. joltik={left={img="1507c0072ab"},right={img="1507c0091f3"}},
  4330. bulbasaur={left={y=-45,img="1507b2d9a2d"},right={y=-45,img="1507b2dabdb"}},
  4331. alomomola={left={img="1507c0035d4"},right={img="1507c00548c"}},
  4332. frillish={left={img="150c9a7013c"},right={img="1507bffdaaa"}},
  4333. foongus={left={img="1507bf8c310"},right={img="1507bf8e234"}},
  4334. shuppet={left={img="1507b953e0d"},right={img="1507b9556f3"}},
  4335. emolga={left={img="1507bf80be3"},right={img="1507bf82ae9"}},
  4336. wingull={left={img="1507b8d062b"},right={img="1507b8d1e56"}},
  4337. sandshrew={left={img="1507b314456"},right={img="1507b3155a3"}},
  4338. nidoking={left={img="1507b323de0"},right={img="1507b324f78"}},
  4339. geodude={left={img="1507b4b5d2d"},right={img="1507b4b6fe4"}},
  4340. deerling={left={img="1507bf78e80"},right={img="1507bf7ad69"}},
  4341. vanilluxe={left={img="1507bf74f0d"},right={img="1507bf76ec9"}},
  4342. vanillite={left={img="1507bf6d07c"},right={img="1507bf6efdd"}},
  4343. mawile={left={img="1507b921391"},right={img="1507b922bfc"}},
  4344. duosion={left={img="1507bf605e9"},right={img="1507bf62424"}},
  4345. mightyena={left={img="1507b89dcb4"},right={img="1507b89f4b0"}},
  4346. gothitelle={left={img="1507bf58a77"},right={img="1507bf5aa42"}},
  4347. gothorita={left={img="1507bf54e66"},right={img="1507bf56c79"}},
  4348. starmie={left={img="1507b526118"},right={img="1507b527555"}},
  4349. samurott={left={img="1507bd593ec"},right={img="1507bd5aea2"}},
  4350. gothita={left={img="1507bf5129a"},right={img="1507bf5305b"}},
  4351. mantine={left={img="1507b9aeb4b"},right={img="1507b9b047d"}},
  4352. scraggy={left={img="1507bf18e68"},right={img="1507bf1acef"}},
  4353. steelix={left={y=-55,img="1507b846ea8"},right={y=-55,img="1507b848650"}},
  4354. minccino={left={img="1507bf49c7a"},right={img="1507bf4ba4c"}},
  4355. boldore={left={img="1507bda561d"},right={img="1507bda721c"}},
  4356. luxray={left={img="1507bc1748a"},right={img="1507bc19009"}},
  4357. gurdurr={left={img="1507bebe089"},right={img="1507bebfe10"}},
  4358. trubbish={left={img="1507bf3b131"},right={img="1507bf3cecd"}},
  4359. victini={left={img="1507bd3acf8"},right={img="1507bd3c95e"}},
  4360. wurmple={left={img="1507b8a85f1"},right={img="1507b8a9da4"}},
  4361. mudkip={left={img="1507b8952d3"},right={img="1507b896a2a"}},
  4362. bayleef={left={img="1507b5d6a2b"},right={img="1507b5d7fd3"}},
  4363. gulpin={left={img="1507b6d2d2c"},right={img="1507b6d4549"}},
  4364. dusclops={left={img="1507ba020d2"},right={img="1507ba038da"}},
  4365. golduck={left={img="1507b43f9fc"},right={img="1507b440da0"}},
  4366. huntail={left={img="1507b743e1e"},right={img="1507b74557a"}},
  4367. scrafty={left={img="1507bf1ca98"},right={img="1507bf1e84e"}},
  4368. palkia={left={y=-60,img="1507bd184d2"},right={y=-60,img="1507bd19f67"}},
  4369. basculin={left={img="1507befc09e"},right={img="1507befdbd3"}},
  4370. swadloon={left={img="1507bedb1ce"},right={img="1507bedcb68"}},
  4371. herdier={left={img="1507bd66e2f"},right={img="1507bd68924"}},
  4372. hooh={left={img="1507b87e7f6"},right={img="1507b87ff60"}},
  4373. scolipede={left={img="1507bee9b88"},right={img="1507beeb8cd"}},
  4374. omanyte={left={img="1507b552854"},right={img="1507b553bc4"}},
  4375. venipede={left={img="1507bee25b4"},right={img="1507bee428c"}},
  4376. tropius={left={img="1507ba0511e"},right={img="1507ba06937"}},
  4377. surskit={left={img="1507b8dfdad"},right={img="1507b8e163e"}},
  4378. swellow={left={img="1507b8cd466"},right={img="1507b8cec87"}},
  4379. lilligant={left={img="1507bef862f"},right={img="1507befa39f"}},
  4380. sewaddle={left={img="1507bed78d4"},right={img="1507bed95c6"}},
  4381. eelektross={left={img="1507c027f46"},right={img="1507c029e1b"}},
  4382. foretress={left={img="1507b83f946"},right={img="1507b84125e"}},
  4383. throh={left={img="1507bed0506"},right={img="1507bed223e"}},
  4384. parasect={left={img="1507b341777"},right={img="1507b342a20"}},
  4385. palpitoad={left={img="1507bec9181"},right={img="1507becaf4a"}},
  4386. latias={left={img="1507ba33507"},right={img="1507bb6b94e"}},
  4387. phione={left={img="1507bd295fb"},right={img="1507bd2b175"}},
  4388. conkeldurr={left={img="1507bec1bd2"},right={img="1507bec39b4"}},
  4389. timburr={left={img="1507bdbb5ff"},right={img="1507bdbd1b5"}},
  4390. purrloin={left={img="1507bd6db6a"},right={img="1507bd6f637"}},
  4391. zorua={left={img="1507bf42637"},right={img="1507bf442be"}},
  4392. unfezant={left={img="1507bd97798"},right={img="1507bd99336"}},
  4393. tranquill={left={img="1507bd940fc"},right={img="1507bd95bf5"}},
  4394. panpour={left={img="1507bd82b1b"},right={img="1507bd84743"}},
  4395. shellder={left={img="1507b4dbd03"},right={img="1507b4dcf88"}},
  4396. pikachu={left={img="1507b30fe8f"},right={img="1507b310fa8"},y=-54},
  4397. pansear={left={img="1507bd7bdb1"},right={img="1507bd7d93c"}},
  4398. swoobat={left={img="1507bdafcaa"},right={img="1507bdb18bd"}},
  4399. stoutland={left={img="1507bd6a4b1"},right={img="1507bd6c018"}},
  4400. clampearl={left={img="1507ba20f8a"},right={img="1507b7424c9"}},
  4401. lillipup={left={img="1507bd6367e"},right={img="1507bd651f3"}},
  4402. dewott={left={img="1507bd55cfa"},right={img="1507bd5787a"}},
  4403. emboar={left={img="1507bd4f424"},right={img="1507bd50f5d"}},
  4404. tepig={left={img="1507bd48738"},right={img="1507bd4a247"}},
  4405. sigilyph={left={img="1507bf2063f"},right={img="1507bf22415"}},
  4406. archeops={left={img="1507bf36f4f"},right={img="1507bf39507"}},
  4407. gardevoir={left={img="1507b8dcc9f"},right={img="1507b8de559"}},
  4408. shelmet={left={img="1507bfb4b90"},right={img="150c9a8c93e"}},
  4409. claydol={left={img="1507b9385d4"},right={img="1507b939e70"}},
  4410. politoed={left={img="1507b80954a"},right={img="1507b80acfb"}},
  4411. tympole={left={img="1507bec589e"},right={img="1507bec76a2"}},
  4412. kangaskhan={left={img="1507b58c2f9"},right={img="1507b518912"}},
  4413. makuhita={left={img="1507b90a2d2"},right={img="1507b90bb6e"}},
  4414. eevee={left={img="1507b5460c9"},right={img="1507b54756f"}},
  4415. regigigas={left={img="1507bd1f1cb"},right={img="1507bd20be7"}},
  4416. crustle={left={img="1507bf15363"},right={img="1507bf173ff"}},
  4417. skorupi={left={img="1507bcabda2"},right={img="1507bcad818"}},
  4418. scizor={left={img="1507b852bc7"},right={img="1507b854430"}},
  4419. dunsparce={left={img="1507b8429dc"},right={img="1507b8440e5"}},
  4420. raikou={left={y=-55,img="1507b9e3cb6"},right={y=-55,img="1507b9e55e4"}},
  4421. dustox={left={img="1507b8b50e9"},right={img="1507b8b6823"}},
  4422. caterpie={left={img="1507b2ed4c8"},right={img="1507b2ee5e4"}},
  4423. froslass={left={img="1507bd03c71"},right={img="1507bd05738"}},
  4424. dusknoir={left={img="1507bd00777"},right={img="1507bd02231"}},
  4425. dialga={left={y=-65,img="1507bd14e17"},right={y=-65,img="1507bd16970"}},
  4426. gliscor={left={img="1507bcf1d04"},right={img="1507bcf3859"}},
  4427. quilava={left={img="1507b5dee51"},right={img="1507b5e047b"}},
  4428. togekiss={left={img="1507bce4a73"},right={img="1507bce6230"}},
  4429. trapinch={left={img="1507b6f7ab9"},right={img="1507b6f9306"}},
  4430. volbeat={left={img="1507b6c9af6"},right={img="1507b6cb163"}},
  4431. rhyperior={left={img="1507bcd7277"},right={img="1507bcd8d46"}},
  4432. lombre={left={img="1507b8bb007"},right={img="1507b8bc267"}},
  4433. masquerain={left={img="1507b8e2fca"},right={img="1507b9fd813"}},
  4434. lickilicky={left={img="1507bcd3b5a"},right={img="1507bcd5581"}},
  4435. weavile={left={img="1507bccd69d"},right={img="1507bccf1fb"}},
  4436. slugma={left={img="1507b99607b"},right={img="1507b99732a"}},
  4437. abomasnow={left={img="1507bcca04a"},right={img="1507bccbafe"}},
  4438. mantyke={left={img="1507bcc3447"},right={img="1507bcc4eb1"}},
  4439. shinx={left={img="1507bc105ca"},right={img="1507bc12107"}},
  4440. stantler={left={img="1507b9c7cb7"},right={img="1507b9c95f0"}},
  4441. finneon={left={img="1507bcbc906"},right={img="1507bcbe383"}},
  4442. drapion={left={img="1507bcaf32c"},right={img="1507bcb0da4"}},
  4443. snivy={left={img="1507bd3e516"},right={img="1507bd4003a"}},
  4444. chingling={left={img="1507bc7001f"},right={img="1507bc71a98"}},
  4445. rufflet={left={img="1507be30444"},right={img="1507be31fdf"}},
  4446. chatot={left={img="1507bc8b074"},right={img="1507bc8ca0a"}},
  4447. skuntank={left={img="1507bc76ae2"},right={img="1507bc78540"}},
  4448. purugly={left={img="1507bc6cb47"},right={img="1507bc6e55d"}},
  4449. drifblim={left={img="1507bc59b8b"},right={img="1507bc5b6ec"}},
  4450. buizel={left={img="1507bc42ab2"},right={img="1507bc444aa"}},
  4451. sentret={left={img="1507b5eca06"},right={img="1507b5edfca"}},
  4452. tauros={left={img="1507b538642"},right={img="1507b539a2a"}},
  4453. vespiquen={left={img="1507bc3c1b9"},right={img="1507bc3db47"}},
  4454. rampardos={left={img="1507bc2558b"},right={img="1507bc26f49"}},
  4455. dragonair={left={img="1507b5910e8"},right={img="1507b569985"}},
  4456. wormadam={left={img="1507bc326c2"},right={img="1507bc3401a"}},
  4457. bastiodon={left={img="1507bc2bd9e"},right={img="1507bc2d775"}},
  4458. shieldon={left={img="1507bc289d1"},right={img="1507bc2a386"}},
  4459. mothim={left={img="1507bc35a2e"},right={img="1507bc373b4"}},
  4460. cranidos={left={img="1507bc22054"},right={img="1507bc23a4a"}},
  4461. victreebel={left={img="1507b4ae549"},right={img="1507b4af865"}},
  4462. luxio={left={img="1507bc13d22"},right={img="1507bc15880"}},
  4463. beldum={left={img="150c9a5261a"},right={img="1507ba22776"}},
  4464. magcargo={left={img="1507b998b7d"},right={img="1507b99a3e4"}},
  4465. kricketot={left={img="1507bc0a878"},right={img="1507bc0c357"}},
  4466. staryu={left={img="1507b523993"},right={img="1507b524cb5"}},
  4467. swinub={left={img="1507b99bc73"},right={img="1507b99d860"}},
  4468. bidoof={left={img="1507bc03bf4"},right={img="1507bc056d0"}},
  4469. piplup={left={y=-45,img="1507bbecd03"},right={y=-45,img="1507bbeea65"}},
  4470. drowzee={left={img="1507b4e9f4a"},right={img="1507b4eb2b1"}},
  4471. infernape={left={img="1507bbe8fe3"},right={img="1507bbeae51"}},
  4472. chimchar={left={img="1507bbe13ed"},right={img="1507bbe3522"}},
  4473. cleffa={left={img="1507b60db5d"},right={img="1507b60f1a0"}},
  4474. turtwig={left={img="1507bbd6165"},right={img="1507bbd7ef2"}},
  4475. corsola={left={img="1507b9a2439"},right={img="1507b9a3ce8"}},
  4476. jirachi={left={img="1507ba81f55"},right={img="1507ba83b68"}},
  4477. kyogre={left={img="1507ba38323"},right={img="1507ba39c3d"}},
  4478. lunatone={left={img="1507b7115f4"},right={img="1507b712e1e"}},
  4479. latios={left={img="1507ba34dec"},right={img="1507ba36a52"}},
  4480. ninetales={left={img="1507b32cc3b"},right={img="1507b32ddcd"}},
  4481. pinsir={left={img="1507b535e9a"},right={img="1507b537234"}},
  4482. pichu={left={img="1507b60afa4"},right={img="1507b60c57b"}},
  4483. regice={left={y=-60,img="1507ba2d2ad"},right={y=-60,img="1507ba2ec0d"}},
  4484. tentacool={left={img="1507b4b0b4b"},right={img="1507b4b243b"}},
  4485. metagross={left={img="1507ba27133"},right={img="1507ba28988"}},
  4486. arcanine={left={y=-60,img="1507b448e0e"},right={y=-60,img="1507b44a171"}},
  4487. metang={left={img="1507ba24004"},right={img="1507ba25893"}},
  4488. cacnea={left={img="1507b700deb"},right={img="1507b70274d"}},
  4489. remoraid={left={img="1507b9a567a"},right={img="1507b9a6e8e"}},
  4490. salamence={left={img="1507b7557db"},right={img="1507b756f95"}},
  4491. luvdisc={left={img="1507b74cae6"},right={img="1507b74e24c"}},
  4492. garchomp={left={img="1507bc98358"},right={img="1507bc99e02"}},
  4493. wynaut={left={img="1507ba0e1c8"},right={img="1507ba0f9e0"}},
  4494. absol={left={img="1507ba0b18b"},right={img="1507ba0c997"}},
  4495. leavanny={left={img="1507bede946"},right={img="1507bee087b"}},
  4496. cofagrigus={left={img="1507bf27df0"},right={img="1507bf29bdc"}},
  4497. duskull={left={img="1507b959d0e"},right={img="1507ba008a5"}},
  4498. escavalier={left={img="1507bf888c9"},right={img="1507bf8a244"}},
  4499. castform={left={img="1507b94dace"},right={img="1507b94f4ff"}},
  4500. weezing={left={img="1507b50c691"},right={img="1507b50d982"}},
  4501. gyarados={left={img="1507b53daab"},right={img="1507b53f4b8"}},
  4502. cubone={left={img="1507b4fd7b6"},right={img="1507b4febe5"}},
  4503. sunflora={left={img="1507b81aeed"},right={img="1507b81c72a"}},
  4504. hariyama={left={img="1507b90d41c"},right={img="1507b90edf8"}},
  4505. lapras={left={y=-57,img="1507b540b04"},right={y=-57,img="1507b54212b"}},
  4506. altaria={left={img="1507b7084d4"},right={img="1507b709bfd"}},
  4507. flygon={left={img="1507b6fdc34"},right={img="1507b6ff4d0"}},
  4508. sneasel={left={img="1507b98d28e"},right={img="1507b98eaa2"}},
  4509. furret={left={y=-60,img="1507b5ef5a5"},right={y=-60,img="1507b5f0b63"}},
  4510. vibrava={left={img="1507b6fab19"},right={img="1507b6fc45b"}},
  4511. linoone={left={img="1507b8a564c"},right={img="1507b8a6e7d"}},
  4512. wailord={left={y=-65,img="1507b6e1f9e"},right={y=-65,img="1507b6e35db"}},
  4513. wailmer={left={img="1507b6df1e7"},right={img="1507b6e08c3"}},
  4514. elekid={left={img="1507b9d73ba"},right={img="1507b9d8cf6"}},
  4515. roselia={left={img="1507b6cf990"},right={img="1507b6d1400"}},
  4516. combusken={left={img="1507b88daf3"},right={img="1507b88f203"}},
  4517. illumise={left={img="1507b6cca61"},right={img="1507b6ce134"}},
  4518. magmortar={left={img="1507bce149d"},right={img="1507bce2f42"}},
  4519. houndoom={left={img="1507b9b818f"},right={img="1507b9b99df"}},
  4520. minun={left={img="1507b6c60d0"},right={img="1507b6c78a7"}},
  4521. milktank={left={img="1507b9dd8bf"},right={img="1507b9df1b6"}},
  4522. pachirisu={left={img="1507bc3f5dd"},right={img="1507bc41075"}},
  4523. pelipper={left={img="1507b8d3730"},right={img="1507b8d4fe6"}},
  4524. lairon={left={img="1507b92741e"},right={img="1507b928c65"}},
  4525. vulpix={left={img="1507b32a6ad"},right={img="1507b32b9a3"}},
  4526. delcatty={left={img="1507b919a2f"},right={img="1507b91d134"}},
  4527. nosepass={left={img="1507b91371f"},right={img="1507b914fb3"}},
  4528. anorith={left={img="1507b941abc"},right={img="1507b94334c"}},
  4529. exploud={left={img="1507b905f27"},right={img="1507b9088ec"}},
  4530. kirlia={left={img="1507b8d9b75"},right={img="1507b8db4b6"}},
  4531. lotad={left={img="1507b8b7fed"},right={img="1507b8b97f3"}},
  4532. hitmontop={left={img="1507b9d13a7"},right={img="1507b9d2ced"}},
  4533. terrakion={left={img="1507be5a13c"},right={img="1507be5be90"}},
  4534. carracosta={left={img="1507bf2f6ec"},right={img="1507bf31505"}},
  4535. blaziken={left={img="1507b890909"},right={img="1507b892099"}},
  4536. sceptile={left={y=-58,img="1507b88921e"},right={y=-58,img="1507b88a971"}},
  4537. whimsicott={left={img="1507bef10ab"},right={img="1507bef2eab"}},
  4538. larvitar={left={img="1507b9ed43a"},right={img="1507b9eee59"}},
  4539. entei={left={y=-55,img="1507b9e6f18"},right={y=-55,img="1507b9e8894"}},
  4540. kabuto={left={img="1507b58d6e8"},right={img="1507b557e21"}},
  4541. rotom={left={img="1507bd07289"},right={img="1507bd08de4"}},
  4542. plusle={left={img="1507b6c3396"},right={img="1507b6c4a94"}},
  4543. tangela={left={img="1507b51568d"},right={img="1507b5169a5"}},
  4544. chansey={left={img="1507b512ffc"},right={img="1507b51431e"}},
  4545. slowpoke={left={img="1507b4c1c75"},right={img="1507b4c2f91"}},
  4546. zigzagoon={left={img="1507b8a0c25"},right={img="1507b8a3e39"}},
  4547. kingdra={left={img="1507b9bb220"},right={img="1507b9bcc3f"}},
  4548. delibird={left={img="1507b9ab9b3"},right={img="1507b9ad244"}},
  4549. deoxys={left={img="1507ba41b28"},right={img="1507ba433d2"}},
  4550. flareon={left={img="1507b54d8c8"},right={img="1507b54ecc7"}},
  4551. probopass={left={img="1507bcfd079"},right={img="1507bcfeb71"}},
  4552. umbreon={left={img="1507b82972c"},right={img="1507b82ae83"}},
  4553. cloyster={left={img="1507b4de221"},right={img="1507b4df561"}},
  4554. quagsire={left={img="1507b823ab4"},right={img="1507b8251ad"}},
  4555. yanma={left={img="1507b81de9f"},right={img="1507b81f502"}},
  4556. grotle={left={img="1507bbd9c8a"},right={img="1507bbdba57"}},
  4557. ariados={left={img="1507b5ffec6"},right={img="1507b601531"}},
  4558. weepinbell={left={img="1507b4ac056"},right={img="1507b4ad299"}},
  4559. chikorita={left={img="1507b5d3bd3"},right={img="1507b5d530f"}},
  4560. mew={left={img="1507b593a84"},right={img="1507b56f8e6"}},
  4561. primeape={left={img="1507b444331"},right={img="1507b44562f"}},
  4562. porygon={left={img="1507b5500be"},right={img="1507b5514dd"}},
  4563. crawdaunt={left={img="1507b721cfa"},right={img="1507b72341a"}},
  4564. aggron={left={img="1507b92a559"},right={img="1507b92bdf2"}},
  4565. mrmime={left={img="1507b528af4"},right={img="1507b52ac5c"}},
  4566. hitmonchan={left={img="1507b504f0b"},right={img="1507b50632a"}},
  4567. marowak={left={img="1507b4ffee4"},right={img="1507b501427"}},
  4568. milotic={left={y=-65,img="1507b94a8d9"},right={y=-65,img="1507b94c1bb"}},
  4569. simisear={left={img="1507bd7f4c8"},right={img="1507bd80fbb"}},
  4570. regirock={left={y=-60,img="1507ba2a1e1"},right={y=-60,img="1507ba2ba3d"}},
  4571. beedrill={left={img="1507b2f8b00"},right={img="1507b2f9bde"}},
  4572. roserade={left={img="1507bc1ebdf"},right={img="1507bc205f4"}},
  4573. poliwag={left={img="1507b44b520"},right={img="1507b44c770"}},
  4574. mankey={left={img="1507b441f7f"},right={img="1507b44320b"}},
  4575. venonat={left={img="1507b42f797"},right={img="1507b4308bd"}},
  4576. paras={left={img="1507b33f271"},right={img="1507b340514"}},
  4577. }
  4578. },
  4579. callbacks={
  4580. keyboard={
  4581. [KEYS.LEFT]=function(player,down,x,y)
  4582. if down then
  4583. if player.sprite and player.sprite.facingRight and _S.images.sprites[player.sprite.category][player.sprite.id].left then
  4584. _S.images.showImage(player)
  4585. end
  4586. end
  4587. end,
  4588. [KEYS.RIGHT]=function(player,down,x,y)
  4589. if down then
  4590. if player.sprite and not player.sprite.facingRight and _S.images.sprites[player.sprite.category][player.sprite.id].right then
  4591. _S.images.showImage(player)
  4592. end
  4593. end
  4594. end,
  4595. [KEYS.E]=function(player,down,x,y)
  4596. if down and player.sprite then
  4597. local fnc=_S.images.sprites[player.sprite.category][player.sprite.id].action
  4598. if fnc then fnc(player,x,y) end
  4599. end
  4600. end
  4601. },
  4602. chatCommand={
  4603. img={
  4604. rank=RANKS.ROOM_ADMIN,
  4605. fnc=function(player,sprite,...)
  4606. sprite=sprite and sprite:lower()
  4607. local arg={...}
  4608. executeCommand(player, function(targetName)
  4609. local target = targetName and players[targetName] or player
  4610. if sprite and sprite=="remove" then
  4611. _S.images.removeImage(target)
  4612. else
  4613. _S.images.selectImage(target,sprite)
  4614. end
  4615. end, arg)
  4616. end
  4617. },
  4618. prop={
  4619. rank=RANKS.ROOM_ADMIN,
  4620. fnc=function(player,prop,...)
  4621. if tonumber(prop) and _S.images.sprites.props[tonumber(prop)] then
  4622. local arg={...}
  4623. executeCommand(player, function(targetName)
  4624. local target = targetName and players[targetName] or player
  4625. _S.images.selectImage(target,tonumber(prop),"props")
  4626. end, arg)
  4627. end
  4628. end
  4629. },
  4630. poke={
  4631. rank=RANKS.ROOM_ADMIN,
  4632. fnc=function(player,pokemon,...)
  4633. if _S.images.sprites.pokemon[pokemon] then
  4634. local arg={...}
  4635. executeCommand(player, function(targetName)
  4636. local target = targetName and players[targetName] or player
  4637. _S.images.selectImage(target,pokemon,"pokemon")
  4638. end, arg)
  4639. end
  4640. end
  4641. }
  4642. },
  4643. newGame=function()
  4644. for name in pairs(tfm.get.room.playerList) do
  4645. local player=players[name]
  4646. if player.sprite then
  4647. if player.activeSegments.prophunt then
  4648. player.sprite=nil
  4649. else
  4650. _S.images.showImage(player)
  4651. end
  4652. end
  4653. end
  4654. end,
  4655. playerRespawn=function(player)
  4656. if player.sprite then
  4657. _S.images.showImage(player)
  4658. end
  4659. end,
  4660. playerGetCheese=function(player)
  4661. if player.sprite then
  4662. _S.images.showImage(player)
  4663. end
  4664. end
  4665. },
  4666. showImage=function(player)
  4667. if player.sprite then
  4668. for k,v in pairs({"img","cheese","forecheese"}) do
  4669. if player.sprite[v] then
  4670. tfm.exec.removeImage(player.sprite[v])
  4671. player.sprite[v]=nil
  4672. end
  4673. end
  4674. end
  4675. local direction=player.facingRight and "right" or "left"
  4676. local cheese,forecheese
  4677. if tfm.get.room.playerList[player.name].hasCheese then
  4678. local spriteIndex=_S.images.sprites[player.sprite.category][player.sprite.id]
  4679. if spriteIndex.cheese then cheese=_S.images.sprites[spriteIndex.cheese[1]][spriteIndex.cheese[2]][direction] or _S.images.sprites[spriteIndex.cheese[1]][spriteIndex.cheese[2]] end
  4680. if spriteIndex.forecheese then forecheese=_S.images.sprites[spriteIndex.forecheese[1]][spriteIndex.forecheese[2]][direction] or _S.images.sprites[spriteIndex.forecheese[1]][spriteIndex.forecheese[2]] end
  4681. end
  4682. local directory=_S.images.sprites[player.sprite.category][player.sprite.id][direction] or _S.images.sprites[player.sprite.category][player.sprite.id]
  4683. local dirroot=_S.images.sprites[player.sprite.category][player.sprite.id]
  4684. player.sprite.facingRight=direction=="right" and true
  4685. if cheese then
  4686. player.sprite.cheese=tfm.exec.addImage(cheese.img..".png","$"..player.name,cheese.x or -50,cheese.y or -50)
  4687. end
  4688. player.sprite.img=tfm.exec.addImage(directory.img..".png",(directory.l or "%")..player.name,directory.x or dirroot.x or -50,directory.y or dirroot.y or -50)
  4689. if forecheese then
  4690. player.sprite.forecheese=tfm.exec.addImage(forecheese.img..".png","$"..player.name,forecheese.x or -50,forecheese.y or -50)
  4691. end
  4692. end,
  4693. selectImage=function(player,id,category)
  4694. if category and id then
  4695. if _S.images.sprites[category][id] and (_S.images.sprites[category][id].img or _S.images.sprites[category][id].right) then
  4696. if player.sprite then
  4697. _S.images.removeImage(player)
  4698. end
  4699. player.sprite={
  4700. category=category,
  4701. id=id
  4702. }
  4703. _S.images.showImage(player)
  4704. end
  4705. elseif id then
  4706. for key,value in pairs(_S.images.sprites) do
  4707. if value[id] and (value[id].img or value[id].right) then
  4708. if player.sprite then
  4709. _S.images.removeImage(player)
  4710. end
  4711. player.sprite={
  4712. category=key,
  4713. id=id
  4714. }
  4715. _S.images.showImage(player)
  4716. break
  4717. end
  4718. end
  4719. else
  4720. local tbl={}
  4721. for key in pairs(_S.images.sprites.main) do
  4722. table.insert(tbl,key)
  4723. end
  4724. if player.sprite then
  4725. _S.images.removeImage(player)
  4726. end
  4727. player.sprite={
  4728. category="main",
  4729. id=tbl[math.random(#tbl)]
  4730. }
  4731. _S.images.showImage(player)
  4732. end
  4733. end,
  4734. removeImage=function(player)
  4735. if player.sprite then
  4736. for k,v in ipairs({"img","cheese","forecheese"}) do
  4737. if player.sprite[v] then
  4738. tfm.exec.removeImage(player.sprite[v])
  4739. end
  4740. end
  4741. player.sprite=nil
  4742. end
  4743. end,
  4744. }
  4745.  
  4746.  
  4747. --[[ src/segments/inspect.lua ]]--
  4748.  
  4749. _S.inspect = {
  4750. defaultPlayer=function(player)
  4751. player.activeSegments.inspect=true
  4752. end,
  4753. callbacks={
  4754. newGame=function()
  4755. ui.removeTextArea(-20)
  4756. end,
  4757. mouse={
  4758. pr=1,
  4759. fnc=function(player,x,y)
  4760. if player.shift and not player.activeSegments.draw then
  4761. local theta,c,s,cx,cy
  4762. for i=#map.grounds,1,-1 do
  4763. local ground=map.grounds[i]
  4764. theta=math.rad(ground.rotation or 0)
  4765. c,s=math.cos(-theta),math.sin(-theta)
  4766. cx=ground.x+c*(x-ground.x)-s*(y-ground.y)
  4767. cy=ground.y+s*(x-ground.x)+c*(y-ground.y)
  4768. if (ground.type==13 and pythag(x,y,ground.x,ground.y,ground.length/2)) or (math.abs(cx-ground.x)<ground.length/2 and math.abs(cy-ground.y)<ground.height/2) then
  4769. local str=""
  4770. local properties={"type","id","x","y","height","length","friction","restitution","rotation","dynamic","mass","color"}
  4771. for _,property in ipairs(properties) do
  4772. if ground[property] then
  4773. str=str.."<N>"..translate(property,player.lang)..": <VP>"..(
  4774. (property=="color" and "<font color='#"..ground[property].."'>#"..(ground[property]).."</font>") or
  4775. (property=="dynamic" and (ground["dynamic"]==0 and "False" or "True")) or
  4776. (property=="type" and translate("groundList",player.lang)[ground[property]]) or
  4777. (ground[property])
  4778. ).."\n"
  4779. end
  4780. end
  4781. local w,h=map.length or 800,map.height or 400
  4782. ui.addTextArea(-20,"<font size='12'>"..str.."</font>",player.name,(x+150<=w and x) or (x<0 and 0) or (w-150),(y+180<=h and y>20 and y) or (y<20 and 25) or (h-180),nil,nil,nil,nil,0.5,false)
  4783. return
  4784. end
  4785. end
  4786. end
  4787. ui.removeTextArea(-20,player.name)
  4788. end
  4789. },
  4790. }
  4791. }
  4792.  
  4793.  
  4794. --[[ src/segments/insta.lua ]]--
  4795.  
  4796. _S.insta = {
  4797. callbacks={
  4798. summoningStart=function(player,type,x,y,ang)
  4799. tfm.exec.addShamanObject(type,x,y,ang)
  4800. end
  4801. }
  4802. }
  4803.  
  4804.  
  4805.  
  4806. --[[ src/segments/lightning.lua ]]--
  4807.  
  4808. _S.lightning = {
  4809. ids={0,1,9},
  4810. move=3,
  4811. ms=3/20,
  4812. ma=(3/20)/1200,
  4813. players={},
  4814. defaultPlayer=function(player)
  4815. _S.lightning.players[player] = os.time()
  4816. end,
  4817. callbacks={
  4818. mouse={
  4819. pr=-21,
  4820. fnc=function(player,x,y)
  4821. if player.ctrl and not player.shift then
  4822. if _S.lightning.players[player] < os.time()-1000 then
  4823. _S.lightning.players[player] = os.time()
  4824. local p=tfm.get.room.playerList[player.name]
  4825. _S.lightning.drawLightining(p.x,p.y,x,y,_S.lightning.ids[math.random(#_S.lightning.ids)])
  4826. end
  4827. end
  4828. end
  4829. }
  4830. },
  4831. drawLine=function(x1,y1,x2,y2,spaces,id)
  4832. id = id or 9
  4833. spaces = spaces or 3
  4834. local distance = _S.lightning.getDistance(x1,y1,x2,y2)
  4835. local numOfParticles = math.floor(distance/spaces)
  4836. local angle = _S.lightning.getAngle(x1,y1,x2,y2)
  4837. for i=0,numOfParticles do
  4838. local dotX = x1+math.cos(angle)*(i*spaces)
  4839. local dotY = y1+math.sin(angle)*(i*spaces)
  4840. tfm.exec.displayParticle(id,dotX,dotY,math.random()*_S.lightning.ms-_S.lightning.ms/2,math.random()*_S.lightning.ms-_S.lightning.ms/2,math.random()*_S.lightning.ma-_S.lightning.ma/2,math.random()*_S.lightning.ma-_S.lightning.ma/2)
  4841. end
  4842. end,
  4843. getDistance=function(x1,y1,x2,y2)
  4844. return math.sqrt(math.abs(x1-x2)^2+math.abs(y1-y2)^2)
  4845. end,
  4846. getAngle=function(x1,y1,x2,y2)
  4847. return math.atan2(y2-y1,x2-x1)
  4848. end,
  4849. radToDeg=function(i)
  4850. i = i*180/math.pi
  4851. i = i<0 and i+360 or i
  4852. return i
  4853. end,
  4854. degToRad=function(i)
  4855. return i*math.pi/180
  4856. end,
  4857. drawLightining=function(x1,y1,x2,y2,id)
  4858. local ang = _S.lightning.getAngle(x1,y1,x2,y2)
  4859. local dis = _S.lightning.getDistance(x1,y1,x2,y2)
  4860. local rd = function() return math.random()*25+25 end
  4861. local ra = function() return math.pi/(math.random()*120+30) end
  4862. local wave = {}
  4863. local addWave = function(k,xx,yy) wave[k] = {x=xx,y=yy} end
  4864. addWave(0,x1,y1)
  4865. local td = 0
  4866. local randomDistance = rd()
  4867. local randomAngle = ra()*((dis-td)/100)
  4868. local zigZag = math.random()<0.5 and 1 or -1
  4869. local ca = ang + randomAngle*zigZag
  4870. while randomDistance<dis-td do
  4871. td = td + randomDistance
  4872. local tx = x1+math.cos(ca)*td
  4873. local ty = y1+math.sin(ca)*td
  4874. addWave(#wave+1,tx,ty)
  4875. randomDistance = rd()
  4876. randomAngle = ra()*((dis-td)/100)
  4877. zigZag = zigZag * -1
  4878. ca = ang + randomAngle*zigZag
  4879. end
  4880. addWave(#wave+1,x2,y2)
  4881. for i=0,#wave-1 do
  4882. local cw = wave[i]
  4883. local nw = wave[i+1]
  4884. _S.lightning.drawLine(cw.x,cw.y,nw.x,nw.y,3,id)
  4885. end
  4886. end
  4887. }
  4888.  
  4889.  
  4890. --[[ src/segments/map-image.lua ]]--
  4891.  
  4892. _S.mapImage = {
  4893. disabled=true,
  4894. images={},
  4895. layers={fg = "!", bg="?", gr="_"},
  4896. callbacks={
  4897. newGame=function()
  4898. local layers = getValueFromXML(tfm.get.room.xmlMapInfo.xml, "IL") or false
  4899. if layers then
  4900. -- imgUrl,imgLayer,imgX,imgY;img...
  4901. layers = string.split(layers, ";")
  4902. _S.mapImage.images = {}
  4903. for index, layerData in pairs(layers) do
  4904. table.insert(_S.mapImage.images, layerData)
  4905. layerData = string.split(layerData, ",")
  4906. local layerType = (_S.mapImage.layers[layerData[2]:sub(0,2)] or "")..(layerData[2]:sub(3) or "1")
  4907. tfm.exec.addImage(layerData[1] or "", layerType, layerData[3] or 0, layerData[4] or 0, nil)
  4908. end
  4909. end
  4910. end,
  4911. newPlayer=function(player)
  4912. for index, layerData in pairs(_S.mapImage.images) do
  4913. layerData = string.split(layerData, ",")
  4914. local layerType = (_S.mapImage.layers[layerData[2]:sub(0,2)] or "")..(layerData[2]:sub(3) or "")
  4915. tfm.exec.addImage(layerData[1] or "", layerType, layerData[3] or 0, layerData[4] or 0, player.name)
  4916. end
  4917. end,
  4918. },
  4919. }
  4920.  
  4921.  
  4922.  
  4923. --[[ src/segments/meep.lua ]]--
  4924.  
  4925. _S.meep = {
  4926. callbacks={
  4927. newGame=function()
  4928. for name,player in pairs(players) do
  4929. if player.activeSegments.meep then
  4930. tfm.exec.giveMeep(name)
  4931. end
  4932. end
  4933. end,
  4934. keyboard={
  4935. [KEYS.SPACE]=function(player,down,x,y)
  4936. if player.meepTimer<os.time()-10100 and player.meepPower then -- time for the meep bar to restore
  4937. player.meepTimer=os.time()
  4938. for k,v in pairs(tfm.get.room.playerList) do
  4939. if player.name~=k then
  4940. local xdiff=tfm.get.room.playerList[k].x-x
  4941. local ydiff=tfm.get.room.playerList[k].y-(y+10)
  4942. local length=math.sqrt(xdiff^2+ydiff^2)
  4943. if length <= 90 then -- distance obviously
  4944. tfm.exec.movePlayer(k, 0, 0, false, (xdiff/(math.abs(xdiff)+math.abs(ydiff)))*player.meepPower, (ydiff/(math.abs(xdiff)+math.abs(ydiff)))*player.meepPower, false)
  4945. end -- the two 250 values determine the power (they must be the same)
  4946. end
  4947. end
  4948. end
  4949. end
  4950. }
  4951. }
  4952. }
  4953.  
  4954.  
  4955.  
  4956. --[[ src/segments/movecheese.lua ]]--
  4957.  
  4958. _S.movecheese = {
  4959. disabled=true,
  4960. cheesePositions={X={},Y={}},
  4961. currentIndex=1,
  4962. currentPos={-500, -500},
  4963. loop=false,
  4964. order=0,
  4965. delay=1000,
  4966. lastMove=os.time(),
  4967. image=-1,
  4968. --[[ TAGS:
  4969. segments="movecheese" - enable the cheese movement
  4970. CheeseX="x1,x2,x3" - horizontal coordinates for the cheese,
  4971. CheeseY="y1,y2,y3" - vertical coordinates for the cheese
  4972. FirstCoord="x,y" - sets the first coordinate for the cheese
  4973. in both you can use:
  4974. fixed - to make the cheese stay in the last location
  4975. random - to make the coordinate be random
  4976. Loop="0 or 1" - enables the move loop(0 false, 1 true)
  4977. Delay="seconds" - the change delay, in seconds
  4978. Order="type" - sets how the cheese should move:
  4979. 0 - following the xml order
  4980. 1 - when a player gets the cheese
  4981. 2 - random coordinate movement, given by the xml
  4982. 3 - when a player gets close to the cheese
  4983. ]]--
  4984. callbacks={
  4985. newGame=function()
  4986. local canLoop=getValueFromXML(tfm.get.room.xmlMapInfo.xml, "Loop") or 1
  4987. local moveDelay=getValueFromXML(tfm.get.room.xmlMapInfo.xml, "Delay") or 1000
  4988. local moveOrder=getValueFromXML(tfm.get.room.xmlMapInfo.xml, "Order") or 0
  4989. local vX = getValueFromXML(tfm.get.room.xmlMapInfo.xml, "CheeseX") or "400"
  4990. local vY= getValueFromXML(tfm.get.room.xmlMapInfo.xml, "CheeseY") or "200"
  4991. local firstCoord = string.split(getValueFromXML(tfm.get.room.xmlMapInfo.xml, "FirstCoord") or "", ",")
  4992. _S.movecheese.cheesePositions.X=string.split(vX, ",")
  4993. _S.movecheese.cheesePositions.Y=string.split(vY, ",")
  4994. _S.movecheese.loop=canLoop == 1
  4995. _S.movecheese.order=tonumber(moveOrder) or 0
  4996. _S.movecheese.delay=tonumber(moveDelay) or 1000
  4997. _S.movecheese.lastMove = os.time()
  4998. _S.movecheese.callbacks.moveCheese(table.unpack(firstCoord))
  4999. end,
  5000. eventLoop=function(time,remain)
  5001. time = math.ceil(time/1000)
  5002. local X = 0
  5003. local Y = 0
  5004. if time > 1 then
  5005. if _S.movecheese.currentIndex <= #_S.movecheese.cheesePositions.X or _S.movecheese.currentIndex <= #_S.movecheese.cheesePositions.Y then
  5006. if _S.movecheese.lastMove < os.time()-_S.movecheese.delay then
  5007. if _S.movecheese.order == 0 then
  5008. _S.movecheese.callbacks.moveCheese()
  5009. elseif _S.movecheese.order == 2 then
  5010. _S.movecheese.currentIndex = math.random(math.max(#_S.movecheese.cheesePositions.X, #_S.movecheese.cheesePositions.Y))
  5011. _S.movecheese.callbacks.moveCheese()
  5012. end
  5013. end
  5014. else
  5015. if _S.movecheese.loop then
  5016. _S.movecheese.currentIndex = 1
  5017. end
  5018. end
  5019. for player, data in pairs(tfm.get.room.playerList) do
  5020. if not data.hasCheese then
  5021. if pythag(_S.movecheese.currentPos[1], _S.movecheese.currentPos[2], data.x, data.y, 25) then
  5022. tfm.exec.giveCheese(player)
  5023. if _S.movecheese.order == 1 then
  5024. _S.movecheese.callbacks.moveCheese()
  5025. end
  5026. end
  5027. if _S.movecheese.order == 3 then
  5028. if pythag(_S.movecheese.currentPos[1], _S.movecheese.currentPos[2], data.x, data.y, 50) then
  5029. _S.movecheese.callbacks.moveCheese()
  5030. end
  5031. end
  5032. end
  5033. end
  5034. end
  5035. end,
  5036. moveCheese=function(givenX, givenY)
  5037. _S.movecheese.lastMove = os.time()
  5038. local i = _S.movecheese.currentIndex
  5039. local X = givenX or _S.movecheese.cheesePositions.X[i] or _S.movecheese.cheesePositions.X[i-1]
  5040. local Y = givenY or _S.movecheese.cheesePositions.Y[i] or _S.movecheese.cheesePositions.Y[i-1]
  5041. if X == "fixed" then
  5042. X = _S.movecheese.currentPos[1] or 0
  5043. end
  5044. if Y == "fixed" then
  5045. Y = _S.movecheese.currentPos[2] or 0
  5046. end
  5047. if X == "random" then
  5048. X = math.random(50, map.length-50)
  5049. end
  5050. if Y == "random" then
  5051. Y = math.random(50, map.height-50)
  5052. end
  5053. tfm.exec.removeImage(_S.movecheese.image)
  5054. X = tonumber(X) or 0
  5055. Y = tonumber(Y) or 0
  5056. _S.movecheese.image = tfm.exec.addImage("1507b11c813.png", "!100", (X)-23, (Y)-19, nil)
  5057. _S.movecheese.currentPos = {X, Y}
  5058. if not givenX then
  5059. _S.movecheese.currentIndex = _S.movecheese.currentIndex+1
  5060. end
  5061. end,
  5062. },
  5063. }
  5064.  
  5065.  
  5066. --[[ src/segments/nogravmove.lua ]]--
  5067.  
  5068. _S.nogravmove = {
  5069. disabled=true,
  5070. callbacks={
  5071. newGame=function()
  5072. local attachImage = getValueFromXML(tfm.get.room.xmlMapInfo.xml, "spriteImage") or "broom"
  5073. for name,player in pairs(players) do
  5074. _S.images.selectImage(player,attachImage)
  5075. end
  5076. end,
  5077. roundEnd=function()
  5078. for name,player in pairs(players) do
  5079. player.sprite=nil
  5080. end
  5081. end,
  5082. keyboard={
  5083. [KEYS.UP]=function(player,down,x,y)
  5084. if down then
  5085. tfm.exec.movePlayer(player.name,0,0,false,0,-50,false)
  5086. else
  5087. tfm.exec.movePlayer(player.name,0,0,false,-1,-1,false)
  5088. tfm.exec.movePlayer(player.name,0,0,false,1,1,true)
  5089. end
  5090. end,
  5091. [KEYS.DOWN]=function(player,down,x,y)
  5092. if down then
  5093. tfm.exec.movePlayer(player.name,0,0,false,0,50,false)
  5094. else
  5095. tfm.exec.movePlayer(player.name,0,0,false,-1,-1,false)
  5096. tfm.exec.movePlayer(player.name,0,0,false,1,1,true)
  5097. end
  5098. end,
  5099. [KEYS.LEFT]=function(player,down,x,y)
  5100. if down then
  5101. tfm.exec.movePlayer(player.name,0,0,false,-50,0,false)
  5102. else
  5103. tfm.exec.movePlayer(player.name,0,0,false,-1,-1,false)
  5104. tfm.exec.movePlayer(player.name,0,0,false,1,1,true)
  5105. end
  5106. end,
  5107. [KEYS.RIGHT]=function(player,down,x,y)
  5108. if down then
  5109. tfm.exec.movePlayer(player.name,0,0,false,50,0,false)
  5110. else
  5111. tfm.exec.movePlayer(player.name,0,0,false,-1,-1,false)
  5112. tfm.exec.movePlayer(player.name,0,0,false,1,1,true)
  5113. end
  5114. end,
  5115. }
  5116. }
  5117. }
  5118.  
  5119.  
  5120. --[[ src/segments/omo.lua ]]--
  5121.  
  5122. _S.omo = {
  5123. defaultPlayer=function(player)
  5124. player.activeSegments.omo=true
  5125. end,
  5126. welcomed={},
  5127. startID=100,
  5128. emotes={"omo","@_@","@@","è_é","e_e","#_#",";A;","owo","(Y)(omo)(Y)","©_©","OmO","0m0","°m°","(´°?°`)","~(-_-)~","{^-^}"},
  5129. display=function(name,str,x,y,size,border,fixed)
  5130. local i=_S.omo.startID
  5131. size=size or 32
  5132. for xoff=-1,1 do
  5133. for yoff=-1,1 do
  5134. i=i+1
  5135. if not (xoff==0 and yoff==0) then
  5136. ui.addTextArea(i,"<p align='center'><b><font size='"..size.."' color='#000000' face='Soopafresh,Segoe,Verdana'>"..str.."</font></b></p>",name,x+(xoff*(border or 1))-250,y+(yoff*(border or 1))-50,500,nil,nil,nil,0,fixed)
  5137. end
  5138. end
  5139. end
  5140. ui.addTextArea(i+1,"<p align='center'><b><font size='"..size.."' face='Soopafresh,Segoe,Verdana'>"..str.."</font></b></p>",name,x-250,y-50,500,nil,nil,nil,0,fixed)
  5141. if not name then _S.omo.welcomed={} end
  5142. end,
  5143. callbacks={
  5144. newGame=function()
  5145. for name,player in pairs(players) do
  5146. if _S.omo and (not _S.omo.welcomed[name] or _S.omo.welcomed[name]<os.time()-3000) then
  5147. _S.omo.welcomed[name]=nil
  5148. local id=_S.omo.startID
  5149. for i=1,10 do
  5150. ui.removeTextArea(id+i,name)
  5151. end
  5152. end
  5153. end
  5154. end,
  5155. newPlayer=function(player)
  5156. _S.omo.welcomed[player.name]=os.time()
  5157. _S.omo.display(player.name,moduleName,400,200,100,3,true)
  5158. end,
  5159. mouse={
  5160. pr=1,
  5161. fnc=function(player,x,y)
  5162. if player.omo then
  5163. local str=player.omo.str or _S.omo.emotes[math.random(#_S.omo.emotes)]
  5164. _S.omo.display(nil,str,x,y,player.omo.size or 64,3)
  5165. if player.omo.str then player.omo=nil end
  5166. return true
  5167. end
  5168. end
  5169. },
  5170. eventLoop=function(time,remaining)
  5171. for name,time in pairs(_S.omo.welcomed) do
  5172. if time<os.time()-10000 then
  5173. _S.omo.welcomed[name]=nil
  5174. for i=1,10 do
  5175. ui.removeTextArea(_S.omo.startID+i,name)
  5176. end
  5177. break
  5178. end
  5179. end
  5180. end,
  5181. chatCommand={
  5182. omo={
  5183. rank=RANKS.ROOM_ADMIN,
  5184. hide=true,
  5185. fnc=function(player,...)
  5186. local arg={...}
  5187. local size
  5188. for k,v in ipairs(arg) do
  5189. if v:match("%[size=(%d+)]") then
  5190. size=v:match("%[size=(%d+)]")
  5191. table.remove(arg,k)
  5192. elseif v=="[br]" then
  5193. arg[k]="\n"
  5194. end
  5195. end
  5196. activateSegment(player.name,"omo")
  5197. player.omo={str=#arg>0 and table.concat(arg," "),size=size}
  5198. end
  5199. },
  5200. clear={
  5201. rank=RANKS.ROOM_ADMIN,
  5202. fnc=function(player)
  5203. local id=_S.omo.startID
  5204. for i=1,10 do
  5205. ui.removeTextArea(id+i)
  5206. end
  5207. end
  5208. }
  5209. }
  5210. }
  5211. }
  5212.  
  5213.  
  5214. --[[ src/segments/pet.lua ]]--
  5215.  
  5216. _S.pet = {
  5217. pets={},
  5218. defaultPlayer=function(player)
  5219. player.activeSegments.pet=true
  5220. end,
  5221. callbacks={
  5222. newGame=function()
  5223. for name,pet in pairs(_S.pet.pets) do
  5224. pet.id=tfm.exec.addShamanObject(6300,map.spawns[1] and map.spawns[1].x or 400,map.spawns[1] and map.spawns[1].y or 200,0,0,false)
  5225. pet.farAway=0
  5226. _S.pet.showImage(pet,"right")
  5227. end
  5228. end,
  5229. eventLoop=function(time,remaining)
  5230. for name,pet in pairs(_S.pet.pets) do
  5231. if tfm.get.room.objectList[pet.id] and pet.stay > 0 and tfm.get.room.playerList[name] then
  5232. local x = 0
  5233. local y = 0
  5234. if pet.stay == 1 then
  5235. x=-(tfm.get.room.objectList[pet.id].x-tfm.get.room.playerList[name].x)
  5236. y=-(tfm.get.room.objectList[pet.id].y-tfm.get.room.playerList[name].y)
  5237.  
  5238. elseif pet.stay == 2 then
  5239. if math.random(10) < 5 then
  5240. if math.random(10) < 2 then
  5241. x=-(tfm.get.room.objectList[pet.id].x-math.random(800))
  5242. else
  5243. x=(tfm.get.room.objectList[pet.id].x-math.random(800))
  5244. end
  5245. y=(tfm.get.room.objectList[pet.id].y-math.random(400))
  5246. else
  5247. if math.random(5) < 2 then
  5248. if _S.images.sprites[pet.sprite.category][pet.sprite.id].petaction then
  5249. _S.images.sprites[pet.sprite.category][pet.sprite.id].petaction(pet)
  5250. end
  5251. else
  5252. if math.random(0, 1) == 1 then
  5253. x=-(tfm.get.room.objectList[pet.id].x-math.random(-50, 50))
  5254. else
  5255. x=(tfm.get.room.objectList[pet.id].x-math.random(-50, 50))
  5256. end
  5257. end
  5258. end
  5259. elseif pet.stay == 3 then
  5260. if tfm.get.room.objectList[pet.treat] then
  5261. x=-(tfm.get.room.objectList[pet.id].x-tfm.get.room.objectList[pet.treat].x)
  5262. y=-(tfm.get.room.objectList[pet.id].y-tfm.get.room.objectList[pet.treat].y)
  5263. if pythag(tfm.get.room.objectList[pet.id].x, tfm.get.room.objectList[pet.id].y, tfm.get.room.objectList[pet.treat].x, tfm.get.room.objectList[pet.treat].y, 60) then
  5264. pet.ttick = pet.ttick+1
  5265. tfm.exec.displayParticle(30, tfm.get.room.objectList[pet.treat].x, tfm.get.room.objectList[pet.treat].y, 0, -1, 0, 0)
  5266. if pet.ttick == 20 then
  5267. for i = 0, 10 do
  5268. tfm.exec.displayParticle(5, tfm.get.room.objectList[pet.treat].x, tfm.get.room.objectList[pet.treat].y, math.cos(i), math.sin(i), 0, 0)
  5269. end
  5270. tfm.exec.removeObject(pet.treat)
  5271. pet.treat=false
  5272. pet.stay=2
  5273. end
  5274. end
  5275. else
  5276. pet.treat=false
  5277. pet.stay=2
  5278. end
  5279. elseif pet.stay == 4 then
  5280. if tfm.get.room.objectList[pet.ball] then
  5281. x=-(tfm.get.room.objectList[pet.id].x-tfm.get.room.objectList[pet.ball].x)
  5282. y=-(tfm.get.room.objectList[pet.id].y-tfm.get.room.objectList[pet.ball].y)
  5283. if pythag(tfm.get.room.objectList[pet.id].x, tfm.get.room.objectList[pet.id].y, tfm.get.room.objectList[pet.ball].x, tfm.get.room.objectList[pet.ball].y, 20) then
  5284. bx=(tfm.get.room.objectList[pet.ball].x-tfm.get.room.objectList[pet.id].x)
  5285. by=(tfm.get.room.objectList[pet.ball].y-tfm.get.room.objectList[pet.id].y)
  5286. tfm.exec.moveObject(pet.ball, 0, 0, false, bx, by, true)
  5287. end
  5288. else
  5289. pet.treat=false
  5290. pet.stay=2
  5291. end
  5292. end
  5293. if (math.abs(x)>300 or math.abs(y)>300) then
  5294. pet.farAway=pet.farAway+1
  5295. if pet.farAway==16 then
  5296. if pet.stay ~= 2 then
  5297. tfm.exec.moveObject(pet.id,tfm.get.room.playerList[name].x,tfm.get.room.playerList[name].y,false,0,0)
  5298. for i = 0, 5 do
  5299. tfm.exec.displayParticle(9, tfm.get.room.playerList[name].x, tfm.get.room.playerList[name].y, math.cos(i), math.sin(i), 0, 0)
  5300. end
  5301. end
  5302. pet.farAway=0
  5303. end
  5304. end
  5305. local maxpower=30
  5306. local highest=0
  5307. if math.abs(x)>math.abs(y) then highest=math.abs(x) else highest=math.abs(y) end
  5308. local multiplier=highest/maxpower
  5309. if x==0 then x=1 end if y==0 then y=1 end
  5310. --if (tfm.get.room.objectList[pet.id].x or 0 >(map.length or 800)-100 and x>0) or (tfm.get.room.objectList[pet.id].x or 0 <100 and x<0) then x=x*-1 end
  5311.  
  5312. if pet.stay==1 then
  5313. tfm.exec.moveObject(pet.id,0,0,false,math.abs(x)<120 and 1 or (x/multiplier),(y/multiplier)+(math.abs(x)>120 and -40 or 1),false)
  5314. elseif pet.stay==2 then
  5315. tfm.exec.moveObject(pet.id,0,0,false,math.abs(x)<70 and 1 or (x/multiplier),(y/multiplier)+(math.abs(x)>120 and -40 or 1),false)
  5316. elseif pet.stay==3 then
  5317. tfm.exec.moveObject(pet.id,0,0,false,math.abs(x)<70 and 1 or (x/multiplier),(y/multiplier)+(math.abs(x)>120 and -40 or 1),false)
  5318. elseif pet.stay==4 then
  5319. tfm.exec.moveObject(pet.id,0,0,false,math.abs(x)<90 and 1 or (x/multiplier),(y/multiplier)+(math.abs(x)>120 and -40 or 1),false)
  5320. end
  5321. local direction=x<0 and "left" or "right"
  5322. if pet.direction~=direction then
  5323. pet.direction=direction
  5324. _S.pet.showImage(pet,direction)
  5325. end
  5326.  
  5327. end
  5328. end
  5329. end,
  5330. playerLeft=function(player)
  5331. if _S.pet.pets[player.name] then
  5332. tfm.exec.removeObject(_S.pet.pets[player.name].id)
  5333. _S.pet.pets[player.name]=nil
  5334. end
  5335. end,
  5336. chatCommand={
  5337. pet={
  5338. rank=RANKS.ROOM_ADMIN,
  5339. fnc=function(player,...)
  5340. local arg={...}
  5341. if arg[1]=="here" and _S.pet.pets[player.name] then
  5342. tfm.exec.moveObject(_S.pet.pets[player.name].id,tfm.get.room.playerList[player.name].x,tfm.get.room.playerList[player.name].y)
  5343. elseif arg[1]=="spawn" and not _S.pet.pets[player.name] then
  5344. local category="main"
  5345. local id="pusheen"
  5346. if arg[2] then
  5347. for cat,tbl in pairs(_S.images.sprites) do
  5348. if tbl[arg[2]:lower()] then
  5349. category=cat
  5350. id=arg[2]:lower()
  5351. break
  5352. end
  5353. end
  5354. end
  5355. _S.pet.pets[player.name]={
  5356. name=player.name,
  5357. id=tfm.exec.addShamanObject(6300,tfm.get.room.playerList[player.name].x,tfm.get.room.playerList[player.name].y,0,0,0,false),
  5358. direction="right",
  5359. sprite={
  5360. category=category,
  5361. id=id
  5362. },
  5363. farAway=0,
  5364. stay = 1,
  5365. treat = false,
  5366. ttick = 0,
  5367. ball = false
  5368. }
  5369. _S.pet.showImage(_S.pet.pets[player.name],"right")
  5370. for i = 0, 10 do
  5371. tfm.exec.displayParticle(9, tfm.get.room.playerList[player.name].x, tfm.get.room.playerList[player.name].y, math.cos(i), math.sin(i), 0, 0)
  5372. end
  5373. elseif arg[1]=="despawn" and _S.pet.pets[player.name] then
  5374. tfm.exec.removeObject(_S.pet.pets[player.name].id)
  5375. if _S.pet.pets[player.name].ball then
  5376. tfm.exec.removeObject(_S.pet.pets[player.name].ball)
  5377. end
  5378. if _S.pet.pets[player.name].treat then
  5379. tfm.exec.removeObject(_S.pet.pets[player.name].treat)
  5380. end
  5381. _S.pet.pets[player.name]=nil
  5382. end
  5383. if _S.pet.pets[player.name] then
  5384. if not _S.pet.pets[player.name].treat then
  5385. if arg[1]=="stay" and _S.pet.pets[player.name] then
  5386. _S.pet.pets[player.name].stay=0
  5387. elseif arg[1]=="follow" and _S.pet.pets[player.name] then
  5388. _S.pet.pets[player.name].stay=1
  5389. elseif arg[1]=="free" and _S.pet.pets[player.name] then
  5390. _S.pet.pets[player.name].stay=2
  5391. elseif arg[1]=="ball" and _S.pet.pets[player.name] then
  5392. if arg[2]=="here" then
  5393. pos = tfm.get.room.playerList[player.name]
  5394. tfm.exec.moveObject(_S.pet.pets[player.name].ball, pos.x, pos.y-40, false, 0, 0, false)
  5395. elseif arg[2]=="set" then
  5396. _S.pet.pets[player.name].ball=tonumber(arg[3]) or _S.pet.pets[player.name].ball
  5397. _S.pet.pets[player.name].stay=4
  5398. elseif arg[2]=="id" then
  5399. tfm.exec.chatMessage(_S.pet.pets[player.name].ball, player.name)
  5400. else
  5401. if _S.pet.pets[player.name].ball then
  5402. tfm.exec.removeObject(_S.pet.pets[player.name].ball)
  5403. _S.pet.pets[player.name].ball=false
  5404. end
  5405. pos = tfm.get.room.playerList[player.name]
  5406. _S.pet.pets[player.name].ball = tfm.exec.addShamanObject(6, pos.x, pos.y-40, 0, 0, 0)
  5407. tfm.exec.addImage("1515419b6f5.png", "#".._S.pet.pets[player.name].ball, -15, -15, nil)
  5408. _S.pet.pets[player.name].stay=4
  5409. tfm.exec.addPhysicObject(1, 0, map.height/2, {height = map.height*2, miceCollision = false, type = 12})
  5410. tfm.exec.addPhysicObject(2, map.length, map.height/2, {height = map.height*2, miceCollision = false, type = 12})
  5411. end
  5412. end
  5413. else
  5414. tfm.exec.chatMessage(translate("peteating",player.lang), player.name)
  5415. end
  5416. end
  5417. if arg[1]=="treat" and _S.pet.pets[player.name] then
  5418. if _S.pet.pets[player.name].treat then
  5419. tfm.exec.removeObject(_S.pet.pets[player.name].treat)
  5420. _S.pet.pets[player.name].treat=false
  5421. else
  5422. pos = tfm.get.room.playerList[player.name]
  5423. _S.pet.pets[player.name].treat = tfm.exec.addShamanObject(1, pos.x, pos.y, 0, 0, 0)
  5424. tfm.exec.addImage("1514f246497.png", "#".._S.pet.pets[player.name].treat, -15, -15, nil)
  5425. _S.pet.pets[player.name].stay=3
  5426. _S.pet.pets[player.name].ttick=0
  5427. end
  5428. end
  5429. end
  5430. }
  5431. }
  5432. },
  5433. showImage=function(pet,direction)
  5434. if pet.sprite.img then tfm.exec.removeImage(pet.sprite.img) end
  5435. local directory=_S.images.sprites[pet.sprite.category][pet.sprite.id][direction] or _S.images.sprites[pet.sprite.category][pet.sprite.id]
  5436. local dirroot=_S.images.sprites[pet.sprite.category][pet.sprite.id]
  5437. pet.sprite.img=tfm.exec.addImage(directory.img..".png","#"..pet.id,directory.x or dirroot.x or -50,4+(directory.y or dirroot.y or -50))
  5438. end,
  5439. }
  5440.  
  5441.  
  5442. --[[ src/segments/projection.lua ]]--
  5443.  
  5444. -- Simulates the shaman skill "projection"
  5445.  
  5446. _S.projection = {
  5447. callbacks={
  5448. keyboard={
  5449. [KEYS.LEFT]=function(player,down,x,y)
  5450. if down then
  5451. if player.dash and player.dash.direction=="left" and player.dash.time>os.time()-250 and (player.lastDash and player.lastDash<os.time()-3000 or not player.lastDash) then
  5452. tfm.exec.movePlayer(player.name, x-100, y)
  5453. player.lastDash=os.time()
  5454. for i=1,6 do
  5455. tfm.exec.displayParticle(3,x,y,math.random(-1,1),math.random(-1,1),0,0)
  5456. tfm.exec.displayParticle(35,x-50,y,0,0,0,0)
  5457. end
  5458. end
  5459. player.dash={time=os.time(),direction="left"}
  5460. end
  5461. end,
  5462. [KEYS.RIGHT]=function(player,down,x,y)
  5463. if down then
  5464. if player.dash and player.dash.direction=="right" and player.dash.time>os.time()-250 and (player.lastDash and player.lastDash<os.time()-3000 or not player.lastDash) then
  5465. tfm.exec.movePlayer(player.name, x+100, y)
  5466. player.lastDash=os.time()
  5467. for i=1,6 do
  5468. tfm.exec.displayParticle(3,x,y,math.random(-1,1),math.random(-1,1),0,0)
  5469. tfm.exec.displayParticle(35,x+50,y,0,0,0,0)
  5470. end
  5471. end
  5472. player.dash={time=os.time(),direction="right"}
  5473. end
  5474. end,
  5475. }
  5476. }
  5477. }
  5478.  
  5479.  
  5480. --[[ src/segments/prophunt.lua ]]--
  5481.  
  5482. _S.prophunt = {
  5483. hunters={},
  5484. props={
  5485. --name={x=,y=,img=}
  5486. },
  5487. defaultPlayer=function(player)
  5488. --player.activeSegments.prophunt=true
  5489. player.prophunt={
  5490. ids={}
  5491. }
  5492. end,
  5493. callbacks={
  5494. newGame=function()
  5495. --[[
  5496. _S.prophunt.props={}
  5497. for n,p in pairs(_S.prophunt.hunters) do
  5498. tfm.exec.setPlayerScore(n,0)
  5499. end
  5500. local hunter=highscore()
  5501. _S.prophunt.hunters={}
  5502. _S.prophunt.hunters[hunter]={lives=3}
  5503. _S.blind.textarea(hunter)
  5504. --hearts(hunter)
  5505. ]]
  5506. end,
  5507. keyboard={
  5508. [KEYS.E]=function(player,down,x,y)
  5509. if down and not tfm.get.room.playerList[player.name].isDead then
  5510. local closest
  5511. for _,deco in pairs(map.decorations) do
  5512. if pythag(x,y,deco.x,deco.y,20) and _S.images.sprites.props[deco.id] then
  5513. local d=distance(deco.x,deco.y,x,y)
  5514. if not closest or d<closest.distance then
  5515. closest={id=deco.id,distance=d}
  5516. end
  5517. end
  5518. end
  5519. if closest then
  5520. _S.images.selectImage(player,closest.id,"props")
  5521. end
  5522. end
  5523. end,
  5524. [KEYS.SPACE]=function(player,down,x,y)
  5525. if down and not tfm.get.room.playerList[player.name].isDead and player.sprite then
  5526. if _S.hide.hidden[player.name] then
  5527. tfm.exec.movePlayer(player.name,_S.prophunt.props[player.name].x,_S.prophunt.props[player.name].y)
  5528. tfm.exec.removeImage(_S.prophunt.props[player.name].img)
  5529. _S.hide.hidden[player.name]=nil
  5530. _S.prophunt.props[player.name]=nil
  5531. else
  5532. _S.hide.hidden[player.name]=true
  5533. _S.hide.movePlayer(player)
  5534. local image=_S.images.sprites[player.sprite.category][player.sprite.id]
  5535. local directory=image[player.facingRight and "right" or "left"] or image
  5536. _S.prophunt.props[player.name]={
  5537. x=x,
  5538. y=y,
  5539. img=tfm.exec.addImage(directory.img..".png","?50",x+(directory.x or image.x or -50),y+(directory.y or image.y or -50))
  5540. }
  5541. end
  5542. end
  5543. end,
  5544. }
  5545. }
  5546. }
  5547.  
  5548.  
  5549. --[[ src/segments/rain.lua ]]--
  5550.  
  5551. _S.rain = {
  5552. disabled=true,
  5553. ticks=0,
  5554. ID=40,
  5555. callbacks={
  5556. eventLoop=function(time,remaining)
  5557. _S.rain.ticks=_S.rain.ticks+1
  5558. if _S.rain.ticks%2==0 then
  5559. tfm.exec.addShamanObject(_S.rain.ID, math.random()*map.length, -800, math.random()*360)
  5560. end
  5561.  
  5562. end
  5563. }
  5564. }
  5565.  
  5566.  
  5567. --[[ src/segments/rainbow.lua ]]--
  5568.  
  5569. _S.rainbow = {
  5570. players={},
  5571. defaultPlayer=function(player)
  5572. _S.rainbow.players[player] = os.time()
  5573. end,
  5574. callbacks={
  5575. keyboard={
  5576. [KEYS.SPACE]=function(player,down,x,y)
  5577. if down then
  5578. if _S.rainbow.players[player] < os.time()-500 then
  5579. _S.rainbow.players[player] = os.time()
  5580. for a = math.pi, 2*math.pi, math.pi/50 do
  5581. local s = 3
  5582. vx1, vy1 = s*math.cos(a), s*math.sin(a)
  5583. local m = -3/100
  5584. vx,vy=vx1,vy1
  5585. tfm.exec.displayParticle(1, x, y+12, vx, vy, m*vx, m*vy)
  5586. vx,vy=vx1*1.1,vy1*1.1
  5587. tfm.exec.displayParticle(9, x, y+12, vx, vy, m*vx, m*vy)
  5588. vx,vy=vx1*1.1,vy1*1.2
  5589. tfm.exec.displayParticle(11, x, y+12, vx, vy, m*vx, m*vy)
  5590. vx,vy=vx1*1.3,vy1*1.3
  5591. tfm.exec.displayParticle(13, x, y+12, vx, vy, m*vx, m*vy)
  5592. end
  5593. end
  5594. end
  5595. end,
  5596. },
  5597. },
  5598. }
  5599.  
  5600.  
  5601. --[[ src/segments/ratapult.lua ]]--
  5602.  
  5603. _S.ratapult = {
  5604. toDespawn={},
  5605. defaultPlayer=function(player)
  5606. player.activeSegments.ratapult=false
  5607. player.ratapult={
  5608. timestamp=os.time(),
  5609. cooldown=1500,
  5610. spawnLength=3000,
  5611. }
  5612. end,
  5613. callbacks={
  5614. keyboard={
  5615. [KEYS.DOWN]=function(player,down,x,y)
  5616. if not tfm.get.room.playerList[player.name].isDead then
  5617. if down then
  5618. player.ratapult.timestamp=os.time()
  5619. else
  5620. if os.time()-player.ratapult.timestamp-player.ratapult.cooldown>=0 then
  5621. local power=(os.time()+player.ratapult.cooldown-player.ratapult.timestamp)/100
  5622. if power>75 then power=75 end
  5623. table.insert(_S.ratapult.toDespawn,{
  5624. id=tfm.exec.addShamanObject(10,player.facingRight and x+30 or x-30,y,0,player.facingRight and power or -power),
  5625. despawn=os.time()+player.ratapult.spawnLength
  5626. })
  5627. player.ratapult.timestamp=os.time()
  5628. end
  5629. end
  5630. end
  5631. end,
  5632. },
  5633. },
  5634. }
  5635.  
  5636.  
  5637. --[[ src/segments/retro.lua ]]--
  5638.  
  5639. _S.retro = {
  5640. disabled=true,
  5641. callbacks={
  5642. newGame=function()
  5643. for _,deco in ipairs(map.holes) do
  5644. tfm.exec.addImage(_S.images.sprites.transformice.retrohole.img..".png","_100",deco.x+_S.images.sprites.transformice.retrohole.x,deco.y+_S.images.sprites.transformice.retrohole.y-15)
  5645. end
  5646. end,
  5647. }
  5648. }
  5649.  
  5650.  
  5651. --[[ src/segments/speed.lua ]]--
  5652.  
  5653. _S.speed = {
  5654. callbacks={
  5655. keyboard={
  5656. [KEYS.LEFT]=function(player,down,x,y)
  5657. if down then
  5658. tfm.exec.movePlayer(player.name, 0, 0, false, -player.speedPower, 0, false)
  5659. end
  5660. end,
  5661. [KEYS.RIGHT]=function(player,down,x,y)
  5662. if down then
  5663. tfm.exec.movePlayer(player.name, 0, 0, false, player.speedPower, 0, false)
  5664. end
  5665. end,
  5666. }
  5667. }
  5668. }
  5669.  
  5670.  
  5671. --[[ src/segments/splashscreen.lua ]]--
  5672.  
  5673. _S.splashScreen = {
  5674. disabled=true,
  5675. welcomed={},
  5676. callbacks={
  5677. newPlayer=function(player)
  5678. _S.splashScreen.welcomed[player.name]={time=os.time(),img=tfm.exec.addImage("150da3fae92.png","&100",100,100,player.name)}
  5679. end,
  5680. eventLoop=function(time,remaining)
  5681. for name,tbl in pairs(_S.splashScreen.welcomed) do
  5682. if tbl.time<os.time()-10000 then
  5683. for i=1,10 do
  5684. tfm.exec.removeImage(tbl.img)
  5685. end
  5686. _S.splashScreen.welcomed[name]=nil
  5687. break
  5688. end
  5689. end
  5690. end,
  5691. }
  5692. }
  5693.  
  5694.  
  5695.  
  5696. --[[ src/segments/tp.lua ]]--
  5697.  
  5698. _S.tp = {
  5699. callbacks={
  5700. mouse={
  5701. pr=1,
  5702. fnc=function(player,x,y)
  5703. for _,n in pairs(player.tp) do
  5704. tfm.exec.movePlayer(n,x,y)
  5705. end
  5706. player.tp=nil
  5707. player.activeSegments.tp=false
  5708. end
  5709. }
  5710. }
  5711. }
  5712.  
  5713.  
  5714. --[[ src/segments/treelights.lua ]]--
  5715.  
  5716. _S.treelights = {
  5717. disabled=true,
  5718. decorations={},
  5719. ids={0,1,2,4,9},
  5720. callbacks={
  5721. newGame=function()
  5722. _S.treelights.decorations={}
  5723. for _,deco in pairs(map.decorations) do
  5724. if deco.id==57 then
  5725. table.insert(_S.treelights.decorations,deco)
  5726. end
  5727. end
  5728. end,
  5729. eventLoop=function(time,remaining)
  5730. for _, deco in pairs(_S.treelights.decorations) do
  5731. for k = 10,0,-1 do
  5732. tfm.exec.displayParticle(_S.treelights.ids[math.random(#_S.treelights.ids)],deco.x+math.random(-40,40),deco.y+math.random(-120,0),0,0,0,0)
  5733. tfm.exec.displayParticle(11,deco.x-2,deco.y-183,math.cos(k),math.sin(k),0,0)
  5734. end
  5735. end
  5736. end
  5737. }
  5738. }
  5739.  
  5740.  
  5741. --[[ src/segments/_global.lua ]]--
  5742.  
  5743. -- Global segment that's always active and contains default functionality
  5744.  
  5745. _S.global = {
  5746. defaultPlayer=function(player)
  5747. player.activeSegments.global=true
  5748. player.ctrl=false
  5749. player.shift=false
  5750. player.facingRight=true
  5751. player.selected={}
  5752. end,
  5753. menu=function(player)
  5754. return {
  5755. --title="Help"
  5756. {callback="global help",icon="?",width=40},
  5757. {callback="global players",icon="Players",width=60},
  5758. }
  5759. end,
  5760. menuCondition=function(player) return true end,
  5761. shamObjects={},
  5762. tempMapName=nil,
  5763. selectPlayer=function(player,selection,x,y)
  5764. if selection then
  5765. if player.selected[selection] then
  5766. player.selected[selection]=nil
  5767. else
  5768. player.selected[selection]=true
  5769. end
  5770. end
  5771. local str=("<a href='event:global select all %s %s'>[%s]</a> <a href='event:global select none %s %s'>[%s]\n</a>"):format(x,y,translate("all",player.lang),x,y,translate("none",player.lang))
  5772. local total=0
  5773. local selected=0
  5774. for n,p in pairs(players) do
  5775. str=str.."\n<font color='#"..(player.selected[n] and "2ECF73" or "C2C2DA").."'><a href='event:global select "..n.." "..x.." "..y.."'>"..(ranks[n]>=RANKS.ROOM_ADMIN and "★ " or "")..n.."</a>"
  5776. total=total+1
  5777. if player.selected[n] then
  5778. selected=selected+1
  5779. end
  5780. end
  5781. ui.addTextArea(0,str,player.name,x,y,nil,nil,nil,nil,0.5,true)
  5782. end,
  5783. callbacks={
  5784. newGame=function()
  5785. _S.global.tempMapName=nil
  5786. end,
  5787. newPlayer=function(player)
  5788. _S.global.showMenu(player.name)
  5789. end,
  5790. playerLeft=function(player)
  5791. for n,p in pairs(players) do
  5792. if p.selected[player.name] then
  5793. p.selected[player.name]=nil
  5794. end
  5795. end
  5796. end,
  5797. textArea={
  5798. players=function(id,name,arg)
  5799. if players[name].dropdown and players[name].dropdown=="players" then
  5800. players[name].dropdown=nil
  5801. ui.removeTextArea(0,name)
  5802. else
  5803. local ta
  5804. for k,v in pairs(players[name].menu) do
  5805. if v.id==id then ta=v end
  5806. end
  5807. _S.global.selectPlayer(players[name],nil,ta.x,ta.y+30)
  5808. players[name].dropdown="players"
  5809. end
  5810. end,
  5811. select=function(id,name,arg)
  5812. local x,y=tonumber(arg[4]),tonumber(arg[5])
  5813. if arg[3]=="all" then
  5814. for n,p in pairs(tfm.get.room.playerList) do
  5815. players[name].selected[n]=true
  5816. end
  5817. _S.global.selectPlayer(players[name],nil,x,y)
  5818. elseif arg[3]=="none" then
  5819. for n,p in pairs(tfm.get.room.playerList) do
  5820. players[name].selected[n]=nil
  5821. end
  5822. _S.global.selectPlayer(players[name],nil,x,y)
  5823. elseif tfm.get.room.playerList[arg[3]] then
  5824. _S.global.selectPlayer(players[name],arg[3],x,y)
  5825. end
  5826. end
  5827. },
  5828. keyboard={
  5829. [KEYS.SHIFT]=function(player,down,x,y)
  5830. player.shift=down
  5831. end,
  5832. [KEYS.CTRL]=function(player,down,x,y)
  5833. player.ctrl=down
  5834. end,
  5835. [KEYS.LEFT]=function(player,down,x,y)
  5836. if down then player.facingRight=false end
  5837. end,
  5838. [KEYS.RIGHT]=function(player,down,x,y)
  5839. if down then player.facingRight=true end
  5840. end,
  5841. [KEYS.UP]=function(player,down,x,y) end,
  5842. [KEYS.DOWN]=function(player,down,x,y) end,
  5843. [KEYS.DELETE]=function(player,down,x,y)
  5844. tfm.exec.killPlayer(player.name)
  5845. end,
  5846. },
  5847. mouse={
  5848. pr=-20,
  5849. fnc=function(player,x,y)
  5850. if _S.omo and _S.omo.welcomed[player.name] then
  5851. local id=_S.omo.startID
  5852. for i=1,10 do
  5853. ui.removeTextArea(id+i,player.name)
  5854. end
  5855. _S.omo.welcomed[player.name]=nil
  5856. elseif _S.splashScreen and _S.splashScreen.welcomed[player.name] then
  5857. tfm.exec.removeImage(_S.splashScreen.welcomed[player.name].img)
  5858. _S.splashScreen.welcomed[player.name]=nil
  5859. elseif player.shift and player.ctrl then
  5860. tfm.exec.chatMessage("X:"..x.." Y:"..y,player.name)
  5861. return true
  5862. elseif player.shift then
  5863. -- Inspect ground.
  5864. return false
  5865. elseif player.ctrl then
  5866. if ranks[player.name]>=RANKS.ROOM_ADMIN then
  5867. tfm.exec.movePlayer(player.name,x,y)
  5868. end
  5869. return true
  5870. end
  5871. end
  5872. },
  5873. chatCommand={
  5874. win={
  5875. rank=RANKS.ROOM_ADMIN,
  5876. fnc=function(player,...)
  5877. local arg={...}
  5878. executeCommand(player, function(a)
  5879. tfm.exec.giveCheese(a)
  5880. tfm.exec.playerVictory(a)
  5881. end, arg)
  5882. end
  5883. },
  5884. cheese={
  5885. rank=RANKS.ROOM_ADMIN,
  5886. fnc=function(player,...)
  5887. local arg={...}
  5888. executeCommand(player, function(a)
  5889. tfm.exec.giveCheese(a)
  5890. end, arg)
  5891. end
  5892. },
  5893. victory={
  5894. rank=RANKS.ROOM_ADMIN,
  5895. fnc=function(player,...)
  5896. local arg={...}
  5897. executeCommand(player, function(a)
  5898. tfm.exec.playerVictory(a)
  5899. end, arg)
  5900. end
  5901. },
  5902. kill={
  5903. rank=RANKS.ROOM_ADMIN,
  5904. fnc=function(player,...)
  5905. local arg={...}
  5906. executeCommand(player, function(a)
  5907. tfm.exec.killPlayer(a)
  5908. end, arg)
  5909. end
  5910. },
  5911. respawn={
  5912. rank=RANKS.ROOM_ADMIN,
  5913. fnc=function(player,...)
  5914. local arg={...}
  5915. executeCommand(player, function(a)
  5916. tfm.exec.respawnPlayer(a)
  5917. end, arg)
  5918. end
  5919. },
  5920. r={rank=RANKS.ROOM_ADMIN,fnc=function(player,...) _S.global.callbacks.chatCommand.respawn.fnc(player,...) end},
  5921. vampire={
  5922. rank=RANKS.ROOM_ADMIN,
  5923. fnc=function(player,...)
  5924. local arg={...}
  5925. executeCommand(player, function(a)
  5926. tfm.exec.setVampirePlayer(a)
  5927. end, arg)
  5928. end
  5929. },
  5930. vamp={rank=RANKS.ROOM_ADMIN,fnc=function(player,...) _S.global.callbacks.chatCommand.vampire.fnc(player,...) end},
  5931. meep={
  5932. rank=RANKS.ROOM_ADMIN,
  5933. fnc=function(player,...)
  5934. local arg={...}
  5935. executeCommand(player, function(a, power)
  5936. tfm.exec.giveMeep(a)
  5937. players[a].meepPower=tonumber(power) or false
  5938. players[a].meepTimer=os.time()
  5939. toggleSegment(a, "meep", not tonumber(arg[1]) and not players[a].activeSegments.meep or tonumber(arg[1]))
  5940. if not players[a].activeSegments.meep then tfm.exec.chatMessage(translate("meepremovednextround",player.lang), a) end
  5941. end, arg)
  5942. end
  5943. },
  5944. shaman={
  5945. rank=RANKS.ROOM_ADMIN,
  5946. fnc=function(player,...)
  5947. local arg={...}
  5948. executeCommand(player, function(a)
  5949. tfm.exec.setShaman(a)
  5950. end, arg)
  5951. end
  5952. },
  5953. sham={rank=RANKS.ROOM_ADMIN,fnc=function(player,...) _S.global.callbacks.chatCommand.shaman.fnc(player,...) end},
  5954. s={rank=RANKS.ROOM_ADMIN,fnc=function(player,...) _S.global.callbacks.chatCommand.shaman.fnc(player,...) end},
  5955. mort={
  5956. rank=RANKS.ANY,
  5957. hide=true,
  5958. fnc=function(player)
  5959. tfm.exec.killPlayer(player.name)
  5960. end
  5961. },
  5962. die={rank=RANKS.ANY,hide=true,fnc=function(player,...) _S.global.callbacks.chatCommand.mort.fnc(player,...) end},
  5963. me={
  5964. rank=RANKS.ANY,
  5965. hide=true,
  5966. fnc=function(player,...)
  5967. local arg={...}
  5968. if arg[1] then
  5969. tfm.exec.chatMessage("<V>*"..player.name.." <N>"..(table.concat(arg," ")))
  5970. end
  5971. end
  5972. },
  5973. mod={
  5974. rank=RANKS.STAFF,
  5975. hide=true,
  5976. fnc=function(player,...)
  5977. local arg={...}
  5978. if arg[1] then
  5979. tfm.exec.chatMessage("<ROSE><b>["..player.name.."] "..(table.concat(arg," ")).."</b>")
  5980. end
  5981. end
  5982. },
  5983. mapname={
  5984. rank=RANKS.ROOM_ADMIN,
  5985. fnc=function(player,...)
  5986. local arg={...}
  5987. if arg[1] then
  5988. _S.global.tempMapName=table.concat(arg," ")
  5989. ui.setMapName("<J>".._S.global.tempMapName)
  5990. end
  5991. end
  5992. },
  5993. c={
  5994. rank=RANKS.ROOM_ADMIN,
  5995. hide=true,
  5996. fnc=function(player,...)
  5997. local arg={...}
  5998. if arg[1] then
  5999. for n,p in pairs(tfm.get.room.playerList) do
  6000. if ranks[n]>=RANKS.ROOM_ADMIN then
  6001. tfm.exec.chatMessage("<font color='#00FFFF'>&#926; ["..player.name.."] "..(table.concat(arg," ")).."</font>",n)
  6002. end
  6003. end
  6004. end
  6005. end
  6006. },
  6007. t={rank=RANKS.ROOM_ADMIN,hide=true,fnc=function(player,...) _S.global.callbacks.chatCommand.c.fnc(player,...) end},
  6008. draw={
  6009. rank=RANKS.ROOM_ADMIN,
  6010. fnc=defaultToggleSegmentChatCallback("draw")
  6011. },
  6012. drawonme={
  6013. rank=RANKS.ROOM_ADMIN,
  6014. fnc=defaultToggleSegmentChatCallback("drawOnMe")
  6015. },
  6016. ffa={
  6017. rank=RANKS.ROOM_ADMIN,
  6018. fnc=defaultToggleSegmentChatCallback("ffa")
  6019. },
  6020. lightning={
  6021. rank=RANKS.ROOM_ADMIN,
  6022. fnc=defaultToggleSegmentChatCallback("lightning")
  6023. },
  6024. fly={
  6025. rank=RANKS.ROOM_ADMIN,
  6026. fnc=defaultToggleSegmentChatCallback("fly")
  6027. },
  6028. dash={
  6029. rank=RANKS.ROOM_ADMIN,
  6030. fnc=defaultToggleSegmentChatCallback("dash")
  6031. },
  6032. projection={
  6033. rank=RANKS.ROOM_ADMIN,
  6034. fnc=defaultToggleSegmentChatCallback("projection")
  6035. },
  6036. inspect={
  6037. rank=RANKS.ALL,
  6038. fnc=defaultToggleSegmentChatCallback("inspect")
  6039. },
  6040. prophunt={
  6041. rank=RANKS.ALL,
  6042. fnc=defaultToggleSegmentChatCallback("prophunt")
  6043. },
  6044. clear={
  6045. rank=RANKS.ROOM_ADMIN,
  6046. fnc = function()
  6047. for objectId in pairs(SPAWNEDOBJS) do
  6048. tfm.exec.removeObject(objectId)
  6049. end
  6050. SPAWNEDOBJS = {}
  6051. end
  6052. },
  6053. name={
  6054. rank=RANKS.ANY,
  6055. fnc=function(player,color,...)
  6056. local arg={...}
  6057. if color then
  6058. if tonumber(color)==0 then
  6059. color=0
  6060. else
  6061. local c=getColor(color)
  6062. if c then
  6063. color=c
  6064. else
  6065. tfm.exec.chatMessage(translate("invalidargument",player.lang),player.name)
  6066. end
  6067. end
  6068. else
  6069. color=0
  6070. end
  6071. if color then
  6072. executeCommand(player,function(target)
  6073. tfm.exec.setNameColor(target,color)
  6074. end,arg)
  6075. end
  6076. end
  6077. },
  6078. speed={
  6079. rank=RANKS.ROOM_ADMIN,
  6080. fnc=function(player,power,...)
  6081. local arg={...}
  6082. power=tonumber(power) or 100
  6083. executeCommand(player, function(targetName)
  6084. local target = targetName and players[targetName] or player
  6085. target.speedPower=tonumber(power) or 100
  6086. toggleSegment(target.name, "speed", not tonumber(arg[1]) and not target.activeSegments.speed or tonumber(arg[1]) and true)
  6087. end, arg)
  6088. end
  6089. },
  6090. conj={
  6091. rank=RANKS.ROOM_ADMIN,
  6092. fnc=function(player,...)
  6093. local arg={...}
  6094. executeCommand(player,function(target,time)
  6095. players[target].conjTime=time or 10
  6096. toggleSegment(target, "conj", not arg[1] and not players[target].activeSegments.conj or arg[1] and true)
  6097. end,arg)
  6098. end
  6099. },
  6100. emote={
  6101. rank=RANKS.ROOM_ADMIN,
  6102. fnc=function(player,...)
  6103. local arg={...}
  6104. executeCommand(player,function(target,emote)
  6105. if emote and tfm.enum.emote[emote:lower()] then
  6106. tfm.exec.playEmote(target,tfm.enum.emote[emote:lower()])
  6107. elseif tonumber(emote) then
  6108. tfm.exec.playEmote(target,tonumber(emote))
  6109. end
  6110. end,arg)
  6111. end
  6112. },
  6113. flag={
  6114. rank=RANKS.ROOM_ADMIN,
  6115. fnc=function(player,...)
  6116. local arg={...}
  6117. executeCommand(player,function(target,flag)
  6118. tfm.exec.playEmote(target,tfm.enum.emote.flag,flag)
  6119. end,arg)
  6120. end
  6121. },
  6122. f={rank=RANKS.ROOM_ADMIN,fnc=function(player,...) _S.global.callbacks.chatCommand.flag.fnc(player,...) end},
  6123. insta={
  6124. rank=RANKS.ROOM_ADMIN,
  6125. fnc=defaultToggleSegmentChatCallback("insta")
  6126. },
  6127. ratapult={
  6128. rank=RANKS.ROOM_ADMIN,
  6129. fnc=defaultToggleSegmentChatCallback("ratapult")
  6130. },
  6131. checkpoints={
  6132. rank=RANKS.ROOM_ADMIN,
  6133. fnc=defaultToggleSegmentChatCallback("checkpoints")
  6134. },
  6135. checkpoint={rank=RANKS.ROOM_ADMIN,fnc=function(player,...) _S.global.callbacks.chatCommand.checkpoints.fnc(player,...) end},
  6136. cp={rank=RANKS.ROOM_ADMIN,fnc=function(player,...) _S.global.callbacks.chatCommand.checkpoints.fnc(player,...) end},
  6137. rainbow={
  6138. rank=RANKS.ROOM_ADMIN,
  6139. fnc=defaultToggleSegmentChatCallback("rainbow")
  6140. },
  6141. meow={
  6142. rank=RANKS.ROOM_ADMIN,
  6143. fnc=function(player)
  6144. local tbl={6356881,6780029}
  6145. selectMap(tbl[math.random(#tbl)])
  6146. for n,p in pairs(players) do
  6147. _S.images.selectImage(p,"pusheen")
  6148. end
  6149. tfm.exec.setGameTime(9999999)
  6150. _S.global.tempMapName=("%s <BL>| %s %s %s"):format(translate("meow"),translate("meow"),translate("meow"),translate("meow"))
  6151. ui.setMapName("<J>".._S.global.tempMapName)
  6152. end
  6153. },
  6154. pw={
  6155. rank=RANKS.ROOM_ADMIN,
  6156. fnc=function(player,password)
  6157. if password then
  6158. tfm.exec.setRoomPassword(password)
  6159. pw=password
  6160. tfm.exec.chatMessage("Room password changed to: "..password,player.name)
  6161. elseif pw then
  6162. tfm.exec.setRoomPassword("")
  6163. pw=nil
  6164. tfm.exec.chatMessage("Room password reset.",player.name)
  6165. elseif not pw then
  6166. tfm.exec.chatMessage("The room currently has no password.",player.name)
  6167. end
  6168. end
  6169. },
  6170. np={
  6171. rank=RANKS.ROOM_ADMIN,
  6172. fnc=function(player,mapid,category)
  6173. selectMap(mapid,category)
  6174. end
  6175. },
  6176. map={rank=RANKS.ROOM_ADMIN,fnc=function(player,...) _S.global.callbacks.chatCommand.np.fnc(player,...) end},
  6177. maps={
  6178. rank=RANKS.ANY,
  6179. fnc=function(player,id)
  6180. local tbl={}
  6181. if id and maps[id] then
  6182. for k,v in pairs(maps[id]) do
  6183. if type(v)=="number" or type(v)=="string" then
  6184. table.insert(tbl,tostring(v))
  6185. elseif type(v)=="table" then
  6186. for kk,vv in pairs(v) do
  6187. table.insert(tbl,tostring(vv))
  6188. end
  6189. end
  6190. end
  6191. else
  6192. for k,v in pairs(maps) do
  6193. table.insert(tbl,k)
  6194. end
  6195. end
  6196. tfm.exec.chatMessage(table.concat(tbl,","),player.name)
  6197. end
  6198. },
  6199. maplist={rank=RANKS.ANY,fnc=function(player,...) _S.global.callbacks.chatCommand.maps.fnc(player,...) end},
  6200. npp={
  6201. rank=RANKS.ROOM_ADMIN,
  6202. fnc=function(player,mapid)
  6203. if mapid then
  6204. local alreadyQueued
  6205. for k,v in ipairs(mapInfo.queue) do
  6206. if v.map==mapid then
  6207. alreadyQueued=true
  6208. break
  6209. end
  6210. end
  6211. if alreadyQueued then
  6212. tfm.exec.chatMessage(translate("alreadyqueued",player.lang),player.name)
  6213. else
  6214. table.insert(mapInfo.queue,{map=mapid,name=player.name})
  6215. tfm.exec.chatMessage(translate("addedtoqueue",player.lang):format(mapid,#mapInfo.queue),player.name)
  6216. end
  6217. else
  6218. local tbl={}
  6219. for k,v in pairs(mapInfo.queue) do
  6220. table.insert(tbl,translate("submittedby",player.lang):format(k,v.map,v.name))
  6221. end
  6222. if tbl[1] then
  6223. tfm.exec.chatMessage(table.concat(tbl,"\n"),name)
  6224. else
  6225. tfm.exec.chatMessage(translate("noqueue",player.lang),player.name)
  6226. end
  6227. end
  6228. end
  6229. },
  6230. queue={rank=RANKS.ROOM_ADMIN,fnc=function(player,...) _S.global.callbacks.chatCommand.npp.fnc(player,...) end},
  6231. q={rank=RANKS.ROOM_ADMIN,fnc=function(player,...) _S.global.callbacks.chatCommand.npp.fnc(player,...) end},
  6232. doll={
  6233. rank=RANKS.ROOM_ADMIN,
  6234. fnc=function(player,...)
  6235. local arg={...}
  6236. if arg[1] then
  6237. player.dolls={}
  6238. --[[
  6239. for k,v in pairs(arg) do
  6240. if players[upper(v)] then
  6241. table.insert(player.dolls,upper(v))
  6242. end
  6243. end
  6244. ]]
  6245. executeCommand(player, function(target)
  6246. table.insert(player.dolls,upper(target))
  6247. end, arg)
  6248. activateSegment(player.name,"doll")
  6249. else
  6250. if player.activeSegments.doll then
  6251. deactivateSegment(player.name,"doll")
  6252. player.dolls=nil
  6253. end
  6254. end
  6255. end
  6256. },
  6257. time={
  6258. rank=RANKS.ANY,
  6259. fnc=function(player,time)
  6260. if ranks[player.name]>=RANKS.ROOM_ADMIN then
  6261. if tonumber(time) then
  6262. tfm.exec.setGameTime((currentTime/1000)+time)
  6263. tfm.exec.chatMessagePublic("addedtime",players,player.name,time)
  6264. end
  6265.  
  6266. elseif SETTINGS.VOTE_TIME then
  6267. local totalVotes=0
  6268. for _ in pairs(SETTINGS.VOTE_TIME.votes) do
  6269. totalVotes=totalVotes+1
  6270. end
  6271. if totalVotes<=SETTINGS.VOTE_TIME.maxVotes and not SETTINGS.VOTE_TIME.votes[player.name] then
  6272. tfm.exec.setGameTime((currentTime/1000)+SETTINGS.VOTE_TIME.timeToAdd,true)
  6273. tfm.exec.chatMessagePublic("addedtime",players,player.name,SETTINGS.VOTE_TIME.timeToAdd)
  6274. SETTINGS.VOTE_TIME.votes[player.name]=true
  6275. else
  6276. tfm.exec.chatMessage(translate("cantaddtime",player.lang),player.name)
  6277. end
  6278. end
  6279. end
  6280. },
  6281. skip={
  6282. rank=RANKS.ANY,
  6283. fnc=function(player)
  6284. if SETTINGS.VOTE_SKIP and not SETTINGS.VOTE_SKIP.skipped then
  6285. if not SETTINGS.VOTE_SKIP.votes[player.name] then
  6286. SETTINGS.VOTE_SKIP.votes[player.name]=true
  6287. local total=0
  6288. local totalVotes=0
  6289. for n in pairs(players) do
  6290. total=total+1
  6291. if SETTINGS.VOTE_SKIP.votes[n] then
  6292. totalVotes=totalVotes+1
  6293. end
  6294. end
  6295. local votesRequired=math.floor((total/1.25))
  6296. tfm.exec.chatMessagePublic("votedtoskip",players,player.name)
  6297. if totalVotes>=votesRequired then
  6298. SETTINGS.VOTE_SKIP.skipped=true
  6299. tfm.exec.chatMessagePublic("roundskipped",players)
  6300. tfm.exec.setGameTime(5)
  6301. end
  6302. else
  6303. tfm.exec.chatMessage(translate("alreadyvotedtoskip",player.lang),player.name)
  6304. end
  6305. end
  6306. end
  6307. },
  6308. print={
  6309. rank=RANKS.STAFF,
  6310. fnc=function(player,...)
  6311. local arg={...}
  6312. local tbl=_G
  6313. local tmp={}
  6314. if arg[1] and arg[1]:find(".") then
  6315. tmp=string.split(arg[1],".")
  6316. end
  6317. for k,v in pairs(tmp) do
  6318. if tbl[tonumber(v)] or tbl[v] then
  6319. tbl=tbl[tonumber(v)] or tbl[v]
  6320. else
  6321. tfm.exec.chatMessage("Table doesn't exist.",player.name)
  6322. return
  6323. end
  6324. end
  6325. if type(tbl)=="string" or type(tbl)=="number" then
  6326. tfm.exec.chatMessage(tostring(tbl),player.name)
  6327. else
  6328. printInfo(arg[1],tbl,player.name)
  6329. end
  6330. end
  6331. },
  6332. list={
  6333. rank=RANKS.STAFF,
  6334. fnc=function(player,...)
  6335. local arg={...}
  6336. local tbl=_G
  6337. local tmp={}
  6338. if arg[1] and arg[1]:find(".") then
  6339. tmp=string.split(arg[1],".")
  6340. end
  6341. for k,v in pairs(tmp) do
  6342. if tbl[tonumber(v)] or tbl[v] then
  6343. tbl=tbl[tonumber(v)] or tbl[v]
  6344. else
  6345. tfm.exec.chatMessage("Table doesn't exist.",player.name)
  6346. return
  6347. end
  6348. end
  6349. if arg[1] and type(tbl)=="table" then
  6350. local t={}
  6351. for k,v in pairs(tbl) do
  6352. table.insert(t,k)
  6353. end
  6354. tfm.exec.chatMessage(table.concat(t,", "),player.name)
  6355. else
  6356. tfm.exec.chatMessage("Not a table.",player.name)
  6357. end
  6358. end
  6359. },
  6360. set={
  6361. rank=RANKS.STAFF,
  6362. fnc=function(player,...)
  6363. local arg={...}
  6364. local tbl=_G
  6365. local tmp={}
  6366. if arg[1] and arg[1]:find(".") then
  6367. tmp=string.split(arg[1],".")
  6368. end
  6369. for k,v in ipairs(tmp) do
  6370. local key=tbl[tonumber(v)] and tonumber(v) or v
  6371. if tmp[k+1] then
  6372. if tbl[key] then
  6373. tbl=tbl[key]
  6374. else
  6375. tfm.exec.chatMessage("Table doesn't exist.",player.name)
  6376. break
  6377. end
  6378. else
  6379. if arg[2] then
  6380. local newval=tonumber(arg[2]) or (arg[2]=="nil" and nil) or (arg[2]=="{}" and {}) or (arg[2]=="true" and true) or (arg[2]=="false" and false) or arg[2]
  6381. tbl[key]=newval
  6382. -- tbl=tonumber(arg[2]) or (arg[2]=="nil" and nil) or (arg[2]=="true" and true) or (arg[2]=="false" and false) or arg[2]
  6383. tfm.exec.chatMessage("Variable set: "..arg[2],player.name)
  6384. else
  6385. tfm.exec.chatMessage("No variable set.",player.name)
  6386. end
  6387. end
  6388. end
  6389. end
  6390. },
  6391. skills={
  6392. rank=RANKS.ROOM_ADMIN,
  6393. fnc=function(player,toggle)
  6394. local skillsDisabled=SETTINGS.SKILLS
  6395. if not toggle then
  6396. if SETTINGS.SKILLS then SETTINGS.SKILLS=false else SETTINGS.SKILLS=true end
  6397. elseif toggle=="on" then SETTINGS.SKILLS=true
  6398. elseif toggle=="off" then SETTINGS.SKILLS=false
  6399. end
  6400.  
  6401. tfm.exec.disableAllShamanSkills(SETTINGS.SKILLS)
  6402. tfm.exec.chatMessagePublic(SETTINGS.SKILLS and "enabled" or "disabled",players)
  6403. end
  6404. },
  6405. snow={
  6406. rank=RANKS.ROOM_ADMIN,
  6407. fnc=function(player,time)
  6408. tfm.exec.snow(time or 60,10)
  6409. end
  6410. },
  6411. changelog={
  6412. rank=RANKS.ANY,
  6413. fnc=function(player,days,num)
  6414. if showChangelog(days,num,player) then
  6415. tfm.exec.chatMessage(showChangelog(days,num,player),player.name)
  6416. else
  6417. tfm.exec.chatMessage("There are no recent things in the changelog.",player.name)
  6418. end
  6419. end
  6420. },
  6421. xml={
  6422. rank=RANKS.ROOM_ADMIN,
  6423. fnc=function(player,...)
  6424. local arg={...}
  6425. if arg[1] then
  6426. selectMap(table.concat(arg," "):gsub("&lt;","<"))
  6427. elseif ranks[player.name]>=RANKS.STAFF then
  6428. local splitnum=800
  6429. for i=1,#map.xml,splitnum do
  6430. tfm.exec.chatMessage("<font size='8'>"..(string.sub(map.xml,i,i+splitnum-1)):gsub("<","&lt;").."</font>",player.name)
  6431. end
  6432. end
  6433. end
  6434. },
  6435. admins={
  6436. rank=RANKS.ANY,
  6437. fnc=function(player)
  6438. local t={}
  6439. for n in pairs(players) do
  6440. if ranks[n] and ranks[n]>=RANKS.ROOM_ADMIN then
  6441. table.insert(t,n)
  6442. end
  6443. end
  6444. if #t>0 then
  6445. tfm.exec.chatMessage(table.concat(t,", "),player.name)
  6446. else
  6447. tfm.exec.chatMessage(translate("noadmins",player.lang),player.name)
  6448. end
  6449. end
  6450. },
  6451. admin={
  6452. rank=RANKS.ROOM_ADMIN,
  6453. fnc=function(player,...)
  6454. local arg={...}
  6455. if arg[1] then
  6456. executeCommand(player, function(a)
  6457. if players[a] and ranks[a] then
  6458. if ranks[a]<RANKS.ROOM_ADMIN then
  6459. ranks[a]=RANKS.ROOM_ADMIN
  6460. tfm.exec.chatMessagePublic("isnowadmin",players,a)
  6461. else
  6462. tfm.exec.chatMessage(translate("hashigherrank",player.lang):format(a),player.name)
  6463. end
  6464. end
  6465. end, arg)
  6466. end
  6467. end
  6468. },
  6469. unadmin={
  6470. rank=RANKS.ROOM_OWNER,
  6471. fnc=function(player,...)
  6472. local arg={...}
  6473. if arg[1] then
  6474. executeCommand(player, function(a)
  6475. if players[a] and ranks[a] then
  6476. if ranks[a]<ranks[player.name] and ranks[a]==RANKS.ROOM_ADMIN then
  6477. ranks[a]=RANKS.ANY
  6478. tfm.exec.chatMessagePublic("isnoadmin",players,a)
  6479. else
  6480. tfm.exec.chatMessage(translate("hashigherrank",player.lang):format(a),player.name)
  6481. end
  6482. end
  6483. end, arg)
  6484. end
  6485. end
  6486. },
  6487. deadmin={rank=RANKS.ROOM_OWNER,fnc=function(player,...) _S.global.callbacks.chatCommand.lock.fnc(player,...) end},
  6488. lock={
  6489. rank=RANKS.ROOM_ADMIN,
  6490. fnc=function(player,num)
  6491. num=tonumber(num) or (num and false) or 1
  6492. if tonumber(num) and (num>=1 and num<=50) then
  6493. tfm.exec.setRoomMaxPlayers(num)
  6494. tfm.exec.chatMessagePublic("roomlimit",players,num)
  6495. else
  6496. tfm.exec.chatMessage(translate("invalidargument",player.lang),player.name)
  6497. end
  6498. end
  6499. },
  6500. unlock={rank=RANKS.ROOM_ADMIN,fnc=function(player,...) _S.global.callbacks.chatCommand.lock.fnc(player,50) end},
  6501. score={
  6502. rank=RANKS.ROOM_ADMIN,
  6503. fnc=function(player,...)
  6504. local arg={...}
  6505. executeCommand(player, function(target, score)
  6506. tfm.exec.setPlayerScore(target, score)
  6507. end, arg)
  6508. end
  6509. },
  6510. tp={
  6511. rank=RANKS.ROOM_ADMIN,
  6512. fnc=function(player,...)
  6513. local arg={...}
  6514. local x,y
  6515. for k,v in pairs(arg) do
  6516. if tonumber(v) then
  6517. if not x then x=v elseif not y then y=v end
  6518. end
  6519. end
  6520. if not x and not y then
  6521. player.activeSegments.tp=true
  6522. player.tp={}
  6523. executeCommand(player, function(target)
  6524. table.insert(player.tp,target)
  6525. end, arg)
  6526. else
  6527. executeCommand(player, function(target,x,y)
  6528. tfm.exec.movePlayer(target, x, y)
  6529. end, arg)
  6530. end
  6531. end
  6532. },
  6533. spawn={
  6534. rank=RANKS.ROOM_ADMIN,
  6535. fnc=function(player,id,x,y,num,angle,vx,vy)
  6536. if id then
  6537. local o={}
  6538. id=tfm.enum.shamanObject[id] or id
  6539. num=tonumber(num) or 1
  6540. if num>15 then num=15 elseif num<0 then num=0 end
  6541. for i=1,num do
  6542. table.insert(o,tfm.exec.addShamanObject(id,tonumber(x) or tfm.get.room.playerList[player.name].x, tonumber(y) or tfm.get.room.playerList[player.name].y,tonumber(angle) or 0,tonumber(vx) or 0,tonumber(vy) or 0))
  6543. end
  6544. return o
  6545. else
  6546. tfm.exec.chatMessage(translate("enterobjectid",player.lang),player.name)
  6547. end
  6548. end
  6549. },
  6550. addspawn={
  6551. rank=RANKS.ROOM_ADMIN,
  6552. fnc=function(player,id,x,y,num,angle,vx,vy,interval,despawn)
  6553. if id then
  6554. id=tfm.enum.shamanObject[id] or id
  6555. num=tonumber(num) or 1
  6556. if num>10 then num=10 elseif num<0 then num=0 end
  6557. for i=1,num do
  6558. table.insert(_S.addspawn.toSpawn, {name=player.name, type=tonumber(id), x=tonumber(x) or 0, y=tonumber(y) or 0, ang=tonumber(ang) or 0,vx=tonumber(vx) or 0, vy=tonumber(vy) or 0, interval=tonumber(interval) or 6, tick=0, despawn=tonumber(despawn) or 120})
  6559. end
  6560. else
  6561. toggleSegment(player.name, "addspawn", not players[player.name].activeSegments.addspawn)
  6562. end
  6563. end
  6564. },
  6565. clearspawns={
  6566. rank=RANKS.ROOM_ADMIN,
  6567. fnc=function(player)
  6568. _S.addspawn.toSpawn={}
  6569. end
  6570. },
  6571. removespawns={rank=RANKS.ROOM_ADMIN,fnc=function(player,...) _S.global.callbacks.chatCommand.clearspawns.fnc(player,...) end},
  6572. disco={
  6573. rank=RANKS.ROOM_ADMIN,
  6574. fnc=function(player)
  6575. _S.disco.disabled = not _S.disco.disabled
  6576. if _S.disco.disabled then
  6577. for n,p in pairs(tfm.get.room.playerList) do
  6578. tfm.exec.setNameColor(n,0)
  6579. end
  6580. end
  6581. end
  6582. },
  6583. doge={
  6584. rank=RANKS.ROOM_ADMIN,
  6585. fnc=function()
  6586. _S.doge.disabled = not _S.doge.disabled
  6587. if _S.doge.disabled then
  6588. ui.removeTextArea(-50)
  6589. end
  6590. end
  6591. },
  6592. treelights={
  6593. rank=RANKS.ROOM_ADMIN,
  6594. fnc=function()
  6595. _S.treelights.disabled = not _S.treelights.disabled
  6596. if not _S.treelights.disabled then _S.treelights.callbacks.newGame() end
  6597. end
  6598. },
  6599. ballExplosion={
  6600. rank=RANKS.ROOM_ADMIN,
  6601. fnc=function(player, ...)
  6602. args = {...}
  6603. if #args == 0 then
  6604. _S.ballExplosion.disabled = not _S.ballExplosion.disabled
  6605. end
  6606. end
  6607. },
  6608. flames={
  6609. rank=RANKS.ROOM_ADMIN,
  6610. fnc=function()
  6611. _S.flames.disabled = not _S.flames.disabled
  6612. if not _S.flames.disabled then _S.flames.callbacks.newGame() end
  6613. end
  6614. },
  6615. bubbles={
  6616. rank=RANKS.ROOM_ADMIN,
  6617. fnc=function()
  6618. _S.bubbles.disabled = not _S.bubbles.disabled
  6619. if not _S.bubbles.disabled then
  6620. _S.bubbles.callbacks.newGame()
  6621. _S.bubbles.shamanObjects = {}
  6622. else
  6623. for _, id in pairs(_S.bubbles.shamanObjects) do
  6624. tfm.exec.removeObject(id)
  6625. end
  6626. end
  6627. end
  6628. },
  6629. rain={
  6630. rank=RANKS.ROOM_ADMIN,
  6631. fnc=function(player,id)
  6632. _S.rain.ID=tonumber(id) or 40
  6633. _S.rain.disabled = not _S.rain.disabled
  6634. end
  6635. },
  6636. fireworks={
  6637. rank=RANKS.ROOM_ADMIN,
  6638. fnc=function(player,...)
  6639. local arg={...}
  6640. if #arg==0 then
  6641. _S.fireworks.disabled = not _S.fireworks.disabled
  6642. --if not _S.fireworks.disabled then _S.fireworks.setPositions() end
  6643. else
  6644. executeCommand(player, function(target)
  6645. toggleSegment(target,"fireworks",not players[target].activeSegments.fireworks)
  6646. end, arg)
  6647. end
  6648.  
  6649. end
  6650. },
  6651. explosion={
  6652. rank=RANKS.ROOM_ADMIN,
  6653. fnc=function(player,...)
  6654. local arg={...}
  6655. executeCommand(player, function(target)
  6656. players[target].activeSegments.explosion=not players[target].activeSegments.explosion
  6657. end, arg)
  6658. end
  6659. },
  6660. debug={
  6661. rank=RANKS.ANY,
  6662. fnc=function(player,...)
  6663. player.activeSegments.debug=not player.activeSegments.debug
  6664. if player.activeSegments.debug then
  6665. _S.debug.showMapInfo(player.name)
  6666. else
  6667. ui.removeTextArea(-18,player.name)
  6668. end
  6669. end
  6670. },
  6671. mapinfo={rank=RANKS.ANY,fnc=function(player,...) _S.global.callbacks.chatCommand.debug.fnc(player) end},
  6672. }
  6673. },
  6674. showMenu=function(name,hidden)
  6675. local player=players[name]
  6676. local menu={}
  6677.  
  6678. if _S.global.menuCondition and _S.global.menuCondition(player) then
  6679. table.insert(menu, _S.global.menu(player))
  6680. end
  6681. for k,s in pairs(_S) do
  6682. if k~="global" and s.menuCondition and s.menuCondition(player) then
  6683. table.insert(menu, s.menu(player))
  6684. end
  6685. end
  6686. player.menu=menu
  6687.  
  6688. local x=0
  6689. local y=25
  6690. local ta=1
  6691. for _,section in ipairs(menu) do
  6692. local titlex=x
  6693. for i,item in ipairs(section) do
  6694. local width=item.width or 20
  6695. ui.addTextArea(ta,item.custom or "<p align='center'><a href='event:"..item.callback.."'>"..item.icon.."\n</a></p>",name,5+x,y,width,20,item.color,nil,0.5,true)
  6696. table.insert(player.menu,{id=ta,callback=item.callback,icon=item.icon,color=item.color,x=x+5,y=y})
  6697. x=x+width+10
  6698. ta=ta+1
  6699. end
  6700. if section.title then
  6701. ui.addTextArea(ta,"<p align='center'>"..section.title.."</p>",name,titlex,50,x-titlex,20,nil,nil,0,true)
  6702. ta=ta+1
  6703. end
  6704. x=x+20
  6705. end
  6706. for i=ta,50 do
  6707. ui.removeTextArea(i,name)
  6708. end
  6709. end
  6710. }
  6711.  
  6712.  
  6713. --[[ src/segments/map-modes/all-shaman.lua ]]--
  6714.  
  6715. _S.mapMode_all_shaman = {
  6716. disabled=true,
  6717. callbacks={
  6718. newGame=function()
  6719. for n,p in pairs(tfm.get.room.playerList) do
  6720. tfm.exec.setShaman(n)
  6721. end
  6722. end,
  6723. roundEnd=function()
  6724. for n,p in pairs(tfm.get.room.playerList) do
  6725. if p.isShaman then
  6726. tfm.exec.setPlayerScore(n,0,true)
  6727. end
  6728. end
  6729. end,
  6730. playerDied=function(player)
  6731. if alivePlayers()<=2 and currentTime<20000 then
  6732. tfm.exec.setGameTime(5)
  6733. end
  6734. end
  6735. }
  6736. }
  6737.  
  6738.  
  6739.  
  6740. --[[ src/segments/map-modes/bootcamp.lua ]]--
  6741.  
  6742. _S.mapMode_bootcamp = {
  6743. disabled=true,
  6744. ticks=0,
  6745. callbacks={
  6746. newGame=function()
  6747. _S.mapMode_bootcamp.ticks=0
  6748. tfm.exec.setGameTime(999999)
  6749. end,
  6750. eventLoop=function(time,remaining)
  6751. _S.mapMode_bootcamp.ticks=_S.mapMode_bootcamp.ticks+1
  6752. if _S.mapMode_bootcamp.ticks==10 then
  6753. for n,p in pairs(tfm.get.room.playerList) do
  6754. if p.isDead then
  6755. tfm.exec.respawnPlayer(n)
  6756. end
  6757. end
  6758. end
  6759. end,
  6760. playerWon=function(player)
  6761. tfm.exec.setPlayerScore(player.name,10,true)
  6762. end,
  6763. playerDied=function(player)
  6764. tfm.exec.setPlayerScore(player.name,-1,true)
  6765. end
  6766. }
  6767. }
  6768.  
  6769.  
  6770.  
  6771. --[[ src/segments/map-modes/dual-shaman.lua ]]--
  6772.  
  6773. _S.mapMode_dual_shaman = {
  6774. disabled=true,
  6775. callbacks={
  6776. newGame=function()
  6777. _S.mapMode_normal.callbacks.newGame()
  6778. local scores=sortScores()
  6779. tfm.exec.setShaman(scores[1].name)
  6780. tfm.exec.setShaman(scores[2].name)
  6781. end,
  6782. roundEnd=function()
  6783. for n,p in pairs(tfm.get.room.playerList) do
  6784. if p.isShaman then
  6785. tfm.exec.setPlayerScore(n,0)
  6786. end
  6787. end
  6788. end,
  6789. playerDied=function(player)
  6790. _S.mapMode_normal.callbacks.playerDied(player)
  6791. end,
  6792. playerWon=function(player)
  6793. _S.mapMode_normal.callbacks.playerWom(player)
  6794. end,
  6795. }
  6796. }
  6797.  
  6798.  
  6799.  
  6800. --[[ src/segments/map-modes/normal.lua ]]--
  6801.  
  6802. _S.mapMode_normal = {
  6803. disabled=true,
  6804. playersWon=0,
  6805. endCondition=function()
  6806. tfm.exec.setPlayerScore(player.name,-1,true)
  6807. if (tfm.get.room.playerList[player.name].isShaman or playersAlive()==2) and currentTime20000 then
  6808. tfm.exec.setGameTime(20)
  6809. elseif playersAlive()==1 and currentTime20000 then
  6810. tfm.exec.setGameTime(20)
  6811. elseif playersAlive()==0 and currentTime5000 then
  6812. tfm.exec.setGameTime(5)
  6813. end
  6814. end,
  6815. callbacks={
  6816. newGame=function()
  6817. _S.mapMode_normal.playersWon=0
  6818. end,
  6819. playerDied=function(player)
  6820. tfm.exec.setPlayerScore(player.name,1,true)
  6821. _S.mapMode_normal.endCondition()
  6822. end,
  6823. playerWon=function(player)
  6824. if _S.mapMode_normal.playersWon==0 then
  6825. tfm.exec.setPlayerScore(player.name,16,true)
  6826. elseif _S.mapMode_normal.playersWon==1 then
  6827. tfm.exec.setPlayerScore(player.name,14,true)
  6828. elseif _S.mapMode_normal.playersWon==2 then
  6829. tfm.exec.setPlayerScore(player.name,12,true)
  6830. else
  6831. tfm.exec.setPlayerScore(player.name,10,true)
  6832. end
  6833. _S.mapMode_normal.playersWon=_S.mapMode_normal.playersWon+1
  6834. _S.mapMode_normal.endCondition()
  6835. end,
  6836. }
  6837. }
  6838.  
  6839.  
  6840. --[[ src/segments/map-modes/racing.lua ]]--
  6841.  
  6842. _S.mapMode_racing = {
  6843. disabled=true,
  6844. callbacks={
  6845. newGame=function()
  6846. tfm.exec.setGameTime(60)
  6847. end
  6848. }
  6849. }
  6850.  
  6851.  
  6852. --[[ src/segments/map-modes/shaman.lua ]]--
  6853.  
  6854. _S.mapMode_shaman = {
  6855. disabled=true,
  6856. callbacks={
  6857. newGame=function()
  6858. _S.mapMode_normal.callbacks.newGame()
  6859. local scores=sortScores()
  6860. tfm.exec.setShaman(scores[1].name)
  6861. end,
  6862. roundEnd=function()
  6863. for n,p in pairs(tfm.get.room.playerList) do
  6864. if p.isShaman then
  6865. tfm.exec.setPlayerScore(n,0)
  6866. end
  6867. end
  6868. end,
  6869. playerDied=function(player)
  6870. _S.mapMode_normal.callbacks.playerDied(player)
  6871. end,
  6872. playerWon=function(player)
  6873. _S.mapMode_normal.callbacks.playerWom(player)
  6874. end,
  6875. }
  6876. }
  6877.  
  6878.  
  6879.  
  6880. --[[ src/segments/map-modes/survivor.lua ]]--
  6881.  
  6882. _S.mapMode_survivor = {
  6883. disabled=true,
  6884. endCondition=function()
  6885. local alive=false
  6886. for n,p in pairs(tfm.get.room.playerList) do
  6887. if not p.isDead and not p.isShaman then
  6888. alive=true
  6889. break
  6890. end
  6891. end
  6892. if not alive then
  6893. tfm.exec.setGameTime(5)
  6894. end
  6895. end,
  6896. callbacks={
  6897. roundEnd=function()
  6898. for n,p in pairs(tfm.get.room.playerList) do
  6899. if not p.isDead and not p.isShaman then
  6900. tfm.exec.setPlayerScore(n,10,true)
  6901. end
  6902. end
  6903. end,
  6904. playerDied=function(player)
  6905. tfm.exec.setPlayerScore(n,1,true)
  6906. _S.mapMode_survivor.endCondition()
  6907. end,
  6908. }
  6909. }
  6910.  
  6911.  
  6912.  
  6913. --[[ src/segments/map-modes/tribe.lua ]]--
  6914.  
  6915. _S.mapMode_tribe = {
  6916. disabled=true,
  6917. callbacks={
  6918. newGame=function()
  6919. tfm.exec.setGameTime(999999)
  6920. end,
  6921. playerDied=function(player)
  6922. tfm.exec.respawnPlayer(player.name)
  6923. end
  6924. }
  6925. }
  6926.  
  6927.  
  6928.  
  6929. --[[ src/segments/map-modes/vampire.lua ]]--
  6930.  
  6931. _S.mapMode_vampire = {
  6932. disabled=true,
  6933. ticks=0,
  6934. endCondition=function()
  6935. local alive=false
  6936. for n,p in pairs(tfm.get.room.playerList) do
  6937. if not p.isDead and not p.isVampire then
  6938. alive=true
  6939. break
  6940. end
  6941. end
  6942. if not alive then
  6943. tfm.exec.setGameTime(5)
  6944. end
  6945. end,
  6946. callbacks={
  6947. newGame=function()
  6948. tfm.exec.setGameTime(120)
  6949. end,
  6950. eventLoop=function(time,remaining)
  6951. _S.mapMode_vampire.ticks=_S.mapMode_vampire.ticks+1
  6952. if _S.mapMode_vampire.ticks==30 then
  6953. local tbl={}
  6954. for n,p in pairs(tfm.get.room.playerList) do
  6955. if not p.isDead then
  6956. table.insert(tbl,n)
  6957. end
  6958. end
  6959. tfm.exec.setVampirePlayer(tbl[math.random(#tbl)])
  6960. end
  6961. end,
  6962. roundEnd=function()
  6963. for n,p in pairs(tfm.get.room.playerList) do
  6964. if not p.isDead and not p.isVampire then
  6965. tfm.exec.setPlayerScore(n,10,true)
  6966. end
  6967. end
  6968. end,
  6969. playerDied=function(player)
  6970. tfm.exec.setPlayerScore(n,1,true)
  6971. _S.mapMode_vampire.endCondition()
  6972. end,
  6973. playerVampire=function(player)
  6974. _S.mapMode_vampire.endCondition()
  6975. end
  6976. }
  6977. }
  6978.  
  6979.  
  6980.  
  6981. --[[ src/after.lua ]]--
  6982.  
  6983. -- Script to provision the module and initialise necessary methods
  6984.  
  6985. bindChatCommands()
  6986.  
  6987. for name,player in pairs(tfm.get.room.playerList) do
  6988. eventNewPlayer(name)
  6989. end
  6990.  
  6991. selectMap()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement