TheOddByte

Boxer Tournament

Mar 2nd, 2013
411
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 193.96 KB | None | 0 0
  1. --[[
  2. Boxer Tournament 2013
  3.  
  4. Credits
  5. -------------------------------------
  6. This Game Is Started By Hellkid98
  7. Single Player: Hellkid98
  8. Multiplayer: Herû
  9. ccConfig API by: theoriginalbit
  10.  
  11.  
  12. And special thanks to GravityScore for the
  13. modified read function that is very useful ;D
  14.  
  15.  Translators
  16. -------------
  17. English: Hellkid98
  18.  
  19. Swedish: Hellkid98
  20.  
  21. Norwegian: Herû
  22.  
  23. Danish: ?
  24.  
  25. Spanish: ?
  26.  
  27. Deutch: ?
  28.  
  29. French: ?
  30.  
  31. Arabic: ?
  32.  
  33. Chinese: ?
  34. -------------------------------------
  35.  
  36. If you want to change your character it is on line 164
  37. NOTE: That is for the map! And change the "@" to whatever you like!
  38.  
  39.  
  40. Further information is under here
  41. ---------------------------------
  42. Things you can/shall not do
  43.  
  44. *Edit this header
  45. *Claim this game as your own and claim you're the owner
  46. *Edit the code unless it is for personal use
  47.  
  48.  
  49. Languages Supported
  50. *English
  51. *Swedish
  52. *Norwegian
  53.  
  54. Solo Play Explanation
  55. ----------------------
  56. The goal for this is to be the best boxer and try to win every tournament.
  57. For that it is good to level up your character to keep him/her fit and
  58. the game will get easier to play, But the enemies will also continue to get
  59. better as you do.
  60. If you want to make sure that you'll win you should buy better equipment
  61. and health items to heal yourself in the game.
  62.  
  63. Multiplayer Explanation
  64. --Herû you should explain what you want here.. Also you should try todo the Norwegian translation.. Since you're norwegian
  65.  
  66. ]]--
  67.  
  68.  
  69.  
  70.  
  71.  local version = 0.91
  72.  
  73. os.pullEvent = os.pullEventRaw
  74.  
  75. --Default language
  76. language = "English"
  77.  
  78.  
  79. --GENERAL
  80.  
  81. --Name Entry
  82. local minName = 4
  83. local maxName = 11
  84.  
  85. --Player
  86. local lvl = 1
  87. local mLvl = 90
  88. local lvlD = 0 --The Damage That Increases After Each Level
  89. local hp = 100 --Player Health
  90. local tHP = 100 --Total Health
  91. local sta = 50 -- Stamina
  92. local tSta = 50 --Total Stamina
  93. local totalXp = 100
  94. local xp = 0
  95. local myScore = 0
  96. local money = 0
  97. local wins = 0
  98. local loss = 0
  99. local day = 0
  100. local regainHP = 100
  101. local regainSTA = 100
  102. local a = agility1
  103. local s = speed1
  104. local dfc = defence1
  105. local d = damage1
  106. local bSta = math.random(1,3) -- Block Stamina That Enemy Loses
  107. local mbrshipDay = 0
  108. local uD = 10
  109.  
  110.  
  111.  
  112.  
  113. --Skills
  114. local damage1 = math.random(5,10)
  115. local damage2 = math.random(5,20)
  116. local damage3 = math.random(5,30)
  117. local damage4 = math.random(5,40)
  118. local damage5 = math.random(5,50)
  119. local agility1 = math.random(5,10)
  120. local agility2 = math.random(10,20)
  121. local agility3 = math.random(20,30)
  122. local agility4 = math.random(30,40)
  123. local agility5 = math.random(40,50)
  124.  
  125. --Screen
  126. w,h = term.getSize()
  127. halfW = w/2
  128. halfH = h/2
  129.  
  130. --Top Topics Text
  131. local ttTextColor = colors.red
  132.    
  133. --Top Topic Background
  134. local ttBackColor = colors.cyan
  135.  
  136. --Menus Text
  137. local menuTextColor = colors.black
  138.  
  139. --Menus Background
  140. local menuBackColor = colors.white
  141.  
  142.  
  143.  
  144. --Controls
  145. defaultControls = true
  146.  
  147. --Settings
  148. local optXYpos = 1
  149. local optColors = 2
  150. local optDetail = 2
  151. local optSHscore = 1
  152. local optConnection = 0
  153. local optgMode = 1
  154. local optAutoUpdate = 1
  155.  
  156.  
  157. ---------------------------------------------------------------------------------------------------
  158. ---------------------------------------------------------------------------------------------------
  159. --Enemies
  160. local eAtk = enemyDMG1
  161. local enemyLvl = 1
  162. local enemySta = 50
  163. local enemyHP = 100
  164. local eLvlD = 0 --The Damage That Increases On The Enemies
  165.  
  166. --Enemies Health
  167. local enemyHP1 = 100
  168. local enemyHP2 = 125
  169. local enemyHP3 = 150
  170. local enemyHP4 = 175
  171. local enemyHP5 = 200
  172.  
  173. local enemyDMG1 = math.random(2,8 + eLvlD) --Enemies Damage. NOTE:If they are Higher Level they get better damage
  174. local enemyDMG2 = math.random(10,15 + eLvlD) --For example: if enemy level = 12 then eAtk = enemyDMG2
  175. local enemyDMG3 = math.random(20,30 + eLvlD)
  176. local enemyDMG4 = math.random(30,45 + eLvlD)
  177. local enemyDMG5 = math.random(50,60 + eLvlD)
  178.  
  179.  
  180. --Randomly Selects An Enemy PS. This Is For Solo Play
  181. function randomChallenger()
  182. t_enemies = {
  183. "Rock Hardwood", "Olov Reynkon", "Usumo Binlayden", "Duke Parker", "Peter Pestrami", "Lucky Mook",
  184. "Gouda Croissant",  "John Dorkian",  "Rochy Ballboda",  "Felix Mjellberg",  "Turk Turkleton",
  185. "Gieek Sheet",  "Robert DuckFaze",  "Mitch Schlucker",  "Homer Simpson",  "Peter Griffin"
  186. }
  187.  
  188. enemy = t_enemies[math.random(1, #t_enemies)]
  189. print(enemy)
  190. cleanScreen()
  191. end
  192.  
  193.  
  194.  
  195.  
  196.  
  197. ---------------------------------------------------------------------------------------------------
  198. ---------------------------------------------------------------------------------------------------
  199.  
  200.  
  201.  
  202. --Basic Drawing Functions
  203. function drawAt(x,y,text)
  204. term.setCursorPos(x,y)
  205. term.write(text)
  206. end
  207.  
  208. function centerPrint(y,text)
  209.   term.setCursorPos(w/2 - #text/2, y)
  210.     term.write(text)
  211. end
  212.  
  213. function cleanScreen()
  214. term.clear()
  215. term.setCursorPos(1,1)
  216. end
  217.  
  218. --Draw Cursors
  219. function drawCursor(x1,x2,y)
  220.   drawAt(x1,y,"[")
  221.   drawAt(x2,y,"]")
  222. end
  223.  
  224. function drawDifCursor(x,y)
  225. drawAt(x,y,">")
  226. end
  227.  
  228. --Draws The Character
  229. function drawCharacter()
  230. if colorsOnOff == "OFF" then
  231. drawAt (x,y,"@")
  232.  
  233. elseif colorsOnOff == "ON" then
  234. paintutils.drawPixel(x,y,colors.orange)
  235. end
  236.  end
  237. ---------------------------------------------------------------------------------------------------
  238. ---------------------------------------------------------------------------------------------------
  239. --Resets Everything
  240. function resetStats()
  241. d = damage1
  242. hp = 100
  243. tHP = 100
  244. sta = 50
  245. tSta = 50
  246. xp = 0
  247. totalXp = 100
  248. lvl = 1
  249. myScore = 0
  250. money = 0
  251. wins = 0
  252. loss = 0
  253. day = 0
  254. lvlD = 0
  255. difficulty = "None"
  256.  
  257. end
  258. ---------------------------------------------------------------------------------------------------
  259. --SAVING/LOADING/DELETING
  260. ---------------------------------------------------------------------------------------------------
  261.  
  262. function toNum()
  263. lvl = tonumber(lvl)
  264. xp = tonumber(xp)
  265. totalXp = tonumber(totalXp)
  266. lvlD = tonumber(lvlD)
  267. hp = tonumber(hp)
  268. tHP = tonumber(tHP)
  269. sta = tonumber(sta)
  270. tSta = tonumber(tSta)
  271. money = tonumber(money)
  272. wins = tonumber(wins)
  273. loss = tonumber(loss)
  274. myScore = tonumber(myScore)
  275. day = tonumber(day)
  276. mbrshipDay = tonumber(mbrshipDay)
  277. end
  278.  
  279. function toStrng()
  280. lvl = tostring(lvl)
  281. xp = tostring(xp)
  282. totalXp = tostring(totalXp)
  283. lvlD = tostring(lvlD)
  284. hp = tostring(hp)
  285. tHP = tostring(tHP)
  286. sta = tostring(sta)
  287. tSta = tostring(tSta)
  288. money = tostring(money)
  289. wins = tostring(wins)
  290. loss = tostring(loss)
  291. myScore = tostring(myScore)
  292. day = tostring(day)
  293. mbrshipDay = tostring(mbrshipDay)
  294. end
  295.  
  296.  
  297. function save(player)
  298. --[[
  299. Line1 = myName
  300. Line2 = lvl
  301. Line3 = xp
  302. Line4 = totalXp
  303. Line5 = lvlD
  304. Line6 = hp
  305. Line7 = tHP
  306. Line8 = sta
  307. Line9 = tSta
  308. Line10 = money
  309. Line11 = wins
  310. Line12 = loss
  311. Line13 = myScore
  312. Line14 = easyMode
  313. Line15 = normalMode
  314. Line16 = hardMode
  315. Line17 = extremeMode
  316. Line18 = day
  317. Line19 = mbrshipDay
  318. ]]--
  319.  
  320.  
  321.  
  322. toStrng()
  323.  
  324. if player == 1 then
  325. local file = fs.open(".gameData/saves/Player1","w")
  326. file.writeLine(myName)
  327. file.writeLine(lvl)
  328. file.writeLine(xp)
  329. file.writeLine(totalXp)
  330. file.writeLine(lvlD)
  331. file.writeLine(hp)
  332. file.writeLine(tHP)
  333. file.writeLine(sta)
  334. file.writeLine(tSta)
  335. file.writeLine(money)
  336. file.writeLine(wins)
  337. file.writeLine(loss)
  338. file.writeLine(myScore)
  339. file.writeLine(difficulty)
  340. file.writeLine(day)
  341. file.writeLine(mbrshipDay)
  342. file.close()
  343. print(" SAVED!")
  344. sleep(1)
  345.  
  346. elseif player == 2 then
  347. local file = fs.open(".gameData/saves/Player2","w")
  348. file.writeLine(myName)
  349. file.writeLine(lvl)
  350. file.writeLine(xp)
  351. file.writeLine(totalXp)
  352. file.writeLine(lvlD)
  353. file.writeLine(hp)
  354. file.writeLine(tHP)
  355. file.writeLine(sta)
  356. file.writeLine(tSta)
  357. file.writeLine(money)
  358. file.writeLine(wins)
  359. file.writeLine(loss)
  360. file.writeLine(myScore)
  361. file.writeLine(difficulty)
  362. file.writeLine(day)
  363. file.writeLine(mbrshipDay)
  364. file.close()
  365. print(" SAVED!")
  366. sleep(1)
  367.  
  368.  
  369. elseif player == 3 then
  370. local file = fs.open(".gameData/saves/Player3","w")
  371. file.writeLine(myName)
  372. file.writeLine(lvl)
  373. file.writeLine(xp)
  374. file.writeLine(totalXp)
  375. file.writeLine(lvlD)
  376. file.writeLine(hp)
  377. file.writeLine(tHP)
  378. file.writeLine(sta)
  379. file.writeLine(tSta)
  380. file.writeLine(money)
  381. file.writeLine(wins)
  382. file.writeLine(loss)
  383. file.writeLine(myScore)
  384. file.writeLine(difficulty)
  385. file.writeLine(day)
  386. file.writeLine(mbrshipDay)
  387. file.close()
  388. print(" SAVED!")
  389. sleep(1)
  390.  
  391.  
  392. elseif player == 4 then
  393. local file = fs.open(".gameData/saves/Player4","w")
  394. file.writeLine(myName)
  395. file.writeLine(lvl)
  396. file.writeLine(xp)
  397. file.writeLine(totalXp)
  398. file.writeLine(lvlD)
  399. file.writeLine(hp)
  400. file.writeLine(tHP)
  401. file.writeLine(sta)
  402. file.writeLine(tSta)
  403. file.writeLine(money)
  404. file.writeLine(wins)
  405. file.writeLine(loss)
  406. file.writeLine(myScore)
  407. file.writeLine(difficulty)
  408. file.writeLine(day)
  409. file.writeLine(mbrshipDay)
  410. file.close()
  411. print(" SAVED!")
  412. sleep(1)
  413. end
  414.  
  415. lvl = tonumber(lvl)
  416. xp = tonumber(xp)
  417. totalXp = tonumber(totalXp)
  418. lvlD = tonumber(lvlD)
  419. hp = tonumber(hp)
  420. tHP = tonumber(tHP)
  421. sta = tonumber(sta)
  422. tSta = tonumber(tSta)
  423. money = tonumber(money)
  424. wins = tonumber(wins)
  425. loss = tonumber(loss)
  426. myScore = tonumber(myScore)
  427.  end
  428.  
  429.  
  430.  
  431. ---------------------------------------------------------------------------------------------------
  432. --Loading
  433. function loadPlayer(player)
  434.  
  435. lvl = tonumber(lvl)
  436. xp = tonumber(xp)
  437. totalXp = tonumber(totalXp)
  438. lvlD = tonumber(lvlD)
  439. hp = tonumber(hp)
  440. tHP = tonumber(tHP)
  441. sta = tonumber(sta)
  442. tSta = tonumber(tSta)
  443. money = tonumber(money)
  444. wins = tonumber(wins)
  445. loss = tonumber(loss)
  446. myScore = tonumber(myScore)
  447. day = tonumber(day)
  448. mbrshipDay = tonumber(mbrshipDay)
  449.  
  450. --[[
  451. Line1 = myName
  452. Line2 = lvl
  453. Line3 = xp
  454. Line4 = totalXp
  455. Line5 = lvlD
  456. Line6 = hp
  457. Line7 = tHP
  458. Line8 = sta
  459. Line9 = tSta
  460. Line10 = money
  461. Line11 = wins
  462. Line12 = loss
  463. Line13 = myScore
  464. Line14 = Difficulty
  465. Line15 = day
  466. Line16 = mbrshipDay
  467. ]]--
  468.  
  469.  
  470. if player == 1 then
  471. if fs.exists(".gameData/saves/Player1") then
  472. file = fs.open(".gameData/saves/Player1","r")
  473. local fileData = {}
  474. local line = file.readLine()
  475. repeat
  476. table.insert(fileData,line)
  477. line = file.readLine()
  478. until line == nil
  479. file.close()
  480.  
  481. local myName1 = fileData[1]
  482. local lvl1 = fileData[2]
  483. xp = fileData[3]
  484. totalXp = fileData[4]
  485. lvlD = fileData[5]
  486. hp = fileData[6]
  487. tHP = fileData[7]
  488. sta = fileData[8]
  489. tSta = fileData[9]
  490. money = fileData[10]
  491. wins = fileData[11]
  492. loss = fileData[12]
  493. myScore = fileData[13]
  494. difficulty = fileData[14]
  495. day = fileData[15]
  496. mbrshipDay = fileData[16]
  497.  
  498.  
  499. print(" Profile Loaded! ")
  500. sleep(2)
  501. myName = myName1
  502. lvl = lvl1
  503. toNum()
  504. solo()
  505. end
  506.  
  507.  
  508. elseif player == 2 then
  509. if fs.exists(".gameData/saves/Player2") then
  510. file = fs.open(".gameData/saves/Player2","r")
  511. local fileData = {}
  512. local line = file.readLine()
  513. repeat
  514. table.insert(fileData,line)
  515. line = file.readLine()
  516. until line == nil
  517. file.close()
  518.  
  519. local myName2 = fileData[1]
  520. local lvl2 = fileData[2]
  521. xp = fileData[3]
  522. totalXp = fileData[4]
  523. lvlD = fileData[5]
  524. hp = fileData[6]
  525. tHP = fileData[7]
  526. sta = fileData[8]
  527. tSta = fileData[9]
  528. money = fileData[10]
  529. wins = fileData[11]
  530. loss = fileData[12]
  531. myScore = fileData[13]
  532. difficulty = fileData[14]
  533. day = fileData[15]
  534. mbrshipDay = fileData[16]
  535.  
  536.  
  537. print(" Profile Loaded! ")
  538. sleep(2)
  539. myName = myName2
  540. lvl = lvl2
  541. toNum()
  542. solo()
  543. end
  544.  
  545.  
  546. elseif player == 3 then
  547. if fs.exists(".gameData/saves/Player3") then
  548. file = fs.open(".gameData/saves/Player3","r")
  549. local fileData = {}
  550. local line = file.readLine()
  551. repeat
  552. table.insert(fileData,line)
  553. line = file.readLine()
  554. until line == nil
  555. file.close()
  556.  
  557. local myName3 = fileData[1]
  558. local lvl3 = fileData[2]
  559. xp = fileData[3]
  560. totalXp = fileData[4]
  561. lvlD = fileData[5]
  562. hp = fileData[6]
  563. tHP = fileData[7]
  564. sta = fileData[8]
  565. tSta = fileData[9]
  566. money = fileData[10]
  567. wins = fileData[11]
  568. loss = fileData[12]
  569. myScore = fileData[13]
  570. difficulty = fileData[14]
  571. day = fileData[15]
  572. mbrshipDay = fileData[16]
  573.  
  574.  
  575. print(" Profile Loaded! ")
  576. sleep(2)
  577. myName = myName3
  578. lvl = lvl3
  579. toNum()
  580. solo()
  581. end
  582.  
  583.  
  584. elseif player == 4 then
  585. if fs.exists(".gameData/saves/Player4") then
  586. file = fs.open(".gameData/saves/Player4","r")
  587. local fileData = {}
  588. local line = file.readLine()
  589. repeat
  590. table.insert(fileData,line)
  591. line = file.readLine()
  592. until line == nil
  593. file.close()
  594.  
  595. local myName4 = fileData[1]
  596. local lvl4 = fileData[2]
  597. xp = fileData[3]
  598. totalXp = fileData[4]
  599. lvlD = fileData[5]
  600. hp = fileData[6]
  601. tHP = fileData[7]
  602. sta = fileData[8]
  603. tSta = fileData[9]
  604. money = fileData[10]
  605. wins = fileData[11]
  606. loss = fileData[12]
  607. myScore = fileData[13]
  608. difficulty = fileData[14]
  609. day = fileData[15]
  610. mbrshipDay = fileData[16]
  611.  
  612. print(" Profile Loaded! ")
  613. sleep(2)
  614. myName = myName4
  615. lvl = lvl4
  616. toNum()
  617. solo()
  618. end
  619.  end
  620.   end
  621.  
  622.  
  623.  
  624.  
  625. function checkSaves()
  626. if myName1 == nil then
  627. myName1 = "No User"
  628. end
  629. if myName2 == nil then
  630. myName2 = "No User"
  631. end
  632. if myName3 == nil then
  633. myName3 = "No User"
  634. end
  635. if myName4 == nil then
  636. myName4 = "No User"
  637. end
  638. if myName5 == nil then
  639. myName5 = "No User"
  640. end
  641. if lvl1 == nil then
  642. lvl1 = "0"
  643. end
  644. if lvl2 == nil then
  645. lvl2 = "0"
  646. end
  647. if lvl3 == nil then
  648. lvl3 = "0"
  649. end
  650. if lvl4 == nil then
  651. lvl4 = "0"
  652. end
  653. if lvl5 == nil then
  654. lvl5 = "0"
  655. end
  656.  end
  657.  
  658.  
  659.  
  660.  function hOption(hMode)
  661.  --Delete
  662.  if hMode == delete then
  663.  chosenOpt = false
  664.  if colorsOnOff == "OFF" then
  665.     print("")
  666.   print("")
  667.   print(" Delete? (y/n) ")
  668.  while true do
  669.  if chosenOpt == true then
  670.  break
  671.  end
  672.  event, p1 = os.pullEvent()
  673.  if event == "char" and
  674.  p1 == "y" then
  675.  hOpt = "Yes"
  676.  chosenOpt = true
  677.  
  678.  elseif p1 == "n"
  679.  then hOpt = "No"
  680.   chosenOpt = true
  681.   end
  682.    end
  683.    
  684.  
  685.   elseif colorsOnOff == "ON" then
  686.    term.setTextColor(ttTextColor)
  687.   term.setBackgroundColor(colors.lightGray)
  688.    print("")
  689.   print("")
  690.    print(" Delete? (y/n) ")
  691.  while true do
  692.  if chosenOpt == true then
  693.  break
  694.  end
  695.  event, p1 = os.pullEvent()
  696.  if event == "char" and
  697.  p1 == "y" then
  698.  hOpt = "Yes"
  699.  chosenOpt = true
  700.  
  701.  elseif p1 == "n"
  702.  then hOpt = "No"
  703.   chosenOpt = true
  704. end
  705.  end
  706.   end
  707.  
  708.  
  709.  
  710.    
  711.  
  712. --Save
  713.  elseif hMode == save then
  714.   chosenOpt = false
  715.   if not saveExist then
  716.   saveMsg = " Save? (y/n)"
  717.  
  718.   elseif saveExist then
  719.   saveMsg = " Savegame already exists! \n Overwrite savegame? (y/n)"
  720.   end
  721.  
  722.   if colorsOnOff == "OFF" then
  723.   print("")
  724.   print("")
  725.   print(saveMsg)
  726.  while true do
  727.  if chosenOpt == true then
  728.  break
  729.  end
  730.  event, p1 = os.pullEvent()
  731.  if event == "char" and
  732.  p1 == "y" then
  733.  hOpt = "Yes"
  734.  chosenOpt = true
  735.  
  736.  elseif p1 == "n"
  737.  then hOpt = "No"
  738.   chosenOpt = true
  739.    end
  740.     end
  741.  
  742.   elseif colorsOnOff == "ON" then
  743.   term.setTextColor(ttTextColor)
  744.   term.setBackgroundColor(colors.lightGray)
  745.   print("")
  746.   print("")
  747.  print(saveMsg)
  748.  while true do
  749.  if chosenOpt == true then
  750.  break
  751.  end
  752.  event, p1 = os.pullEvent()
  753.  if event == "char" and
  754.  p1 == "y" then
  755.  hOpt = "Yes"
  756.  chosenOpt = true
  757.  
  758.  elseif p1 == "n"
  759.  then hOpt = "No"
  760.   chosenOpt = true
  761.  end
  762.  end
  763.  saveExist = false
  764.  end
  765.  
  766.  
  767.  
  768.   --Load
  769.   elseif hMode == load then
  770.   chosenOpt = false
  771.   if colorsOnOff == "OFF" then
  772.    print("")
  773.   print("")
  774.   print(" Load? Y/N ")
  775.  while true do
  776.  if chosenOpt == true then
  777.  break
  778.  end
  779.  event, p1 = os.pullEvent()
  780.  if event == "char" and
  781.  p1 == "y" then
  782.  hOpt = "Yes"
  783.  chosenOpt = true
  784.  
  785.  elseif p1 == "n"
  786.  then hOpt = "No"
  787.   chosenOpt = true
  788.    end
  789.     end
  790.  
  791.   elseif colorsOnOff == "ON" then
  792.   term.setTextColor(ttTextColor)
  793.   term.setBackgroundColor(colors.lightGray)
  794.      print("")
  795.   print("")
  796.   print(" Load? Y/N ")
  797.  while true do
  798.  if chosenOpt == true then
  799.  break
  800.  end
  801.  event, p1 = os.pullEvent()
  802.  if event == "char" and
  803.  p1 == "y" then
  804.  hOpt = "Yes"
  805.  chosenOpt = true
  806.  
  807.  elseif p1 == "n"
  808.  then hOpt = "No"
  809.   chosenOpt = true
  810.  end
  811.   end
  812.    end
  813.      end
  814.       end
  815.      
  816.      
  817.        
  818.  
  819. function hLoadMenuEvents()
  820. event, p1 = os.pullEvent()
  821. if event == "key" then
  822.  
  823. if p1 == 200 then
  824. menuPos = menuPos - 4
  825. if menuPos < 4 then
  826. menuPos = 16
  827. end
  828.  
  829. elseif p1 == 208 then
  830. menuPos = menuPos + 4
  831. if menuPos > 16 then
  832. menuPos = 4
  833. end
  834.  
  835. elseif p1 == 14 then
  836. inMenu = false
  837. return
  838.  
  839. -------------------------------------------------
  840. --Player 1
  841. elseif p1 == 28 then
  842. if menuPos == 4 then
  843. if sMode then
  844. if fs.exists(".gameData/saves/player1") then
  845. saveExist = true
  846. end
  847. hOption(save)
  848. if hOpt == "Yes" then
  849. save(1)
  850.  elseif hOpt == "No" then
  851. return
  852. end
  853. end
  854.  
  855.  
  856. if dMode then
  857. hOption(delete)
  858. if hOpt == "Yes" then
  859. fs.delete(".gameData/saves/Player1")
  860. elseif hOpt == "No" then
  861. return
  862. end
  863.  end
  864.  
  865. if lMode then
  866. hOption(load)
  867. if hOpt == "Yes" then
  868. if not fs.exists(".gameData/saves/player1") then
  869. print("No Save Game")
  870. sleep(2)
  871. return
  872. end
  873. loadPlayer(1)
  874. inMenu = false
  875. elseif hOpt == "No" then
  876. return
  877. end
  878. end
  879.  
  880. -------------------------------------------------
  881. --Player 2
  882. elseif menuPos == 8 then
  883. if sMode then
  884. if fs.exists(".gameData/saves/player2") then
  885. saveExist = true
  886. end
  887. hOption(save)
  888. if hOpt == "Yes" then
  889. save(2)
  890.  elseif hOpt == "No" then
  891. return
  892. end
  893. end
  894.  
  895. if dMode then
  896. hOption(delete)
  897. if hOpt == "Yes" then
  898. fs.delete(".gameData/saves/Player2")
  899. elseif hOpt == "No" then
  900. return
  901.  end
  902.   end
  903.  
  904. if lMode then
  905. hOption(load)
  906. if hOpt == "Yes" then
  907. if not fs.exists(".gameData/saves/player2") then
  908. print("No Save Game")
  909. sleep(2)
  910. return
  911. end
  912. loadPlayer(2)
  913. inMenu = false
  914. elseif hOpt == "No" then
  915. return
  916. end
  917. end
  918.  
  919. -------------------------------------------------
  920. --Player 3
  921. elseif menuPos == 12 then
  922. if sMode then
  923. if fs.exists(".gameData/saves/player3") then
  924. saveExist = true
  925. end
  926. hOption(save)
  927. if hOpt == "Yes" then
  928. save(3)
  929. elseif hOpt == "No" then
  930. return
  931. end
  932. end
  933.  
  934. if dMode then
  935. hOption(delete)
  936. if hOpt == "Yes" then
  937. fs.delete(".gameData/saves/Player3")
  938. elseif hOpt == "No" then
  939. return
  940.  end
  941.   end
  942.  
  943. if lMode then
  944. hOption(load)
  945. if hOpt == "Yes" then
  946. if not fs.exists(".gameData/saves/player3") then
  947. print("No Save Game")
  948. sleep(2)
  949. return
  950. end
  951. loadPlayer(3)
  952. inMenu = false
  953. elseif hOpt == "No" then
  954. return
  955. end
  956. end
  957.  
  958. -------------------------------------------------
  959. --Player 4
  960. elseif menuPos == 16 then
  961. if sMode then
  962. if fs.exists(".gameData/saves/player4") then
  963. saveExist = true
  964. end
  965. hOption(save)
  966. if hOpt == "Yes" then
  967. save(4)
  968.  elseif hOpt == "No" then
  969. return
  970. end
  971. end
  972.  
  973. if dMode then
  974. hOption()
  975. if hOpt == "Yes" then
  976. fs.delete(".gameData/saves/Player4")
  977. elseif hOpt == "No" then
  978. return
  979.  end
  980.  end
  981.  
  982. if lMode then
  983. hOption(load)
  984. if hOpt == "Yes" then
  985. if not fs.exists(".gameData/saves/player4") then
  986. print("No Save Game")
  987. sleep(2)
  988. return
  989. end
  990. loadPlayer(4)
  991. inMenu = false
  992. elseif hOpt == "No" then
  993. return
  994. end
  995. end
  996.  end
  997.   end
  998.    end
  999.     end
  1000. -------------------------------------------------
  1001.    
  1002. function readAll()
  1003. if not fs.exists(".gameData/saves/Player1") then
  1004. myName1 = "No User"
  1005. lvl1 = "0"
  1006. dif1 = "------"
  1007. end
  1008.  
  1009. if not fs.exists(".gameData/saves/Player2") then
  1010. myName2 = "No User"
  1011. lvl2 = "0"
  1012. dif2 = "------"
  1013. end
  1014.  
  1015. if not fs.exists(".gameData/saves/Player3") then
  1016. myName3 = "No User"
  1017. lvl3 = "0"
  1018. dif3 = "------"
  1019. end
  1020.  
  1021. if not fs.exists(".gameData/saves/Player4") then
  1022. myName4 = "No User"
  1023. lvl4 = "0"
  1024. dif4 = "------"
  1025. end
  1026.  
  1027.  
  1028. --Player 1
  1029. if fs.exists(".gameData/saves/Player1") then
  1030. file = fs.open(".gameData/saves/Player1","r")
  1031. local fileData = {}
  1032. local line = file.readLine()
  1033. repeat
  1034. table.insert(fileData,line)
  1035. line = file.readLine()
  1036. until line == nil
  1037. file.close()
  1038. myName1 = fileData[1]
  1039. lvl1 = fileData[2]
  1040. dif1 = fileData[14]
  1041. end
  1042.  
  1043. --Player 2
  1044. if fs.exists(".gameData/saves/Player2") then
  1045. file = fs.open(".gameData/saves/Player2","r")
  1046. local fileData = {}
  1047. local line = file.readLine()
  1048. repeat
  1049. table.insert(fileData,line)
  1050. line = file.readLine()
  1051. until line == nil
  1052. file.close()
  1053. myName2 = fileData[1]
  1054. lvl2 = fileData[2]
  1055. dif2 = fileData[14]
  1056. end
  1057.  
  1058. --Player 3
  1059. if fs.exists(".gameData/saves/Player3") then
  1060. file = fs.open(".gameData/saves/Player3","r")
  1061. local fileData = {}
  1062. local line = file.readLine()
  1063. repeat
  1064. table.insert(fileData,line)
  1065. line = file.readLine()
  1066. until line == nil
  1067. file.close()
  1068. myName3 = fileData[1]
  1069. lvl3 = fileData[2]
  1070. dif3 = fileData[14]
  1071. end
  1072.  
  1073. --Player 4
  1074. if fs.exists(".gameData/saves/Player4") then
  1075. file = fs.open(".gameData/saves/Player4","r")
  1076. local fileData = {}
  1077. local line = file.readLine()
  1078. repeat
  1079. table.insert(fileData,line)
  1080. line = file.readLine()
  1081. until line == nil
  1082. file.close()
  1083. myName4 = fileData[1]
  1084. lvl4 = fileData[2]
  1085. dif4 = fileData[14]
  1086. end
  1087.  end
  1088.    
  1089. function drawSS()
  1090. readAll()
  1091. if colorsOnOff == "OFF" then
  1092. drawAt(1,1,"+-------------------------------------------------+")
  1093. drawAt(1,2,"|                                                 |")
  1094. drawAt(1,3,"+-------------------------------------------------+")
  1095. drawAt(1,4,"                       I                           ")
  1096. drawAt(1,5,"+-------------------------------------------------+")
  1097. drawAt(1,6,"|                                             |   |")
  1098. drawAt(1,7,"+-------------------------------------------------+")
  1099. drawAt(5,6,"+"..myName1.."+")
  1100. drawAt(24,6,"LVL:"..lvl1.."    "..dif1)      
  1101. drawAt(20,2,"+--"..mode.."--+")
  1102.  
  1103. drawAt(1,8,"                       II                          ")
  1104. drawAt(1,9,"+-------------------------------------------------+")
  1105. drawAt(1,10,"|                                             |   |")
  1106. drawAt(1,11,"+-------------------------------------------------+")
  1107. drawAt(5,10,"+"..myName2.."+")
  1108. drawAt(24,10,"LVL:"..lvl2.."    "..dif2)  
  1109.  
  1110. drawAt(1,12,"                       III                         ")
  1111. drawAt(1,13,"+-------------------------------------------------+")
  1112. drawAt(1,14,"|                                             |   |")
  1113. drawAt(1,15,"+-------------------------------------------------+")
  1114. drawAt(5,14,"+"..myName3.."+")
  1115. drawAt(24,14,"LVL:"..lvl3.."    "..dif3)
  1116.  
  1117. drawAt(1,16,"                       IV                          ")
  1118. drawAt(1,17,"+-------------------------------------------------+")
  1119. drawAt(1,18,"|                                             |   |")
  1120. drawAt(1,19,"+-------------------------------------------------+")
  1121. drawAt(5,18,"+"..myName4.."+")
  1122. drawAt(24,18,"LVL:"..lvl4.."    "..dif4)
  1123. drawAt(49,2 + menuPos,"*")
  1124.  
  1125.  
  1126. elseif colorsOnOff == "ON" then
  1127. term.setBackgroundColor(colors.white)
  1128. term.setTextColor(menuTextColor)
  1129. drawAt(1,1,"                                                   ")
  1130. drawAt(1,2,"                                                   ")
  1131. drawAt(1,3,"                                                   ")
  1132.  
  1133. term.setBackgroundColor(colors.lightGray)
  1134. term.setTextColor(colors.red)
  1135. drawAt(1,4,"                       I                           ")
  1136.  
  1137. term.setBackgroundColor(ttBackColor)
  1138. term.setTextColor(menuTextColor)
  1139. drawAt(1,5,"                                                   ")
  1140. drawAt(1,6,"                                                   ")
  1141. drawAt(1,7,"                                                   ")
  1142. drawAt(5,6,"+"..myName1.."+")
  1143. drawAt(24,6,"LVL:"..lvl1.."    "..dif1)
  1144. term.setBackgroundColor(menuBackColor)      
  1145. drawAt(20,2,"+--"..mode.."--+")
  1146.  
  1147. term.setBackgroundColor(menuBackColor)
  1148. drawAt(48,6,"   ")
  1149.  
  1150.  
  1151. term.setBackgroundColor(colors.lightGray)
  1152. term.setTextColor(colors.red)
  1153. drawAt(1,8,"                       II                          ")
  1154.  
  1155. term.setBackgroundColor(ttBackColor)
  1156. term.setTextColor(menuTextColor)
  1157. drawAt(1,9,"                                                   ")
  1158. drawAt(1,10,"                                                   ")
  1159. drawAt(1,11,"                                                   ")
  1160. drawAt(5,10,"+"..myName2.."+")
  1161. drawAt(24,10,"LVL:"..lvl2.."    "..dif2)  
  1162.  
  1163. term.setBackgroundColor(menuBackColor)
  1164. drawAt(48,10,"   ")
  1165.  
  1166.  
  1167. term.setBackgroundColor(colors.lightGray)
  1168. term.setTextColor(colors.red)
  1169. drawAt(1,12,"                       III                         ")
  1170.  
  1171. term.setBackgroundColor(ttBackColor)
  1172. term.setTextColor(menuTextColor)
  1173. drawAt(1,13,"                                                   ")
  1174. drawAt(1,14,"                                                   ")
  1175. drawAt(1,15,"                                                   ")
  1176. drawAt(5,14,"+"..myName3.."+")
  1177. drawAt(24,14,"LVL:"..lvl3.."    "..dif3)
  1178.  
  1179. term.setBackgroundColor(menuBackColor)
  1180. drawAt(48,14,"   ")
  1181.  
  1182. term.setBackgroundColor(colors.lightGray)
  1183. term.setTextColor(colors.red)
  1184. drawAt(1,16,"                       IV                          ")
  1185.  
  1186. term.setBackgroundColor(ttBackColor)
  1187. term.setTextColor(menuTextColor)
  1188. drawAt(1,17,"                                                   ")
  1189. drawAt(1,18,"                                                   ")
  1190. drawAt(1,19,"                                                   ")
  1191. drawAt(5,18,"+"..myName4.."+")
  1192. drawAt(24,18,"LVL:"..lvl4.."    "..dif4)
  1193.  
  1194. term.setBackgroundColor(menuBackColor)
  1195. drawAt(48,18,"   ")
  1196.  
  1197. term.setBackgroundColor(menuBackColor)
  1198. term.setTextColor(menuTextColor)
  1199. drawAt(49,2 + menuPos,"*")
  1200.  
  1201. term.setBackgroundColor(colors.black)
  1202. term.setTextColor(colors.white)
  1203. end
  1204. end
  1205.  
  1206.  
  1207. function loadMenu()
  1208. menuPos = 4
  1209. while true do
  1210. checkSaves()
  1211. readAll()
  1212. if not inMenu then
  1213. cleanScreen()
  1214. print(myName)
  1215. break
  1216.  end
  1217. cleanScreen()
  1218. drawSS()
  1219. hLoadMenuEvents()
  1220. end
  1221.  end
  1222.  
  1223.  
  1224.  
  1225.  
  1226.  if not fs.exists(".gameData/APIs") then
  1227.   fs.makeDir(".gameData/APIs")
  1228.  end
  1229.  
  1230.  if not fs.exists(".gameData/saves/") then
  1231. fs.makeDir(".gameData/saves")
  1232. fs.makeDir(".gameData/mods")
  1233. fs.makeDir(".gameData/settings")
  1234. fs.makeDir(".gameData/themes")
  1235.  
  1236. end
  1237.  
  1238.  if not fs.exists(".gameData/mods/") then
  1239. fs.makeDir(".gameData/saves")
  1240. fs.makeDir(".gameData/mods")
  1241. fs.makeDir(".gameData/settings")
  1242. fs.makeDir(".gameData/themes")
  1243.  
  1244. end
  1245.  
  1246.  if not fs.exists(".gameData/settings/") then
  1247. fs.makeDir(".gameData/saves")
  1248. fs.makeDir(".gameData/mods")
  1249. fs.makeDir(".gameData/settings")
  1250. fs.makeDir(".gameData/themes")
  1251.  
  1252. end
  1253.  
  1254.  if not fs.exists(".gameData/themes/") then
  1255. fs.makeDir(".gameData/saves")
  1256. fs.makeDir(".gameData/mods")
  1257. fs.makeDir(".gameData/settings")
  1258. fs.makeDir(".gameData/themes")
  1259. end
  1260.  
  1261. if not fs.exists(".gameData/.mp/settings") then
  1262. fs.makeDir(".gameData/.mp/settings")
  1263. fs.makeDir(".gameData/.mp/mods")
  1264. fs.makeDir(".gameData/.mp/characterArt")
  1265. end
  1266.  
  1267. ---------------------------------------------------------------------------------------------------
  1268. --SETTINGS
  1269. ---------------------------------------------------------------------------------------------------
  1270. function defaultSettings()
  1271. hintLevel = "LOW"
  1272.        subOnOff = "OFF"
  1273.             xyPosOnOff = "ON"
  1274.                colorsOnOff = "OFF"
  1275.             hDetailLevel = "NORMAL"
  1276.                  connection = "NONE"
  1277.                       shName = "ON"
  1278.                  shScore = "ON"
  1279.                  shHUD = "ON"
  1280.       gameMode = "Command"
  1281.       hAutoUpdate = "OFF"
  1282.       language = "English"
  1283. optXYpos = 1
  1284. optColors = 2
  1285. optDetail = 2
  1286. optSHscore = 1
  1287. optConnection = 0
  1288. optgMode = 1
  1289. optAutoUpdate = 1
  1290. optLang = 1
  1291. cheatQuickLeveling = false
  1292. cheatInstaKill = false
  1293. cheatGodMode = false
  1294. cheatUnlimitedMoney = false
  1295. cheatNoClip = false
  1296. cheatSuperFreak = false
  1297. end
  1298.  
  1299. function defaultColors()
  1300. ttTextColor = colors.red
  1301. ttBackColor = colors.cyan
  1302. menuTextColor = colors.black
  1303. menuBackColor = colors.white
  1304. end
  1305.  
  1306.  
  1307. function dApi()
  1308. if not fs.exists(".gameData/APIs/ccConfig") then
  1309.  
  1310.  
  1311. if colorsOnOff == "ON" then
  1312. term.setBackgroundColor(colors.white)
  1313. end
  1314. cleanScreen()
  1315.  
  1316.  
  1317. if not http then
  1318. cleanScreen()
  1319. centerPrint(halfH,"HTTP api not enabled!")
  1320. downloading = false
  1321. end
  1322.  
  1323. --Checks if you can access the site
  1324. if colorsOnOff == "ON" then
  1325. term.setTextColor(colors.black)
  1326. end
  1327.  
  1328. centerPrint(halfH,"Trying to connect to ccConfigs pastebin..")
  1329. http.request("http://pastebin.com/raw.php?i=iMpzmDWt")
  1330.  evt = os.pullEvent()
  1331.   if evt == "http_success" then
  1332.     downloading = true
  1333.     elseif evt ~= "http_success" then
  1334.     cleanScreen()
  1335.     downloading = false
  1336.     if colorsOnOff == "OFF" then
  1337.     centerPrint(halfH,"Failed to download ccConfig.")
  1338.      elseif colorsOnOff == "ON" then
  1339.      term.setTextColor(colors.red)
  1340.      centerPrint(halfH,"Failed to download ccConfig.")
  1341. end
  1342.  sleep(1)
  1343.  end
  1344.    
  1345.   --Drawing
  1346.   if downloading then
  1347.   if colorsOnOff == "ON" then
  1348.   term.setBackgroundColor(colors.white)
  1349.   end
  1350.    cleanScreen()
  1351.       if colorsOnOff == "OFF" then
  1352.        centerPrint(halfH,"Downloading")
  1353.         centerPrint(halfH + 1,"ccConfig..")
  1354.     elseif colorsOnOff == "ON" then
  1355.     term.setTextColor(colors.black)
  1356.            centerPrint(halfH,"Downloading")
  1357.         centerPrint(halfH + 1,"ccConfig..")
  1358.     end
  1359.        
  1360.         --Downloading
  1361.      code = http.get("http://pastebin.com/raw.php?i="..textutils.urlEncode("iMpzmDWt"))
  1362.      file = fs.open(".gameData/APIs/ccConfig","w")
  1363.         local sCode = code.readAll()
  1364.        file.write(sCode)
  1365.            file.close() --Always important to close file
  1366.            
  1367.           cleanScreen()
  1368.           if colorsOnOff == "OFF" then
  1369.    centerPrint(halfH,"Downloaded!")
  1370.    elseif colorsOnOff == "ON" then
  1371.    term.setTextColor(colors.lime)
  1372.    centerPrint(halfH,"Downloaded!")
  1373.    end
  1374.    sleep(1)
  1375. end
  1376.   end
  1377.      end
  1378.  
  1379.  
  1380. function update()
  1381.  
  1382. --[[
  1383. This Updater Is Made By Herû
  1384. I just modified the function a little
  1385. ]]--
  1386.  
  1387. if colorsOnOff == "OFF" then
  1388. cleanScreen()
  1389. centerPrint(halfH,"Looking For Updates..")
  1390.  
  1391. elseif colorsOnOff == "ON" then
  1392. term.setBackgroundColor(colors.white)
  1393. term.setTextColor(colors.black)
  1394. cleanScreen()
  1395. centerPrint(halfH,"Looking For Updates..")
  1396. end
  1397.  
  1398. local newestVersion
  1399. if not http then
  1400.  if colorsOnOff == "OFF" then
  1401.     cleanScreen()
  1402. drawAt(2,halfH,"You need to have the http api enabled!")
  1403. sleep(0.5)
  1404.  
  1405. elseif colorsOnOff == "ON" then
  1406. term.setTextColor(ttTextColor)
  1407. term.setBackgroundColor(colors.white)
  1408. cleanScreen()
  1409. drawAt(2,halfH," You need to have the http api enabled! ")
  1410. sleep(0.5)
  1411. end
  1412. else
  1413. local getVersion = "http://admin.boxer.hostei.com/autoupdater/find.php?todo=version"
  1414. http.request(getVersion)
  1415. event, url, newestVersionWeb = os.pullEvent()
  1416. if event == "http_success" then
  1417.   newestVersion = newestVersionWeb.readLine()
  1418.   local getCurrentVersion = ".gameData/version"
  1419.   if fs.exists(getCurrentVersion) then
  1420.     local file = fs.open(getCurrentVersion,"r")
  1421.     currentVersion = file.readLine()
  1422.     file.close()
  1423.   else
  1424.     currentVersion = version
  1425.   end
  1426.   currentVersion = tonumber(currentVersion)
  1427.   newestVersion = tonumber(newestVersion)
  1428.   if newestVersion > currentVersion then
  1429.    if colorsOnOff == "OFF" then
  1430.     centerPrint(halfH - 1,"                                                     ")
  1431.     centerPrint(halfH,"      +--Current version is "..newestVersion.."--+               ")
  1432.     centerPrint(halfH + 1,"          Your version is "..currentVersion..",                ")
  1433.     centerPrint(halfH + 2,"    Will you update to the newest version?            ")
  1434.     centerPrint(halfH + 3,"                   (y/n)                              ")
  1435.    
  1436.     elseif colorsOnOff == "ON" then
  1437.     term.setTextColor(colors.yellow)
  1438.      term.setBackgroundColor(colors.white)
  1439.      cleanScreen()
  1440.      term.setBackgroundColor(colors.lightGray)
  1441.     drawAt(5,halfH - 1,"                                                     ")
  1442.     drawAt(5,halfH,"      +--Current version is "..newestVersion.."--+               ")
  1443.     term.setTextColor(colors.black)
  1444.     drawAt(5,halfH + 1,"          Your version is "..currentVersion..",                ")
  1445.     drawAt(5,halfH + 2,"    Will you update to the newest version?            ")
  1446.     drawAt(5,halfH + 3,"                   (y/n)                              ")
  1447.    
  1448.     for i = halfH -1, halfH + 3 do
  1449.     paintutils.drawPixel(51,i,colors.white)
  1450.     end
  1451.    
  1452.     term.setBackgroundColor(colors.white)
  1453.     end
  1454.     if not startUpdate then
  1455.     event2, answer = os.pullEvent("char")
  1456.     end
  1457.    
  1458.      if startUpdate then
  1459.      answer = "y"
  1460.      end
  1461.      
  1462.     if answer == "y" then
  1463.      cleanScreen()
  1464.       if colorsOnOff == "OFF" then
  1465.         centerPrint(halfH,"Updating..")
  1466.        
  1467.         elseif colorsOnOff == "ON" then
  1468.         term.setBackgroundColor(colors.white)
  1469.         cleanScreen()
  1470.          term.setBackgroundColor(colors.lightGray)
  1471.           term.setTextColor(colors.yellow)
  1472.           centerPrint(halfH - 1,"           ")
  1473.           centerPrint(halfH," Updating..")
  1474.           centerPrint(halfH + 1,"           ")
  1475.           end
  1476.           local getCurrentCode = "http://admin.boxer.hostei.com/autoupdater/find.php?todo=pastebincode"
  1477.           http.request(getCurrentCode)
  1478.           event, url, currentLink = os.pullEvent()
  1479.           if event == "http_success" then
  1480.             local programName = shell.getRunningProgram()
  1481.             programName = fs.getName(programName)
  1482.             oldSize = fs.getSize(programName)
  1483.             local response = http.get("http://pastebin.com/raw.php?i="..textutils.urlEncode(currentLink.readLine()))
  1484.             if response then
  1485.                   centerPrint(halfH,"Downloaded, saving to file...")
  1486.                   sleep(2)
  1487.                   local file = fs.open(programName,"w")
  1488.                   local sResponse = response.readAll()
  1489.                   file.write(sResponse)
  1490.                   file.close()
  1491.                   ufile = fs.open(".gameData/version","w")
  1492.                   ufile.write(newestVersion)
  1493.                   ufile.close()
  1494.                   newSize = fs.getSize(programName)
  1495.                  if colorsOnOff == "OFF" then
  1496.                  cleanScreen()
  1497.                  drawAt(2,halfH - 1,"                                                    ")
  1498.                  drawAt(2,halfH," You have now updated the game, please exit the     ")
  1499.                    drawAt(2,halfH + 1," Game and open it again to use the updated version. ")
  1500.                    drawAt(2,halfH + 2,"                                                    ")
  1501.                    drawAt(2,halfH + 4,"Boxer Tournament Ver "..newestVersion.." Size: "..newSize.." Byte")
  1502.                    drawAt(2,halfH + 5,"Boxer Tournament Ver "..version.." Size: "..oldSize.." Byte")
  1503.                    drawAt(2,halfH + 7,"Free Disk Space: "..fs.getFreeSpace("/").." Byte")
  1504.                   sleep(0.5)
  1505.                  
  1506.                 elseif colorsOnOff == "ON" then
  1507.                 term.setTextColor(colors.yellow)
  1508.                    term.setBackgroundColor(colors.white)
  1509.                     cleanScreen()
  1510.                     term.setBackgroundColor(colors.lightGray)
  1511.                    drawAt(1,halfH," You have now updated the game, please exit the     ")
  1512.                    drawAt(1,halfH + 1," Game and open it again to use the updated version. ")
  1513.                    term.setBackgroundColor(colors.white)
  1514.                    term.setTextColor(colors.black)
  1515.                    drawAt(1,halfH + 3," Boxer Tournament Ver "..newestVersion.." Size: "..newSize.." Byte")
  1516.                    drawAt(1,halfH + 4," Boxer Tournament Ver "..version.." Size: "..oldSize.." Byte")
  1517.                    drawAt(1,halfH + 6," Free Disk Space: "..fs.getFreeSpace("/").." Byte")
  1518.                  
  1519.                  sleep(0.5)
  1520.                  end
  1521.  
  1522.             else
  1523.                     if colorsOnOff == "OFF" then
  1524.                  cleanScreen()
  1525.                   drawAt(4,halfH,"Something went wrong when trying to")
  1526.                   drawAt(4,halfH + 1,"Get the pastebin code, Try again later.")
  1527.                   sleep(0.5)
  1528.                  
  1529.                 elseif colorsOnOff == "ON" then
  1530.                 term.setTextColor(colors.red)
  1531.                    term.setBackgroundColor(colors.white)
  1532.                     cleanScreen()
  1533.                     term.setBackgroundColor(colors.lightGray)
  1534.                     centerPrint(halfH - 1,"                                       ")
  1535.                     centerPrint(halfH," Something went wrong when trying to ")
  1536.                   centerPrint(halfH + 1," Get the pastebin code, Try again later. ")
  1537.                   centerPrint(halfH + 2,"                                         ")
  1538.                  term.setBackgroundColor(colors.white)
  1539.                  sleep(0.5)
  1540.                  end
  1541.             end
  1542.            
  1543.           else
  1544.             if event == "http_failure" then
  1545.                 if colorsOnOff == "OFF" then
  1546.                  cleanScreen()
  1547.                   centerPrint(halfH,"Something went wrong, try again later.")
  1548.                   sleep(0.5)
  1549.                  
  1550.                 elseif colorsOnOff == "ON" then
  1551.                 term.setTextColor(colors.red)
  1552.                    term.setBackgroundColor(colors.white)
  1553.                     cleanScreen()
  1554.                     term.setBackgroundColor(colors.lightGray)
  1555.                     centerPrint(halfH - 1,"                                        ")
  1556.                 centerPrint(halfH," Something went wrong, try again later. ")
  1557.                 centerPrint(halfH + 1,"                                            ")
  1558.                  term.setBackgroundColor(colors.white)
  1559.                  sleep(0.5)
  1560.                  end
  1561.             end
  1562.           end
  1563.     else
  1564.           if colorsOnOff == "OFF" then
  1565.                  cleanScreen()
  1566.                   centerPrint(halfH,"Ok, but remember that you could update it later.")
  1567.                   sleep(0.5)
  1568.                  
  1569.                 elseif colorsOnOff == "ON" then
  1570.                 term.setTextColor(colors.black)
  1571.                    term.setBackgroundColor(colors.white)
  1572.                     cleanScreen()
  1573.                     term.setBackgroundColor(colors.lightGray)
  1574.                     centerPrint(halfH - 1,"                                                   ")
  1575.                 centerPrint(halfH,"  Ok, but remember that you could update it later. ")
  1576.                     centerPrint(halfH + 1,"                                                   ")
  1577.                 term.setBackgroundColor(colors.white)
  1578.                  sleep(0.5)
  1579.                  end
  1580.     end
  1581.   else
  1582.  
  1583.  if colorsOnOff == "OFF" then
  1584.                  cleanScreen()
  1585.                   centerPrint(halfH,"You have the newest version")
  1586.                   sleep(0.5)
  1587.                  
  1588.                 elseif colorsOnOff == "ON" then
  1589.                 term.setTextColor(colors.yellow)
  1590.                    term.setBackgroundColor(colors.white)
  1591.                     cleanScreen()
  1592.                     term.setBackgroundColor(colors.lightGray)
  1593.                 centerPrint(halfH - 1,"                             ")
  1594.                 centerPrint(halfH," You have the newest version ")
  1595.                 centerPrint(halfH + 1,"                             ")
  1596.                 term.setBackgroundColor(colors.white)
  1597.                  sleep(0.5)
  1598.                  end
  1599. end
  1600. else
  1601.   if event == "http_failure" then
  1602.  
  1603.   if colorsOnOff == "OFF" then
  1604.                  cleanScreen()
  1605.                    centerPrint(halfH,"Something went wrong when trying")
  1606.                   centerPrint(halfH + 1,"To get the newest version, Try again later.")
  1607.                   sleep(0.5)
  1608.                  
  1609.                 elseif colorsOnOff == "ON" then
  1610.                 term.setTextColor(colors.red)
  1611.                    term.setBackgroundColor(colors.white)
  1612.                     cleanScreen()
  1613.                     term.setBackgroundColor(colors.lightGray)
  1614.                  centerPrint(halfH - 1,"                                         ")
  1615.                  centerPrint(halfH," Something went wrong when trying to get ")
  1616.                   centerPrint(halfH + 1," The newest version, Try again later.    ")
  1617.                   centerPrint(halfH + 2,"                                         ")
  1618.                  sleep(0.5)
  1619.                  end
  1620.   end
  1621. end
  1622. end
  1623. if not startUpdate then
  1624. if colorsOnOff == "OFF" then
  1625. centerPrint(19,"Press Any Key To Continue")
  1626.  
  1627. elseif colorsOnOff == "ON" then
  1628. term.setTextColor(colors.black)
  1629. centerPrint(19,"Press Any Key To Continue")
  1630. end
  1631.   end
  1632. if not startUpdate then
  1633. os.pullEvent("key")
  1634.  
  1635. elseif startUpdate then
  1636. sleep(2)
  1637. end
  1638.  
  1639. if not fs.exists(".gameData/APIs/ccConfig") then
  1640. dApi()
  1641. end
  1642.  
  1643. cleanScreen()
  1644. loadSettings()
  1645. return
  1646. end
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654. --[[
  1655. This is a modified read function by GravityScore
  1656.  
  1657.  
  1658.   Properties:
  1659.   - replaceChar     Replace Character when typing
  1660.   - history             Up/Down arrow history
  1661.   - visibleLength       Visible text length
  1662.   - textLength      Maxmimum typing length
  1663.   - liveUpdates         Live update function
  1664.   - exitOnKey           Key that will stop reading
  1665.   - refusePrint     Array of keys that will not be able to be typed
  1666.   - grantPrint      Array of characters that are only allowed to be typed
  1667. ]]--
  1668.  
  1669. local function modRead(properties)
  1670.     local w, h = term.getSize()
  1671.     local defaults = {replaceChar = nil, history = nil, visibleLength = nil, textLength = nil,
  1672.         liveUpdates = nil, exitOnKey = nil}
  1673.     if not properties then properties = {} end
  1674.     for k, v in pairs(defaults) do if not properties[k] then properties[k] = v end end
  1675.     if properties.replaceChar then properties.replaceChar = properties.replaceChar:sub(1, 1) end
  1676.     if not properties.visibleLength then properties.visibleLength = w end
  1677.  
  1678.     local sx, sy = term.getCursorPos()
  1679.     local line = ""
  1680.     local pos = 0
  1681.     local historyPos = nil
  1682.  
  1683.     local function redraw(repl)
  1684.         local scroll = 0
  1685.         if properties.visibleLength and sx + pos > properties.visibleLength + 1 then
  1686.             scroll = (sx + pos) - (properties.visibleLength + 1)
  1687.         end
  1688.  
  1689.         term.setCursorPos(sx, sy)
  1690.         local a = repl or properties.replaceChar
  1691.         if a then term.write(string.rep(a, line:len() - scroll))
  1692.         else term.write(line:sub(scroll + 1, -1)) end
  1693.         term.setCursorPos(sx + pos - scroll, sy)
  1694.     end
  1695.  
  1696.     local function sendLiveUpdates(event, ...)
  1697.         if type(properties.liveUpdates) == "function" then
  1698.             local ox, oy = term.getCursorPos()
  1699.             properties.liveUpdates(line, event, ...)
  1700.             if a == true and data == nil then
  1701.                 term.setCursorBlink(false)
  1702.                 return line
  1703.             elseif a == true and data ~= nil then
  1704.                 term.setCursorBlink(false)
  1705.                 return data
  1706.             end
  1707.             term.setCursorPos(ox, oy)
  1708.         end
  1709.     end
  1710.  
  1711.     term.setCursorBlink(true)
  1712.     while true do
  1713.         local e, but, x, y, p4, p5 = os.pullEvent()
  1714.  
  1715.         if e == "char" then
  1716.             local s = false
  1717.             if properties.textLength and line:len() < properties.textLength then s = true
  1718.             elseif not properties.textLength then s = true end
  1719.  
  1720.             local canType = true
  1721.             if not properties.grantPrint and properties.refusePrint then
  1722.                 local canTypeKeys = {}
  1723.                 if type(properties.refusePrint) == "table" then
  1724.                     for _, v in pairs(properties.refusePrint) do
  1725.                         table.insert(canTypeKeys, tostring(v):sub(1, 1))
  1726.                     end
  1727.                 elseif type(properties.refusePrint) == "string" then
  1728.                     for char in properties.refusePrint:gmatch(".") do
  1729.                         table.insert(canTypeKeys, char)
  1730.                     end
  1731.                 end
  1732.                 for _, v in pairs(canTypeKeys) do if but == v then canType = false end end
  1733.             elseif properties.grantPrint then
  1734.                 canType = false
  1735.                 local canTypeKeys = {}
  1736.                 if type(properties.grantPrint) == "table" then
  1737.                     for _, v in pairs(properties.grantPrint) do
  1738.                         table.insert(canTypeKeys, tostring(v):sub(1, 1))
  1739.                     end
  1740.                 elseif type(properties.grantPrint) == "string" then
  1741.                     for char in properties.grantPrint:gmatch(".") do
  1742.                         table.insert(canTypeKeys, char)
  1743.                     end
  1744.                 end
  1745.                 for _, v in pairs(canTypeKeys) do if but == v then canType = true end end
  1746.             end
  1747.  
  1748.             if s and canType then
  1749.                 line = line:sub(1, pos) .. but .. line:sub(pos + 1, -1)
  1750.                 pos = pos + 1
  1751.                 redraw()
  1752.             end
  1753.         elseif e == "key" then
  1754.             if but == keys.enter then
  1755.                 break
  1756.             elseif but == keys.left then
  1757.                 if pos > 0 then pos = pos - 1 redraw() end
  1758.             elseif but == keys.right then
  1759.                 if pos < line:len() then pos = pos + 1 redraw() end
  1760.             elseif (but == keys.up or but == keys.down) and properties.history then
  1761.                 redraw(" ")
  1762.                 if but == keys.up then
  1763.                     if historyPos == nil and #properties.history > 0 then
  1764.                         historyPos = #properties.history
  1765.                     elseif historyPos > 1 then
  1766.                         historyPos = historyPos - 1
  1767.                     end
  1768.                 elseif but == keys.down then
  1769.                     if historyPos == #properties.history then historyPos = nil
  1770.                     elseif historyPos ~= nil then historyPos = historyPos + 1 end
  1771.                 end
  1772.  
  1773.                 if properties.history and historyPos then
  1774.                     line = properties.history[historyPos]
  1775.                     pos = line:len()
  1776.                 else
  1777.                     line = ""
  1778.                     pos = 0
  1779.                 end
  1780.  
  1781.                 redraw()
  1782.                 sendLiveUpdates("history")
  1783.             elseif but == keys.backspace and pos > 0 then
  1784.                 redraw(" ")
  1785.                 line = line:sub(1, pos - 1) .. line:sub(pos + 1, -1)
  1786.                 pos = pos - 1
  1787.                 redraw()
  1788.                 sendLiveUpdates("delete")
  1789.             elseif but == keys.home then
  1790.                 pos = 0
  1791.                 redraw()
  1792.             elseif but == keys.delete and pos < line:len() then
  1793.                 redraw(" ")
  1794.                 line = line:sub(1, pos) .. line:sub(pos + 2, -1)
  1795.                 redraw()
  1796.                 sendLiveUpdates("delete")
  1797.             elseif but == keys["end"] then
  1798.                 pos = line:len()
  1799.                 redraw()
  1800.             elseif properties.exitOnKey then
  1801.                 if but == properties.exitOnKey or (properties.exitOnKey == "control" and
  1802.                         (but == 29 or but == 157)) then
  1803.                     term.setCursorBlink(false)
  1804.                     return nil
  1805.                 end
  1806.             end
  1807.         end
  1808.  
  1809.         sendLiveUpdates(e, but, x, y, p4, p5)
  1810.     end
  1811.  
  1812.     term.setCursorBlink(false)
  1813.     if line ~= nil then line = line:gsub("^%s*(.-)%s*$", "%1") end
  1814.     return line
  1815. end
  1816.  
  1817.  
  1818.  
  1819.  
  1820.  
  1821.  
  1822.  
  1823.  
  1824.  
  1825.  
  1826.  
  1827. --[[
  1828. GAME:{
  1829. Hint Level (hintLevel)
  1830. Subititles (subOnOff)
  1831. }
  1832.  
  1833. GRAPHICS:{
  1834. ShowXYpos = Allows you to choose if you want to see X/Y pos. (xyPosOnOff)
  1835. Colors = Allow you to turn on and off the colors (colorsOnOff)
  1836. Detail Level = Low,Medium, Normal,High,Extreme (detailLevel)
  1837. }
  1838.  
  1839. CONTROLS:{
  1840. Default Controls
  1841. Set Controls
  1842. }
  1843.  
  1844. NETWORK:{
  1845. Connection = Global, Private, Lan (connection)
  1846. Show/Hide Name (shName)
  1847. }
  1848.  
  1849. HUD: {
  1850. Show/Hide Score (shScore)
  1851. Show Hide HUD = Shows Or Hides Everything (shHUD)
  1852. }
  1853.  
  1854. ENTER CHEAT = Here you can enter a cheatCode to enable a cheat
  1855.  
  1856. ]]--
  1857.  
  1858.  
  1859.  
  1860.  
  1861.  
  1862.  
  1863.  
  1864.  
  1865. function saveSettings()
  1866.  
  1867. local file = fs.open(".gameData/settings/cfg","w")
  1868. file.writeLine("--Game") --1
  1869. file.writeLine(hintLevel) --2
  1870. file.writeLine(gameMode) -- 3
  1871.  
  1872. file.writeLine("--Subititles") --4
  1873. file.writeLine(subOnOff) --5
  1874.  
  1875. file.writeLine("--X/Y Pos") --6
  1876. file.writeLine(xyPosOnOff) --7
  1877.  
  1878. file.writeLine("--Colors") --8
  1879. file.writeLine(colorsOnOff) --9
  1880.  
  1881. file.writeLine("--Detail Level") -- 10
  1882. file.writeLine(hDetailLevel)--11
  1883.  
  1884. file.writeLine("--Network/Connection") --12
  1885. file.writeLine(connection) --13
  1886. file.writeLine(shName) --14
  1887.  
  1888. file.writeLine("--Show Score/Hud") --15
  1889. file.writeLine(shScore) -- 16
  1890. file.writeLine(shHUD) --17
  1891.  
  1892. file.writeLine("--Stats") --18
  1893. file.writeLine(optXYpos) -- 19
  1894. file.writeLine(optColors) --20
  1895. file.writeLine(optDetail) -- 21
  1896. file.writeLine(optSHscore) --22
  1897. file.writeLine(optConnection) --23
  1898. file.writeLine(optgMode) -- 24
  1899.  
  1900. file.writeLine("")
  1901. file.writeLine("--Auto Update")
  1902. file.writeLine(hAutoUpdate) --27
  1903. file.writeLine(optAutoUpdate) --28
  1904. file.writeLine("")
  1905. file.writeLine("--Language")
  1906. file.writeLine(language) --31
  1907. file.writeLine(optLang) --32
  1908.  
  1909. file.writeLine("")
  1910. file.writeLine("+----------------------------------------------------+")
  1911. file.writeLine(" DO NOT EDIT THIS UNLESS YOU KNOW WHAT YOU ARE DOING")
  1912. file.writeLine("       EDITING CONFIGS HERE IS AT YOUR OWN RISK!")
  1913. file.writeLine("+----------------------------------------------------+")
  1914. file.writeLine("")
  1915. file.writeLine("+--NOTE--+")
  1916. file.writeLine(" If you get any error, Then try to delete this cfg file")
  1917. file.writeLine(" And try to start the game again, Otherwise you'll have")
  1918. file.writeLine(" To delete the whole .gameData folder.")
  1919.  
  1920.  
  1921.  
  1922. file.close()
  1923. end
  1924.  
  1925.  
  1926. function loadSettings()
  1927. if not fs.exists(".gameData/settings/cfg") then
  1928. defaultSettings()
  1929. end
  1930. if fs.exists(".gameData/settings/cfg") then
  1931. file = fs.open(".gameData/settings/cfg","r")
  1932. local fileData = {}
  1933. local line = file.readLine()
  1934. repeat
  1935. table.insert(fileData,line)
  1936. line = file.readLine()
  1937. until line == nil
  1938. file.close()
  1939.  
  1940. hintLevel = fileData[2]
  1941. gameMode = fileData[3]
  1942. subOnOff = fileData[5]
  1943. xyPosOnOff = fileData[7]
  1944. colorsOnOff = fileData[9]
  1945. hDetailLevel = fileData[11]
  1946. connection = fileData[13]
  1947. shName = fileData[14]
  1948. shScore = fileData[16]
  1949. shHUD = fileData[17]
  1950. optXYpos = fileData[19]
  1951. optColors = fileData[20]
  1952. optDetail = fileData[21]
  1953. optSHscore = fileData[22]
  1954. optConnection = fileData[23]
  1955. optgMode = fileData[24]
  1956. hAutoUpdate = fileData[27]
  1957. optAutoUpdate = fileData[28]
  1958. language = fileData[31]
  1959. optLang = fileData[32]
  1960. file.close()
  1961. end
  1962.  end
  1963.  
  1964.  
  1965. function checkSettings()
  1966.  
  1967. if not fs.exists(".gameData/themes/default") then
  1968. defaultColors()
  1969. end
  1970.  
  1971. if fs.exists(".gameData/themes/default") then
  1972. file = fs.open(".gameData/themes/default","r")
  1973. local fileData = {}
  1974. local line = file.readLine()
  1975. repeat
  1976. table.insert(fileData,line)
  1977. line = file.readLine()
  1978. until line == nil
  1979. file.close()
  1980.  
  1981. ttTextColor = fileData[2]
  1982.  
  1983. ttBackColor = fileData[5]
  1984.  
  1985. menuTextColor = fileData[8]
  1986.  
  1987. menuBackColor = fileData[11]
  1988. file.close()
  1989. end
  1990.  end
  1991.  
  1992.  
  1993.   --Start Updater
  1994.   loadSettings()
  1995.   checkSettings()
  1996.   if hAutoUpdate == "ON" then
  1997.   startUpdate = true
  1998.   update()
  1999.   dApi()
  2000.   startUpdate = false
  2001.   end
  2002.  
  2003.  
  2004.  
  2005.  
  2006.  
  2007.  
  2008. function drawSetCursor()
  2009. if colorsOnOff == "ON" then
  2010.  
  2011. term.setTextColor(menuTextColor)
  2012. term.setBackgroundColor(menuBackColor)
  2013.  
  2014. if posMode == "show" then
  2015. drawAt(3,sMenuStat,">")
  2016. term.setTextColor(colors.white)
  2017. term.setBackgroundColor(colors.black)
  2018.  
  2019. elseif posMode == "hide" then
  2020. drawAt(3,sMenuStat,"<")
  2021. term.setTextColor(colors.white)
  2022. term.setBackgroundColor(colors.black)
  2023.  
  2024. elseif posMode == "setOption" then
  2025. drawAt(3,sMenuStat,"*")
  2026. term.setTextColor(colors.white)
  2027. term.setBackgroundColor(colors.black)
  2028. end
  2029.  
  2030. elseif colorsOnOff == "OFF" then
  2031. if posMode == "show" then
  2032. drawAt(3,sMenuStat,">")
  2033.  
  2034. elseif posMode == "hide" then
  2035. drawAt(3,sMenuStat,"<")
  2036.  
  2037. elseif posMode == "setOption" then
  2038. drawAt(3,sMenuStat,"*")
  2039. end
  2040.  end
  2041.   end
  2042.  
  2043.  function enterCheatCode()
  2044.  --CHEATS
  2045.  
  2046. --QuickLeveling = You Earn 10000xp when winning a match
  2047. --InstaKill = Enemies Die/lose directly so you win
  2048. --GodMode = You Have Unlimited Health/Sta
  2049. --NoClip = You Can Walk Through Houses And Stuff
  2050. --SuperFreak = You Deal Insane Damage
  2051. --UnlimitedMoney = You Have Unlimited Money
  2052.  
  2053.  while true do
  2054.  cleanScreen()
  2055.   if colorsOnOff == "ON" then
  2056.  for i = 1, #setMenu do
  2057.    drawAt(1,i,setMenuCol[i])
  2058.    drawSetMenuExtra()
  2059.    drawPCart()
  2060.    term.setBackgroundColor(menuBackColor)
  2061.    term.setTextColor(menuTextColor)
  2062.    end
  2063.    
  2064.    elseif colorsOnOff == "OFF" then
  2065.    for i = 1, #setMenu do
  2066.    drawAt(1,i,setMenu[i])
  2067.    drawSetMenuExtra()
  2068.    drawPCart()
  2069.    end
  2070.     end
  2071.    
  2072.    
  2073.    drawAt(3,halfH,"CODE:")
  2074.  local input = read()
  2075.  if input == "ChuckNorrisFists" then
  2076.  cheatInstaKill = true
  2077.  print(" Cheat Code Entered!")
  2078.  sleep(2)
  2079.  return settingsMenu()
  2080.  
  2081.  elseif input == "KindaGODLIKE" then
  2082.  cheatGodMode = true
  2083.   print(" Cheat Code Entered!")
  2084.  sleep(2)
  2085.  return settingsMenu()
  2086.  
  2087.  elseif input == "FasterThenLightning" then
  2088.  cheatQuickLeveling = true
  2089.   print(" Cheat Code Entered!")
  2090.  sleep(2)
  2091.   return settingsMenu()
  2092.  
  2093.  elseif input == "ImSoooRich" then
  2094.  cheatUnlimitedMoney = true
  2095.   print(" Cheat Code Entered!")
  2096.  sleep(2)
  2097.    return settingsMenu()
  2098.    
  2099.  elseif input == "StupidFreakPowers" then
  2100.  cheatSuperFreak = true
  2101.   print(" Cheat Code Entered!")
  2102.  sleep(2)
  2103.   return settingsMenu()
  2104.  
  2105.  elseif input == "AreGhostsReal?" then
  2106.  cheatNoClip = true
  2107.   print(" Cheat Code Entered!")
  2108.  sleep(2)
  2109.   return settingsMenu()
  2110.  
  2111. else
  2112. print(" Unknown Cheat Code! ")
  2113. sleep(2)
  2114. return settingsMenu()
  2115.  end
  2116.   end
  2117.    end
  2118.  
  2119.  
  2120.  
  2121.  function setControls()
  2122.  
  2123.  setControlsNum = 1
  2124.  
  2125.  while true do
  2126.  cleanScreen()
  2127.  
  2128.  if setControlsNum > 4 then
  2129.  defaultControls = false
  2130.  return settingsMenu()
  2131.  end
  2132.  
  2133.  if colorsOnOff == "ON" then
  2134.  
  2135.  
  2136.  for i = 1, #setMenuCol do
  2137.    drawAt(1,i,setMenuCol[i])
  2138.    end
  2139.  term.setBackgroundColor(menuBackColor)
  2140.   cleanScreen()
  2141.  term.setTextColor(ttTextColor)
  2142. term.setBackgroundColor(ttBackColor)
  2143. drawAt(1,1,"                                                   ")
  2144. drawAt(1,2,"                 +---SETTINGS---+                  ")
  2145. drawAt(1,3,"                                                   ")
  2146. term.setBackgroundColor(colors.white)
  2147. term.setTextColor(colors.black)
  2148. drawAt(1,18,"                                                   ")
  2149. drawAt(1,19,"                                                   ")
  2150.  
  2151.  
  2152.  elseif colorsOnOff == "OFF" then
  2153.  
  2154.  for i = 1, #setMenu do
  2155.    drawAt(1,i,setMenu[i])
  2156.    end
  2157.    
  2158.  end
  2159.  
  2160.  
  2161.  
  2162.  
  2163.   if setControlsNum == 1 then
  2164.   centerPrint(halfH - 1,"UP BUTTON")
  2165.   centerPrint(halfH + 1," _ ")
  2166.   centerPrint(halfH + 2,"| |")
  2167.   centerPrint(halfH + 3,"+-+")
  2168.   term.setCursorPos(25,halfH + 2)
  2169.   upButton = modRead({textLength = 1})
  2170.   if #upButton > 0 then
  2171.   setControlsNum = setControlsNum + 1
  2172.   end
  2173.  
  2174.   elseif setControlsNum == 2 then
  2175.   centerPrint(halfH - 1,"LEFT BUTTON")
  2176.         centerPrint(halfH + 1," _ ")
  2177.   centerPrint(halfH + 2,"| |")
  2178.   centerPrint(halfH + 3,"+-+")
  2179.     term.setCursorPos(25,halfH + 2)
  2180.   leftButton = modRead({textLength = 1})
  2181.   if #leftButton > 0 then
  2182.   setControlsNum = setControlsNum + 1
  2183.   end
  2184.  
  2185.  
  2186.   elseif setControlsNum == 3 then
  2187.   centerPrint(halfH - 1,"DOWN BUTTON")
  2188.   centerPrint(halfH + 1," _ ")
  2189.   centerPrint(halfH + 2,"| |")
  2190.   centerPrint(halfH + 3,"+-+")
  2191.     term.setCursorPos(25,halfH + 2)
  2192.   downButton = modRead({textLength = 1})
  2193.   if #downButton > 0 then
  2194.   setControlsNum = setControlsNum + 1
  2195.   end
  2196.  
  2197.  
  2198.   elseif setControlsNum == 4 then
  2199.   centerPrint(halfH - 1,"RIGHT BUTTON")
  2200.   centerPrint(halfH + 1," _ ")
  2201.   centerPrint(halfH + 2,"| |")
  2202.   centerPrint(halfH + 3,"+-+")
  2203.     term.setCursorPos(25,halfH + 2)
  2204.   rightButton = modRead({textLength = 1})
  2205.   if #rightButton > 0 then
  2206.   setControlsNum = setControlsNum + 1
  2207.   end
  2208.   end
  2209.     end
  2210.       end
  2211.  
  2212.  
  2213.  
  2214.  
  2215.  
  2216.  function checkOptions()
  2217.  if language == "English" then
  2218. setOpt0 = {
  2219.  "GAME",
  2220.  "GRAPHICS",
  2221.  "CONTROLS",
  2222.  "NETWORK",
  2223.  "HUD",
  2224.  "ENTER CHEAT",
  2225.  "RESET",
  2226.  "UPDATE",
  2227.  }
  2228.  
  2229.  setOpt1 = {
  2230.  "GAME",
  2231.  "----------",
  2232.  "Hint Level:"..hintLevel.." ",
  2233.  "Subititles:"..subOnOff.." ",
  2234.  "Mode:"..gameMode.." ",
  2235.  "Language:"..language.." ",
  2236.  "----------",
  2237.  "GRAPHICS",
  2238.  "CONTROLS",
  2239.  "NETWORK",
  2240.  "HUD",
  2241.  "ENTER CHEAT",
  2242.  "RESET",
  2243.  "UPDATE",
  2244.  }
  2245.  
  2246.   setOpt2 = {
  2247.  "GAME",
  2248.  "GRAPHICS",
  2249.  "----------",
  2250.  "Show X/Y Pos:"..xyPosOnOff.." ",
  2251.  "Colors:"..colorsOnOff.." ",
  2252.  "Detail Level:"..hDetailLevel.." ",
  2253.  "----------",
  2254.  "CONTROLS",
  2255.  "NETWORK",
  2256.  "HUD",
  2257.  "ENTER CHEAT",
  2258.  "RESET",
  2259.  "UPDATE",
  2260.  }
  2261.  
  2262.  
  2263.   setOpt3 = {
  2264.  "GAME",
  2265.  "GRAPHICS",
  2266.  "CONTROLS",
  2267.  "----------",
  2268.  "Default Controls",
  2269.  "Set Controls",
  2270.  "----------",
  2271.  "NETWORK",
  2272.  "HUD",
  2273.  "ENTER CHEAT",
  2274.  "RESET",
  2275.  "UPDATE",
  2276.  }
  2277.  
  2278.    setOpt4 = {
  2279.  "GAME",
  2280.  "GRAPHICS",
  2281.  "CONTROLS",
  2282.  "NETWORK",
  2283.  "----------",
  2284.  "Connection:"..connection.." ",
  2285.  "Show Name:"..shName.." ",
  2286.  "Auto Update:"..hAutoUpdate.." ",
  2287.  "----------",
  2288.  "HUD",
  2289.  "ENTER CHEAT",
  2290.  "RESET",
  2291.  "UPDATE",
  2292.  }
  2293.  
  2294.   setOpt5 = {
  2295.  "GAME",
  2296.  "GRAPHICS",
  2297.  "CONTROLS",
  2298.  "NETWORK",
  2299.  "HUD",
  2300.  "----------",
  2301.  "Show Score:"..shScore.." ",
  2302.  "Show HUD:"..shHUD.." ",
  2303.  "----------",
  2304.  "ENTER CHEAT",
  2305.  "RESET",
  2306.  "UPDATE",
  2307.  }
  2308.  
  2309.  
  2310.  
  2311.  
  2312.  --SWEDISH
  2313.  --SVENSKA
  2314.  elseif language == "Swedish" then
  2315.  setOpt0 = {
  2316.  "SPEL",
  2317.  "GRAFIKER",
  2318.  "KONTROLLER",
  2319.  "NÄTVERK",
  2320.  "HUD",
  2321.  "ANGE FUSKKOD",
  2322.  "ÅTERSTÄLL",
  2323.  "UPPDATERA",
  2324.  }
  2325.  
  2326.  setOpt1 = {
  2327.  "SPEL",
  2328.  "----------",
  2329.  "Tips nivå:"..hintLevel.." ",
  2330.  "Undertexter:"..subOnOff.." ",
  2331.  "Spel-läge:"..gameMode.." ",
  2332.  "Språk:"..language.." ",
  2333.  "----------",
  2334.  "GRAFIKER",
  2335.  "KONTROLLER",
  2336.  "NÄTVERK",
  2337.  "HUD",
  2338.  "ANGE FUSKKOD",
  2339.  "ÅTERSTÄLL",
  2340.  "UPPDATERA",
  2341.  }
  2342.  
  2343.   setOpt2 = {
  2344.  "SPEL",
  2345.  "GRAFIKER",
  2346.  "----------",
  2347.  "Visa X/Y Positon:"..xyPosOnOff.." ",
  2348.  "Färger:"..colorsOnOff.." ",
  2349.  "Detalj nivå:"..hDetailLevel.." ",
  2350.  "----------",
  2351.  "KONTROLLER",
  2352.  "NÄTVERK",
  2353.  "HUD",
  2354.  "ANGE FUSKKOD",
  2355.  "ÅTERSTÄLL",
  2356.  "UPPDATERA",
  2357.  }
  2358.  
  2359.  
  2360.   setOpt3 = {
  2361.  "SPEL",
  2362.  "GRAFIKER",
  2363.  "KONTROLLER",
  2364.  "----------",
  2365.  "Förvalda kontroller",
  2366.  "Ställ in kontroller",
  2367.  "----------",
  2368.  "NÄTVERK",
  2369.  "HUD",
  2370.  "ANGE FUSKKOD",
  2371.  "ÅTERSTÄLL",
  2372.  "UPPDATERA",
  2373.  }
  2374.  
  2375.    setOpt4 = {
  2376.  "SPEL",
  2377.  "GRAFIKER",
  2378.  "KONTROLLER",
  2379.  "NÄTVERK",
  2380.  "----------",
  2381.  "Anslutning:"..connection.." ",
  2382.  "Visa namn:"..shName.." ",
  2383.  "Auto uppdatering:"..hAutoUpdate.." ",
  2384.  "----------",
  2385.  "HUD",
  2386.  "ANGE FUSKKOD",
  2387.  "ÅTERSTÄLL",
  2388.  "UPPDATERA",
  2389.  }
  2390.  
  2391.   setOpt5 = {
  2392.  "SPEL",
  2393.  "GRAFIKER",
  2394.  "KONTROLLER",
  2395.  "NÄTVERK",
  2396.  "HUD",
  2397.  "----------",
  2398.  "Visa poäng:"..shScore.." ",
  2399.  "Visa HUD:"..shHUD.." ",
  2400.  "----------",
  2401.  "ANGE FUSKKOD",
  2402.  "ÅTERSTÄLL",
  2403.  "UPPDATERA",
  2404.  }
  2405.  end
  2406.  
  2407.  
  2408.  
  2409.  if setOpt == "Nothing" then
  2410.  minStat = 5
  2411.  maxStat = 12
  2412.  disabled = false
  2413.  
  2414.  for i = 1, #setOpt0 do
  2415.   drawAt(4,i + 4,setOpt0[i])
  2416.   end
  2417.  
  2418.   elseif setOpt == "Game" then
  2419.   minStat = 6
  2420.   maxStat = 10
  2421.  for i = 1, #setOpt1 do
  2422.   drawAt(4,i + 4,setOpt1[i])
  2423.   end
  2424.  
  2425.   elseif setOpt == "Graphics" then
  2426.     minStat = 7
  2427.   maxStat = 10
  2428.  for i = 1, #setOpt2 do
  2429.   drawAt(4,i + 4,setOpt2[i])
  2430.   end
  2431.  
  2432.   elseif setOpt == "Controls" then
  2433.     minStat = 8
  2434.   maxStat = 10
  2435.  for i = 1, #setOpt3 do
  2436.   drawAt(4,i + 4,setOpt3[i])
  2437.   end
  2438.  
  2439.   elseif setOpt == "Network" then
  2440.     minStat = 9
  2441.   maxStat = 12
  2442.  for i = 1, #setOpt4 do
  2443.   drawAt(4,i + 4,setOpt4[i])
  2444.   end
  2445.  
  2446.   elseif setOpt == "Hud" then
  2447.     minStat = 10
  2448.   maxStat = 12
  2449.  for i = 1, #setOpt5 do
  2450.   drawAt(4,i + 4,setOpt5[i])
  2451.   end
  2452.    end
  2453.     end
  2454.  
  2455.  
  2456. function drawSetMenuExtra()
  2457. if colorsOnOff == "ON" then
  2458. term.setTextColor(ttTextColor)
  2459. term.setBackgroundColor(ttBackColor)
  2460. drawAt(1,1,"                                                   ")
  2461. drawAt(1,2,"                 +---SETTINGS---+                  ")
  2462. drawAt(1,3,"                                                   ")
  2463. term.setBackgroundColor(colors.white)
  2464. term.setTextColor(colors.black)
  2465. drawAt(1,18,"                                                   ")
  2466. drawAt(1,19,"                                                   ")
  2467.  
  2468.  
  2469. elseif colorsOnOff == "OFF" then
  2470. drawAt(1,1,"+-------------------------------------------------+")
  2471. drawAt(1,2,"|                +---SETTINGS---+                 |")
  2472. drawAt(1,3,"+-------------------------------------------------+")
  2473. drawAt(1,18,"+-------------------------------------------------+")
  2474.  end
  2475.   end
  2476.  
  2477.  function drawPCart()
  2478.  if colorsOnOff == "OFF" then
  2479.  drawAt(26,5,"  _________")
  2480.  drawAt(26,6," |.-------.|")
  2481.  drawAt(26,7," ||       ||")
  2482.  drawAt(26,8," ||_______||")
  2483.  drawAt(26,9," '---------'   __")
  2484.  drawAt(26,10,"  '-------'  _[__]")
  2485.  drawAt(26,11,"( [_______] |-==-|")
  2486.  drawAt(26,12," )'=======' '--,-',")
  2487.  drawAt(26,13,"(.------------.)  ) ")
  2488.  drawAt(26,14," ||#######||#||  [^]")
  2489.  drawAt(26,15," '------------'  ")
  2490.  
  2491.  elseif colorsOnOff == "ON" then
  2492.  term.setBackgroundColor(colors.gray)
  2493.  drawAt(27,5,"           ")
  2494.  
  2495.  
  2496.   drawAt(27,6," ")
  2497.  drawAt(37,6," ")
  2498.   term.setBackgroundColor(colors.black)
  2499.   drawAt(28,6,"         ")
  2500.  
  2501.    term.setBackgroundColor(colors.gray)
  2502.  drawAt(27,7," ")
  2503.  drawAt(37,7," ")
  2504.  
  2505.  term.setBackgroundColor(colors.black)
  2506.   drawAt(28,7,"         ")
  2507.  
  2508.   term.setBackgroundColor(colors.gray)
  2509.   drawAt(27,8," ")
  2510.  drawAt(37,8," ")
  2511.  
  2512.   term.setBackgroundColor(colors.black)
  2513.   drawAt(28,8,"         ")
  2514.  
  2515.     term.setBackgroundColor(colors.gray)
  2516.  
  2517. drawAt(27,9,"           ")
  2518. term.setTextColor(colors.black)
  2519.  drawAt(28,10,"'-------'  _[__]")
  2520.  drawAt(28,11,"[_______] |-==-|")
  2521.  drawAt(28,12,"'=======' '--,-'")
  2522.  drawAt(27,13,".------------.)  )")
  2523.  drawAt(27,14,"||#######||#||  [^]")
  2524.  drawAt(27,15,"'------------'")
  2525.  
  2526.  term.setBackgroundColor(colors.black)
  2527.  term.setTextColor(colors.white)
  2528.  end
  2529.   end
  2530.  
  2531.  
  2532. function drawSettingsMenuArt()
  2533. setMenu = {
  2534. "+-------------------------------------------------+",
  2535. "|                +---SETTINGS---+                 |",
  2536. "+-------------------------------------------------+",
  2537. "|                                                 |",
  2538. "|                                                 |",
  2539. "|                                                 |",
  2540. "|                                                 |",
  2541. "|                                                 |",
  2542. "|                                                 |",
  2543. "|                                                 |",
  2544. "|                                                 |",
  2545. "|                                                 |",
  2546. "|                                                 |",
  2547. "|                                                 |",
  2548. "|                                                 |",
  2549. "|                                                 |",
  2550. "|                                                 |",
  2551. "+-------------------------------------------------+",
  2552. }
  2553.  
  2554. setMenuCol = {
  2555. "+-------------------------------------------------+",
  2556. "|                +---SETTINGS---+                 |",
  2557. "+-------------------------------------------------+",
  2558. "                                                   ",
  2559. "                                                   ",
  2560. "                                                   ",
  2561. "                                                   ",
  2562. "                                                   ",
  2563. "                                                   ",
  2564. "                                                   ",
  2565. "                                                   ",
  2566. "                                                   ",
  2567. "                                                   ",
  2568. "                                                   ",
  2569. "                                                   ",
  2570. "                                                   ",
  2571. "                                                   ",
  2572. "                                                   ",
  2573. "                                                   ",
  2574. }
  2575.  
  2576. for i = 1, #setMenu do
  2577.    if colorsOnOff == "ON" then
  2578.    term.setBackgroundColor(menuBackColor)
  2579.    term.setTextColor(menuTextColor)
  2580.    drawAt(1,i,setMenuCol[i])
  2581.    checkOptions()
  2582.    drawSetMenuExtra()
  2583.    drawPCart()
  2584.    
  2585.    elseif colorsOnOff == "OFF" then
  2586.    drawAt(1,i,setMenu[i])
  2587.    checkOptions()
  2588.    drawSetMenuExtra()
  2589.    drawPCart()
  2590.     end
  2591.      end
  2592.       end
  2593.      
  2594.    
  2595.  
  2596.  
  2597. function setMenuEvents()
  2598. if setOpt ~= "Nothing" then
  2599. disabled = true
  2600. end
  2601. if setOpt ~= "Nothing" and
  2602. sMenuStat ~= minStat then
  2603. posMode = "setOption"
  2604.  
  2605. elseif setOpt ~= "Nothing" and
  2606. sMenuStat == minStat then
  2607. posMode = "hide"
  2608.  
  2609. elseif setOpt == "Nothing" then
  2610. posMode = "show"
  2611. end
  2612.  
  2613. drawSetCursor()
  2614. event, p1 = os.pullEvent()
  2615. if event == "key" and
  2616.  
  2617. --UP
  2618. p1 == 200 then
  2619. sMenuStat = sMenuStat - 1
  2620. if sMenuStat < minStat then
  2621. sMenuStat = minStat
  2622. end
  2623.  
  2624. --DOWN
  2625. elseif p1 == 208 then
  2626. sMenuStat = sMenuStat + 1
  2627. if sMenuStat > maxStat then
  2628. sMenuStat = maxStat
  2629. end
  2630.  
  2631. --BACKSPACE
  2632. elseif p1 == 14 then
  2633. checkSettings()
  2634. saveSettings()
  2635. checkSettings()
  2636. return menu()
  2637.  
  2638.  
  2639. --ENTER
  2640. elseif p1 == 28 then
  2641. -------------------------------------------------
  2642. --GAME SETTINGS
  2643. if setOpt == "Game" and
  2644.  sMenuStat == 9 then --Game Mode
  2645.   optgMode = optgMode + 1
  2646.    if optgMode > 2 then
  2647.    optgMode = 1
  2648.    end
  2649.    
  2650.    if optgMode == 1 then
  2651.    gameMode = "Command"
  2652.    
  2653.    elseif optgMode == 2 then
  2654.    gameMode = "GUI"
  2655.     end
  2656.    
  2657.    
  2658.     elseif sMenuStat == 10 then
  2659.     if disabled then
  2660.     if setOpt == "Game" then
  2661.     optLang = optLang + 1
  2662.      if optLang > 3 then
  2663.      optLang = 1
  2664.      end
  2665.        end
  2666.      end
  2667.      
  2668.      if optLang == 1 then
  2669.      language = "English"
  2670.      
  2671.        elseif optLang == 2 then
  2672.        language = "Swedish"
  2673.        
  2674.       elseif optLang == 3 then
  2675.        language = "Norwegian"
  2676.       end
  2677.     end  
  2678.    
  2679. --GRAPHIC SETTINGS
  2680. --X/Y Pos
  2681. if setOpt == "Graphics" and
  2682.  sMenuStat == 8 then
  2683.   optXYpos = optXYpos + 1
  2684.   if optXYpos > 2 then
  2685.    optXYpos = 1
  2686.    end
  2687.  
  2688.   if optXYpos == 1 then  
  2689.    xyPosOnOff = "ON"
  2690.    
  2691.    elseif optXYpos == 2 then
  2692.     xyPosOnOff = "OFF"
  2693.    end  
  2694.   end
  2695.  
  2696. --Colors
  2697. if setOpt == "Graphics" and
  2698.  sMenuStat == 9 then
  2699.   optColors = optColors + 1
  2700.   if optColors > 2 then
  2701.    optColors = 1
  2702.    end
  2703.  
  2704.   if optColors == 1 then
  2705.    if not term.isColor() then
  2706.     print("Error; Advanced Computer Required.")
  2707.     sleep(2)
  2708.     optColors = 2
  2709.     return
  2710.     elseif term.isColor() then
  2711.     colorsOnOff = "ON"
  2712.     end
  2713.      
  2714.    
  2715.    elseif optColors == 2 then
  2716.     colorsOnOff = "OFF"
  2717.    end
  2718.      end  
  2719.  
  2720.  
  2721. --Detail Level
  2722. if setOpt == "Graphics" and
  2723.  sMenuStat == 10 then
  2724.   optDetail = optDetail + 1
  2725.   if optDetail > 4 then
  2726.    optDetail = 1
  2727.    end
  2728.  
  2729.   if optDetail == 1 then  
  2730.    hDetailLevel = "LOW"
  2731.    
  2732.    elseif optDetail == 2 then
  2733.     hDetailLevel = "NORMAL"
  2734.    
  2735.     elseif optDetail == 3 then
  2736.     hDetailLevel = "HIGH"
  2737.    
  2738.     elseif optDetail == 4 then
  2739.     hDetailLevel = "EXTREME"
  2740.    end  
  2741.   end
  2742.  
  2743. --HUD SETTINGS
  2744. if setOpt == "Hud" and
  2745.  sMenuStat == 11 then
  2746.   optSHscore = optSHscore + 1
  2747.   if optSHscore > 2 then
  2748.    optSHscore = 1
  2749.    end
  2750.  
  2751.   if optSHscore == 1 then  
  2752.    shScore = "ON"
  2753.    
  2754.    elseif optSHscore == 2 then
  2755.     shScore = "OFF"
  2756.    end  
  2757.   end
  2758.  
  2759. --NETWORK/CONNECTION SETTINGS  
  2760.  if setOpt == "Network" then
  2761.  if disabled and
  2762.  sMenuStat == 10 then
  2763.   optConnection = optConnection + 1
  2764.   if optConnection > 3 then
  2765.    optConnection = 0
  2766.    end
  2767.  
  2768.   if optConnection == 0 then  
  2769.    connection = "NONE"
  2770.    
  2771.    elseif optConnection == 1 then
  2772.     connection = "GLOBAL"
  2773.    
  2774.     elseif optConnection == 2 then
  2775.     connection = "PRIVATE"
  2776.    
  2777.     elseif optConnection == 3 then
  2778.     connection = "LAN"
  2779.    end
  2780.  
  2781.    elseif sMenuStat == 12 then
  2782.    if disabled then
  2783.     optAutoUpdate = optAutoUpdate + 1
  2784.     if optAutoUpdate > 2 then
  2785.  optAutoUpdate = 1
  2786.         end
  2787.        
  2788.  if optAutoUpdate == 1 then
  2789.    hAutoUpdate = "OFF"
  2790.    
  2791. elseif optAutoUpdate == 2 then
  2792.  hAutoUpdate = "ON"    
  2793.   end
  2794.    end
  2795.     end
  2796.      end
  2797.  
  2798.  --NETWORK NAME SETTINGS  
  2799.  
  2800. -------------------------------------------------
  2801. --CONTROL SETTINGS
  2802. --Default
  2803. if setOpt == "Controls" and
  2804.  sMenuStat == 9 then
  2805.   defaultControls = true
  2806.   if colorsOnOff == "ON" then
  2807.   term.setBackgroundColor(menuBackColor)
  2808.   term.setTextColor(menuTextColor)
  2809.   end
  2810.   write(" Controls Reset! ")
  2811.   sleep(1)
  2812.   cleanScreen()
  2813.    end
  2814.    
  2815.   if setOpt == "Controls" and
  2816.  sMenuStat == 10 then
  2817.   setControls()
  2818.    end
  2819.      
  2820.  
  2821. -------------------------------------------------
  2822.  
  2823. if setOpt ~= "Nothing" then
  2824. if sMenuStat == minStat then
  2825. setOpt = "Nothing"
  2826. sMenuStat = sMenuStat - 1
  2827. end
  2828.   end
  2829.  
  2830. if sMenuStat == 5 then
  2831. if disabled == false then
  2832. firstTime = true
  2833. posMode = "hide"
  2834. setOpt = "Game"
  2835.  
  2836. if firstTime then
  2837. checkOptions()
  2838. sMenuStat = minStat
  2839. firstTime = false
  2840. end
  2841. end
  2842.  
  2843.  
  2844.  
  2845. elseif sMenuStat == 6 then
  2846. if disabled == false then
  2847. firstTime = true
  2848. posMode = "hide"
  2849. setOpt = "Graphics"
  2850.  
  2851. if firstTime then
  2852. checkOptions()
  2853. sMenuStat = minStat
  2854. firstTime = false
  2855. end
  2856. end
  2857.  
  2858.  
  2859. elseif sMenuStat == 7 then
  2860. if disabled == false then
  2861. firstTime = true
  2862. posMode = "hide"
  2863. setOpt = "Controls"
  2864.  
  2865. if firstTime then
  2866. checkOptions()
  2867. sMenuStat = minStat
  2868. firstTime = false
  2869. end
  2870. end
  2871.  
  2872.  
  2873.  
  2874. elseif sMenuStat == 8 then
  2875. if disabled == false then
  2876. firstTime = true
  2877. posMode = "hide"
  2878. setOpt = "Network"
  2879.  
  2880. if firstTime then
  2881. checkOptions()
  2882. sMenuStat = minStat
  2883. firstTime = false
  2884. end
  2885. end
  2886.  
  2887.  
  2888. elseif sMenuStat == 9 then
  2889. if disabled == false then
  2890. firstTime = true
  2891. posMode = "hide"
  2892. setOpt = "Hud"
  2893.  
  2894. if firstTime then
  2895. checkOptions()
  2896. sMenuStat = minStat
  2897. firstTime = false
  2898. end
  2899. end
  2900.  
  2901.  
  2902. elseif sMenuStat == 10 then
  2903. if disabled == false then
  2904. checkSettings()
  2905. saveSettings()
  2906. checkSettings()
  2907. enterCheatCode()
  2908. end
  2909.  
  2910.  
  2911. elseif sMenuStat == 11 then
  2912. if disabled == false then
  2913. write("Settings Reset!")
  2914. sleep(1)
  2915. fs.delete(".gameData/settings/cfg")
  2916. defaultSettings()
  2917. end
  2918.  
  2919.  
  2920. elseif sMenuStat == 12 then
  2921. if disabled == false then
  2922. if colorsOnOff == "OFF" then
  2923. write("Trying to update..")
  2924. checkSettings()
  2925. saveSettings()
  2926. checkSettings()
  2927.  
  2928. elseif colorsOnOff == "ON" then
  2929. term.setTextColor(menuTextColor)
  2930. term.setBackgroundColor(menuBackColor)
  2931. write("Trying to update..")
  2932. checkSettings()
  2933. saveSettings()
  2934. checkSettings()
  2935. end
  2936.  
  2937. sleep(1)
  2938.  update()
  2939.  end
  2940.  
  2941.   end
  2942.    end
  2943.     end
  2944.    
  2945.  
  2946.  
  2947.  
  2948.  
  2949.  
  2950.  
  2951.  
  2952.  
  2953.  
  2954.  
  2955.  
  2956.  
  2957.  
  2958.  
  2959.  
  2960.  
  2961.  
  2962.  
  2963.  
  2964. function settingsMenu()
  2965. setOpt = "Nothing"
  2966. posMode = "show"
  2967. minStat = 5
  2968. maxStat = 10
  2969. sMenuStat = 5
  2970. settingsNum = 0
  2971. loadSettings()
  2972. while true do
  2973. cleanScreen()
  2974. drawSettingsMenuArt()
  2975. setMenuEvents()
  2976. checkOptions()
  2977. end
  2978.  end
  2979.  
  2980. ---------------------------------------------------------------------------------------------------
  2981. --MAP SECTION
  2982. ---------------------------------------------------------------------------------------------------
  2983.  
  2984. function drawHUD()
  2985. if xyPosOnOff == "ON" then
  2986. if colorsOnOff == "OFF" then
  2987. drawAt(39,19,"+ X:"..x.." Y:"..y.." +")
  2988.  
  2989. elseif colorsOnOff == "ON" then
  2990. term.setTextColor(colors.white)
  2991. term.setBackgroundColor(colors.lightGray)
  2992. drawAt(1,19,"                                      + X:"..x.." Y:"..y.." +         ")
  2993. term.setBackgroundColor(colors.black)
  2994. term.setTextColor(colors.white)
  2995. end
  2996.  end
  2997.   end
  2998.                                      
  2999.  
  3000.  
  3001.  
  3002.  
  3003. ---------------------------------------------------------------------------------------------------
  3004. --TreadMill
  3005. ---------------------------------------------------------------------------------------------------
  3006.  
  3007. wButton = true
  3008. tMode = 1
  3009. p = 0
  3010. tm = 100
  3011. btn = "W"
  3012.  
  3013. treadMill1 = {
  3014. "                                                  ",
  3015. "                                                  ",
  3016. "                                                  ",
  3017. "                                                  ",
  3018. "                       ___                        ",
  3019. "                      |  .|                       ",
  3020. "                      |__-|                       ",
  3021. "                       | |                        ",
  3022. "                       | |      __                ",
  3023. "                       |=|        |               ",
  3024. "                       |_|        |               ",
  3025. "                       | |        |               ",                                                  
  3026. "                       |_|        |               ",
  3027. "                       |_|        |               ",
  3028. "              |=-=-=-=-=-=-=-=-=-=|               ",
  3029. "               -------------------                ",
  3030. "--------------------------------------------------",
  3031. }
  3032.  
  3033. treadMill2 = {
  3034. "                                                  ",
  3035. "                                                  ",
  3036. "                                                  ",
  3037. "                                                  ",
  3038. "                       ___                        ",
  3039. "                      |  .|                       ",
  3040. "                      |__-|                       ",
  3041. "                       | |   =                    ",
  3042. "                      /|  \\/ /  __                ",
  3043. "                     / | \\__/     |               ",
  3044. "                      \\|_|____    |               ",
  3045. "                       /|_____|   |               ",                                                  
  3046. "                      /_/   |_|   |               ",
  3047. "                     |_|          |               ",
  3048. "              |-=-=-=-=-=-=-=-=-=-|               ",
  3049. "               -------------------                ",
  3050. "--------------------------------------------------",
  3051. }
  3052.  
  3053. treadMill3 = {
  3054. "                                                  ",
  3055. "                                                  ",
  3056. "                                                  ",
  3057. "                                                  ",
  3058. "                       ___                        ",
  3059. "                      |  .|                       ",
  3060. "                      |__-|                       ",
  3061. "                       | |                        ",
  3062. "                       | |      __                ",
  3063. "                       |=|        |               ",
  3064. "                       |_|        |               ",
  3065. "                       | |        |               ",                                                  
  3066. "                       |_|        |               ",
  3067. "                       |_|        |               ",
  3068. "              |=-=-=-=-=-=-=-=-=-=|               ",
  3069. "               -------------------                ",
  3070. "--------------------------------------------------",
  3071. }
  3072.  
  3073. treadMill4 = {
  3074. "                                                  ",
  3075. "                                                  ",
  3076. "                                                  ",
  3077. "                                                  ",
  3078. "                       ___                        ",
  3079. "                      |  .|                       ",
  3080. "                      |__-|                       ",
  3081. "                       | |   =                    ",
  3082. "                      /  |\\/ /  __                ",
  3083. "                     / / |\\_/     |               ",
  3084. "                      \\=_|____    |               ",
  3085. "                       / /____|   |               ",                                                  
  3086. "                      /_/   |_|   |               ",
  3087. "                     |_|          |               ",
  3088. "              |-=-=-=-=-=-=-=-=-=-|               ",
  3089. "               -------------------                ",
  3090. "--------------------------------------------------",
  3091. }
  3092.  
  3093. ---------------------------------------------------------------------------------------------------
  3094. function drawTreadMill()
  3095.  
  3096. if tMode > 4 then
  3097. tMode = 1
  3098. end
  3099. if tMode == 1 then
  3100. for i = 1, #treadMill1 do
  3101.         drawAt(1,i,treadMill1[i])
  3102.         end
  3103. elseif tMode == 2 then
  3104. for i = 1, #treadMill2 do
  3105.         drawAt(1,i,treadMill2[i])
  3106.         end
  3107.  elseif tMode == 3 then
  3108. for i = 1, #treadMill3 do
  3109.         drawAt(1,i,treadMill3[i])
  3110.         end
  3111.     elseif tMode == 4 then
  3112. for i = 1, #treadMill4 do
  3113.         drawAt(1,i,treadMill4[i])
  3114.         end
  3115. end
  3116.  end
  3117. function drawStats()
  3118. if p < 1 then
  3119. mtr = 0
  3120. end
  3121. if p >= 10 then
  3122. mtr = 1
  3123. end
  3124. if p >= 20 then
  3125. mtr = 2
  3126. end
  3127. if p >= 30 then
  3128. mtr = 3
  3129. end
  3130. if p >= 40 then
  3131. mtr = 4
  3132. end
  3133. if p >= 50 then
  3134. mtr = 5
  3135. end
  3136. if p >= 60 then
  3137. mtr = 6
  3138. end
  3139. if p >= 70 then
  3140. mtr = 7
  3141. end
  3142. if p >= 80 then
  3143. mtr = 8
  3144. end
  3145. if p >= 90 then
  3146. mtr = 9
  3147. end
  3148. if p >= 100 then
  3149. mtr = 10
  3150. end
  3151.  
  3152. if btnNum == 1 then
  3153. btn = "W"
  3154. elseif btnNum == 2 then
  3155. btn = "D"
  3156. end
  3157. drawAt(1,18,"Button:"..btn.." "..p..":"..tm)
  3158. drawAt(1,19,"|")
  3159. drawAt(12,19,"|")
  3160. drawAt(2 + mtr,19,"=")
  3161. end
  3162.  
  3163.  
  3164. function hWButton()
  3165. btnNum = 2
  3166. while true do
  3167. event, button = os.pullEvent()
  3168. if event == "char" and
  3169. button == "w" then
  3170. dButton = true
  3171. wButton = false
  3172. tMode = tMode + 1
  3173. p = p + 1
  3174. sleep(0)
  3175. return treadMill()
  3176.  end
  3177. end
  3178.  end
  3179.  
  3180.  
  3181.  function hDButton()
  3182.  btnNum = 1
  3183. while true do
  3184.   event, button = os.pullEvent()
  3185.  if event == "char" and
  3186.  button == "d" then
  3187.  wButton = true
  3188.  dButton = false
  3189.  tMode = tMode + 1
  3190.  p = p + 1
  3191.  sleep(0)
  3192. return treadMill()
  3193.  end
  3194.  end
  3195.   end
  3196.  
  3197.  
  3198.  function treadMill()
  3199.  while true do
  3200.  
  3201.  if p >= tm then
  3202.  term.clear()
  3203.  term.setCursorPos(1,1)
  3204.   xp = xp + trainXp
  3205. sta = sta - 10
  3206. day = day + 1
  3207. mbrshipDay = mbrshipDay - 1
  3208. print("EARNED:"..trainXp)
  3209. print("XP:"..xp)
  3210. sleep(2)
  3211.   return inGym()
  3212.  end
  3213.  
  3214.  term.clear()
  3215.  term.setCursorPos(1,1)
  3216. drawTreadMill()
  3217. drawStats()
  3218.  if wButton then
  3219.  hWButton()
  3220.  end
  3221.  if dButton then
  3222.  hDButton()
  3223.  end
  3224.   end
  3225.    end
  3226.  
  3227.  
  3228.  
  3229.  
  3230.  
  3231.  
  3232.  
  3233.  
  3234. function checkMoney()
  3235. price = 3000
  3236. if money < price then
  3237.  cleanScreen()
  3238.  term.setCursorPos(10,10)
  3239.   print("Not Enough Money!")
  3240.                    end
  3241.     if money >= price then
  3242.     mbrshipDay = mbrshipDay + 30
  3243.        money = money - 3000
  3244.     print("Membership Days Increased By 30 days")
  3245.                      end
  3246.                        end
  3247.                      
  3248. function checkTrain()
  3249. trainXp = 300
  3250. if hp == 0 or sta == 0 then
  3251. cleanScreen()
  3252. term.setCursorPos(10,10)
  3253. print("Need To Rest First!")
  3254. sleep(1)
  3255. return
  3256. end
  3257. if mbrshipDay == 0 then
  3258. cleanScreen()
  3259. term.setCursorPos(2,10)
  3260. print("You don't have any days left on Your Membership!")
  3261. sleep(1)
  3262. return
  3263. end
  3264. if hp > 0 then if
  3265. sta > 0 then
  3266. if mbrshipDay > 0 then
  3267. treadMill()
  3268.  end
  3269.   end
  3270.    end
  3271.     end
  3272.  
  3273.    
  3274. local map1 = {
  3275. " _________________________________________________  ",  
  3276. "/                                                 \\",  
  3277. "|                                                 |",  
  3278. "|                                                 |",  
  3279. "|                                                 |",  
  3280. "|                                                 |",  
  3281. "|                  **|  |**                       |",  
  3282. "|   **|  |**         |  |                         |",  
  3283. "|     |  |           |  |                         |",  
  3284. "|     \\  \\-----------|  |----------------         |",  
  3285. "|      \\____________________________    /         |",  
  3286. "|                                   /  /          |",  
  3287. "|                                  /  /           |",  
  3288. "|                                 /  /            |", --X:41 Y:14  
  3289. "|              **       **       /  /             |",  
  3290. "|    ---------------------------/  /              |",  
  3291. "|   |_____________________________/               |",  
  3292. "\\_________________________________________________/"  
  3293. }
  3294.  
  3295. local map1L = {
  3296. " _________________________________________________  ",  
  3297. "/                                                 \\",  
  3298. "|                                                 |",  
  3299. "|                                                 |",  
  3300. "|                                                 |",  
  3301. "|                                                 |",  
  3302. "|                    |  |                         |",  
  3303. "|     |  |           |  |                         |",  
  3304. "|     |  |           |  |                         |",  
  3305. "|     \\  \\-----------|  |----------------         |",  
  3306. "|      \\____________________________    /         |",  
  3307. "|                                   /  /          |",  
  3308. "|                                  /  /           |",  
  3309. "|                                 /  /            |", --X:41 Y:14  
  3310. "|                                /  /             |",  
  3311. "|    ---------------------------/  /              |",  
  3312. "|   |_____________________________/               |",  
  3313. "\\_________________________________________________/"  
  3314. }
  3315.  
  3316.  
  3317. local mallInterior = {
  3318. " _________________________________________________  ",  
  3319. "/\\         ___                 ___               /\\",  
  3320. "| \\_______\\.../_______________\\.../_____________/ |",  
  3321. "|  |                                           |  |",  
  3322. "|  |                                           |  |",  
  3323. "|  |                                           |  |",  
  3324. "|  |                                           |  |",  
  3325. "|  |                                           |  |",  
  3326. "|  |                                           |  |",  
  3327. "|  |                                           |  |",  
  3328. "|  |                                           |  |",  
  3329. "|  |                                           |  |",  
  3330. "|  |                                           |  |",  
  3331. "|  |                                           |  |",  
  3332. "|  |                                           |  |",  
  3333. "|  |_____________... ..._______________________|  |",  
  3334. "| /             /___|___\\                       \\ |",  
  3335. "\\/_______________________________________________\\/  "  
  3336. }
  3337.  
  3338.  
  3339. local mallInteriorCol = {
  3340. "\\                                                / ",  
  3341. " \\         ___                 ___              /  ",  
  3342. "  \\_______|   |_______________|   |____________/   ",  
  3343. "   |                                           |   ",  
  3344. "   |                                           |   ",  
  3345. "   |                                           |   ",  
  3346. "   |                                           |   ",  
  3347. "   |                                           |   ",  
  3348. "   |                                           |   ",  
  3349. "   |                                           |   ",  
  3350. "   |                                           |   ",  
  3351. "   |                                           |   ",  
  3352. "   |                                           |   ",  
  3353. "   |                                           |   ",  
  3354. "   |                                           |   ",  
  3355. "   |____________ ... ... ______________________|   ",  
  3356. "  /             |___|___|                       \\  ",  
  3357. "_/_______________________________________________\\_"  
  3358. }
  3359.  
  3360. local gymE = {
  3361. "   _____",
  3362. "  |_GYM_|",
  3363. " --------",
  3364. "|---__---|",
  3365. "|--|::|--|",
  3366. "'--------'"
  3367. }
  3368.  
  3369.  
  3370. local gymH = {
  3371. "   _____",
  3372. "  | GYM |",
  3373. " --------",
  3374. "|---__---|",
  3375. "|--|::|--|",
  3376. "'--------'"
  3377. }
  3378.  
  3379.  
  3380. local gym = {
  3381. "   _____",
  3382. "  | GYM |",
  3383. " --------",
  3384. "|---__---|",
  3385. "|--|::|--|",
  3386. " -------- "
  3387. }
  3388.  
  3389. local gymL = {
  3390. "   _____",
  3391. "  | GYM |",
  3392. " --------",
  3393. "|   __   |",
  3394. "|  |::|  |",
  3395. " -------- "
  3396. }
  3397.  
  3398.  
  3399.  
  3400. local home = {
  3401. " _____",
  3402. "/_____\\",
  3403. "|  _  |",
  3404. "| |:| |",
  3405. "-------"
  3406. }
  3407.  
  3408. local homeL = {
  3409. " _____",
  3410. "/     \\",
  3411. "|  _  |",
  3412. "| |:| |",
  3413. "-------"
  3414. }
  3415.  
  3416.  
  3417. local superMallHE = {
  3418. "_____________",
  3419. "|============|",
  3420. "|====MALL====|",
  3421. "--------------",
  3422. "|            |",
  3423. "|-----___----|",
  3424. "|____|:|:|___|",
  3425. "--------------"
  3426. }
  3427.  
  3428. local superMall = {
  3429. "_____________",
  3430. "|============|",
  3431. "|====MALL====|",
  3432. "--------------",
  3433. "|            |",
  3434. "|     ___    |",
  3435. "|____|:|:|___|",
  3436. "--------------"
  3437. }
  3438.  
  3439. local superMallL = {
  3440. "_____________",
  3441. "|            |",
  3442. "|    MALL    |",
  3443. "--------------",
  3444. "|            |",
  3445. "|     ___    |",
  3446. "|____|:|:|___|",
  3447. "--------------"
  3448. }
  3449.  
  3450. local hospital = {
  3451. "__________",
  3452. "| Hospital|",
  3453. "|_________|",
  3454. "|__|:|:|__|"
  3455. }
  3456.  
  3457. local hospitalL = {
  3458. "__________",
  3459. "| Hospital|",
  3460. "|   ___   |",
  3461. "|__|:|:|__|"
  3462. }
  3463.  
  3464.  
  3465. local gymMenuArt = {
  3466. " __________________________",
  3467. "|       --[[GYM]]--       |",
  3468. "|-------------------------|",
  3469. "|                         |",
  3470. "|                         |",
  3471. "|                         |",
  3472. "|                         |",
  3473. "|                         |",
  3474. "|                         |",
  3475. "|                         |",
  3476. "|                         |",
  3477. "|                         |",
  3478. "|                         |",
  3479. "|                         |",
  3480. "|                         |",
  3481. "|                         |",
  3482. "|                         |",
  3483. "|_________________________|"
  3484. }
  3485.  
  3486.  
  3487. local gymMenuArtCol = {
  3488. "                           ",
  3489. "        --[[GYM]]--        ",
  3490. "                           ",
  3491. "                           ",
  3492. "                           ",
  3493. "                           ",
  3494. "                           ",
  3495. "                           ",
  3496. "                           ",
  3497. "                           ",
  3498. "                           ",
  3499. "                           ",
  3500. "                           ",
  3501. "                           ",
  3502. "                           ",
  3503. "                           ",
  3504. "                           ",
  3505. "                           ",
  3506. "                           "
  3507. }
  3508.  
  3509. local gymOptions = {
  3510. "Buy/Extend Membership",  "Train", "Open Map"
  3511. }
  3512.  
  3513. -------------------------------------------------
  3514.  
  3515. function gymEvents()
  3516. event, p1 = os.pullEvent()
  3517. if event == "key" then
  3518. if p1 == 200
  3519. then
  3520. menuStat = menuStat - 1
  3521. if menuStat < 4 then
  3522. menuStat = 6
  3523. end
  3524. elseif p1 == 208 then
  3525.          menuStat = menuStat + 1
  3526.          if menuStat > 6 then
  3527.            menuStat = 4
  3528.            end
  3529.            elseif p1 == 28 then
  3530.     if menuStat == 4 then
  3531. cleanScreen()
  3532. checkMoney()
  3533.  sleep(2)
  3534.  return
  3535.  elseif menuStat == 5 then
  3536.    checkTrain()
  3537.  sleep(2)
  3538.  return
  3539. elseif menuStat == 6 then
  3540. if colorsOnOff == "OFF" then
  3541. map(lastXpos,lastYpos)
  3542.  
  3543. elseif colorsOnOff == "ON" then
  3544.   term.setBackgroundColor(colors.black)
  3545.   term.setTextColor(colors.white)
  3546.   map(lastXpos,lastYpos)
  3547.     end
  3548.   end
  3549.    end
  3550.   end
  3551.    end
  3552.          
  3553. -------------------------------------------------        
  3554.          
  3555.          
  3556.          
  3557. function gameEvents()
  3558. if defaultControls then
  3559. event, p1 = os.pullEvent()
  3560. if event == "char" and p1 == "a" then
  3561. x = x - 1
  3562. lastXpos = x + 1
  3563. lastYpos = y
  3564.  
  3565. elseif p1 == "d" then
  3566. x = x + 1
  3567. lastXpos = x - 1
  3568. lastYpos = y
  3569.  
  3570. elseif p1 == "s" then
  3571. y = y + 1
  3572. lastYpos = y - 1
  3573. lastXpos = x
  3574.  
  3575. elseif p1 == "w" then
  3576. y = y - 1
  3577. lastYpos = y + 1
  3578. lastXpos = x
  3579. end
  3580.  end
  3581.  
  3582.  if not defaultControls then
  3583. event, p1 = os.pullEvent()
  3584. if event == "char" and
  3585. p1 == leftButton then
  3586. x = x - 1
  3587. lastXpos = x + 1
  3588. lastYpos = y
  3589.  
  3590. elseif p1 == rightButton then
  3591. x = x + 1
  3592. lastXpos = x - 1
  3593. lastYpos = y
  3594.  
  3595. elseif p1 == downButton then
  3596. y = y + 1
  3597. lastYpos = y - 1
  3598. lastXpos = x
  3599.  
  3600. elseif p1 == upButton then
  3601. y = y - 1
  3602. lastYpos = y + 1
  3603. lastXpos = x
  3604. end
  3605.  end
  3606.  
  3607.   end
  3608. -------------------------------------------------
  3609.  
  3610. function checkMallPos()
  3611. --Checks If You Leave the Mall
  3612. if x == 18 or x == 19 or x == 20 then    
  3613. if y == 17 then
  3614. insMall = false
  3615. map(37,9)
  3616. end
  3617.  end
  3618. if x == 21 then
  3619. if y == 17 then
  3620. insMall = false
  3621. map(38,9)
  3622. end
  3623.  end
  3624. if x == 22 or x == 23 or x == 24 then
  3625. if y == 17 then
  3626. insMall = false
  3627. map(39,9)
  3628. end
  3629.  end
  3630. -------------------------------------------------
  3631.  
  3632. --Makes The Mall Solid
  3633. if y < 4 then
  3634. y = 4
  3635. end
  3636. if y > 16 then
  3637. y = 16
  3638. end
  3639. if x < 5 then
  3640. x = 5
  3641. end
  3642. if x > 47 then
  3643. x = 47
  3644. end
  3645. end
  3646. -------------------------------------------------
  3647. function checkHealth()
  3648. if sta < 1 then
  3649. sta = 0
  3650. end
  3651. half = tHP / 2
  3652. oFour = tHP / 4
  3653. tFour = tHP / 4 * 3
  3654.  
  3655. if colorsOnOff == "OFF" then
  3656. if hp == 0 then
  3657. status = "Paralyzed"
  3658. end
  3659. if hp >= 1 and
  3660. hp < oFour then
  3661. status = "Seriously Damaged"
  3662. end
  3663. if hp >= oFour and
  3664. hp < half then
  3665. status = "Very Damaged"
  3666. end
  3667. if hp >= half and
  3668. hp < tFour then
  3669. status = "Damaged"
  3670. end
  3671. if hp >= tFour and
  3672. hp < tHP then
  3673. status = "Minor Injury"
  3674. end
  3675. if hp == tHP then
  3676. status = "Healthy"
  3677. end
  3678.  
  3679. elseif colorsOnOff == "ON" then
  3680. if hp == 0 then
  3681. term.setTextColor(colors.purple)
  3682. status = "Paralyzed"
  3683. term.setTextColor(menuTextColor)
  3684. end
  3685.  
  3686. if hp >= 1 and
  3687. hp < oFour then
  3688. term.setTextColor(colors.red)
  3689. status = "Seriously Damaged"
  3690. term.setTextColor(menuTextColor)
  3691. end
  3692.  
  3693. if hp >= oFour and
  3694. hp < half then
  3695. term.setTextColor(colors.orange)
  3696. status = "Very Damaged"
  3697. term.setTextColor(menuTextColor)
  3698. end
  3699.  
  3700. if hp >= half and
  3701. hp < tFour then
  3702. term.setTextColor(colors.yellow)
  3703. status = "Damaged"
  3704. term.setTextColor(menuTextColor)
  3705. end
  3706.  
  3707. if hp >= tFour and
  3708. hp < tHP then
  3709. term.setTextColor(colors.green)
  3710. status = "Minor Injury"
  3711. term.setTextColor(menuTextColor)
  3712. end
  3713.  
  3714. if hp == tHP then
  3715. term.setTextColor(colors.lime)
  3716. status = "Healthy"
  3717. term.setTextColor(menuTextColor)
  3718. end
  3719.  end
  3720.   end
  3721.  
  3722. function drawGymInfo()
  3723. if colorsOnOff == "OFF" then
  3724. drawAt(29,3,"NAME:"..myName)
  3725. drawAt(29,4,"HP:"..hp)
  3726. drawAt(29,5,"STA:"..sta)
  3727. drawAt(29,6,"Money"..money.."$")
  3728. drawAt(29,11,"Membership:".. mbrshipDay.." Days Left")
  3729. drawAt(29,7,"DAY:"..day)
  3730. drawAt(29,9,"STATUS:"..status)
  3731.  
  3732. elseif colorsOnOff == "ON" then
  3733. term.setBackgroundColor(menuBackColor)
  3734. term.setTextColor(colors.yellow)
  3735. drawAt(28,1,"                                            ")
  3736. drawAt(28,2,"                                            ")
  3737. drawAt(28,3," NAME:"..myName.."                          ")
  3738.  
  3739. term.setTextColor(colors.red)
  3740. drawAt(28,4," HP:"..hp.."                          ")
  3741.  
  3742. term.setTextColor(colors.cyan)
  3743. drawAt(28,5," STA:"..sta.."                          ")
  3744.  
  3745. term.setTextColor(colors.lime)
  3746. drawAt(28,6," Money"..money.."$                      ")
  3747. drawAt(28,8,"                                            ")
  3748. drawAt(28,10,"                                            ")
  3749. drawAt(28,12,"                                            ")
  3750. drawAt(28,13,"                                            ")
  3751. drawAt(28,14,"                                            ")
  3752. drawAt(28,15,"                                            ")
  3753. drawAt(28,16,"                                            ")
  3754. drawAt(28,17,"                                            ")
  3755. drawAt(28,18,"                                            ")
  3756. drawAt(28,19,"                                            ")
  3757.  
  3758. term.setTextColor(menuTextColor)
  3759. drawAt(28,11," Membership:".. mbrshipDay.." Days Left                               ")
  3760. drawAt(28,7," DAY:"..day.."                          ")
  3761. checkHealth()
  3762. drawAt(28,9," STATUS:"..status.."                          ")
  3763.  
  3764. term.setBackgroundColor(colors.black)
  3765. term.setTextColor(colors.white)
  3766. end
  3767.  end
  3768.  
  3769. function inGym()
  3770. p = 0
  3771. onMap = false
  3772. menuStat = 4
  3773.  
  3774. while true do
  3775.  
  3776. checkHealth()
  3777. cleanScreen()
  3778.  
  3779. if colorsOnOff == "OFF" then
  3780. drawGymMenu()
  3781. drawGymInfo()
  3782. checkHealth()
  3783. gymEvents()
  3784.  
  3785. elseif colorsOnOff == "ON" then
  3786. drawGymMenu()
  3787. drawGymInfo()
  3788. checkHealth()
  3789. gymEvents()
  3790. term.setTextColor(colors.white)
  3791. term.setBackgroundColor(colors.black)
  3792. end
  3793.  end
  3794.   end
  3795.  
  3796. -------------------------------------------------
  3797. function inMall(pos1,pos2)
  3798. x = pos1
  3799. y = pos2
  3800. onMap = false
  3801. insMall = true
  3802. while insMall do
  3803.  
  3804.  
  3805. cleanScreen()
  3806. checkMallPos()
  3807. drawMallArt()
  3808. drawCharacter()
  3809. drawHUD()
  3810. gameEvents()
  3811. cleanScreen()
  3812. end
  3813.  end
  3814. -------------------------------------------------
  3815.  
  3816.  
  3817. function drawDoors()
  3818.         term.setBackgroundColor(colors.cyan)
  3819.       drawAt(18,17,"___|___")
  3820.       drawAt(12,3,"   ")
  3821.       drawAt(32,3,"   ")
  3822.         term.setBackgroundColor(colors.lightGray)
  3823.         end
  3824.      
  3825.  
  3826. function drawMallArt()
  3827. if colorsOnOff == "OFF" then
  3828.  
  3829. for i = 1, #mallInterior do
  3830.         drawAt(1,i,mallInterior[i])
  3831.   end
  3832.  
  3833.   elseif colorsOnOff == "ON" then
  3834.   for i = 1, #mallInteriorCol do
  3835.     term.setBackgroundColor(colors.lightGray)
  3836.   term.setTextColor(colors.black)
  3837.         drawAt(1,i,mallInteriorCol[i])
  3838.        
  3839.         drawDoors()
  3840.        
  3841.        
  3842.       term.setTextColor(colors.white)
  3843.       term.setBackgroundColor(colors.black)
  3844.   end
  3845.  end
  3846. end
  3847.  
  3848. -------------------------------------------------
  3849. function checkPosition()
  3850. --This checks if you enter A Building
  3851.  
  3852. --Checks if you Enter The Gym
  3853. if x == 8 or x == 9 then
  3854. if y == 6 then
  3855. onMap = false
  3856. inGym()
  3857. end
  3858.  end
  3859.  
  3860. --Checks if you Enter the Home
  3861. if x == 23 then
  3862. if y == 5 then
  3863. onMap = false
  3864. solo()
  3865. end
  3866.  end
  3867.  
  3868. --Checks if you Enter the mall
  3869. if x == 37 then
  3870. if y == 8 then
  3871. onMap = false
  3872. inMall(19,16)
  3873. end
  3874.  end
  3875. if x == 38 then
  3876. if y == 8 then
  3877. onMap = false
  3878. inMall(21,16)
  3879. end
  3880.  end
  3881.  if x == 39 then
  3882. if y == 8 then
  3883. onMap = false
  3884. inMall(23,16)
  3885. end
  3886.  end
  3887.  
  3888. --This Does so you don't walk through a house
  3889. --or Fall out of the map
  3890.  
  3891. --Makes the map solid
  3892. if y < 2 then
  3893. y = 2
  3894. end
  3895. if y > 17 then
  3896. y = 17
  3897. end
  3898. if x < 2 then
  3899. x = 2
  3900. end
  3901. if x > 50 then
  3902. x = 50
  3903. end
  3904.  
  3905. --Makes the Gym Solid
  3906. if y == 6 then
  3907. if x == 4 then
  3908. x = 3
  3909.  end
  3910.   end
  3911. if y == 5 then
  3912. if x == 4 then
  3913. x = 3
  3914.  end
  3915.   end
  3916. if y == 4 then
  3917. if x == 5 then
  3918. x = 4
  3919.  end
  3920.   end
  3921. if y == 3 then
  3922. if x == 6 then
  3923. x = 5
  3924.  end
  3925.   end
  3926. if y == 2 then
  3927. if x == 7 then
  3928. x = 6
  3929.  end
  3930.   end
  3931. if y == 6 then
  3932. if x == 5 then
  3933. y = 7
  3934.  end
  3935.   end
  3936. if y == 6 then
  3937. if x == 6 then
  3938. y = 7
  3939.   end
  3940.  end
  3941. if y == 6 then
  3942. if x == 7 then
  3943. y = 7
  3944.   end
  3945.  end
  3946. if y == 6 then
  3947. if x == 10 then
  3948. y = 7
  3949.   end
  3950.  end
  3951. if y == 6 then
  3952. if x == 11 then
  3953. y = 7
  3954.   end
  3955.  end
  3956. if y == 6 then
  3957. if x == 12 then
  3958. y = 7
  3959.   end
  3960.  end
  3961.  if y == 5 then
  3962. if x == 8 then
  3963. y = 6
  3964.   end
  3965.  end
  3966.  if y == 5 then
  3967. if x == 9 then
  3968. y = 6
  3969.   end
  3970.  end
  3971. if y == 6 then
  3972. if x == 13 then
  3973. x = 14
  3974.   end
  3975.  end
  3976. if y == 5 then
  3977. if x == 13 then
  3978. x = 14
  3979.   end
  3980.  end
  3981. if y == 4 then
  3982. if x == 12 then
  3983. x = 13
  3984.   end
  3985.  end
  3986. if y == 3 then
  3987. if x == 12 then
  3988. x = 13
  3989.   end
  3990.  end
  3991. if y == 2 then
  3992. if x == 11 then
  3993. x = 12
  3994.   end
  3995.  end
  3996.  
  3997.  
  3998. --Makes The Home Solid
  3999. if y == 5 then
  4000. if x == 20 then
  4001. x = 19
  4002. end
  4003.  end
  4004.  if y == 4 then
  4005. if x == 20 then
  4006. x = 19
  4007. end
  4008.  end
  4009. if y == 3 then
  4010. if x == 20 then
  4011. x = 19
  4012. end
  4013.  end
  4014. if y == 2 then
  4015. if x == 21 then
  4016. x = 20
  4017. end
  4018.  end
  4019. if y == 5 then
  4020. if x == 26 then
  4021. x = 27
  4022. end
  4023.  end
  4024. if y == 4 then
  4025. if x == 26 then
  4026. x = 27
  4027. end
  4028.  end
  4029. if y == 3 then
  4030. if x == 26 then
  4031. x = 27
  4032. end
  4033.  end
  4034. if y == 2 then
  4035. if x == 25 then
  4036. x = 26
  4037. end
  4038.  end
  4039. if y == 5 then
  4040. if x == 21 then
  4041. y = 6
  4042. end
  4043.  end
  4044. if y == 5 then
  4045. if x == 22 then
  4046. y = 6
  4047. end
  4048.  end
  4049. if y == 5 then
  4050. if x == 23 then
  4051. y = 6
  4052. end
  4053.  end
  4054. if y == 5 then
  4055. if x == 24 then
  4056. y = 6
  4057. end
  4058.  end
  4059. if y == 5 then
  4060. if x == 25 then
  4061. y = 6
  4062. end
  4063.  end
  4064.  
  4065. --Makes The Mall Solid
  4066. --Left
  4067. if y == 8 then
  4068. if x == 31 then
  4069. x = 30
  4070. end
  4071.  end
  4072. if y == 7 then
  4073. if x == 31 then
  4074. x = 30
  4075. end
  4076.  end
  4077. if y == 6 then
  4078. if x == 31 then
  4079. x = 30
  4080. end
  4081.  end
  4082. if y == 5 then
  4083. if x == 31 then
  4084. x = 30
  4085. end
  4086.  end
  4087. if y == 4 then
  4088. if x == 31 then
  4089. x = 30
  4090. end
  4091.  end
  4092. if y == 3 then
  4093. if x == 31 then
  4094. x = 30
  4095. end
  4096.  end
  4097. if y == 2 then
  4098. if x == 31 then
  4099. x = 30
  4100. end
  4101.  end
  4102. --Right
  4103. if y == 8 then
  4104. if x == 44 then
  4105. x = 45
  4106. end
  4107.  end
  4108. if y == 7 then
  4109. if x == 44 then
  4110. x = 45
  4111. end
  4112.  end  
  4113. if y == 6 then
  4114. if x == 44 then
  4115. x = 45
  4116. end
  4117.  end
  4118. if y == 5 then
  4119. if x == 44 then
  4120. x = 45
  4121. end
  4122.  end  
  4123. if y == 4 then
  4124. if x == 44 then
  4125. x = 45
  4126. end
  4127.  end
  4128. if y == 3 then
  4129. if x == 44 then
  4130. x = 45
  4131. end
  4132.  end
  4133. if y == 2 then
  4134. if x == 44 then
  4135. x = 45
  4136. end
  4137.  end
  4138.  --Bottom
  4139. if y == 8 then
  4140. if x == 32 then
  4141. y = 9
  4142. end
  4143.  end
  4144. if y == 8 then
  4145. if x == 33 then
  4146. y = 9
  4147. end
  4148.  end
  4149. if y == 8 then
  4150. if x == 34 then
  4151. y = 9
  4152. end
  4153.  end
  4154. if y == 8 then
  4155. if x == 35 then
  4156. y = 9
  4157. end
  4158.  end
  4159. if y == 8 then
  4160. if x == 36 then
  4161. y = 9
  4162. end
  4163.  end
  4164. if y == 8 then
  4165. if x == 38 then
  4166. y = 9
  4167. end
  4168.  end
  4169. if y == 8 then
  4170. if x == 40 then
  4171. y = 9
  4172. end
  4173.  end
  4174. if y == 8 then
  4175. if x == 41 then
  4176. y = 9
  4177. end
  4178.  end
  4179. if y == 8 then
  4180. if x == 42 then
  4181. y = 9
  4182. end
  4183.  end
  4184. if y == 8 then
  4185. if x == 43 then
  4186. y = 9
  4187. end
  4188.  end
  4189. --Makes The House Solid
  4190. --Left
  4191. if y == 12 then
  4192. if x == 19 then
  4193. x = 18
  4194. end
  4195.  end
  4196. if y == 13 then
  4197. if x == 18 then
  4198. x = 17
  4199.   end
  4200.  end
  4201. if y == 14 then
  4202. if x == 18 then
  4203. x = 17
  4204.   end
  4205.  end
  4206. if y == 15 then
  4207. if x == 18 then
  4208. x = 17
  4209.   end
  4210.  end
  4211.  
  4212. --Bottom
  4213. if y == 15 then
  4214. if x == 19 then
  4215. y = 16
  4216.   end
  4217.  end
  4218. if y == 15 then
  4219. if x == 20 then
  4220. y = 16
  4221.   end
  4222.  end
  4223. if y == 15 then
  4224. if x == 21 then
  4225. y = 16
  4226.   end
  4227.  end
  4228. if y == 15 then
  4229. if x == 22 then
  4230. y = 16
  4231.   end
  4232.  end
  4233. if y == 15 then
  4234. if x == 23 then
  4235. y = 16
  4236.   end
  4237.  end
  4238.  
  4239. --Right
  4240. if y == 15 then
  4241. if x == 24 then
  4242. x = 25
  4243. end
  4244.  end
  4245. if y == 14 then
  4246. if x == 24 then
  4247. x = 25
  4248. end
  4249.  end
  4250. if y == 13 then
  4251. if x == 24 then
  4252. x = 25
  4253. end
  4254.  end
  4255. if y == 12 then
  4256. if x == 23 then
  4257. x = 24
  4258. end
  4259.  end
  4260.  
  4261. --Top
  4262. if y == 12 then
  4263. if x == 23 then
  4264. y = 11
  4265. end
  4266.  end
  4267. if y == 12 then
  4268. if x == 22 then
  4269. y = 11
  4270. end
  4271.  end
  4272. if y == 12 then
  4273. if x == 21 then
  4274. y = 11
  4275. end
  4276.  end
  4277. if y == 12 then
  4278. if x == 20 then
  4279. y = 11
  4280. end
  4281.  end
  4282. if y == 12 then
  4283. if x == 19 then
  4284. y = 11
  4285. end
  4286.  end
  4287.  
  4288. --Makes the Hospital Solid
  4289. --Left
  4290. if y == 13 then
  4291. if x == 4 then
  4292. x = 3
  4293.  end
  4294.   end
  4295.  if y == 14 then
  4296. if x == 4 then
  4297. x = 3
  4298.  end
  4299.   end
  4300.  if y == 15 then
  4301. if x == 4 then
  4302. x = 3
  4303.  end
  4304.   end
  4305.  
  4306.  --Top
  4307.  if y == 12 then
  4308. if x == 4 then
  4309. y = 11
  4310.  end
  4311.   end
  4312.  if y == 12 then
  4313.  if x == 5 then
  4314.  y = 11
  4315.    end
  4316.     end
  4317.  if y == 12 then
  4318.  if x == 6 then
  4319.  y = 11
  4320.    end
  4321.   end
  4322. if y == 12 then
  4323.  if x == 7 then
  4324.  y = 11
  4325.    end
  4326.   end
  4327.  if y == 12 then
  4328.  if x == 8 then
  4329.  y = 11
  4330.    end
  4331.   end
  4332.  if y == 12 then
  4333.  if x == 9 then
  4334.  y = 11
  4335.    end
  4336.   end
  4337.  if y == 12 then
  4338.  if x == 10 then
  4339.  y = 11
  4340.    end
  4341.   end
  4342.  if y == 12 then
  4343.  if x == 11 then
  4344.  y = 11
  4345.    end
  4346.   end
  4347.  if y == 12 then
  4348.  if x == 12 then
  4349.  y = 11
  4350.    end
  4351.   end
  4352.  if y == 12 then
  4353.  if x == 13 then
  4354.  y = 11
  4355.    end
  4356.   end
  4357.  if y == 12 then
  4358.  if x == 14 then
  4359.  y = 11
  4360.    end
  4361.   end
  4362.  
  4363.  
  4364.  
  4365. --Bottom
  4366. if y == 15 then
  4367. if x == 4 then
  4368. y = 16
  4369.  end
  4370.   end
  4371.  if y == 15 then
  4372.  if x == 5 then
  4373.  y = 16
  4374.    end
  4375.     end
  4376.  if y == 15 then
  4377.  if x == 6 then
  4378.  y = 16
  4379.    end
  4380.   end
  4381. if y == 15 then
  4382.  if x == 7 then
  4383.  y = 16
  4384.    end
  4385.   end
  4386.  if y == 15 then
  4387.  if x == 8 then
  4388.  y = 16
  4389.    end
  4390.   end
  4391.  if y == 15 then
  4392.  if x == 9 then
  4393.  y = 16
  4394.    end
  4395.   end
  4396.  if y == 15 then
  4397.  if x == 10 then
  4398.  y = 16
  4399.    end
  4400.   end
  4401.  if y == 15 then
  4402.  if x == 11 then
  4403.  y = 16
  4404.    end
  4405.   end
  4406.  if y == 15 then
  4407.  if x == 12 then
  4408.  y = 16
  4409.    end
  4410.   end
  4411.  if y == 15 then
  4412.  if x == 13 then
  4413.  y = 16
  4414.    end
  4415.   end
  4416.  
  4417.  
  4418. --Right
  4419. if y == 15 then
  4420. if x == 14 then
  4421. x = 15
  4422. end
  4423.  end
  4424. if y == 14 then
  4425. if x == 14 then
  4426. x = 15
  4427. end
  4428.  end
  4429. if y == 13 then
  4430. if x == 14 then
  4431. x = 15
  4432. end
  4433.  end
  4434.   end
  4435.  
  4436.  
  4437. -------------------------------------------------
  4438. --Drawing Section
  4439.  
  4440.  
  4441. function drawMap1()
  4442. if colorsOnOff == "OFF" then
  4443. drawScenery()
  4444. drawBuildings()
  4445.  
  4446. elseif colorsOnOff == "ON" then
  4447. term.setBackgroundColor(colors.lime)
  4448. term.setTextColor(colors.green)
  4449. drawScenery()
  4450. drawColorBuildings()
  4451. end
  4452.  end
  4453.  
  4454. function drawColorBuildings()
  4455. --HOME1
  4456.  
  4457. term.setBackgroundColor(colors.black)
  4458. drawAt(21,2,"     ")
  4459. drawAt(20,3,"       ")
  4460.  
  4461. term.setBackgroundColor(colors.red)
  4462. term.setTextColor(colors.brown)
  4463. drawAt(20,4,"   _   ")
  4464. drawAt(20,5,"  |:|  ")
  4465.  
  4466.  
  4467.  
  4468. --HOME2
  4469.  
  4470. term.setBackgroundColor(colors.black)
  4471. drawAt(19,12,"     ")
  4472. drawAt(18,13,"       ")
  4473.  
  4474. term.setBackgroundColor(colors.yellow)
  4475. term.setTextColor(colors.brown)
  4476. drawAt(18,14,"   _   ")
  4477. drawAt(18,15,"  |:|  ")
  4478.  
  4479.  
  4480.  
  4481. --GYM
  4482.  
  4483. term.setBackgroundColor(colors.white)
  4484. term.setTextColor(colors.black)
  4485. drawAt(7,2,"     ")
  4486. drawAt(6,3,"  GYM  ")
  4487.  
  4488. term.setBackgroundColor(colors.lightGray)
  4489. term.setTextColor(colors.brown)
  4490. drawAt(5,4,"        ")
  4491. drawAt(4,5,"    __    ")
  4492. drawAt(4,6,"   |::|   ")
  4493. term.setTextColor(colors.gray)
  4494. drawAt(4,7,"'--------'")
  4495.  
  4496.  
  4497.  
  4498.  
  4499.  
  4500. --MALL
  4501. term.setBackgroundColor(colors.gray)
  4502. term.setTextColor(colors.red)
  4503. drawAt(31,2,"              ")
  4504. drawAt(31,3,"              ")
  4505. drawAt(31,4,"     MALL     ")
  4506.  
  4507. term.setBackgroundColor(colors.lightGray)
  4508. term.setTextColor(colors.brown)
  4509.  
  4510. drawAt(31,5,"              ")
  4511. drawAt(31,6,"              ")
  4512. drawAt(31,7,"      ___     ")
  4513. drawAt(31,8,"     |:|:|    ")
  4514. term.setTextColor(colors.gray)
  4515. drawAt(31,9,"--------------")
  4516.  
  4517.  
  4518.  
  4519.  
  4520.  
  4521. --HOSPITAL
  4522.  
  4523. term.setBackgroundColor(colors.white)
  4524. term.setTextColor(colors.red)
  4525. drawAt(4,12,"           ")
  4526. drawAt(4,13,"  Hospital ")
  4527. term.setTextColor(colors.brown)
  4528. drawAt(4,14,"    ___    ")
  4529. drawAt(4,15,"   |:|:|   ")
  4530.  
  4531. term.setBackgroundColor(colors.black)
  4532. term.setTextColor(colors.white)
  4533.  
  4534. end
  4535.  
  4536.  
  4537.  
  4538.  
  4539.  
  4540.  
  4541. function drawGymMenu()
  4542. if colorsOnOff == "OFF" then
  4543. for i = 1, #gymMenuArt do
  4544.      drawAt (1,i,gymMenuArt[i])
  4545.     end
  4546. for i = 1, #gymOptions do
  4547.     drawAt (3,i + 4,"*")
  4548.      drawAt (5,i + 4,gymOptions[i])
  4549. end
  4550. drawCursor(2,4,1 + menuStat)
  4551.  
  4552.   elseif colorsOnOff == "ON" then
  4553.  
  4554.   term.setTextColor(ttTextColor)
  4555.   term.setBackgroundColor(ttBackColor)
  4556. for i = 1, #gymMenuArtCol do
  4557.      drawAt (1,i,gymMenuArtCol[i])
  4558.     end
  4559.     term.setTextColor(ttTextColor)
  4560.   term.setBackgroundColor(ttBackColor)
  4561. for i = 1, #gymOptions do
  4562.     drawAt (3,i + 4,"*")
  4563.      drawAt (5,i + 4,gymOptions[i])
  4564. end
  4565. term.setBackgroundColor(ttBackColor)
  4566. drawCursor(2,4,1 + menuStat)
  4567.  
  4568. term.setTextColor(colors.white)
  4569.   term.setBackgroundColor(colors.black)
  4570.  
  4571.   end
  4572.  end
  4573.  
  4574.  
  4575. function drawScenery()
  4576. if hDetailLevel == "LOW" then
  4577. for i = 1, #map1L do
  4578.         drawAt(1,i,map1L[i])
  4579.   end
  4580.  
  4581. elseif hDetailLevel == "NORMAL" or hDetailLevel == "HIGH" or hDetailLevel == "EXTREME" then
  4582.  for i = 1, #map1 do
  4583.         drawAt(1,i,map1[i])
  4584.   end
  4585. end
  4586. end
  4587.  
  4588.  
  4589. function drawBuildings()
  4590.  
  4591. if colorsOnOff == "OFF" then
  4592.  
  4593. if hDetailLevel == "NORMAL" then
  4594. for i = 1, #gym do
  4595.         drawAt(4,i + 1,gym[i])
  4596.   end
  4597.   for i = 1, #superMall do
  4598.         drawAt(31,i + 1,superMall[i])
  4599.   end
  4600. for i = 1, #home do
  4601.         drawAt(20,i + 1,home[i])
  4602.   end
  4603. for i = 1, #home do
  4604.         drawAt(18,i + 11,home[i])
  4605.   end
  4606. for i = 1, #hospital do
  4607.         drawAt(4,i + 11,hospital[i])
  4608.   end
  4609.  
  4610.  
  4611.  elseif hDetailLevel == "LOW" then
  4612.  for i = 1, #gymL do
  4613.         drawAt(4,i + 1,gymL[i])
  4614.   end
  4615.   for i = 1, #superMallL do
  4616.         drawAt(31,i + 1,superMallL[i])
  4617.   end
  4618. for i = 1, #homeL do
  4619.         drawAt(20,i + 1,homeL[i])
  4620.   end
  4621. for i = 1, #homeL do
  4622.         drawAt(18,i + 11,homeL[i])
  4623.   end
  4624. for i = 1, #hospitalL do
  4625.         drawAt(4,i + 11,hospitalL[i])
  4626.   end
  4627.  
  4628.  
  4629.   elseif hDetailLevel == "HIGH" then
  4630.  for i = 1, #gymH do
  4631.         drawAt(4,i + 1,gymL[i])
  4632.   end
  4633.   for i = 1, #superMallHE do
  4634.         drawAt(31,i + 1,superMallHE[i])
  4635.   end
  4636. for i = 1, #home do
  4637.         drawAt(20,i + 1,home[i])
  4638.   end
  4639. for i = 1, #home do
  4640.         drawAt(18,i + 11,home[i])
  4641.   end
  4642. for i = 1, #hospital do
  4643.         drawAt(4,i + 11,hospital[i])
  4644.   end
  4645.  
  4646.  
  4647.     elseif hDetailLevel == "EXTREME" then
  4648.  for i = 1, #gymE do
  4649.         drawAt(4,i + 1,gymE[i])
  4650.   end
  4651.   for i = 1, #superMallHE do
  4652.         drawAt(31,i + 1,superMallHE[i])
  4653.   end
  4654. for i = 1, #home do
  4655.         drawAt(20,i + 1,home[i])
  4656.   end
  4657. for i = 1, #home do
  4658.         drawAt(18,i + 11,home[i])
  4659.   end
  4660. for i = 1, #hospital do
  4661.         drawAt(4,i + 11,hospital[i])
  4662.   end
  4663.    end
  4664.  
  4665.   elseif colorsOnOff == "ON" then
  4666.   drawColorBuildings()
  4667.     end
  4668.      end
  4669. -------------------------------------------------
  4670.  
  4671.  
  4672.  
  4673. function map(pos1,pos2)
  4674. x = pos1
  4675. y = pos2
  4676. onMap = true
  4677. while true do
  4678. if onMap == false
  4679. then
  4680. break
  4681. end
  4682. cleanScreen()
  4683. drawMap1(detailLevel)
  4684. checkPosition()
  4685. drawHUD()
  4686. drawCharacter()
  4687. gameEvents()
  4688. cleanScreen()
  4689. end
  4690. end
  4691.  
  4692.  
  4693. ---------------------------------------------------------------------------------------------------
  4694. ---------------------------------------------------------------------------------------------------
  4695.  
  4696. local function CheckUserName()
  4697.         if #myName < minName then
  4698.                 return false, "                Name is too short."
  4699.         elseif #myName > maxName then
  4700.                 return false, "                Name is too long."
  4701.         end
  4702.         return true
  4703. end
  4704.  
  4705.  
  4706. ---------------------------------------------------------------------------------------------------
  4707. --:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  4708. ---------------------------------------------------------------------------------------------------
  4709. --MULTIPLAYER SECTION
  4710. ---------------------------------------------------------------------------------------------------
  4711. --LOCAL Multiplayer
  4712. ---------------------------------------------------------------------------------------------------
  4713.  
  4714.  
  4715.  
  4716.  
  4717.  
  4718. -----------------------------------
  4719.  --MENUS OPTIONS
  4720. -----------------------------------
  4721.  
  4722.  
  4723. local warningOptions = {
  4724.  "Yes", "No"
  4725. }
  4726.  
  4727. local hMenuOptions =
  4728. {
  4729.  "Quick Match", "Tournament", "Inventory", "Open Map",  "Relax",  "Save",  "Exit To Main Menu"
  4730. }
  4731.  
  4732. local chMenuOptions =
  4733. {
  4734. "New Game",  "Load",  "Delete",  "Exit"
  4735. }
  4736.  
  4737. local dMenuOptions =
  4738. {
  4739. "Easy",  "Normal",  "Hard",  "Extreme"
  4740. }
  4741.  
  4742. --Draws the Gameplay
  4743. function drawMatchArt()
  4744. if colorsOnOff == "OFF" then
  4745. drawAt(10,9,"ACTION: ")
  4746.  
  4747. elseif colorsOnOff == "ON" then
  4748.   term.setTextColor(colors.black)
  4749.  drawAt(10,9,"ACTION: ")
  4750. end
  4751.  end
  4752.  
  4753. --Draw The players and The Enemies Grid PS. This Is for solo Play
  4754. function drawGrids()
  4755. if hDetailLevel == "LOW" then
  4756. drawAt(1,1,"|======| "..myName.."   ")
  4757. drawAt(1,2,"| O ..O| HP:"..hp.."/"..tHP)
  4758. drawAt(1,3,"|  _   | STA:"..sta.."/"..tSta)
  4759. drawAt(1,4,"|      | LVL:"..lvl.."  ")
  4760. drawAt(1,5,"|------+                ")
  4761. drawAt(28,1,"|======| "..enemy.."   ")
  4762. drawAt(28,2,"|O ..O | HP:"..enemyHP.."    ")
  4763. drawAt(28,3,"|   _  | STA:"..enemySta.."  ")
  4764. drawAt(28,4,"|      | LVL:"..enemyLvl.."  ")
  4765. drawAt(28,5,"|------+                ")
  4766.  
  4767. elseif hDetailLevel == "NORMAL" or hDetailLevel == "HIGH" or hDetailLevel == "EXTREME" then
  4768. if colorsOnOff == "OFF" then
  4769. drawAt(1,1," ''''''  "..myName.."   ")
  4770. drawAt(1,2,"' .   .  HP:"..hp.."/"..tHP)
  4771. drawAt(1,3,"d   -  | STA:"..sta.."/"..tSta)
  4772. drawAt(1,4,"|  _   | LVL:"..lvl.."  ")
  4773. drawAt(1,5,"|______/")
  4774.  
  4775. drawAt(28,1," ''''''  "..enemy.."   ")
  4776. drawAt(28,2," .   . ' HP:"..enemyHP.."    ")
  4777. drawAt(28,3,"|  -   D STA:"..enemySta.."  ")
  4778. drawAt(28,4,"|   _  | LVL:"..enemyLvl.."  ")
  4779. drawAt(28,5,"\\______|                ")
  4780.  
  4781.  
  4782.  
  4783.  
  4784.  
  4785.  
  4786. elseif colorsOnOff == "ON" then
  4787.  
  4788. term.setBackgroundColor(colors.white)
  4789. term.setTextColor(colors.brown)
  4790. drawAt(1,1," ''''''  "..myName.."                      ")
  4791. drawAt(1,2,"' .   .  HP:"..hp.."/"..tHP.."             ")
  4792. term.setTextColor(colors.black)
  4793. drawAt(1,3,"d   -  | STA:"..sta.."/"..tSta.."             ")
  4794. drawAt(1,4,"|  _   | LVL:"..lvl.."                        ")
  4795. drawAt(1,5,"|______/                                      ")
  4796.  
  4797. --Player Info
  4798. term.setTextColor(colors.yellow)
  4799. drawAt(10,1,myName)
  4800. term.setTextColor(colors.red)
  4801. drawAt(10,2,"HP:"..hp.."/"..tHP)
  4802. term.setTextColor(colors.cyan)
  4803. drawAt(10,3,"STA:"..sta.."/"..tSta)
  4804. term.setTextColor(colors.yellow)
  4805. drawAt(10,4,"LVL:"..lvl)
  4806.  
  4807.  
  4808.  
  4809. term.setTextColor(colors.brown)
  4810. drawAt(28,1," ''''''  "..enemy.."             ")
  4811. term.setTextColor(colors.black)
  4812. drawAt(28,2," .   . ' HP:"..enemyHP.."           ")
  4813. drawAt(28,3,"|  -   D STA:"..enemySta.."           ")
  4814. drawAt(28,4,"|   _  | LVL:"..enemyLvl.."           ")
  4815. drawAt(28,5,"\\______|                             ")
  4816. drawAt(1,6,"                                                                                 ")
  4817.  
  4818. --Enemy Info
  4819. term.setTextColor(colors.yellow)
  4820. drawAt(37,1,enemy)
  4821. term.setTextColor(colors.red)
  4822. drawAt(37,2,"HP:"..enemyHP)
  4823. term.setTextColor(colors.cyan)
  4824. drawAt(37,3,"STA:"..enemySta)
  4825. term.setTextColor(colors.yellow)
  4826. drawAt(37,4,"LVL:"..enemyLvl)
  4827.  
  4828.  
  4829. term.setBackgroundColor(colors.lightGray)
  4830. drawAt(1,7,"                                                                                 ")
  4831.  
  4832.  
  4833. end
  4834.  end
  4835.   end
  4836.  ---------------------------------------------------------------------------------------------------
  4837.  --MENUS ART
  4838.  ---------------------------------------------------------------------------------------------------
  4839.  
  4840.  
  4841.  function drawBoxingGloves()
  4842.  term.setBackgroundColor(colors.lightGray)
  4843.  term.setTextColor(colors.white)
  4844. drawAt(35,8,"      Boxing        ")
  4845.  term.setBackgroundColor(colors.black)
  4846.  term.setTextColor(colors.white)
  4847. drawAt(35,9,"     _____           ")
  4848. drawAt(35,10,"  .'  .   '. _      ")
  4849. drawAt(35,11," |   :  .-  | |     ")
  4850. drawAt(35,12," |   : (__  |_|     ")
  4851. drawAt(35,13," '._   ___/         ")
  4852. drawAt(35,14,"   .'     '. _      ")
  4853. drawAt(35,15,"  |         | |     ")
  4854. drawAt(35,16,"  |         |_|     ")
  4855. drawAt(35,17,"   '._____.'        ")
  4856. drawAt(35,18,"                    ")
  4857. term.setBackgroundColor(colors.lightGray)
  4858. drawAt(35,19,"   Gloves Ascii         ")
  4859.    term.setBackgroundColor(menuBackColor)
  4860.    term.setTextColor(menuTextColor)
  4861.    end
  4862.    
  4863.  
  4864.  
  4865.  
  4866. --Draws The Main Menu
  4867. function drawMenu()
  4868.   cleanScreen()
  4869.  
  4870.     if language == "English" then
  4871. menuOptions = {
  4872.   "Solo",  "Multiplayer",  "Settings",  "Highscore",  "Help",  "Credits",  "Quit"
  4873. }
  4874.  
  4875. elseif language == "Swedish" then
  4876. menuOptions = {
  4877. "Solo Spel",  "Flerspelare",  "Inställningar",  "Rekord",  "Hjälp",  "Krediter",  "Lämna"
  4878. }
  4879. end
  4880.  
  4881.   if colorsOnOff == "ON" then
  4882.   term.setTextColor(ttTextColor)
  4883.   term.setBackgroundColor(ttBackColor)
  4884.   drawAt(1,1,"                                                   ")
  4885.   drawAt(1,2,"                                                   ")
  4886.   drawAt(1,3,"                                                   ")
  4887.    centerPrint(2,"Boxer Tournament Ver "..version)
  4888.  
  4889.   term.setBackgroundColor(menuBackColor)
  4890.   drawAt(1,4,"                                                   ")
  4891.   drawAt(1,5,"                                                   ")
  4892.   drawAt(1,6,"                                                   ")
  4893.   drawAt(1,7,"                                                   ")
  4894.   drawAt(1,8,"                                                   ")
  4895.   drawAt(1,9,"                                                   ")
  4896.   drawAt(1,10,"                                                   ")
  4897.   drawAt(1,11,"                                                   ")
  4898.   drawAt(1,12,"                                                   ")
  4899.   drawAt(1,13,"                                                   ")
  4900.   drawAt(1,14,"                                                   ")
  4901.   drawAt(1,15,"                                                   ")
  4902.   drawAt(1,16,"                                                   ")
  4903.   drawAt(1,17,"                                                   ")
  4904.   drawAt(1,18,"                                                   ")
  4905.   drawAt(1,19,"                                                   ")
  4906.   drawBoxingGloves()
  4907.  
  4908.   for i = 1, #menuOptions do
  4909.         term.setTextColor(menuTextColor)
  4910.         drawAt(3,i + 4,"*")
  4911.         drawAt(5,i + 4,menuOptions[i])
  4912.   end
  4913.   term.setTextColor(menuTextColor)
  4914.   drawCursor(2,4,3 + menuStat)
  4915.   term.setBackgroundColor(colors.black)
  4916.   term.setTextColor(colors.white)
  4917.  
  4918.  
  4919.  
  4920. elseif colorsOnOff == "OFF" then
  4921.   drawAt(1,1,"+-------------------------------------------------+")
  4922.   drawAt(1,2,"|                                                 |")
  4923.   drawAt(1,3,"+-------------------------------------------------+")
  4924.   drawAt(1,4,"|                                                 |")
  4925.   drawAt(1,5,"|                                                 |")
  4926.   drawAt(1,6,"|                                                 |")
  4927.   drawAt(1,7,"|                                                 |")
  4928.   drawAt(1,8,"|                                                 |")
  4929.   drawAt(1,9,"|                                     _____       |")
  4930.   drawAt(1,10,"|                                  .'  .   '. _   |")
  4931.   drawAt(1,11,"|                                 |   :  .-  | |  |")
  4932.   drawAt(1,12,"|                                 |   : (__  |_|  |")
  4933.   drawAt(1,13,"|                                  '._   ___/     |")
  4934.   drawAt(1,14,"|                                    .'     '. _  |")
  4935.   drawAt(1,15,"|                                   |         | | |")
  4936.   drawAt(1,16,"|                                   |         |_| |")
  4937.   drawAt(1,17,"|                                     '._____.'   |")
  4938.   drawAt(1,18,"+-------------------------------------------------+")
  4939.       centerPrint(2,"Boxer Tournament Ver "..version)
  4940.   for i = 1, #menuOptions do
  4941.         drawAt(3,i + 4,"*")
  4942.         drawAt(5,i + 4,menuOptions[i])
  4943.   end
  4944.   drawCursor(2,4,3 + menuStat)
  4945. end
  4946. end
  4947.  
  4948.  
  4949.  
  4950.  
  4951.  
  4952. --Draws The Difficulty Menu
  4953. function drawDifMenuU()
  4954.   cleanScreen()
  4955.   if colorsOnOff == "OFF" then
  4956.   drawAt(1,1,"+-------------------------------------------------+")
  4957.   drawAt(1,2,"|                                                 |") --Draw Difficulty at 19
  4958.   drawAt(1,3,"+-------------------------------------------------+")
  4959.   drawAt(1,4,"|                                                 |")
  4960.   drawAt(1,5,"|                                                 |")
  4961.   drawAt(1,6,"|                                                 |")
  4962.   drawAt(1,7,"|                                                 |")
  4963.   drawAt(1,8,"|                                                 |")
  4964.   drawAt(1,9,"|                                                 |")
  4965.   drawAt(1,10,"|                                                 |")
  4966.   drawAt(1,11,"|                                                 |")
  4967.   drawAt(1,12,"|                                                 |")
  4968.   drawAt(1,13,"|                                                 |")
  4969.   drawAt(1,14,"|                                                 |")
  4970.   drawAt(1,15,"|                                                 |")
  4971.   drawAt(1,16,"|                                                 |")
  4972.   drawAt(1,17,"|                                                 |")
  4973.   drawAt(1,18,"+-------------------------------------------------+")
  4974.   for i = 1, #menuOptions do
  4975.         drawAt(22,i + 4,dMenuOptions[i])
  4976.   end
  4977.   drawDifCursor(20,3 + menuStat)
  4978.  
  4979.    elseif colorsOnOff == "ON" then
  4980.   term.setBackgroundColor(ttBackColor)
  4981.   term.setTextColor(ttTextColor)
  4982.   drawAt(1,1,"                                                   ")
  4983.   drawAt(1,2,"                                                   ")
  4984.   drawAt(1,3,"                                                   ")
  4985.  
  4986.     term.setBackgroundColor(menuBackColor)
  4987.   term.setTextColor(menuTextColor)
  4988.  
  4989.   drawAt(1,4,"                                                   ")
  4990.   drawAt(1,5,"                                                   ")
  4991.   drawAt(1,6,"                                                   ")
  4992.   drawAt(1,7,"                                                   ")
  4993.   drawAt(1,8,"                                                   ")
  4994.   drawAt(1,9,"                                                   ")
  4995.   drawAt(1,10,"                                                   ")
  4996.   drawAt(1,11,"                                                   ")
  4997.   drawAt(1,12,"                                                   ")
  4998.   drawAt(1,13,"                                                   ")
  4999.   drawAt(1,14,"                                                   ")
  5000.   drawAt(1,15,"                                                   ")
  5001.   drawAt(1,16,"                                                   ")
  5002.   drawAt(1,17,"                                                   ")
  5003.   drawAt(1,18,"                                                   ")
  5004.   drawAt(1,19,"                                                   ")
  5005.  
  5006.    term.setTextColor(colors.gray)
  5007.    centerPrint(6,"EASY")
  5008.    term.setTextColor(colors.gray)
  5009.    centerPrint(7,"NORMAL")
  5010.    term.setTextColor(colors.gray)
  5011.    centerPrint(8,"HARD")
  5012.    term.setTextColor(colors.gray)
  5013.    centerPrint(9,"EXTREME")  
  5014.    term.setTextColor(colors.black)
  5015.    drawDifCursor(20,4 + menuStat)
  5016. end
  5017.  end
  5018.  
  5019.  
  5020.  
  5021.  
  5022.  
  5023.  
  5024. --Draws The Difficulty Menu
  5025. function drawDifMenu()
  5026.   if colorsOnOff == "OFF" then
  5027.   cleanScreen()
  5028.   drawAt(1,1,"+-------------------------------------------------+")
  5029.   drawAt(1,2,"|               --[Difficulty]--                  |")
  5030.   drawAt(1,3,"+-------------------------------------------------+")
  5031.   drawAt(1,4,"|                                                 |")
  5032.   drawAt(1,5,"|                                                 |")
  5033.   drawAt(1,6,"|                                                 |")
  5034.   drawAt(1,7,"|                                                 |")
  5035.   drawAt(1,8,"|                                                 |")
  5036.   drawAt(1,9,"|                                                 |")
  5037.   drawAt(1,10,"|                                                 |")
  5038.   drawAt(1,11,"|                                                 |")
  5039.   drawAt(1,12,"|                                                 |")
  5040.   drawAt(1,13,"|                                                 |")
  5041.   drawAt(1,14,"|                                                 |")
  5042.   drawAt(1,15,"|                                                 |")
  5043.   drawAt(1,16,"|                                                 |")
  5044.   drawAt(1,17,"|                                                 |")
  5045.   drawAt(1,18,"+-------------------------------------------------+")
  5046.   for i = 1, #menuOptions do
  5047.         drawAt(22,i + 4,dMenuOptions[i])
  5048.   end
  5049.   drawDifCursor(20,3 + menuStat)
  5050.  
  5051.   elseif colorsOnOff == "ON" then
  5052.   term.setBackgroundColor(ttBackColor)
  5053.   term.setTextColor(ttTextColor)
  5054.   drawAt(1,1,"                                                   ")
  5055.   drawAt(1,2,"                                                   ")
  5056.   drawAt(1,3,"                                                   ")
  5057.   centerPrint(2,"--[Difficulty]--")
  5058.  
  5059.     term.setBackgroundColor(menuBackColor)
  5060.   term.setTextColor(menuTextColor)
  5061.  
  5062.   drawAt(1,4,"                                                   ")
  5063.   drawAt(1,5,"                                                   ")
  5064.   drawAt(1,6,"                                                   ")
  5065.   drawAt(1,7,"                                                   ")
  5066.   drawAt(1,8,"                                                   ")
  5067.   drawAt(1,9,"                                                   ")
  5068.   drawAt(1,10,"                                                   ")
  5069.   drawAt(1,11,"                                                   ")
  5070.   drawAt(1,12,"                                                   ")
  5071.   drawAt(1,13,"                                                   ")
  5072.   drawAt(1,14,"                                                   ")
  5073.   drawAt(1,15,"                                                   ")
  5074.   drawAt(1,16,"                                                   ")
  5075.   drawAt(1,17,"                                                   ")
  5076.   drawAt(1,18,"                                                   ")
  5077.   drawAt(1,19,"                                                   ")
  5078.  
  5079.    term.setTextColor(colors.green)
  5080.    centerPrint(6,"EASY")
  5081.    term.setTextColor(colors.cyan)
  5082.    centerPrint(7,"NORMAL")
  5083.    term.setTextColor(colors.orange)
  5084.    centerPrint(8,"HARD")
  5085.    term.setTextColor(colors.red)
  5086.    centerPrint(9,"EXTREME")  
  5087.    term.setTextColor(colors.black)
  5088.    drawDifCursor(20,4 + menuStat)
  5089.   term.setBackgroundColor(colors.black)  
  5090.   term.setTextColor(colors.white)
  5091. end
  5092.  end
  5093.  
  5094.  
  5095. function drawHomeCharacter()
  5096. if colorsOnOff == "ON" then
  5097. if hDetailLevel == "LOW" then
  5098.  
  5099. term.setTextColor(colors.white)
  5100. term.setBackgroundColor(colors.lightGray)
  5101. drawAt(28,1,"                                           ")
  5102. term.setBackgroundColor(colors.black)
  5103. drawAt(28,2,"   |======| "..myName.."                   ")
  5104. drawAt(28,3,"   | O ..O| HP:"..hp.."/"..tHP.."          ")
  5105. drawAt(28,4,"   |  _   | STA:"..sta.."/"..tSta.."       ")
  5106. drawAt(28,5,"   |      | XP:"..xp.."/"..totalXp.."                  ")
  5107. drawAt(28,6,"   |------+ LVL:"..lvl.."                               ")
  5108. drawAt(28,7,"    MONEY:"..money.."$                                        ")
  5109. drawAt(28,8,"    WINS:"..wins.."                                        ")
  5110. drawAt(28,9,"    LOSSES:"..loss.."                                        ")
  5111. drawAt(28,10,"   SCORE:"..myScore.."                                         ")
  5112. drawAt(1,11,"                                                    ")
  5113. drawAt(1,12,"                                                    ")
  5114. drawAt(1,13,"                                                    ")
  5115. drawAt(1,14,"                                                    ")
  5116. drawAt(1,15,"                                                    ")
  5117. drawAt(1,16,"                                                    ")
  5118. drawAt(1,17,"                                                    ")
  5119. drawAt(1,18,"                                                    ")
  5120. term.setBackgroundColor(colors.lightGray)
  5121. drawAt(1,19,"                                                    ")
  5122.  
  5123. term.setBackgroundColor(menuBackColor)
  5124. term.setTextColor(menuTextColor)
  5125.  
  5126.  
  5127. term.setBackgroundColor(menuBackColor)
  5128. term.setTextColor(menuTextColor)
  5129.  
  5130. elseif hDetailLevel == "NORMAL" or hDetailLevel == "HIGH" or hDetailLevel == "EXTREME" then
  5131.  
  5132. term.setTextColor(colors.white)
  5133. term.setBackgroundColor(colors.lightGray)
  5134. drawAt(28,1,"                                            ")
  5135. term.setBackgroundColor(colors.black)
  5136. drawAt(28,2,"    ''''''  "..myName.."                    ")
  5137. drawAt(28,3,"   ' .   .  HP:"..hp.."/"..tHP.."           ")
  5138. drawAt(28,4,"   d   -  | STA:"..sta.."/"..tSta.."        ")
  5139. drawAt(28,5,"   |  _   | XP:"..xp.."/"..totalXp.."                   ")
  5140. drawAt(28,6,"   |______/ LVL:"..lvl.."                                ")
  5141. drawAt(28,7,"    MONEY:"..money.."$                                        ")
  5142. drawAt(28,8,"    WINS:"..wins.."                                           ")
  5143. drawAt(28,9,"    LOSSES:"..loss.."                                       ")
  5144. drawAt(28,10,"    SCORE:"..myScore.."                                         ")
  5145. drawAt(1,11,"                                                    ")
  5146. drawAt(1,12,"                                                    ")
  5147. drawAt(1,13,"                                                    ")
  5148. drawAt(1,14,"                                                    ")
  5149. drawAt(1,15,"                                                    ")
  5150. drawAt(1,16,"                                                    ")
  5151. drawAt(1,17,"                                                    ")
  5152. drawAt(1,18,"                                                    ")
  5153. term.setBackgroundColor(colors.lightGray)
  5154. drawAt(1,19,"                                                    ")
  5155.  
  5156. term.setBackgroundColor(menuBackColor)
  5157. term.setTextColor(menuTextColor)
  5158. end
  5159.  
  5160.  
  5161. elseif colorsOnOff == "OFF" then
  5162.  
  5163. if hDetailLevel == "LOW" then
  5164.  
  5165. drawAt(28,1,"                                           ")
  5166. drawAt(28,2,"|======| "..myName.."                   ")
  5167. drawAt(28,3,"| O ..O| HP:"..hp.."/"..tHP.."          ")
  5168. drawAt(28,4,"|  _   | STA:"..sta.."/"..tSta.."       ")
  5169. drawAt(28,5,"|      | XP:"..xp.."/"..totalXp.."                  ")
  5170. drawAt(28,6,"|------+ LVL:"..lvl.."                               ")
  5171. drawAt(28,7," MONEY:"..money.."$                                           ")
  5172. drawAt(28,8," WINS:"..wins.."                                           ")
  5173. drawAt(28,9," LOSSES:"..loss.."                                           ")
  5174. drawAt(28,10," SCORE:"..myScore.."                                           ")
  5175.  
  5176.  
  5177.  
  5178.  
  5179.  
  5180.  
  5181. elseif hDetailLevel == "NORMAL" or hDetailLevel == "HIGH" or hDetailLevel == "EXTREME" then
  5182.  
  5183. drawAt(28,1,"                                            ")
  5184. drawAt(28,2," ''''''  "..myName.."                    ")
  5185. drawAt(28,3,"' .   .  HP:"..hp.."/"..tHP.."           ")
  5186. drawAt(28,4,"d   -  | STA:"..sta.."/"..tSta.."        ")
  5187. drawAt(28,5,"|  _   | XP:"..xp.."/"..totalXp.."                   ")
  5188. drawAt(28,6,"|______/ LVL:"..lvl.."                                ")
  5189. drawAt(28,7," MONEY:"..money.."$                                        ")
  5190. drawAt(28,8," WINS:"..wins.."                                           ")
  5191. drawAt(28,9," LOSSES:"..loss.."                                       ")
  5192. drawAt(28,10," SCORE:"..myScore.."                                         ")
  5193.  
  5194.  
  5195.  end
  5196.   end
  5197.    end
  5198.  
  5199.  
  5200.  
  5201.  
  5202.  
  5203.  
  5204.            
  5205.            --Draws the Home Menu
  5206. function drawHomeMenu()
  5207.   cleanScreen()
  5208.   if colorsOnOff == "OFF" then
  5209.   drawAt(1,1,"+-------------------------+")
  5210.   drawAt(1,2,"|         HOME            |======+ "..myName.."   ")
  5211.   drawAt(1,3,"|-------------------------| O ..O| HP:"..hp.."/"..tHP)
  5212.   drawAt(1,4,"|                         |  _   | STA:"..sta.."/"..tSta)
  5213.   drawAt(1,5,"|                         |      | XP:"..xp.."/"..totalXp)
  5214.   drawAt(1,6,"|                         |------+ LVL:"..lvl.."/"..mLvl)
  5215.   drawAt(1,7,"|                         | MONEY:"..money.."$    ")
  5216.   drawAt(1,8,"|                         | WINS:"..wins.."       ")
  5217.   drawAt(1,9,"|                         | LOSSES:"..loss.."      ")
  5218.   drawAt(1,10,"|                         | SCORE:"..myScore.."   ")
  5219.   drawAt(1,11,"+-------------------------+")
  5220.  
  5221.  
  5222.   for i = 1, #hMenuOptions do
  5223.         drawAt(4,i + 3,"*")
  5224.         drawAt(6,i + 3,hMenuOptions[i])
  5225.         drawHomeCharacter()
  5226.         end
  5227.         drawCursor(3,5,2 + menuStat)
  5228.        
  5229.    elseif colorsOnOff == "ON" then
  5230.    
  5231.    term.setBackgroundColor(ttBackColor)
  5232.    term.setTextColor(ttTextColor)
  5233.    drawAt(1,1,"                           ")
  5234.    drawAt(1,2,"          HOME             ")
  5235.    drawAt(1,3,"                           ")
  5236.    
  5237.      term.setBackgroundColor(menuBackColor)
  5238.    term.setTextColor(menuTextColor)
  5239.    drawAt(1,4,"                           ")
  5240.    drawAt(1,5,"                           ")
  5241.    drawAt(1,6,"                           ")
  5242.    drawAt(1,7,"                           ")
  5243.    drawAt(1,8,"                           ")
  5244.    drawAt(1,9,"                           ")
  5245.    drawAt(1,10,"                           ")
  5246.    drawAt(1,11,"                           ")
  5247.    for i = 1, #hMenuOptions do
  5248.    term.setTextColor(colors.black)
  5249.         drawAt(4,i + 3,"*")
  5250.         drawAt(6,i + 3,hMenuOptions[i])
  5251.         drawHomeCharacter()
  5252.         end
  5253.         drawCursor(3,5,2 + menuStat)
  5254.         term.setBackgroundColor(colors.black)
  5255.         term.setTextColor(colors.white)
  5256.   end
  5257.  
  5258.  end
  5259.  
  5260.                    
  5261.            
  5262. ---------------------------------------------------------------------------------------------------
  5263. --Draws Warning Menu
  5264. function drawWarningMenu()
  5265. if colorsOnOff == "OFF" then
  5266. cleanScreen()
  5267. drawAt(1,1,"+-------------------------------------------------+")
  5268. drawAt(1,2,"|           #####---!WARNING!---#####             |")
  5269. drawAt(1,3,"+-------------------------------------------------+")
  5270. drawAt(1,4,"|      If you quit to the main menu you will      |")
  5271. drawAt(1,5,"|    lose all unsaved progress made in the game.  |")
  5272. drawAt(1,6,"|        ARE YOU SURE YOU WANT TO QUIT?           |")
  5273. drawAt(1,7,"|                                                 |")
  5274. drawAt(1,8,"|                                                 |")
  5275. drawAt(1,9,"|                                                 |")
  5276. drawAt(1,10,"+-------------------------------------------------+")
  5277.  
  5278. for i = 1, #warningOptions do
  5279.         drawAt(20,i + 6,"*")
  5280.         drawAt(22,i + 6,warningOptions[i])
  5281.   end
  5282.   drawCursor(19,21,2 + menuStat)
  5283.  
  5284.   elseif colorsOnOff == "ON" then
  5285. cleanScreen()
  5286. term.setBackgroundColor(ttBackColor)
  5287. term.setBackgroundColor(ttTextColor)
  5288. drawAt(1,1,"                                                   ")
  5289. drawAt(1,2,"            #####---!WARNING!---#####              ")
  5290. drawAt(1,3,"                                                   ")
  5291.  
  5292. term.setBackgroundColor(menuBackColor)
  5293. term.setTextColor(ttTextColor)
  5294. drawAt(1,4,"                                                   ")
  5295. drawAt(1,5,"       If you quit to the main menu you will       ")
  5296. drawAt(1,6,"     lose all unsaved progress made in the game.   ")
  5297. drawAt(1,7,"         ARE YOU SURE YOU WANT TO QUIT?            ")
  5298. drawAt(1,8,"                                                   ")
  5299. drawAt(1,9,"                                                   ")
  5300. drawAt(1,10,"                                                   ")
  5301. drawAt(1,11,"                                                   ")
  5302. term.setBackgroundColor(colors.lightGray)
  5303. drawAt(1,12,"                                                   ")
  5304. term.setBackgroundColor(menuBackColor)
  5305. for i = 1, #warningOptions do
  5306.         drawAt(20,i + 7,"*")
  5307.         drawAt(22,i + 7,warningOptions[i])
  5308.   end
  5309.   drawCursor(19,21,3 + menuStat)
  5310.   term.setBackgroundColor(colors.black)
  5311. term.setTextColor(colors.white)
  5312.  
  5313. end
  5314. end
  5315.  
  5316.  
  5317. ---------------------------------------------------------------------------------------------------
  5318.  
  5319. function drawBoxerAscii()
  5320. if colorsOnOff == "OFF" then
  5321. drawAt(17,6,"                 /////' ")
  5322. drawAt(17,7,"                '  o o  ")
  5323. drawAt(17,8,"                C   - | ")
  5324. drawAt(17,9,"  ___           '  =__'        ___")
  5325. drawAt(17,10," (' _ \\_        |   |        _/  ')")
  5326. drawAt(17,11,"  \\  (__\\   ,---- _ |----.  / __)-|")
  5327. drawAt(17,12,"   \\__  (  (           /  ) )  __/")
  5328. drawAt(17,13,"     |_X_\\/  \\.   # _. |  \\/_X_|")
  5329. drawAt(17,14,"       |  \\  /(   /    /\\ /  |")
  5330. drawAt(17,15,"        \\ /   (  ,    /  \\ _/")
  5331. drawAt(17,16,"              /      /")
  5332. drawAt(17,17,"             [:::::::]")
  5333.  
  5334.  
  5335. elseif colorsOnOff == "ON" then
  5336. term.setBackgroundColor(colors.lightGray)
  5337. term.setTextColor(colors.white)
  5338. drawAt(17,5,"             Boxer Ascii           ")
  5339.  
  5340. term.setBackgroundColor(colors.black)
  5341. term.setTextColor(colors.white)
  5342. drawAt(17,6,"                 /////'             ")
  5343. drawAt(17,7,"                '  o o              ")
  5344. drawAt(17,8,"                C   - |             ")
  5345. drawAt(17,9,"  ___           '  =__'        ___ ")
  5346. drawAt(17,10," (' _ \\_        |   |        _/  ') ")
  5347. drawAt(17,11,"  \\  (__\\   ,---- _ |----.  / __)-| ")
  5348. drawAt(17,12,"   \\__  (  (           /  ) )  __/   ")
  5349. drawAt(17,13,"     |_X_\\/  \\.   # _. |  \\/_X_|   ")
  5350. drawAt(17,14,"       |  \\  /(   /    /\\ /  |      ")
  5351. drawAt(17,15,"        \\ /   (  ,    /  \\ _/       ")
  5352. drawAt(17,16,"              /      /                ")
  5353. drawAt(17,17,"             [:::::::]                ")
  5354.  
  5355. term.setBackgroundColor(colors.lightGray)
  5356. drawAt(17,18,"              2013                  ")
  5357.  
  5358. term.setBackgroundColor(menuBackColor)
  5359. term.setTextColor(menuTextColor)
  5360. end
  5361.  end
  5362.  
  5363. function drawChMenu()
  5364.   cleanScreen()
  5365.   if colorsOnOff == "OFF" then
  5366.   drawAt(1,1,"+-------------------------------------------------+")
  5367.   drawAt(1,2,"|               [Character Menu]                  |")
  5368.   drawAt(1,3,"+-------------------------------------------------+")
  5369.   drawAt(1,4,"|                                                 |")
  5370.   drawAt(1,5,"|                                                 |")
  5371.   drawAt(1,6,"|                                                 |")
  5372.   drawAt(1,7,"|                                                 |")
  5373.   drawAt(1,8,"|                                                 |")
  5374.   drawAt(1,9,"|                                                 |")
  5375.   drawAt(1,10,"|                                                 |")
  5376.   drawAt(1,11,"|                                                 |")
  5377.   drawAt(1,12,"|                                                 |")
  5378.   drawAt(1,13,"|                                                 |")
  5379.   drawAt(1,14,"|                                                 |")
  5380.   drawAt(1,15,"|                                                 |")
  5381.   drawAt(1,16,"|                                                 |")
  5382.   drawAt(1,17,"|                                                 |")
  5383.   drawAt(1,18,"+-------------------------------------------------+")
  5384.   for i = 1, #chMenuOptions do
  5385.         drawAt(3,i + 4,"*")
  5386.         drawAt(5,i + 4,chMenuOptions[i])
  5387.         drawBoxerAscii()
  5388.   end
  5389.   drawCursor(2,4,3 + menuStat)
  5390.  
  5391.   elseif colorsOnOff == "ON" then
  5392.  
  5393.   term.setTextColor(ttTextColor)
  5394.   term.setBackgroundColor(ttBackColor)
  5395.  
  5396.   drawAt(1,1,"                                                   ")
  5397.   drawAt(1,2,"                [Character Menu]                   ")
  5398.   drawAt(1,3,"                                                   ")
  5399.  
  5400.   term.setTextColor(menuTextColor)
  5401.   term.setBackgroundColor(menuBackColor)
  5402.  
  5403.   drawAt(1,4,"                                                   ")
  5404.   drawAt(1,5,"                                                   ")
  5405.   drawAt(1,6,"                                                   ")
  5406.   drawAt(1,7,"                                                   ")
  5407.   drawAt(1,8,"                                                   ")
  5408.   drawAt(1,9,"                                                   ")
  5409.   drawAt(1,10,"                                                   ")
  5410.   drawAt(1,11,"                                                   ")
  5411.   drawAt(1,12,"                                                   ")
  5412.   drawAt(1,13,"                                                   ")
  5413.   drawAt(1,14,"                                                   ")
  5414.   drawAt(1,15,"                                                   ")
  5415.   drawAt(1,16,"                                                   ")
  5416.   drawAt(1,17,"                                                   ")
  5417.   drawAt(1,18,"                                                   ")
  5418.   drawAt(1,19,"                                                   ")
  5419.  
  5420.   for i = 1, #chMenuOptions do
  5421.         drawAt(3,i + 4,"*")
  5422.         drawAt(5,i + 4,chMenuOptions[i])
  5423.         drawBoxerAscii()
  5424.   end
  5425.   drawCursor(2,4,3 + menuStat)
  5426.   term.setTextColor(colors.white)
  5427.   term.setBackgroundColor(colors.black)
  5428. end
  5429.  end
  5430.  
  5431.  
  5432. --Credits
  5433.  
  5434.  
  5435.  
  5436. function cEvents()   
  5437. event, p1 = os.pullEvent()
  5438.  
  5439.         if event == "key" and
  5440.           p1 == 28 then
  5441.           inCredits = false
  5442.          
  5443.          elseif p1 == 200 then
  5444.          yCrdPos = yCrdPos + 1
  5445.          scrollBar = scrollBar - 1  
  5446.          if scrollBar < 4 then
  5447.          scrollBar = 4
  5448.          yCrdPos = 10
  5449.          end
  5450.          
  5451.          elseif p1 == 208 then
  5452.          yCrdPos = yCrdPos - 1
  5453.          scrollBar = scrollBar + 1
  5454.          if scrollBar > 17 then
  5455.          scrollBar = 17
  5456.          yCrdPos = yCrdPos + 1
  5457.          end
  5458.           end  
  5459.             end      
  5460.              
  5461.  
  5462.  
  5463. --Credits
  5464. function credits()
  5465.  
  5466. inCredits = true
  5467. yCrdPos = 10
  5468. scrollBar = 4
  5469.  
  5470. while inCredits do
  5471. cleanScreen()
  5472. drawCredits()
  5473. drawExtra()
  5474. cEvents()
  5475. end
  5476.  end
  5477.  
  5478. function drawExtra()
  5479. if colorsOnOff == "OFF" then
  5480. drawAt(1,1,"+-------------------------------------------------+")
  5481. drawAt(1,2,"|                    --CREDITS--                  |")
  5482. drawAt(1,3,"|-------------------------------------------------|")
  5483.  
  5484. drawAt(1,18,"+-------------------------------------------------+")
  5485. drawAt(1,19,"              --PRESS [ENTER] TO EXIT--              ")
  5486.  
  5487. elseif colorsOnOff == "ON" then
  5488. term.setTextColor(colors.black)
  5489. term.setBackgroundColor(colors.cyan)
  5490. drawAt(1,1,"                                                   ")
  5491. drawAt(1,2,"                     --CREDITS--                   ")
  5492. drawAt(1,3,"                                                   ")
  5493.  
  5494. term.setBackgroundColor(colors.cyan)
  5495. term.setTextColor(colors.black)
  5496. drawAt(1,18,"                                                   ")
  5497. drawAt(1,19,"             --PRESS [ENTER] TO EXIT--              ")
  5498.  
  5499. end
  5500.  end
  5501.  
  5502.  
  5503. function drawCredits()
  5504.  
  5505.  
  5506.  
  5507. creditsMenuArt = {  
  5508. "+-------------------------------------------------+",
  5509. "|                    --CREDITS--                  |",
  5510. "|-------------------------------------------------|",
  5511. "|                                               | |",
  5512. "|                                               | |",
  5513. "|                                               | |",
  5514. "|                                               | |",
  5515. "|                                               | |",
  5516. "|                                               | |",
  5517. "|                                               | |", 
  5518. "|                                               | |",
  5519. "|                                               | |",
  5520. "|                                               | |",
  5521. "|                                               | |",
  5522. "|                                               | |",
  5523. "|                                               | |",
  5524. "|                                               | |",
  5525. "+-------------------------------------------------+",
  5526. "               --PRESS [ENTER] TO EXIT--            ",
  5527. }
  5528.  
  5529. creditsMenuArtCol = {  
  5530. "                                                   ",
  5531. "                     --CREDITS--                   ",
  5532. "                                                   ",
  5533. "                                                | |",
  5534. "                                                | |",
  5535. "                                                | |",
  5536. "                                                | |",
  5537. "                                                | |",
  5538. "                                                | |",
  5539. "                                                | |", 
  5540. "                                                | |",
  5541. "                                                | |",
  5542. "                                                | |",
  5543. "                                                | |",
  5544. "                                                | |",
  5545. "                                                | |",
  5546. "                                                | |",
  5547. "+-------------------------------------------------+",
  5548. "               --PRESS [ENTER] TO EXIT--            ",
  5549. }
  5550.  
  5551.  
  5552.  
  5553.  if colorsOnOff == "OFF" then
  5554. for i = 1, #creditsMenuArt do
  5555.    drawAt(1,i,creditsMenuArt[i])
  5556.    drawAt(50,scrollBar,"=")
  5557.    drawAt(16,yCrdPos - 3,"Boxer Tournament 2013(c)")
  5558.    drawAt(19,yCrdPos,"Author: Hellkid98")
  5559.    drawAt(19,yCrdPos + 3,"+--PROGRAMMERS--+")
  5560.    drawAt(21,yCrdPos + 5,"Single Player")
  5561. drawAt(23,yCrdPos + 7,"Hellkid98")
  5562. drawAt(22,yCrdPos + 10,"Multiplayer")
  5563. drawAt(25,yCrdPos + 12,"Herû")
  5564.  
  5565. drawAt(21,yCrdPos + 15,"ccConfig API")
  5566. drawAt(20,yCrdPos + 17,"theoriginalbit")
  5567.    end
  5568.  
  5569.  elseif colorsOnOff == "ON" then
  5570. for i = 1, #creditsMenuArt do
  5571.     term.setBackgroundColor(colors.white)
  5572.     term.setTextColor(colors.black)
  5573.    
  5574.    drawAt(1,i,creditsMenuArtCol[i])
  5575.    term.setBackgroundColor(colors.gray)
  5576.    drawAt(50,scrollBar," ")
  5577.    
  5578.    term.setBackgroundColor(colors.white)
  5579.    term.setTextColor(colors.red)
  5580.    drawAt(16,yCrdPos - 3,"Boxer Tournament 2013(c)")
  5581.     term.setTextColor(colors.black)
  5582.    drawAt(19,yCrdPos,"Author: Hellkid98")
  5583.    drawAt(19,yCrdPos + 3,"+--PROGRAMMERS--+")
  5584. drawAt(21,yCrdPos + 5,"Single Player")
  5585. term.setTextColor(colors.blue)
  5586. drawAt(23,yCrdPos + 7,"Hellkid98")
  5587. term.setTextColor(colors.black)
  5588. drawAt(22,yCrdPos + 10,"Multiplayer")
  5589. term.setTextColor(colors.blue)
  5590. drawAt(25,yCrdPos + 12,"Herû")
  5591. term.setTextColor(colors.black)
  5592. drawAt(21,yCrdPos + 15,"ccConfig API")
  5593. term.setTextColor(colors.purple)
  5594. drawAt(20,yCrdPos + 17,"theoriginalbit")
  5595.   term.setTextColor(colors.white)
  5596.   term.setBackgroundColor(colors.black)
  5597.    end
  5598.      end
  5599.        end
  5600.  
  5601.  
  5602.      
  5603.  
  5604.      
  5605.  
  5606.  
  5607.  
  5608.  
  5609. function highScore()
  5610. highCheck()
  5611. cleanScreen()
  5612.  
  5613. if colorsOnOff == "ON" then
  5614. term.setTextColor(ttTextColor)
  5615. term.setBackgroundColor(ttBackColor)
  5616.  
  5617.  
  5618. drawAt(1,1,"                                                   ")
  5619. drawAt(1,2,"                 +--Highscore--+                   ")
  5620. drawAt(1,3,"                                                   ")
  5621.  
  5622. term.setTextColor(menuTextColor)
  5623. term.setBackgroundColor(menuBackColor)
  5624. drawAt(1,4,"                                                   ")
  5625. drawAt(1,5,"    1.                                             ")
  5626. drawAt(1,6,"    2.                                             ")
  5627. drawAt(1,7,"    3.                                             ")
  5628. drawAt(1,8,"    4.                                             ")  
  5629. drawAt(1,9,"    5.                                             ")  
  5630. drawAt(1,10,"    6.                                             ") 
  5631. drawAt(1,11,"    7.                                             ") 
  5632. drawAt(1,12,"    8.                                             ")
  5633. drawAt(1,13,"    9.                                             ")
  5634. drawAt(1,14,"   10.                                             ")
  5635. drawAt(1,15,"                                                   ")
  5636. drawAt(1,16,"                                                   ")
  5637. term.setBackgroundColor(ttBackColor)
  5638. drawAt(1,17,"                                                   ")
  5639. drawAt(1,18,"            PRESS [ENTER] TO EXIT                  ")
  5640. drawAt(1,19,"                                                   ")
  5641. term.setBackgroundColor(menuBackColor)
  5642.  
  5643.  
  5644.  
  5645. drawNames()
  5646. drawScores()
  5647.  
  5648. while true do  
  5649. event, p1 = os.pullEvent()
  5650.         if event == "key" then
  5651.           if p1 == 28 then
  5652. return
  5653. end
  5654.  end
  5655.   end
  5656.  
  5657. elseif colorsOnOff == "OFF" then
  5658. drawAt(1,1,"+-------------------------------------------------+")
  5659. drawAt(1,2,"|                +--Highscore--+                  |")
  5660. drawAt(1,3,"|-------------------------------------------------|")
  5661. drawAt(1,4,"|                                                 |")
  5662. drawAt(1,5,"|   1.                                            |")
  5663. drawAt(1,6,"|   2.                                            |")
  5664. drawAt(1,7,"|   3.                                            |")
  5665. drawAt(1,8,"|   4.                                            |")  
  5666. drawAt(1,9,"|   5.                                            |")  
  5667. drawAt(1,10,"|   6.                                            |") 
  5668. drawAt(1,11,"|   7.                                            |") 
  5669. drawAt(1,12,"|   8.                                            |")
  5670. drawAt(1,13,"|   9.                                            |")
  5671. drawAt(1,14,"|  10.                                            |")
  5672. drawAt(1,15,"|                                                 |")
  5673. drawAt(1,16,"|                                                 |")
  5674. drawAt(1,17,"+-------------------------------------------------+")
  5675. drawAt(1,18,"            PRESS [ENTER] TO EXIT                  ")
  5676. drawAt(1,19,"")
  5677.  
  5678. drawNames()
  5679. drawScores()
  5680.  
  5681. while true do  
  5682. event, p1 = os.pullEvent()
  5683.         if event == "key" then
  5684.           if p1 == 28 then
  5685. return
  5686. end
  5687. end
  5688. end
  5689. end
  5690.  end
  5691.      
  5692.  
  5693. ---------------------------------------------------------------------------------------------------
  5694. --HIGHSCORE
  5695. ---------------------------------------------------------------------------------------------------
  5696. function drawNames()
  5697. drawAt(8,5,myNm1)
  5698. drawAt(8,6,myNm2)
  5699. drawAt(8,7,myNm3)
  5700. drawAt(8,8,myNm4)
  5701. drawAt(8,9,myNm5)
  5702. drawAt(8,10,myNm6)
  5703. drawAt(8,11,myNm7)
  5704. drawAt(8,12,myNm8)
  5705. drawAt(8,13,myNm9)
  5706. drawAt(8,14,myNm10)
  5707. end
  5708.  
  5709. function drawScores()
  5710. drawAt(21,5,"Score:"..mySc1)
  5711. drawAt(21,6,"Score:"..mySc2)
  5712. drawAt(21,7,"Score:"..mySc3)
  5713. drawAt(21,8,"Score:"..mySc4)
  5714. drawAt(21,9,"Score:"..mySc5)
  5715. drawAt(21,10,"Score:"..mySc6)
  5716. drawAt(21,11,"Score:"..mySc7)
  5717. drawAt(21,12,"Score:"..mySc8)
  5718. drawAt(21,13,"Score:"..mySc9)
  5719. drawAt(21,14,"Score:"..mySc10)
  5720. end
  5721.            
  5722.  
  5723. ---------------------------------------------------------------------------------------------------
  5724.  
  5725.  
  5726.  
  5727. function highCheck()
  5728.  
  5729.  
  5730.  
  5731. --Here It checks if the users are nil or not
  5732. if myNm1 == nil then
  5733. myNm1 = "No User"
  5734. end
  5735. if myNm2 == nil then
  5736. myNm2 = "No User"
  5737. end
  5738. if myNm3 == nil then
  5739. myNm3 = "No User"
  5740. end
  5741. if myNm4 == nil then
  5742. myNm4 = "No User"
  5743. end
  5744. if myNm5 == nil then
  5745. myNm5 = "No User"
  5746. end
  5747. if myNm6 == nil then
  5748. myNm6 = "No User"
  5749. end
  5750. if myNm7 == nil then
  5751. myNm7 = "No User"
  5752. end
  5753. if myNm8 == nil then
  5754. myNm8 = "No User"
  5755. end
  5756. if myNm9 == nil then
  5757. myNm9 = "No User"
  5758. end
  5759. if myNm10 == nil then
  5760. myNm10 = "No User"
  5761. end
  5762. --Here It checks Score
  5763. if mySc1 == nil then
  5764. mySc1 = 0
  5765. end
  5766. if mySc2 == nil then
  5767. mySc2 = 0
  5768. end
  5769. if mySc3 == nil then
  5770. mySc3 = 0
  5771. end
  5772. if mySc4 == nil then
  5773. mySc4 = 0
  5774. end
  5775. if mySc5 == nil then
  5776. mySc5 = 0
  5777. end
  5778. if mySc6 == nil then
  5779. mySc6 = 0
  5780. end
  5781. if mySc7 == nil then
  5782. mySc7 = 0
  5783. end
  5784. if mySc8 == nil then
  5785. mySc8 = 0
  5786. end
  5787. if mySc9 == nil then
  5788. mySc9 = 0
  5789. end
  5790. if mySc10 == nil then
  5791. mySc10 = 0
  5792. end
  5793.  
  5794.  
  5795.  
  5796. if myScore > mySc10 and
  5797. myScore < mySc9 then
  5798. myNm10 = myName
  5799. mySc10 = myScore
  5800. end
  5801. if myScore > mySc9 and
  5802. myScore < mySc8 then
  5803. myNm9 = myName
  5804. mySc9 = myScore
  5805. end
  5806. if myScore > mySc8 and
  5807. myScore < mySc7 then
  5808. myNm8 = myName
  5809. mySc8 = myScore
  5810. end
  5811. if myScore > mySc7 and
  5812. myScore < mySc6 then
  5813. myNm7 = myName
  5814. mySc7 = myScore
  5815. end
  5816. if myScore > mySc6 and
  5817. myScore < mySc5 then
  5818. myNm6 = myName
  5819. mySc6 = myScore
  5820. end
  5821. if myScore > mySc5 and
  5822. myScore < mySc4 then
  5823. myNm5 = myName
  5824. mySc5 = myScore
  5825. end
  5826. if myScore > mySc4 and
  5827. myScore < mySc3 then
  5828. myNm4 = myName
  5829. mySc4 = myScore
  5830. end
  5831. if myScore > mySc3 and
  5832. myScore < mySc2 then
  5833. myNm3 = myName
  5834. mySc3 = myScore
  5835. end
  5836. if myScore > mySc2 and
  5837. myScore < mySc1 then
  5838. myNm2 = myName
  5839. mySc2 = myScore
  5840. end
  5841. if myScore > mySc2 then
  5842. myNm1 = myName
  5843. mySc1 = myScore
  5844. end
  5845.  end
  5846.  
  5847.  
  5848. function enemyAction()
  5849. if enemyHP < 25 and
  5850. enemyPotions > 1 then
  5851. print(enemy.." Heals him/herself")
  5852. enemyHP = enemyHP + 25
  5853. enemyPotions = enemyPotions - 1
  5854. sleep(2)
  5855. end
  5856.  
  5857.  
  5858. if act == Punch then
  5859. enemyAct = math.random(1,4)
  5860. end
  5861.  
  5862. if act == Uppercut then
  5863. enemyAct = math.random(1,5)
  5864. end
  5865.  end
  5866.  
  5867.  
  5868.            
  5869.            
  5870. ---------------------------------------------------------------------------------------------------
  5871. --TOURNAMENT
  5872. ---------------------------------------------------------------------------------------------------
  5873.  
  5874. function startTournament()
  5875. load(8)
  5876. cleanScreen()
  5877. print("Nothing Available YET")
  5878. sleep(1)
  5879. return
  5880. end
  5881.  
  5882. ---------------------------------------------------------------------------------------------------
  5883. --QUICK MATCH
  5884. ---------------------------------------------------------------------------------------------------
  5885.  
  5886. function startFight()
  5887. enemyPotions = math.random(0,3)
  5888. matchPlaying = true
  5889. checkAvail()
  5890. checkXp()
  5891. if matchPlaying == false
  5892. then
  5893. solo()
  5894. end
  5895. load(6)
  5896. var = 0
  5897. checkDifficulty()
  5898. randomChallenger()
  5899. drawGrids()
  5900. drawMatchArt()
  5901.  
  5902. while true do
  5903. checkStatus()
  5904. checkMatch()
  5905.  
  5906. if matchPlaying == false
  5907. then
  5908. checkXp()
  5909. solo()
  5910. end
  5911.  
  5912. if cheatGodMode == true then
  5913. hp = tHP
  5914. sta = tSta
  5915. end
  5916.  
  5917. cleanScreen()
  5918. checkHP()
  5919. checkSta()
  5920. drawGrids()
  5921. drawMatchArt()
  5922. myAction()
  5923. end
  5924.    end
  5925.    
  5926.  
  5927.    
  5928.    
  5929. function myAction()
  5930. myAct = string.lower(read())
  5931.  
  5932. if myAct == "Punch" or myAct == "punch"
  5933. then
  5934.  
  5935. act = Punch
  5936. enemyAction()
  5937.  
  5938. if enemyAct == 1 or enemyAct == 2 then
  5939. drawGrids()
  5940. drawMatchArt()
  5941. print("")
  5942. print(myName.." did "..d.." damage")
  5943. sleep(0.5)
  5944. print(enemy.." did "..eAtk.." damage")
  5945. sta = sta - 1
  5946. enemyHP = enemyHP - d
  5947. hp = hp - eAtk
  5948. enemySta = enemySta - 1
  5949. sleep(1)
  5950. cleanScreen()
  5951.  
  5952. elseif enemyAct == 3 then
  5953. drawGrids()
  5954. drawMatchArt()
  5955. print("")
  5956. print(myName.." did "..d.." damage")
  5957. sta = sta - 1
  5958. enemyHP = enemyHP - d
  5959. sleep(1)
  5960. cleanScreen()
  5961.  
  5962.  
  5963. elseif enemyAct == 4 then
  5964. drawGrids()
  5965. drawMatchArt()
  5966. print("")
  5967. print(myName.." tries to punch "..enemy)
  5968. print("But "..enemy.." blocks the attack")
  5969. sta = sta - 1
  5970. sleep(3)
  5971. cleanScreen()
  5972. end
  5973. ------------------------
  5974.  
  5975. ------------------------
  5976. elseif myAct == "Punch Myself" or myAct == "punch myself"
  5977. then
  5978. drawGrids()
  5979. drawMatchArt()
  5980. print("")
  5981. print(myName.." punches himself/herself in the head.")
  5982. print(enemy.." just stands and stares.")
  5983. hp = hp - d
  5984. sleep(3)
  5985. cleanScreen()
  5986. ------------------------
  5987.  
  5988.  
  5989. ------------------------
  5990. elseif myAct == "Leave" or myAct == "leave" then
  5991. print("Goodbye")
  5992. sleep(1)
  5993. matchPlaying = false
  5994. ------------------------
  5995.  
  5996.  
  5997. ------------------------
  5998. elseif myAct == "Kill" or myAct == "kill" then
  5999. if cheatInstaKill == true then
  6000. enemyHP = enemyHP - enemyHP
  6001. print("Enemy will now die")
  6002. sleep(1)
  6003. cleanScreen()
  6004. end
  6005. ------------------------
  6006.  
  6007. elseif myAct == "Uppercut" or myAct == "uppercut" then
  6008. if lvl >= 5 then
  6009. act = Uppercut
  6010. enemyAction()
  6011.  
  6012. if enemyAct == 1 or enemyAct == 2 then
  6013. enemyHP = enemyHP - d
  6014. print(myName.." Did an Uppercut On "..enemy)
  6015. print("And Dealt "..d.." Damage")
  6016. sleep(2)
  6017. cleanScreen()
  6018.  
  6019. elseif enemyAct == 3 then
  6020. print(enemy.." Dodged "..myName.."'s attack")
  6021. sleep(2)
  6022. sta = sta - 2
  6023.  
  6024. elseif enemyAct == 4 then
  6025. print(enemy.." Dodged "..myName.."'s attack")
  6026. print("And Punched "..myName)
  6027. sleep(2)
  6028. sta = sta - 3
  6029. hp = hp - eAtk
  6030.  
  6031. elseif enemyAct == 5 then
  6032. print(enemy.." Blocked "..myName.."'s attack")
  6033. sleep(2)
  6034. sta = sta - 1
  6035. end
  6036.  end
  6037. ------------------------
  6038. elseif myAct == "Kick" or myAct == "kick" then
  6039. print("Soon My Friend")
  6040. sleep(2)
  6041. ------------------------
  6042. elseif myAct == "Dodge" or myAct == "dodge" then
  6043.  
  6044. dodge = math.random(1,3)
  6045. if dodge == 1 or dodge == 2 then
  6046. print(myName.." Dodged "..enemy.."'s attack successfully")
  6047. enemySta = enemySta - 3
  6048. sleep(2)
  6049.  
  6050. elseif dodge == 3 then
  6051. print(myName.." did'nt succeed to dodge")
  6052. print(enemy.." dealt "..eAtk.." damage")
  6053. hp = hp - eAtk
  6054. sleep(2)
  6055. end
  6056.  
  6057. ------------------------
  6058. elseif myAct == "Block" or myAct == "block" then
  6059. block = math.random(1,2)
  6060. if block == 1
  6061. then
  6062. print(enemy.." Blocked Successfully")
  6063. enemySta = enemySta - bSta
  6064. sleep(2)
  6065. cleanScreen()
  6066.  
  6067. elseif block == 2 then
  6068. print(enemy.." Blocked Unsuccessfully")
  6069. sleep(2)
  6070. hp = hp - eAtk
  6071. sleep(2)
  6072. cleanScreen()
  6073. end
  6074.  
  6075. else
  6076. term.setCursorPos(10,9)
  6077. print("Unknown Action")
  6078. sleep(0.2)
  6079. cleanScreen()
  6080.  end
  6081.   end
  6082. ------------------------
  6083.      
  6084. ---------------------------------------------------------------------------------------------------
  6085. ---------------------------------------------------------------------------------------------------
  6086.  
  6087.  
  6088.  
  6089.  
  6090.  
  6091.  
  6092. ---------------------------------------------------------
  6093. --CHEATS
  6094.  
  6095. --QuickLeveling = You Earn 10000xp when winning a match
  6096. --InstaKill = Enemies Die/lose directly so you win
  6097. --GodMode = You Have Unlimited Health/Sta
  6098. --NoClip = You Can Walk Through Houses And Stuff
  6099. --SuperFreak = You Deal Insane Damage
  6100. --UnlimitedMoney = You Have Unlimited Money
  6101. ---------------------------------------------------------
  6102.  
  6103.  
  6104. ---------------------------------------------------------------------------------------------------
  6105. ---------------------------------------------------------------------------------------------------
  6106. --Checks If someone Has Won
  6107. function checkMatch()
  6108. checkXp()
  6109. if enemyLvl > lvl then
  6110. mReward = 300
  6111. xpReward = 250
  6112. end
  6113. if enemyLvl == lvl then  
  6114. mReward = 150
  6115. xpReward = 150
  6116. end
  6117. if enemyLvl < lvl then
  6118. mReward = 150
  6119. xpReward = 100
  6120. end
  6121. if cheatQuickLeveling == true then
  6122. xpReward = 10000
  6123. end
  6124. myName = myName
  6125. enemy = enemy
  6126. d = damage1
  6127. damage1 = math.random(5,10)
  6128. eAtk = enemyDMG1
  6129. enemyDMG1 = math.random(2,8)
  6130. if hp == 0  or sta == 0 then
  6131. checkXp()
  6132. cleanScreen()
  6133. drawAt(11,9,enemy.." Won")
  6134. drawAt(11,10,"Score For This Match: 100")
  6135. myScore = myScore + 100
  6136. loss = loss + 1
  6137. checkXp()
  6138. sleep(2)
  6139. checkXp()
  6140. matchPlaying = false
  6141. end
  6142. if enemyHP == 0 or enemySta == 0
  6143. then
  6144. checkXp()
  6145. cleanScreen()
  6146. myScore = myScore + 450
  6147. xp = xp + xpReward
  6148. money = money + mReward
  6149. drawAt(11,9,myName.." Won")
  6150. drawAt(11,10,xpReward.." Xp Earned")
  6151. drawAt(11,11,mReward.." $ Earned")
  6152. drawAt(11,12,"Score For This Match: 450")
  6153. wins = wins + 1
  6154. checkXp()
  6155. sleep(2)
  6156. checkXp()
  6157. matchPlaying = false
  6158. end
  6159. if hp == 0  or sta == 0 and
  6160. enemyHP == 0 or enemySta == 0 then
  6161. drawAt(11,9,"It's A Tie")
  6162. return
  6163. end
  6164. end
  6165.  
  6166. ---------------------------------------------------------------------------------------------------
  6167.  
  6168. --Checks If you Can start the match
  6169. function checkAvail()
  6170. if hp == 0 then
  6171. cleanScreen()
  6172. term.setCursorPos(6,6)
  6173. print("Need to rest first!")
  6174. sleep(2)
  6175. matchPlaying = false
  6176. end
  6177. if sta == 0 then
  6178. cleanScreen()
  6179. term.setCursorPos(6,6)
  6180. print("Need to rest first!")
  6181. sleep(2)
  6182. matchPlaying = false
  6183. end
  6184. end
  6185.  
  6186. --Checks Status of HP/STA
  6187. function checkStatus()
  6188. checkXp()
  6189. if hp < 1 then hp = 0
  6190. end
  6191. if enemyHP < 1 then enemyHP = 0
  6192. end
  6193. if sta < 1 then sta = 0
  6194. end
  6195. if enemySta < 1 then enemySta = 0
  6196. end
  6197. end
  6198.  
  6199. ---------------------------------------------------------------------------------------------------
  6200.  
  6201. function checkXp()
  6202. if lvl == 9 and
  6203. xp >= totalXp then
  6204. cleanScreen()
  6205. drawAt(halfW,halfH - 1,"New Ability Unlocked!")
  6206. drawAt(halfW,halfH," ---UPPERCUT---")
  6207. sleep(3)
  6208. end
  6209.  
  6210.  
  6211.  
  6212. if xp >= totalXp and
  6213. lvl == 90 then
  6214. xp = 0
  6215. end
  6216.  
  6217. uD = 0
  6218. damage1 = math.random(5,10 + lvlD + uD)
  6219. damage2 = math.random(5,20 + lvlD + uD)
  6220. damage3 = math.random(5,30 + lvlD + uD)
  6221. damage4 = math.random(5,40 + lvlD + uD)
  6222. damage5 = math.random(5,50 + lvlD + uD)
  6223.  
  6224. local enemyDMG1 = math.random(2,8 + eLvlD)
  6225. local enemyDMG2 = math.random(10,15 + eLvlD)
  6226. local enemyDMG3 = math.random(20,30 + eLvlD)
  6227. local enemyDMG4 = math.random(30,45 + eLvlD)
  6228. local enemyDMG5 = math.random(50,60 + eLvlD)
  6229.  
  6230. while true do
  6231. if lvl >= 90 then
  6232. lvl = 90
  6233. enemyLvl = 90
  6234. end
  6235. xpLeft = xp - totalXp
  6236. --Checks if you level Up
  6237. if xp >= totalXp then
  6238. lvlUp = true
  6239. xp = 0 + xpLeft
  6240. lvl = lvl + 1
  6241.  lvlD = lvlD + 1
  6242.      totalXp = totalXp + 50
  6243.         tHP = tHP + 10
  6244.          tSta = tSta + 1
  6245.                     end
  6246.                    
  6247.       if  xp < totalXp then        
  6248.        lvlUp = false
  6249.        end     
  6250.        
  6251.       if not lvlUp then
  6252.       if lvl >= 90 then
  6253. lvl = 90
  6254. enemyLvl = 90
  6255. end
  6256.         break
  6257.        end
  6258.                    
  6259. if lvl > mLvl
  6260. then lvl = mLvl
  6261. end
  6262. if lvl == mLvl
  6263. then if xp > totalXp then
  6264. xp = totalXp
  6265. end
  6266. --Checks Level Properties
  6267. if lvl >= 10 then
  6268. d = damage2
  6269.  
  6270.  elseif lvl >= 20 then
  6271.   d = damage3
  6272.  
  6273.  elseif lvl >= 30 then
  6274.        d = damage4
  6275.  
  6276. elseif lvl >= 40 then
  6277.  d = damage5  
  6278.  end
  6279.   end
  6280.    end
  6281.     end
  6282.  
  6283. ---------------------------------------------------------------------------------------------------
  6284.  
  6285. --Checks if Hp are a larger value than the total Health
  6286. function checkHP()
  6287. if hp > tHP then
  6288.      hp = tHP
  6289.           end
  6290.             end
  6291.  
  6292. --Checks if Stamina have a larger value than the total Stamina
  6293. function checkSta()
  6294. if sta > tSta then
  6295.    sta = tSta
  6296.            end
  6297.              end
  6298.  
  6299. ---------------------------------------------------------------------------------------------------
  6300.  
  6301. --Relax
  6302. function relax()
  6303. t = 0
  6304. while true do
  6305. checkHP()
  6306. checkSta()         
  6307. cleanScreen()
  6308. drawReAnim1()
  6309. sleep(0.3)
  6310.  
  6311. cleanScreen()
  6312. drawReAnim2()
  6313. sleep(0.3)
  6314.  
  6315. cleanScreen()
  6316. drawReAnim3()
  6317. sleep(0.3)
  6318. cleanScreen()
  6319. t = t + 1
  6320. if t == 5 then
  6321. sta = sta + regainSTA
  6322. hp = hp + regainHP         
  6323. day = day + 1
  6324. drawFinishedAnim()
  6325. drawAt(20,2,day.." ")
  6326. sleep(3)
  6327. checkHP()
  6328. checkSta()
  6329. solo()
  6330.  end
  6331.   end
  6332.  end  
  6333.  
  6334.  --Relax Anims
  6335. local rAnim1 =
  6336. {
  6337. "                                               ",
  6338. "                                               ",
  6339. "                                               ",
  6340. "                                               ",
  6341. "                                               ",
  6342. "          Z                                    ",
  6343. "           ____________________                ",
  6344. "          /                    \\               ",
  6345. "         /                      \\              ",
  6346. "        /________________________\\             ",
  6347. "        |                        |             ",
  6348. "        |                        |             ",
  6349. "        |         _______        |             ",
  6350. "        |        |:::::::|       |             ",
  6351. "        |        |:::::::|       |             ",
  6352. "        |        |:::::::|       |             ",
  6353. "        |        |:::::::|       |             ",
  6354. "           --------------------------             "
  6355. }
  6356.  
  6357. local rAnim2 =
  6358. {
  6359. "                                               ",
  6360. "                                               ",
  6361. "                                               ",
  6362. "                                               ",
  6363. "         Z                                     ",
  6364. "          Z                                    ",
  6365. "           ____________________                ",
  6366. "          /                    \\               ",
  6367. "         /                      \\              ",
  6368. "        /________________________\\             ",
  6369. "        |                        |             ",
  6370. "        |                        |             ",
  6371. "        |         _______        |             ",
  6372. "        |        |:::::::|       |             ",
  6373. "        |        |:::::::|       |             ",
  6374. "        |        |:::::::|       |             ",
  6375. "        |        |:::::::|       |             ",
  6376. "           --------------------------             "
  6377. }
  6378.  
  6379. local rAnim3 =
  6380. {
  6381. "                                               ",
  6382. "                                               ",
  6383. "                                               ",
  6384. "        Z                                      ",
  6385. "         Z                                     ",
  6386. "                                               ",
  6387. "           ____________________                ",
  6388. "          /                    \\               ",
  6389. "         /                      \\              ",
  6390. "        /________________________\\             ",
  6391. "        |                        |             ",
  6392. "        |                        |             ",
  6393. "        |         _______        |             ",
  6394. "        |        |:::::::|       |             ",
  6395. "        |        |:::::::|       |             ",
  6396. "        |        |:::::::|       |             ",
  6397. "        |        |:::::::|       |             ",
  6398. "           --------------------------             "
  6399. }  
  6400.  
  6401. local finishedAnim =
  6402. {
  6403. "                 PLAYED                        ",
  6404. "                                               ",
  6405. "                  DAYS                         ",
  6406. "                                               ",
  6407. "                                               ",
  6408. "                                               ",
  6409. "           ____________________                ",
  6410. "          /                    \\               ",
  6411. "         /                      \\              ",
  6412. "        /________________________\\             ",
  6413. "        |                        |             ",
  6414. "        |                        |             ",
  6415. "        |         _______        |             ",
  6416. "        |        |:::::::|       |             ",
  6417. "        |        |:::::::|       |             ",
  6418. "        |        |:::::::|       |             ",
  6419. "        |        |:::::::|       |             ",
  6420. "           --------------------------             "
  6421. }
  6422.  
  6423. --1
  6424. function drawReAnim1()
  6425.  
  6426. for i = 1, #rAnim1 do
  6427.         drawAt(1,i,rAnim1[i])
  6428.   end
  6429.    end
  6430.  
  6431. --2
  6432. function drawReAnim2()
  6433. for i = 1, #rAnim2 do
  6434.         drawAt(1,i,rAnim2[i])
  6435.   end
  6436.    end
  6437.  
  6438. --3
  6439. function drawReAnim3()
  6440. for i = 1, #rAnim3 do
  6441.         drawAt(1,i,rAnim3[i])
  6442.   end
  6443.    end  
  6444.  
  6445.   --END
  6446. function drawFinishedAnim()
  6447. for i = 1, #finishedAnim do
  6448.         drawAt(1,i,finishedAnim[i])
  6449.   end
  6450.    end
  6451.  
  6452. ---------------------------------------------------------------------------------------------------
  6453. --DIFFICULTY
  6454. ---------------------------------------------------------------------------------------------------
  6455. --Checks What Difficulty It is
  6456.  
  6457. difficulty = "None Difficulty"
  6458.  
  6459. function checkLevels()
  6460. local enemyDMG1 = math.random(2,8 + eLvlD)
  6461. local enemyDMG2 = math.random(10,15 + eLvlD)
  6462. local enemyDMG3 = math.random(20,30 + eLvlD)
  6463. local enemyDMG4 = math.random(30,45 + eLvlD)
  6464. local enemyDMG5 = math.random(50,60 + eLvlD)
  6465. if enemyHP < 100 then
  6466. enemyHP = 100
  6467. end
  6468. if eLvlD <= 0 then
  6469. eLvlD = 0
  6470. end
  6471. if enemyLvl < 1 then
  6472.       enemyLvl = 1
  6473.    enemyHP = 100
  6474.  enemySta = 50
  6475.   end
  6476.  if enemyLvl >= 10 and
  6477.  enemyLvl < 20 then
  6478.  eAtk = enemyDMG2
  6479.    end
  6480.  if enemyLvl >= 20  and
  6481.   enemyLvl < 30 then
  6482.  eAtk = enemyDMG3
  6483.    end
  6484.   if enemyLvl >= 30  and
  6485.   enemyLvl < 40 then
  6486.  eAtk = enemyDMG4
  6487.    end
  6488.    if enemyLvl >= 40 then
  6489.  eAtk = enemyDMG5
  6490.    end
  6491.     end
  6492.    
  6493.  
  6494. ---------------------------------------------------------------------------------------------------  
  6495. ---------------------------------------------------------------------------------------------------
  6496. function checkDifficulty()
  6497. if difficulty == "Easy" then
  6498. ranLvl = 0
  6499. ranLvl = math.random(1,5)
  6500.  
  6501. if ranLvl == 1 then
  6502.    enemyLvl = lvl - 1
  6503.     enemyHP = tHP - 10
  6504.    eLvlD = lvlD - 1
  6505.  checkLevels()
  6506.  
  6507.  
  6508. elseif ranLvl == 2 then
  6509.    enemyLvl = lvl - 2
  6510.     enemyHP = tHP - 20
  6511.    eLvlD = lvlD - 2
  6512.  checkLevels()
  6513.  
  6514. elseif ranLvl == 3 then
  6515.    enemyLvl = lvl - 3
  6516.     enemyHP = tHP - 30
  6517.    eLvlD = lvlD - 3
  6518.  checkLevels()
  6519.  
  6520. elseif ranLvl == 4 then
  6521.    enemyLvl = lvl - 4
  6522.     enemyHP = tHP - 40
  6523.    eLvlD = lvlD - 4
  6524.  checkLevels()
  6525.  
  6526. elseif ranLvl == 5 then
  6527.      enemyLvl = lvl - 5
  6528.       enemyHP = tHP - 50
  6529.      eLvlD = lvlD - 1
  6530.    checkLevels()
  6531.   end
  6532. end
  6533.  
  6534. if difficulty == "Normal" then
  6535. enemyLvl = lvl
  6536. enemyHP = tHP
  6537. eLvlD = lvlD - 1
  6538. checkLevels()
  6539. end
  6540.  
  6541. if difficulty == "Hard" then
  6542. ranLvl = 0
  6543. ranLvl = math.random(1,5)
  6544.  
  6545. if ranLvl == 1 then
  6546.    enemyLvl = lvl + 2
  6547.     enemyHP = tHP + 20
  6548.    eLvlD = lvlD + 2
  6549.  
  6550. elseif ranLvl == 2 then
  6551.    enemyLvl = lvl + 3
  6552.     enemyHP = tHP + 30
  6553.    eLvlD = lvlD + 3
  6554.  
  6555. elseif ranLvl == 3 then
  6556.    enemyLvl = lvl + 4
  6557.     enemyHP = tHP + 40
  6558.    eLvlD = lvlD + 4
  6559.  
  6560. elseif ranLvl == 4 then
  6561.    enemyLvl = lvl + 5
  6562.     enemyHP = tHP + 50
  6563.    eLvlD = lvlD + 5
  6564.  
  6565. elseif ranLvl == 5 then
  6566.    enemyLvl = lvl + 6
  6567.     enemyHP = tHP + 60
  6568.    eLvlD = lvlD + 6
  6569.   end
  6570. end
  6571.  
  6572. if difficulty == "Extreme"  then
  6573. ranLvl = 0
  6574. ranLvl = math.random(1,5)
  6575.  
  6576. if ranLvl == 1 then
  6577.    enemyLvl = lvl + 3
  6578.     enemyHP = tHP + 30
  6579.    eLvlD = lvlD + 3
  6580.  
  6581.  
  6582. elseif ranLvl == 2 then
  6583.    enemyLvl = lvl + 4
  6584.     enemyHP = tHP + 40
  6585.    eLvlD = lvlD + 4
  6586.  
  6587.  
  6588. elseif ranLvl == 3 then
  6589.    enemyLvl = lvl + 5
  6590.     enemyHP = tHP + 50
  6591.    eLvlD = lvlD + 5
  6592.  
  6593.  
  6594. elseif ranLvl == 4 then
  6595.    enemyLvl = lvl + 6
  6596.     enemyHP = tHP + 60
  6597.    eLvlD = lvlD + 6
  6598.  
  6599.  
  6600. elseif ranLvl == 5 then
  6601.       enemyLvl = lvl + 8
  6602.        enemyHP = tHP + 80
  6603.       eLvlD = lvlD + 8
  6604.     end
  6605.    end
  6606.    checkLevels()
  6607.   end
  6608.  
  6609. ---------------------------------------------------------------------------------------------------  
  6610. --MENU EVENTS
  6611. ---------------------------------------------------------------------------------------------------
  6612. --Difficulty Menu Events
  6613. function dMenuEvents()
  6614. event, p1 = os.pullEvent()
  6615. if event == "key" then
  6616.  
  6617. if p1 == 200 then
  6618. menuStat = menuStat - 1
  6619. if menuStat < 2 then
  6620. menuStat = 5
  6621. end
  6622.  
  6623. elseif p1 == 208 then
  6624.   menuStat = menuStat + 1
  6625.    if menuStat > 5 then
  6626.    menuStat = 2
  6627.    end
  6628.    
  6629.    elseif p1 == 14 then
  6630.    return characterMenu()
  6631.    
  6632.   elseif p1 == 28
  6633.   then if menuStat == 2
  6634.     then
  6635.  difficulty = "Easy"
  6636.  checkDifficulty()
  6637.  enterName()
  6638.  
  6639.    elseif menuStat == 3 then
  6640. difficulty = "Normal"
  6641. checkDifficulty()
  6642.  enterName()
  6643.  
  6644. elseif menuStat == 4 then
  6645.  difficulty = "Hard"
  6646.  checkDifficulty()
  6647. enterName()
  6648.  
  6649.   elseif menuStat == 5 then
  6650.   difficulty = "Extreme"
  6651.   checkDifficulty()
  6652.   enterName()
  6653. end
  6654.  end
  6655.   end
  6656.    end
  6657.    
  6658. ---------------------------------------------------------------------------------------------------
  6659. --Character Menu Events
  6660. function chMenuEvents()
  6661. event, p1 = os.pullEvent()
  6662. if event == "key" then
  6663. if p1 == 200
  6664. then
  6665. menuStat = menuStat - 1
  6666. if menuStat < 2 then
  6667. menuStat = 5
  6668. end
  6669. elseif p1 == 208 then
  6670.          menuStat = menuStat + 1
  6671.          if menuStat > 5 then
  6672.            menuStat = 2
  6673.            end
  6674.            elseif p1 == 28 then
  6675.            if menuStat == 2 then
  6676.            difMenu()
  6677.            enterName()
  6678.            solo()
  6679.            
  6680.            elseif menuStat == 3 then
  6681.            inMenu = true
  6682.            lMode = true
  6683.            dMode = false
  6684.            sMode = false
  6685.            mode = "LOAD"
  6686.            loadMenu()
  6687.            
  6688.            elseif menuStat == 4 then
  6689.            inMenu = true
  6690.            dMode = true
  6691.            sMode = false
  6692.            lMode = false
  6693.            mode = "DELETE"
  6694.            loadMenu()
  6695.            
  6696.            elseif menuStat == 5 then
  6697.            return
  6698.            menu()
  6699.            end
  6700.            end
  6701.            end
  6702.            end
  6703.            
  6704.  
  6705. --Warning Menu events
  6706. function wMenuEvents()
  6707. event, p1 = os.pullEvent()
  6708. if event == "key" then
  6709. if p1 == 200
  6710. then
  6711. menuStat = menuStat - 1
  6712. if menuStat < 5 then
  6713. menuStat = 6
  6714. end
  6715. elseif p1 == 208 then
  6716.          menuStat = menuStat + 1
  6717.          if menuStat > 6 then
  6718.            menuStat = 5
  6719.            end
  6720.            elseif p1 == 14 then
  6721.            solo()
  6722.            elseif p1 == 28 then
  6723.            if menuStat == 5 then
  6724.            resetStats()
  6725.            menu()
  6726.            elseif menuStat == 6 then
  6727.            solo()
  6728.            end
  6729.            end
  6730.            end
  6731.            end
  6732.  
  6733.          
  6734. --Main Menu Events
  6735. function menuEvents()
  6736. event, p1 = os.pullEvent()
  6737. if event == "key" then
  6738. if p1 == 200
  6739. then
  6740. menuStat = menuStat - 1
  6741. if menuStat < 2 then
  6742. menuStat = 8
  6743. end
  6744. elseif p1 == 208 then
  6745.          menuStat = menuStat + 1
  6746.          if menuStat > 8 then
  6747.            menuStat = 2
  6748.            end
  6749.            elseif p1 == 28 then
  6750.            if menuStat == 2 then
  6751.            characterMenu()
  6752.            
  6753.            elseif menuStat == 3 then
  6754.            cleanScreen()
  6755.            print("Not Available YET")
  6756.            sleep(1)
  6757.            return
  6758.            
  6759.            
  6760.            
  6761.            elseif menuStat == 4 then
  6762.            settingsMenu()
  6763.          
  6764.            
  6765.            elseif menuStat == 5 then
  6766.            highScore()
  6767.            
  6768.            elseif menuStat == 6 then
  6769.            helpMenu()
  6770.            
  6771.            elseif menuStat == 7 then
  6772.            credits()
  6773.            elseif menuStat == 8 then
  6774.            myName = nil
  6775.            cleanScreen()
  6776.            print("Thanks For Playing!")
  6777.            error()
  6778.            end
  6779.            end
  6780.            end
  6781.            end
  6782.            
  6783.            
  6784. ---------------------------------------------------------------------------------------------------
  6785. --HomeMenu Events
  6786. function hMenuEvents()
  6787. event, p1 = os.pullEvent()
  6788. if event == "key" then
  6789. if p1 == 200
  6790. then
  6791. menuStat = menuStat - 1
  6792. if menuStat < 2 then
  6793. menuStat = 8
  6794. end
  6795. elseif p1 == 208 then
  6796.          menuStat = menuStat + 1
  6797.          if menuStat > 8 then
  6798.            menuStat = 2
  6799.            end
  6800.            elseif p1 == 28 then
  6801.            if menuStat == 2 then
  6802.            startFight()
  6803.            elseif menuStat == 3 then
  6804.            startTournament()
  6805.            elseif menuStat == 4 then
  6806.            cleanScreen()
  6807.            print("Nothing Here YET!")
  6808.            sleep(1)
  6809.            return
  6810.            
  6811.            elseif menuStat == 5 then
  6812.            map(23,6)
  6813.            elseif menuStat == 6 then
  6814.            relax()
  6815.            
  6816.            elseif menuStat == 7 then
  6817.            inMenu = true
  6818.            sMode = true
  6819.            dMode = false
  6820.            lMode = false
  6821.             mode = "SAVE"
  6822.             loadMenu()
  6823.            elseif menuStat == 8 then
  6824.            warningMenu()
  6825.            end
  6826.            end
  6827.            end
  6828.            end       
  6829.  
  6830.  
  6831.          
  6832.  
  6833.          
  6834. ---------------------------------------------------------------------------------------------------
  6835. --Loading Section  
  6836.  
  6837. function load(s)
  6838. tipses()
  6839. local t = 0
  6840.  
  6841. repeat
  6842.  
  6843.    drawLoadingStuff()
  6844. cleanScreen()
  6845.  
  6846.    drawLoadingStuff()
  6847.   drawLoad1()
  6848.  sleep(0.2)
  6849. cleanScreen()
  6850.  
  6851.    drawLoadingStuff()
  6852.   drawLoad2()
  6853.  sleep(0.2)
  6854.  
  6855. cleanScreen()
  6856.    drawLoadingStuff()
  6857.   drawLoad3()
  6858.  sleep(0.2)
  6859. t = t + 1
  6860. until t == s
  6861. end
  6862.  
  6863.  
  6864.  
  6865. --Draws The loading Stuff
  6866.  
  6867. function drawLoadingStuff()
  6868. drawAt(21,11,"Loading")
  6869. drawAt(5,13,"TIPS:")
  6870. term.setCursorPos(11,13)
  6871. print(tips)
  6872. end
  6873.  
  6874.  
  6875.  
  6876. --Draws The Load anim 1
  6877. function drawLoad1()
  6878. drawAt(18,8," ___________")
  6879. drawAt(18,9,"|// // // //|")
  6880. drawAt(18,10," -----------")
  6881. end
  6882.      
  6883. --Draw The Load Anim 2
  6884. function drawLoad2()
  6885. drawAt(18,8," ___________")
  6886. drawAt(18,9,"| // // // /|")
  6887. drawAt(18,10," -----------")
  6888. end
  6889.  
  6890. --Draw The Load Anim 3
  6891. function drawLoad3()
  6892. drawAt(18,8," ___________")
  6893. drawAt(18,9,"|/ // // // |")
  6894. drawAt(18,10," -----------")
  6895. end
  6896.  
  6897.  
  6898.  
  6899.  
  6900.  
  6901.  
  6902.  
  6903. --Tips For Gameplay
  6904.  
  6905. function tipses()
  6906.  
  6907. t_tips = {
  6908. "Running Out Of Stamina Is Not Good!",  "Punching Enemies is a Good way to win.",
  6909. "You can Always Leave a \n     Match When You Want.",  "Energy Drinks Regerenates Your Stamina.",
  6910. "Blocking can Tire out the Enemy!",  "Save Your Game Often!",
  6911. "If the Game Gets to Hard \n     You can Cheat.",  "Trolling in the Game is Allowed!",
  6912. "You can Improve your character \n     By buying new Equipment",  "This is a Useless Tips",
  6913. "When you Level up You \n    Should Improve Your Skills!",  "Playing Multiplayer is More fun.",
  6914. "Horses does not exist.",  "Be careful so you don't \n     End up in the hospital!",
  6915. "Play Quick Match to earn Quick Xp",  "Change the Settings to Your Likings",
  6916. "Train to Earn Xp Quickly",  "If you think the game is too easy \n     Then play on a higher difficulity!",
  6917. "Check Out The Credits!",  "Always Have Some Health Stuff on You!",
  6918. }
  6919.  
  6920. tips = t_tips[math.random(1, #t_tips)]
  6921. print(tips)
  6922. cleanScreen()
  6923.  
  6924. end
  6925.  
  6926. ---------------------------------------------------------------------------------------------------
  6927. function hExitEvents()
  6928. local e, but, x, y = os.pullEvent()
  6929.  
  6930. if e == "mouse_click" and
  6931. x >= 35 and
  6932. x <= 45 and
  6933. y >= 7 and
  6934. y <= 9 then
  6935. return characterMenu()
  6936.  
  6937.  
  6938. elseif e == "key" and
  6939.  but == 14 then
  6940. return characterMenu()
  6941. end
  6942.  end
  6943.  
  6944.  
  6945.  
  6946. --Enter Your Name
  6947. function enterName()
  6948. if colorsOnOff == "OFF" then
  6949. repeat
  6950. drawNameMenu()
  6951. drawAt(14,halfH + 1,"|ENTER NAME: ")
  6952. myName = modRead({textLength = 11})
  6953. drawAt(14,halfH + 4,"PRESS ANY BUTTON TO CONFIRM")
  6954. drawAt(15,halfH + 5,"PRESS BACKSPACE TO RETURN")
  6955.  
  6956. local e, but, x, y = os.pullEvent()
  6957. if e == "key" and
  6958.  but == 14 then
  6959. return characterMenu()
  6960. end
  6961.  
  6962. local valid, err = CheckUserName()
  6963.         if not valid then
  6964.                 print("")
  6965.                 print("")
  6966.                 print(err)
  6967.                 sleep(2)
  6968.         end
  6969. until valid
  6970. solo()
  6971.  
  6972. elseif colorsOnOff == "ON" then
  6973. repeat
  6974.  
  6975.  
  6976.  
  6977.  
  6978.  
  6979.  
  6980.  
  6981.  
  6982.  
  6983. drawNameMenu()
  6984. drawAt(27,halfH + 1,"                      ")
  6985. drawAt(14,halfH + 1,"  ENTER NAME: ")
  6986. myName = modRead({textLength = 11})
  6987. drawAt(14,halfH + 4,"PRESS ANY BUTTON TO CONFIRM")
  6988. drawAt(15,halfH + 5,"PRESS BACKSPACE TO RETURN")
  6989.  
  6990.  hExitEvents()
  6991.  
  6992. local valid, err = CheckUserName()
  6993.         if not valid then
  6994.                 print("")
  6995.                 print("")
  6996.                 print(err)
  6997.                 sleep(2)
  6998.         end
  6999.          
  7000.  
  7001.        
  7002.  
  7003.  
  7004.  
  7005.  
  7006.          
  7007. until valid
  7008. solo()  
  7009. end
  7010.  end
  7011.    
  7012.  
  7013.  
  7014. --Draws the Name menu
  7015. function drawNameMenu()
  7016. cleanScreen()
  7017. if colorsOnOff == "OFF" then
  7018. drawAt(14,halfH,"+-------------------------+")
  7019. drawAt(40,halfH + 1,"|")
  7020. drawAt(14,halfH + 2,"+-------------------------+")
  7021.  
  7022. elseif colorsOnOff == "ON" then
  7023.  
  7024. term.setTextColor(menuTextColor)
  7025. term.setBackgroundColor(menuBackColor)
  7026. cleanScreen()
  7027. term.setTextColor(ttTextColor)
  7028. term.setBackgroundColor(ttBackColor)
  7029.  
  7030. drawAt(14,halfH,"                           ")
  7031. drawAt(14,halfH + 1,"                           ")
  7032. drawAt(14,halfH + 2,"                           ")
  7033. term.setBackgroundColor(colors.lightGray)
  7034. drawAt(14,halfH + 3,"                           ")
  7035. drawAt(14,halfH - 1,"                           ")
  7036.  
  7037. term.setBackgroundColor(colors.red)
  7038. term.setTextColor(colors.black)
  7039. drawAt(38,halfH - 1," X ")
  7040. term.setTextColor(menuTextColor)
  7041. term.setBackgroundColor(menuBackColor)
  7042. end
  7043.  end
  7044.  
  7045.  
  7046.  
  7047.  
  7048. ---------------------------------------------------------------------------------------------------
  7049. --HELP
  7050. ---------------------------------------------------------------------------------------------------
  7051. function drawExtraHelp()
  7052. if colorsOnOff == "OFF" then
  7053. drawAt(1,1,"+-------------------------------------------------+")
  7054. drawAt(1,2,"|                +---HELP---+                     |")
  7055. drawAt(1,3,"+-------------------------------------------------+")
  7056. drawAt(1,18,"+-------------------------------------------------+")
  7057.  
  7058. elseif colorsOnOff  == "ON" then
  7059. term.setBackgroundColor(ttBackColor)
  7060. term.setTextColor(ttTextColor)
  7061. drawAt(1,1,"                                                   ")
  7062. drawAt(1,2,"                 +---HELP---+                      ")
  7063. drawAt(1,3,"                                                   ")
  7064. drawAt(1,18,"                                                   ")
  7065.  
  7066. term.setBackgroundColor(colors.black)
  7067. term.setTextColor(colors.white)
  7068.  end
  7069.   end
  7070.  
  7071.  
  7072. function drawHelpMenu()
  7073. helpMenuArt = {
  7074. "+-------------------------------------------------+",
  7075. "|                  +---HELP---+                   |",
  7076. "+-------------------------------------------------+",
  7077. "|                                                 |",
  7078. "|                                                 |",
  7079. "|                                                 |",
  7080. "|                                                 |",
  7081. "|                                                 |",
  7082. "|                                                 |",
  7083. "|                                                 |",
  7084. "|                                                 |",
  7085. "|                                                 |",
  7086. "|                                                 |",
  7087. "|                                                 |",
  7088. "|                                                 |",
  7089. "|                                                 |",
  7090. "|                                                 |",
  7091. "+-------------------------------------------------+",
  7092. }
  7093.  
  7094.  
  7095. helpMenuArtCol = {
  7096. "                                                   ",
  7097. "                   +---HELP---+                    ",
  7098. "                                                   ",
  7099. "                                                   ",
  7100. "                                                   ",
  7101. "                                                   ",
  7102. "                                                   ",
  7103. "                                                   ",
  7104. "                                                   ",
  7105. "                                                   ",
  7106. "                                                   ",
  7107. "                                                   ",
  7108. "                                                   ",
  7109. "                                                   ",
  7110. "                                                   ",
  7111. "                                                   ",
  7112. "                                                   ",
  7113. "                                                   ",
  7114. "                                                   ",
  7115. }
  7116.  
  7117.  
  7118.  
  7119.  
  7120. for i = 1, #helpMenuArt do
  7121.          if colorsOnOff == "OFF" then
  7122.         drawAt(1,i,helpMenuArt[i])
  7123.         drawExtraHelp()
  7124.        
  7125.         elseif colorsOnOff == "ON" then
  7126.         term.setBackgroundColor(menuBackColor)
  7127.         term.setTextColor(menuTextColor)
  7128.         drawAt(1,i,helpMenuArtCol[i])
  7129.         drawExtraHelp()
  7130.         end
  7131.         end
  7132.          
  7133.        
  7134.  
  7135. if colorsOnOff == "OFF" then       
  7136.        
  7137. term.setCursorPos(17,halfH - 3)
  7138. if exit == false then
  7139. if helpMenuStat == 1 then
  7140. print("--How To Play--")
  7141. term.setCursorPos(20,halfH - 2)
  7142. print("Controls")
  7143. term.setCursorPos(21,halfH - 1)
  7144. print("Commands")
  7145. term.setCursorPos(22,halfH)
  7146. print("Abilities")
  7147.  
  7148. elseif helpMenuStat == 2 then
  7149. term.setCursorPos(17,halfH - 3)
  7150. print("--Controls--")
  7151. term.setCursorPos(20,halfH - 2)
  7152. print("Commands")
  7153. term.setCursorPos(21,halfH - 1)
  7154. print("Abilities")
  7155. term.setCursorPos(22,halfH)
  7156. print("How To Play")
  7157.  
  7158. elseif helpMenuStat == 3 then
  7159. term.setCursorPos(17,halfH - 3)
  7160. print("--Commands--")
  7161. term.setCursorPos(20,halfH - 2)
  7162. print("Abilities")
  7163. term.setCursorPos(21,halfH - 1)
  7164. print("How To Play")
  7165. term.setCursorPos(22,halfH)
  7166. print("Controls")
  7167.  
  7168. elseif helpMenuStat == 4 then
  7169. term.setCursorPos(17,halfH - 3)
  7170. print("--Abilities--")
  7171. term.setCursorPos(20,halfH - 2)
  7172. print("How To Play")
  7173. term.setCursorPos(21,halfH - 1)
  7174. print("Controls")
  7175. term.setCursorPos(22,halfH)
  7176. print("Commands")
  7177.  
  7178. end
  7179.  end
  7180.  
  7181.  
  7182.  
  7183. elseif colorsOnOff == "ON" then
  7184. term.setTextColor(menuTextColor)
  7185. term.setBackgroundColor(menuBackColor)
  7186.  
  7187. term.setCursorPos(17,halfH - 3)
  7188. if exit == false then
  7189. if helpMenuStat == 1 then
  7190. term.setTextColor(ttTextColor)
  7191. print("--How To Play--")
  7192. term.setTextColor(menuTextColor)
  7193. term.setCursorPos(20,halfH - 2)
  7194. print("Controls")
  7195. term.setCursorPos(21,halfH - 1)
  7196. print("Commands")
  7197. term.setCursorPos(22,halfH)
  7198. print("Abilities")
  7199.  
  7200. elseif helpMenuStat == 2 then
  7201. term.setTextColor(ttTextColor)
  7202. term.setCursorPos(17,halfH - 3)
  7203. print("--Controls--")
  7204. term.setTextColor(menuTextColor)
  7205. term.setCursorPos(20,halfH - 2)
  7206. print("Commands")
  7207. term.setCursorPos(21,halfH - 1)
  7208. print("Abilities")
  7209. term.setCursorPos(22,halfH)
  7210. print("How To Play")
  7211.  
  7212. elseif helpMenuStat == 3 then
  7213. term.setTextColor(ttTextColor)
  7214. term.setCursorPos(17,halfH - 3)
  7215. print("--Commands--")
  7216. term.setTextColor(menuTextColor)
  7217. term.setCursorPos(20,halfH - 2)
  7218. print("Abilities")
  7219. term.setCursorPos(21,halfH - 1)
  7220. print("How To Play")
  7221. term.setCursorPos(22,halfH)
  7222. print("Controls")
  7223.  
  7224. elseif helpMenuStat == 4 then
  7225. term.setTextColor(ttTextColor)
  7226. term.setCursorPos(17,halfH - 3)
  7227. print("--Abilities--")
  7228. term.setTextColor(menuTextColor)
  7229. term.setCursorPos(20,halfH - 2)
  7230. print("How To Play")
  7231. term.setCursorPos(21,halfH - 1)
  7232. print("Controls")
  7233. term.setCursorPos(22,halfH)
  7234. print("Commands")
  7235.  
  7236.  
  7237. end
  7238.  end
  7239.   end
  7240.    end
  7241.  
  7242. function helpEvents()
  7243. event, p1 = os.pullEvent()
  7244. if event == "key" and
  7245. p1 == 200 then --UP
  7246. helpMenuStat = helpMenuStat - 1
  7247. if helpMenuStat < 1 then
  7248. helpMenuStat = 4
  7249. end
  7250. elseif p1 == 208 then -- DOWN
  7251. helpMenuStat = helpMenuStat + 1
  7252. if helpMenuStat > 4 then
  7253. helpMenuStat = 1
  7254. end
  7255. elseif p1 == 28 then --ENTER
  7256. if helpMenuStat == 1 then
  7257. exit = true
  7258. hHowToPlay()
  7259.  
  7260.  
  7261.  
  7262. elseif helpMenuStat == 2 then
  7263. exit = true
  7264. hHelpControls()
  7265.  
  7266. elseif helpMenuStat == 3 then
  7267. exit = true
  7268. hHelpCommands()
  7269.  
  7270. elseif helpMenuStat == 4 then
  7271. exit = true
  7272. hHelpAbilities()
  7273. end
  7274. elseif p1 == 14 then
  7275. exit = true
  7276.  end
  7277.   end
  7278.  
  7279. function pageEvents()
  7280. event, p1 = os.pullEvent()
  7281. if event == "char" and
  7282. p1 == "b" then
  7283. page = page - 1
  7284. if page < minPage then
  7285. page = minPage
  7286. end
  7287. elseif p1 == "n" then
  7288. page = page + 1
  7289. if page > maxPage then
  7290. page = maxPage
  7291. end
  7292. elseif p1 == 14 then
  7293. inHelpTopic = false
  7294. exit = false
  7295. end
  7296.  end
  7297.  
  7298. function drawButtons()
  7299. if colorsOnOff == "OFF" then
  7300. drawAt(2,19,"[Backspace]Exit [n]Next [b]Back ["..page.."]/["..maxPage.."]")
  7301.  
  7302. elseif colorsOnOff == "ON" then
  7303.  
  7304. term.setBackgroundColor(colors.lightGray)
  7305. term.setTextColor(colors.black)
  7306. drawAt(1,19," [Backspace]Exit [n]Next [b]Back ["..page.."]/["..maxPage.."]                                                                     ")
  7307.  
  7308. term.setBackgroundColor(colors.black)
  7309. term.setTextColor(colors.white)
  7310. end
  7311.  end
  7312. ---------------------------------------------------------------------------------------------------
  7313. function drawHowToPlay()
  7314. htp1 = {
  7315. "                   HOW TO PLAY                   |",
  7316. "                -:INTRODUCTION:-                 |",
  7317. "  Well I don't know how much i can explain about |",
  7318. "  -this that you could'nt figure out for yourself|",
  7319. "  -or already knowed. It's pretty much an RPG and|",
  7320. "  -you play it by writing commands or simply     |",
  7321. "  -punch if it is the GUI version that is        |",
  7322. "  -easier to play since the controls can be      |",
  7323. "  -watched ingame and also here in the help      |"
  7324. }
  7325.  
  7326. htp1Col = {
  7327. "                   HOW TO PLAY                    ",
  7328. "                -:INTRODUCTION:-                  ",
  7329. "  Well I don't know how much i can explain about  ",
  7330. "  -this that you could'nt figure out for yourself ",
  7331. "  -or already knowed. It's pretty much an RPG and ",
  7332. "  -you play it by writing commands or simply      ",
  7333. "  -punch if it is the GUI version that is         ",
  7334. "  -easier to play since the controls can be       ",
  7335. "  -watched ingame and also here in the help       "
  7336. }
  7337.  
  7338.  
  7339. htp2 = {
  7340. "                   HOW TO PLAY                   |",
  7341. "                                                 |",
  7342. "  The Controls if ofcourse were it says          |",
  7343. "  'Controls' in the help section, Where Else?    |",
  7344. "                                                 |",
  7345. "                                                 |"
  7346. }
  7347.  
  7348. htp2Col = {
  7349. "                   HOW TO PLAY                    ",
  7350. "                                                  ",
  7351. "  The Controls if ofcourse were it says           ",
  7352. "  'Controls' in the help section, Where Else?     ",
  7353. "                                                  ",
  7354. "                                                  "
  7355. }
  7356.  
  7357. htp3 = {
  7358. "                   HOW TO PLAY                   |",
  7359. "                -:SINGLE PLAYER:-                |",
  7360. "  Well here you'll unlock new abilities at some  |",
  7361. "  -certain levels like uppercut is unlocked at   |",
  7362. "  -level 10 and you'll also get a new ability    |",
  7363. "  -point every level so you can increase damage  |",
  7364. "  -and other stuff off the ability.              |",
  7365. "  You Should start by playing some quick matches |",
  7366. "  -before you join any tournament since they are |",
  7367. "  -much more difficult than quick match.         |",
  7368. "  And when you get enough money you can join     |",
  7369. "  -the gym and earn experience and improve your  |",
  7370. "  -damage and skill and more ofcourse.           |"
  7371. }
  7372.  
  7373.  
  7374.  
  7375. htp3Col = {
  7376. "                   HOW TO PLAY                    ",
  7377. "                -:SINGLE PLAYER:-                 ",
  7378. "  Well here you'll unlock new abilities at some   ",
  7379. "  -certain levels like uppercut is unlocked at    ",
  7380. "  -level 10 and you'll also get a new ability     ",
  7381. "  -point every level so you can increase damage   ",
  7382. "  -and other stuff off the ability.               ",
  7383. "  You Should start by playing some quick matches  ",
  7384. "  -before you join any tournament since they are  ",
  7385. "  -much more difficult than quick match.          ",
  7386. "  And when you get enough money you can join      ",
  7387. "  -the gym and earn experience and improve your   ",
  7388. "  -damage and skill and more ofcourse.            "
  7389. }
  7390.  
  7391. htp4 = {
  7392. "                   HOW TO PLAY                   |",
  7393. "                                                 |",
  7394. "  So now you know that you can improve your      |",
  7395. "  -character at the gym, But remember to have    |",
  7396. "  -enough money to buy Membership.               |",
  7397. "  So now when you know all that you should learn |",
  7398. "  -that you can go to the mall and enter either  |",
  7399. "  -the equipment shop or the foodcourt to buy    |",
  7400. "  -items like:Energy Drink, Hamburgers and       |",
  7401. "  -boxing gloves, helmet and shoes + more        |",
  7402. }
  7403.  
  7404.  
  7405.  
  7406. htp4Col = {
  7407. "                   HOW TO PLAY                    ",
  7408. "                                                  ",
  7409. "  So now you know that you can improve your       ",
  7410. "  -character at the gym, But remember to have     ",
  7411. "  -enough money to buy Membership.                ",
  7412. "  So now when you know all that you should learn  ",
  7413. "  -that you can go to the mall and enter either   ",
  7414. "  -the equipment shop or the foodcourt to buy     ",
  7415. "  -items like:Energy Drink, Hamburgers and        ",
  7416. "  -boxing gloves, helmet and shoes + more         ",
  7417. }
  7418.  
  7419. htp5 = {
  7420. "                   HOW TO PLAY                   |",
  7421. "                                                 |",
  7422. "  Why don't you go out on an adventure and earn  |",
  7423. "  -some money from chests and you can find more  |",
  7424. "  -like for example new special equipment that   |",
  7425. "  -does special attacks and more damage          |",
  7426. "  Adventure is GUI and not command based since   |",
  7427. "  -it's special and adds variation to the game   |",
  7428. }
  7429.  
  7430.  
  7431. htp5Col = {
  7432. "                   HOW TO PLAY                    ",
  7433. "                                                  ",
  7434. "  Why don't you go out on an adventure and earn   ",
  7435. "  -some money from chests and you can find more   ",
  7436. "  -like for example new special equipment that    ",
  7437. "  -does special attacks and more damage           ",
  7438. "  Adventure is GUI and not command based since    ",
  7439. "  -it's special and adds variation to the game    ",
  7440. }
  7441.  
  7442. htp6 = {
  7443. "                   HOW TO PLAY                   |",
  7444. "                -:MULTIPLAYER:-                  |",
  7445. "  Multiplayer Quick Match is like a regular      |",
  7446. "  -quick match but you play against another      |",
  7447. "  -player that isn't an AI                       |",
  7448. "  Multiplayer Tournament is much more awesome    |",
  7449. "  -since you can win much more money and xp      |",
  7450. "  -there is also 'first win of the day' rewards  |",
  7451. "  -and the tournaments is mostly players that    |",
  7452. "  -is in a high level since you atleast have to  |",
  7453. "  -be over level 25 to play MP tournament        |",
  7454. "  You can also start a custom match and select   |",
  7455. "  -who to invite and what options it should be   |",
  7456. }
  7457.  
  7458. htp6Col = {
  7459. "                   HOW TO PLAY                    ",
  7460. "                -:MULTIPLAYER:-                   ",
  7461. "  Multiplayer Quick Match is like a regular       ",
  7462. "  -quick match but you play against another       ",
  7463. "  -player that isn't an AI                        ",
  7464. "  Multiplayer Tournament is much more awesome     ",
  7465. "  -since you can win much more money and xp       ",
  7466. "  -there is also 'first win of the day' rewards   ",
  7467. "  -and the tournaments is mostly players that     ",
  7468. "  -is in a high level since you atleast have to   ",
  7469. "  -be over level 25 to play MP tournament         ",
  7470. "  You can also start a custom match and select    ",
  7471. "  -who to invite and what options it should be    ",
  7472.  
  7473.  
  7474. }
  7475.  
  7476. htp7 = {
  7477. "                   HOW TO PLAY                   |",
  7478. "                                                 |",
  7479. "  Like if the match should be Command or GUI,    |",
  7480. "  If cheats are enabled and mode like            |",
  7481. "  Adventure,PvP,PvE and you can select so you    |",
  7482. "  Play more than two in a match for example      |",
  7483. "  4vs4 or just select MaxPlayers:4 or something  |",
  7484. }
  7485.  
  7486. htp7Col = {
  7487. "                   HOW TO PLAY                    ",
  7488. "                                                  ",
  7489. "  Like if the match should be Command or GUI,     ",
  7490. "  If cheats are enabled and mode like             ",
  7491. "  Adventure,PvP,PvE and you can select so you     ",
  7492. "  Play more than two in a match for example       ",
  7493. "  4vs4 or just select MaxPlayers:4 or something   ",
  7494. }
  7495.  
  7496.  
  7497. if colorsOnOff == "OFF" then
  7498.  
  7499. if page == 1 then
  7500.  for i = 1, #htp1 do
  7501.         drawAt(2,i + 3,htp1[i])
  7502.         end
  7503.        
  7504.     elseif page == 2 then
  7505.      for i = 1, #htp2 do
  7506.         drawAt(2,i + 3,htp2[i])
  7507.   end
  7508.  
  7509.  elseif page == 3 then
  7510.      for i = 1, #htp3 do
  7511.         drawAt(2,i + 3,htp3[i])
  7512.   end
  7513.  
  7514.   elseif page == 4 then
  7515.      for i = 1, #htp4 do
  7516.         drawAt(2,i + 3,htp4[i])
  7517.   end
  7518.  
  7519.   elseif page == 5 then
  7520.      for i = 1, #htp5 do
  7521.         drawAt(2,i + 3,htp5[i])
  7522.   end
  7523.  
  7524.    elseif page == 6 then
  7525.      for i = 1, #htp6 do
  7526.         drawAt(2,i + 3,htp6[i])
  7527.   end
  7528.  
  7529.    elseif page == 7 then
  7530.      for i = 1, #htp7 do
  7531.         drawAt(2,i + 3,htp7[i])
  7532.   end
  7533.    end
  7534.  
  7535.  
  7536.   elseif colorsOnOff == "ON" then
  7537.  
  7538.   term.setBackgroundColor(menuBackColor)
  7539.   term.setTextColor(menuTextColor)
  7540.   if page == 1 then
  7541.    for i = 1, #htp1 do
  7542.         drawAt(2,i + 3,htp1Col[i])
  7543.         end
  7544.        
  7545.     elseif page == 2 then
  7546.      for i = 1, #htp2 do
  7547.         drawAt(2,i + 3,htp2Col[i])
  7548.   end
  7549.  
  7550.  elseif page == 3 then
  7551.      for i = 1, #htp3 do
  7552.         drawAt(2,i + 3,htp3Col[i])
  7553.   end
  7554.  
  7555.   elseif page == 4 then
  7556.      for i = 1, #htp4 do
  7557.         drawAt(2,i + 3,htp4Col[i])
  7558.   end
  7559.  
  7560.   elseif page == 5 then
  7561.      for i = 1, #htp5 do
  7562.         drawAt(2,i + 3,htp5Col[i])
  7563.   end
  7564.  
  7565.    elseif page == 6 then
  7566.      for i = 1, #htp6 do
  7567.         drawAt(2,i + 3,htp6Col[i])
  7568.   end
  7569.  
  7570.    elseif page == 7 then
  7571.      for i = 1, #htp7 do
  7572.         drawAt(2,i + 3,htp7Col[i])
  7573.   end
  7574.     end
  7575.      end
  7576.       end
  7577.  
  7578.  
  7579.      
  7580.      
  7581. function drawHelpControls()
  7582. ctrl1 = {
  7583. "                    CONTROLS                     |",
  7584. "                  -:Menus:-                      |",
  7585. "        UP/DOWN Arrow: Move Up And Down          |",
  7586. "        ENTER: Makes Your Selection              |",
  7587. "        BACKSPACE: Exit                          |",
  7588. "        Y/N: Accept Or Decline the Question      |"
  7589. }
  7590.  
  7591.  
  7592.  
  7593.  
  7594. ctrl1Col = {
  7595. "                                                  ",
  7596. "                    CONTROLS                      ",
  7597. "                  -:Menus:-                       ",
  7598. "        UP/DOWN Arrow: Move Up And Down           ",
  7599. "        ENTER: Makes Your Selection               ",
  7600. "        BACKSPACE: Exit                           ",
  7601. "        Y/N: Accept Or Decline the Question       "
  7602. }
  7603.  
  7604.  
  7605.  
  7606. ctrl2 = {  
  7607. "                    CONTROLS                     |",
  7608. "                  -:In Game:-                    |",
  7609. "        A: Punch                                 |",
  7610. "        D: Uppercut                              |",
  7611. "        S: Special Attack                        |",
  7612. "        CTRL: Block                              |",
  7613. "        SPACE: Kick                              |",
  7614. "        X = Leave                                |",
  7615. }
  7616.  
  7617. ctrl2Col = {
  7618. "                                                  ",
  7619. "                    CONTROLS                      ",
  7620. "                  -:In Game:-                     ",
  7621. "        A: Punch                                  ",
  7622. "        D: Uppercut                               ",
  7623. "        S: Special Attack                         ",
  7624. "        CTRL: Block                               ",
  7625. "        SPACE: Kick                               ",
  7626. "        X = Leave                                 ",
  7627. }
  7628.  
  7629.  
  7630. ctrl3 = {  
  7631. "                    CONTROLS                     |",
  7632. "                  -:In Map:-                     |",
  7633. "        W: Move Up                               |",
  7634. "        A: Move Left                             |",
  7635. "        S: Move Down                             |",
  7636. "        D: Move Right                            |",
  7637. }
  7638.  
  7639.  
  7640. ctrl3Col = {  
  7641. "                                                  ",
  7642. "                    CONTROLS                      ",
  7643. "                  -:In Map:-                      ",
  7644. "        W: Move Up                                ",
  7645. "        A: Move Left                              ",
  7646. "        S: Move Down                              ",
  7647. "        D: Move Right                             ",
  7648. }
  7649.  
  7650. ctrl4 = {  
  7651. "                    CONTROLS                     |",
  7652. "                  -:Adventure:-                  |",
  7653. "        A: Move Left                             |",
  7654. "        D: Move Right                            |",
  7655. "        SPACE: Jump                              |",
  7656. "        W: Punch                                 |",
  7657. "        F: Interact                              |",
  7658. }
  7659.  
  7660.  
  7661. ctrl4Col = {  
  7662. "                                                  ",
  7663. "                    CONTROLS                      ",
  7664. "                  -:Adventure:-                   ",
  7665. "        A: Move Left                              ",
  7666. "        D: Move Right                             ",
  7667. "        SPACE: Jump                               ",
  7668. "        W: Punch                                  ",
  7669. "        F: Interact                               ",
  7670. }
  7671.  
  7672.  
  7673.  
  7674. if colorsOnOff == "OFF" then
  7675.  
  7676. if page == 1 then
  7677.  for i = 1, #ctrl1 do
  7678.         drawAt(2,i + 3,ctrl1[i])
  7679.         end
  7680.        
  7681.  elseif page == 2 then
  7682.   for i = 1, #ctrl2 do
  7683.         drawAt(2,i + 3,ctrl2[i])
  7684.         end
  7685.        
  7686.   elseif page == 3 then
  7687.  for i = 1, #ctrl3 do
  7688.         drawAt(2,i + 3,ctrl3[i])
  7689.         end
  7690.        
  7691.     elseif page == 4 then
  7692.  for i = 1, #ctrl4 do
  7693.         drawAt(2,i + 3,ctrl4[i])
  7694.         end
  7695.          end
  7696.        
  7697.         elseif colorsOnOff == "ON" then
  7698.        
  7699.         if page == 1 then
  7700.        
  7701.          for i = 1, #ctrl1 do
  7702.         drawAt(2,i + 3,ctrl1Col[i])
  7703.         end
  7704.        
  7705.  elseif page == 2 then
  7706.   for i = 1, #ctrl2 do
  7707.         drawAt(2,i + 3,ctrl2Col[i])
  7708.         end
  7709.        
  7710.   elseif page == 3 then
  7711.  for i = 1, #ctrl3 do
  7712.         drawAt(2,i + 3,ctrl3Col[i])
  7713.         end
  7714.        
  7715.     elseif page == 4 then
  7716.  for i = 1, #ctrl4 do
  7717.         drawAt(2,i + 3,ctrl4Col[i])
  7718.         end
  7719.            end
  7720.              end
  7721.               end
  7722.                          
  7723.    
  7724.  
  7725.  function drawHelpCommands()
  7726.  
  7727.  hc1 = {
  7728. "                    COMMANDS                     |",
  7729. "                  -:Explanation:-                |",
  7730. "  Ok so first I'll explain that a command is     |",
  7731. "  What you write like 'Leave' then you'll leave  |",
  7732. "  The match since 'Leave' is a command in the    |",
  7733. "  Game that's available.                         |",
  7734. }
  7735.  
  7736.  
  7737.  
  7738.  hc1Col = {
  7739. "                                                  ",
  7740. "                    COMMANDS                      ",
  7741. "                  -:Explanation:-                 ",
  7742. "  Ok so first I'll explain that a command is      ",
  7743. "  What you write like 'Leave' then you'll leave   ",
  7744. "  The match since 'Leave' is a command in the     ",
  7745. "  Game that's available.                          ",
  7746. }
  7747.  
  7748. hc2 = {
  7749. "                    COMMANDS                     |",
  7750. "                  -:Commands:-                   |",
  7751. "  Punch: Punches The Enemy and deals damage to   |",
  7752. "  the enemy if you don't miss them.              |",
  7753. "                                                 |",
  7754. "  Block: Blocks the enemys attack if you do a    |",
  7755. "  Successful block then the enemy loses stamina  |",
  7756. "  And you don't take any damage ofcourse.        |",
  7757. "                                                 |",
  7758. "  Leave: Leaves the match.                       |",
  7759. "                                                 |",
  7760. "  Kick: Kicks the enemy, But be careful so you   |",
  7761. "  Don't get disqualified from the match.         |",
  7762. }
  7763.  
  7764.  
  7765. hc2Col = {
  7766. "                                                  ",
  7767. "                    COMMANDS                      ",
  7768. "                  -:Commands:-                    ",
  7769. "  Punch: Punches The Enemy and deals damage to    ",
  7770. "  the enemy if you don't miss them.               ",
  7771. "                                                  ",
  7772. "  Block: Blocks the enemys attack if you do a     ",
  7773. "  Successful block then the enemy loses stamina   ",
  7774. "  And you don't take any damage ofcourse.         ",
  7775. "                                                  ",
  7776. "  Kick: Kicks the enemy, But be careful so you    ",
  7777. "  Don't get disqualified from the match.          ",
  7778. }
  7779.  
  7780. hc3 = {
  7781. "                    COMMANDS                     |",
  7782. "                                                 |",
  7783. "  Drink <item> = Drinks the drink you have and   |",
  7784. "  you regenate something like STA or HP.         |",
  7785. "                                                 |",
  7786. "  Eat <item> = Eat the food item you have and    |",
  7787. "  Regenate HP.                                   |",
  7788. "                                                 |",
  7789. "  Uppercut: Does An Uppercut that deals more dmg |",
  7790. "                                                 |",
  7791. "  Dodge: Dodges the enemy attack if successful   |",
  7792. }
  7793.  
  7794.  
  7795. hc3Col = {
  7796. "                                                  ",
  7797. "                    COMMANDS                      ",
  7798. "                                                  ",
  7799. "  Drink <item> = Drinks the drink you have and    ",
  7800. "  you regenate something like STA or HP.          ",
  7801. "                                                  ",
  7802. "  Eat <item> = Eat the food item you have and     ",
  7803. "  Regenate HP.                                    ",
  7804. "                                                  ",
  7805. "  Uppercut: Does An Uppercut that deals more dmg  ",
  7806. "                                                  ",
  7807. "  Dodge: Dodges the enemy attack if successful    ",
  7808. "                                                  ",
  7809. "  Leave: Leaves the match.                        ",
  7810. }
  7811.    
  7812. hc4 = {
  7813. "                    COMMANDS                     |",
  7814. "                  -:Cheat Commands:-             |",
  7815. "  Kill: Kills the enemy instantly                |",
  7816. "                                                 |",
  7817. "  Attack with <god weapons>: Deals maxium or     |",
  7818. "  Super high damage.                             |",
  7819. }
  7820.  
  7821.  
  7822. hc4Col = {
  7823. "                                                  ",
  7824. "                    COMMANDS                      ",
  7825. "                  -:Cheat Commands:-              ",
  7826. "  Kill: Kills the enemy instantly                 ",
  7827. "                                                  ",
  7828. "  Attack with <god weapons>: Deals maxium or      ",
  7829. "  Super high damage.                              ",
  7830. }  
  7831.  
  7832.  
  7833. if colorsOnOff == "OFF" then
  7834.    
  7835. if page == 1 then
  7836.  for i = 1, #hc1 do
  7837.         drawAt(2,i + 3,hc1[i])
  7838.         end
  7839.        
  7840.  elseif page == 2 then
  7841.   for i = 1, #hc2 do
  7842.         drawAt(2,i + 3,hc2[i])
  7843.         end
  7844.        
  7845.   elseif page == 3 then
  7846.  for i = 1, #hc3 do
  7847.         drawAt(2,i + 3,hc3[i])
  7848.         end
  7849.        
  7850.     elseif page == 4 then
  7851.  for i = 1, #hc4 do
  7852.         drawAt(2,i + 3,hc4[i])
  7853.         end
  7854.            end
  7855.            
  7856.            elseif colorsOnOff == "ON" then
  7857.            
  7858.            
  7859.            
  7860.            if page == 1 then
  7861.            for i = 1, #hc1 do
  7862.         drawAt(2,i + 3,hc1Col[i])
  7863.         end
  7864.        
  7865.  elseif page == 2 then
  7866.   for i = 1, #hc2 do
  7867.         drawAt(2,i + 3,hc2Col[i])
  7868.         end
  7869.        
  7870.   elseif page == 3 then
  7871.  for i = 1, #hc3 do
  7872.         drawAt(2,i + 3,hc3Col[i])
  7873.         end
  7874.        
  7875.     elseif page == 4 then
  7876.  for i = 1, #hc4 do
  7877.         drawAt(2,i + 3,hc4Col[i])
  7878.         end
  7879.            end
  7880.              end
  7881.               end
  7882.  function drawHelpAbilities()            
  7883. hlpAbi1 = {
  7884. "                  ABILITIES                      |",
  7885. "                -:Explanation:-                  |",
  7886. "  An ability is something like an 'Uppercut' or  |",
  7887. " 'Block', And all abilities can be upgraded      |",
  7888. "  Like for example 'Block' can get better        |",
  7889. "  Resistans against attacks and better chance    |",
  7890. "  To block and attack from an enemy or such      |",
  7891. }
  7892.  
  7893. hlpAbi1Col = {
  7894. "                                                  ",
  7895. "                  ABILITIES                       ",
  7896. "                -:Explanation:-                   ",
  7897. "  An ability is something like an 'Uppercut' or   ",
  7898. " 'Block', And all abilities can be upgraded       ",
  7899. "  Like for example 'Block' can get better         ",
  7900. "  Resistans against attacks and better chance     ",
  7901. "  To block and attack from an enemy or such       ",
  7902. }  
  7903.  
  7904. if colorsOnOff == "OFF" then
  7905.  
  7906. if page == 1 then
  7907.  for i = 1, #hlpAbi1 do
  7908.         drawAt(2,i + 3,hlpAbi1[i])
  7909.         end
  7910.          end
  7911.        
  7912.         elseif colorsOnOff == "ON" then
  7913.         if page == 1 then
  7914.  for i = 1, #hlpAbi1 do
  7915.         drawAt(2,i + 3,hlpAbi1Col[i])
  7916.         end
  7917.          end
  7918.           end
  7919.            end
  7920.  
  7921. ---------------------------------------------------------------------------------------------------
  7922.    
  7923.    
  7924. --How To Play
  7925.  function hHowToPlay()
  7926.   inHelpTopic = true
  7927.   minPage = 1
  7928.   maxPage = 7
  7929.   page = 1
  7930.   while inHelpTopic do
  7931.   cleanScreen()
  7932.   drawButtons()
  7933.   drawHelpMenu()
  7934.   drawHowToPlay()
  7935.   pageEvents()
  7936.   end
  7937.    end
  7938.  
  7939. --Controls
  7940. function hHelpControls()
  7941.  
  7942.   inHelpTopic = true
  7943.   minPage = 1
  7944.   maxPage = 4
  7945.   page = 1
  7946.   while inHelpTopic do
  7947.  
  7948.   cleanScreen()
  7949.   drawButtons()
  7950.   drawHelpMenu()
  7951.   drawHelpControls()
  7952.   pageEvents()
  7953.   end
  7954.    end
  7955.  
  7956.  function hHelpCommands()
  7957.    inHelpTopic = true
  7958.   minPage = 1
  7959.   maxPage = 4
  7960.   page = 1
  7961.   while inHelpTopic do
  7962.  
  7963.   cleanScreen()
  7964.   drawButtons()
  7965.   drawHelpMenu()
  7966.   drawHelpCommands()
  7967.   pageEvents()
  7968.   end
  7969.    end
  7970.  
  7971.  function hHelpAbilities()
  7972.    inHelpTopic = true
  7973.   minPage = 1
  7974.   maxPage = 1
  7975.   page = 1
  7976.   while inHelpTopic do
  7977.  
  7978.   cleanScreen()
  7979.   drawButtons()
  7980.   drawHelpMenu()
  7981.   drawHelpAbilities()
  7982.   pageEvents()
  7983.   end
  7984.    end
  7985.    
  7986.    
  7987. ---------------------------------------------------------------------------------------------------  
  7988. local helpArt = {
  7989. "  _____",
  7990. " /     \\______",
  7991. "|  .-''-.     |",
  7992. "| /      \\    |",
  7993. "| \\      /    |",
  7994. "|  '-..-;\\    |",
  7995. "|________\\\\___|",
  7996. "          \\|"
  7997. }
  7998.  
  7999.  
  8000.  
  8001. --Help Menu
  8002. function helpMenu()
  8003. exit = false
  8004. helpMenuStat = 1
  8005. while true do
  8006.  
  8007. if colorsOnOff == "ON" then
  8008. term.setBackgroundColor(ttBackColor)
  8009. drawAt(1,19,"                                                  ")
  8010. end
  8011.  
  8012. if exit == true then
  8013. break
  8014. end
  8015. cleanScreen()
  8016. drawHelpMenu()
  8017.  if colorsOnOff == "OFF" then
  8018.         for i = 1, #helpArt do
  8019.         drawAt(10,i + 9,helpArt[i])
  8020.         end
  8021.         elseif colorsOnOff == "ON" then
  8022.         term.setTextColor(menuTextColor)
  8023.         term.setBackgroundColor(menuBackColor)
  8024.         for i = 1, #helpArt do
  8025.         drawAt(10,i + 9,helpArt[i])
  8026.         end
  8027.          end
  8028.        
  8029. helpEvents()
  8030. end
  8031.  end
  8032.  
  8033.                                                  
  8034.  
  8035. ---------------------------------------------------------------------------------------------------
  8036. --MENUS
  8037. ---------------------------------------------------------------------------------------------------
  8038.  
  8039.  
  8040. --Difficulty Menu
  8041. function difMenu()
  8042. cleanScreen()
  8043. drawDifMenuU()
  8044. sleep(0.7)
  8045. term.setCursorPos(17,2)
  8046. if colorsOnOff == "ON" then
  8047. term.setBackgroundColor(ttBackColor)
  8048. textutils.slowPrint("--[Difficulty]--")
  8049. sleep(0.5)
  8050.  
  8051. elseif colorsOnOff == "OFF" then
  8052. textutils.slowPrint("--[Difficulty]--")
  8053. sleep(0.5)
  8054. end
  8055. menuStat = 2
  8056. while true do
  8057. cleanScreen()
  8058. drawDifMenu()
  8059. dMenuEvents()
  8060. end
  8061.  end
  8062.  
  8063.  
  8064. --Character Menu
  8065. function characterMenu()
  8066. menuStat = 2
  8067. while true do
  8068. cleanScreen()
  8069. drawChMenu()
  8070. chMenuEvents()
  8071. end
  8072. end
  8073.  
  8074. --Warning Menu
  8075. function warningMenu()
  8076. menuStat = 5
  8077. while true do
  8078. drawWarningMenu()
  8079. wMenuEvents()
  8080. end
  8081. end
  8082.  
  8083. --Solo Menu
  8084. function solo()
  8085. checkDifficulty()
  8086. menuStat = 2
  8087. while true do
  8088. checkStatus()
  8089. if cheatUnlimitedMoney == true then
  8090. money = 99999999999999
  8091. end
  8092. drawHomeMenu()
  8093. hMenuEvents()
  8094. end
  8095. end
  8096.  
  8097.  
  8098.  
  8099. --Main Menu
  8100. function menu()
  8101.   menuStat = 2
  8102.   loadSettings()
  8103.   checkSettings()
  8104.   while true do
  8105.   checkXp()
  8106.         drawMenu()
  8107.         menuEvents()
  8108.   end
  8109. end
  8110.  
  8111.  
  8112.  
  8113.  
  8114. --Starts The Game
  8115. menu()
  8116. ---------------------------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment