Advertisement
Guest User

Untitled

a guest
Jan 17th, 2019
557
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --Creator: Bolodefchoco
  2. --Made in: 06/02/2017
  3. --Last update: 14/07/2017
  4.  
  5. --[[ Module ]]--
  6. local module = {
  7. _VERSION = "3.6",
  8. _NAME = "grounds",
  9. _STATUS = "semi-official",
  10. _AUTHOR = "Bolodefchoco",
  11. _LICENSE = [[
  12. MIT LICENSE
  13.  
  14. Copyright (c) 2017 @Transformice + @Bolodefchoco
  15.  
  16. Permission is hereby granted, free of charge, to any person obtaining
  17. a copy of this software and associated documentation files (the
  18. "Software"), to deal in the Software without restriction, including
  19. without limitation the rights to use, copy, modify, merge, and to
  20. permit persons to whom the Software is furnished to do so, subject to
  21. the following conditions:
  22.  
  23. The above copyright notice and this permission notice shall be included
  24. in all copies or substantial portions of the Software.
  25.  
  26. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  27. OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF FITNESS FOR
  28. A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  29. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  30. CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  31. TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  32. SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  33. ]],
  34. _FREEACCESS = { -- Verified players
  35. -- 3 : Commands + Room admin + Debug
  36. Bolodefchoco = 3,
  37. -- 2 : Commands
  38. Bodykudo = 2,
  39. Error_404 = 2,
  40. Jordynl = 2,
  41. Laagaadoo = 2,
  42. Sebafrancuz = 2,
  43. Tocutoeltuco = 2,
  44. -- 1 : Some commands
  45. Artinoe = 1,
  46. Bapereira = 1,
  47. Barberserk = 1,
  48. Byontr = 1,
  49. Claumiau = 1,
  50. Drescen = 1,
  51. Ekull = 1,
  52. Elvismouse = 1,
  53. Grastfetry = 1,
  54. Mcqv = 1,
  55. Mescouleur = 1,
  56. Mquk = 1,
  57. Reshman = 1,
  58. Rikkeshang = 1,
  59. Ruamorangos = 1,
  60. Sammynya = 1,
  61. },
  62. }
  63.  
  64. --[[ Optimization ]]--
  65. --[[ String ]]--
  66. local stringlen,stringfind,stringgmatch,stringbyte,stringdump,stringreverse,stringupper,stringformat,stringrep,stringlower,stringsub,stringgsub,stringmatch,stringchar = string.len,string.find,string.gmatch,string.byte,string.dump,string.reverse,string.upper,string.format,string.rep,string.lower,string.sub,string.gsub,string.match,string.char
  67. --[[ Math ]]--
  68. local mathdeg,mathfmod,mathrandom,mathasin,mathmax,mathmodf,mathfloor,mathcosh,mathldexp,mathatan2,mathpow,mathrandomseed,mathfrexp,mathabs,mathtanh,mathacos,mathlog,mathtan,mathmin,mathceil,mathsinh,mathsqrt,mathhuge,mathrad,mathsin,mathexp,mathcos,mathatan,mathpi = math.deg,math.fmod,math.random,math.asin,math.max,math.modf,math.floor,math.cosh,math.ldexp,math.atan2,math.pow,math.randomseed,math.frexp,math.abs,math.tanh,math.acos,math.log,math.tan,math.min,math.ceil,math.sinh,math.sqrt,math.huge,math.rad,math.sin,math.exp,math.cos,math.atan,math.pi
  69. --[[ Table ]]--
  70. local tablepack,tableforeachi,tableforeach,tableremove,tableinsert,tableunpack,tableconcat,tablesort = table.pack,table.foreachi,table.foreach,table.remove,table.insert,table.unpack,table.concat,table.sort
  71.  
  72. --[[ API ]]--
  73. -- Timers
  74. system.newGameTimer = 0
  75.  
  76. -- Control
  77. system.officialMode = {"",""}
  78. system.setAdmins = function()
  79. local out = {}
  80. for k,v in next,module._FREEACCESS do
  81. if v > 2 then
  82. out[k] = true
  83. end
  84. end
  85. return out
  86. end
  87.  
  88. -- Improvements
  89. tableconcat = function(list,sep,f,i,j)
  90. local txt = ""
  91. sep = sep or ""
  92. i,j = i or 1,j or #list
  93. for k,v in next,list do
  94. if type(k) ~= "number" and true or (k >= i and k <= j) then
  95. txt = txt .. (f and f(k,v) or v) .. sep
  96. end
  97. end
  98. return stringsub(txt,1,-1-#sep)
  99. end
  100. do
  101. local newGame = tfm.exec.newGame
  102. tfm.exec.newGame = function(code)
  103. if os.time() > system.newGameTimer then
  104. system.newGameTimer = os.time() + 6000
  105. newGame(code)
  106. return true
  107. end
  108. return false
  109. end
  110.  
  111. local addImage = tfm.exec.addImage
  112. local removeImage = tfm.exec.removeImage
  113. tfm.exec.addImage = function(...)
  114. local id = addImage(...)
  115. if id then
  116. system.objects.image[id] = true
  117. end
  118. return id
  119. end
  120. tfm.exec.removeImage = function(id)
  121. removeImage(id)
  122. if system.objects.image[id] then
  123. system.objects.image[id] = nil
  124. end
  125. end
  126.  
  127. local addTextArea = ui.addTextArea
  128. ui.addTextArea = function(id,...)
  129. addTextArea(id,...)
  130. if not system.objects.textarea[id] then
  131. system.objects.textarea[id] = true
  132. end
  133. end
  134.  
  135. local chatMessage = tfm.exec.chatMessage
  136. tfm.exec.chatMessage = function(txt,n)
  137. if #txt > 1000 then
  138. local total = 0
  139. while #txt > total do
  140. chatMessage(stringsub(txt,total,total + 1000),n)
  141. total = total + 1001
  142. end
  143. else
  144. chatMessage(txt,n)
  145. end
  146. end
  147.  
  148. local loadPlayerData = system.loadPlayerData
  149. system.loadPlayerData = function(n)
  150. if module._STATUS == "official" then
  151. return loadPlayerData(n)
  152. else
  153. if _G["eventPlayerDataLoaded"] then
  154. eventPlayerDataLoaded(n,"")
  155. end
  156. return true
  157. end
  158. end
  159.  
  160. local savePlayerData = system.savePlayerData
  161. system.savePlayerData = function(n,data)
  162. if module._STATUS == "official" then
  163. savePlayerData(n,data)
  164. return true
  165. else
  166. return false
  167. end
  168. end
  169. end
  170.  
  171. -- Room
  172. system.isRoom = stringbyte(tfm.get.room.name,2) ~= 3
  173. system.roomAdmins = system.setAdmins()
  174. system.miscAttrib = 0
  175. system.roomNumber,system.roomAttributes = (function()
  176. if system.isRoom then
  177. local number,attribute = stringmatch(tfm.get.room.name,"%*?#"..module._NAME.."(%d+)(.*)")
  178. return tonumber(number) or "",attribute or ""
  179. else
  180. return "",""
  181. end
  182. end)()
  183.  
  184. -- Player
  185. system.isPlayer = function(n)
  186. --[[
  187. The player must not be a souris;
  188. The player must have played Transformice for at least 5 days
  189. ]]
  190. return tfm.get.room.playerList[n] and stringsub(n,1,1) ~= "*" and tfm.get.room.playerList[n].registrationDate and (os.time() - (tfm.get.room.playerList[n].registrationDate or 0) >= 432e6) or false
  191. end
  192. system.players = function(alivePlayers)
  193. local alive,total = 0,0
  194. if alivePlayers then
  195. alive = {}
  196. end
  197. for k,v in next,tfm.get.room.playerList do
  198. if system.isPlayer(k) then
  199. if not v.isDead and not v.isVampire then
  200. if alivePlayers then
  201. alive[#alive + 1] = k
  202. else
  203. alive = alive + 1
  204. end
  205. end
  206. total = total + 1
  207. end
  208. end
  209. if alivePlayers then
  210. return alive
  211. else
  212. return alive,total
  213. end
  214. end
  215.  
  216. -- System
  217. currentTime,leftTime = 0,0
  218. system.loadTable = function(s)
  219. -- "a.b.c.1" returns a[b][c][1]
  220. local list
  221. for tbl in stringgmatch(s,"[^%.]+") do
  222. tbl = tonumber(tbl) and tonumber(tbl) or tbl
  223. list = (list and list[tbl] or _G[tbl])
  224. end
  225. return list
  226. end
  227. system.getTranslation = function(index,n)
  228. local t = stringformat("mode.%s.translations.%s.%s",system.gameMode,(n and mode[system.gameMode].info[n].langue or mode[system.gameMode].langue),index)
  229. return system.loadTable(t) or system.loadTable(stringgsub(t,"translations%..-%.",function() return "translations.en." end))
  230. end
  231. system.looping = function(f,tick)
  232. local s = 1000 / tick
  233. local t = {}
  234. for timer = 0,1000 - s,s do
  235. system.newTimer(function()
  236. t[#t+1] = system.newTimer(f,1000,true)
  237. end,1000 + timer,false)
  238. end
  239. return t
  240. end
  241.  
  242. -- Math
  243. mathisNegative = function(x,iN,iP)
  244. return (x<0 and (iN or x) or (iP or x))
  245. end
  246. mathpercent = function(x,y,v)
  247. v = (v or 100)
  248. local m = x/y * v
  249. return mathmin(m,v)
  250. end
  251. mathpythag = function(x1,y1,x2,y2,range)
  252. return (x1-x2)^2 + (y1-y2)^2 <= (range^2)
  253. end
  254. mathsetLim = function(value,min,max)
  255. return mathmax(min,mathmin(max,value))
  256. end
  257.  
  258. -- String
  259. stringsplit = function(value,pattern,f)
  260. local out = {}
  261. for v in stringgmatch(value,pattern) do
  262. out[#out + 1] = (f and f(v) or v)
  263. end
  264. return out
  265. end
  266. stringnick = function(player)
  267. return stringgsub(stringlower(player),"%a",stringupper,1)
  268. end
  269.  
  270. -- Table
  271. tablefind = function(list,value,index,f)
  272. for k,v in next,list do
  273. local i = (type(v) == "table" and index and v[index] or v)
  274. if (f and f(i) or i) == value then
  275. return true,k
  276. end
  277. end
  278. return false,0
  279. end
  280. tableturnTable = function(x)
  281. return (type(x)=="table" and x or {x})
  282. end
  283. tablerandom = function(t)
  284. return (type(t) == "table" and t[mathrandom(#t)] or mathrandom())
  285. end
  286. tableshuffle = function(t)
  287. local randomized = {}
  288. for v = 1,#t do
  289. end
  290. return randomized
  291. end
  292.  
  293. -- Others
  294. deactivateAccents=function(str)
  295. local letters = {a = {"á","â","à","å","ã","ä"},e = {"é","ê","è","ë"},i = {"í","î","ì","ï"},o = {"ó","ô","ò","õ","ö"},u = {"ú","û","ù","ü"}}
  296. for k,v in next,letters do
  297. for i = 1,#v do
  298. str = stringgsub(str,v[i],tostring(k))
  299. end
  300. end
  301. return str
  302. end
  303. normalizeTime = function(time)
  304. return mathfloor(time) + ((time - mathfloor(time)) >= .5 and .5 or 0)
  305. end
  306. disableChatCommand = function(command)
  307. system.disableChatCommandDisplay(command,true)
  308. system.disableChatCommandDisplay(stringlower(command),true)
  309. system.disableChatCommandDisplay(stringupper(command),true)
  310. end
  311. normalizeTranslation = function()
  312. local t = mode[system.gameMode].translations
  313.  
  314. for k,v in next,t.en do
  315. for i,j in next,t do
  316. if i ~= "en" then
  317. if not j[k] then
  318. j[k] = v
  319. end
  320. end
  321. end
  322. end
  323. end
  324.  
  325. -- XML Dealer
  326. xml = {}
  327. xml.parse = function(currentXml)
  328. currentXml = stringmatch(currentXml,"<P (.-)/>") or ""
  329. local out = {}
  330. for tag,_,value in stringgmatch(currentXml,"([%-%w]+)=([\"'])(.-)%2") do
  331. out[tag] = value
  332. end
  333. return out
  334. end
  335. xml.attribFunc = function(currentXml,funcs)
  336. local attributes = xml.parse(currentXml)
  337. for k,v in next,funcs do
  338. if attributes[v.attribute] then
  339. v.func(attributes[v.attribute])
  340. end
  341. end
  342. end
  343. xml.addAttrib = function(currentXml,out,launch)
  344. local parameters = stringmatch(currentXml,"<P (.-)/>") or ""
  345. for k,v in next,out do
  346. if not stringfind(parameters,v.tag) then
  347. currentXml = stringgsub(currentXml,"<P (.-)/>",function(attribs)
  348. return stringformat("<P %s=\"%s\" %s/>",v.tag,v.value,attribs)
  349. end)
  350. end
  351. end
  352. if launch then
  353. tfm.exec.newGame(currentXml)
  354. else
  355. return currentXml
  356. end
  357. end
  358. xml.getCoordinates = function(s)
  359. if stringfind(s,";") then
  360. local x,y
  361. local axis,value = stringmatch(s,"(%a);(%d+)")
  362. value = tonumber(value)
  363. if value then
  364. if axis == "x" then x = value else y = value end
  365. end
  366. return x or 0,y or 0
  367. else
  368. local pos = {}
  369. for x,y in stringgmatch(s,"(%d+) ?, ?(%d+)") do
  370. pos[#pos+1] = {x = x,y = y}
  371. end
  372. return pos
  373. end
  374. end
  375.  
  376. --[[ Game Mode System ]]--
  377. system.normalizedModeName = function(name,back)
  378. if back then
  379. name = stringgsub(name,"%+","P") -- Test+ = TestP
  380. else
  381. name = stringgsub(name,"P$","+") -- TestP = Test+
  382. end
  383. return name
  384. end
  385.  
  386. system.submodes = {}
  387.  
  388. system.gameMode = module._NAME
  389. system.modeChanged = os.time() + 10e3
  390.  
  391. system.getGameMode = function(value,notFirst)
  392. local found,submode = tablefind(system.submodes,stringlower(value),nil,stringlower)
  393. if found then
  394. system.gameMode = system.normalizedModeName(system.submodes[submode],true)
  395.  
  396. if notFirst then
  397. eventModeChanged()
  398. end
  399.  
  400. system.modeChanged = os.time() + 10e3
  401. end
  402. return found
  403. end
  404.  
  405. --[[ Modes ]]--
  406. mode = setmetatable({},{
  407. __newindex = function(list,key,value)
  408. rawset(list,key,value)
  409. system.submodes[#system.submodes+1] = system.normalizedModeName(key,false)
  410. end
  411. })
  412.  
  413. --[[ Grounds ]]--
  414. mode.grounds = {
  415. -- Translations
  416. translations = {
  417. en = {
  418. -- Data
  419. grounds = {
  420. -- Ground, Description
  421. [0] = {"Wood","?","?"},
  422. [1] = {"Ice","Increases your speed by pressing spacebar","Increases the speed in <BL>%s%%</BL>"},
  423. [2] = {"Trampoline","?","?"},
  424. [3] = {"Lava","Teleports you to the last Z indexed ground","?"},
  425. [4] = {"Chocolate","?","?"},
  426. [5] = {"Earth","?","?"},
  427. [6] = {"Grass","?","?"},
  428. [7] = {"Sand","Creates a sand storm","Decreases the storm in <BL>%s%%</BL>"},
  429. [8] = {"Cloud","Enables you to fly by pressing spacebar","Increases the fly in <BL>%s%%</BL>"},
  430. [9] = {"Water","Drowns you","Drowns you <BL>%s%%</BL> slower"},
  431. [10] = {"Stone","Creates a block of stone by pressing spacebar","Increases the block size in <BL>%s%%</BL>"},
  432. [11] = {"Snow","Shoots snowballs by pressing spacebar","Increases the snowball speed in <BL>%s%%</BL>"},
  433. [12] = {"Rectangle","Each color has its own function","?",{
  434. ["C90909"] = "Kills you",
  435. ["18C92B"] = "Revives all the enemies",
  436. ["555D77"] = "Respawning Checkpoint",
  437. }},
  438. [13] = {"Circle","Each color has its own function","?"},
  439. [14] = {"Invisible","?","?"},
  440. [15] = {"Spiderweb","Teleports you to the spawn point","?"},
  441. },
  442. categories = {
  443. [1] = "Often long maps that, in most of the cases, the players must pass the same obstacles more than once.",
  444. [2] = "Usually long maps with dodgeable spiderwebs or lavas, sometimes using invisible waters to simule a fly.",
  445. [3] = "Harder maps that requires multiple skills to be completed.",
  446. [4] = "Maps that has as main obstacle the water drowning.",
  447. [5] = "Maps based mainly on lava teleports.",
  448. [6] = "Maps that requires a new skill, with mechanisms or something that makes you think before act.",
  449. [7] = "Maps based on speed and agility, built mostly with ice grounds.",
  450. [8] = "Maps based on snowball mechanisms/technics.",
  451. [9] = "Maps with different gameplays that doesn't fit any other category, also locates the <i>vanilla maps</i>.",
  452. [10] = "Soloable (mostly) maps, but with faster paths when the players work together.",
  453. [11] = "Maps with vampires.",
  454. [12] = "Houses without gameplay, only a place for noobs.",
  455. },
  456.  
  457. -- Init
  458. welcome = "Welcome to #%s! Can you be the fastest mouse using the ground effects? Try it!\n<PS>Press H for more info!",
  459. developer = "Developed by %s",
  460.  
  461. -- Shop
  462. shop = {
  463. coin = "Coins",
  464. power = "Ground power",
  465. upgrade = "Upgrade",
  466. price = "Upgrade price",
  467. close = "Close",
  468. },
  469. bought = "You just spent %s coins for the ground %s!",
  470. cantbuy = "You haven't coins enough in order to buy this upgrade! :(",
  471.  
  472. -- Profile
  473. profile = "Leaderboard : %s\n\n<N>Rounds : %s\n<N>Podiums : %s\n\n<N>Deaths : %s\n\n<N>Shop Coins : %s",
  474.  
  475. -- Gameplay
  476. gotcoin = "You just got %s coins! :D",
  477. zombie = "Now you are a zombie!",
  478. countstats = {
  479. mice = "At least 5 mice are needed to stats count",
  480. tribe = "Stats do not count in tribe houses"
  481. },
  482.  
  483. -- New map
  484. powersenabled = "The ground powers were enabled! Good luck!",
  485. tribehouse = "This is a House place. No stats, no gameplay. Enjoy with your friends",
  486.  
  487. -- Language
  488. language = "Current language : <J>%s",
  489.  
  490. -- Settings
  491. password = {
  492. on = "New password : %s",
  493. off = "Password disabled!"
  494. },
  495.  
  496. -- Commands
  497. commands = {
  498. shop = "shop",
  499. profile = "profile",
  500. help = "help",
  501. langue = "langue",
  502. leaderboard = "leaderboard",
  503. info = "info",
  504. pw = "password",
  505. mapinfo = "mapinfo",
  506. },
  507.  
  508. -- Menu
  509. menu = {
  510. [1] = {"%s","\tYour aim in this minigame is to collect the cheese the faster you can, using the effects each ground offers."},
  511. [2] = {"Ground effects","Click in the ground's name to read more.\n\n%s"},
  512. [3] = {"Commands",{
  513. [1] = {"\t<J>» User</J>\n",{
  514. [1] = "<VP>!%s</VP> <PS>playerName</PS> <R>or</R> <VP>Key P</VP> - Opens the profile!",
  515. [2] = "<VP>!%s</VP> <R>or</R> <VP>Key O</VP> - Opens the shop!",
  516. [3] = "<VP>!%s</VP> - Changes the language!",
  517. }},
  518. [2] = {"\n\t<J>» Others</J>\n",{
  519. [1] = "<VP>!%s</VP> <R>or</R> <VP>Key H</VP> - Opens the help menu!",
  520. [2] = "<VP>!%s</VP> - Opens the leaderboard!",
  521. [3] = "<VP>!%s</VP> - Opens the help according to the ground you are on!",
  522. [4] = "<VP>!%s</VP> - Displays the map info if it is in the rotation!",
  523. }},
  524. [3] = {"\n\t<J>» Room admin</J>\n",{
  525. [1] = "<VP>!%s</VP> <PS>password</PS> - Adds or removes a password in the room!",
  526. }},
  527. }},
  528. [4] = {"Maps","<J>Maps : %s\n\n\tAccess %s and send your map. Do not forget to read all the rules before!"},
  529. [5] = {"Thanks for","<R>%s <G>- <N>Developer\n%s <G>- <N>Translators\n%s <G>- <N>Map evaluators"},
  530. },
  531. max = "15a2df47d2e",
  532. },
  533. br = {
  534. grounds = {
  535. [0] = {"Madeira","?","?"},
  536. [1] = {"Gelo","Aumenta sua velocidade ao pressionar a barra de espaço","Aumenta a velocidade em <BL>%s%%</BL>"},
  537. [2] = {"Trampolim","?","?"},
  538. [3] = {"Lava","Teletransporta-o para o piso de Z anterior","?"},
  539. [4] = {"Chocolate","?","?"},
  540. [5] = {"Terra","?","?"},
  541. [6] = {"Grama","?","?"},
  542. [7] = {"Areia","Cria uma tempestade de areia","Diminui a tempestade em <BL>%s%%</BL>"},
  543. [8] = {"Nuvem","Permite o voo ao pressionar a barra de espaço","Aumenta o voo em <BL>%s%%</BL>"},
  544. [9] = {"Água","Afoga-o","Afoga-o <BL>%s%%</BL> mais devagar"},
  545. [10] = {"Pedra","Cria um bloco de pedra ao pressionar a barra de espaço","Aumenta o tamanho do bloco em <BL>%s%%</BL>"},
  546. [11] = {"Neve","Atira bolas de neve ao pressionar a barra de espaço","Aumenta a velocidade da bola de neve em <BL>%s%%</BL>"},
  547. [12] = {"Retângulo","Cada cor tem sua própria função","?",{
  548. ["C90909"] = "Mata-o",
  549. ["18C92B"] = "Revive todos os inimigos",
  550. ["555D77"] = "Checkpoint para reviver",
  551. }},
  552. [13] = {"Círculo","Cada cor tem sua própria função","?","?"},
  553. [14] = {"Invisível","?","?"},
  554. [15] = {"Teia de aranha","Teletransporta-o para o ponto de spawn","?"},
  555. },
  556. categories = {
  557. [1] = "Geralmente mapas longos que, na maioria dos casos, os jogadores devem passar pelo mesmo obstáculo mais de uma vez.",
  558. [2] = "Geralmente mapas grandes com teias de aranha ou lavas desviáveis, às vezes usando águas invisíveis para simular voo.",
  559. [3] = "Mapas mais difíceis que requem múltiplas habilidades para serem completados.",
  560. [4] = "Mapas que tem como obstáculo principal o afogamento na água.",
  561. [5] = "Mapas baseados principalmente em teleportes de lava.",
  562. [6] = "Mapas que requerem novas habilidades, com mecanismos ou algo que o faça pensar antes de agir.",
  563. [7] = "Mapas baseados em velocidade e agilidade, construídos em sua maioria por pisos de gelo.",
  564. [8] = "Mapas baseados em mecanismos/técnicas com bolas de neve.",
  565. [9] = "Mapas com gameplays diferentes que não se encaixam em nenhuma outra categoria, também dá espaço aos <i>mapas vanilla</i>.",
  566. [10] = "Mapas em que você pode completar sozinho (em maioria), mas com caminhos mais rápidos quando há trabalho em equipe entre os jogadores.",
  567. [11] = "Mapas com vampiros.",
  568. [12] = "Casas sem jogabilidade, apenas um lugar para noobs.",
  569. },
  570.  
  571. welcome = "Bem-vindo ao #%s! Você pode ser o rato mais rápido usando os efeitos dos pisos? Prove!\n<PS>Pressione H para mais informações!",
  572. developer = "Desenvolvido por %s",
  573.  
  574. shop = {
  575. coin = "Moedas",
  576. power = "Poder do piso",
  577. upgrade = "Melhorar",
  578. price = "Preço de aprimoramento",
  579. close = "Fechar",
  580. },
  581. bought = "Você acaba de gastar %s moedas pelo piso %s!",
  582. cantbuy = "Você não tem moedas suficientes para comprar esta atualização! :(",
  583.  
  584. profile = "Rank : %s\n\n<N>Partidas : %s\n<N>Pódios : %s\n\n<N>Mortes : %s\n\n<N>Moedas na loja : %s",
  585.  
  586. gotcoin = "Você acaba de conseguir %s moedas! :D",
  587. zombie = "Agora você é um zumbi!",
  588. countstats = {
  589. mice = "Ao menos 5 ratos são necessários para as estatísticas serem contabilizadas",
  590. tribe = "Estatísticas não são contabilizadas em cafofos de tribo"
  591. },
  592.  
  593. powersenabled = "Os poderes dos pisos foram ativados! Boa sorte!",
  594. tribehouse = "Este lugar é uma casa. Sem estatísticas, sem gameplay. Divirta-se com seus amigos",
  595.  
  596. language = "Idioma atual : <J>%s",
  597.  
  598. password = {
  599. on = "Nova senha : %s",
  600. off = "Senha desativada!"
  601. },
  602.  
  603. commands = {
  604. shop = "loja",
  605. profile = "perfil",
  606. help = "ajuda",
  607. langue = "idioma",
  608. leaderboard = "rank",
  609. info = "info",
  610. pw = "senha",
  611. },
  612.  
  613. menu = {
  614. [1] = {"%s","\tSeu objetivo neste mini-game é coletar o queijo o mais rápido possível, utilizando os efeitos que cada piso oferecer."},
  615. [2] = {"Efeitos dos pisos","Clique no nome do piso para ler mais.\n\n%s"},
  616. [3] = {"Comandos",{
  617. [1] = {"\t<J>» Usuário</J>\n",{
  618. [1] = "<VP>!%s</VP> <PS>nomeDoJogador</PS> <R>ou</R> <VP>Tecla P</VP> - Abre o perfil!",
  619. [2] = "<VP>!%s</VP> <R>ou</R> <VP>Tecla O</VP> - Abre a loja!",
  620. [3] = "<VP>!%s</VP> - Altera o idioma!",
  621. }},
  622. [2] = {"\n\t<J>» Outros</J>\n",{
  623. [1] = "<VP>!%s</VP> <R>ou</R> <VP>Tecla H</VP> - Abre o menu de ajuda!",
  624. [2] = "<VP>!%s</VP> - Abre o ranking!",
  625. [3] = "<VP>!%s</VP> - Abre a ajuda de acordo com o piso que você está pisando!",
  626. [4] = "<VP>!%s</VP> - Mostra as informações do mapa se estiver na rotação!",
  627. }},
  628. [3] = {"\n\t<J>» Administrador da sala</J>\n",{
  629. [1] = "<VP>!%s</VP> <PS>senha</PS> - Adiciona ou remove uma senha na sala!",
  630. }},
  631. }},
  632. [4] = {"Mapas","<J>Mapas : %s\n\n\tAcesse %s e envie seu mapa. Não se esqueça de ler todas as regras antes!"},
  633. [5] = {"Agradecimentos","<R>%s <G>- <N>Desenvolvedor\n%s <G>- <N>Tradutores\n%s <G>- <N>Avaliadores de mapa"},
  634. },
  635. max = "15a2df3e699",
  636. },
  637. es = {
  638. grounds = {
  639. [0] = {"Madera","?","?"},
  640. [1] = {"Hielo","Incrementa tu velocidad apretando espacio","Aumenta la velocidad en <BL>%s%%</BL>"},
  641. [2] = {"Trampolín","?","?"},
  642. [3] = {"Lava","Te teletransporta al suelo que tenga el último Z index","?"},
  643. [4] = {"Chocolate","?","?"},
  644. [5] = {"Tierra","?","?"},
  645. [6] = {"Hierba","?","?"},
  646. [7] = {"Arena","Crea una tormenta de arena","Disminuye la tormenta en <BL>%s%%</BL>"},
  647. [8] = {"Nube","Te permite volar presionando espacio","Aumenta el vuelo en <BL>%s%%</BL>"},
  648. [9] = {"Agua","Te ahogas","Te ahogas <BL>%s%%</BL> más lento"},
  649. [10] = {"Piedra","Crea un bloque de piedra presionando espacio","Aumenta el tamaño del bloque en <BL>%s%%</BL>"},
  650. [11] = {"Nieve","Dispara bolas de nieve presionando espacio","Aumenta la velocidad de la bola de nieve en <BL>%s%%</BL>"},
  651. [12] = {"Rectángulo","Cada color tiene su propia función","?",{
  652. ["C90909"] = "Te mata",
  653. ["18C92B"] = "Revive todos los enemigos",
  654. ["555D77"] = "Respawning Checkpoint", -- *
  655. }},
  656. [13] = {"Círculo","Cada color tiene su propia función","?"},
  657. [14] = {"Invisible","?","?"},
  658. [15] = {"Tela de araña","Te teletransporta al punto de aparición","?"},
  659. },
  660. categories = {
  661. [1] = "Mapas que, en la mayoría de los casos, los jugadores deben pasar obstaculos más de una vez.",
  662. [2] = "Usualmente mapas largos con telas de araña y lavas esquivables, algunas veces usando agua invisible para simular un vuelo.",
  663. [3] = "Mapas difíciles que necesitan una gran habilidad para completarlos.",
  664. [4] = "Mapas que tienen un obstáculo principal: el agua. ¡Te puedes ahogar!.",
  665. [5] = "Mapas basados principalmente en teletransportes de lava.",
  666. [6] = "Mapas que necesitan una nueva habilidad, con mecanismos o algo que te haga pensar antes de actuar.",
  667. [7] = "Mapas basados en la velocidad del jugador, construidos mayoritariamente con suelos de hielo.",
  668. [8] = "Mapas basados en mecanismos/técnicas con nieve.",
  669. [9] = "Mapas con un gameplay diferente que no entran en otra categoría, también localizados en los <i>mapas vanilla</i>.",
  670. [10] = "Mapas que (mayoritariamente) pueden ser completados solo, pero con patrones rápidos donde los jugadores necesitan trabajar juntos.",
  671. [11] = "Mapas con vampiros.",
  672. [12] = "Houses without gameplay, only a place for noobs",
  673. },
  674.  
  675. welcome = "Bienvenido a #%s! Podrás ser el más rápido usando los efectos de los suelos? Inténtalo!\n<PS>Presiona H para más información!",
  676. developer = "Programado por %s",
  677.  
  678. shop = {
  679. coin = "Monedas",
  680. power = "Potencia del suelo",
  681. upgrade = "Mejorar",
  682. price = "Precio de la mejora",
  683. close = "Cerrar",
  684. },
  685. bought = "Has gastado %s monedas para el suelo %s!",
  686. cantbuy = "No tienes las suficientes monedas para comprar esta mejora! :(",
  687.  
  688. profile = "Tabla de líderes : %s\n\n<N>Rondas : %s\n<N>Podios : %s\n\n<N>Muertes : %s\n\n<N>Monedas : %s",
  689.  
  690. gotcoin = "Has obtenido %s monedas! :D",
  691. zombie = "Ahora eres un Zombi!",
  692. countstats = {
  693. mice = "Por lo menos 5 ratones son necesarios para contar estadísticas",
  694. tribe = "Las estadísticas no cuentan en casas de tribu"
  695. },
  696.  
  697. powersenabled = "Los poderes de los suelos han sido activados! Buena suerte!",
  698. -- *
  699.  
  700. language = "Idioma actual : <J>%s",
  701.  
  702. password = {
  703. on = "Nueva contraseña : %s",
  704. off = "Contraseña desactivada!"
  705. },
  706.  
  707. commands = {
  708. shop = "tienda",
  709. profile = "perfil",
  710. help = "ayuda",
  711. langue = "idioma",
  712. leaderboard = "ranking",
  713. info = "info",
  714. pw = "contraseña",
  715. },
  716.  
  717. menu = {
  718. [1] = {"%s","\tTu objetivo en este juego es agarrar el queso lo más rápido que puedas, usando los efectos que cada suelo ofrece."},
  719. [2] = {"Efectos de suelo","Clickea en el nombre del suelo para leer más.\n\n%s"},
  720. [3] = {"Comandos",{
  721. [1] = {"\t<J>» Usuario</J>\n",{
  722. [1] = "<VP>!%s</VP> <PS>nombreDeUsuario</PS> <R>o</R> <VP>Tecla P</VP> - Abre el perfil!",
  723. [2] = "<VP>!%s</VP> <R>o</R> <VP>Tecla O</VP> - Abre la tienda!",
  724. [3] = "<VP>!%s</VP> - Cambia el idioma!\n",
  725. }},
  726. [2] = {"\t<J>» Otros</J>\n",{
  727. [1] = "<VP>!%s</VP> <R>o</R> <VP>Tecla H</VP> - Abre el menu de ayuda!",
  728. [2] = "<VP>!%s</VP> - Abre el ranking!",
  729. [3] = "<VP>!%s</VP> - Abre la guía del suelo en el que estás!",
  730. [4] = "<VP>!%s</VP> - Muestra la información del mapa si está en la rotación!",
  731. }},
  732. [3] = {"\n\t<J>» Admin de la sala</J>\n",{
  733. [1] = "<VP>!%s</VP> <PS>contraseña</PS> - Activa o desactiva la contraseña en la sala.",
  734. }},
  735. }},
  736. [4] = {"Mapas","<J>Mapas : %s\n\n\tEntra a %s y envía tu mapa. No olvides leer las reglas antes!"},
  737. [5] = {"Agradecimientos","<R>%s <G>- <N>Programador\n%s <G>- <N>Traductores\n%s <G>- <N>Evaluadores de mapas"},
  738. },
  739. max = "15a2df3e699",
  740. },
  741. fr = {
  742. grounds = {
  743. [0] = {"Bois","?","?"},
  744. [1] = {"Glace","Augmente votre vitesse en appuyant sur Espace","Augmente la vitesse de <BL>%s%%</BL>"},
  745. [2] = {"Trampoline","?","?"},
  746. [3] = {"Lave","Vous téléporte au sol avec le dernier indice Z","?"},
  747. [4] = {"Chocolat","?","?"},
  748. [5] = {"Terre","?","?"},
  749. [6] = {"Herbe","?","?"},
  750. [7] = {"Sable","Crée une tempête de sable","Diminue la tempête de <BL>%s%%</BL>"},
  751. [8] = {"Nuage","Vous donne la possibilité de voler en appuyant sur Espace","Augmente le vol de <BL>%s%%</BL>"},
  752. [9] = {"Eau","Vous noie","Vous noie <BL>%s%%</BL> plus lentement"},
  753. [10] = {"Pierre","Crée un bloc de pierre en appuyant sur Espace","Augmente la taille du bloc de <BL>%s%%</BL>"},
  754. [11] = {"Neige","Tire des boules de neige en appuyant sur Espace","Augmente la vitesse de la boule de neige de <BL>%s%%</BL>"},
  755. [12] = {"Rectangle","Chaque couleur a sa propre fonction","?",{
  756. ["C90909"] = "Te tue",
  757. ["18C92B"] = "Ressuscite tous les ennemis",
  758. ["555D77"] = "Respawning Checkpoint", -- *
  759. }},
  760. [13] = {"Cercle","Chaque couleur a sa propre fonction","?"},
  761. [14] = {"Invisible","?","?"},
  762. [15] = {"Toile d'araignée","Vous téléporte au point de spawn","?"},
  763. },
  764. -- *
  765.  
  766. welcome = "Bienvenue à #%s! Pouvez vous être la souris la plus rapide grâce aux effets des sols? Essayez!\n<PS>Appuyez sur H pour plus d'informations!",
  767. developer = "Développé par %s",
  768.  
  769. shop = {
  770. coin = "Pièces",
  771. power = "Force du sol",
  772. upgrade = "Améliorer",
  773. price = "Coût d'amélioration",
  774. close = "Fermer",
  775. },
  776. bought = "Vous venez de dépenser %s pièces pour le sol %s!",
  777. cantbuy = "Vous n'avez pas assez de pièces pour acheter cette amélioration! :(",
  778.  
  779. profile = "Leaderboard : %s\n\n<N>Parties : %s\n<N>Podiums : %s\n\n<N>Morts : %s\n\n<N>Shop Pièces : %s",
  780.  
  781. gotcoin = "Vous venez de recevoir %s pièces! :D",
  782. countstats = {
  783. mice = "Au moins 5 souris sont nécessaires pour que les statistiques comptent",
  784. tribe = "Les statistiques ne comptent pas en maison de tribu"
  785. },
  786. zombie = "Vous êtes maintenant un zombie!",
  787.  
  788. powersenabled = "Les pouvoirs des sols ont été activés! Bonne chance!",
  789. -- *
  790.  
  791. language = "Langage actuel : <J>%s",
  792.  
  793. password = {
  794. on = "Nouveau mot de passe : %s",
  795. off = "Mot de passe désactivé!"
  796. },
  797.  
  798. commands = {
  799. shop = "magasin",
  800. profile = "profil",
  801. help = "aide",
  802. langue = "langue",
  803. leaderboard = "leaderboard",
  804. info = "info",
  805. pw = "password",
  806. },
  807.  
  808. menu = {
  809. [1] = {"%s","\tVotre but dans ce minijeu est de collecter le fromage aussi vite que possible, en utilisant les effets des différents sols."},
  810. [2] = {"Effets du sol","Clique sur le nom du salon pour en lire plus.\n\n%s"},
  811. [3] = {"Commandes",{
  812. [1] = {"\t<J>» Joueur</J>\n",{
  813. [1] = "<VP>!%s</VP> <PS>playerName</PS> <R>ou</R> <VP>Touche P</VP> - Ouvre le profil !",
  814. [2] = "<VP>!%s</VP> <R>ou</R> <VP>Touche O</VP> - Ouvre le magasin !",
  815. [3] = "<VP>!%s</VP> - Change la langue !\n",
  816. }},
  817. [2] = {"\t<J>» Autres</J>\n",{
  818. [1] = "<VP>!%s</VP> <R>ou</R> <VP>Touche H</VP> - Ouvre le menu d'aide !",
  819. [2] = "<VP>!%s</VP> - Ouvre le leaderboard!",
  820. [3] = "<VP>!%s</VP> - Ouvre l'aide en fonction du sol sur lequel vous vous trouvez!",
  821. [4] = "<VP>!%s</VP> - Affiche les informations de la carte si elle est dans la rotation!"
  822. }},
  823. [3] = {"\n\t<J>» Place admin</J>\n",{
  824. [1] = "<VP>!%s</VP> <PS>mot de passe</PS> - Ajoute ou supprime un mot de passe dans la chambre.",
  825. }},
  826. }},
  827. [4] = {"Cartes","<J>Cartes : %s\n\n\tAccédez à %s et envoyez votre carte. N'oubliez pas de lire toutes les règles avant!"},
  828. [5] = {"Merci à","<R>%s <G>- <N>Développeur\n%s <G>- <N>Traducteurs\n%s <G>- <N>Evaluateurs de maps"},
  829. },
  830. -- *
  831. },
  832. pl = {
  833. grounds = {
  834. [0] = {"Drewno","?","?"},
  835. [1] = {"Lód","Zwiększa twoją szybkość, gdy klikasz spację","Zwiększa prędkość w <BL>%s%%</BL>"},
  836. [2] = {"Trampolina","?","?"},
  837. [3] = {"Lawa","Przenosi ciebie do ostatniego indexu Z","?"},
  838. [4] = {"Czekolada","?","?"},
  839. [5] = {"Ziemia","?","?"},
  840. [6] = {"Trawa","?","?"},
  841. [7] = {"Piasek","Tworzy burzę piaskową","Zmniejsza storm w <BL>%s%%</BL>"},
  842. [8] = {"Chmura","Pozwala tobie latać, gdy klikasz spację","Zwiększa latanie w <BL>%s%%</BL>"},
  843. [9] = {"Woda","Topi ciebie","Topi <BL>%s%%</BL> wolniej"},
  844. [10] = {"Kamień","Powoduje, że możesz stworzyć blok kamienia, wciskając spację","Zwiększa wielkość bloku w <BL>%s%%</BL>"},
  845. [11] = {"Śnieg","Powoduje, że możesz strzelić śnieżką, wciskając spację","Zwiększa prędkość śnieżki w <BL>%s%%</BL>"},
  846. [12] = {"Trójkąt","Każdy kolor ma swoją funkcję","?",{
  847. ["C90909"] = "Zabija ciebie",
  848. ["18C92B"] = "Ożywia wszystkich przeciwników",
  849. ["555D77"] = "Ponowne spawnowanie Checkpointów",
  850. }},
  851. [13] = {"Koło","Każdy kolor ma swoją funkcję","?"},
  852. [14] = {"Niewidzialność","?","?"},
  853. [15] = {"Pajęcza sieć","Przenosi ciebie do miejsca spawnu","?"},
  854. },
  855. categories = {
  856. [1] = "Często długie mapy, w większości przypadków, gracze muszą przejść takie same przeszkody.",
  857. [2] = "Zwyczajnie długie mapy z lawami i pajęczynami, czasami używana woda aby zasymulować latanie.",
  858. [3] = "Trudniejsze mapy, które wymagają większej ilości zdolności, aby zostały ukończone.",
  859. [4] = "Mapy, które jako główną mapę mają wodę, w której myszki się topią.",
  860. [5] = "Mapy bazowane głównie na teleportacji z lawy.",
  861. [6] = "Mapy, które wymagają nowej zdolności, z mechanizmem albo czymś co powoduje, że musisz myśleć zanim coś zrobisz.",
  862. [7] = "Mapy bazowane na szybkości i zwinności, budowane najczęsciej z gruntów lodu.",
  863. [8] = "Mapy bazowane na technikach/mechanikach śnieżnych kulek.",
  864. [9] = "Mapy z zupełnie inną rozgrywką niż inne kategorie, również znaduje się w <I>mapach vanilliowych</I>.",
  865. [10] = "Mapy (w większości) zdolne do przejścia samemu, ale szybciej się ją przechodzi gdy gracze pracują wspólnie.",
  866. [11] = "Mapy z wampirami.",
  867. [12] = "Chatki plemienne bez rozgrywki, są miejscem tylko dla noobków.",
  868. },
  869.  
  870. welcome = "Witaj w #%s! Możesz zostać najszybszą myszką, używając moce gruntów? Spróbuj!\n<PS>Wciśnij H, aby otrzymać więcej informacji!",
  871. developer = "Stworzone przez %s",
  872.  
  873. shop = {
  874. coin = "Kredyty",
  875. power = "Moc gruntu",
  876. upgrade = "Ulepsz",
  877. price = "Cena ulepszenia",
  878. close = "Zamknij",
  879. },
  880. bought = "Wydałeś %s monet na %s!",
  881. cantbuy = "Nie masz wystarczającej ilości monet, żeby zakupić to ulepszenie! :(",
  882.  
  883. profile = "Ranking : %s\n\n<N>Rund : %s\n<N>Podia : %s\n\n<N>Zgony : %s\n\n<N>Monety : %s",
  884.  
  885. gotcoin = "Masz %s monet! :D",
  886. zombie = "Zostałeś/-aś zombie!",
  887. countstats = {
  888. mice = "Przynajmniej 5 myszek jest potrzebnych aby statystyki były naliczane",
  889. tribe = "Statystyki nie są naliczane w chatkach plemiennych"
  890. },
  891.  
  892. powersenabled = "Moce gruntów są włączone! Powodzenia!",
  893. tribehouse = "To jest miejsce chatki plemiennej. Bez statystyk, bez rozgrywki. Ciesz się ze swoimi znajomymi.",
  894.  
  895. language = "Bieżący język : <J>%s",
  896.  
  897. password = {
  898. on = "Nowe hasło : %s",
  899. off = "Hasło wyłączone!"
  900. },
  901.  
  902. commands = {
  903. shop = "sklep",
  904. profile = "profil",
  905. help = "pomoc",
  906. langue = "język",
  907. leaderboard = "ranking",
  908. info = "informacje",
  909. pw = "hasło",
  910. },
  911.  
  912. menu = {
  913. [1] = {"%s","\tTwoim zadaniem w tej minigrze jest zbieranie serka najszybciej jak potrafisz, wykorzystując moce gruntów."},
  914. [2] = {"Moce gruntu","Kliknij w nazwę gruntu, żeby uzyskać więcej informacji.\n\n%s"},
  915. [3] = {"Komendy",{
  916. [1] = {"\t<J>» Użytkowe</J>\n",{
  917. [1] = "<VP>!%s</VP> <PS>nazwaGracza</PS> <R>albo</R> <VP>Klawisz P</VP> - Otwiera profil!",
  918. [2] = "<VP>!%s</VP> <R>albo</R> <VP>Klawisz O</VP> - Otwiera Sklep!",
  919. [3] = "<VP>!%s</VP> - Zmienia język!",
  920. }},
  921. [2] = {"\t<J>» Inne</J>\n",{
  922. [1] = "<VP>!%s</VP> <R>albo</R> <VP>Klawisz H</VP> - Otwiera pomoc!",
  923. [2] = "<VP>!%s</VP> - Otwiera ranking!",
  924. [3] = "<VP>!%s</VP> - Otwiera pomoc zależnie, na którym gruncie jesteś!",
  925. [4] = "<VP>!%s</VP> - Pokazuje informacje o mapie jeżeli jest w rotacji!",
  926. }},
  927. [3] = {"\n\t<J>» Pokój z adminem</J>\n",{
  928. [1] = "<VP>!%s</VP> <PS>hasło</PS> - Dodaje lub usuwa hasło w pokoju.",
  929. }},
  930. }},
  931. [4] = {"Mapy","<J>Mapy : %s\n\n\tStwórz %s i prześlij swoją mapę. Nie zapomnij, aby najpierw przeczytać zasady!"},
  932. [5] = {"Podziękowania","<R>%s <G>- <N>Twórca\n%s <G>- <N>Tłumacze\n%s <G>- <N>Testerzy map"},
  933. },
  934. max = "15a2df4de75",
  935. },
  936. hu = {
  937. grounds = {
  938. [0] = {"Fa","?","?"},
  939. [1] = {"Jég","Növeli a sebességedet, ha megnyomod a Szóközt","Növeli a sebességet <BL>%s%%</BL>-kal"},
  940. [2] = {"Trambulin","?","?"},
  941. [3] = {"Láva","Elteleportál téged a legutóbbi Z index talajhoz","?"},
  942. [4] = {"Csoki","?","?"},
  943. [5] = {"Föld","?","?"},
  944. [6] = {"Füves talaj","?","?"},
  945. [7] = {"Homok","Homokvihart hoz létre","Csökkenti a sebességet <BL>%s%%</BL>-kal"},
  946. [8] = {"Felhő","Lehetővé teszi számodra a repülést, ha megnyomod a Szóközt","Növeli a repülést <BL>%s%%</BL>-kal"},
  947. [9] = {"Víz","Megfullaszt téged","Megfullaszt <BL>%s%%</BL>-kal lassabban"},
  948. [10] = {"Kő","Egy kőtömböt hoz létre, ha megnyomod a Szóközt","Növeli a blokk méretét <BL>%s%%</BL>-kal"},
  949. [11] = {"Hó","Hógolyót lő, ha megnyomod a Szóközt","Növeli a hógolyó sebességét <BL>%s%%</BL>-kal"},
  950. [12] = {"Téglalap","Mindegyik színnek megvan a saját szerepe","?",{
  951. ["C90909"] = "Megöl téged",
  952. ["18C92B"] = "Újraéleszti az összes ellenséget",
  953. ["555D77"] = "Újraéledő Ellenőrzőpont",
  954. }},
  955. [13] = {"Kör","Mindegyik színnek megvan a saját szerepe","?"},
  956. [14] = {"Láthatatlan","?","?"},
  957. [15] = {"Pókháló","Elteleportál téged a kezdőpontra","?"},
  958. },
  959. -- *
  960.  
  961. welcome = "Üdvözöllek a #%s! Sikerül neked a leggyorsabb egérré válni a talajhatások használatával? Próbáld ki!\n<PS>Nyomd meg a H betűt több információért!",
  962. developer = "Fejlesztve %s által",
  963.  
  964. shop = {
  965. coin = "Pénzérmék",
  966. power = "Talaj ereje",
  967. upgrade = "Frissítés",
  968. price = "Ár frissítése",
  969. close = "Bezárás",
  970. },
  971. bought = "Te most költöttél el %s pénzt a talajra %s!",
  972. cantbuy = "Nincs elég pénzed ahhoz, hogy megvedd ezt a frissítést! :(",
  973.  
  974. profile = "Ranglista : %s\n\n<N>Körök : %s\n<N>Dobogók : %s\n\n<N>Halálozások : %s\n\n<N>Bolti pénz : %s",
  975.  
  976. gotcoin = "Te most szereztél %s pénzt! :D",
  977. zombie = "Most egy zombi vagy!",
  978. countstats = {
  979. mice = "Legalább 5 egérnek kell lennie, hogy statisztikát lehessen számolni",
  980. tribe = "A statisztika nem számít a törzsházakban"
  981. },
  982.  
  983. powersenabled = "A talajhatások engedélyezve lettek! Sok szerencsét!",
  984. -- *
  985.  
  986. language = "Jelenlegi nyelv : <J>%s",
  987.  
  988. password = {
  989. on = "Új jelszó : %s",
  990. off = "Jelszó letiltva!"
  991. },
  992.  
  993. commands = {
  994. shop = "bolt",
  995. profile = "profil",
  996. help = "súgó",
  997. langue = "nyelv",
  998. leaderboard = "ranglistát",
  999. info = "infó",
  1000. pw = "jelszó",
  1001. },
  1002.  
  1003. menu = {
  1004. [1] = {"%s","\tA te feladatod ebben a minijátékban az, hogy a lehető leggyorsabban összegyűjtsd a sajtot a talajhatások használatával."},
  1005. [2] = {"Talajhatások","Kattints a talaj nevére, hogy több mindent megtudhass.\n\n%s"},
  1006. [3] = {"Parancsok",{
  1007. [1] = {"\t<J>» Felhasználó</J>\n",{
  1008. [1] = "<VP>!%s</VP> <PS>játékosNeve</PS> <R>vagy</R> <VP>P billenytű</VP> - Megnyitja a profilt!",
  1009. [2] = "<VP>!%s</VP> <R>vagy</R> <VP>O billentyű</VP> - Megnyitja a boltot!",
  1010. [3] = "<VP>!%s</VP> - Megváltoztatja a nyelvet!\n",
  1011. }},
  1012. [2] = {"\t<J>» Egyebek</J>\n",{
  1013. [1] = "<VP>!%s</VP> <R>vagy</R> <VP>H billentyű</VP> - Megnyitja a Súgó menüpontot!",
  1014. [2] = "<VP>!%s</VP> - Megnyitja a ranglistát!",
  1015. [3] = "<VP>!%s</VP> - Megnyitja a Súgót aszerint, amelyik talajon állsz!",
  1016. [4] = "<VP>!%s</VP> - Displays the map info if it is in the rotation!",
  1017. }},
  1018. [3] = {"\n\t<J>» Szoba admin</J>\n",{
  1019. [1] = "<VP>!%s</VP> <PS>jelszó</PS> - Bekapcsolja vagy kikapcsolja a jelszót a szobában!",
  1020. }},
  1021. }},
  1022. [4] = {"Pályák","<J>Pályák : %s\n\n\tEngedélyezd a %s és küldd be a pályádat. Előtte ne felejtsd el elolvasni az összes szabály!"},
  1023. [5] = {"Köszönet","<R>%s - Nak <G>- <N>Fejlesztő\n%s <G>- <N>Fordítók\n%s <G>- <N>Pálya értékelők"},
  1024. },
  1025. -- *
  1026. },
  1027. ar = {
  1028. grounds = {
  1029. [0] = {"خشب","?","?"},
  1030. [1] = {"جليد","تزيد من سرعتك عند الضغط على زر المسطرة","يزيد من السرعة ب <BL>%s%%</BL>"},
  1031. [2] = {"الترامبولين","?","?"},
  1032. [3] = {"الحمم","تنقلك إلى الأرضية التي لديها اَخر رقم في الـ Z","?"},
  1033. [4] = {"الشوكولاته","?","?"},
  1034. [5] = {"الأرض","?","?"},
  1035. [6] = {"العشب","?","?"},
  1036. [7] = {"الرمل","تصنع عاصفة رملية","يقلل من العاصفة ب <BL>%s%%</BL>"},
  1037. [8] = {"غيمة","تجعلك تطير عن طريق الضغط على زر المسطرة","يزيد من الطيران ب <BL>%s%%</BL>"},
  1038. [9] = {"المياه","تغرقك","يغرقك <BL>%s%%</BL> ببطئ"},
  1039. [10] = {"الحجارة","تصنع حاجو من الحجارة عن طريق الضغط على زر المسطرة","يزيد من حجم الارضية ب <BL>%s%%</BL>"},
  1040. [11] = {"الثلج","تطلق كرات ثلجية عن طريق الضغط على زر المسطرة","يزيد من سرعة كرة الثلج ب <BL>%s%%</BL>"},
  1041. [12] = {"مستطيل","كل لون له قوته الخاصة","?",{
  1042. ["C90909"] = "يقتلك",
  1043. ["18C92B"] = "إعادة الحياة إلى جميع أعدائك",
  1044. ["555D77"] = "نقطة العودة للحياة",
  1045. }},
  1046. [13] = {"الدائرة","كل لون له قوته الخاصة","?"},
  1047. [14] = {"الإختفاء","?","?"},
  1048. [15] = {"شبكة العنكبوت","تنقلك إلى نقطة البداية","?"},
  1049. },
  1050. -- *
  1051.  
  1052. welcome = "مرحبا إلى #%s! هل يمكنك أن تكون أسرع فأر يستعمل قوى الأرض؟ قم بتجربتها!\n<PS>اضغط على الزر H لمعرفة المزيد!",
  1053. developer = "مبرمجة من قبل %s",
  1054.  
  1055. shop = {
  1056. coin = "النقود",
  1057. power = "طاقة الارضية",
  1058. upgrade = "ترقية",
  1059. price = "ترقبة السعر",
  1060. close = "اغلاق",
  1061. },
  1062. bought = "لقد قمت بإستعمال %s من النقود من أجل الأرضية %s!",
  1063. cantbuy = "لا تملك النقود الكافية لشراء هذا! :(",
  1064.  
  1065. profile = "لائحة المتقدمين : %s\n\n<N>الجولات : %s\n<N>المناصب : %s\n\n<N>الموت : %s\n\n<N>نقود المتجر : %s",
  1066.  
  1067. gotcoin = "لقد حصلت على %s نقود! :D",
  1068. zombie = "أصبحت الأن ميت حي!",
  1069. countstats = {
  1070. mice = "تحتاج الاقل ل 5 فئران لاحصائيات الاعتماد",
  1071. tribe = "الاحصائيات لا تحسب بمنزل القبيلة"
  1072. },
  1073.  
  1074. powersenabled = "تم تفعيل قوى الأرض! حظا موفقا!",
  1075. -- *
  1076.  
  1077. language = "اللغة الحالية : <J>%s",
  1078.  
  1079. password = {
  1080. on = "جديدة سر كلمة : %s",
  1081. off = "السر كلمة تعطيل!"
  1082. },
  1083.  
  1084. commands = {
  1085. shop = "المتجر",
  1086. profile = "لاعب",
  1087. help = "المساعدة",
  1088. langue = "اللغة",
  1089. leaderboard = "مراكز",
  1090. info = "معلومة",
  1091. pw = "password",
  1092. },
  1093.  
  1094. menu = {
  1095. [1] = {"%s","\tما عليك فعله في هذه اللعبة هو جمع الجبن بأسرع ما يمكن يمكنك إستخدام القوى التي توفرها لك الأرضيات."},
  1096. [2] = {"تأثيرات الأراضي","أنقر على إسم الأرضية لمعرفة المزيد عنها\n\n%s"},
  1097. [3] = {"الأوامر",{
  1098. [1] = {"\t<J>» اللاعب</J>\n",{
  1099. [1] = "<VP>!%s</VP> <PS>إسم اللاعب</PS> <R>أو</R> <VP>زر P</VP> - لفتح الملف الشخصي!",
  1100. [2] = "<VP>!%s</VP> <R>أو</R> <VP>الزر O</VP> - لفتح المتجر!",
  1101. [3] = "<VP>!%s</VP> - لتغيير اللغة!\n",
  1102. }},
  1103. [2] = {"\t<J>» البقية</J>\n",{
  1104. [1] = "<VP>!%s</VP> <R>أو</R> <VP>الزر H</VP> - لقتح لائحة المساعدة!",
  1105. [2] = "<VP>!%s</VP> - فتح قائمة المراكز!",
  1106. [3] = "<VP>!%s</VP> - فتح المساعدة وفقا للمكان الذي انت عليه!",
  1107. [4] = "<VP>!%s</VP> - يعرض معلومات الخريطة إذا كانت في دوران",
  1108. }},
  1109. [3] = {"\n\t<J>» مشرف غرفة</J>\n",{
  1110. [1] = "<VP>!%s</VP> <PS>سر كلمة</PS> - إضافة أو إزالة كلمة مرور في الغرفة!",
  1111. }},
  1112. }},
  1113. [4] = {"الخرائط","<J>الخرائط : %s\n\n\tتفعيل %s وأرسل الخارطة. لا تنسى قراءة القوانين!"},
  1114. [5] = {"شكرا لـ","<R>%s <G>- <N>المبرمج\n%s <G>- <N>مترجمون\n%s <G>- <N>مقيموا الخرائط"},
  1115. },
  1116. -- *
  1117. },
  1118. nl = {
  1119. grounds = {
  1120. [0] = {"Hout","?","?"},
  1121. [1] = {"Ijs","Verhoogt je snelheid door op de spatiebalk te drukken","Verhoogd de snelheid met <BL>%s%%</BL>"},
  1122. [2] = {"Trampoline","?","?"},
  1123. [3] = {"Lava","Teleport jou naar de laatst Z index grond","?"},
  1124. [4] = {"Chocolade","?","?"},
  1125. [5] = {"Aarde","?","?"},
  1126. [6] = {"Gras","?","?"},
  1127. [7] = {"Zand","Maakt een zandstorm","Vemindert de storm met <BL>%s%%</BL>"},
  1128. [8] = {"Wolk","Hiermee kun je vliegen door op de spatiebalk te drukken","Verhoogd de vlucht met <BL>%s%%</BL>"},
  1129. [9] = {"Water","Laat je verdrinken","Maakt je <BL>%s%%</BL> langzamer"},
  1130. [10] = {"Steen","Hiermee maak je een blok steen door op de spatiebalk te drukken","Vergroot de grootte van het blok met <BL>%s%%</BL>"},
  1131. [11] = {"Sneeuw","Schiet sneeuwballen door op de spatiebalk te drukken","Verhoogd de snelheid van de sneeuwbal met <BL>%s%%</BL>"},
  1132. [12] = {"Rechthoek","Elke kleur heeft zijn eigen functie","?",{
  1133. ["C90909"] = "Vermoordt jou",
  1134. ["18C92B"] = "Brengt alle tegenstanders weer tot leven",
  1135. ["555D77"] = "Respawning Checkpoint", -- *
  1136. }},
  1137. [13] = {"Cirkel","Elke kleur heeft zijn eigen functie","?"},
  1138. [14] = {"Onzichtbaar","?","?"},
  1139. [15] = {"Spinnenweb","Teleport je naar het beginpunt","?"},
  1140. },
  1141. -- *
  1142.  
  1143.  
  1144. welcome = "Welkom bij #%s! Ben jij de snelste muis door grond effecten te gebruiken? Probeer het!",
  1145. developer = "Gemaakt door %s",
  1146.  
  1147. shop = {
  1148. coin = "Munten",
  1149. power = "Grondkracht",
  1150. upgrade = "Upgraden",
  1151. price = "Upgrade kosten",
  1152. close = "Sluit",
  1153. },
  1154. bought = "Je gaf net %s munten uit voor de grond %s!",
  1155. cantbuy = "Je hebt niet genoeg munten om deze upgrade uit te voeren! :(",
  1156.  
  1157. profile = "Ranglijst : %s\n\n<N>Rondes : %s\n<N>Podiums : %s\n\n<N>Sterfgevallen : %s\n\n<N>Winkel Munten : %s",
  1158.  
  1159. gotcoin = "Je kreeg zojuist %s munten! :D",
  1160. zombie = "Nu ben je een zombie!",
  1161. countstats = {
  1162. mice = "Er zijn minstens 5 muizen nodig voordat de stats tellen",
  1163. tribe = "Stats tellen niet in stamhuizen"
  1164. },
  1165.  
  1166. powersenabled = "De grondkrachten zijn ingeschakeld! Succes!",
  1167. -- *
  1168.  
  1169. language = "Huidige taal : <J>%s",
  1170.  
  1171. password = {
  1172. on = "Nieuwe wachtwoord : %s",
  1173. off = "Wachtwoord uitgezet!"
  1174. },
  1175.  
  1176. commands = {
  1177. shop = "winkel",
  1178. profile = "profiel",
  1179. help = "help",
  1180. langue = "taal",
  1181. leaderboard = "leaderboard",
  1182. info = "info",
  1183. pw = "wachtwoord",
  1184. },
  1185.  
  1186. menu = {
  1187. [1] = {"%s","\tJouw doel is om zoveel mogelijk kaas te verzamelen, met gebruik van verschillende grond-effecten."},
  1188. [2] = {"Grond effecten","Klik op de grond om meer info te lezen.\n\n%s"},
  1189. [3] = {"Commands",{
  1190. [1] = {"\t<J>» User</J>\n",{
  1191. [1] = "<VP>!%s</VP> <PS>playerName</PS> <R>or</R> <VP>Key P</VP> - Opent het profiel!",
  1192. [2] = "<VP>!%s</VP> <R>or</R> <VP>Key O</VP> - Opent de winkel!",
  1193. [3] = "<VP>!%s</VP> - Wijzigt de taal!\n",
  1194. }},
  1195. [2] = {"\t<J>» Others</J>\n",{
  1196. [1] = "<VP>!%s</VP> <R>or</R> <VP>Key H</VP> - Opent de Help menu!",
  1197. [2] = "<VP>!%s</VP> - Opent de leaderboard!",
  1198. [3] = "<VP>!%s</VP> - Opent help op basis van de grond waarop je staat!",
  1199. [4] = "<VP>!%s</VP> - Displays the map info if it is in the rotation!", -- *
  1200. }},
  1201. [3] = {"\n\t<J>» Kamer admin</J>\n",{
  1202. [1] = "<VP>!%s</VP> <PS>wachtwoord</PS> - Voegt of haalt een wachtwoord weg van een kamer!",
  1203. }},
  1204. }},
  1205. [4] = {"Maps","<J>Maps : %s\n\n\tBereik %s en verzend jouw map. Vergeet niet om alle regels te lezen voordat je begint!"},
  1206. [5] = {"Dank aan","<R>%s <G>- <N>Developer\n%s <G>- <N>Translators\n%s <G>- <N>Mapbeoordelaars"},
  1207. },
  1208. -- *
  1209. },
  1210. de = {
  1211. grounds = {
  1212. [0] = {"Holz","?","?"},
  1213. [1] = {"Eis","Beschleunigt dich indem du die Leertaste drückst","Erhoht die geschwindigkeit in <BL>%s%%</BL>"},
  1214. [2] = {"Trampoline","?","?"},
  1215. [3] = {"Lava","Teleportiert dich zum letzen Z Index Boden","?"},
  1216. [4] = {"Schokolade","?","?"},
  1217. [5] = {"Erde","?","?"},
  1218. [6] = {"Gras","?","?"},
  1219. [7] = {"Sand","Kreiert einen Sandsturm","Verringert die sturm in <BL>%s%%</BL>"},
  1220. [8] = {"Wolke","Du kannst fliegen indem du die Leertaste drückst","Erhoht die fliege in <BL>%s%%</BL>"},
  1221. [9] = {"Wasser","Ertränkt dich","Ertrinkt dich <BL>%s%%</BL> langsamer"},
  1222. [10] = {"Stein","Erschaffe einen Stein indem du die Leertaste drückst","Erhoht die blockgrosse in <BL>%s%%</BL>"},
  1223. [11] = {"Schnee","Wirf Schneebälle indem du die Leertaste drückst","Erhoht die schneeball geschwindigkeit in <BL>%s%%</BL>"},
  1224. [12] = {"Rechteck","Jede Farbe hat seine eigene Funktion","?",{
  1225. ["C90909"] = "Tötet du",
  1226. ["18C92B"] = "Aufleben alle Feinde",
  1227. ["555D77"] = "Respawning Checkpoint", -- *
  1228. }},
  1229. [13] = {"Kreis","Jede Farbe hat seine eigene Funktion","?"},
  1230. [14] = {"Unsichtbar","?","?"},
  1231. [15] = {"Spinnweben","Teleportiert dich zum Startpunkt","?"},
  1232. },
  1233. -- *
  1234.  
  1235. welcome = "Willkommen zu #%s! Kannst du die schnellste Maus mit den Bodeneffekten sein? Versuch es!\n<PS>Drück H für mehr informationen!",
  1236. developer = "Entwickelt von %s",
  1237.  
  1238. shop = {
  1239. coin = "Munzen",
  1240. power = "Bodenleistung",
  1241. upgrade = "Aktualisierung",
  1242. price = "Upgrade Preis",
  1243. close = "Schliessen",
  1244. },
  1245. bought = "Du hast %s Münzen für den Boden %s ausgegeben!",
  1246. cantbuy = "Du hast nicht genügend Münzen um dieses Upgrade zu kaufen! :(",
  1247.  
  1248. profile = "Bestenliste : %s\n\n<N>Runden: %s\n<N>Podiums: %s\n\n<N>Tode : %s\n\n<N>Shop Münzen: %s",
  1249.  
  1250. gotcoin = "Du hast soeben %s Münzen erhalten! :D",
  1251. zombie = "Du bist nun ein Zombie!",
  1252. countstats = {
  1253. mice = "Es müssen mindestens 5 Mäuse im Raum sein damit die Stats zählen",
  1254. tribe = "Stats zählen in Stammeshäusern nicht"
  1255. },
  1256.  
  1257. powersenabled = "Der Effekt des Bodens wurde aktiviert! Viel Glück!",
  1258. -- *
  1259.  
  1260. language = "Aktuelle Sprache : <J>%s",
  1261.  
  1262. password = {
  1263. on = "Neu passwort: : %s",
  1264. off = "Passwort deaktiviert!"
  1265. },
  1266.  
  1267. commands = {
  1268. shop = "shop",
  1269. profile = "profil",
  1270. help = "hilfe",
  1271. langue = "sprache",
  1272. leaderboard = "bestenliste",
  1273. info = "info",
  1274. pw = "passwort",
  1275. },
  1276.  
  1277. menu = {
  1278. [1] = {"%s","\tDein Ziel in diesem Minigame ist es den Käse so schnell wie möglich zu sammeln, indem du die verschiedenen Effekte der Böden ausnutzt."},
  1279. [2] = {"Bodeneffekte","Klicken in den bodens namen um mehr zu lesen.\n\n%s"},
  1280. [3] = {"Kommandos",{
  1281. [1] = {"\t<J>» Benutzer</J>\n",{
  1282. [1] = "<VP>!%s</VP> <PS>Spielername</PS> <R>oder</R> <VP>Taste P</VP> - Öffnet das Profil!",
  1283. [2] = "<VP>!%s</VP> <R>oder</R> <VP>Taste O</VP> - Öffnet den Shop!",
  1284. [3] = "<VP>!%s</VP> - Ändert die Sprache!\n",
  1285. }},
  1286. [2] = {"\t<J>» Anderes</J>\n",{
  1287. [1] = "<VP>!%s</VP> <R>oder</R> <VP>Taste H</VP> - Öffnet das Hilfsmenu!",
  1288. [2] = "<VP>!%s</VP> - Öffnet die Bestenliste!",
  1289. [3] = "<VP>!%s</VP> - Öffnet die hilfe nach dem boden auf dem du bist auf!",
  1290. [4] = "<VP>!%s</VP> - Displays the map info if it is in the rotation!", -- *
  1291. }},
  1292. [3] = {"\n\t<J>» Zimmer admin</J>\n",{
  1293. [1] = "<VP>!%s</VP> <PS>passwort</PS> - Hinzufugen oder entfernen eines passwortes im raum!",
  1294. }},
  1295. }},
  1296. [4] = {"Maps","<J>Maps : %s\n\n\tBesuche das Thema %s und reiche deine Map ein. Vergiss nicht zuvor alle Regeln zu lesen!"},
  1297. [5] = {"Danke an ","<R>%s <G>- <N>Entwickler\n%s <G>- <N>Übersetzer\n%s <G>- <N>Landkarte bewerter"},
  1298. },
  1299. -- *
  1300. },
  1301. },
  1302. langue = "en",
  1303. -- Info
  1304. staff = {
  1305. translators = {
  1306. -- Name, Languages
  1307. {"Bolodefchoco",{"EN","BR"}},
  1308. {"Distances","NL"},
  1309. {"Tocutoeltuco","ES"},
  1310. {"Sebafrancuz","PL"},
  1311. {"Doriiarvai","HU"},
  1312. {"Error_404","AR"},
  1313. {"Cheeselicious","NL"},
  1314. {"Archaeron","DE"},
  1315. {"Aewing","FR"},
  1316. {"Fashionkid","DE"},
  1317. {"Yuir","ES"},
  1318. {"Mquk","FR"}
  1319. },
  1320. mapEvaluators = {
  1321. -- Name, Joined
  1322. {"Bolodefchoco","14/02/2017"},
  1323. {"Error_404","11/03/2017"}
  1324. },
  1325. },
  1326. -- Data
  1327. bindKeys = {0,1,2,3,stringbyte("OPHK",1,4)},
  1328. info = {},
  1329. stormIntensities = {
  1330. --[[ Opaque images
  1331. [1] = "15a6d6fcd18",
  1332. [2] = "15a6d6ff82f",
  1333. [4] = "15a6d7015bc",
  1334. [8] = "15a6d703149"
  1335. ]]
  1336. [1] = .75,
  1337. [2] = .65,
  1338. [4] = .5,
  1339. [8] = .25
  1340. },
  1341. -- Maps (G Categories)
  1342. maps = {},
  1343. G = {
  1344. --[[
  1345. name = catName,
  1346. queue{maps},
  1347. id = 1,
  1348. icon = {iconImage,x axis (from 360),y axis (from 123)}
  1349. color = catColor,
  1350. before = function executed before the map,
  1351. after = function executed after the map
  1352. ]]--
  1353. [1] = {
  1354. name = "Circuit",
  1355. queue = {3099763,4612510,7078090,4493715,7102175,5921816,7127261,7102187},
  1356. id = 1,
  1357. icon = {"15c60371706",0,-1},
  1358. color = "9A9ACE",
  1359. },
  1360. [2] = {
  1361. name = "Flap Bird",
  1362. queue = {7069835,2265250,6300148,5921754,2874090,2310427},
  1363. id = 1,
  1364. icon = {"15c603730a6",0,0},
  1365. color = "E084D4",
  1366. },
  1367. [3] = {
  1368. name = "Bootcamp",
  1369. queue = {4592612,7079708,5921867,7087840,6391815,7090909,7011800,7069314,6333026,6000012,6990787,7100040},
  1370. id = 1,
  1371. icon = {"15c60382627",-5,-5},
  1372. color = "A4CF9E",
  1373. },
  1374. [4] = {
  1375. name = "Aquatic",
  1376. queue = {6133469,3324284,6578479,7095393,5772226,2310447},
  1377. id = 1,
  1378. icon = {"15c603788c1",0,0},
  1379. color = "2194D9",
  1380. },
  1381. [5] = {
  1382. name = "Teleport",
  1383. queue = {5168440,6987992,7069343,6945850,7090907,3326655,7069816,5921744,7071075,7071400,4509060,7118888},
  1384. id = 1,
  1385. icon = {"15c60376d57",2,-1},
  1386. color = "E29E71",
  1387. },
  1388. [6] = {
  1389. name = "Puzzle",
  1390. queue = {5993927,7057010,5507021,6994066,6332986,7074686,3448597,2887357,6576282,4514386,7079827,7079880},
  1391. id = 1,
  1392. icon = {"15c6037edb7",0,-1},
  1393. color = "CB56D8",
  1394. },
  1395. [7] = {
  1396. name = "Racing",
  1397. queue = {4140491,3324180,6564380,6600268,6987993,6726599,2283901,6568120,4055924,4361785,3851416,7079644,6347093,6620004,7086768,6797243,2030030,5198518,6230212,6340023,7069304,4362362,5981054,4364504,7086737,6623930},
  1398. id = 1,
  1399. icon = {"15c6037ccd7",-5,-5},
  1400. color = "9DBCF2",
  1401. },
  1402. [8] = {
  1403. name = "Snow",
  1404. queue = {4396371,5632126,7079092,4531989,4509584},
  1405. id = 1,
  1406. icon = {"15c6037b089",5,1},
  1407. color = "C4F4F6",
  1408. after = function()
  1409. if os.date("%m") == "12" then
  1410. tfm.exec.chatMessage("<PS>Merry christmas :)")
  1411. tfm.exec.snow(60)
  1412. end
  1413. end,
  1414. },
  1415. [9] = {
  1416. name = "Miscellaneous",
  1417. queue = {6226386,5425815,7047955,6558179,6961916,6968299,6935117,4802574,7087798,6335452,7093647,7145064},
  1418. id = 1,
  1419. icon = {"15c6036fb66",-10,-2},
  1420. color = "DED963",
  1421. },
  1422. [10] = {
  1423. name = "Cooperation",
  1424. queue = {3326675,4184558,5198607,6988672},
  1425. id = 1,
  1426. icon = {"15c60374f1f",-3,-1},
  1427. color = "2EBA7E",
  1428. },
  1429. [11] = {
  1430. name = "Vampire",
  1431. queue = {5043429,4361619,4633670},
  1432. id = 1,
  1433. icon = {"15c60380b12",-10,-5},
  1434. color = "CB546B",
  1435. after = function()
  1436. if os.date("%m") == "10" then
  1437. tfm.exec.chatMessage("<R>Happy Halloween :>")
  1438. end
  1439. end,
  1440. },
  1441. [12] = {
  1442. name = "House",
  1443. queue = {510966},
  1444. id = 1,
  1445. icon = {"15cb6dbea83",-8,-4},
  1446. color = "D1AB83",
  1447. after = function()
  1448. tfm.exec.setGameTime(1800) -- 30 minutes
  1449. tfm.exec.chatMessage("<ROSE>" .. system.getTranslation("tribehouse"))
  1450. end,
  1451. },
  1452. },
  1453. rotation = {1,{9,7,4,1,5,7,10,8,6,11,2,1,3,5}},
  1454. newMap = coroutine.wrap(function()
  1455. while true do
  1456. local map
  1457. if os.time() > system.newGameTimer then
  1458. if mode.grounds.rotation[1] > #mode.grounds.rotation[2] then
  1459. mode.grounds.rotation[1] = 1
  1460. end
  1461.  
  1462. local category = mode.grounds.rotation[2][mode.grounds.rotation[1]]
  1463. mode.grounds.mapInfo[2] = category
  1464. category = mode.grounds.G[category]
  1465. mode.grounds.mapInfo[5] = category.color
  1466. map = category.queue[category.id]
  1467. mode.grounds.mapInfo[1] = map
  1468.  
  1469. category.id = category.id + 1
  1470.  
  1471. mode.grounds.afterFunction = category.after or (function() end)
  1472. if category.before then
  1473. category.before()
  1474. end
  1475.  
  1476. if category.id > #category.queue then
  1477. category.queue = tableshuffle(category.queue)
  1478. category.id = 1
  1479. end
  1480.  
  1481. mode.grounds.rotation[1] = mode.grounds.rotation[1] + 1
  1482. end
  1483. coroutine.yield(map)
  1484. end
  1485. end),
  1486. -- New Map Settings
  1487. review = false,
  1488. afterFunction = (function() end),
  1489. mapInfo = {0,0,0,0,"CAA4CF"}, -- Code, Category, Width, Height, Color
  1490. respawn = 0,
  1491. hasWater = false,
  1492. podium = 0,
  1493. availableRoom = false,
  1494. alivePlayers = 0,
  1495. totalPlayers = 0,
  1496. spawnPoint = {0,0},
  1497. -- Loop Settings
  1498. despawnGrounds = {},
  1499. announceTimer = 0,
  1500. -- Misc Settings
  1501. welcomeMessage = (function()
  1502. if system.roomNumber == 666 then
  1503. return {"<R>","<R>","<R>","<R>"}
  1504. else
  1505. return {"<BV>","<PT>","<BV>","<VP>"}
  1506. end
  1507. end)(),
  1508. isHouse = system.roomNumber == 801 or system.officialMode[1] == "village",
  1509. -- Leaderboard Settings
  1510. leaderboard = {update = 0,data = {}},
  1511. -- Shop
  1512. shop = {
  1513. images = {
  1514. [1] = {'15a2a340dd5','15a2a342b88','15a2a3449a9','15a2a3459e1','15a2a346953','15a2a3479a3','15a2a348ad3','15a2a349a89','15a2a34aa0d'},
  1515. [3] = {'15a2a35fef7','15a2a36114b','15a2a36240d','15a2a36332f','15a2a3645f3'},
  1516. [7] = {'15a2a3721bc','15a2a3731bb','15a2a3742b6','15a2a375439','15a2a376339'},
  1517. [8] = {'15a2a31b8dc','15a2a31d292','15a2a323150','15a2a32815c','15a2a32af10','15a2a32ce03','15a2a32dc09','15a2a32ecde','15a2a32fc20'},
  1518. [9] = {'15a2a3b475f','15a2a3b5996','15a2a3b6ab9','15a2a3b8250','15a2a3b924f'},
  1519. [10] = {'15a2a3a0156','15a2a3a1229','15a2a3a2460','15a2a3a3702','15a2a3a4c70'},
  1520. [11] = {'15a2a381307','15a2a3824c8','15a2a383682','15a2a384dc1','15a2a3865c5','15a2a38820d','15a2a38a3a8','15a2a38bbd6','15a2a38d0ec'},
  1521. [15] = {'15a2a3c4442','15a2a3c54f3','15a2a3c69b7','15a2a3c78e7','15a2a3c873b'},
  1522. },
  1523. unpackImages = function(id,e)
  1524. local t = {}
  1525. for k,v in next,mode.grounds.shop.images[id] do
  1526. if #t < e then
  1527. t[#t+1] = v
  1528. end
  1529. end
  1530. return t
  1531. end,
  1532. },
  1533. -- System functions
  1534. concat = function(k,v)
  1535. if type(v) == "table" then
  1536. return tableconcat(v,"\n",function(i,j) return mode.grounds.concat(i,j) end)
  1537. else
  1538. return v
  1539. end
  1540. end,
  1541. listener = function(t,st,from)
  1542. from = (from and from.."." or "")
  1543. for k,v in next,t do
  1544. if type(v) == "table" then
  1545. mode.grounds.listener(v,st,from .. tostring(k))
  1546. else
  1547. st[#st + 1] = from .. k
  1548. end
  1549. end
  1550. return st
  1551. end,
  1552. -- Bar
  1553. uibar = function(id,player,value,color,size,height)
  1554. size = size or 100
  1555. height = height or 20
  1556.  
  1557. if value > size then
  1558. value = size
  1559. elseif value < 0 then
  1560. value = 0
  1561. end
  1562.  
  1563. ui.addTextArea(id,"",player,5,(height+8) * id,size + 4,height,0xC7CED2,1,1,true)
  1564. if value ~= 0 then
  1565. ui.addTextArea(id+1,"",player,6,(height+8) * id + 2,value + 2,height - 4,color,color,1,true)
  1566. end
  1567. ui.addTextArea(id+2,"<p align='center'><B><font color='#0'>"..value.."%",player,5,(height+8) * id,size + 4,height,1,1,0,true)
  1568. end,
  1569. -- Shop
  1570. uishop = function(n)
  1571. if mode.grounds.info[n].groundsDataLoaded then
  1572. for k,v in next,mode.grounds.info[n].shop.image do
  1573. tfm.exec.removeImage(v)
  1574. end
  1575. if not mode.grounds.info[n].shop.accessing then
  1576. local get,index = tablefind(mode.grounds.shop.grounds,mode.grounds.info[n].powersOP.GTYPE,1)
  1577. if get then
  1578. mode.grounds.info[n].shop.page = index
  1579. else
  1580. mode.grounds.info[n].shop.page = 1
  1581. end
  1582. mode.grounds.info[n].shop.accessing = true
  1583. end
  1584. if mode.grounds.info[n].shop.page < 1 then
  1585. mode.grounds.info[n].shop.page = #mode.grounds.shop.grounds
  1586. elseif mode.grounds.info[n].shop.page > #mode.grounds.shop.grounds then
  1587. mode.grounds.info[n].shop.page = 1
  1588. end
  1589.  
  1590. local shopTxt = system.getTranslation("shop",n)
  1591. local debuggedGround = mode.grounds.shop.grounds[mode.grounds.info[n].shop.page]
  1592. local ground = system.getTranslation("grounds."..debuggedGround[1],n)
  1593. local G = stringlower(mode.grounds.translations.en.grounds[debuggedGround[1]][1])
  1594. local groundLevel = mode.grounds.info[n].stats.powers[G]
  1595. groundLevel = groundLevel[#groundLevel]
  1596.  
  1597. ui.addTextArea(4,"",n,160,50,480,320,0x1a2433,1,1,true)
  1598.  
  1599. ui.addTextArea(5,"",n,171,56,240,15,0x1d5a78,0x1d5a78,1,true)
  1600. ui.addTextArea(6,"<p align='center'><font size='13'>"..stringnick(mode.grounds.cmds.shop),n,170,53,240,25,1,1,0,true)
  1601.  
  1602. ui.addTextArea(7,"<p align='center'><font size='12'><B><a href='event:shop.left'><BV>«</BV></a> <font size='14'><a href='event:info.grounds."..stringgsub(ground[1],"'","#").."."..ground[2].."'>"..ground[1].."</a></font> <a href='event:shop.right'><BV>»</BV></a>",n,170,87,240,25,0x073247,0x073247,1,true)
  1603.  
  1604. mode.grounds.info[n].shop.image[1] = tfm.exec.addImage(debuggedGround[2][1]..".png","&0",435,70,n)
  1605.  
  1606. local playerData = stringformat("<font size='12'><N>%s <G>: <J>$%s\n<N>%s\n<N>%s <G>: <BL>%s",shopTxt.coin,mode.grounds.info[n].stats.groundsCoins,"%s",shopTxt.power,mathfloor(mathpercent(groundLevel,#debuggedGround[2])).."%%")
  1607. local groundData = ""
  1608. local upgradeData = "<p align='center'><font size='15'><B>%s" .. shopTxt.upgrade
  1609.  
  1610. if (groundLevel + 1) <= #debuggedGround[2] then
  1611. local price = (groundLevel + 1) * (120 * debuggedGround[3])
  1612. playerData = stringformat(playerData,shopTxt.price .. " <G>: <R>$" .. price)
  1613. local iniPerc = mathfloor(mathpercent(1,#mode.grounds.shop.grounds[mode.grounds.info[n].shop.page][2]))
  1614. groundData = stringformat(ground[3],iniPerc)
  1615. upgradeData = stringformat(upgradeData,"<a href='event:shop.buy."..price.."."..G.."'><PT>")
  1616.  
  1617. local gId = mode.grounds.info[n].stats.powers[G][#mode.grounds.info[n].stats.powers[G]]
  1618. mode.grounds.info[n].shop.image[2] = tfm.exec.addImage(debuggedGround[2][gId]..".png","&1",540,70,n)
  1619. mode.grounds.info[n].shop.image[3] = tfm.exec.addImage("15a2df6ab69.png","&2",440,205,n)
  1620. mode.grounds.info[n].shop.image[4] = tfm.exec.addImage(debuggedGround[2][gId+1]..".png","&3",540,210,n)
  1621. else
  1622. playerData = stringformat(playerData,"<R>-")
  1623. upgradeData = stringformat(upgradeData,"<V>")
  1624.  
  1625. mode.grounds.info[n].shop.image[2] = tfm.exec.addImage(system.getTranslation("max",n)..".png","&2",175,215,n)
  1626. end
  1627.  
  1628. ui.addTextArea(8,playerData,n,170,130,240,52,0x073247,0x073247,1,true)
  1629. ui.addTextArea(9,groundData,n,170,200,240,80,0x073247,0x073247,1,true)
  1630.  
  1631. ui.addTextArea(10,upgradeData,n,170,298,240,24,0x073247,0x073247,1,true)
  1632. ui.addTextArea(11,"<p align='center'><font size='15'><R><B><a href='event:shop.close'>"..shopTxt.close.."</a></B>",n,170,339,240,24,0x073247,0x073247,1,true)
  1633.  
  1634. ui.addTextArea(12,"",n,430,62,200,300,0x073247,0x073247,1,true)
  1635. ui.addTextArea(13,"",n,426,58,90,90,0x1a2433,0x1a2433,1,true)
  1636. end
  1637. end,
  1638. -- Profile
  1639. uiprofile = function(n,p)
  1640. if mode.grounds.info[p].groundsDataLoaded then
  1641. local nickSize = #p > 12 and 10 or 15
  1642. ui.addTextArea(14,"<p align='center'><B><R><a href='event:profile.close'>X",n,513,115,20,20,1,1,1,true)
  1643. ui.addTextArea(15,"<p align='center'><B><PS><a href='event:profile.open'>•",n,513,145,20,20,1,1,1,true)
  1644. ui.addTextArea(16,"<p align='center'><font size='16'><B><V>"..p.."</V></B> "..(mode.grounds.info[p].isOnline and "<VP>" or "<R>").."•</font></p><p align='left'><font size='12'>\n<N>" .. stringformat(system.getTranslation("profile",n),"<V>#"..mode.grounds.info[p].ranking,"<V>"..mode.grounds.info[p].stats.rounds,"<V>"..mode.grounds.info[p].stats.podiums,"<V>"..mode.grounds.info[p].stats.deaths,"<J>$"..mode.grounds.info[p].stats.groundsCoins),n,290,115,220,160,0x073247,1,1,true)
  1645. end
  1646. end,
  1647. -- Menu
  1648. uimenu = function(n)
  1649. if not mode.grounds.info[n].menu.accessing then
  1650. mode.grounds.info[n].menu.page = 1
  1651. mode.grounds.info[n].menu.accessing = true
  1652. end
  1653.  
  1654. local langue = system.getTranslation("menu",n)
  1655.  
  1656. if mode.grounds.info[n].menu.page < 1 then
  1657. mode.grounds.info[n].menu.page = #langue
  1658. elseif mode.grounds.info[n].menu.page > #langue then
  1659. mode.grounds.info[n].menu.page = 1
  1660. end
  1661.  
  1662. local popupFormat = "<%s><a href='event:menu.page.%d'>#%s</a>"
  1663. local popups = {}
  1664. for k,v in next,langue do
  1665. popups[#popups+1] = stringformat(popupFormat,(k == mode.grounds.info[n].menu.page and "VP" or "J"),k,stringformat(v[1],stringnick(module._NAME)))
  1666. end
  1667.  
  1668. local popup = {
  1669. x = {663,546},
  1670. d = "«",
  1671. txt = "<font size='11'><J>"..tableconcat(popups,"\n\n")
  1672. }
  1673. if not mode.grounds.info[n].menu.showPopup then
  1674. popup = {
  1675. x = {552,435},
  1676. d = "»",
  1677. txt = "",
  1678. }
  1679. end
  1680.  
  1681. local displayText = {tableunpack(langue[mode.grounds.info[n].menu.page])}
  1682.  
  1683. if mode.grounds.info[n].menu.page == 1 then
  1684. displayText[1] = stringformat(displayText[1],stringnick(module._NAME))
  1685.  
  1686. local gameModes = "<PT>"
  1687. for k,v in next,{"powers",tableunpack(system.submodes,2)} do
  1688. local room
  1689. if k > 1 then
  1690. room = stringformat("/room #%s%s@%s*%s",module._NAME,mathrandom(0,999),n,system.normalizedModeName(v,false))
  1691. else
  1692. room = stringformat("/room #%s%s%s",v,mathrandom(0,999),n)
  1693. end
  1694. gameModes = gameModes .. stringformat("<a href='event:print.&lt;ROSE>%s'>%s</a>\n",room,room)
  1695. end
  1696.  
  1697. displayText[2] = displayText[2] .. "\n\n" .. gameModes
  1698. else
  1699. local textFormat = nil
  1700. if mode.grounds.info[n].menu.page == 2 then
  1701. textFormat = {{},system.getTranslation("grounds",n)}
  1702. for k,v in next,textFormat[2] do
  1703. if v[2] ~= "?" then
  1704. tableinsert(textFormat[1],stringformat("<a href='event:info.grounds.%s.%s'><B>%s</B></a>",stringgsub(v[1],"'","#"),stringgsub(v[2],"%.","@"),stringupper(v[1])))
  1705. end
  1706. end
  1707. displayText[2] = stringformat(displayText[2],"• "..tableconcat(textFormat[1],"\n• "))
  1708. elseif mode.grounds.info[n].menu.page == 3 then
  1709. displayText[2] = tableconcat(displayText[2],"\n",function(k,v)
  1710. return mode.grounds.concat(k,v)
  1711. end)
  1712. displayText[2] = "<font size='10'>" .. stringformat(displayText[2],mode.grounds.cmds.profile,mode.grounds.cmds.shop,mode.grounds.cmds.langue,mode.grounds.cmds.help,mode.grounds.cmds.leaderboard,mode.grounds.cmds.info,mode.grounds.cmds.mapinfo,mode.grounds.cmds.pw)
  1713. elseif mode.grounds.info[n].menu.page == 4 then
  1714. displayText[2] = stringformat(displayText[2] .. "\n\n%s",#mode.grounds.maps.."<N>","<BV><a href='event:print.atelier801¬com/topic?f=6&t=845005'>#"..stringupper(module._NAME).." MAP SUBMISSIONS</a></BV>",tableconcat(mode.grounds.G,"\n",function(k,v)
  1715. return stringformat("<font color='#%s'><a href='event:info.mapCategory.%s'>G%2d</a> : %3d</font>",v.color,k,k,#v.queue)
  1716. end))
  1717. elseif mode.grounds.info[n].menu.page == 5 then
  1718. local concat = {}
  1719. for i,j in next,{{"translators","<CEP>"},{"mapEvaluators","<BV>"}} do
  1720. concat[#concat+1] = j[2] .. tableconcat(mode.grounds.staff[j[1]],"<G>, " .. j[2],function(k,v)
  1721. return stringformat("<a href='event:info.%s.%s'>%s</a>",j[1],k,v[1])
  1722. end)
  1723. end
  1724. displayText[2] = stringformat(displayText[2],"Bolodefchoco",concat[1],concat[2])
  1725. end
  1726. end
  1727.  
  1728. ui.addTextArea(17,"<font size='1'>\n</font><p align='center'><J><B><a href='event:menu.right'>»</a>",n,543,352,40,20,1,1,1,true)
  1729. ui.addTextArea(18,"<font size='1'>\n</font><p align='center'><J><B><a href='event:menu.left'>«</a>",n,217,352,40,20,1,1,1,true)
  1730.  
  1731. ui.addTextArea(19,"<font size='1'>\n</font><p align='center'><PT><B><a href='event:menu.popup'>"..popup.d.."</a>",n,popup.x[1],137,20,20,1,1,1,true)
  1732. ui.addTextArea(20,popup.txt,n,popup.x[2],137,115,125,0x123e54,1,1,true)
  1733.  
  1734. ui.addTextArea(21,"<p align='center'><B><R><a href='event:menu.close'>X",n,543,42,20,20,1,1,1,true)
  1735. ui.addTextArea(22,"<p align='center'><font size='20'><V><B>"..stringupper(displayText[1]).."</B></V><font size='15'>\n<R>_____________\n\n<font size='11'><N><p align='left'>"..displayText[2],n,260,42,280,330,0x073247,1,1,true)
  1736. end,
  1737. -- Info
  1738. uidisplayInfo = function(n,data)
  1739. local what = data[2]
  1740. local title,text,color = "","",""
  1741. if what == "grounds" then
  1742. color = "<N>"
  1743. title = stringgsub(data[3],"#","'")
  1744. local info = stringgsub(data[4],"@",".")
  1745. local groundTxt = system.getTranslation("grounds.12",n)
  1746. if info == groundTxt[2] then
  1747. local colors = {}
  1748. for k,v in next,groundTxt[4] do
  1749. colors[#colors+1] = stringformat("<PT>[•] <N2><font color='#%s'>(#%s)</a> <BL>- <PS>%s",k,k,v)
  1750. end
  1751. text = tableconcat(colors,"\n")
  1752. else
  1753. text = stringformat("<PT>[•] <PS>%s",info)
  1754. end
  1755. elseif what == "mapCategory" then
  1756. data[3] = tonumber(data[3])
  1757. color = "<S>"
  1758. title = "G"..data[3]
  1759. text = stringformat("%s\n# %s\n@ %s",mode.grounds.G[data[3]].name,#mode.grounds.G[data[3]].queue,system.getTranslation("categories." .. data[3],n))
  1760. if mode.grounds.info[n].infoImage[#mode.grounds.info[n].infoImage] then
  1761. tfm.exec.removeImage(mode.grounds.info[n].infoImage[#mode.grounds.info[n].infoImage])
  1762. end
  1763. mode.grounds.info[n].infoImage[#mode.grounds.info[n].infoImage + 1] = tfm.exec.addImage(mode.grounds.G[data[3]].icon[1] .. ".png","&4",360 + mode.grounds.G[data[3]].icon[2],125 + mode.grounds.G[data[3]].icon[3],n)
  1764. elseif mode.grounds.staff[what] then
  1765. local comp = data[3]
  1766. local info = mode.grounds.staff[what][tonumber(comp)]
  1767. title = info[1]
  1768. if what == "translators" then
  1769. color = "<CEP>"
  1770. text = stringformat("[•] !%s %s",mode.grounds.cmds.langue,tableconcat(tableturnTable(info[2]),", "))
  1771. elseif what == "mapEvaluators" then
  1772. color = "<BV>"
  1773. text = stringformat("[•] %s",info[2])
  1774. end
  1775. end
  1776. ui.addTextArea(37,"<p align='center'><B><R><a href='event:info.close'>X",n,528,115,20,20,1,1,1,true)
  1777. ui.addTextArea(38,"<p align='center'><font size='20'><V><B>" .. title .. "</B>" .. color .. (mode.grounds.staff[what] and " •" or "") .. "\n\n<p align='left'><font size='13'>" .. text,n,275,115,250,160,0x073247,1,1,true)
  1778. end,
  1779. -- Leaderboard
  1780. uileaderboard = function(n)
  1781. if os.time() > mode.grounds.leaderboard.update or not n then
  1782. mode.grounds.leaderboard = {update = os.time() + 180e3,data = {}}
  1783.  
  1784. local players = {}
  1785. for k,v in next,mode.grounds.info do
  1786. if stringsub(k,1,1) ~= "*" then
  1787. players[#players + 1] = {k,mathfloor((v.stats.rounds - v.stats.deaths)/10) * (v.stats.podiums + 1)}
  1788. end
  1789. end
  1790. tablesort(players,function(p1,p2) return p1[2] > p2[2] end)
  1791.  
  1792. for k,v in next,players do
  1793. mode.grounds.info[v[1]].ranking = k
  1794. if k < 11 then
  1795. tableinsert(mode.grounds.leaderboard.data,"<J>"..k..". " .. (({"<BV>","<PS>","<CE>"})[k] or "<V>") .. "<a href='event:profile.open."..v[1].."'>".. v[1] .. "</a> <BL>- <VP>" .. v[2] .. "G")
  1796. end
  1797. end
  1798. if #mode.grounds.leaderboard.data == 0 then
  1799. mode.grounds.leaderboard.update = 0
  1800. end
  1801. end
  1802.  
  1803. if n then
  1804. mode.grounds.info[n].leaderboardAccessing = true
  1805. local id,y = 25,100
  1806. ui.addTextArea(23,"<p align='center'><B><R><a href='event:ranking.close'>X",n,603,35,20,20,1,1,1,true)
  1807. ui.addTextArea(24,"<p align='center'><font size='45'>" .. stringnick(mode.grounds.cmds.leaderboard),n,200,35,400,350,0x073247,1,1,true)
  1808.  
  1809. for i = 1,10 do
  1810. local v = mode.grounds.leaderboard.data[i] or ""
  1811. local color = id % 2 == 0 and 0x123e54 or 0x042636
  1812. if stringfind(v,n) then
  1813. v = stringgsub(v,"'>(.-)</a>",function(name)
  1814. return "'><a:active>"..name.."</a:active></a>"
  1815. end)
  1816. end
  1817. ui.addTextArea(id,v,n,245,y,315,20,color,color,1,true)
  1818. id = id + 1
  1819. y = y + 28
  1820. end
  1821.  
  1822. ui.addTextArea(id,"",n,230,90,10,285,0x073247,0x073247,1,true)
  1823. ui.addTextArea(id + 1,"",n,565,90,10,285,0x073247,0x073247,1,true)
  1824. end
  1825. end,
  1826. -- Grounds system
  1827. gsys = {
  1828. -- Ground system
  1829. grounds = {},
  1830. disabledGrounds = {},
  1831. collisionArea = {34,40,50,50,40,34,34,35,0,0,40,35,35,23,0,0},
  1832. getTpPos = function(g,center)
  1833. if center then
  1834. return {g.X,g.Y}
  1835. else
  1836. local ang = stringsplit(g.P,"[^,]+",tonumber)
  1837. ang = ang[5]
  1838. local hTP = {g.X,g.Y}
  1839. if ang == 90 or ang == -270 then
  1840. hTP[1] = hTP[1] + g.L/2
  1841. elseif ang == -90 or ang == 270 then
  1842. hTP[1] = hTP[1] - g.L/2
  1843. elseif mathabs(ang) == 180 then
  1844. hTP[2] = hTP[2] + g.H/2
  1845. else
  1846. hTP[2] = hTP[2] - g.H/2
  1847. end
  1848.  
  1849. return hTP
  1850. end
  1851. end,
  1852. onGround = function(t,px,py)
  1853. local prop = stringsplit(t.P,"[^,]+",tonumber)
  1854.  
  1855. px,py = px or 0,py or 0
  1856. local offset = {}
  1857. local isOn = false
  1858.  
  1859. local w = tonumber(t.L)
  1860. local h = tonumber(t.H)
  1861. local x = tonumber(t.X)
  1862. local y = tonumber(t.Y)
  1863. local gtype = tonumber(t.T)
  1864. gtype = mathsetLim(gtype,0,15) -- mathmin(15,mathmax(0,gtype))
  1865.  
  1866. if not tablefind({8,9,15},gtype) then
  1867. local area = mode.grounds.gsys.collisionArea[gtype + 1]
  1868. w = w + area
  1869. h = h + area
  1870. end
  1871.  
  1872. if gtype == 13 then
  1873. isOn = mathpythag(x,y,px,py,w)
  1874. else
  1875. local ang = mathrad(prop[5])
  1876.  
  1877. local range = {w = w/2,h = h/2}
  1878.  
  1879. local cosA = mathcos(ang)
  1880. local sinA = mathsin(ang)
  1881.  
  1882. local vxA = {x = ((-range.w * cosA - (-range.h) * sinA) + x),y = ((-range.w * sinA + (-range.h) * cosA) + y)}
  1883. local vxB = {x = ((range.w * cosA - (-range.h) * sinA) + x),y = ((range.w * sinA + (-range.h) * cosA) + y)}
  1884. local vxC = {x = ((range.w * cosA - range.h * sinA) + x),y = ((range.w * sinA + range.h * cosA) + y)}
  1885. local vxD = {x = ((-range.w * cosA - range.h * sinA) + x),y = ((-range.w * sinA + range.h * cosA) + y)}
  1886. offset = {vxA,vxB,vxC,vxD}
  1887.  
  1888. local p = 4
  1889. for i = 1,4 do
  1890. if (offset[i].y < py and offset[p].y >= py) or (offset[p].y < py and offset[i].y >= py) then
  1891. if offset[i].x + (py - offset[i].y) / (offset[p].y - offset[i].y) * (offset[p].x - offset[i].x) < px then
  1892. isOn = not isOn
  1893. end
  1894. end
  1895. p = i
  1896. end
  1897. end
  1898.  
  1899. return isOn
  1900. end,
  1901. getGroundProperties = function(xml)
  1902. mode.grounds.gsys.grounds = {}
  1903. stringgsub(xml,"<S (.-)/>", function(parameters)
  1904. local attributes = {}
  1905. stringgsub(parameters,"([%-%w]+)=([\"'])(.-)%2",function(tag,_,value)
  1906. attributes[tag] = tonumber(value) or value
  1907. end)
  1908. mode.grounds.gsys.grounds[#mode.grounds.gsys.grounds + 1] = attributes
  1909. end)
  1910. end,
  1911. groundEffects = function()
  1912. for n,p in next,tfm.get.room.playerList do
  1913. if not p.isDead then
  1914. local affected = false
  1915. for id = 1,#mode.grounds.gsys.grounds do
  1916. local ground = mode.grounds.gsys.grounds[id]
  1917. local newId = id - 1
  1918. if (ground.disablepower or stringsub(ground.P,1,1) == "1" or (ground.v and (_G.currentTime - 3) == (tonumber(ground.v)/1000))) and not mode.grounds.gsys.disabledGrounds[newId] then
  1919. -- If the ground has the disablepower attribute, or is dynamic, or the v despawner attribute exists (after it disappear)
  1920. mode.grounds.gsys.disabledGrounds[newId] = true
  1921. end
  1922. if not mode.grounds.gsys.disabledGrounds[newId] and _G.currentTime >= 3 then
  1923. if mode.grounds.gsys.onGround(ground,p.x,p.y) then
  1924. affected = true
  1925. local gtype = ground.T
  1926. local color = stringupper(tostring(ground.o or ""))
  1927. mode.grounds.info[n].powersOP.GTYPE = gtype
  1928. if gtype == 1 or color == "89A7F5" then -- ice
  1929. system.bindKeyboard(n,32,true,true)
  1930. if color ~= "" then
  1931. mode.grounds.info[n].powersOP.GTYPE = 1
  1932. end
  1933. elseif gtype == 2 or color == "6D4E94" then -- trampoline
  1934. if color ~= "" then
  1935. mode.grounds.info[n].powersOP.GTYPE = 2
  1936. end
  1937. elseif gtype == 3 or color == "D84801" then -- lava
  1938. if color ~= "" then
  1939. mode.grounds.info[n].powersOP.GTYPE = 3
  1940. end
  1941. id = (id > 1 and id - 1 or #mode.grounds.gsys.grounds)
  1942. local g = mode.grounds.gsys.grounds[id]
  1943. local hTP = mode.grounds.gsys.getTpPos(g)
  1944. tfm.exec.displayParticle(36,p.x,p.y,0,0,0,0,n)
  1945. tfm.get.room.playerList[n].x = 0
  1946. tfm.get.room.playerList[n].y = 0
  1947. tfm.exec.movePlayer(n,hTP[1],hTP[2])
  1948. tfm.exec.displayParticle(36,hTP[1],hTP[2],0,0,0,0,n)
  1949. elseif gtype == 8 or color == "9BAABC" then -- cloud
  1950. system.bindKeyboard(n,32,true,true)
  1951. elseif gtype == 7 then -- sand
  1952. ui.addTextArea(-1,"",n,-1500,-1500,3e3,3e3,0xE5CC5D,0xE5CC5D,mode.grounds.stormIntensities[mode.grounds.info[n].stats.powers.sand[1]],false)
  1953. for i = 1,2 do
  1954. tfm.exec.displayParticle(26,mathrandom(800),mathrandom(350),0,0,0,0,n)
  1955. tfm.exec.displayParticle(27,mathrandom(800),mathrandom(350),0,0,0,0,n)
  1956. end
  1957. elseif gtype == 9 then -- water
  1958. if mode.grounds.hasWater then
  1959. mode.grounds.info[n].drown = mode.grounds.info[n].drown + mathrandom(1,mathfloor(mode.grounds.info[n].stats.powers.water[1]))
  1960. mode.grounds.uibar(1,n,mode.grounds.info[n].drown,0x519DDA,100,20)
  1961. if mode.grounds.info[n].drown > 99 then
  1962. tfm.exec.killPlayer(n)
  1963. mode.grounds.uibar(1,n,mode.grounds.info[n].drown,0xDA516D,100,20)
  1964. mode.grounds.info[n].drown = 0
  1965. for i = 1,8 do
  1966. tfm.exec.displayParticle(14,p.x+mathrandom(-50,50),p.y+mathrandom(-20,20),0,-1,0,0,n)
  1967. end
  1968. end
  1969. for i = 1,mathrandom(2,4) do
  1970. tfm.exec.displayParticle(14,p.x+mathrandom(-50,50),p.y+mathrandom(-20,20),0,-1,0,0,n)
  1971. end
  1972. end
  1973. elseif gtype == 10 then -- stone
  1974. system.bindKeyboard(n,32,true,true)
  1975. elseif gtype == 11 or color == "E7F0F2" then -- snow
  1976. system.bindKeyboard(n,32,true,true)
  1977. elseif gtype == 12 or gtype == 13 then -- retangle or circle
  1978. if color == "C90909" then
  1979. tfm.exec.killPlayer(n)
  1980. elseif color == "18C92B" then
  1981. if os.time() > mode.grounds.respawn then
  1982. mode.grounds.respawn = os.time() + 7e3
  1983. for k,v in next,tfm.get.room.playerList do
  1984. if v.isVampire then
  1985. tfm.exec.killPlayer(k)
  1986. elseif v.isDead and mode.grounds.info[k].canRev then
  1987. tfm.exec.respawnPlayer(k)
  1988. end
  1989. end
  1990. end
  1991. elseif color == "555D77" then
  1992. mode.grounds.info[n].checkpoint = id
  1993. end
  1994. elseif gtype == 15 then -- web
  1995. tfm.exec.movePlayer(n,mode.grounds.spawnPoint[1],mode.grounds.spawnPoint[2])
  1996. tfm.get.room.playerList[n].x = 0
  1997. tfm.get.room.playerList[n].y = 0
  1998. end
  1999. end
  2000. end
  2001. end
  2002. if not affected then
  2003. mode.grounds.info[n].powersOP.GTYPE = -1
  2004. end
  2005. end
  2006. end
  2007. end,
  2008. },
  2009. -- Init
  2010. reset = function()
  2011. -- Settings and modes
  2012. mode.grounds.welcomeMessage = (function()
  2013. if system.roomNumber == 666 then
  2014. return {"<R>","<R>","<R>","<R>"}
  2015. else
  2016. return {"<BV>","<PT>","<BV>","<VP>"}
  2017. end
  2018. end)()
  2019.  
  2020. mode.grounds.isHouse = system.roomNumber == 801 or system.officialMode[1] == "village"
  2021.  
  2022. -- Data
  2023. mode.grounds.info = {}
  2024.  
  2025. -- Maps
  2026. mode.grounds.rotation = {1,{9,7,4,1,5,7,10,8,6,11,2,1,3,5}}
  2027. end,
  2028. init = function()
  2029. mode.grounds.translations.pt = mode.grounds.translations.br
  2030.  
  2031. -- Sets the main language according to the community
  2032. if mode.grounds.translations[tfm.get.room.community] then
  2033. mode.grounds.langue = tfm.get.room.community
  2034. end
  2035.  
  2036. -- Shuffle the map rotation
  2037. for k,v in next,mode.grounds.G do
  2038. v.queue = tableshuffle(v.queue)
  2039. end
  2040.  
  2041. -- Map list
  2042. for k,v in next,mode.grounds.G do
  2043. for i,j in next,v.queue do
  2044. mode.grounds.maps[#mode.grounds.maps + 1] = {j,k}
  2045. end
  2046. end
  2047.  
  2048. -- Organizates the staff table
  2049. for k,v in next,mode.grounds.staff do
  2050. tablesort(v,function(t1,t2) return t2[1] > t1[1] end)
  2051. end
  2052.  
  2053. -- Organizes the languages
  2054. mode.grounds.langues = (function()
  2055. local l = {}
  2056. for id in next,mode.grounds.translations do
  2057. l[#l + 1] = stringupper(id)
  2058. end
  2059. tablesort(l)
  2060. return l
  2061. end)()
  2062.  
  2063. -- Translation indexes
  2064. mode.grounds.translationIndexes = mode.grounds.listener(mode.grounds.translations.en,{})
  2065.  
  2066. -- Sets the shop prices, upgrades, etc
  2067. mode.grounds.shop.grounds = {
  2068. -- Ground ID, #Possible upgrades (Imgs), Price average, Upgrade average
  2069. [1] = {1,mode.grounds.shop.unpackImages(1,3),1.05,1.5},
  2070. [2] = {7,mode.grounds.shop.unpackImages(7,4),.4,2},
  2071. [3] = {8,mode.grounds.shop.unpackImages(8,3),1.15,1.47},
  2072. [4] = {9,mode.grounds.shop.unpackImages(9,3),1.6,.6},
  2073. [5] = {10,mode.grounds.shop.unpackImages(10,3),1.1,1.65},
  2074. [6] = {11,mode.grounds.shop.unpackImages(11,5),.5,1.42},
  2075. }
  2076.  
  2077. -- Sets the commands
  2078. mode.grounds.cmds = system.getTranslation("commands")
  2079.  
  2080. -- Disable commands
  2081. for k,v in next,mode.grounds.cmds do
  2082. disableChatCommand(v)
  2083. end
  2084. for k,v in next,{"o","p","h","k","?","pw","time","np","is","check","review","next","again"} do
  2085. disableChatCommand(v)
  2086. end
  2087.  
  2088. -- Official modes running together
  2089. if system.officialMode[1] == "racing" then
  2090. mode.grounds.rotation = {1,{7}}
  2091. elseif system.officialMode[1] == "bootcamp" then
  2092. mode.grounds.rotation = {1,{3}}
  2093. end
  2094.  
  2095. -- House system
  2096. if mode.grounds.isHouse then
  2097. system.isRoom = false
  2098. mode.grounds.rotation = {1,{12}}
  2099. tfm.exec.disableAfkDeath()
  2100. end
  2101.  
  2102. -- Init
  2103. for _,f in next,{"AutoShaman","AutoScore","AutoNewGame","AutoTimeLeft","MinimalistMode","PhysicalConsumables"} do
  2104. end
  2105. tfm.exec.setAutoMapFlipMode(false)
  2106. tfm.exec.setRoomMaxPlayers(16)
  2107.  
  2108. mode.grounds.alivePlayers,mode.grounds.totalPlayers = system.players()
  2109.  
  2110. mode.grounds.uileaderboard()
  2111. system.newTimer(function()
  2112. tfm.exec.newGame(mode.grounds.newMap())
  2113. end,1000,false)
  2114. end,
  2115. -- Callbacks
  2116. eventTextAreaCallback = function(i,n,c)
  2117. local p = stringsplit(c,"[^%.]+")
  2118. if p[1] == "shop" and os.time() > mode.grounds.info[n].shop.timer then
  2119. mode.grounds.info[n].shop.timer = os.time() + 900
  2120. if p[2] == "left" then
  2121. mode.grounds.info[n].shop.page = mode.grounds.info[n].shop.page - 1
  2122. mode.grounds.uishop(n)
  2123. elseif p[2] == "right" then
  2124. mode.grounds.info[n].shop.page = mode.grounds.info[n].shop.page + 1
  2125. mode.grounds.uishop(n)
  2126. elseif p[2] == "buy" and mode.grounds.info[n].groundsDataLoaded then
  2127. p[3] = tonumber(p[3]) or 0
  2128. if mode.grounds.info[n].stats.groundsCoins >= p[3] then
  2129. mode.grounds.info[n].stats.groundsCoins = mode.grounds.info[n].stats.groundsCoins - p[3]
  2130. local loc = mode.grounds.info[n].stats.powers[p[4]]
  2131. mode.grounds.info[n].stats.powers[p[4]][#loc] = mode.grounds.info[n].stats.powers[p[4]][#loc] + 1
  2132. mode.grounds.info[n].stats.powers[p[4]][1] = mode.grounds.info[n].stats.powers[p[4]][1] * mode.grounds.shop.grounds[mode.grounds.info[n].shop.page][4]
  2133. tfm.exec.chatMessage(stringformat("<PT>[•] <BV>%s",stringformat(system.getTranslation("bought",n),"<J>$"..p[3].."</J>","<ROSE>"..system.getTranslation("grounds."..mode.grounds.shop.grounds[mode.grounds.info[n].shop.page][1],n)[1].."</ROSE>",n)),n)
  2134. mode.grounds.uishop(n)
  2135. else
  2136. tfm.exec.chatMessage(stringformat("<PT>[•] <R>%s",system.getTranslation("cantbuy",n)),n)
  2137. end
  2138. elseif p[2] == "close" then
  2139. for i = 4,13 do
  2140. ui.removeTextArea(i,n)
  2141. end
  2142. mode.grounds.info[n].shop.accessing = false
  2143. for k,v in next,mode.grounds.info[n].shop.image do
  2144. tfm.exec.removeImage(v)
  2145. end
  2146. end
  2147. elseif p[1] == "profile" then
  2148. if p[2] == "close" then
  2149. for i = 14,16 do
  2150. ui.removeTextArea(i,n)
  2151. end
  2152. mode.grounds.info[n].profileAccessing = false
  2153. elseif p[2] == "open" then
  2154. if p[3] then
  2155. mode.grounds.uiprofile(n,p[3])
  2156. else
  2157. mode.grounds.uiprofile(n,n)
  2158. end
  2159. end
  2160. elseif p[1] == "menu" and os.time() > mode.grounds.info[n].menu.timer then
  2161. mode.grounds.info[n].menu.timer = os.time() + 750
  2162. if p[2] == "page" and p[3] then
  2163. mode.grounds.info[n].menu.page = tonumber(p[3])
  2164. mode.grounds.uimenu(n)
  2165. elseif p[2] == "right" then
  2166. mode.grounds.info[n].menu.page = mode.grounds.info[n].menu.page + 1
  2167. mode.grounds.uimenu(n)
  2168. elseif p[2] == "left" then
  2169. mode.grounds.info[n].menu.page = mode.grounds.info[n].menu.page - 1
  2170. mode.grounds.uimenu(n)
  2171. elseif p[2] == "popup" then
  2172. mode.grounds.info[n].menu.showPopup = not mode.grounds.info[n].menu.showPopup
  2173. mode.grounds.uimenu(n)
  2174. elseif p[2] == "close" then
  2175. for i = 22,17,-1 do
  2176. ui.removeTextArea(i,n)
  2177. end
  2178. mode.grounds.info[n].menu.accessing = false
  2179. if mode.grounds.info[n].showHelp then
  2180. mode.grounds.info[n].showHelp = false
  2181. ui.removeTextArea(0,n)
  2182. end
  2183. end
  2184. elseif p[1] == "print" then
  2185. p[2] = stringgsub(p[2],"¬",".")
  2186. tfm.exec.chatMessage(stringformat("<PT>[•] <BV>%s",p[2]),n)
  2187. elseif p[1] == "ranking" then
  2188. if p[2] == "close" then
  2189. mode.grounds.info[n].leaderboardAccessing = false
  2190. for i = 23,36 do
  2191. ui.removeTextArea(i,n)
  2192. end
  2193. end
  2194. elseif p[1] == "info" then
  2195. if p[2] == "close" then
  2196. for i = 37,38 do
  2197. ui.removeTextArea(i,n)
  2198. end
  2199. for k,v in next,mode.grounds.info[n].infoImage do
  2200. tfm.exec.removeImage(v)
  2201. end
  2202. mode.grounds.info[n].infoImage = {}
  2203. else
  2204. mode.grounds.uidisplayInfo(n,p)
  2205. end
  2206. end
  2207. end,
  2208. -- New Player
  2209. eventNewPlayer = function(n)
  2210. tfm.exec.chatMessage(stringformat("%s[•] %s%s\n\n<G>[^_^] %s%s",mode.grounds.welcomeMessage[2],mode.grounds.welcomeMessage[3],stringformat(system.getTranslation("welcome"),"<ROSE>" .. module._NAME .. mode.grounds.welcomeMessage[1]),mode.grounds.welcomeMessage[4],stringformat(system.getTranslation("developer"),"Bolodefchoco")),n)
  2211. if mathrandom(10) < 3 then
  2212. tfm.exec.chatMessage("<ROSE>[•] Play #powers at /room #powers",n)
  2213. end
  2214.  
  2215. if system.isPlayer(n) then
  2216. for _,key in next,mode.grounds.bindKeys do
  2217. if key < 4 then
  2218. system.bindKeyboard(n,key,false,true)
  2219. end
  2220. system.bindKeyboard(n,key,true,true)
  2221. end
  2222. else
  2223. tfm.exec.chatMessage("<R>Souris! :(",n)
  2224. end
  2225. if not mode.grounds.info[n] then
  2226. mode.grounds.info[n] = {
  2227. groundsDataLoaded = true,
  2228. showHelp = true,
  2229. right = true,
  2230. langue = mode.grounds.langue,
  2231. isWalking = false,
  2232. drown = 0,
  2233. ranking = -1,
  2234. canRev = false,
  2235. checkpoint = -1,
  2236. shop = {
  2237. accessing = false,
  2238. page = 0,
  2239. timer = 0,
  2240. image = {},
  2241. },
  2242. menu = {
  2243. accessing = false,
  2244. page = 0,
  2245. timer = 0,
  2246. showPopup = true,
  2247. },
  2248. profileAccessing = false,
  2249. leaderboardAccessing = false,
  2250. profileTimer = 0,
  2251. leaderboardTimer = 0,
  2252. isOnline = true,
  2253. stats = {
  2254. groundsCoins = 1000,
  2255. rounds = 0,
  2256. podiums = 0,
  2257. deaths = 0,
  2258. powers = {
  2259. ice = {25,100,1}, -- power, timer, level
  2260. lava = {0,1}, -- power, level
  2261. sand = {1,1}, -- Txtarea opacity, level
  2262. cloud = {35,100,1}, -- power, timer, level
  2263. water = {5,1}, -- power, level
  2264. stone = {15,2500,700,1}, -- size, despawn timer, timer, level
  2265. snow = {5,100,1}, -- power, timer, level
  2266. spiderweb = {0,1}, -- power, level
  2267. },
  2268. },
  2269. powersOP = {
  2270. TIMER = 0,
  2271. GTYPE = -1,
  2272. },
  2273. infoImage = {},
  2274. }
  2275. if not mode.grounds.isHouse then
  2276. ui.addTextArea(0,"",n,-1500,-1500,3e3,3e3,1,1,.8,true)
  2277. mode.grounds.uimenu(n)
  2278. end
  2279. end
  2280.  
  2281. mode.grounds.info[n].isOnline = true
  2282. mode.grounds.info[n].canRev = false
  2283. end,
  2284. -- New Game
  2285. eventNewGame = function()
  2286. local mapName = {}
  2287. if tablefind(mode.grounds.maps,tfm.get.room.xmlMapInfo.mapCode,1) then
  2288. mapName[#mapName + 1] = "<font color='#".. mode.grounds.mapInfo[5] .."'>G" .. mode.grounds.mapInfo[2] .. "</font>"
  2289. else
  2290. mode.grounds.mapInfo = {0,0,0,0,"CAA4CF"}
  2291. mode.grounds.afterFunction = (function() end)
  2292. end
  2293.  
  2294. tfm.exec.setGameTime(3 * 60)
  2295.  
  2296. mode.grounds.podium = 0
  2297. mode.grounds.availableRoom = system.isRoom and mode.grounds.totalPlayers > 2
  2298. if not mode.grounds.availableRoom then
  2299. if mathrandom(30) < 16 then
  2300. if not system.isRoom then
  2301. tfm.exec.chatMessage(stringformat("<PT>[•] <BV>%s",system.getTranslation("countstats.tribe")))
  2302. else
  2303. tfm.exec.chatMessage(stringformat("<PT>[•] <BV>%s",system.getTranslation("countstats.mice")))
  2304. end
  2305. end
  2306. end
  2307.  
  2308. for k,v in next,mode.grounds.info do
  2309. if not system.isPlayer(k) then
  2310. tfm.exec.killPlayer(k)
  2311. end
  2312. if v.groundsDataLoaded and mode.grounds.availableRoom then
  2313. v.stats.rounds = v.stats.rounds + 1
  2314. end
  2315. v.canRev = true
  2316. v.right = true
  2317. v.checkpoint = -1
  2318. end
  2319.  
  2320. mode.grounds.afterFunction()
  2321.  
  2322. mode.grounds.hasWater = false
  2323. local deactivateWater = mode.grounds.isHouse
  2324.  
  2325. mode.grounds.despawnGrounds = {}
  2326. mode.grounds.gsys.disabledGrounds = {}
  2327. local currentXml = tfm.get.room.xmlMapInfo
  2328.  
  2329. local xmlPowers = {}
  2330. -- Info
  2331. xmlPowers[1] = { -- Soulmate system
  2332. attribute = "A", -- Soulmate not allowed for rooms with odd amount of players
  2333. func = function()
  2334. if mode.grounds.totalPlayers % 2 ~= 0 then
  2335. tableforeach(mode.grounds.info,tfm.exec.killPlayer)
  2336. end
  2337. end
  2338. }
  2339. xmlPowers[2] = { -- Map Width
  2340. attribute = "L",
  2341. func = function(size)
  2342. if size then
  2343. mode.grounds.mapInfo[3] = tonumber(size)
  2344. end
  2345. end
  2346. }
  2347. xmlPowers[3] = { -- Map Height
  2348. attribute = "H",
  2349. func = function(size)
  2350. if size then
  2351. mode.grounds.mapInfo[4] = tonumber(size)
  2352. end
  2353. end
  2354. }
  2355.  
  2356. mode.grounds.mapInfo[3] = mathmax(800,mode.grounds.mapInfo[3])
  2357. mode.grounds.mapInfo[4] = mathmax(400,mode.grounds.mapInfo[4])
  2358. -- Powers
  2359. xmlPowers[4] = { -- mapname
  2360. attribute = "mapname",
  2361. func = function(t)
  2362. if t ~= "" then
  2363. mapName[#mapName + 1] = t
  2364. end
  2365. end
  2366. }
  2367. xmlPowers[5] = { -- disablepower
  2368. attribute = "disablepower",
  2369. func = function(g)
  2370. for ground in stringgmatch(g,"[^,]+") do
  2371. ground = tonumber(ground)
  2372. if ground and not mode.grounds.gsys.disabledGrounds[ground] then
  2373. mode.grounds.gsys.disabledGrounds[ground] = true
  2374. end
  2375. end
  2376. end
  2377. }
  2378. xmlPowers[6] = { -- cheese
  2379. attribute = "cheese",
  2380. func = function()
  2381. tableforeach(mode.grounds.info,tfm.exec.giveCheese)
  2382. end
  2383. }
  2384. xmlPowers[7] = { -- meep
  2385. attribute = "meep",
  2386. func = function()
  2387. tableforeach(mode.grounds.info,tfm.exec.giveMeep)
  2388. end
  2389. }
  2390. xmlPowers[8] = { -- addtime
  2391. attribute = "addtime",
  2392. func = function(minutes)
  2393. tfm.exec.setGameTime((3 + (tonumber(minutes) or 0)) * 60)
  2394. end
  2395. }
  2396. xmlPowers[9] = { -- notwater
  2397. attribute = "notwater",
  2398. func = function()
  2399. deactivateWater = true
  2400. end
  2401. }
  2402. xmlPowers[10] = { -- setvampire
  2403. attribute = "setvampire",
  2404. func = function(coordinates)
  2405. if mode.grounds.totalPlayers > 2 then
  2406. local coord,axY = xml.getCoordinates(coordinates)
  2407.  
  2408. local vampires,p = {},{}
  2409. for k,v in next,mode.grounds.info do
  2410. if v.isOnline then
  2411. p[#p + 1] = k
  2412. end
  2413. end
  2414. local randomVamp = ""
  2415. for i = 1,mathfloor(mode.grounds.totalPlayers/3) do
  2416. repeat
  2417. randomVamp = tablerandom(p)
  2418. until not tablefind(vampires,randomVamp)
  2419. vampires[#vampires + 1] = randomVamp
  2420. end
  2421. for k,v in next,vampires do
  2422. if type(coord) == "table" then
  2423. local c = tablerandom(coord)
  2424. tfm.exec.movePlayer(v,c.x,c.y)
  2425. else
  2426. if axY == 0 then
  2427. tfm.exec.movePlayer(v,coord,mathrandom(10,mode.grounds.mapInfo[4] - 10))
  2428. else
  2429. tfm.exec.movePlayer(v,mathrandom(10,mode.grounds.mapInfo[4] - 10),axY)
  2430. end
  2431. end
  2432. tfm.exec.setVampirePlayer(v)
  2433. end
  2434. else
  2435. tableforeach(mode.grounds.info,tfm.exec.setVampirePlayer)
  2436. end
  2437. end
  2438. }
  2439. xmlPowers[11] = { -- shaman
  2440. attribute = "shaman",
  2441. func = function(t)
  2442. if t ~= "" then
  2443. ui.setShamanName(t)
  2444. end
  2445. end
  2446. }
  2447.  
  2448. xml.attribFunc(currentXml.xml or "",xmlPowers)
  2449.  
  2450. mode.grounds.gsys.getGroundProperties(currentXml.xml)
  2451.  
  2452. if not deactivateWater then
  2453. for k,v in next,mode.grounds.gsys.grounds do
  2454. if v.T == 9 then
  2455. mode.grounds.hasWater = true
  2456. for k,v in next,mode.grounds.info do
  2457. v.drown = 0
  2458. mode.grounds.uibar(1,k,v.drown,0x519DDA,100,20)
  2459. end
  2460. break
  2461. end
  2462. end
  2463. end
  2464. if not mode.grounds.hasWater then
  2465. for i = 1,3 do
  2466. ui.removeTextArea(i)
  2467. end
  2468. end
  2469.  
  2470. local ini = ""
  2471. local D = stringmatch(tfm.get.room.xmlMapInfo.xml,"<D>(.-)</D>") or ""
  2472. for k,v in next,{"DS","T"} do
  2473. ini = stringmatch(D,"<"..v.." (.-)/>")
  2474. if ini then
  2475. break
  2476. end
  2477. end
  2478. ini = ini or ""
  2479. local sX = stringmatch(ini,"X=\"(.-)\"")
  2480. local sY = stringmatch(ini,"Y=\"(.-)\"")
  2481. mode.grounds.spawnPoint = {tonumber(sX) or 0,tonumber(sY) or 0}
  2482.  
  2483. ui.setMapName(tableconcat(mapName," <G>|<J> ") .. (#mapName > 0 and " <G>|<J> " or "") .. currentXml.author .. " <BL>- " .. tfm.get.room.currentMap)
  2484. end,
  2485. -- Loop
  2486. eventLoop = function()
  2487. mode.grounds.gsys.groundEffects()
  2488.  
  2489. if _G.currentTime % 5 == 0 then
  2490. mode.grounds.alivePlayers,mode.grounds.totalPlayers = system.players()
  2491. end
  2492.  
  2493. if not mode.grounds.isHouse and _G.currentTime == 3 and mathrandom(50) < 16 and os.time() > mode.grounds.announceTimer then
  2494. mode.grounds.announceTimer = os.time() + 5000
  2495. tfm.exec.chatMessage(stringformat("<PT>[•] <BV>%s",system.getTranslation("powersenabled")))
  2496. end
  2497.  
  2498. if mode.grounds.isHouse then
  2499. if _G.currentTime%5 == 0 then
  2500. if _G.leftTime <= 2 then
  2501. tfm.exec.newGame(mode.grounds.newMap())
  2502. end
  2503. end
  2504. else
  2505. if _G.currentTime%2 == 0 and not mode.grounds.review then
  2506. if mode.grounds.alivePlayers < 1 or _G.leftTime <= 2 then
  2507. tfm.exec.newGame(mode.grounds.newMap())
  2508. elseif mode.grounds.alivePlayers == 1 and _G.leftTime > 50 and mode.grounds.totalPlayers > 1 then
  2509. tfm.exec.setGameTime(30)
  2510. elseif mode.grounds.podium > 5 and mode.grounds.alivePlayers > 3 then
  2511. tfm.exec.setGameTime(20,false)
  2512. end
  2513. end
  2514. end
  2515.  
  2516. --[[
  2517. local grounds = {}
  2518. for k,v in next,mode.grounds.despawnGrounds do
  2519. grounds[k] = v
  2520. end
  2521. for k,v in next,grounds do
  2522. if os.time() > v[2] then
  2523. tfm.exec.removePhysicObject(v[1])
  2524. tableremove(mode.grounds.despawnGrounds,k)
  2525. end
  2526. end
  2527. ]]
  2528.  
  2529. for n,v in next,mode.grounds.info do
  2530. v.isWalking = (tfm.get.room.playerList[n] and (tfm.get.room.playerList[n].movingRight or tfm.get.room.playerList[n].movingLeft) or false)
  2531. v.right = (tfm.get.room.playerList[n] and (tfm.get.room.playerList[n].isFacingRight) or false)
  2532. if v.powersOP.GTYPE ~= 7 then -- Sand
  2533. ui.removeTextArea(-1,n)
  2534. end
  2535. if mode.grounds.hasWater then
  2536. if _G.currentTime%2 == 0 then
  2537. if tfm.get.room.playerList[n] then
  2538. if not tfm.get.room.playerList[n].isDead and v.powersOP.GTYPE ~= 9 then -- Water
  2539. if v.drown > 0 then
  2540. v.drown = v.drown - mathrandom(1,mathfloor(v.stats.powers.water[1]))
  2541. mode.grounds.uibar(1,n,v.drown,0x519DDA,100,20)
  2542. end
  2543. end
  2544. end
  2545. end
  2546. end
  2547. end
  2548. end,
  2549. -- Keyboard
  2550. eventKeyboard = function(n,k,d,x,y)
  2551. tfm.get.room.playerList[n].x = x
  2552. tfm.get.room.playerList[n].x = y
  2553. if tablefind(mode.grounds.bindKeys,k) then
  2554. if k < 4 then
  2555. if k == 0 then
  2556. mode.grounds.info[n].right = false
  2557. elseif k == 2 then
  2558. mode.grounds.info[n].right = true
  2559. end
  2560. elseif k == stringbyte("O") then
  2561. mode.grounds.eventChatCommand(n,"o")
  2562. elseif k == stringbyte("P") then
  2563. if mode.grounds.info[n].profileAccessing then
  2564. mode.grounds.eventTextAreaCallback(nil,n,"profile.close")
  2565. else
  2566. if os.time() > mode.grounds.info[n].profileTimer then
  2567. mode.grounds.info[n].profileTimer = os.time() + 1e3
  2568. mode.grounds.eventChatCommand(n,"p")
  2569. end
  2570. end
  2571. elseif k == stringbyte("H") then
  2572. mode.grounds.eventChatCommand(n,"h")
  2573. elseif k == stringbyte("K") then
  2574. mode.grounds.eventChatCommand(n,"k")
  2575. end
  2576. else
  2577. if k == 32 and os.time() > mode.grounds.info[n].powersOP.TIMER then
  2578. local ms = 0
  2579. local power = {0,0}
  2580. if mode.grounds.info[n].powersOP.GTYPE == 8 then -- Cloud
  2581. power = mode.grounds.info[n].stats.powers.cloud
  2582. ms = power[2]
  2583. tfm.exec.movePlayer(n,0,0,true,0,-power[1],true)
  2584. elseif mode.grounds.info[n].powersOP.GTYPE == 1 and mode.grounds.info[n].isWalking then -- Ice
  2585. power = mode.grounds.info[n].stats.powers.ice
  2586. ms = power[2]
  2587. tfm.exec.movePlayer(n,0,0,false,(mode.grounds.info[n].right and power[1] or -power[1]),0,true)
  2588. elseif mode.grounds.info[n].powersOP.GTYPE == 11 and not mode.grounds.info[n].isWalking then -- Snow
  2589. power = mode.grounds.info[n].stats.powers.snow
  2590. ms = power[2]
  2591. tfm.exec.addShamanObject(34,x + (mode.grounds.info[n].right and 20 or -20),y - 5,0,(mode.grounds.info[n].right and power[1] or -power[1]))
  2592. tfm.exec.playEmote(n,26)
  2593. elseif mode.grounds.info[n].powersOP.GTYPE == 10 and not mode.grounds.info[n].isWalking then -- Stone
  2594. power = mode.grounds.info[n].stats.powers.stone
  2595. local id = tfm.get.room.playerList[n].id
  2596. if not mode.grounds.despawnGrounds[id] then--if not tablefind(mode.grounds.despawnGrounds,id,1) then
  2597. ms = power[3]
  2598. local halfSize = (power[1]/2) + 15
  2599. tfm.exec.addPhysicObject(id,x + (mode.grounds.info[n].right and halfSize or -halfSize),y + 32 - halfSize,{
  2600. type = 10,
  2601. miceCollision = true,
  2602. groundCollision = false,
  2603. width = power[1],
  2604. height = power[1],
  2605. friction = .3,
  2606. restitution = 0
  2607. })
  2608. mode.grounds.despawnGrounds[id] = true
  2609.  
  2610. system.newTimer(function()
  2611. tfm.exec.removePhysicObject(id)
  2612. mode.grounds.despawnGrounds[id] = nil
  2613. end,power[2],false)
  2614. --tableinsert(mode.grounds.despawnGrounds,{id,os.time() + power[2]})
  2615. end
  2616. end
  2617. mode.grounds.info[n].powersOP.TIMER = os.time() + ms
  2618. system.bindKeyboard(n,32,true,false)
  2619. end
  2620. mode.grounds.info[n].powersOP.GTYPE = -1
  2621. end
  2622. end,
  2623. -- Commands
  2624. eventChatCommand = function(n,c)
  2625. if system.isPlayer(n) then
  2626. c = deactivateAccents(c)
  2627. system.disableChatCommandDisplay(c,true)
  2628. local p = stringsplit(c,"[^%s]+",stringlower)
  2629. disableChatCommand(p[1])
  2630. if (p[1] == mode.grounds.cmds.shop or p[1] == "o") and not mode.grounds.isHouse then
  2631. if mode.grounds.info[n].shop.accessing then
  2632. mode.grounds.eventTextAreaCallback(nil,n,"shop.close")
  2633. else
  2634. if os.time() > mode.grounds.info[n].shop.timer then
  2635. mode.grounds.info[n].shop.timer = os.time() + 1200
  2636. mode.grounds.uishop(n)
  2637. end
  2638. end
  2639. elseif (p[1] == mode.grounds.cmds.profile or p[1] == "p") and not mode.grounds.isHouse then
  2640. if p[2] then
  2641. p[2] = stringnick(p[2])
  2642. if mode.grounds.info[p[2]] then
  2643. mode.grounds.uiprofile(n,p[2])
  2644. end
  2645. else
  2646. mode.grounds.uiprofile(n,n)
  2647. end
  2648. mode.grounds.info[n].profileAccessing = true
  2649. elseif p[1] == mode.grounds.cmds.help or p[1] == "h" then
  2650. if mode.grounds.info[n].menu.accessing then
  2651. mode.grounds.eventTextAreaCallback(nil,n,"menu.close")
  2652. else
  2653. if os.time() > mode.grounds.info[n].menu.timer then
  2654. mode.grounds.info[n].menu.timer = os.time() + 1e3
  2655. mode.grounds.uimenu(n)
  2656. end
  2657. end
  2658. elseif p[1] == mode.grounds.cmds.langue then
  2659. p[2] = p[2] and stringlower(p[2]) or nil
  2660. if p[2] and (p[2] == "default" or mode.grounds.translations[p[2]]) then
  2661. if p[2] == "default" then
  2662. mode.grounds.info[n].langue = (mode.grounds.translations[tfm.get.room.playerList[n].community] and tfm.get.room.playerList[n].community or mode.grounds.langue)
  2663. else
  2664. mode.grounds.info[n].langue = stringlower(p[2])
  2665. end
  2666. tfm.exec.chatMessage(stringformat("<PT>[•] <BV>%s",stringformat(system.getTranslation("language",n),stringupper(mode.grounds.info[n].langue))),n)
  2667. else
  2668. tfm.exec.chatMessage(stringformat("<PT>[•] <J>!%s <PS>%s",p[1],tableconcat(mode.grounds.langues," <G>-</G> ")),n)
  2669. end
  2670. elseif (p[1] == mode.grounds.cmds.leaderboard or p[1] == "k") and not mode.grounds.isHouse then
  2671. if mode.grounds.info[n].leaderboardAccessing then
  2672. mode.grounds.eventTextAreaCallback(nil,n,"ranking.close")
  2673. else
  2674. if os.time() > mode.grounds.info[n].leaderboardTimer then
  2675. mode.grounds.info[n].leaderboardTimer = os.time() + 1e3
  2676. mode.grounds.uileaderboard(n)
  2677. end
  2678. end
  2679. elseif p[1] == mode.grounds.cmds.info or p[1] == "?" then
  2680. local grounds = system.getTranslation("grounds",n)
  2681. local ground = grounds[mode.grounds.info[n].powersOP.GTYPE]
  2682. if ground then
  2683. mode.grounds.uidisplayInfo(n,{"info","grounds",stringgsub(ground[1],"'","#"),ground[2]})
  2684. end
  2685. elseif p[1] == "mapinfo" and mode.grounds.mapInfo[2] > 0 then
  2686. tfm.exec.chatMessage(stringformat("<PT>[•] <BV>G%s (%s) - %s - @%s",mode.grounds.mapInfo[2],mode.grounds.G[mode.grounds.mapInfo[2]].name,tfm.get.room.xmlMapInfo.author,mode.grounds.mapInfo[1]),n)
  2687. else
  2688. local isAdmin,isMapEv,isTranslator = system.roomAdmins[n],tablefind(mode.grounds.staff.mapEvaluators,n,1),tablefind(mode.grounds.staff.translators,n,1)
  2689. if p[1] == mode.grounds.cmds.pw or p[1] == "pw" then
  2690. if isAdmin then
  2691. local newPassword = p[2] and tableconcat(p," ",nil,2) or ""
  2692. local pwMsg = system.getTranslation("password")
  2693. if newPassword == "" then
  2694. tfm.exec.chatMessage(stringformat("<R>[•] %s",pwMsg.off))
  2695. else
  2696. local xxx = stringrep("*",#newPassword)
  2697. for k in next,mode.grounds.info do
  2698. if system.roomAdmins[k] and system.isPlayer(k) then
  2699. tfm.exec.chatMessage(stringformat("<R>[•] %s",stringformat(pwMsg.on,newPassword)),k)
  2700. else
  2701. tfm.exec.chatMessage(stringformat("<R>[•] %s",stringformat(pwMsg.on,xxx)),k)
  2702. end
  2703. end
  2704. end
  2705. tfm.exec.setRoomPassword(newPassword)
  2706. else
  2707. tfm.exec.chatMessage("<ROSE>[•] /room #" .. module._NAME .. mathrandom(0,999) .. "@" .. n,n)
  2708. end
  2709. end
  2710. if not system.isRoom then
  2711. local permission = (mode.grounds.isHouse and system.roomAdmins[n] or isMapEv)
  2712. if p[1] == "time" and permission then
  2713. tfm.exec.setGameTime(p[2] or 1e7)
  2714. elseif p[1] == "np" and p[2] and permission then
  2715. mode.grounds.mapInfo = {0,0,0,0,"CAA4CF"}
  2716. tfm.exec.newGame(p[2])
  2717. elseif p[1] == "review" and isMapEv then
  2718. mode.grounds.review = not mode.grounds.review
  2719. tfm.exec.chatMessage("<BV>[•] REVIEW MODE : " .. stringupper(tostring(mode.grounds.review)),n)
  2720. tfm.exec.disableAfkDeath(mode.grounds.review)
  2721. if mode.grounds.review then
  2722. tableforeach(mode.grounds.info,tfm.exec.respawnPlayer)
  2723. end
  2724. elseif p[1] == "next" and _G.currentTime > 10 and permission then
  2725. tfm.exec.newGame(mode.grounds.newMap())
  2726. elseif p[1] == "again" and _G.currentTime > 10 and permission then
  2727. if tfm.get.room.currentMap then
  2728. tfm.exec.newGame(tfm.get.room.currentMap)
  2729. end
  2730. end
  2731. end
  2732. if p[1] == "is" and (mode.grounds.isHouse or isMapEv) then
  2733. p[2] = p[2] or tfm.get.room.currentMap
  2734. p[2] = tonumber(stringmatch(p[2],"@?(%d+)")) or 0
  2735.  
  2736. local exist,index = tablefind(mode.grounds.maps,p[2],1)
  2737. local cat = exist and mode.grounds.maps[index][2] or 0
  2738. tfm.exec.chatMessage(stringformat("<BV>[•] @%s : %s",p[2],stringupper(tostring(exist)) .. (exist and " (G"..cat..")" or "")),n)
  2739. end
  2740. if p[1] == "check" and isTranslator then
  2741. p[2] = p[2] and stringlower(p[2]) or nil
  2742. if p[2] and mode.grounds.translations[p[2]] then
  2743. local newP3 = p[3] and system.loadTable("mode.grounds.translations."..p[2].."."..p[3]) or {}
  2744. if newP3 and type(newP3) == "string" then
  2745. tfm.exec.chatMessage("<CEP>[•] [" .. p[3] .. "] : <N><VI>\"</VI>" .. newP3 .. "<VI>\"</VI>",n)
  2746. else
  2747. tfm.exec.chatMessage("<CEP>[•] " .. (p[3] and "Invalid! Try one of these indexes:" or "!" .. p[1] .. " " .. p[2] .. " <VI>id"),n)
  2748. for k,v in next,mode.grounds.translationIndexes do
  2749. tfm.exec.chatMessage("<N>\t\t" .. v,n)
  2750. end
  2751. end
  2752. else
  2753. tfm.exec.chatMessage("<CEP>[•] !" .. p[1] .. " " .. tableconcat(mode.grounds.langues," <G>-</G> "),n)
  2754. end
  2755. end
  2756. end
  2757. end
  2758. end,
  2759. -- Victory
  2760. eventPlayerWon = function(n)
  2761. if mode.grounds.availableRoom and mode.grounds.info[n].groundsDataLoaded and system.isPlayer(n) then
  2762. mode.grounds.podium = mode.grounds.podium + 1
  2763.  
  2764. if mode.grounds.podium < 4 then
  2765. mode.grounds.info[n].stats.podiums = mode.grounds.info[n].stats.podiums + 1
  2766.  
  2767. local addedCoins = 20 - mode.grounds.podium * 5
  2768. mode.grounds.info[n].stats.groundsCoins = mode.grounds.info[n].stats.groundsCoins + addedCoins
  2769. tfm.exec.setPlayerScore(n,4-podium,true)
  2770. tfm.exec.chatMessage(stringformat("<PT>[•] <BV>%s",stringformat(system.getTranslation("gotcoin",n),"<J>+$"..addedCoins.."</J>")),n)
  2771.  
  2772. if mode.grounds.podium == 1 then
  2773. tfm.exec.setGameTime(60,false)
  2774. end
  2775. else
  2776. if mode.grounds.podium == 4 then
  2777. tfm.exec.setGameTime(30,false)
  2778. end
  2779.  
  2780. mode.grounds.info[n].stats.groundsCoins = mode.grounds.info[n].stats.groundsCoins + 1
  2781. tfm.exec.setPlayerScore(n,1,true)
  2782. end
  2783.  
  2784. if mode.grounds.hasWater then
  2785. mode.grounds.uibar(1,n,mode.grounds.info[n].drown,0x6FDA51,100,20)
  2786. end
  2787.  
  2788. if system.miscAttrib ~= 0 then
  2789. if mode.grounds.podium == system.miscAttrib then
  2790. tfm.exec.setGameTime(0)
  2791. end
  2792. end
  2793. end
  2794.  
  2795. if mode.grounds.review or mode.grounds.isHouse then
  2796. tfm.exec.respawnPlayer(n)
  2797. else
  2798. mode.grounds.info[n].canRev = false
  2799. end
  2800. end,
  2801. -- Died
  2802. eventPlayerDied = function(n)
  2803. if mode.grounds.info[n].groundsDataLoaded and mode.grounds.availableRoom then
  2804. mode.grounds.info[n].stats.deaths = mode.grounds.info[n].stats.deaths + 1
  2805. end
  2806. if mode.grounds.hasWater then
  2807. if mode.grounds.info[n].drown > 0 then
  2808. mode.grounds.uibar(1,n,mode.grounds.info[n].drown,0xDA516D,100,20)
  2809. end
  2810. end
  2811.  
  2812. system.bindKeyboard(n,32,true,false)
  2813. ui.removeTextArea(-1,n)
  2814.  
  2815. if mode.grounds.review or mode.grounds.isHouse then
  2816. tfm.exec.respawnPlayer(n)
  2817. end
  2818. end,
  2819. -- Left
  2820. eventPlayerLeft = function(n)
  2821. if mode.grounds.info[n] then
  2822. mode.grounds.info[n].isOnline = false
  2823. end
  2824. end,
  2825. -- Respawn
  2826. eventPlayerRespawn = function(n)
  2827. if mode.grounds.info[n].checkpoint ~= -1 then
  2828. local g = mode.grounds.gsys.grounds[mode.grounds.info[n].checkpoint]
  2829. local hTP = mode.grounds.gsys.getTpPos(g,true)
  2830. tfm.exec.movePlayer(n,hTP[1],hTP[2])
  2831. end
  2832. if mode.grounds.info[n].groundsDataLoaded and mode.grounds.availableRoom then
  2833. mode.grounds.info[n].stats.rounds = mode.grounds.info[n].stats.rounds + 1
  2834. end
  2835. if mode.grounds.hasWater then
  2836. mode.grounds.uibar(1,n,mode.grounds.info[n].drown,0x519DDA,100,20)
  2837. end
  2838.  
  2839. if not mode.grounds.isHouse then
  2840. tfm.exec.chatMessage(stringformat("<R>[•] %s",system.getTranslation("zombie",n)),n)
  2841. end
  2842. end,
  2843. }
  2844.  
  2845. --[[ Jokenpo ]]--
  2846. mode.jokenpo = {
  2847. -- Translations
  2848. translations = {
  2849. en = {
  2850. -- Init
  2851. welcome = "Welcome to <ROSE>#Jokenpo<CE>! Choose a chair, press space and start playing!\n\tReport any issue to Bolodefchoco",
  2852.  
  2853. -- Simple words
  2854. round = "Round",
  2855. players = "Players",
  2856. won = "won the round!",
  2857. tie = "Tie!",
  2858. victory = "won the game!",
  2859.  
  2860. -- Info
  2861. guide = "Press\n\t<PS>»</PS> %s<PT> - Rock</PT>\n\t<PS>»</PS> %s<PT> - Paper</PT>\n\t<PS>»</PS> %s<PT> - Scissor (Pufferfish)</PT>",
  2862.  
  2863. -- Game
  2864. items = {"Rock","Paper","Scissor"},
  2865. selected = "You've selected the item %s!",
  2866. },
  2867. br = {
  2868. welcome = "Bem-vindo ao <ROSE>#Jokenpo<CE>! Escolha uma cadeira, aperte espaço e comece a jogar!\n\tReporte qualquer problema para Bolodefchoco",
  2869.  
  2870. round = "Partida",
  2871. players = "Jogadores",
  2872. won = "venceu a partida!",
  2873. tie = "Empate!",
  2874. victory = "ganhou!",
  2875.  
  2876. guide = "Pressione\n\t<PS>»</PS> %s<PT> - Pedra</PT>\n\t<PS>»</PS> %s<PT> - Papel</PT>\n\t<PS>»</PS> %s<PT> - Tesoura (Baiacu)</PT>",
  2877.  
  2878. items = {"Pedra","Papel","Tesoura"},
  2879. selected = "Você selecionou o item %s!",
  2880. },
  2881. },
  2882. langue = "en",
  2883. -- Maps
  2884. maps = {5198315,4093087},
  2885. buildSquares = function(c)
  2886. tfm.exec.removePhysicObject(1)
  2887. for k,v in next,{{346,224},{454,224},{400,105}} do
  2888. for i = 1,4 do
  2889. local x = i == 1 and v[1] + 28 or i == 2 and v[1] - 28 or v[1]
  2890. local y = i == 3 and v[2] + 28 or i == 4 and v[2] - 28 or v[2]
  2891.  
  2892. local w = x == v[1] and 46 or 10
  2893. local h = w == 10 and 66 or 10
  2894.  
  2895. tfm.exec.addPhysicObject(i..k,x,y,{
  2896. type = 12,
  2897. color = c[k],
  2898. width = w,
  2899. height = h,
  2900. })
  2901. end
  2902. end
  2903. end,
  2904. -- New Round Settings
  2905. playing = false,
  2906. players = {},
  2907. colors = {0xE3454D,0x4577E3,0x45E374},
  2908. timer = 9.5,
  2909. partialTimer = 0,
  2910. tie = 0,
  2911. round = 0,
  2912. roundsPerGame = 5,
  2913. -- Game settings
  2914. objects = {
  2915. 85,
  2916. 95,
  2917. 65,
  2918. },
  2919. -- Emotes
  2920. emote = {
  2921. sit = 8,
  2922. victory = 24,
  2923. fail = 5,
  2924. tie = 4,
  2925. no = 2
  2926. },
  2927. -- Battle
  2928. decision = function()
  2929. for i = 1,2 do
  2930. mode.jokenpo.players[i].obj = mode.jokenpo.players[i].obj ~= 0 and mode.jokenpo.players[i].obj or false
  2931. if mode.jokenpo.players[i].obj then
  2932. mode.jokenpo.players[i].remId = tfm.exec.addShamanObject(mode.jokenpo.objects[mode.jokenpo.players[i].obj],({350,455})[i],200)
  2933. end
  2934. end
  2935.  
  2936. local winner = ((mode.jokenpo.players[1].obj and mode.jokenpo.players[2].obj) and ((3 + mode.jokenpo.players[1].obj - mode.jokenpo.players[2].obj) % 3) or mode.jokenpo.players[1].obj and 1 or mode.jokenpo.players[2].obj and 2 or 0)
  2937.  
  2938. if winner == 0 then
  2939. mode.jokenpo.tie = mode.jokenpo.tie + 1
  2940. tfm.exec.chatMessage("<CE>[•] <J>" .. system.getTranslation("tie"))
  2941.  
  2942. for k,v in next,mode.jokenpo.players do
  2943. tfm.exec.playEmote(v.name,mode.jokenpo.emote.tie)
  2944. end
  2945. else
  2946. mode.jokenpo.players[winner].score = mode.jokenpo.players[winner].score + 1
  2947. tfm.exec.playEmote(mode.jokenpo.players[winner].name,mode.jokenpo.emote.victory)
  2948.  
  2949. local looser = (winner == 1 and 2 or 1)
  2950. local looserEmote = mode.jokenpo.emote.fail
  2951. if not mode.jokenpo.players[looser].obj then
  2952. looserEmote = mode.jokenpo.emote.no
  2953. end
  2954. tfm.exec.playEmote(mode.jokenpo.players[looser].name,looserEmote)
  2955.  
  2956. tfm.exec.chatMessage("<CE>[•] " .. mode.jokenpo.players[winner].color .. mode.jokenpo.players[winner].name .. " " .. system.getTranslation("won"))
  2957. end
  2958.  
  2959. ui.addTextArea(5,stringformat("<font size='50'><p align='center'>%s%d <PT>| <J>%d <PT>| %s%s",mode.jokenpo.players[1].color,mode.jokenpo.players[1].score,mode.jokenpo.tie,mode.jokenpo.players[2].color,mode.jokenpo.players[2].score),nil,5,270,795,nil,1,1,0,true)
  2960. end,
  2961. -- Partial Next Round
  2962. pNextRound = function()
  2963. mode.jokenpo.playing = false
  2964. mode.jokenpo.timer = 9.5
  2965. mode.jokenpo.partialTimer = 3.5
  2966. mode.jokenpo.decision()
  2967. if mode.jokenpo.round == mode.jokenpo.roundsPerGame then
  2968. tablesort(mode.jokenpo.players,function(p1,p2) return p1.score > p2.score end)
  2969. if (mode.jokenpo.players[1].score == mode.jokenpo.players[2].score) or (mode.jokenpo.tie > mode.jokenpo.players[1].score) then
  2970. tfm.exec.chatMessage("<CE>[•] " .. system.getTranslation("tie"))
  2971. else
  2972. tfm.exec.chatMessage("<CE>[•] " .. mode.jokenpo.players[1].color .. mode.jokenpo.players[1].name .. " " .. system.getTranslation("victory"))
  2973. end
  2974. end
  2975. end,
  2976. -- Next Round
  2977. nextRound = function()
  2978. for i = 1,2 do
  2979. if mode.jokenpo.players[i].remId then
  2980. tfm.exec.removeObject(mode.jokenpo.players[i].remId)
  2981. end
  2982. mode.jokenpo.players[i].remId = nil
  2983. mode.jokenpo.players[i].obj = 0
  2984. end
  2985. ui.removeTextArea(5,nil)
  2986. mode.jokenpo.partialTimer = 0
  2987. if mode.jokenpo.roundsPerGame > mode.jokenpo.round then
  2988. mode.jokenpo.playing = true
  2989. mode.jokenpo.round = mode.jokenpo.round + 1
  2990. else
  2991. mode.jokenpo.playing = false
  2992. mode.jokenpo.round = 0
  2993. mode.jokenpo.tie = 0
  2994. mode.jokenpo.timer = 9.5
  2995. mode.jokenpo.partialTimer = 0
  2996. mode.jokenpo.players = {}
  2997. tfm.exec.newGame(tablerandom(mode.jokenpo.maps))
  2998. for i = 2,3 do
  2999. ui.removeTextArea(i,nil)
  3000. end
  3001. end
  3002. mode.jokenpo.uiinfo()
  3003. end,
  3004. -- Display names
  3005. displayNames = function()
  3006. if #mode.jokenpo.players == 0 then
  3007. return ""
  3008. else
  3009. return " <G>| <N>" .. system.getTranslation("players") .. " : " .. tableconcat(mode.jokenpo.players," <V>- ",function(k,v)
  3010. tfm.exec.setNameColor(v.name,mode.jokenpo.colors[v.id])
  3011. return v.color .. v.name
  3012. end)
  3013. end
  3014. end,
  3015. -- Info textareas
  3016. uiinfo = function()
  3017. ui.addTextArea(0,"<p align='center'><font size='35'><J>"..mathfloor(mode.jokenpo.timer),nil,380,85,40,40,1,1,0,true)
  3018. ui.addTextArea(1,"<p align='center'><font size='25'><J><B>X</B><font size='13'>\n"..stringformat("%02d",mode.jokenpo.tie),nil,380,207,40,nil,1,1,0,true)
  3019.  
  3020. for k,v in next,mode.jokenpo.players do
  3021. ui.addTextArea(v.id + 1,"<p align='center'>"..v.name.."\n"..stringformat("%02d",v.score),nil,v.x,165,105,nil,1,1,0,true)
  3022. end
  3023.  
  3024. ui.setMapName("<PT>#Jokenpo <G>| <N>" .. system.getTranslation("round") .. " : <V>" .. mode.jokenpo.round .. mode.jokenpo.displayNames() .. "<")
  3025. end,
  3026. -- Init
  3027. reset = function()
  3028. -- Scores
  3029. mode.jokenpo.tie = 0
  3030. mode.jokenpo.round = 0
  3031. mode.jokenpo.roundsPerGame = 5
  3032.  
  3033. -- Data
  3034. mode.jokenpo.players = {}
  3035. mode.jokenpo.playing = false
  3036.  
  3037. -- Timers
  3038. mode.jokenpo.timer = 9.5
  3039. mode.jokenpo.partialTimer = 0
  3040. end,
  3041. init = function()
  3042. mode.jokenpo.translations.pt = mode.jokenpo.translations.br
  3043.  
  3044. -- Sets the main language according to the community
  3045. if mode.jokenpo.translations[tfm.get.room.community] then
  3046. mode.jokenpo.langue = tfm.get.room.community
  3047. end
  3048.  
  3049. -- Sets the rounds per game
  3050. mode.jokenpo.roundsPerGame = mathmax(5,system.miscAttrib)
  3051.  
  3052. -- Init
  3053. for _,f in next,{"AutoShaman","AutoNewGame","PhysicalConsumables","AfkDeath"} do
  3054. tfm.exec["disable"..f]()
  3055. end
  3056. tfm.exec.setAutoMapFlipMode(false)
  3057. tfm.exec.setRoomMaxPlayers(20)
  3058.  
  3059. tfm.exec.newGame(tablerandom(mode.jokenpo.maps))
  3060. end,
  3061. -- New Player
  3062. eventNewPlayer = function(n)
  3063. tfm.exec.chatMessage("<CE>[•] " .. system.getTranslation("welcome"),n)
  3064.  
  3065. for k,v in next,{32,stringbyte("BNM",1,3)} do
  3066. system.bindKeyboard(n,v,true,true)
  3067. end
  3068.  
  3069. if mode.jokenpo.playing then
  3070. mode.jokenpo.round = mode.jokenpo.round + 1
  3071. else
  3072. tfm.exec.respawnPlayer(n)
  3073. end
  3074.  
  3075. mode.jokenpo.buildSquares(mode.jokenpo.colors)
  3076. mode.jokenpo.uiinfo()
  3077. end,
  3078. -- New Game
  3079. eventNewGame = function()
  3080. if mode.jokenpo.playing then
  3081. for k,v in next,tfm.get.room.playerList do
  3082. if not tablefind(mode.jokenpo.players,k,"name") then
  3083. tfm.exec.killPlayer(k)
  3084. end
  3085. end
  3086. end
  3087.  
  3088. mode.jokenpo.colors = {0xE3454D,0x4577E3,0x45E374}
  3089. xml.attribFunc(tfm.get.room.xmlMapInfo.xml or "",{
  3090. [1] = {
  3091. attribute = "o",
  3092. func = function(color)
  3093. local c = stringsplit(color,"[^,]+",function(o)
  3094. return stringmatch(o,"#?(.+)")
  3095. end)
  3096.  
  3097. for i = 1,#c do
  3098. mode.jokenpo.colors[i] = tonumber(c[i],16)
  3099. end
  3100. end
  3101. }
  3102. })
  3103.  
  3104. mode.jokenpo.buildSquares(mode.jokenpo.colors)
  3105. mode.jokenpo.uiinfo()
  3106. end,
  3107. -- Keyboard
  3108. eventKeyboard = function(n,k,d,x,y)
  3109. if k == 32 and #mode.jokenpo.players < 2 then
  3110. for k,v in next,{{285,330,270},{515,330,425}} do
  3111. if mathpythag(v[1],v[2],x,y,30) then
  3112. if not tablefind(mode.jokenpo.players,n,"name") then
  3113. if not tablefind(mode.jokenpo.players,k,"id") then
  3114. mode.jokenpo.players[#mode.jokenpo.players + 1] = {
  3115. name = n,
  3116. x = v[3],
  3117. score = 0,
  3118. color = stringformat("<font color='#%s'>",stringformat("%x",mode.jokenpo.colors[k])),
  3119. id = k,
  3120. obj = 0,
  3121. remId = nil,
  3122. }
  3123.  
  3124. tfm.exec.chatMessage("<CE>[•] " .. mode.jokenpo.players[#mode.jokenpo.players].color .. stringformat(system.getTranslation("guide"),"B","N","M"),n)
  3125.  
  3126. mode.jokenpo.uiinfo()
  3127. tfm.exec.playEmote(n,mode.jokenpo.emote.sit)
  3128. end
  3129. end
  3130. end
  3131. end
  3132.  
  3133. if #mode.jokenpo.players == 2 then
  3134. tablesort(mode.jokenpo.players,function(p1,p2) return p1.id < p2.id end)
  3135. mode.jokenpo.playing = true
  3136.  
  3137. mode.jokenpo.round = mode.jokenpo.round + 1
  3138. mode.jokenpo.uiinfo()
  3139. end
  3140. else
  3141. if mode.jokenpo.playing then
  3142. local foundObject,objectIndex = tablefind({stringbyte("BNM",1,3)},k)
  3143. if foundObject then
  3144. local found,i = tablefind(mode.jokenpo.players,n,"name")
  3145. if found then
  3146. i = mode.jokenpo.players[i]
  3147. if i.obj == 0 then
  3148. i.obj = objectIndex
  3149.  
  3150. tfm.exec.chatMessage("<CE>[•] " .. i.color .. stringformat(system.getTranslation("selected"),system.getTranslation("items")[objectIndex]),n)
  3151. end
  3152. end
  3153. end
  3154. end
  3155. end
  3156. end,
  3157. -- Loop
  3158. eventLoop = function()
  3159. if mode.jokenpo.playing then
  3160. if mode.jokenpo.timer > 0 then
  3161. mode.jokenpo.timer = mode.jokenpo.timer - .5
  3162. ui.addTextArea(0,"<p align='center'><font size='35'><J>"..mathfloor(mode.jokenpo.timer),nil,380,85,40,40,1,1,0,true)
  3163. for i = 1,2 do
  3164. tfm.exec.movePlayer(mode.jokenpo.players[i].name,({285,515})[i],330)
  3165. tfm.exec.playEmote(mode.jokenpo.players[i].name,26)
  3166. end
  3167. else
  3168. mode.jokenpo.pNextRound()
  3169. end
  3170. else
  3171. if mode.jokenpo.partialTimer > 0 then
  3172. mode.jokenpo.partialTimer = mode.jokenpo.partialTimer - .5
  3173. ui.addTextArea(0,"<p align='center'><font size='35'><PT>"..mathfloor(mode.jokenpo.partialTimer),nil,380,85,40,40,1,1,0,true)
  3174.  
  3175. if mode.jokenpo.partialTimer <= 0 then
  3176. mode.jokenpo.nextRound()
  3177. end
  3178. end
  3179. end
  3180. end,
  3181. -- Player Left
  3182. eventPlayerLeft = function(n)
  3183. if tablefind(mode.jokenpo.players,n,"name") then
  3184. mode.jokenpo.round = mode.jokenpo.roundsPerGame
  3185. mode.jokenpo.nextRound()
  3186. end
  3187. end,
  3188. }
  3189.  
  3190. --[[ Click ]]--
  3191. mode.click = {
  3192. -- Translations
  3193. translations = {
  3194. en = {
  3195. -- Init
  3196. welcome = "<BV>Welcome to <CH><B>#click</B><BV>!\n\t» Type <B>!p Playername</B> to open the profile of the player\n\t» Report any issue to <B>Bolodefchoco</B>",
  3197.  
  3198. -- Info
  3199. newGame = "New game in %s seconds!",
  3200. clickfast = "Click several times in the circle before %s seconds!",
  3201.  
  3202. -- Simple words
  3203. click = "CLICK!",
  3204. won = "won!",
  3205.  
  3206. -- Profile
  3207. profile = "Total clicks <BL>: <V>%s\n<J>High Score <BL>: <V>%s\n\n<J>Victories <BL>: <V>%s",
  3208. },
  3209. br = {
  3210. welcome = "<BV>Bem-vindo ao <CH><B>#click</B><BV>!\n\t\n\t» Digite <B>!p Jogador</B> para abrir o perfil do jogador\n\t» Reporte qualquer problema para <B>Bolodefchoco</B>",
  3211.  
  3212. newGame = "Novo jogo em %s segundos!",
  3213. clickfast = "Clique várias vezes no círculo antes de %s segundos!",
  3214.  
  3215. click = "CLIQUE!",
  3216. won = "venceu!",
  3217.  
  3218. profile = "Cliques totais <BL>: <V>%s\n<J>Maior pontuação <BL>: <V>%s\n\n<J>Vitórias <BL>: <V>%s",
  3219. },
  3220. },
  3221. langue = "en",
  3222. -- Data
  3223. info = {},
  3224. -- System
  3225. circle = {
  3226. id = 0,
  3227. status = false
  3228. },
  3229. spawnCircle = function(on)
  3230. if mode.click.circle.id > 0 then
  3231. tfm.exec.removeJoint(mode.click.circle)
  3232. end
  3233.  
  3234. mode.click.circle = {id = 1,status = on}
  3235.  
  3236. local color = on and 0x53D08B or 0x555D77
  3237.  
  3238. tfm.exec.addJoint(1,0,0,{
  3239. type = 0,
  3240. alpha = .9,
  3241. color = color,
  3242. foreground = false,
  3243. line = 300,
  3244. point1 = "400,200",
  3245. point2 = "400,201"
  3246. })
  3247. end,
  3248. -- Timers
  3249. partialTimer = 1,
  3250. counter = 0,
  3251. -- Ranking
  3252. uileaderboard = function()
  3253. local data = {}
  3254. for k,v in next,mode.click.info do
  3255. if v.canPlay and v.roundClick > 0 then
  3256. data[#data + 1] = {k,v.roundClick}
  3257. end
  3258.  
  3259. if v.highScore < v.roundClick then
  3260. v.highScore = v.roundClick
  3261. end
  3262. v.totalClick = v.totalClick + v.roundClick
  3263. v.roundClick = 0
  3264. end
  3265.  
  3266. tablesort(data,function(p1,p2) return p1[2] > p2[2] end)
  3267.  
  3268. local str = ""
  3269. for k,v in next,data do
  3270. if k < 51 then
  3271. if k == 1 then
  3272. mode.click.info[v[1]].victories = mode.click.info[v[1]].victories + 1
  3273. tfm.exec.chatMessage("<J>" .. v[1] .. " <G>" .. system.getTranslation("won"))
  3274. tfm.exec.setPlayerScore(v[1],1,true)
  3275. end
  3276.  
  3277. str = str .. stringformat("<J>%s. <V>%s <BL>- <PT>%sP\n",k,v[1],v[2])
  3278. end
  3279. end
  3280.  
  3281. ui.addTextArea(1,str,nil,5,30,250,330,1,1,.9,true)
  3282. end,
  3283. -- Init
  3284. reset = function()
  3285. -- Data
  3286. mode.click.info = {}
  3287. end,
  3288. init = function()
  3289. mode.click.translations.pt = mode.click.translations.br
  3290.  
  3291. -- Sets the main language according to the community
  3292. if mode.click.translations[tfm.get.room.community] then
  3293. mode.click.langue = tfm.get.room.community
  3294. end
  3295.  
  3296. -- Init
  3297. for _,f in next,{"AutoShaman","AutoScore","AutoNewGame","AfkDeath"} do
  3298. tfm.exec["disable"..f]()
  3299. end
  3300.  
  3301. tfm.exec.newGame(5993911)
  3302. end,
  3303. -- New Player
  3304. eventNewPlayer = function(n)
  3305. system.bindMouse(n,true)
  3306. if not mode.click.info[n] then
  3307. mode.click.info[n] = {
  3308. canPlay = false,
  3309. totalClick = 0,
  3310. roundClick = 0,
  3311. highScore = 0,
  3312. victories = 0,
  3313. }
  3314. end
  3315. if not mode.click.circle.status then
  3316. tfm.exec.respawnPlayer(n)
  3317. mode.click.info[n].canPlay = true
  3318. end
  3319. tfm.exec.chatMessage(system.getTranslation("welcome"),n)
  3320. end,
  3321. -- New Game
  3322. eventNewGame = function()
  3323. mode.click.spawnCircle(false)
  3324. mode.click.partialTimer = 10.5
  3325. end,
  3326. -- Loop
  3327. eventLoop = function()
  3328. if mode.click.partialTimer > 0 then
  3329. mode.click.partialTimer = mode.click.partialTimer - .5
  3330. ui.setMapName(stringformat(system.getTranslation("newGame"),"<ROSE>"..mathfloor(mode.click.partialTimer).."<J>") .. "<")
  3331. if mode.click.partialTimer <= 0 then
  3332. mode.click.spawnCircle(true)
  3333.  
  3334. mode.click.counter = mathmax(20,system.miscAttrib)
  3335.  
  3336. for k,v in next,mode.click.info do
  3337. v.canPlay = true
  3338. tfm.exec.respawnPlayer(k)
  3339. end
  3340.  
  3341. ui.removeTextArea(1,nil)
  3342. ui.setMapName(system.getTranslation("click") .. "<")
  3343. end
  3344. else
  3345. if mode.click.counter > 0 then
  3346. mode.click.counter = mode.click.counter - .5
  3347. ui.addTextArea(0,"<p align='center'><font size='28'>" .. stringformat(system.getTranslation("clickfast"),mathfloor(mode.click.counter)),nil,0,30,800,50,1,1,0,true)
  3348. if mode.click.counter <= 0 then
  3349. mode.click.spawnCircle(false)
  3350.  
  3351. mode.click.partialTimer = 10.5
  3352.  
  3353. ui.removeTextArea(0,nil)
  3354. mode.click.uileaderboard()
  3355. end
  3356. end
  3357. end
  3358. end,
  3359. -- Mouse
  3360. eventMouse = function(n,x,y)
  3361. if mode.click.circle.status then
  3362. if mode.click.info[n].canPlay then
  3363. if mathpythag(400,200,x,y,150) then
  3364. mode.click.info[n].roundClick = mode.click.info[n].roundClick + 1
  3365. tfm.exec.displayParticle(15,mathrandom(150,650),mathrandom(100,300),0,0,0,0,n)
  3366. end
  3367. end
  3368. end
  3369. end,
  3370. -- Commands
  3371. eventChatCommand = function(n,c)
  3372. local p = stringsplit(c,"[^%s]+",stringlower)
  3373. if p[1] == "p" then
  3374. p[2] = p[2] and stringnick(p[2]) or n
  3375. if mode.click.info[p[2]] then
  3376. ui.addTextArea(2,"<p align='center'><font size='18'><a:active><a href='event:close'>"..p[2].."</a><p align='left'><font size='13'>\n<J>" .. stringformat(system.getTranslation("profile"),mode.click.info[p[2]].totalClick,mode.click.info[p[2]].highScore,mode.click.info[p[2]].victories),n,620,295,175,100,1,1,1,true)
  3377. end
  3378. end
  3379. end,
  3380. -- Callbacks
  3381. eventTextAreaCallback = function(i,n,c)
  3382. if c == "close" then
  3383. ui.removeTextArea(2,n)
  3384. end
  3385. end,
  3386. -- Respawn
  3387. eventPlayerDied = function(n)
  3388. tfm.exec.respawnPlayer(n)
  3389. end,
  3390. -- Player Left
  3391. eventPlayerLeft = function(n)
  3392. mode.click.info[n].canPlay = false
  3393. end,
  3394. }
  3395.  
  3396. --[[ Presents ]]--
  3397. mode.presents = {
  3398. -- Translations
  3399. translations = {
  3400. en = {
  3401. -- Init
  3402. welcome = "<J>Welcome to <VP><B>#presents</B><J>! Choose a gap according to the gift represented and good luck! You will win if your three-gifts-sequence is correct!\nType !p PlayerName to open the profile of the specified player\n\n<CE>Developed by Bolodefchoco and projected by Ruamorangos",
  3403.  
  3404. -- Info
  3405. choose = "Choose a gift before <PT>%s seconds!",
  3406. kill = "Those who are out of the correct gift will be dead!",
  3407. newGame = "New game in <PT>%s seconds!",
  3408. nowinner = "No one won!",
  3409. appear = "You will appear in the next game!",
  3410.  
  3411. -- Simple words
  3412. rival = "Rivals",
  3413. won = "won!",
  3414.  
  3415. -- Profile
  3416. profile = "Rounds <BL>: <V>%s\n<J>Gifts <BL>: <V>%s\n\n<J>Victories <BL>: <V>%s",
  3417. },
  3418. br = {
  3419. welcome = "<J>Bem-vindo ao <VP><B>#presents</B><J>! Escolha um buraco de acordo com o presente representado e boa sorte! Você ganhará se sua sequência nos três presentes estiver correta!\nDigite !p Jogador para abrir o perfil o jogador especificado\n\n<CE>Desenvolvido por Bolodefchoco, pedido por Ruamorangos",
  3420.  
  3421. choose = "Escolha um presente antes de <PT>%s segundos!",
  3422. kill = "Aqueles que estão fora do presente correto serão mortos!",
  3423. newGame = "Novo jogo em <PT>%s segundos!",
  3424. nowinner = "Ninguém ganhou!",
  3425. appear = "Você irá aparecer no próximo jogo!",
  3426.  
  3427. rival = "Rivais",
  3428. won = "venceu!",
  3429.  
  3430. profile = "Partidas <BL>: <V>%s\n<J>Presents <BL>: <V>%s\n\n<J>Vitórias <BL>: <V>%s",
  3431. },
  3432. },
  3433. langue = "en",
  3434. -- Data
  3435. info = {},
  3436. -- System
  3437. isRunning = false,
  3438. gifts = {},
  3439. -- Timers
  3440. chooseTimer = 15,
  3441. blockTimer = 0,
  3442. newMapTimer = 0,
  3443. currentGift = 1,
  3444. -- Map
  3445. generateMap = function()
  3446. mode.presents.isRunning = true
  3447. mode.presents.gifts = {
  3448. [1] = tablerandom({2104,2102,2100,2101,2103,2100,2104,2102,2103,2101,2104,2102,2100,2101,2103,2100,2104,2102,2103,2101,2104,2102,2100,2101,2103,2100,2104,2102,2103,2101}),
  3449. [2] = tablerandom({2102,2100,2101,2103,2100,2104,2102,2103,2101,2104,2102,2100,2101,2103,2100,2104,2102,2103,2101,2104,2102,2100,2101,2103,2100,2104,2102,2103,2101,2104}),
  3450. [3] = tablerandom({2100,2101,2103,2100,2104,2102,2103,2101,2104,2102,2100,2101,2103,2100,2104,2102,2103,2101,2104,2102,2100,2101,2103,2100,2104,2102,2103,2101,2104,2102})
  3451. }
  3452.  
  3453. tfm.exec.newGame('<C><P DS="m;250,120,400,120,550,120" D="x_transformice/x_inventaire/'..mode.presents.gifts[1]..'.jpg,230,60;x_transformice/x_inventaire/'..mode.presents.gifts[2]..'.jpg,380,60;x_transformice/x_inventaire/'..mode.presents.gifts[3]..'.jpg,530,60;x_transformice/x_inventaire/2100.jpg,140,320;x_transformice/x_inventaire/2101.jpg,260,320;x_transformice/x_inventaire/2102.jpg,380,320;x_transformice/x_inventaire/2103.jpg,500,320;x_transformice/x_inventaire/2104.jpg,620,320" /><Z><S><S P="1,0.0001,20,0.2,90,1,0,0" H="700" L="15" X="400" c="3" Y="161" T="4" /><S X="100" P="0,0,20,0.2,0,0,0,0" L="40" H="135" c="3" Y="335" T="4" /><S H="135" P="0,0,20,0.2,0,0,0,0" L="40" X="220" c="3" Y="335" T="4" /><S X="340" P="0,0,20,0.2,0,0,0,0" L="40" H="135" c="3" Y="335" T="4" /><S H="135" P="0,0,20,0.2,0,0,0,0" L="40" X="460" c="3" Y="335" T="4" /><S X="580" P="0,0,20,0.2,0,0,0,0" L="40" H="135" c="3" Y="335" T="4" /><S H="40" P="0,0,0.3,0.2,0,0,0,0" L="40" X="100" c="3" Y="160" T="0" /><S X="700" P="0,0,0.3,0.2,0,0,0,0" L="40" H="40" c="3" Y="160" T="0" /><S X="550" P="0,0,0.3,0.2,0,0,0,0" L="40" H="40" c="3" Y="160" T="0" /><S X="400" P="0,0,0.3,0.2,0,0,0,0" L="40" H="40" c="3" Y="160" T="0" /><S X="250" P="0,0,0.3,0.2,0,0,0,0" L="40" H="40" c="3" Y="160" T="0" /><S H="20" P="0,0,0.3,0.2,0,0,0,0" L="800" X="400" Y="10" T="0" /><S H="135" P="0,0,20,0.2,0,0,0,0" L="40" X="700" c="3" Y="335" T="4" /><S X="400" P="0,0,0.3,0.2,0,0,0,0" L="800" H="100" c="3" Y="415" T="0" /><S P="0,0,0.3,0.2,0,0,0,0" H="10" L="50" o="324650" X="745" c="3" Y="138" T="13" /><S X="55" P="0,0,0.3,0.2,0,0,0,0" L="50" o="324650" H="10" c="3" Y="138" T="13" /><S P="0,0,0.3,0.2,0,0,0,0" H="140" L="100" o="324650" X="55" c="3" Y="72" T="12" /><S X="745" P="0,0,0.3,0.2,0,0,0,0" L="100" o="324650" H="140" c="3" Y="72" T="12" /><S P="0,0,0,0,0,0,0,0" H="102" L="581" o="6a7495" X="401" c="4" v="3001" Y="78" T="12" /></S><D /><O /><L><JR M2="10" M1="0" /></L></Z></C>')
  3454. end,
  3455. -- Kill wrong gaps
  3456. killOutOfRange = function()
  3457. local gift = mode.presents.gifts[mode.presents.currentGift] - 2099
  3458. for k,v in next,tfm.get.room.playerList do
  3459. if not v.isDead then
  3460. if v.x >= (gift * 120) and v.x <= (gift * 120 + 80) and v.y > 267 then
  3461. mode.presents.info[k].gifts = mode.presents.info[k].gifts + 1
  3462. tfm.exec.setPlayerScore(k,1,true)
  3463. else
  3464. tfm.exec.killPlayer(k)
  3465. end
  3466. end
  3467. end
  3468. end,
  3469. -- Victory
  3470. victory = function(noone)
  3471. if noone then
  3472. tfm.exec.chatMessage("<J>" .. system.getTranslation("nowinner"))
  3473. mode.presents.chooseTimer = 0
  3474. mode.presents.blockTimer = 0
  3475. else
  3476. tfm.exec.chatMessage("<S>" .. tableconcat(system.players(true),"<J>, <S>",function(k,v)
  3477. mode.presents.info[v].victories = mode.presents.info[v].victories + 1
  3478. return v
  3479. end) .. " <J>" .. system.getTranslation("won"))
  3480. end
  3481. mode.presents.newMapTimer = 10.5
  3482. end,
  3483. -- Init
  3484. reset = function()
  3485. -- Data
  3486. mode.presents.info = {}
  3487. end,
  3488. init = function()
  3489. mode.presents.translations.pt = mode.presents.translations.br
  3490.  
  3491. -- Sets the main language according to the community
  3492. if mode.presents.translations[tfm.get.room.community] then
  3493. mode.presents.langue = tfm.get.room.community
  3494. end
  3495.  
  3496. -- Init
  3497. for _,f in next,{"AutoShaman","AutoNewGame","AutoScore","AfkDeath","MortCommand","DebugCommand","PhysicalConsumables"} do
  3498. tfm.exec["disable"..f]()
  3499. end
  3500. tfm.exec.setRoomMaxPlayers(30)
  3501.  
  3502. mode.presents.generateMap()
  3503.  
  3504. -- Auto Admin
  3505. system.roomAdmins.Ruamorangos = true
  3506. end,
  3507. -- New Player
  3508. eventNewPlayer = function(n)
  3509. if not mode.presents.info[n] then
  3510. mode.presents.info[n] = {
  3511. rounds = 0,
  3512. gifts = 0,
  3513. victories = 0,
  3514. }
  3515. end
  3516.  
  3517. tfm.exec.chatMessage(system.getTranslation("welcome"),n)
  3518.  
  3519. if mode.presents.isRunning then
  3520. local m = "<PT>" .. system.getTranslation("appear")
  3521. ui.addTextArea(0,"<p align='center'><font size='20'><VP>" .. m,n,216,65,365,35,1,1,1,true)
  3522. tfm.exec.chatMessage(m,n)
  3523. else
  3524. tfm.exec.respawnPlayer(n)
  3525. end
  3526. end,
  3527. -- New Game
  3528. eventNewGame = function()
  3529. if mode.presents.isRunning then
  3530. for i,x in next,{250,400,550} do
  3531. tfm.exec.addPhysicObject(i,x,75,{
  3532. type = 12,
  3533. height = 90,
  3534. width = 90,
  3535. miceCollision = false,
  3536. groundCollision = false,
  3537. color = 0x6A7495
  3538. })
  3539. end
  3540. for i = 0,1 do
  3541. ui.removeTextArea(i)
  3542. end
  3543. mode.presents.chooseTimer = 15
  3544. mode.presents.blockTimer = 0
  3545. mode.presents.newMapTimer = 0
  3546. mode.presents.currentGift = 1
  3547. for k,v in next,mode.presents.info do
  3548. v.rounds = v.rounds + 1
  3549. end
  3550. end
  3551. end,
  3552. -- Loop
  3553. eventLoop = function()
  3554. local mapName = "<N>" .. system.getTranslation("rival") .." : <V>" .. mathisNegative(system.players()-1,0)
  3555. if _G.currentTime > 4 and mode.presents.isRunning then
  3556. if mode.presents.chooseTimer > 0 then
  3557. mode.presents.chooseTimer = mode.presents.chooseTimer - .5
  3558.  
  3559. if mode.presents.chooseTimer <= 0 then
  3560. mode.presents.blockTimer = 5
  3561. tfm.exec.addPhysicObject(4,400,270,{
  3562. type = 4,
  3563. height = 10,
  3564. width = 640,
  3565. miceCollision = true,
  3566. groundCollision = false
  3567. })
  3568. tfm.exec.removePhysicObject(mode.presents.currentGift)
  3569. else
  3570. mapName = mapName .. " <G>| <J>" .. stringformat(system.getTranslation("choose"),mathfloor(mode.presents.chooseTimer).."<J>")
  3571. end
  3572.  
  3573. if system.players() == 0 then
  3574. mode.presents.victory(true)
  3575. end
  3576. end
  3577.  
  3578. if mode.presents.blockTimer > 0 then
  3579. mode.presents.blockTimer = mode.presents.blockTimer - .5
  3580.  
  3581. if mode.presents.blockTimer == 2 then
  3582. mode.presents.killOutOfRange()
  3583. end
  3584.  
  3585. if mode.presents.blockTimer <= 0 then
  3586. mode.presents.currentGift = mode.presents.currentGift + 1
  3587. if mode.presents.currentGift > 3 then
  3588. mode.presents.victory()
  3589. else
  3590. tfm.exec.removePhysicObject(4)
  3591. mode.presents.chooseTimer = 15
  3592. end
  3593. else
  3594. mapName = mapName .. " <G>| <R>" .. system.getTranslation("kill")
  3595. end
  3596. end
  3597.  
  3598. if mode.presents.newMapTimer > 0 then
  3599. mode.presents.newMapTimer = mode.presents.newMapTimer - .5
  3600.  
  3601. mapName = "<PS>" .. stringformat(system.getTranslation("newGame"),mathfloor(mode.presents.newMapTimer) .. "<PS>")
  3602. if mode.presents.newMapTimer <= 0 then
  3603. mode.presents.generateMap()
  3604. end
  3605. end
  3606. end
  3607. ui.setMapName(mapName .. "<")
  3608. end,
  3609. -- Commands
  3610. eventChatCommand = function(n,c)
  3611. local p = stringsplit(c,"[^%s]+",stringlower)
  3612. if p[1] == "p" then
  3613. p[2] = p[2] and stringnick(p[2]) or n
  3614. if mode.presents.info[p[2]] then
  3615. ui.addTextArea(1,"<p align='center'><font size='18'><a:active><a href='event:close'>"..p[2].."</a><p align='left'><font size='13'>\n<J>" .. stringformat(system.getTranslation("profile"),mode.presents.info[p[2]].rounds,mode.presents.info[p[2]].gifts,mode.presents.info[p[2]].victories),n,5,30,790,100,1,1,.8,true)
  3616. end
  3617. end
  3618. end,
  3619. -- Callbacks
  3620. eventTextAreaCallback = function(i,n,c)
  3621. if c == "close" then
  3622. ui.removeTextArea(1,n)
  3623. end
  3624. end,
  3625. }
  3626.  
  3627. --[[ Chat ]]--
  3628. mode.chat = {
  3629. -- Translations
  3630. translations = {
  3631. en = {
  3632. -- Init
  3633. welcome = "<J>Welcome to #chat. Enjoy while you are muted ?! Report any issue to Bolodefchoco.",
  3634.  
  3635. -- Info
  3636. loadmap = "loaded by",
  3637. enabled = "enabled",
  3638. disabled = "disabled",
  3639.  
  3640. -- Cats
  3641. shaman = "shaman",
  3642. newGame = "Auto New Game",
  3643.  
  3644. -- Misc
  3645. title = "%s has just unlocked the «%s» title.\n<ROSE>Type /title to choose a title",
  3646. },
  3647. br = {
  3648. welcome = "<J>Bem-vindo ao #chat. Aproveite enquanto você está mutado ?! Reporte qualquer problema para Bolodefchoco.",
  3649.  
  3650. loadmap = "carregado por",
  3651. enabled = "ativado",
  3652. disabled = "desativado",
  3653.  
  3654. shaman = "shaman",
  3655. newGame = "Novo Jogo Automático",
  3656.  
  3657. title = "%s Desbloqueou o título «%s»\n<ROSE>Digite /title para escolher um título.",
  3658. },
  3659. ar = {
  3660. welcome = "<J>مرحبًا بك في #chat. استمتع بينما أنت مكتوم ?! بلغ عن أي مشكلة إلى Bolodefchoco.",
  3661.  
  3662. loadmap = "شُغل بواسطة",
  3663. enabled = "فُعل",
  3664. disabled = "أُلغي",
  3665.  
  3666. shaman = "الشامان",
  3667. newGame = "جولة جديدة تلقائية",
  3668.  
  3669. title = "%s has just unlocked the «%s» title.\n<ROSE>Type /title to choose a title",
  3670. },
  3671. },
  3672. langue = "en",
  3673. -- Data
  3674. info = {},
  3675. data = {},
  3676. displayData = {},
  3677. messageId = 0,
  3678. -- New Game Settings
  3679. hasShaman = false,
  3680. autoNeWGame = false,
  3681. -- Chat settings
  3682. chatTitle = "Chat",
  3683. -- Chat
  3684. chat = function(n,message,update)
  3685. if not update then
  3686. ui.addPopup(0,2,"",n,107,325,565,true)
  3687. end
  3688. ui.addTextArea(0,"",n,108,73,564,253,0x212E35,0x212E35,1,true)
  3689. ui.addTextArea(1,message,n,110,75,560,250,0x324650,0x324650,1,true)
  3690. ui.addTextArea(2,"<p align='center'><B><V>" .. mode.chat.chatTitle,n,108,53,564,20,0x212E35,0x212E35,1,true)
  3691. ui.addTextArea(3,"<p align='right'><B><R><a href='event:close'>X",n,110,54,560,20,1,1,0,true)
  3692. end,
  3693. getTextLength = function(line)
  3694. return stringlen(stringgsub(line,"<.*>",""))
  3695. end,
  3696. loadData = function()
  3697. local message = "<font size='7'>\n</font>"
  3698. for i = 18,1,-1 do
  3699. if #message < 1900 then
  3700. local line = mode.chat.displayData[i] or ""
  3701. message = message .. line
  3702. end
  3703. end
  3704. return message
  3705. end,
  3706. updateToRead = function(n)
  3707. ui.addTextArea(4,"<p align='center'><V><a href='event:open'><B>" .. stringsub(stringlower(mode.chat.chatTitle),1,8) .. "</B> <J>" .. mode.chat.info[n].toRead,n,712,378,80,nil,0x324650,0x212E35,1,true)
  3708. end,
  3709. displayChat = function(n,update)
  3710. local loadedM = mode.chat.loadData()
  3711. if not update then
  3712. mode.chat.chat(n,loadedM)
  3713. else
  3714. for k,v in next,mode.chat.info do
  3715. if v.open then
  3716. mode.chat.chat(k,loadedM,k ~= n)
  3717. else
  3718. v.toRead = v.toRead + 1
  3719. mode.chat.updateToRead(k)
  3720. end
  3721. end
  3722. end
  3723. end,
  3724. newMessage = function(message,n)
  3725. mode.chat.messageId = mode.chat.messageId + 1
  3726. tableinsert(mode.chat.data,{mode.chat.messageId,n,stringgsub(stringgsub(message,"@%((.*)%)",function(text) return text end),"{.-:(.-)}",function(text) return text end)})
  3727.  
  3728. if mode.chat.getTextLength(message) > 50 then
  3729. message = stringsub(message,1,47) .. "..."
  3730. end
  3731. message = stringgsub(message,"<","&lt;") -- < to <
  3732. message = stringgsub(message,"https?","") -- https to ""
  3733. message = stringgsub(message,"://","") -- :// to ""
  3734. message = stringgsub(message,"@%((.*)%)",function(text) -- @(link:text)
  3735. return stringformat("<a href='event:display.%s'>%s</a>",mode.chat.messageId,text)
  3736. end)
  3737.  
  3738. if #message > 0 then
  3739. if stringsub(message,1,1) == "/" then
  3740. mode.chat.eventChatCommand(n,stringsub(message,2))
  3741. else
  3742. message = stringgsub(message,"{(.-):(.-)}",function(color,text) -- {colorTag:Text}
  3743. color = stringupper(color)
  3744. if tablefind({"BV","R","BL","J","N","N2","PT","CE","CEP","CS","S","PS","G","V","VP","VI","ROSE","CH","T"},color) then
  3745. return stringformat("<%s>%s</%s>",color,text,color)
  3746. else
  3747. return text
  3748. end
  3749. end)
  3750. tableinsert(mode.chat.displayData,1,stringformat("<V>[%s] <N>%s\n",n,message))
  3751. end
  3752. end
  3753. end,
  3754. -- Init
  3755. init = function()
  3756. mode.chat.translations.pt = mode.chat.translations.br
  3757. mode.chat.langue = mode.chat.translations[tfm.get.room.community] and tfm.get.room.community or "en"
  3758. tfm.exec.setRoomMaxPlayers(30)
  3759. system.disableChatCommandDisplay("title",true)
  3760. mode.chat.displayChat()
  3761. end,
  3762. -- New Player
  3763. eventNewPlayer = function(n)
  3764. mode.chat.info[n] = {
  3765. open = true,
  3766. toRead = 0,
  3767. }
  3768. mode.chat.displayChat(n)
  3769. tfm.exec.chatMessage(system.getTranslation("welcome"),n)
  3770. end,
  3771. -- Answer bar
  3772. eventPopupAnswer = function(i,n,a)
  3773. if #stringgsub(a," ","") > 0 then
  3774. mode.chat.newMessage(a,n)
  3775. mode.chat.displayChat(n,true)
  3776. else
  3777. mode.chat.displayChat(n)
  3778. end
  3779. end,
  3780. -- Callbacks
  3781. eventTextAreaCallback = function(i,n,c)
  3782. local p = stringsplit(c,"[^%.]+")
  3783. if p[1] == "close" then
  3784. ui.addPopup(0,2,"",n,1e7,1e7)
  3785. for i = 0,3 do
  3786. ui.removeTextArea(i,n)
  3787. end
  3788. mode.chat.info[n].open = false
  3789. mode.chat.updateToRead(n)
  3790. elseif p[1] == "open" then
  3791. mode.chat.info[n].open = true
  3792. mode.chat.info[n].toRead = 0
  3793. mode.chat.displayChat(n)
  3794. ui.removeTextArea(4,n)
  3795. elseif p[1] == "display" then
  3796. local msg = mode.chat.data[tonumber(p[2])]
  3797. tfm.exec.chatMessage(stringformat("<N>> <V>[%s] <N>%s",msg[2],msg[3]),n)
  3798. end
  3799. end,
  3800. -- Commands
  3801. eventChatCommand = function(n,c)
  3802. local p = stringsplit(c,"[^%s]+",stringlower)
  3803. if p[1] == "title" and p[2] and system.roomAdmins[n] then
  3804. mode.chat.chatTitle = stringsub(tableconcat(p," ",nil,2),1,40)
  3805. mode.chat.displayChat()
  3806. elseif p[1] == "np" and p[2] then
  3807. tfm.exec.chatMessage(stringformat("<S>%s %s %s",stringsub(p[2],1,1) == "@" and p[2] or "@" .. p[2],system.getTranslation("loadmap"),n))
  3808. tfm.exec.newGame(p[2])
  3809. elseif p[1] == "sha" then
  3810. mode.chat.hasShaman = not mode.chat.hasShaman
  3811.  
  3812. tfm.exec.chatMessage("<S>• " .. system.getTranslation("shaman") .. " " .. system.getTranslation((mode.chat.hasShaman and "disabled" or "enabled")),n)
  3813. tfm.exec.disableAutoShaman(mode.chat.hasShaman)
  3814. elseif p[1] == "new" then
  3815. mode.chat.autoNeWGame = not mode.chat.autoNeWGame
  3816.  
  3817. tfm.exec.chatMessage("<S>• " .. system.getTranslation("newGame") .. " " .. system.getTranslation((mode.chat.autoNeWGame and "disabled" or "enabled")),n)
  3818. tfm.exec.disableAutoNewGame(mode.chat.autoNeWGame)
  3819. tfm.exec.disableAutoTimeLeft(mode.chat.autoNeWGame)
  3820. elseif stringsub(c,1,6) == "unlock" then
  3821. tfm.exec.chatMessage("<J>" .. stringformat(system.getTranslation("title"),n,stringsub(c,8)),n)
  3822. end
  3823. end,
  3824. }
  3825.  
  3826. --[[ Cannonup ]]--
  3827. mode.cannonup = {
  3828. -- Translations
  3829. translations = {
  3830. en = {
  3831. -- Init
  3832. welcome = "Welcome to #cannonup. Your aim is to be the survivor! <VP>Take care, watermelons are dangerous!\n\t<J>Report any issue to Bolodefchoco.",
  3833.  
  3834. -- Info
  3835. nowinner = "No one won!",
  3836.  
  3837. -- Simple words
  3838. won = "won!",
  3839.  
  3840. -- Profile
  3841. profile = "Rounds : <V>%d</V>\nCheeses : <V>%d</V>\n\nDeaths : <V>%d</V>",
  3842. },
  3843. br = {
  3844. welcome = "Bem-vindo ao #cannonup. Seu objetivo é ser o sobrevivente! <VP>Tome cuidado, melancias são perigosas!\n\t<J>Reporte qualquer problema para Bolodefchoco.",
  3845.  
  3846. nowinner = "Ninguém ganhou!",
  3847.  
  3848. won = "venceu!",
  3849.  
  3850. profile = "Rodadas : <V>%d</V>\nQueijos : <V>%d</V>\n\nMortes : <V>%d</V>",
  3851. },
  3852. },
  3853. langue = "en",
  3854. -- Data
  3855. info = {},
  3856. -- Maps
  3857. maps = {3746497,6001536,3666224,4591929,"#10","#10","#10","#10","#10","#10","#10","#10","#10"},
  3858. -- Settings
  3859. isRunning = false,
  3860. totalPlayers = 0,
  3861. -- New Map Settings
  3862. cannon = {
  3863. x = 0,
  3864. y = 0,
  3865. time = 3,
  3866. amount = 1,
  3867. speed = 20,
  3868. },
  3869. canMessage = false,
  3870. currentXml = -1,
  3871. toDespawn = {},
  3872. alivePlayers = {},
  3873. -- Cannon ID
  3874. getCannon = function()
  3875. local currentMonth = tonumber(os.date("%m"))
  3876.  
  3877. if currentMonth == 12 then
  3878. return 1703 -- Christmas [Ornament]
  3879. elseif currentMonth == 10 then
  3880. return tablerandom({17,1701,1702}) -- Halloween [Normal, Glass, Lollipop]
  3881. elseif currentMonth == 5 and tonumber(os.date("%d")) < 11 then
  3882. return 1704 -- Transformice's Birthday [Shaman]
  3883. elseif currentMonth == 7 then
  3884. return tablerandom({17,1705,1706}) -- Vacations [Normal, Apple, Watermellon]
  3885. else
  3886. return tablerandom({17,17,17,1706}) -- Standard
  3887. end
  3888. end,
  3889. -- Spawn Cannon
  3890. newCannon = function()
  3891. local alive = system.players(true)
  3892. if #alive > 0 then
  3893. local player
  3894. repeat
  3895. player = tfm.get.room.playerList[tablerandom(alive)]
  3896. until not player.isDead
  3897.  
  3898. local coordinates = {
  3899. {player.x,mathrandom() * 700},
  3900. {player.y,mathrandom() * 300},
  3901. {false,false}
  3902. }
  3903.  
  3904. if mode.cannonup.cannon.x ~= 0 then
  3905. coordinates[1][2] = mode.cannonup.cannon.x
  3906. coordinates[3][1] = true
  3907. end
  3908. if mode.cannonup.cannon.y ~= 0 then
  3909. coordinates[2][2] = mode.cannonup.cannon.y
  3910. coordinates[3][2] = true
  3911. end
  3912.  
  3913. if not coordinates[3][2] and coordinates[2][2] > coordinates[2][1] then
  3914. coordinates[2][2] = coordinates[2][1] - mathrandom(100) - 35
  3915. end
  3916. if not coordinates[3][1] and mathabs(coordinates[1][2] - coordinates[1][1]) > 350 then
  3917. coordinates[1][2] = coordinates[1][1] + mathrandom(-100,100)
  3918. end
  3919.  
  3920. local ang = mathdeg(mathatan2(coordinates[2][2] - coordinates[2][1],coordinates[1][2] - coordinates[1][1]))
  3921. tfm.exec.addShamanObject(0,coordinates[1][2] - (coordinates[3][1] and 0 or 10),coordinates[2][2] - (coordinates[3][2] and 0 or 10),ang + 90)
  3922.  
  3923. --system.newTimer(function()
  3924. mode.cannonup.toDespawn[#mode.cannonup.toDespawn + 1] = {tfm.exec.addShamanObject(mode.cannonup.getCannon(),coordinates[1][2],coordinates[2][2],ang - 90,mode.cannonup.cannon.speed),os.time() + 5000}
  3925. --end,mathisNegative((mode.cannonup.cannon.speed - 1) * 500,0),false)
  3926. end
  3927. end,
  3928. -- Profile
  3929. uiprofile = function(p,n)
  3930. ui.addTextArea(1,"\n\n<font size='13'>\n" .. stringformat(system.getTranslation("profile"),mode.cannonup.info[p].round,mode.cannonup.info[p].victory,mode.cannonup.info[p].death),n,300,100,200,150,0x0B282E,0x1B282E,1,true)
  3931. ui.addTextArea(2,"<p align='center'><font size='20'><VP><B><a href='event:close'>"..p.."</a>",n,305,105,190,30,0x244452,0x1B282E,.4,true)
  3932. end,
  3933. -- Update data
  3934. updatePlayers = function()
  3935. local alive,total = system.players()
  3936. mode.cannonup.alivePlayers = system.players(true)
  3937. mode.cannonup.totalPlayers = total
  3938. end,
  3939. -- Init
  3940. reset = function()
  3941. -- Data
  3942. mode.cannonup.info = {}
  3943. end,
  3944. init = function()
  3945. mode.cannonup.translations.pt = mode.cannonup.translations.br
  3946.  
  3947. -- Sets the main language according to the community
  3948. if mode.cannonup.translations[tfm.get.room.community] then
  3949. mode.cannonup.langue = tfm.get.room.community
  3950. end
  3951.  
  3952. -- Init
  3953. for _,f in next,{"AutoShaman","AutoScore","AutoNewGame","AutoTimeLeft","PhysicalConsumables"} do
  3954. tfm.exec["disable"..f]()
  3955. end
  3956. tfm.exec.setRoomMaxPlayers(25)
  3957. tfm.exec.newGame('<C><P /><Z><S><S L="800" o="324650" H="100" X="400" Y="400" T="12" P="0,0,0.3,0.2,0,0,0,0" /></S><D /><O /></Z></C>')
  3958.  
  3959. -- Auto Admin
  3960. system.roomAdmins.Byontr = true
  3961. end,
  3962. -- New Player
  3963. eventNewPlayer = function(n)
  3964. if not mode.cannonup.info[n] then
  3965. mode.cannonup.info[n] = {
  3966. round = 0,
  3967. victory = 0,
  3968. death = 0
  3969. }
  3970. end
  3971.  
  3972. tfm.exec.chatMessage("<J>" .. system.getTranslation("welcome"),n)
  3973. end,
  3974. -- New Game
  3975. eventNewGame = function()
  3976. ui.setMapName("#CannonUp")
  3977.  
  3978. mode.cannonup.cannon = {
  3979. x = 0,
  3980. y = 0,
  3981. time = 3,
  3982. amount = ((mode.cannonup.totalPlayers - (mode.cannonup.totalPlayers % 10)) / 10) + mathsetLim(system.miscAttrib+1,1,5), -- mathmin(5,mathmax(1,system.miscAttrib+1))
  3983. speed = 20,
  3984. }
  3985.  
  3986. mode.cannonup.toDespawn = {}
  3987.  
  3988. if mode.cannonup.currentXml == -1 then
  3989. mode.cannonup.currentXml = 0
  3990. elseif mode.cannonup.currentXml == -2 then
  3991. mode.cannonup.currentXml = -1
  3992. end
  3993.  
  3994. ui.removeTextArea(0,nil)
  3995. if mode.cannonup.isRunning then
  3996. if mode.cannonup.currentXml == 0 then
  3997. tfm.exec.setGameTime(5)
  3998.  
  3999. mode.cannonup.currentXml = xml.addAttrib(tfm.get.room.xmlMapInfo.xml or "",{
  4000. [1] = {
  4001. tag = "BH",
  4002. value = "",
  4003. }
  4004. },false)
  4005. ui.addTextArea(0,"",nil,-1500,-1500,3e3,3e3,0x6A7495,0x6A7495,1,true)
  4006.  
  4007. mode.cannonup.canMessage = false
  4008. else
  4009. tfm.exec.setGameTime(125)
  4010. mode.cannonup.canMessage = true
  4011.  
  4012. if mode.cannonup.totalPlayers > 3 then
  4013. for k,v in next,mode.cannonup.info do
  4014. v.round = v.round + 1
  4015. end
  4016. end
  4017.  
  4018. xml.attribFunc(mode.cannonup.currentXml or "",{
  4019. [1] = {
  4020. attribute = "cn",
  4021. func = function(value)
  4022. local coord,axY = xml.getCoordinates(value)
  4023. if type(coord) == "table" then
  4024. mode.cannonup.cannon.x = coord[1].x
  4025. mode.cannonup.cannon.y = coord[1].y
  4026. else
  4027. if axY == 0 then
  4028. mode.cannonup.cannon.x = coord
  4029. else
  4030. mode.cannonup.cannon.y = coord
  4031. end
  4032. end
  4033. end
  4034. },
  4035. [2] = {
  4036. attribute = "cheese",
  4037. func = function()
  4038. tableforeach(tfm.get.room.playerList,tfm.exec.giveCheese)
  4039. end,
  4040. },
  4041. [3] = {
  4042. attribute = "meep",
  4043. func = function()
  4044. tableforeach(tfm.get.room.playerList,tfm.exec.giveMeep)
  4045. end,
  4046. },
  4047. })
  4048.  
  4049. mode.cannonup.currentXml = 0
  4050. mode.cannonup.canMessage = true
  4051. end
  4052. else
  4053. tfm.exec.setGameTime(1e7)
  4054. mode.cannonup.currentXml = -1
  4055. mode.cannonup.canMessage = false
  4056. end
  4057. end,
  4058. -- Loop
  4059. eventLoop = function()
  4060. mode.cannonup.updatePlayers()
  4061.  
  4062. if mode.cannonup.isRunning then
  4063. if mode.cannonup.totalPlayers < 2 then
  4064. mode.cannonup.isRunning = false
  4065. mode.cannonup.canMessage = false
  4066. mode.cannonup.currentXml = -2
  4067. else
  4068. if mode.cannonup.currentXml == -1 then
  4069. tfm.exec.newGame(tablerandom(mode.cannonup.maps))
  4070. elseif mode.cannonup.currentXml ~= 0 then
  4071. tfm.exec.newGame(mode.cannonup.currentXml)
  4072. else
  4073. if _G.leftTime < 4 or #mode.cannonup.alivePlayers < 2 then
  4074. if mode.cannonup.canMessage and mode.cannonup.totalPlayers > 1 then
  4075. mode.cannonup.canMessage = false
  4076. if #mode.cannonup.alivePlayers > 0 then
  4077. for k,v in next,mode.cannonup.alivePlayers do
  4078. tfm.exec.giveCheese(v)
  4079. tfm.exec.playerVictory(v)
  4080. if mode.cannonup.totalPlayers > 3 then
  4081. mode.cannonup.info[v].victory = mode.cannonup.info[v].victory + 1
  4082. end
  4083. tfm.exec.setPlayerScore(v,5,true)
  4084. end
  4085.  
  4086. tfm.exec.chatMessage("<J>" .. tableconcat(mode.cannonup.alivePlayers,"<G>, <J>") .. " <J>" .. system.getTranslation("won"))
  4087. else
  4088. tfm.exec.chatMessage("<J>" .. system.getTranslation("nowinner"))
  4089. end
  4090. end
  4091. tfm.exec.newGame(tablerandom(mode.cannonup.maps))
  4092. else
  4093. if _G.currentTime > 5 and mode.cannonup.currentXml == 0 then
  4094. if _G.currentTime % mode.cannonup.cannon.time == 0 then
  4095. for i = 1,mode.cannonup.cannon.amount do
  4096. mode.cannonup.newCannon()
  4097. end
  4098. end
  4099.  
  4100. if #mode.cannonup.toDespawn > 0 then
  4101. for i = 1,#mode.cannonup.toDespawn do
  4102. if os.time() > mode.cannonup.toDespawn[i][2] then
  4103. tfm.exec.removeObject(mode.cannonup.toDespawn[i][1])
  4104. end
  4105. end
  4106. end
  4107.  
  4108. if _G.currentTime % 20 == 0 then
  4109. mode.cannonup.cannon.amount = ((mode.cannonup.totalPlayers - (mode.cannonup.totalPlayers % 10)) / 10) + mathsetLim(system.miscAttrib+1,1,5) --mathmin(5,mathmax(1,system.miscAttrib+1))
  4110. mode.cannonup.cannon.speed = mode.cannonup.cannon.speed + 20
  4111. mode.cannonup.cannon.time = mathmax(.5,mode.cannonup.cannon.time-.5)
  4112. end
  4113. end
  4114. end
  4115. end
  4116. end
  4117. else
  4118. if mode.cannonup.currentXml == -2 then
  4119. tfm.exec.newGame('<C><P /><Z><S><S L="800" o="324650" H="100" X="400" Y="400" T="12" P="0,0,0.3,0.2,0,0,0,0" /></S><D /><O /></Z></C>')
  4120. end
  4121.  
  4122. if mode.cannonup.totalPlayers > 1 then
  4123. mode.cannonup.isRunning = true
  4124. end
  4125. end
  4126. end,
  4127. -- Commands
  4128. eventChatCommand = function(n,c)
  4129. local p = stringsplit(c,"[^%s]+",stringlower)
  4130. if p[1] == "p" or p[1] == "profile" then
  4131. if p[2] then
  4132. p[2] = stringnick(p[2])
  4133. if tfm.get.room.playerList[p[2]] then
  4134. mode.cannonup.uiprofile(p[2],n)
  4135. end
  4136. else
  4137. mode.cannonup.uiprofile(n,n)
  4138. end
  4139. end
  4140. end,
  4141. -- Callbacks
  4142. eventTextAreaCallback = function(i,n,c)
  4143. if c == "close" then
  4144. for i = 1,2 do
  4145. ui.removeTextArea(i,n)
  4146. end
  4147. end
  4148. end,
  4149. -- Player Left
  4150. eventPlayerLeft = function()
  4151. mode.cannonup.updatePlayers()
  4152. end,
  4153. -- Player Died
  4154. eventPlayerDied = function(n)
  4155. mode.cannonup.info[n].death = mode.cannonup.info[n].death + 1
  4156. end,
  4157. }
  4158.  
  4159. --[[ Xmas ]]--
  4160. mode.xmas = {
  4161. -- Translations
  4162. translations = {
  4163. en = {"Merry Christmas & Happy New Year!","Christmas is approaching and S4nt4 has a lot to do on his <I>paws</I>. He wants to give all the gifts on time, but he must be fast! Since our dear S4nt4 is clumsy, some gifts will fall and you will have to <CE>collect</CE> them by pressing the <I>space bar</I>! Give the gifts back to S4nt4 when he feels <CE>dizzy</CE> by pressing the <I>space bar</I>!"},
  4164. fr = {"Joyeux Noël et Bonne Année!","Noël approche et S4nt4 en a plein les <I>pattes</I>. Il veut donner tous les cadeaux à temps, mais il doit être rapide ! Puisque notre cher S4nt4 est maladroix, certains cadeaux tombent et vous devrez les, <CE>collecter</CE> en appuyant sur la <I>barre d'espace</I>! Donnez les cadeaux à S4nt4 quand il se sent <CE>étourdi</CE> en appuyant sur la <I>barre d'espace</I>!"},
  4165. br = {"Feliz Natal & Feliz Ano Novo!","O Natal está chegando e S4nt4 tem em suas <I>patas</I> muito o que fazer. Ele quer entregar todos os presentes a tempo, mas ele deve ser rápido! Uma vez que nosso querido S4NT4 é desajeitado, alguns presentes cairão e você terá que <CE>coletá-los</CE> pressionando a <I>barra de espaço</I>! Devolva os presentes ao S4nt4, pressionando a <I>barra de espaço</I>, quando ele se sentir <CE>tonto</CE>!"},
  4166. es = {"¡Feliz Navidad y Próspero Año Nuevo!","La Navidad se está acercando y S4nt4 tiene muchas cosas que hacer con sus <I>patas</I>. Él quiere dar todos los regalos a tiempo, pero debe ser rápido! Puesto que nuestro querido S4nt4 es torpe, algunos regalos caerán y tendrás que <CE>recogerlos</CE> pulsando la <I>barra espaciadora</I>! Regrese los regalos a S4nt4 cuando se sienta <CE>mareado</CE> presionando la <I>barra de espacio</I>!"},
  4167. tr = {"Mutlu Noeller & Mutlu Yıllar!","Noel geliyor ve S4nt4'nın <I>patilerinde</I> yapacağı çok işi var. Bütün hediyeleri zamanında vermek istiyor ama hızlı olması gerek! Sevgili S4nt4'mız sakar olduğu için, bazı hediyeler düşecek ve <I>boşluk tuşuna</I> basarak onları <CE>toplamanız</CE> gerekecek! S4nt4'nın <CE>başı döndüğünde</CE> <I>boşluk tuşuna</I> basarak hediyeleri ona geri verin!"},
  4168. pl = {"Wesołych Świąt i Wesołego Nowego Roku!","Święta nadchodzą, a S4nt4 ma <I>łapki</I> pełne roboty. On chce dać wszystkim prezenty na czas, ale musi się pośpieszyć! Od kiedy nasz S4nt4 jest niezdarny, gubi prezenty, które musicie <CE>pozbierać</CE> wciskając <I>spację</I>! Oddajcie prezenty S4nt4 kiedy jest <CE>oszołomiony</CE> wciskając <I>spację</I>!"},
  4169. ar = {"عيد ميلاد مجيدا و كل عام و أنتم بخير","عيد الميلاد اقترب و<I> يدى </I> سانتا مليئة. يريد سانتا تسليم جميع الهدايا على الوقت, ولكن يجب ان يكون سريعا! ولكن صديقنا العزيز سانتا غير بارع في تسليم الهدايا, بعض الهدايا ستسقط وعليك ان تقوم <CE> بجمع</CE> الهدايا التي سقطت عن طريق الضغط على المسطرة ! وارجاع الهدايا الى صديقنا العزيز سانتا عندما يشعر <CE> بالدوار</CE> عن طريق الضغط على زر المسطرة!"},
  4170. hu = {"Boldog Karácsonyt & Boldog Új Évet!","A Karácsony közeleg, és a Mikulásra pedig <I>rengeteg munka vár<I>. Oda akarja adni az összes ajándékot időben, de muszáj gyorsnak lennie! Mivel a mi Mikulásunk kétbalkezes, néhány ajándék lepottyan és Neked kell <CE>összegyűjteni</CE> azokat, a <I>Szóköz</I> megnyomásával! Vidd vissza a Mikulásnak az ajándékot a <I>Szóköz</I> megnyomásával, amikor Mikulás <CE>megszédül</CE>!"},
  4171. ru = {"С новым годом и Рождеством!","Рождество приближается и S4nt4 направляется к вам! Он очень спешит, чтобы раздать все подарки вовремя! Но так как наш дорогой S4nt4 неуклюж, то некоторые подарки будут падать. Вы должны <CE>собрать</CE> их, нажимая клавишу <I>пробел</I>! Помогите S4nta. <CE>Верните</CE> ему подарки обратно с помощью <I>пробела</I>!"},
  4172. },
  4173. langue = "en",
  4174. -- Data
  4175. info = {},
  4176. gifts = {
  4177. [1] = {
  4178. [1] = "158bb1db61b",
  4179. [2] = 20000,
  4180. };
  4181. [2] = {
  4182. [1] = "158bb1c95e0",
  4183. [2] = 15000,
  4184. };
  4185. [3] = {
  4186. [1] = "158bb1cc6ec",
  4187. [2] = 10000,
  4188. };
  4189. [4] = {
  4190. [1] = "158bb1ce1aa",
  4191. [2] = 8000,
  4192. };
  4193. [5] = {
  4194. [1] = "1591c9b3123",
  4195. [2] = 6000,
  4196. };
  4197. },
  4198. -- Maps
  4199. xml = '<C><P DS="y;310" /><Z><S><S H="10" L="50" X="275" c="2" Y="165" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S L="200" X="100" H="80" Y="360" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S L="200" X="109" H="80" Y="379" T="12" P="0,0,0.3,0.2,-10,0,0,0" /><S X="391" L="230" H="80" c="3" Y="354" T="12" P="0,0,0.3,0.2,-2,0,0,0" /><S H="100" L="230" X="430" c="3" Y="411" T="12" P="0,0,0.3,0.2,-30,0,0,0" /><S H="80" L="180" X="705" c="3" Y="397" T="12" P="0,0,0.3,0.2,-2,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="44" H="10" c="3" Y="361" T="13" X="237" /><S X="-5" L="10" H="3000" c="3" Y="100" T="12" P="0,0,0,0,0,0,0,0" /><S H="3000" L="10" X="805" c="3" Y="101" T="12" P="0,0,0,0,0,0,0,0" /><S L="10" X="400" H="3000" Y="-5" T="12" P="0,0,0,0,90,0,0,0" /><S L="80" H="10" X="96" Y="158" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,.9,0,0,0,0" L="50" X="275" c="3" Y="165" T="12" H="10" /><S L="130" X="527" H="10" Y="128" T="12" P="0,0,0.3,0.2,10,0,0,0" /><S L="90" H="10" X="632" Y="131" T="12" P="0,0,0.3,0.2,-10,0,0,0" /><S H="3000" L="10" o="23E9E9" X="805" c="2" Y="100" T="12" m="" P="0,0,0,2,0,0,0,0" /><S X="-5" L="10" o="23E9E9" H="3000" c="2" Y="100" T="12" m="" P="0,0,0,2,0,0,0,0" /><S P="0,0,0.3,0.2,-35,0,0,0" L="230" X="549" c="3" Y="467" T="12" H="100" /><S P="0,0,0.3,0.2,-55,0,0,0" L="230" H="100" c="3" Y="441" T="12" X="250" /><S L="230" X="125" H="100" Y="422" T="12" P="0,0,0.3,0.2,-30,0,0,0" /><S X="510" L="230" H="100" c="3" Y="477" T="12" P="0,0,0.3,0.2,-65,0,0,0" /><S L="50" X="91" H="50" Y="339" T="12" P="0,0,0.3,0.2,-45,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="30" X="164" c="2" Y="325" T="12" H="50" /><S P="0,0,0.3,1.1,0,0,0,0" L="30" H="50" c="3" Y="325" T="12" X="164" /><S L="50" X="240" H="10" Y="158" T="12" P="0,0,0.3,0.2,0,0,0,0" /><S L="50" H="10" X="443" Y="125" T="12" P="0,0,0.3,0.2,-20,0,0,0" /><S H="80" L="220" o="23E9E9" X="393" c="1" Y="359" T="12" m="" P="0,0,0.3,0.2,-2,0,0,0" /><S L="230" o="23E9E9" X="427" H="100" Y="416" T="12" m="" P="0,0,0.3,0.2,-30,0,0,0" /><S P="0,0,0.3,0.2,-65,0,0,0" L="230" o="23E9E9" H="100" Y="481" T="12" m="" X="501" /><S P="0,0,0.3,0.2,-35,0,0,0" L="230" o="23E9E9" H="100" Y="474" T="12" m="" X="550" /><S P="0,0,0.3,0.2,-2,0,0,0" L="180" o="23E9E9" X="706" Y="404" T="12" m="" H="80" /><S P="0,0,0.3,0.2,1,0,0,0" L="230" o="23E9E9" X="314" c="2" Y="373" T="12" m="" H="100" /></S><D><P X="241" Y="507" T="51" P="0,1" /><P X="566" Y="449" T="46" P="0,0" /></D><O /></Z></C>',
  4200. initx = 240,
  4201. inity = 140,
  4202. -- New Game Settings
  4203. aim = 8,
  4204. start = true,
  4205. amountPlayers = 20,
  4206. despawnObjects = {},
  4207. currentGifts = {},
  4208. currentTime = 0,
  4209. leftTime = 150,
  4210. -- Player Settings
  4211. setPlayerTools = function(k)
  4212. mode.xmas.info[k] = {
  4213. db = {
  4214. eventNoelGifts = {0,0},
  4215. },
  4216. catch = 0,
  4217. lastColor = 0xB73535,
  4218. }
  4219. if not tfm.get.room.playerList[k].isDead then
  4220. system.bindKeyboard(k,32,true,true)
  4221. end
  4222. mode.xmas.updateBar(k)
  4223. end,
  4224. -- Noel's AI
  4225. noel = {
  4226. x = 240,
  4227. y = 140,
  4228. id = -1,
  4229. isEscaping = false,
  4230. isDizzy = {0,false},
  4231. timers = {
  4232. teleport = 0,
  4233. prize = 0
  4234. },
  4235. img = {
  4236. dizzy = {"158bb1dccb6","158bb1cf9a8","158bb1d6489","158bb1e2518"},
  4237. right = "158bb1d8069",
  4238. left = "158bb1e0daf",
  4239. jumping = "158bb1d470a",
  4240. stop = "158bb1d9b67",
  4241. },
  4242. updateImage = function(img)
  4243. tfm.exec.removeImage(mode.xmas.noel.imgId)
  4244. mode.xmas.noel.imgId = tfm.exec.addImage(img..".png","#"..mode.xmas.noel.id,-23,-32)
  4245. end,
  4246. particles = function(id)
  4247. for i = 1,5 do
  4248. tfm.exec.displayParticle(id,mode.xmas.noel.x + mathrandom(-50,50),mode.xmas.noel.y + mathrandom(-50,50),tablerandom({-.2,.2}),tablerandom({-.2,.2}))
  4249. end
  4250. end,
  4251. move = function(x,y)
  4252. tfm.exec.moveObject(mode.xmas.noel.id,0,0,false,x,y,false)
  4253. end,
  4254. nearMouse = function(range)
  4255. local player = {"",{dist=mathrandom(800),x=0,y=0}}
  4256. for k,v in next,tfm.get.room.playerList do
  4257. if not v.isDead then
  4258. if mathpythag(v.x,v.y,mode.xmas.noel.x,mode.xmas.noel.y,range) then
  4259. local m = v.x-mode.xmas.noel.x
  4260. if mathabs(m) < player[2].dist then
  4261. player = {k,{dist=m,x=v.x,y=v.y}}
  4262. end
  4263. end
  4264. end
  4265. end
  4266. mode.xmas.noel.isEscaping = player[1] ~= ""
  4267. return player
  4268. end,
  4269. escape = function(id)
  4270. local player = mode.xmas.noel.nearMouse(mathrandom(80,100))
  4271. local mul = (player[1] ~= "" and mathisNegative(player[2].dist,1,-1) or tablerandom({-1,1}))
  4272. local img = mathisNegative(mul,"left","right")
  4273. local rand = 9 - mathrandom(0,9)
  4274. if id == 0 or (rand < 6) then
  4275. mode.xmas.noel.move(mul * mathrandom(50,80),-mathrandom(1,10))
  4276. mode.xmas.noel.updateImage(mode.xmas.noel.img[img])
  4277. elseif id == 1 or (rand < 9) then
  4278. mode.xmas.noel.move(mul * mathrandom(60,70),-80)
  4279. mode.xmas.noel.updateImage(tablerandom({mode.xmas.noel.img[img],mode.xmas.noel.img.jumping}))
  4280. elseif id == 2 or rand == 9 then
  4281. mode.xmas.noel.move(mul * mathrandom(10,20),-mathrandom(70,100))
  4282. mode.xmas.noel.updateImage(mode.xmas.noel.img.jumping)
  4283. end
  4284. end,
  4285. meep = function()
  4286. tfm.exec.displayParticle(20,mode.xmas.noel.x,mode.xmas.noel.y)
  4287. tfm.exec.explosion(mode.xmas.noel.x,mode.xmas.noel.y,20,50)
  4288. end,
  4289. cannon = function()
  4290. local player = mode.xmas.noel.nearMouse(100)
  4291. if player[1] ~= "" then
  4292. local x = mode.xmas.noel.x + (mode.xmas.noel.x > player[2].x and -40 or 40)
  4293. local y = mode.xmas.noel.y + (mode.xmas.noel.y > player[2].y and -40 or 40)
  4294. local angle = mathdeg(mathatan2(player[2].y-mode.xmas.noel.y,player[2].x-mode.xmas.noel.x)) + 90
  4295. tableinsert(mode.xmas.despawnObjects,{
  4296. [1] = tfm.exec.addShamanObject(1703,x,y,angle),
  4297. [2] = os.time() + 2500
  4298. })
  4299. local effect = function(id,sx,sy,xs,ys,e)
  4300. for i = 1,2 do
  4301. tfm.exec.displayParticle(id[i] and id[i] or id[1],x + sx * e,y - sy * e,xs/1.5,ys/1.5)
  4302. end
  4303. end
  4304. for i = 1,20 do
  4305. effect({9,11},mathcos(i),mathsin(i),mathcos(i),-mathsin(i),22)
  4306. effect({13},mathcos(i),mathsin(i),mathsin(i),mathcos(i),19)
  4307. end
  4308. end
  4309. end,
  4310. teleport = function()
  4311. if os.time() > mode.xmas.noel.timers.teleport then
  4312. mode.xmas.noel.timers.teleport = os.time() + 8000
  4313. tfm.exec.displayParticle(37,mode.xmas.noel.x,mode.xmas.noel.y)
  4314. local x,y = mathrandom(20,780),mathrandom(50,300)
  4315. tfm.exec.moveObject(mode.xmas.noel.id,x,y)
  4316. tfm.exec.displayParticle(37,x,y)
  4317. else
  4318. mode.xmas.noel.escape(2)
  4319. end
  4320. end,
  4321. gift = function()
  4322. if os.time() > mode.xmas.noel.timers.prize then
  4323. mode.xmas.noel.timers.prize = os.time() + 5000
  4324. mode.xmas.noel.updateImage(mode.xmas.noel.img.stop)
  4325. local giftsAmount = mode.xmas.amountPlayers < 10 and 1 or mathfloor(mode.xmas.amountPlayers/10)
  4326. for i = 1,giftsAmount do
  4327. local gift = tablerandom({2,4,3,1,1,2,3,5,2,4})
  4328. for k,v in next,mode.xmas.gifts do
  4329. if gift == k then
  4330. gift = k
  4331. break
  4332. end
  4333. end
  4334. local gen = {}
  4335. gen[1] = tfm.exec.addShamanObject(6300,mode.xmas.noel.x,mode.xmas.noel.y,0,tablerandom({-13,-10,-5,5,10,13}))
  4336. gen[2] = os.time() + mode.xmas.gifts[gift][2]
  4337. gen[3] = tfm.exec.addImage(mode.xmas.gifts[gift][1]..".png","#"..gen[1],-15,-15)
  4338. gen[4] = gift
  4339. tableinsert(mode.xmas.currentGifts,gen)
  4340. end
  4341. else
  4342. mode.xmas.noel.escape(0)
  4343. end
  4344. end,
  4345. dizzy = function(timer)
  4346. if os.time() > mode.xmas.noel.timers.prize then
  4347. mode.xmas.noel.isDizzy[1] = os.time() + 9500
  4348. else
  4349. mode.xmas.noel.escape(2)
  4350. end
  4351. end,
  4352. },
  4353. resetNoel = function()
  4354. mode.xmas.initx = 240
  4355. mode.xmas.inity = 140
  4356. mode.xmas.noel.x = mode.xmas.initx
  4357. mode.xmas.noel.y = mode.xmas.inity
  4358. mode.xmas.noel.id = -1
  4359. mode.xmas.noel.isEscaping = false
  4360. mode.xmas.noel.isDizzy = {0,false}
  4361. mode.xmas.noel.timers = {
  4362. teleport = 0,
  4363. prize = 0
  4364. }
  4365. end,
  4366. -- Bar
  4367. displayBar = function(id,player,value,nvalue,color,sig,size,height)
  4368. sig = sig or ""
  4369. size = size or 100
  4370. height = height or 20
  4371.  
  4372. ui.addTextArea(id,"",player,5,(height+8) * id,size + 4,height,0xC7CED2,1,1,true)
  4373. if value ~= 0 then
  4374. ui.addTextArea(id.."0","",player,6,(height+8) * id + 2,nvalue + 2,height - 4,color,color,1,true)
  4375. end
  4376. ui.addTextArea(id + 2,"<B><font color='#0'>"..value..sig,player,(size-30)/2,(height+8) * id + 1,50,height,1,1,0,true)
  4377. end,
  4378. updateBar = function(n,giftColor)
  4379. giftColor = giftColor or mode.xmas.info[n].lastColor
  4380. mode.xmas.displayBar(1,n,mathfloor(mode.xmas.info[n].db.eventNoelGifts[2]) .. " / "..mode.xmas.aim,(mode.xmas.info[n].db.eventNoelGifts[2] > mode.xmas.aim and 100 or mathpercent(mode.xmas.info[n].db.eventNoelGifts[2],mode.xmas.aim,100)),0xFF0000)
  4381. mode.xmas.displayBar(2,n,mode.xmas.info[n].db.eventNoelGifts[1],(mode.xmas.info[n].db.eventNoelGifts[1] > 50 and 50 or mathpercent(mode.xmas.info[n].db.eventNoelGifts[1],50,50)),giftColor,"G",50,20)
  4382. end,
  4383. -- Init
  4384. init = function()
  4385. mode.xmas.translations.pt = mode.xmas.translations.br
  4386. mode.xmas.langue = mode.xmas.translations[tfm.get.room.community] and tfm.get.room.community or "en"
  4387. for i,f in next,{"AutoShaman","AfkDeath","MortCommand","AutoTimeLeft","PhysicalConsumables","AutoNewGame","DebugCommand"} do
  4388. tfm.exec["disable"..f]()
  4389. end
  4390. tfm.exec.setRoomMaxPlayers(25)
  4391. tfm.exec.newGame(mode.xmas.xml)
  4392. mode.xmas.aim = system.miscAttrib > 0 and system.miscAttrib or 8
  4393. end,
  4394. -- New Game
  4395. eventNewGame = function()
  4396. mode.xmas.resetNoel()
  4397.  
  4398. mode.xmas.start = true
  4399.  
  4400. local _,aP = system.players()
  4401. mode.xmas.amountPlayers = aP
  4402.  
  4403. tfm.exec.setGameTime(150)
  4404. tfm.exec.snow(150)
  4405. mode.xmas.currentTime = 0
  4406. mode.xmas.leftTime = 150
  4407.  
  4408. tfm.exec.addImage("158c1feaf90.png","?0",0,0)
  4409.  
  4410. ui.setMapName("<J>"..tablerandom({"Nöel","Christmas","Bolodefchoco","Lua event","#xmas","Bogkitty"}).." <G>- @"..tablerandom({666,404,801,os.date("%Y"),0,1}))
  4411. ui.setShamanName("<R>S4NT4 M4U5")
  4412.  
  4413. for k,v in next,tfm.get.room.playerList do
  4414. mode.xmas.setPlayerTools(k)
  4415. end
  4416. tfm.exec.chatMessage(stringformat("<V><B>[^_^]</B></V> <BV>%s</BV>\n<V><B>[S4NT4 M4U5]</B></V> <R>%s</R>",mode.xmas.translations[mode.xmas.langue][2],stringupper(mode.xmas.translations[mode.xmas.langue][1])))
  4417. end,
  4418. -- New Player
  4419. eventNewPlayer = function(n)
  4420. tfm.exec.addImage("158c1feaf90.png","?0",0,0,n)
  4421. mode.xmas.setPlayerTools(n)
  4422. tfm.exec.respawnPlayer(n)
  4423. end,
  4424. -- Loop
  4425. eventLoop = function()
  4426. mode.xmas.currentTime = mode.xmas.currentTime + .5
  4427. mode.xmas.leftTime = mode.xmas.leftTime - .5
  4428. if mode.xmas.start then
  4429. if mode.xmas.currentTime > 4 then
  4430. if mode.xmas.noel.id == -1 then
  4431. mode.xmas.noel.id = tfm.exec.addShamanObject(6300,mode.xmas.noel.x,mode.xmas.noel.y)
  4432. mode.xmas.noel.updateImage(mode.xmas.noel.img.stop)
  4433. end
  4434.  
  4435. local ox,oy
  4436. if tfm.get.room.objectList[mode.xmas.noel.id] then
  4437. ox,oy = tfm.get.room.objectList[mode.xmas.noel.id].x,tfm.get.room.objectList[mode.xmas.noel.id].y
  4438. else
  4439. ox,oy = mode.xmas.noel.x,mode.xmas.noel.y
  4440. end
  4441.  
  4442. if (ox < -10 or ox > 810) or (oy > 400 or oy < -50) then
  4443. tfm.exec.removeObject(mode.xmas.noel.id)
  4444. mode.xmas.noel.x,mode.xmas.noel.y = mode.xmas.initx,mode.xmas.inity
  4445. mode.xmas.noel.id = nil
  4446. end
  4447.  
  4448. if mode.xmas.noel.id then
  4449. mode.xmas.noel.x = ox
  4450. mode.xmas.noel.y = oy
  4451. end
  4452.  
  4453. for k,v in ipairs(mode.xmas.despawnObjects) do
  4454. if os.time() > v[2] then
  4455. tfm.exec.removeObject(v[1])
  4456. end
  4457. end
  4458. for k,v in ipairs(mode.xmas.currentGifts) do
  4459. if os.time() > v[2] then
  4460. tfm.exec.removeObject(v[1])
  4461. tfm.exec.removeImage(v[3])
  4462. end
  4463. end
  4464.  
  4465. if os.time() > mode.xmas.noel.isDizzy[1] and mode.xmas.currentTime > 5 then
  4466. mode.xmas.noel.particles(13)
  4467. if mode.xmas.currentTime % 60 == 0 then
  4468. mode.xmas.noel.dizzy()
  4469. elseif mode.xmas.currentTime % 5 == 0 then
  4470. mode.xmas.noel.gift()
  4471. mode.xmas.noel.escape(1)
  4472. elseif mathfloor(mode.xmas.currentTime) % 2 == 0 then
  4473. local option = mathrandom((mode.xmas.noel.isEscaping and 15 or 12))
  4474. if option > 3 then
  4475. mode.xmas.noel.escape()
  4476. else
  4477. mode.xmas.noel.updateImage(mode.xmas.noel.img.stop)
  4478. if mode.xmas.currentTime > 7 and mathrandom(1,2) == 1 then
  4479. if option == 3 then
  4480. mode.xmas.noel.cannon()
  4481. elseif option == 2 then
  4482. mode.xmas.noel.teleport()
  4483. elseif option == 1 then
  4484. mode.xmas.noel.meep()
  4485. end
  4486. end
  4487. end
  4488. else
  4489. mode.xmas.noel.updateImage(mode.xmas.noel.img.stop)
  4490. end
  4491. else
  4492. mode.xmas.noel.particles(1)
  4493. if not mode.xmas.noel.isDizzy[2] then
  4494. mode.xmas.noel.isDizzy[2] = true
  4495. mode.xmas.noel.timers.prize = os.time() + 5000
  4496. local imgId = #mode.xmas.noel.img.dizzy
  4497. local animation = {}
  4498. local numb = 1
  4499. animation = system.looping(function()
  4500. mode.xmas.noel.updateImage(mode.xmas.noel.img.dizzy[imgId])
  4501.  
  4502. if imgId == #mode.xmas.noel.img.dizzy or imgId == 1 then
  4503. numb = -numb
  4504. end
  4505.  
  4506. imgId = imgId + numb
  4507.  
  4508. if (os.time()+250) > mode.xmas.noel.isDizzy[1] then
  4509. for k,v in next,animation do
  4510. system.removeTimer(v)
  4511. end
  4512. mode.xmas.noel.isDizzy = {0,false}
  4513. end
  4514. end,10)
  4515. end
  4516. end
  4517. end
  4518. if mode.xmas.leftTime < 2 then
  4519. mode.xmas.start = false
  4520. tfm.exec.newGame(mode.xmas.xml)
  4521. end
  4522. end
  4523. end,
  4524. -- Keyboard
  4525. eventKeyboard = function(n,k,d,x,y)
  4526. if mode.xmas.start then
  4527. if os.time() > mode.xmas.info[n].catch and k == 32 then
  4528. if os.time() < mode.xmas.noel.isDizzy[1] then
  4529. if mathpythag(x,y,mode.xmas.noel.x,mode.xmas.noel.y,32) then
  4530. mode.xmas.info[n].db.eventNoelGifts[2] = (mode.xmas.info[n].db.eventNoelGifts[1]/10) + mode.xmas.info[n].db.eventNoelGifts[2]
  4531. mode.xmas.info[n].db.eventNoelGifts[1] = 0
  4532.  
  4533. mode.xmas.updateBar(n)
  4534. end
  4535. else
  4536. for k,v in next,mode.xmas.currentGifts do
  4537. local o = tfm.get.room.objectList[v[1]]
  4538. if o and mathpythag(x,y,o.x,o.y,25) then
  4539. if (mode.xmas.info[n].db.eventNoelGifts[1]+v[4]) <= 50 then
  4540. tfm.exec.removeObject(v[1])
  4541. tfm.exec.removeImage(v[3])
  4542.  
  4543. mode.xmas.currentGifts[k][2] = 0
  4544. mode.xmas.info[n].db.eventNoelGifts[1] = mode.xmas.info[n].db.eventNoelGifts[1] + v[4]
  4545.  
  4546. mode.xmas.updateBar(n,({0xB73535,0x358CB7,0x35B765,0xB7B735,0xB73487})[v[4]])
  4547. break
  4548. end
  4549. end
  4550. end
  4551. end
  4552. mode.xmas.info[n].catch = os.time() + 1000
  4553. end
  4554. end
  4555. end,
  4556. -- Player Died
  4557. eventPlayerDied = function(n)
  4558. if mode.xmas.start then
  4559. system.bindKeyboard(n,32,true,false)
  4560. end
  4561. end,
  4562. }
  4563.  
  4564. --[[ Signal ]]--
  4565. mode.signal = {
  4566. -- Translations
  4567. translations = {
  4568. en = {
  4569. -- Init
  4570. welcome = "<S>Welcome to <PS>#Signal<S>! Follow the signs and join the hole! Use !help to read more informations.\n\tReport any issue to Bolodefchoco",
  4571.  
  4572. -- Info
  4573. info = {
  4574. [1] = {"Run","Run the faster you can. Do not stop!"},
  4575. [2] = {"Attention","Pay attention! You can die in a few seconds!"},
  4576. [3] = {"Stop","Stop or die!"},
  4577. },
  4578. skip = "<PS>[•] <S>Impossible map? Type !skip",
  4579. skipped = "Your vote to skip the map has been recorded.",
  4580.  
  4581. -- Simple words
  4582. close = "Close",
  4583. },
  4584. br = {
  4585. welcome = "<S>Bem-vindo ao <PS>#Signal<S>! Siga os sinais e entre na toca! Use !help para ler mais informações.\n\tReporte qualquer problema para Bolodefchoco",
  4586.  
  4587. info = {
  4588. [1] = {"Corra","Corra o mais rápido que puder. Não pare!"},
  4589. [2] = {"Atenção","Preste atenção! Você poderá morrer a qualquer momento!"},
  4590. [3] = {"Pare","Pare ou morra!"},
  4591. },
  4592. skip = "<PS>[•] <S>Mapa impossível? Digite !skip",
  4593. skipped = "Seu voto para passar o mapa foi registrado.",
  4594.  
  4595. close = "Fechar",
  4596. },
  4597. pl = {
  4598. welcome = "<S>Witaj w <PS>#Signal<S>! Patrz na tabliczke i wejdź do norki! Użyj komendy !help, aby przeczytać więcej informacji.\n\tZgłoś wszystkie błędy jakie znajdziesz do Bolodefchoco",
  4599.  
  4600. info = {
  4601. [1] = {"Biegnij","Biegnij jak najszybciej do norki. Nie zatrzymuj się!"},
  4602. [2] = {"Uważaj","Uważaj! Możesz zginąć za kilka sekund!"},
  4603. [3] = {"Stój","Stój albo zgiń!"},
  4604. },
  4605. skip = "<PS>[•] <S>Niemożliwa mapa? Wpisz komendę !skip",
  4606. skipped = "Twój głos na ominięcie mapy został policzony.",
  4607.  
  4608. close = "Zamknij",
  4609. },
  4610. },
  4611. langue = "en",
  4612. -- Data
  4613. info = {},
  4614. -- Maps
  4615. generateMap = function()
  4616. local groundProperties = {[0] = {.3,.2},[4] = {20,.2},[5] = {.3,.2},[6] = {.3,.2},[7] = {.1,.2},[10] = {.3,0},[11] = {.05,.1},[3] = {5,20}}
  4617. local groundDecorations = {[0] = {0,4,5},[4] = {1,42,51},[5] = {1,2,4,12,18,20,32,42,46},[6] = {0,1,2,3,4,5,11,42},[7] = {7,8,9,10},[10] = {42,103,118},[11] = {51,106},[3] = {}}
  4618. local newGround = "<S L=\"%s\" H=\"%s\" X=\"%s\" Y=\"%s\" T=\"%s\" P=\"0,0,%s,%s,0,0,0,0\" />"
  4619. local newDecoration = "<P P=\"%s,0\" X=\"%d\" Y=\"%d\" T=\"%d\" />"
  4620. local object = "<%s X=\"%s\" Y=\"%s\"/>"
  4621. local objects = {hole="T",mice="DS",cheese="F"}
  4622.  
  4623. local mapHeight = mathrandom(1500,3000)
  4624.  
  4625. local grounds = {}
  4626. local decorations = {}
  4627. for i = 1,mathceil(mapHeight/180) do
  4628. local T = tablerandom({0,4,5,6,7,10,11,tablerandom({4,5,6,10,3})})
  4629.  
  4630. local H = T==3 and mathrandom(10,20) or mathrandom(40,100)
  4631.  
  4632. local Y = (#grounds > 1 and grounds[#grounds].Y < 320 and mathrandom(230,310) or mathrandom(300,350)) or mathrandom(290,350)
  4633.  
  4634. local X,L
  4635. repeat
  4636. X = (#grounds > 1 and (grounds[#grounds].X + ((mathrandom(-1,1) * 30) + 200)) or mathrandom(50,300))
  4637. X = X < 60 and 100 or X > mapHeight - 100 and mapHeight - 300 or X
  4638. L = T==3 and H or mathrandom(40,mathceil(mapHeight/18))
  4639. until (X - (L/2)) > 50 and (X + (L/2)) < mapHeight - 50
  4640.  
  4641. local properties = groundProperties[T]
  4642. grounds[#grounds + 1] = {X=X,Y=Y,L=L,H=H,stringformat(newGround,L,H,X,Y,T,properties[1],properties[2])}
  4643.  
  4644. if T ~= 3 and mathrandom(20) < 10 then
  4645. local decoList = groundDecorations[T]
  4646. decorations[#decorations + 1] = stringformat(newDecoration,tablerandom({0,0,0,mathrandom(0,1),1}),X - mathrandom(-((L/4)+1),((L/4)+1)),Y - (H/2),tablerandom(decoList))
  4647. end
  4648. end
  4649.  
  4650. local cheeseX
  4651. repeat
  4652. cheeseX = mathrandom(200,mapHeight - 500)
  4653. until (function()
  4654. for k,v in next,grounds do
  4655. if (cheeseX + 10) > (v.X - v.L/2) and (cheeseX - 10) < (v.X + v.L/2) then
  4656. return false
  4657. end
  4658. end
  4659. return true
  4660. end)()
  4661.  
  4662. grounds[#grounds + 1] = {X=0,Y=0,L=0,H=0,stringformat(newGround,200,40,100,380,2,.3,.9)}
  4663. grounds[#grounds + 1] = {X=0,Y=0,L=0,H=0,stringformat(newGround,300,40,mapHeight - 150,380,6,.3,.2)}
  4664.  
  4665. tfm.exec.newGame(stringformat("<C><P G=\"0,%s\" F=\"%s\" L=\"%s\" /><Z><S>%s</S><D>%s%s%s%s</D><O /></Z></C>",tablerandom({mathrandom(7,12),10,11,9}),tablerandom({0,1,2,3,4,5,7,8}),mapHeight,tableconcat(grounds,"",function(k,v) return v[1] end),stringformat(object,objects.hole,mapHeight - 30,360),stringformat(object,objects.mice,10,365),stringformat(object,objects.cheese,cheeseX,mathrandom(280,340)),tableconcat(decorations)))
  4666. end,
  4667. -- Settings
  4668. sys = {0,1},
  4669. discrepancy = 0,
  4670. lights = {"15b52f8717d","15b52f8583a","15b52f88765"},
  4671. lightId = -1,
  4672. skip = 0,
  4673. rounds = 0,
  4674. possible = false,
  4675. -- Settings
  4676. update = function(id)
  4677. tfm.exec.removeImage(mode.signal.lightId)
  4678. mode.signal.lightId = tfm.exec.addImage(mode.signal.lights[mode.signal.sys[2]] .. ".png","&0",375,30)
  4679. local color = ({0x1CB70C,0xF4D400,0xEC0000})[mode.signal.sys[2]]
  4680. for k,v in next,mode.signal.info do
  4681. if id == 1 then
  4682. if not v.afk and v.canRev then
  4683. tfm.exec.respawnPlayer(k)
  4684. end
  4685. end
  4686. tfm.exec.setNameColor(k,color)
  4687. end
  4688. end,
  4689. -- Help
  4690. displayInfo = function(n,id)
  4691. local color = ({"<VP>","<J>","<R>"})[id]
  4692. ui.addTextArea(1,"<p align='center'><font size='25'>" .. color .. mode.signal.translations[mode.signal.langue].info[id][1] .. "\n</font></p><p align='left'><font size='14'>" .. mode.signal.translations[mode.signal.langue].info[id][2],n,250,110,300,181,0x324650,0x27343A,1,true)
  4693. ui.addTextArea(2,"<font size='2'>\n</font><p align='center'><font size='16'><a href='event:close'>" .. mode.signal.translations[mode.signal.langue].close,n,250,300,300,30,0x27343A,0x27343A,1,true)
  4694. ui.addTextArea(3,"<p align='center'><font size='20'><a href='event:info.1'><VP>•</a> <a href='event:info.2'><J>•</a> <a href='event:info.3'><R>•</a>",n,250,145,300,30,1,1,0,true)
  4695. tfm.exec.removeImage(mode.signal.info[n].imageId)
  4696. mode.signal.info[n].imageId = tfm.exec.addImage(mode.signal.lights[id] .. ".png","&1",375,200,n)
  4697. end,
  4698. -- Init
  4699. reset = function()
  4700. -- Data
  4701. mode.signal.info = {}
  4702. end,
  4703. init = function()
  4704. mode.signal.translations.pt = mode.signal.translations.br
  4705. mode.signal.langue = mode.signal.translations[tfm.get.room.community] and tfm.get.room.community or "en"
  4706.  
  4707. for _,f in next,{"AutoShaman","AutoNewGame","AutoTimeLeft","PhysicalConsumables"} do
  4708. tfm.exec["disable"..f]()
  4709. end
  4710.  
  4711. mode.signal.generateMap()
  4712. end,
  4713. -- New Player
  4714. eventNewPlayer = function(n)
  4715. if not mode.signal.info[n] then
  4716. mode.signal.info[n] = {
  4717. isMoving = {false,false,false,false},
  4718. imageId = -1,
  4719. afk = true,
  4720. skipped = false,
  4721. canRev = true,
  4722. }
  4723. end
  4724. for i = 0,3 do
  4725. system.bindKeyboard(n,i,true,true)
  4726. system.bindKeyboard(n,i,false,true)
  4727. end
  4728. tfm.exec.chatMessage(mode.signal.translations[mode.signal.langue].welcome,n)
  4729. end,
  4730. -- New Game
  4731. eventNewGame = function()
  4732. mode.signal.skip = 0
  4733. mode.signal.possible = false
  4734. mode.signal.rounds = mode.signal.rounds + 1
  4735.  
  4736. if mode.signal.rounds % 3 == 0 then
  4737. tfm.exec.chatMessage(mode.signal.translations[mode.signal.langue].skip)
  4738. end
  4739.  
  4740. ui.setMapName("<BL>@" .. mathrandom(999) .. " <G>| <N>Round : <V>" .. mode.signal.rounds)
  4741.  
  4742. for k,v in next,mode.signal.info do
  4743. v.isMoving = {false,false,false,false}
  4744. v.afk = true
  4745. v.skipped = false
  4746. v.canRev = true
  4747. end
  4748.  
  4749. mode.signal.sys = {0,1}
  4750. mode.signal.update(mode.signal.sys[2])
  4751. end,
  4752. -- Keyboard
  4753. eventKeyboard = function(n,k,d)
  4754. if mode.signal.sys[2] == 3 and d and os.time() > mode.signal.discrepancy then
  4755. tfm.exec.killPlayer(n)
  4756. else
  4757. mode.signal.info[n].isMoving[k + 1] = d
  4758. end
  4759. mode.signal.info[n].afk = false
  4760. end,
  4761. -- Loop
  4762. eventLoop = function(currentTime,leftTime)
  4763. if _G.currentTime > 8 then
  4764. if os.time() > mode.signal.sys[1] then
  4765. mode.signal.sys[2] = (mode.signal.sys[2] % 3) + 1
  4766. mode.signal.sys[1] = os.time() + ({mathrandom(7,13),mathrandom(2,3),mathrandom(3,5)})[mode.signal.sys[2]] * 1000
  4767. mode.signal.update(mode.signal.sys[2])
  4768. mode.signal.discrepancy = os.time() + 520
  4769. end
  4770. end
  4771.  
  4772. if _G.leftTime > 2 and system.players() > 0 then
  4773. if mode.signal.sys[2] == 3 and os.time() > mode.signal.discrepancy then
  4774. for k,v in next,mode.signal.info do
  4775. for i,j in next,v.isMoving do
  4776. if j then
  4777. tfm.exec.killPlayer(k)
  4778. break
  4779. end
  4780. end
  4781. end
  4782. end
  4783. else
  4784. mode.signal.generateMap()
  4785. end
  4786. end,
  4787. -- Callbacks
  4788. eventTextAreaCallback = function(i,n,c)
  4789. local p = stringsplit(c,"[^%.]+")
  4790. if p[1] == "info" then
  4791. mode.signal.displayInfo(n,tonumber(p[2]))
  4792. elseif p[1] == "close" then
  4793. tfm.exec.removeImage(mode.signal.info[n].imageId)
  4794. for i = 1,3 do
  4795. ui.removeTextArea(i,n)
  4796. end
  4797. end
  4798. end,
  4799. -- Commands
  4800. eventChatCommand = function(n,c)
  4801. if c == "info" or c == "help" or c == "?" then
  4802. eventTextAreaCallback(nil,n,"info." .. mode.signal.sys[2])
  4803. elseif c == "skip" and _G.currentTime > 8 and not mode.signal.possible and not mode.signal.info[n].skipped then
  4804. mode.signal.skip = mode.signal.skip + 1
  4805. tfm.exec.chatMessage(mode.signal.translations[mode.signal.langue].skipped,n)
  4806.  
  4807. local alive,total = system.players()
  4808. if mode.signal.skip == mathceil(.5 * total) then
  4809. tfm.exec.chatMessage("o/")
  4810. mode.signal.generateMap()
  4811. end
  4812. end
  4813. end,
  4814. -- Victory
  4815. eventPlayerWon = function(n)
  4816. mode.signal.possible = true
  4817. mode.signal.info[n].canRev = false
  4818. tfm.exec.setGameTime(40,false)
  4819. end,
  4820. }
  4821.  
  4822. --[[ Bootcamp+ ]]--
  4823. mode.bootcampP = {
  4824. -- Translations
  4825. translations = {
  4826. en = {
  4827. -- Init
  4828. welcome = "Welcome to <B>#Bootcamp+</B>! Type !info to check the commands\n\tReport any issue to Bolodefchoco!",
  4829.  
  4830. -- Info
  4831. info = "Checkpoint:\n\tIf the checkpoint system is enabled, press <B>E</B> to put a checkpoint and <B>Shift+E</B> to remove it.\nAdmin\n\tIf you are a room admin, there are some commands that you can execute:\n\tMaps\n\t\t!next <V>--> Pass the map</V>\n\t\t!again <V>--> Resets the current map</V>\n\t\t!np @Code <VP>or</VP> !map @Code <V>--> Loads a map</V>\n\t\t!queue clear <V>--> Clear the map queue</V>\n\t\t!queue add @Code <V>--> Adds a map in the map queue</V>\n\t\t!queue P3 <VP>or</VP> P13 <VP>or</VP> P23 <V>--> Adds the whole official rotation of P3 or P13 or P23 in the map queue</V>\n\tTime\n\t\t!time TimeInMinutes <V>--> Set the time of the current round in TimeInMinutes</V>\n\t\t!standtime TimeInMinutes <V>--> Set the time of all the rounds in TimeInMinutes</V>\n\tOthers\n\t\t<B>Shift+Click</B> in a ground to read its properties\n\t\t!checkpoint [[not] cheese] <V>--> Enables/Disables the checkpoint system</V>\n\t\tKey Delete <V>--> Kills you</V>",
  4832. skip = "<VP>%s</VP> just skipped the map!",
  4833. restart = "<VP>%s</VP> just restarted the current map!",
  4834. loadmap = "<VP>%s</VP> just loaded the map %s!",
  4835. settime = "The time has been set to %s minutes!",
  4836. setstandtime = "The standard time of all the rounds has been set to %s minutes!",
  4837. enabled = "enabled! Press <B>E</B> to put a checkpoint and <B>Shift+E</B> to remove it.",
  4838. queuecleared = "%s just cleared the map queue",
  4839. queuemapadded = "%s just added the map %s to the map queue",
  4840. queueperm = "%s just added the category %s to the map queue",
  4841. queuereset = "%s just reseted the queue to the main maps",
  4842.  
  4843. -- Simple words
  4844. disabled = "disabled!",
  4845. },
  4846. br = {
  4847. welcome = "Bem-vindo ao <B>#Bootcamp+</B>! Digite !info para checar os comandos\n\tReporte quaisquer problemas para Bolodefchoco!",
  4848.  
  4849. info = "Checkpoint:\n\tSe o sistema de checkpoint está ativado, pressione <B>E</B> para marcar um checkpoint e <B>Shift+E</B> para remove-lo.\nAdmin\n\tSe você é um administrador da sala, há alguns comandos que você pode executar:\n\tMapas\n\t\t!next <V>--> Passa o mapa</V>\n\t\t!again <V>--> Reinicia o mapa atual</V>\n\t\t!np @Código <VP>ou</VP> !map @Código <V>--> Carrega um mapa</V>\n\t\t!queue clear <V>--> Limpa a lista de mapas</V>\n\t\t!queue add @Código <V>--> Adiciona um mapa na lista de mapas</V>\n\t\t!queue P3 <VP>ou</VP> P13 <VP>ou</VP> P23 <V>--> Adiciona a rotação inteira de P3 ou P13 ou P23 na lista de mapas</V>\n\tTempo\n\t\t!time TempoEmMinutos <V>--> Define o tempo do mapa atual em TempoEmMinutos</V>\n\t\t!standtime TempoEmMinutos <V>--> Define o tempo de todas as partidas em TempoEmMinutos</V>\n\tOutros\n\t\t<B>Shift+Click</B> sobre um piso para ler suas propriedades\n\t\t!checkpoint [[not] cheese] <V>--> Ativa/Desativa o sistema de checkpoint</V>\n\t\tTecla Delete <V>--> Mata-o</V>",
  4850. skip = "<VP>%s</VP> acabou de passar o mapa!",
  4851. restart = "<VP>%s</VP> acabou de reiniciar o mapa atual!",
  4852. loadmap = "<VP>%s</VP> acabou de carregar o mapa %s!",
  4853. settime = "O tempo foi definido para %s minutos!",
  4854. setstandtime = "O tempo padrão para todas as partidas foram definidas para %s minutos!",
  4855. enabled = "ativado! Pressione <B>E</B> para marcar um checkpoint e <B>Shift+E</B> para remove-lo.",
  4856. queuecleared = "%s acabou de limpar a rotação de mapas",
  4857. queuemapadded = "%s acabou de adicionar o mapa %s na rotação de mapas",
  4858. queueperm = "%s acabou de adicionar a categoria %s na rotação de mapas",
  4859. queuereset = "%s acabou de resetar a rotação de mapas para os mapas principais",
  4860.  
  4861. disabled = "desativado!",
  4862. },
  4863. pl = {
  4864. welcome = "Witaj w <B>#Bootcamp+</B>! Wpisz !info na czacie aby sprawdzić jakie są komendy\n\tZgłaszaj wszelkie błędy do Bolodefchoco!",
  4865.  
  4866. info = "Checkpoint:\n\tJeżeli system checkpointów jest włączony, kliknij <B>E</B>, aby ustawić checkpoint i <B>Shift+E</B>, aby go usunąć.\nAdmin\n\tJeżeli jesteś administratorem pokoju, jest kilka komend, które możesz użyć:\n\tMapy\n\t\t!next <V>--> Przełącza mapę</V>\n\t\t!again <V>--> Restartuje mapę</V>\n\t\t!np @Code <VP>albo</VP> !map @Code <V>--> Ładuje mapę</V>\n\t\t!queue clear <V>--> Czyści kolejkę map</V>\n\t\t!queue add @Code <V>--> Dodaję mapę do kolejki</V>\n\t\t!queue P3 <VP>albo</VP> P13 <VP>albo</VP> P23 <V>--> Dodaje wszystkie oficjalne rotacje z permów P3 albo P13 albo P23 do kolejki map</V>\n\tCzas\n\t\t!time CzasWMinutach <V>--> Ustawia czas obecnej mapy na CzasWMinutach</V>\n\t\t!standtime CzasWMinutach <V>--> Ustawia czas dla wszystkich rund na CzasWMinutach</V>\n\tInne\n\t\t<B>Shift+Click</B> na gruncie aby przeczytać jego właściwości\n\t\t!checkpoint [[not] cheese] <V>--> Włącza/Wyłącza system checkpointów</V>\n\t\tKey Delete <V>--> Kills you</V>",
  4867. skip = "<VP>%s</VP> pominął/-ęła mapę!",
  4868. restart = "<VP>%s</VP> zrestartował/-a mapę!",
  4869. loadmap = "<VP>%s</VP> załadował/-a mapę %s!",
  4870. settime = "Czas został ustawiony na %s minut!",
  4871. setstandtime = "Standardowy czas dla wszystkich map został ustawiony na %s minut!",
  4872. enabled = "włączony! Kliknij <B>E</B>, aby ustawić checkpoint i <B>Shift+E</B>, aby go usunąć.",
  4873. queuecleared = "%s just cleared the map queue",
  4874. queuemapadded = "%s just added the map %s to the map queue",
  4875. queueperm = "%s just added the category %s to the map queue",
  4876. queuereset = "%s just reseted the queue to the main maps",
  4877.  
  4878. disabled = "wyłączony!",
  4879. },
  4880. },
  4881. langue = "en",
  4882. -- Data
  4883. info = {},
  4884. -- Maps
  4885. maps = {},
  4886. map = function()
  4887. mode.bootcampP.maps = {6501305,6118143,2604997,2836937,6921682,3339586,5776126,5678468,6531399,5847160,5745650,7091808,7000003,6999993,4559999,4784241,3883780,4976520,4854044,6374076,3636206,6793803,4499335,4694197,5485847,6258690,3938895,1719709,4209243,6550335,5994088,3866650,3999455,4095418,4523127,1964971,1554670,4423047,764650,5562230,4883346,2978216,1947288,7025830,7108857,4766627,5888889,6782978,5699275,6422459,2634659,4808290,3620953,2973289,2604643,6591698,7134487,7054821,6900009,7159725,3737744,6933187,6864581,4701337,6631702,6761156,4212122,4160675,4623227,5191670,6377984,1132272,2781845,3460976,7167027,4834444,3734991,7138019,7037760,6521356,6502657,6469688,6092666,2749928,7175796,7142063,7167539,7173296,6995540,7151000,3931358,3374686,6324891,3704015,3937060,2429057,7192029,7192034,7192689}
  4888. end,
  4889. -- New Game Settings
  4890. groundsData = {},
  4891. mapData = {},
  4892. standardTime = 6,
  4893. checkpoint = false,
  4894. -- Settings
  4895. respawnCheese = false,
  4896. -- Leaderboard
  4897. rank = function(players,fromValue,showPos,showPoints,pointsName,lim)
  4898. local p,rank = {},""
  4899. fromValue,lim = fromValue or {tfm.get.room.playerList,"score"},tonumber(lim) or 100
  4900. for n in next,players do
  4901. p[#p+1] = {name=n,v=fromValue[1][n][fromValue[2]]}
  4902. end
  4903. tablesort(p,function(f,s) return f.v>s.v end)
  4904. for o,n in next,p do
  4905. if o <= lim then
  4906. rank = rank .. (showPos and "<J>"..o..". " or "") .. "<V>" .. n.name .. (showPoints and " <BL>- <VP>" .. n.v .. " "..(pointsName or "points") .."\n" or "\n")
  4907. end
  4908. end
  4909. return rank
  4910. end,
  4911. -- Init
  4912. reset = function()
  4913. -- Data
  4914. mode.bootcampP.info = {}
  4915. end,
  4916. init = function()
  4917. -- Translations
  4918. mode.bootcampP.translations.pt = mode.bootcampP.translations.br
  4919. mode.bootcampP.langue = mode.bootcampP.translations[tfm.get.room.community] and tfm.get.room.community or "en"
  4920.  
  4921. -- Settings
  4922. mode.bootcampP.respawnCheese = system.miscAttrib == 1
  4923.  
  4924. -- Init
  4925. for _,f in next,{"AutoShaman","AutoScore","AutoTimeLeft","AutoNewGame","PhysicalConsumables","AfkDeath"} do
  4926. tfm.exec["disable"..f]()
  4927. end
  4928. tfm.exec.setAutoMapFlipMode(false)
  4929.  
  4930. mode.bootcampP.map()
  4931. tfm.exec.newGame(tablerandom(mode.bootcampP.maps))
  4932.  
  4933. -- Auto Admin
  4934. system.roomAdmins.Mquk = true
  4935. end,
  4936. -- New Game
  4937. eventNewGame = function()
  4938. tfm.exec.setGameTime(mode.bootcampP.standardTime * 60)
  4939. mode.bootcampP.groundsData = {}
  4940. mode.bootcampP.mapData = {}
  4941. for k,v in next,mode.bootcampP.info do
  4942. v.cheese = false
  4943. v.checkpoint = {false,0,0,false}
  4944. ui.removeTextArea(1,n)
  4945. end
  4946.  
  4947. local xml = tfm.get.room.xmlMapInfo.xml
  4948. if xml then
  4949. local grounds = stringmatch(xml,"<S>(.-)</S>")
  4950. local properties = stringmatch(xml,"<C><P (.-)/>.*<Z>")
  4951. if properties then
  4952. mode.bootcampP.mapData = {
  4953. width = stringmatch(properties,'L="(%d+)"') or 800,
  4954. heigth = stringmatch(properties,'H="(%d+)"') or 400,
  4955. }
  4956. else
  4957. mode.bootcampP.mapData = {
  4958. width = 800,
  4959. heigth = 400,
  4960. }
  4961. end
  4962.  
  4963. local data = {}
  4964. stringgsub(grounds,"<S (.-)/>",function(attributes)
  4965. data[#data + 1] = attributes
  4966. end)
  4967. for i = 1,#data do
  4968. mode.bootcampP.groundsData[i] = {}
  4969.  
  4970. local type = stringmatch(data[i],'T="(%d+)"')
  4971. mode.bootcampP.groundsData[i].type = type and tonumber(type) or -1
  4972.  
  4973. local x = stringmatch(data[i],'X="(%d+)"')
  4974. mode.bootcampP.groundsData[i].x = x and tonumber(x) or 0
  4975.  
  4976. local y = stringmatch(data[i],'Y="(%d+)"')
  4977. mode.bootcampP.groundsData[i].y = y and tonumber(y) or 0
  4978.  
  4979. local width = stringmatch(data[i],'L="(%d+)"')
  4980. mode.bootcampP.groundsData[i].width = width and tonumber(width) or 0
  4981.  
  4982. local heigth = stringmatch(data[i],'H="(%d+)"')
  4983. mode.bootcampP.groundsData[i].heigth = heigth and tonumber(heigth) or 0
  4984.  
  4985. local info = stringmatch(data[i],'P="(.*)"')
  4986. info = stringsplit(info,"[^,]+")
  4987.  
  4988. mode.bootcampP.groundsData[i].friction = info[3] and tonumber(info[3]) or .3
  4989. mode.bootcampP.groundsData[i].restitution = info[3] and tonumber(info[4]) or .2
  4990. mode.bootcampP.groundsData[i].angle = info[3] and tonumber(info[5]) or 0
  4991. end
  4992. end
  4993. end,
  4994. -- New Player
  4995. eventNewPlayer = function(n)
  4996. if not mode.bootcampP.info[n] then
  4997. mode.bootcampP.info[n] = {
  4998. shift = false,
  4999. checkpoint = {false,0,0,false},
  5000. cheese = false,
  5001. }
  5002. end
  5003.  
  5004. system.bindMouse(n,true)
  5005. for i = 1,2 do
  5006. system.bindKeyboard(n,16,i==1,true)
  5007. system.bindKeyboard(n,stringbyte("K"),i==1,true)
  5008. end
  5009.  
  5010. system.bindKeyboard(n,stringbyte("E"),true,true)
  5011. system.bindKeyboard(n,46,true,true) -- Delete key
  5012. tfm.exec.chatMessage("<T>" .. system.getTranslation("welcome") .. "\n\t<CEP>/w Mquk #bootcamp+ @mapCode",n)
  5013.  
  5014. local id = tfm.exec.addImage("15c6ee6324d.png","&0",120,100,n)
  5015. system.newTimer(function()
  5016. tfm.exec.removeImage(id)
  5017. end,5000,false)
  5018. end,
  5019. -- Mouse
  5020. eventMouse = function(n,x,y)
  5021. if mode.bootcampP.info[n].shift then
  5022. for i = #mode.bootcampP.groundsData,1,-1 do
  5023. local g = mode.bootcampP.groundsData[i]
  5024. local rad = mathrad(g.angle)
  5025. local ax = {mathcos(rad),mathsin(rad)}
  5026.  
  5027. local gX = g.x + ax[1] * (x - g.x) - ax[2] * (y - g.y)
  5028. local gY = g.y + ax[2] * (x - g.x) + ax[1] * (y - g.y)
  5029.  
  5030. if (g.type == 13 and mathpythag(x,y,g.x,g.y,g.width/2) or (mathabs(gX - g.x) < g.width/2 and mathabs(gY - g.y) < g.heigth/2)) then
  5031. local properties = {"Type","ID","X","Y","Heigth","Width","Friction","Restitution","Angle"}
  5032. local info = ""
  5033.  
  5034. for k,v in next,properties do
  5035. info = info .. stringformat("<N>%s : <V>%s\n",v,(v == "ID" and i or v == "Type" and (({[0] = "Unknown","Wood","Ice","Trampoline","Lava","Chocolate","Earth","Grass","Sand","Cloud","Water","Stone","Snow","Rectangle","Circle","Spiderweb"})[g.type + 1]) or tostring(g[stringlower(v)])))
  5036. end
  5037.  
  5038. local mapW = tonumber(mode.bootcampP.mapData.width)
  5039. local mapH = tonumber(mode.bootcampP.mapData.heigth)
  5040. ui.addTextArea(0,info,n,(x + 150 <= mapW and x) or (x < 0 and 0) or (mapW - 150),(y + 180 <= mapH and y > 20 and y) or (y < 20 and 25) or (mapH - 180),nil,nil,nil,nil,.8,false)
  5041. end
  5042. end
  5043. else
  5044. ui.removeTextArea(0,n)
  5045. end
  5046. end,
  5047. -- Keyboard
  5048. eventKeyboard = function(n,k,d,x,y)
  5049. if k == 16 then
  5050. mode.bootcampP.info[n].shift = d
  5051. elseif k == stringbyte("E") and mode.bootcampP.checkpoint then
  5052. if mode.bootcampP.info[n].shift then
  5053. mode.bootcampP.info[n].checkpoint = {false,0,0,mode.bootcampP.info[n].checkpoint[4]}
  5054. ui.removeTextArea(1,n)
  5055. else
  5056. mode.bootcampP.info[n].checkpoint = {true,x,y,true}
  5057. ui.addTextArea(1,"",n,x-5,y-5,10,10,0x56A75A,0x56A75A,.5,true)
  5058. end
  5059. elseif k == stringbyte("K") then
  5060. if d then
  5061. ui.addTextArea(2,mode.bootcampP.rank(tfm.get.room.playerList,{tfm.get.room.playerList,"score"},true,true,"points",20),n,5,30,nil,200,nil,nil,.8,true)
  5062. else
  5063. ui.removeTextArea(2,n)
  5064. end
  5065. elseif k == 46 then
  5066. tfm.exec.killPlayer(n)
  5067. end
  5068. end,
  5069. -- Commands
  5070. eventChatCommand = function(n,c)
  5071. local p = stringsplit(c,"[^%s]+",stringlower)
  5072. if p[1] == "info" then
  5073. tfm.exec.chatMessage("<T>" .. system.getTranslation("info"),n)
  5074. else
  5075. if system.roomAdmins[n] then
  5076. if p[1] == "next" and os.time() > system.newGameTimer then
  5077. tfm.exec.newGame(tablerandom(mode.bootcampP.maps))
  5078. tfm.exec.chatMessage("<T>• " .. stringformat(system.getTranslation("skip"),n))
  5079. elseif p[1] == "again" and os.time() > system.newGameTimer then
  5080. tfm.exec.newGame(tfm.get.room.currentMap)
  5081. tfm.exec.chatMessage("<T>• " .. stringformat(system.getTranslation("restart"),n))
  5082. elseif (p[1] == "np" or p[1] == "map") and os.time() > system.newGameTimer then
  5083. tfm.exec.newGame(p[2])
  5084. tfm.exec.chatMessage("<T>• " .. stringformat(system.getTranslation("loadmap"),n,stringfind(p[2],"@") and p[2] or "@"..p[2]))
  5085. elseif p[1] == "time" then
  5086. tfm.exec.setGameTime(p[2] * 60)
  5087. tfm.exec.chatMessage(stringformat(system.getTranslation("settime"),p[2]))
  5088. elseif p[1] == "standtime" then
  5089. p[2] = p[2] and tonumber(p[2]) or 6
  5090. if p[2] > 0 and p[2] < 10 then
  5091. mode.bootcampP.standardTime = p[2]
  5092. tfm.exec.chatMessage(stringformat(system.getTranslation("setstandtime",p[2])))
  5093. end
  5094. elseif p[1] == "checkpoint" then
  5095. local attribute = false
  5096. if p[2] then
  5097. attribute = true
  5098. if p[2] == "not" and p[3] and p[3] == "cheese" then
  5099. mode.bootcampP.respawnCheese = false
  5100. elseif p[2] == "cheese" then
  5101. mode.bootcampP.respawnCheese = true
  5102. else
  5103. attribute = false
  5104. end
  5105. end
  5106.  
  5107. if not (mode.bootcampP.checkpoint and attribute) then
  5108. mode.bootcampP.checkpoint = not mode.bootcampP.checkpoint
  5109. tfm.exec.chatMessage("<T>Checkpoint " .. system.getTranslation(mode.bootcampP.checkpoint and "enabled" or "disabled"))
  5110.  
  5111. if not mode.bootcampP.checkpoint then
  5112. ui.removeTextArea(1,nil)
  5113. for k,v in next,mode.bootcampP.info do
  5114. v.checkpoint = {false,0,0,v.checkpoint[4]}
  5115. end
  5116. if system.miscAttrib ~= 1 then
  5117. mode.bootcampP.respawnCheese = false
  5118. end
  5119. for k,v in next,mode.bootcampP.info do
  5120. v.cheese = false
  5121. end
  5122. end
  5123. end
  5124. elseif p[1] == "queue" then
  5125. if p[2] == "clear" then
  5126. mode.bootcampP.maps = {}
  5127. tfm.exec.chatMessage("• " .. stringformat(system.getTranslation("queuecleared"),n))
  5128. elseif p[2] == "add" then
  5129. mode.bootcampP.maps[#mode.bootcampP.maps + 1] = p[3]
  5130. tfm.exec.chatMessage("• " .. stringformat(system.getTranslation("queuemapadded"),n,stringfind(p[3],"@") and p[3] or "@"..p[3]))
  5131. elseif p[2] and stringsub(p[2],1,1) == "p" then
  5132. if p[2] == "p3" or p[2] == "p13" or p[2] == "p23" then
  5133. mode.bootcampP.maps[#mode.bootcampP.maps + 1] = "#" .. stringsub(p[2],2)
  5134. tfm.exec.chatMessage("• " .. stringformat(system.getTranslation("queueperm"),n,stringupper(p[2])))
  5135. end
  5136. else
  5137. mode.bootcampP.map()
  5138. tfm.exec.chatMessage("• " .. stringformat(system.getTranslation("queuereset"),n))
  5139. end
  5140. end
  5141. end
  5142. end
  5143. end,
  5144. -- Loop
  5145. eventLoop = function()
  5146. if _G.leftTime < 1 then
  5147. tfm.exec.newGame(tablerandom(mode.bootcampP.maps))
  5148. end
  5149. end,
  5150. -- Player Died
  5151. eventPlayerDied = function(n)
  5152. system.newTimer(function()
  5153. tfm.exec.respawnPlayer(n)
  5154.  
  5155. if mode.bootcampP.checkpoint and mode.bootcampP.info[n].checkpoint[1] then
  5156. tfm.exec.movePlayer(n,mode.bootcampP.info[n].checkpoint[2],mode.bootcampP.info[n].checkpoint[3])
  5157. end
  5158. if mode.bootcampP.checkpoint and mode.bootcampP.info[n].cheese and mode.bootcampP.respawnCheese then
  5159. tfm.exec.giveCheese(n)
  5160. end
  5161. end,1500,false)
  5162. end,
  5163. -- Victory
  5164. eventPlayerWon = function(n,t,time)
  5165. mode.bootcampP.info[n].cheese = false
  5166. mode.bootcampP.info[n].checkpoint = {false,0,0,mode.bootcampP.info[n].checkpoint[4]}
  5167. ui.removeTextArea(1,n)
  5168.  
  5169. mode.bootcampP.eventPlayerDied(n)
  5170. tfm.exec.setPlayerScore(n,1,true)
  5171. tfm.exec.chatMessage(stringformat("<ROSE>%s (%ss <PT>(%scheckpoint)</PT>)",n,time/100,mode.bootcampP.info[n].checkpoint[4] and "" or "no "),n)
  5172. end,
  5173. -- Got Cheese
  5174. eventPlayerGetCheese = function(n)
  5175. if mode.bootcampP.checkpoint and mode.bootcampP.respawnCheese then
  5176. mode.bootcampP.info[n].cheese = true
  5177. end
  5178. end,
  5179. }
  5180.  
  5181. --[[ Map ]]--
  5182. mode.map = {
  5183. -- Translations
  5184. translations = {
  5185. en = {
  5186. -- Init
  5187. welcome = "Welcome to #map! Here you can test your maps in different categories and check its approvation in the community!\n\tAdd a map to the queue with the command <B>!maptest @Code PCategory</B> and check the map info using the command <B>!mapinfo</B>.\n\n\tReport any problem to Bolodefchoco.",
  5188.  
  5189. -- Info
  5190. savenewmap = "Your map %s is in the position %s",
  5191. newmaptime = "Less than %s minutes",
  5192. vote = "Your vote has been recorded.",
  5193. dovote = "Hold P and vote according to your opinion about this map!",
  5194.  
  5195. -- Map Info
  5196. mapby = "Map %s loaded by %s as %s.",
  5197.  
  5198. -- Security
  5199. cantvote = "You cannot vote.",
  5200.  
  5201. -- Simple words
  5202. grounds = "Grounds",
  5203. status = "Status",
  5204. author = "Author",
  5205. },
  5206. br = {
  5207. welcome = "Bem-vindo ao #map! Aqui você pode testar seus mapas em diferentes categorias e checar sua aprovação na comunidade!\n\tAdicione um mapa na lista de espera com o comando <B>!maptest @Código PCategoria</B> e cheque as informações do mapa usando o comando <B>!mapinfo</B>.\n\n\tReporte qualquer problema para Bolodefchoco.",
  5208.  
  5209. savenewmap = "Seu mapa %s está na posição %s",
  5210. newmaptime = "Menos de %s minutos",
  5211. vote = "Seu voto foi registrado.",
  5212. dovote = "Segure P e vote de acordo com sua opinião sobre este mapa!",
  5213.  
  5214. mapby = "Mapa %s carregado por %s como %s.",
  5215.  
  5216. cantvote = "Vote não pode votar.",
  5217.  
  5218. grounds = "Pisos",
  5219. status = "Estado",
  5220. author = "Autor",
  5221. }
  5222. },
  5223. langue = "en",
  5224. -- Data
  5225. info = {},
  5226. -- Maps
  5227. queue = {},
  5228. -- Map Settings
  5229. autoRespawn = false,
  5230. category = -1,
  5231. mapInfo = {},
  5232. canInfo = false,
  5233. totalPlayers = 0,
  5234. skip = false,
  5235. images = {},
  5236. -- Next Map
  5237. nextMap = function()
  5238. if os.time() > system.newGameTimer and #mode.map.queue > 0 then
  5239. local mapData = mode.map.queue[1]
  5240.  
  5241. mode.map.mapInfo = {mapData[1],mapData[2],0,0}
  5242. mode.map.category = mapData[3]
  5243.  
  5244. mode.map.before()
  5245. tfm.exec.newGame(mapData[1])
  5246. end
  5247. end,
  5248. -- Category rules
  5249. before = function()
  5250. if mode.map.category >= 0 then
  5251. if tablefind({0,1,4,5,6,8,9},mode.map.category) then
  5252. tfm.exec.disableAutoShaman(false)
  5253. tfm.exec.disableAfkDeath(false)
  5254. mode.map.autoRespawn = false
  5255. elseif tablefind({3,7,17},mode.map.category) then
  5256. tfm.exec.disableAutoShaman()
  5257. if mode.map.category == 3 then
  5258. mode.map.autoRespawn = true
  5259. tfm.exec.disableAfkDeath()
  5260. end
  5261. end
  5262. end
  5263. end,
  5264. after = function()
  5265. if mode.map.category >= 0 then
  5266. if tablefind({0,1,4,5,6,8,9},mode.map.category) then
  5267. tfm.exec.setGameTime(135)
  5268. if mode.map.category == 8 and mode.map.totalPlayers > 1 then
  5269. local newShaman
  5270. repeat
  5271. newShaman = tablerandom(system.players(true))
  5272. until not tfm.get.room.playerList[newShaman].isShaman
  5273.  
  5274. ui.setShamanName((function()
  5275. for k,v in next,tfm.get.room.playerList do
  5276. if v.isShaman then
  5277. return k
  5278. end
  5279. end
  5280. return "?"
  5281. end)() .. " - <PS>" .. newShaman)
  5282. tfm.exec.setShaman(newShaman)
  5283.  
  5284. local xml = tfm.get.room.xmlMapInfo.xml
  5285. local attribute = stringmatch(xml,"<DC2 (.-)/>")
  5286. if attribute then
  5287. local x = stringmatch(attribute,"X=\"(%d+)\"")
  5288. local y = stringmatch(attribute,"Y=\"(%d+)\"")
  5289. if x and y then
  5290. tfm.exec.movePlayer(newShaman,x,y)
  5291. end
  5292. end
  5293.  
  5294. tfm.exec.setNameColor(newShaman,0xF1C4F6)
  5295. end
  5296. elseif mode.map.category == 3 then
  5297. tfm.exec.setGameTime(360)
  5298. elseif mode.map.category == 7 then
  5299. tfm.exec.setGameTime(120)
  5300. elseif mode.map.category == 17 then
  5301. tfm.exec.setGameTime(63)
  5302. end
  5303. end
  5304. end,
  5305. -- Init
  5306. init = function()
  5307. mode.map.translations.pt = mode.map.translations.br
  5308. mode.map.langue = mode.map.translations[tfm.get.room.community] and tfm.get.room.community or "en"
  5309.  
  5310. tfm.exec.disableAutoNewGame()
  5311. tfm.exec.setGameTime(10,false)
  5312.  
  5313. local alive
  5314. alive,mode.map.totalPlayers = system.players()
  5315. end,
  5316. -- New Player
  5317. eventNewPlayer = function(n)
  5318. if not mode.map.info[n] then
  5319. mode.map.info[n] = {
  5320. hasVoted = false
  5321. }
  5322. end
  5323.  
  5324. for i = 1,2 do
  5325. system.bindKeyboard(n,stringbyte("P"),i == 1,true)
  5326. end
  5327.  
  5328. tfm.exec.chatMessage("<J>" .. system.getTranslation("welcome"),n)
  5329. end,
  5330. -- New Game
  5331. eventNewGame = function()
  5332. ui.removeTextArea(2,nil)
  5333. mode.map.skip = false
  5334. if mode.map.mapInfo[1] then
  5335. mode.map.canInfo = true
  5336.  
  5337. mode.map.after()
  5338. mode.map.after = function() end
  5339. tableremove(mode.map.queue,1)
  5340.  
  5341. for k,v in next,mode.map.info do
  5342. v.hasVoted = false
  5343. end
  5344.  
  5345. for k,v in next,mode.map.images do
  5346. tfm.exec.removeImage(v)
  5347. end
  5348.  
  5349. xml.attribFunc(tfm.get.room.xmlMapInfo.xml,{
  5350. [1] = {
  5351. attribute = "img",
  5352. func = function(value)
  5353. local images = stringsplit(value,"[^;]+")
  5354. for k,v in next,images do
  5355. local info = stringsplit(v,"[^,]+")
  5356.  
  5357. -- "img.png,x or 0,y or 0,0/1 (foreground)"
  5358. info[4] = tonumber(info[4]) or 0
  5359. if tablefind({0,1},info[4]) then
  5360. mode.map.images[#mode.map.images + 1] = tfm.exec.addImage(info[1],(info[4] == 0 and "?" or info[4] == 1 and "&") .. k,tonumber(info[2]) or 5,tonumber(info[3]) or 30)
  5361. end
  5362. end
  5363. end
  5364. }
  5365. })
  5366.  
  5367. tfm.exec.chatMessage("<J>" .. stringformat(system.getTranslation("mapby"),"@" .. mode.map.mapInfo[1],mode.map.mapInfo[2],"P" .. mode.map.category))
  5368. tfm.exec.chatMessage("<J>" .. system.getTranslation("dovote"))
  5369. end
  5370. end,
  5371. -- Commands
  5372. eventChatCommand = function(n,c)
  5373. local p = stringsplit(c,"[^%s]+",stringlower)
  5374. if system.isPlayer(n) and p[1] == "maptest" and p[2] then
  5375. p[2] = tonumber(stringsub(p[2],(stringfind(p[2],"@") and 2 or 1),8))
  5376. if p[2] and #tostring(p[2]) > 3 then
  5377. if #mode.map.mapInfo == 0 then
  5378. tfm.exec.setGameTime(10,false)
  5379. end
  5380.  
  5381. local pos = #mode.map.queue + 1
  5382. local category = (p[3] and tonumber(stringsub(p[3],(stringfind(p[3],"p") and 2 or 1))) or 0)
  5383. if tablefind({0,1,3,4,5,6,7,8,9,17,18},category) then
  5384. if category == 18 then
  5385. category = 1
  5386. end
  5387. else
  5388. category = 0
  5389. end
  5390.  
  5391. mode.map.queue[pos] = {p[2],n,category}
  5392. tfm.exec.chatMessage("<J><B>" .. stringformat(system.getTranslation("savenewmap"),stringformat("@%s (P%s)",p[2],category),"#" .. pos) .. "</B>. <ROSE>" .. stringformat("(%s)",stringformat(system.getTranslation("newmaptime"),pos * 2.5)),n)
  5393. end
  5394. elseif mode.map.mapInfo[1] and p[1] == "mapinfo" then
  5395. local xml = tfm.get.room.xmlMapInfo
  5396. xml = xml and xml.xml or "?"
  5397.  
  5398. local attributes = stringmatch(xml,"<P (.-)/>") or "?"
  5399.  
  5400. local totalGrounds = (function()
  5401. local g = stringmatch(xml,"<S>(.-)</S>") or "?"
  5402.  
  5403. local total = 0
  5404. stringgsub(g,"<S ",function()
  5405. total = total + 1
  5406. end)
  5407.  
  5408. return total
  5409. end)()
  5410.  
  5411. local info = {attributes,system.getTranslation("grounds") .. ": " .. totalGrounds,system.getTranslation("author") .. ": " .. (tfm.get.room.xmlMapInfo.author or "?"),system.getTranslation("status") .. ": " .. ("P" .. tfm.get.room.xmlMapInfo.permCode or "?")}
  5412. ui.addTextArea(2,"\t<J>" .. tableconcat(info," <G>|<J> "),n,5,380,790,20,1,1,.7,true)
  5413. elseif n == mode.map.mapInfo[2] and p[1] == "time" then
  5414. tfm.exec.setGameTime(tonumber(stringsub(p[2],1,3)) or 60,false)
  5415. elseif n == mode.map.mapInfo[2] and p[1] == "skip" then
  5416. if os.time() > system.newGameTimer then
  5417. mode.map.skip = true
  5418. mode.map.mapInfo = {}
  5419. end
  5420. end
  5421. end,
  5422. eventKeyboard = function(n,k,d)
  5423. if k == stringbyte("P") and _G.currentTime > 5 and #mode.map.mapInfo > 0 then
  5424. if d and not mode.map.info[n].hasVoted then
  5425. if n == mode.map.mapInfo[2] or not system.isPlayer(n) then
  5426. tfm.exec.chatMessage("<R>" .. system.getTranslation("cantvote"),n)
  5427. else
  5428. local ic = {{"+","VP"},{"-","R"}}
  5429. for i = 0,1 do
  5430. ui.addTextArea(i,"<p align='center'><font size='6'>\n<font size='17'><" .. ic[i+1][2] .. "><a href='event:" .. ic[i+1][1] .. "'><B>" .. ic[i+1][1] .. "1",n,5 + i * 50,30,40,40,1,1,.7,true)
  5431. end
  5432. end
  5433. else
  5434. for i = 0,1 do
  5435. ui.removeTextArea(i,n)
  5436. end
  5437. end
  5438. end
  5439. end,
  5440. -- Callbacks
  5441. eventTextAreaCallback = function(i,n,c)
  5442. mode.map.info[n].hasVoted = true
  5443. if c == "+" then
  5444. mode.map.mapInfo[3] = mode.map.mapInfo[3] + 1
  5445. elseif c == "-" then
  5446. mode.map.mapInfo[4] = mode.map.mapInfo[4] + 1
  5447. end
  5448. mode.map.eventKeyboard(n,stringbyte("P"),false)
  5449.  
  5450. tfm.exec.chatMessage("• " .. system.getTranslation("vote"),n)
  5451. end,
  5452. -- Loop
  5453. eventLoop = function()
  5454. local alive = 100
  5455. if _G.currentTime % 5 == 0 then
  5456. alive,mode.map.totalPlayers = system.players()
  5457. end
  5458. if _G.leftTime < 1 or alive < 1 or mode.map.skip then
  5459. if mode.map.mapInfo[1] and mode.map.canInfo then
  5460. mode.map.canInfo = false
  5461.  
  5462. local totalVotes = mode.map.mapInfo[3] + mode.map.mapInfo[4]
  5463. if totalVotes > 0 then
  5464. tfm.exec.chatMessage(stringformat("• [@%s] %s%% (%s)",mode.map.mapInfo[1],mathpercent(mode.map.mapInfo[3],totalVotes),totalVotes),mode.map.mapInfo[2])
  5465. end
  5466. end
  5467.  
  5468. if #mode.map.queue > 0 then
  5469. mode.map.nextMap()
  5470. else
  5471. tfm.exec.newGame()
  5472. end
  5473. end
  5474. end,
  5475. -- Player Died
  5476. eventPlayerDied = function(n)
  5477. if mode.map.autoRespawn then
  5478. tfm.exec.respawnPlayer(n)
  5479. end
  5480. end,
  5481. -- Player Won
  5482. eventPlayerWon = function(n)
  5483. mode.map.eventPlayerDied(n)
  5484. end,
  5485. }
  5486.  
  5487. --[[ Godmode ]]--
  5488. mode.godmode = {
  5489. -- Translations
  5490. translations = {
  5491. en = {
  5492. -- Init
  5493. welcome = "Welcome to <B>#godmode</B>. Type !info to read the help message.\n\tReport any issue to Bolodefchoco.",
  5494.  
  5495. -- Guide
  5496. shaman = "Hello shaman! Try to build without nails! Good luck.",
  5497.  
  5498. -- Info
  5499. info = "Use your creativity and build WITHOUT nails in shaman maps! The more mice you save, the higher your score will be. Do not let the mice die.\nPress P or type !p [playername] to open a profile.",
  5500. xp = "You've saved %s mice and %s died.",
  5501.  
  5502. -- Warning
  5503. nail = "You can use %s more nails. After that, you will die.",
  5504. kill = "Try not to use nails in your buildings.",
  5505. fail = "You failed!",
  5506.  
  5507. -- Profile
  5508. profile = "Title : <V>«%s»<N>\n\nRounds : %s\n<N>Shaman : %s <G>/ %s\n\n<N>Deaths : %s",
  5509.  
  5510. -- Titles
  5511. titles = {
  5512. "Shammy",
  5513. "Experienced Shaman",
  5514. "Evil Shaman",
  5515. "Angry Shaman",
  5516. "Spirit",
  5517. "Haunted Shaman",
  5518. "Troll Shaman",
  5519. "Scientist",
  5520. "Physics Master",
  5521. "Black Magic",
  5522. },
  5523. unlock = "%s just unlocked «%s»",
  5524. },
  5525. br = {
  5526. welcome = "Bem-vindo ao <B>#godmode</B>. Digite !info para ler a mensagem de ajuda.\n\tReporte qualquer problema para Bolodefchoco.",
  5527.  
  5528. shaman = "Olá shaman! Tente construir sem pregos! Boa sorte.",
  5529.  
  5530. info = "Utilize sua criatividade e construa em mapas shaman SEM pregos! Quanto mais ratos você salvar, maior será sua pontuação. Não deixe nenhum rato morrer.\nPressione P ou digite !p [nome] para abrir um perfil.",
  5531. xp = "Você salvou %s ratos e %s morreram.",
  5532.  
  5533. nail = "Você pode usar mais %s pregos. Depois disso, você morrerá.",
  5534. kill = "Tente não usar pregos em suas construções.",
  5535. fail = "Você falhou!",
  5536.  
  5537. profile = "Título : <V>«%s»<N>\n\nPartidas : %s\n<N>Shaman : %s <G>/ %s\n\n<N>Mortes : %s",
  5538.  
  5539. titles = {
  5540. "Pequeno Shaman",
  5541. "Shaman Profissional",
  5542. "Shaman Mau",
  5543. "Shaman Bravo",
  5544. "Espírito",
  5545. "Shaman Assombado",
  5546. "Shaman Troll",
  5547. "Cientista",
  5548. "Mestre da Física",
  5549. "Magia Negra",
  5550. },
  5551. unlock = "%s acabou de desbloquear «%s»",
  5552. },
  5553. },
  5554. langue = "en",
  5555. -- Data
  5556. info = {},
  5557. -- Shaman
  5558. getShaman = function()
  5559. local s = {}
  5560. for k,v in next,tfm.get.room.playerList do
  5561. if v.isShaman then
  5562. s[#s + 1] = k
  5563. end
  5564. end
  5565.  
  5566. return s
  5567. end,
  5568. -- New Game Settings
  5569. savedMice = 0,
  5570. deadMice = 0,
  5571. lastShaman = {},
  5572. -- Other Settings
  5573. title = nil,
  5574. titles = {0,10,20,30,40,50,60,70,80,90},
  5575. -- Profile
  5576. profile = function(n,p)
  5577. ui.addTextArea(0,"<p align='center'><B><R><a href='event:profile.close'>X",n,513,115,20,20,1,1,1,true)
  5578. ui.addTextArea(1,"<p align='center'><font size='16'><B><V>"..p.."</V></B></font></p><p align='left'><font size='12'>\n<N>" .. stringformat(system.getTranslation("profile"),mode.godmode.info[p].title,"<V>"..mode.godmode.info[p].roundSha,"<J>"..mode.godmode.info[p].cheeseMice,"<R>"..mode.godmode.info[p].deathMice,"<V>"..mode.godmode.info[p].deathSha),n,290,115,220,160,1,1,1,true)
  5579. end,
  5580. -- Update Menu Bar
  5581. updateMenu = function()
  5582. ui.setShamanName(tableconcat(mode.godmode.getShaman()," - <PS>") .. " <G>| <N>Status : <J>" .. mode.godmode.savedMice .. " <BL>/ <R>" .. mode.godmode.deadMice)
  5583. end,
  5584. -- Init
  5585. reset = function()
  5586. -- Data
  5587. mode.godmode.info = {}
  5588. end,
  5589. init = function()
  5590. -- Translations
  5591. mode.godmode.translations.pt = mode.godmode.translations.br
  5592. mode.godmode.langue = mode.godmode.translations[tfm.get.room.community] and tfm.get.room.community or "en"
  5593.  
  5594. -- Titles
  5595. mode.godmode.title = system.getTranslation("titles")
  5596.  
  5597. -- Init
  5598. tfm.exec.disableAutoNewGame()
  5599. tfm.exec.disableAllShamanSkills()
  5600. tfm.exec.newGame("#4")
  5601.  
  5602. -- Auto Admin
  5603. system.roomAdmins.Mcqv = true
  5604. end,
  5605. -- New Player
  5606. eventNewPlayer = function(n)
  5607. if not mode.godmode.info[n] then
  5608. mode.godmode.info[n] = {
  5609. usedNails = 0,
  5610. roundSha = 0,
  5611. deathSha = 0,
  5612. deathMice = 0,
  5613. cheeseMice = 0,
  5614. title = "Shammy",
  5615. }
  5616. end
  5617.  
  5618. for k,v in next,{66,67,74,78,80,86} do
  5619. system.bindKeyboard(n,v,true,true)
  5620. end
  5621.  
  5622. tfm.exec.chatMessage("<ROSE>" .. system.getTranslation("welcome"),n)
  5623.  
  5624. local id = tfm.exec.addImage("15ca3f4a200.png","&0",5,150,n)
  5625. system.newTimer(function()
  5626. tfm.exec.removeImage(id)
  5627. end,10000,false)
  5628. end,
  5629. -- New Game
  5630. eventNewGame = function()
  5631. if #mode.godmode.lastShaman > 0 then
  5632. for k,v in next,mode.godmode.lastShaman do
  5633. mode.godmode.info[v].cheeseMice = mode.godmode.info[v].cheeseMice + mode.godmode.savedMice
  5634. mode.godmode.info[v].deathMice = mode.godmode.info[v].deathMice + mode.godmode.deadMice
  5635. tfm.exec.chatMessage("<CH>" .. stringformat(system.getTranslation("xp"),mode.godmode.savedMice,mode.godmode.deadMice),v)
  5636.  
  5637.  
  5638. for i = #mode.godmode.titles,1,-1 do
  5639. if mode.godmode.info[v].cheeseMice >= mode.godmode.titles[i] then
  5640. if mode.godmode.info[v].title ~= mode.godmode.title[i] then
  5641. mode.godmode.info[v].title = mode.godmode.title[i]
  5642. tfm.exec.chatMessage("<J>" .. stringformat(system.getTranslation("unlock"),v,mode.godmode.title[i]))
  5643. end
  5644. break
  5645. end
  5646. end
  5647. end
  5648. end
  5649.  
  5650. mode.godmode.savedMice = 0
  5651. mode.godmode.deadMice = 0
  5652.  
  5653. mode.godmode.updateMenu()
  5654.  
  5655. for k,v in next,mode.godmode.info do
  5656. v.usedNails = 0
  5657. end
  5658. for k,v in next,mode.godmode.getShaman() do
  5659. mode.godmode.info[v].roundSha = mode.godmode.info[v].roundSha + 1
  5660. tfm.exec.chatMessage("<CH>" .. system.getTranslation("shaman"),v)
  5661. end
  5662.  
  5663. tfm.exec.setGameTime(183)
  5664. end,
  5665. -- Keyboard
  5666. eventKeyboard = function(n,k)
  5667. if k == 80 then
  5668. mode.godmode.profile(n,n)
  5669. elseif not tfm.get.room.playerList[n].isDead and tfm.get.room.playerList[n].isShaman then
  5670. if tablefind({66,67,74,78,86},k) then -- B;C;V;N;J
  5671. mode.godmode.info[n].usedNails = mode.godmode.info[n].usedNails + 1
  5672. if mode.godmode.info[n].usedNails > 4 then
  5673. tfm.exec.killPlayer(n)
  5674. tfm.exec.chatMessage("<R>" .. system.getTranslation("fail") .. " " .. system.getTranslation("kill"),n)
  5675. else
  5676. tfm.exec.chatMessage("<R>" .. stringformat(system.getTranslation("nail"),5 - mode.godmode.info[n].usedNails),n)
  5677. end
  5678. end
  5679. end
  5680. end,
  5681. -- Summoned
  5682. eventSummoningEnd = function(n,o,x,y,a,i)
  5683. tfm.exec.removeObject(i.id)
  5684.  
  5685. tfm.exec.addShamanObject(o,x,y,a,i.vx,i.vy,i.ghost)
  5686. end,
  5687. -- Loop
  5688. eventLoop = function()
  5689. local alive,total = system.players()
  5690. if _G.leftTime < 2 or (total > 1 and alive < 2) or alive == 0 then
  5691. mode.godmode.lastShaman = mode.godmode.getShaman()
  5692. tfm.exec.newGame("#4")
  5693. end
  5694. end,
  5695. -- Player Died
  5696. eventPlayerDied = function(n)
  5697. if tfm.get.room.playerList[n].isShaman then
  5698. tfm.exec.setGameTime(10,false)
  5699. mode.godmode.info[n].deathSha = mode.godmode.info[n].deathSha + 1
  5700. tfm.exec.chatMessage("<R>" .. system.getTranslation("fail"),n)
  5701. else
  5702. mode.godmode.deadMice = mode.godmode.deadMice + 1
  5703. mode.godmode.updateMenu()
  5704. end
  5705. end,
  5706. -- Player Won
  5707. eventPlayerWon = function(n)
  5708. if not tfm.get.room.playerList[n].isShaman then
  5709. mode.godmode.savedMice = mode.godmode.savedMice + 1
  5710. mode.godmode.updateMenu()
  5711. end
  5712. end,
  5713. -- Commands
  5714. eventChatCommand = function(n,c)
  5715. local p = stringsplit(c,"[^%s]+",stringlower)
  5716. if p[1] == "info" then
  5717. tfm.exec.chatMessage("<J>" .. system.getTranslation("info"),n)
  5718. elseif p[1] == "p" then
  5719. if p[2] then
  5720. p[2] = stringnick(p[2])
  5721. if mode.godmode.info[p[2]] then
  5722. mode.godmode.profile(n,p[2])
  5723. end
  5724. else
  5725. mode.godmode.profile(n,n)
  5726. end
  5727. end
  5728. end,
  5729. -- Callback
  5730. eventTextAreaCallback = function(i,n,c)
  5731. local p = stringsplit(c,"[^%.]+")
  5732. if p[1] == "profile" then
  5733. if p[2] == "close" then
  5734. for i = 0,1 do
  5735. ui.removeTextArea(i,n)
  5736. end
  5737. end
  5738. end
  5739. end,
  5740. }
  5741.  
  5742. --[[ Sharpie ]]--
  5743. mode.sharpie = {
  5744. -- Translations
  5745. translations = {
  5746. en = {
  5747. -- Init
  5748. welcome = "Welcome to #sharpie! Fly pressing space.",
  5749.  
  5750. -- Warning
  5751. nothacker = "The mice flying are NOT hackers!",
  5752.  
  5753. -- Sample words
  5754. won = "won",
  5755.  
  5756. -- Messages
  5757. first = {
  5758. "yay 2 in a row",
  5759. "super pro",
  5760. "oml are you playing alone or what",
  5761. "wooow 4 in a row!",
  5762. "getting hard? good luck pro!",
  5763. "you noob just unlocked the title lightning",
  5764. "woah speedmaster",
  5765. "formula 1",
  5766. "time traveler you sir",
  5767. "queen of the win",
  5768. "as pro as the developer",
  5769. "ILLUMINATI!",
  5770. "are you a real hacker?",
  5771. "I hope you dont loose the chance of seeing the last message",
  5772. "THIS IS A SHIT MESSAGE BECAUSE YOU DIDNT DESERVE IT",
  5773. },
  5774. hardMode = "The hard mode is activated this round!",
  5775. },
  5776. br = {
  5777. welcome = "Bem-vindo ao #sharpie! Voe apertando espaço.",
  5778.  
  5779. nothacker = "Os ratos voando NÃO são hackers!",
  5780.  
  5781. won = "venceu",
  5782.  
  5783. first = {
  5784. "yay 2 seguidas",
  5785. "super pro",
  5786. "omg você tá jogando sozinho ou o que",
  5787. "etaaa 4 seguidas!",
  5788. "ficando difícil? boa sorte mito!",
  5789. "vc noob acaba de desbloquear o título relâmpago",
  5790. "vuash mestre da corrida",
  5791. "relâmpago marquinhos",
  5792. "viajante do tempo vc senhor",
  5793. "rainha da vitória",
  5794. "tão pro quanto o criador do jogo",
  5795. "ILLUMINATI!",
  5796. "éres um hacker de verdade?",
  5797. "Espero que você não perca a chance de ler a última mensagem",
  5798. "ESSA É UMA MENSAGEM DE MERDA PQ VC N MERECEU ISSO",
  5799. },
  5800. hardMode = "O modo difícil está ativado nessa partida!",
  5801. },
  5802. },
  5803. langue = "en",
  5804. -- New Game Settings
  5805. flyPower = -50,
  5806. firstRow = {"",0}, -- Player, amount
  5807. podium = 0,
  5808. totalPlayers = 0,
  5809. hardmode = false,
  5810. modeImages = {"15cbdb3c427","15cbdb479ca","15cbdb4a1ca","15cbdb4cae5"},
  5811. mapInfo = {800,400},
  5812. -- Not Hacker Message
  5813. uiborder = function(t,x,y)
  5814. local colors = {
  5815. {"#F7F918","#EC4848"},
  5816. {"#4CE7F7","#2C9F5B"},
  5817. {"#4BD9CD","#2A64E9"},
  5818. {"#D4F31A","#8C8fA4"},
  5819. }
  5820. local color = tablerandom(colors)
  5821.  
  5822. ui.addTextArea(0,"<font color='" .. color[2] .. "'><B>"..t,nil,x,y-1,900,25,1,1,0,true)
  5823. ui.addTextArea(1,"<font color='" .. color[2] .. "'><B>"..t,nil,x,y+1,900,25,1,1,0,true)
  5824. ui.addTextArea(2,"<font color='" .. color[2] .. "'><B>"..t,nil,x+1,y,900,25,1,1,0,true)
  5825. ui.addTextArea(3,"<font color='" .. color[2] .. "'><B>"..t,nil,x-1,y,900,25,1,1,0,true)
  5826. ui.addTextArea(4,"<font color='" .. color[1] .. "'><B>"..t,nil,x,y,900,25,1,1,0,true)
  5827. end,
  5828. -- Init
  5829. init = function()
  5830. -- Init
  5831. tfm.exec.disableAutoShaman()
  5832. tfm.exec.disableAutoScore()
  5833.  
  5834. tfm.exec.newGame()
  5835. end,
  5836. -- New Game
  5837. eventNewGame = function()
  5838. mode.sharpie.podium = 0
  5839.  
  5840. local currentXml = tfm.get.room.xmlMapInfo
  5841. currentXml = currentXml and currentXml.xml or ""
  5842.  
  5843. mode.sharpie.mapInfo = {800,400}
  5844. mode.sharpie.flyPower = -50
  5845.  
  5846. xml.attribFunc(currentXml or "",{
  5847. [1] = {
  5848. attribute = "G",
  5849. func = function(value)
  5850. value = stringsplit(value,"[^,]+")
  5851. value = tonumber(value[2]) or value
  5852. mode.sharpie.flyPower = value < 0 and 50 or -50
  5853. end
  5854. },
  5855. [2] = {
  5856. attribute = "L",
  5857. func = function(value)
  5858. value = tonumber(value)
  5859. if value then
  5860. mode.sharpie.mapInfo[1] = value
  5861. end
  5862. end
  5863. },
  5864. [3] = {
  5865. attribute = "H",
  5866. func = function(value)
  5867. value = tonumber(value)
  5868. if value then
  5869. mode.sharpie.mapInfo[2] = value
  5870. end
  5871. end
  5872. },
  5873.  
  5874. })
  5875.  
  5876. mode.sharpie.hardmode = mathrandom(10) == 6
  5877. if mode.sharpie.hardmode then
  5878. tfm.exec.chatMessage("<CH>" .. system.getTranslation("hardMode"))
  5879. end
  5880. end,
  5881. -- New Player
  5882. eventNewPlayer = function(n)
  5883. tfm.exec.chatMessage("<CE>" .. system.getTranslation("welcome"),n)
  5884.  
  5885. system.bindKeyboard(n,32,true,true)
  5886. end,
  5887. -- Keyboard
  5888. eventKeyboard = function(n,k,d,x,y)
  5889. if k == 32 then
  5890.  
  5891. tfm.exec.movePlayer(n,0,0,true,0,mode.sharpie.flyPower,true)
  5892. end
  5893. end,
  5894. -- Victory
  5895. eventPlayerWon = function(n)
  5896. mode.sharpie.podium = mode.sharpie.podium + 1
  5897. if mode.sharpie.podium == 1 then
  5898. if mode.sharpie.firstRow[1] == n then
  5899. mode.sharpie.firstRow[2] = mode.sharpie.firstRow[2] + 1
  5900.  
  5901. if mode.sharpie.totalPlayers > 3 then
  5902. local msg = system.getTranslation("first")
  5903. tfm.exec.chatMessage("<G># <ROSE>" .. (msg[mode.sharpie.firstRow[2] - 1] or tablerandom({msg[2],msg[3],msg[6],msg[13],msg[15]})),n)
  5904. end
  5905. else
  5906. mode.sharpie.firstRow = {n,1}
  5907. end
  5908.  
  5909. tfm.exec.setPlayerScore(n,(mode.sharpie.firstRow[2]+1) * 5,true)
  5910.  
  5911. tfm.exec.chatMessage(stringformat("<J>%s %s! %s",n,system.getTranslation("won"),mode.sharpie.firstRow[2] > 1 and "("..mode.sharpie.firstRow[2]..")" or ""))
  5912. else
  5913. tfm.exec.setPlayerScore(n,5,true)
  5914. end
  5915. end,
  5916. -- Loop
  5917. eventLoop = function()
  5918. if _G.currentTime % 5 == 0 then
  5919. local alive,total = system.players()
  5920. mode.sharpie.totalPlayers = total
  5921.  
  5922. -- Warning
  5923. mode.sharpie.uiborder(system.getTranslation("nothacker"),10,382)
  5924. end
  5925.  
  5926. if mode.sharpie.hardmode and _G.currentTime % 14 == 0 then
  5927. system.newTimer(function()
  5928. local x,y = mathrandom(0,mode.sharpie.mapInfo[1]),mathrandom(0,mode.sharpie.mapInfo[2])
  5929. local id = tfm.exec.addImage(tablerandom(mode.sharpie.modeImages) .. ".png","&0",x - 56,y - 51) -- 112x103 img
  5930. system.newTimer(function()
  5931. tfm.exec.removeImage(id)
  5932.  
  5933. tfm.exec.displayParticle(24,x,y)
  5934. tfm.exec.explosion(x,y,50,100)
  5935. end,1250,false)
  5936. end,1000,false)
  5937. end
  5938. end,
  5939. }
  5940.  
  5941. --[[ Non-official Events ]]--
  5942. system.objects = {
  5943. image = {},
  5944. textarea = {}
  5945. }
  5946. eventModeChanged = function()
  5947. -- Remove content
  5948. for k in next,system.objects.image do
  5949. tfm.exec.removeImage(k)
  5950. end
  5951.  
  5952. for k in next,system.objects.textarea do
  5953. ui.removeTextArea(k,nil)
  5954. end
  5955.  
  5956. system.objects = {
  5957. image = {},
  5958. textarea = {}
  5959. }
  5960.  
  5961. ui.addPopup(0,0,"",nil,-1500,-1500)
  5962.  
  5963. -- Unbind keyboard and mouse, also normalize color name and scores
  5964. for k in next,tfm.get.room.playerList do
  5965. for i = 0,255 do
  5966. for v = 0,1 do
  5967. system.bindKeyboard(k,i,v == 0,false)
  5968. end
  5969. end
  5970.  
  5971. system.bindMouse(k,false)
  5972.  
  5973. tfm.exec.setNameColor(k,-1)
  5974. tfm.exec.setPlayerScore(k,0)
  5975. end
  5976.  
  5977. -- Set admin back
  5978. system.roomAdmins = system.setAdmins()
  5979.  
  5980. -- Reset settings
  5981. for k,v in next,{"AutoScore","WatchCommand","AutoNewGame","AutoShaman","AllShamanSkills","MortCommand","DebugCommand","MinimalistMode","AfkDeath","PhysicalConsumables","AutoTimeLeft"} do
  5982. tfm.exec["disable" .. v](false)
  5983. end
  5984. tfm.exec.setAutoMapFlipMode()
  5985.  
  5986. tfm.exec.setRoomMaxPlayers(25)
  5987. tfm.exec.setRoomPassword("")
  5988. end
  5989.  
  5990. --[[ Event Functions ]]--
  5991. events = {}
  5992.  
  5993. events.eventLoop = function(currentTime,leftTime)
  5994. _G.currentTime = normalizeTime(currentTime / 1e3)
  5995. _G.leftTime = normalizeTime(leftTime / 1e3)
  5996. end
  5997.  
  5998. events.eventChatCommand = function(n,c)
  5999. disableChatCommand(c)
  6000. if module._FREEACCESS[n] then
  6001. if c == "refresh" and (not system.isRoom or module._FREEACCESS[n] > 1) then
  6002. eventModeChanged()
  6003. system.init(true)
  6004. elseif stringsub(c,1,4) == "room" and (not system.isRoom or module._FREEACCESS[n] > 1) then
  6005. system.roomNumber = tonumber(stringsub(c,6)) or 0
  6006. if _G["eventChatCommand"] then
  6007. eventChatCommand(n,"refresh")
  6008. end
  6009. elseif stringsub(c,1,4) == "load" and (not system.isRoom or module._FREEACCESS[n] > 2) then
  6010. if os.time() > system.modeChanged and os.time() > system.newGameTimer then
  6011. local newMode = system.getGameMode(stringsub(c,6),true)
  6012. if newMode then
  6013. system.init(system.isRoom)
  6014. end
  6015. end
  6016. end
  6017. end
  6018. if stringsub(c,1,6) == "module" then
  6019. c = stringupper(stringsub(c,8))
  6020. if module["_" .. c] then
  6021. tfm.exec.chatMessage(c .. " : " .. tableconcat(tableturnTable(module["_" .. c]),"\n",function(k,v)
  6022. return (c == "FREEACCESS" and stringformat("%s(%s)",k,v) or v)
  6023. end),n)
  6024. else
  6025. tfm.exec.chatMessage(stringformat("VERSION : %s\nNAME : %s\nSTATUS : %s\nAUTHOR : %s\n\nMODE : %s",module._VERSION,module._NAME,module._STATUS,module._AUTHOR,system.gameMode),n)
  6026. end
  6027. elseif c == "modes" then
  6028. tfm.exec.chatMessage(tableconcat(system.submodes,"\n",function(k,v)
  6029. return "#" .. system.normalizedModeName(v)
  6030. end),n)
  6031. elseif c == "admin" then
  6032. tfm.exec.chatMessage(tableconcat(system.roomAdmins,", ",tostring),n)
  6033. elseif c == "stop" and system.roomAdmins[n] then
  6034. system.exit()
  6035. elseif stringsub(c,1,3) == "adm" and (system.roomAdmins[n] or module._FREEACCESS[n] > 2) then
  6036. system.roomAdmins[stringnick(stringsub(c,5))] = true
  6037. end
  6038. end
  6039.  
  6040. events.eventNewPlayer = function(n)
  6041.  
  6042. if system.officialMode[2] ~= "" then
  6043. tfm.exec.chatMessage(system.officialMode[2],n)
  6044. end
  6045. end
  6046.  
  6047. --[[ Room Settings ]]--
  6048. system.roomSettings = {
  6049. ["@"] = function(n)
  6050. system.roomAdmins[stringnick(n)] = true
  6051. end,
  6052. ["#"] = function(id)
  6053. system.miscAttrib = tonumber(id) or 1
  6054. system.miscAttrib = mathsetLim(system.miscAttrib,1,99) -- mathmax(1,mathmin(system.miscAttrib,99))
  6055. end,
  6056. ["*"] = function(name)
  6057. local game = system.getGameMode(name)
  6058. if not game then
  6059. system.gameMode = "grounds"
  6060. end
  6061. end
  6062. }
  6063. system.setRoom = function()
  6064. if system.isRoom and system.roomAttributes then
  6065. local chars = ""
  6066. for k in next,system.roomSettings do
  6067. chars = chars .. k
  6068. end
  6069.  
  6070. for char,value in stringgmatch(system.roomAttributes,"(["..chars.."])([^"..chars.."]+)") do
  6071. value = stringmatch(value,"[^%s]+")
  6072. for k,v in next,system.roomSettings do
  6073. if k == char then
  6074. v(value)
  6075. break
  6076. end
  6077. end
  6078. end
  6079.  
  6080. local officialModes = {
  6081. {"vanilla","<VP>Enjoy your vanilla (: .. okno"},
  6082. {"survivor","<R>Aw, you cannot play survivor on #grounds"},
  6083. {"racing","<CH>Uh, racing? Good luck!"},
  6084. {"music","<BV>Music? Nice choice! Why don't you try a rock'n'roll?"},
  6085. {"bootcamp","<PT>Bootcamp? Ok. This is unfair and your data won't be saved out of the room."},
  6086. {"defilante","<R>Aw, you cannot play defilante on #grounds"},
  6087. {"village","<R>You cannot play village on #grounds. Please, change your room."},
  6088. }
  6089. for k,v in next,officialModes do
  6090. if stringfind(system.roomAttributes,v[1] .. "$") then
  6091. system.officialMode = {v[1],v[2]}
  6092. break
  6093. end
  6094. end
  6095. end
  6096. end
  6097.  
  6098. --[[ Initialize ]]--
  6099. execute = {}
  6100. system.setRoom()
  6101.  
  6102. system.init = function(refresh)
  6103. for i,event in next,{"Loop","NewGame","PlayerDied","PlayerGetCheese","PlayerVampire","PlayerWon","PlayerLeft","EmotePlayed","Keyboard","Mouse","PopupAnswer","TextAreaCallback","ChatCommand","ChatMessage","SummoningStart","SummoningEnd","SummoningCancel","NewPlayer","PlayerRespawn","ColorPicked"} do
  6104. local e = "event" .. event
  6105.  
  6106. local found = false
  6107. for k,v in next,mode[system.gameMode] do
  6108. if k == e then
  6109. execute[e] = v
  6110. found = true
  6111. break
  6112. end
  6113. end
  6114. if not found then
  6115. execute[e] = function() end
  6116. end
  6117.  
  6118. _G[e] = function(...)
  6119. if events[e] then
  6120. events[e](...)
  6121. end
  6122. execute[e](...)
  6123. end
  6124. end
  6125.  
  6126. if refresh then
  6127. if mode[system.gameMode].reset then
  6128. mode[system.gameMode].reset()
  6129. end
  6130. end
  6131.  
  6132. if _G["eventNewPlayer"] then
  6133. tableforeach(tfm.get.room.playerList,eventNewPlayer)
  6134. end
  6135.  
  6136. normalizeTranslation()
  6137. mode[system.gameMode].init()
  6138. end
  6139. system.init()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement