Advertisement
buttercheetah

Axium

Dec 4th, 2019
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.14 KB | None | 0 0
  1. ::compbeg::
  2. local component = require("component")
  3. local gpu = component.gpu
  4. local colors = require("colors")
  5. local width, height = gpu.getResolution()
  6. local text = "Project Axium"
  7. gpu.setBackground(0x000000)
  8. print("Project Axium 0.02")
  9. os.sleep(1)
  10. ::beg::
  11. os.execute("cls")
  12. print("what is the Hero's name")
  13. local name = io.read("*l")
  14. local health = 100
  15. local damage = 1
  16. local critC = 10
  17. local missC = 5
  18. local ress = 1
  19. local CordX = 0
  20. local CordZ = 0
  21. local Cname = "error"
  22. local Chealth = 1
  23. local Cdamage = 1
  24. local exp = 0
  25. local nedexp = 0
  26. local option = 0
  27. local randoN = 0
  28. local chosenN = 0
  29. local Tdamage = 0
  30. local coins = 0
  31. local firebcoold = 0
  32. nedexp = nedexp + 1
  33. --mobs!
  34. local slimeN = "Slime"
  35. local slimeH = 10
  36. local slimeA = 1
  37. local bunnyN = "Bunny"
  38. local bunnyH = 15
  39. local bunnyA = 3
  40. local skeletonN = "Skeleton"
  41. local skeletonH = 20
  42. local skeletonA = 5
  43. local witchN = "Witch"
  44. local witchH = 20
  45. local witchA = 8
  46. local ghostN = "ghost"
  47. local ghostH = 3
  48. local ghostA = 15
  49. local babydN = "Baby Dragon"
  50. local babydH = 100
  51. local babydA = 50
  52. local option2 = 0
  53. local option3 = 0
  54. local burning = 0
  55. ::home::
  56. local endsceneC = math.random(0, 100)
  57. local runchance = math.random(1, 4)
  58. local Rmob = math.random(0, 100)
  59. local mobspawnC = math.random(0, 100)
  60. gpu.setBackground(0x005050)
  61. if exp >= nedexp then
  62. goto lvlup
  63. end
  64. os.execute("cls")
  65. print("Welcome " .. name .. "!")
  66. print("Stats:")
  67. print("coins = " .. coins)
  68. print("X = " .. CordX .. " Z = " .. CordZ)
  69. print("Health = " .. health .. " Damage = " .. damage)
  70. print("Crit chance = " .. critC .. "% miss chance = " .. missC .. "%")
  71. print("resistance = " .. ress)
  72. print("XP = " .. exp .. " of " .. nedexp)
  73. print("")
  74. print("what would you like to do?")
  75. print("1) move")
  76. print("2) inventory")
  77. option = io.read("*l")
  78. if option == "1" then
  79. goto move
  80. elseif option == "2" then
  81. goto inventory
  82. elseif option == "adminOV" then
  83. goto adminpanel
  84. else
  85. goto home
  86. end
  87. ::adminpanel::
  88. gpu.setBackground(0x000000)
  89. os.execute("cls")
  90. print("1) add exp")
  91. print("2) add damage")
  92. print("3) add health")
  93. print("4) add resistance")
  94. print("5) add coins")
  95. print("6) change coords")
  96. print("7) back")
  97. option = io.read("*l")
  98. if option == "1" then
  99. print("how much?")
  100. option = io.read("*n")
  101. exp = exp + option
  102. elseif option == "2" then
  103. print("how much?")
  104. option = io.read("*n")
  105. damage = damage + option
  106. elseif option == "3" then
  107. print("how much")
  108. option = io.read("*n")
  109. health = health + option
  110. elseif option == "4" then
  111. print("how much?")
  112. print("hint: dont go crazy. max 10")
  113. option = io.read("*n")
  114. ress = ress + option
  115. elseif option == "5" then
  116. print("how much?")
  117. option = io.read("*n")
  118. coins = coins + option
  119. elseif option == "6" then
  120. print("CordX =")
  121. option = io.read("*n")
  122. CordX = option
  123. print("CordZ =")
  124. option = io.read("*n")
  125. CordZ = option
  126. elseif option == "7" then
  127. goto home
  128. end
  129. goto adminpanel
  130. ::move::
  131. coins = coins + 1
  132. os.execute("cls")
  133. print("what direction would you like to go?")
  134. print("1) north -Z")
  135. print("2) east +X")
  136. print("3) south +Z")
  137. print("4) west -Z")
  138. option = io.read("*l")
  139. if option == "1" then
  140. CordZ = CordZ - 1
  141. goto chance
  142. elseif option == "2" then
  143. CordX = CordX + 1
  144. goto chance
  145. elseif option == "3" then
  146. CordZ = CordZ + 1
  147. goto chance
  148. elseif option == "4" then
  149. CordX = CordX - 1
  150. elseif option == "adminOV" then
  151. print("which mob should appear next?")
  152. print("1)slime 2)bunny 3)witch")
  153. print("4)ghost 5)baby dragon")
  154. option2 = io.read("*l")
  155. if option2 == "1" then
  156. Rmob = 39
  157. elseif option2 == "2" then
  158. Rmob = 41
  159. elseif option2 == "3" then
  160. Rmob = 71
  161. print("trigger end scene?")
  162. print("Y/n")
  163. option = io.read("*l")
  164. if option == n then
  165. print("oof")
  166. else
  167. endsceneC = 49
  168. end
  169. elseif option2 == "4" then
  170. Rmob = 91
  171. elseif option2 == "5" then
  172. Rmob = 96
  173. end
  174. mobspawnC = 100
  175. goto move
  176. else
  177. goto move
  178. end
  179. ::chance::
  180. if CordX == 100 and CordZ == 100 then
  181. os.execute("cls")
  182. print("you have entered the village of cento")
  183. print("what would you like to do?")
  184. print("1) shop")
  185. print("2) go to a doctors")
  186. print("3) visit a rune master")
  187. print("4) leave")
  188. option = io.read("*l")
  189. if option == "1" then
  190. os.execute("cls")
  191. print("what would you like to buy?")
  192. print("1) damage upgrades")
  193. print("2) back")
  194. option2 = io.read("*l")
  195. if option2 == "1" then
  196. print("that'l be 400 coins")
  197. print("y/n")
  198. option3 = io.read("*l")
  199. if option3 == "y" then
  200. if coins >= 400 then
  201. print("alrighty then")
  202. os.sleep(2)
  203. coins = coins - 400
  204. damage = damage + 1
  205. else
  206. print("you aint got enugh lad, sorry")
  207. os.sleep(2)
  208. end
  209. end
  210. goto chance
  211. elseif option2 == "2" then
  212. goto chance
  213. else
  214. goto chance
  215. end
  216. elseif option == "2" then
  217. os.execute("cls")
  218. print("do you need some potions?")
  219. print("im afraid their 200 dollars a piece")
  220. print("y/n")
  221. option2 = io.read("*l")
  222. if option2 == "y" then
  223. if coins >= 200 then
  224. print("commin right up")
  225. os.sleep(2)
  226. coins = coins - 200
  227. health = health + 20
  228. else
  229. print("oh sorry, but you only have " .. coins)
  230. os.sleep(2)
  231. end
  232. elseif option2 == "n" then
  233. goto chance
  234. end
  235. goto chance
  236. elseif option == "3" then
  237. os.execute("cls")
  238. print("you came for runes, right?")
  239. print("that'l be 800 coins")
  240. print("hope that aint a problem")
  241. print("y/n")
  242. option2 = io.read("*l")
  243. if option2 == "y" then
  244. if coins >= 800 then
  245. print("whatever, heres your rune")
  246. os.sleep(3)
  247. ress = ress + 1
  248. goto chance
  249. else
  250. print("what are you trying to scam me with")
  251. print("only " .. coins .. " coins!?")
  252. print("get outa here!")
  253. os.sleep(4)
  254. goto chance
  255. end
  256. else
  257. goto chance
  258. end
  259. else
  260. os.execute("cls")
  261. print("what direction would you like to go?")
  262. print("1) north -Z")
  263. print("2) east +X")
  264. print("3) south +Z")
  265. print("4) west -Z")
  266. option = io.read("*l")
  267. if option == "1" then
  268. CordZ = CordZ - 1
  269. elseif option == "2" then
  270. CordX = CordX + 1
  271. elseif option == "3" then
  272. CordZ = CordZ + 1
  273. elseif option == "4" then
  274. CordX = CordX - 1
  275. end
  276. goto home
  277. end
  278. end
  279. --mob appear chance
  280. if mobspawnC >= 50 then
  281. print("50!")
  282. if Rmob <= 40 then
  283. Cname = slimeN
  284. Chealth = slimeH
  285. Cdamage = slimeA
  286. CThealth = Chealth
  287. print(Cname)
  288. print(Chealth)
  289. print(Cdamage)
  290. goto battle
  291. elseif Rmob >= 41 and Rmob <= 70 then
  292. Cname = bunnyN
  293. Chealth = bunnyH
  294. Cdamage = bunnyA
  295. CThealth = Chealth
  296. goto battle
  297. elseif Rmob <= 80 and Rmob >= 71 then
  298. Cname = witchN
  299. Chealth = witchH
  300. Cdamage = witchA
  301. CThealth = Chealth
  302. goto battle
  303. elseif Rmob <= 94 and Rmob >= 81 then
  304. Cname = ghostN
  305. Chealth = ghostH
  306. Cdamage = ghostA
  307. CThealth = Chealth
  308. goto battle
  309. elseif Rmob >= 95 then
  310. Cname = babydN
  311. Chealth = babydH
  312. Cdamage = babydA
  313. CThealth = Chealth
  314. goto battle
  315. end
  316. else
  317. goto home
  318. end
  319. ::battle::
  320. randoN = math.random(0, 10)
  321. gpu.setBackground(0xff2020)
  322. os.execute("cls")
  323. if health <= 0 then
  324. gpu.setBackground(0xff0303)
  325. os.sleep(0.5)
  326. print("you have died!")
  327. os.sleep(2)
  328. print("thats sad")
  329. os.sleep(2)
  330. print("final coins = " .. coins)
  331. print("press enter to leave")
  332. option = io.read("*l")
  333. goto compbeg
  334. end
  335. print(Cname .. " Has appeared")
  336. print("health = " .. Chealth)
  337. print("damage = " .. Cdamage)
  338. if burning >= 1 then
  339. print("BURNING!")
  340. end
  341. print("")
  342. print(name)
  343. print("health = " .. health)
  344. print("damage = " .. damage)
  345. print("")
  346. print("what will you do")
  347. print("1) attack")
  348. print("2) run")
  349. option = io.read("*l")
  350. if option == "1" then
  351. print("select type of attack")
  352. print("1) light")
  353. print("2) heavy(sometimes backfires)")
  354. print("3) fireball")
  355. option2 = io.read("*l")
  356. if option2 == "1" then
  357. --attack chance
  358. if math.random(0, 1000) <= 5 then
  359. print("attack failed")
  360. os.sleep(2)
  361. goto obattle
  362. end
  363. Chealth = Chealth - damage
  364. print("attack successfull")
  365. os.sleep(2)
  366. if math.random(0, 100) <= 10 then
  367. print("The attack did more damage than expected!")
  368. print("you did twice the ammount of damage!")
  369. os.sleep(2)
  370. Chealth = Chealth - damage
  371. end
  372. if randoN >= 5 then
  373. print("your sword suddenly became very light")
  374. print("you attack twice")
  375. os.sleep(2)
  376. Chealth = Chealth - damage
  377. end
  378. if Chealth <= 0 then
  379. goto endbattle
  380. end
  381. elseif option2 == "2" then
  382. print("choose a number betwwen 1-10")
  383. chosenN = io.read("*n")
  384. if chosenN >= 11 then
  385. print("error to high of number")
  386. os.sleep(2)
  387. goto battle
  388. end
  389. randoN = randoN - 2
  390. chosenN = chosenN - randoN
  391. if chosenN - chosenN == 0 then
  392. print("")
  393. else
  394. chosenN = chosenN * -1
  395. end
  396. if chosenN >= 0 and chosenN <= 1 then
  397. os.execute("cls")
  398. print("you swung you sword but did no damage!")
  399. os.sleep(1)
  400. print("instead you brok your wrist!")
  401. print("-10 health!")
  402. health = health - 10
  403. os.sleep(2)
  404. elseif chosenN >= 2 and chosenN <= 4 then
  405. os.execute("cls")
  406. Tdamage = 1 * damage
  407. print("you did " .. Tdamage .. " damage")
  408. elseif chosenN >= 5 and chosenN <= 8 then
  409. os.execute("cls")
  410. Tdamage = 2 * damage
  411. print("you did " .. Tdamage .. " damage")
  412. elseif chosenN >= 9 and chosenN <= 10 then
  413. os.execute("cls")
  414. Tdamage = 3 * damage
  415. print("you did " .. Tdamage .. " damage")
  416. else
  417. print("now thats alot of damage!")
  418. Tdamage = 4 * damage
  419. print("you did " .. Tdamage .. " damage")
  420. os.sleep(3)
  421. end
  422. Chealth = Chealth - Tdamage
  423. if Chealth <= 0 then
  424. goto endbattle
  425. end
  426. elseif option2 == "3" then
  427. if firebcoold >= 1 then
  428. print("you are out of mana!")
  429. print("please wait to regain mana!")
  430. os.sleep(3)
  431. goto home
  432. end
  433. print("you cast fireball!")
  434. os.sleep(1)
  435. burning = damage * 2
  436. print("the enemy wil burn for " .. burning .. " turns")
  437. print("you do " .. damage / 2 .. " damage")
  438. os.sleep(3)
  439. firebcoold = 3
  440. end
  441. goto obattle
  442. elseif option == "2" then
  443. goto Attackrun
  444. elseif option == "adminOV" then
  445. Chealth = Chealth - Chealth
  446. if Chealth == 0 then
  447. goto endbattle
  448. end
  449. else
  450. goto battle
  451. end
  452. ::obattle::
  453. if burning >= 1 then
  454. print("the enemy is on fire! -" .. damage .. " health!")
  455. Chealth = Chealth - damage
  456. end
  457. if firebcoold >= 1 then
  458. firebcoold = firebcoold - 1
  459. end
  460. print("The " .. Cname .. " is trying to attack ")
  461. os.sleep(2)
  462. if math.random(1, 4) <= 2 then
  463. print("The attack landed!")
  464. print(Cdamage .. " damage!")
  465. health = health - Cdamage / ress
  466. os.sleep(2)
  467. else
  468. print("the attack failed!")
  469. os.sleep(1)
  470. end
  471. goto battle
  472. ::Attackrun::
  473. if Cname == babydN and randoN >= 2 then
  474. print("the baby dragon breathes fire on you")
  475. os.sleep(2)
  476. print("-10 health")
  477. os.sleep(1)
  478. health = health - 10
  479. goto obattle
  480. elseif Cname == babydN then
  481. print("you got away")
  482. os.sleep(1)
  483. print("somehow....")
  484. os.sleep(3)
  485. goto home
  486. end
  487. if math.random(0, 3) <= 1 then
  488. os.execute("cls")
  489. print("you have succsesfully ran away!")
  490. os.sleep(2)
  491. goto home
  492. else
  493. os.execute("cls")
  494. print("you failed to run away!")
  495. if runchance == 1 then
  496. print("while running away you stubbed your toe!")
  497. print("-1 health")
  498. health = health - 1 / ress
  499. elseif runchance == 2 then
  500. print("while running away the " .. Cname .. " hit you from behind!")
  501. print("-2 health!")
  502. health = health - 2 / ress
  503. end
  504. os.sleep(2)
  505. goto battle
  506. end
  507. ::endbattle::
  508. gpu.setBackground(0x949235)
  509. os.execute("cls")
  510. print("you win!")
  511. print("you got 10 coins")
  512. exp = exp + CThealth / 10
  513. coins = coins + 10
  514. print("you earned " .. exp .. " xp!")
  515. print("XP = " .. exp .. " of " .. nedexp)
  516. os.sleep(2)
  517. ::lvlup::
  518. gpu.setBackground(0x949235)
  519. os.execute("cls")
  520. if exp >= nedexp then
  521. print("you have leveled up!")
  522. print("1) increase health")
  523. print("2) increase damage")
  524. option = io.read("*l")
  525. if option == "1" then
  526. os.execute("cls")
  527. print("adding 10 health")
  528. health = health + 10
  529. print("health is now " .. health)
  530. os.sleep(2)
  531. elseif option == "2" then
  532. os.execute("cls")
  533. print("adding 1 damage!")
  534. damage = damage + 1
  535. print("damage is now " .. damage)
  536. os.sleep(2)
  537. else
  538. goto lvlup
  539. end
  540. exp = exp - nedexp
  541. nedexp = nedexp + 1
  542. end
  543. if Cname == witchN and endsceneC <= 50 then
  544. os.execute("cls")
  545. gpu.setBackground(0x0042b5)
  546. os.execute("cls")
  547. print("while leaving the battle field you stumble across a glowing rune")
  548. os.sleep(3)
  549. print("it feels like its calling to you....")
  550. os.sleep(3)
  551. print("do you take it?")
  552. print("Y/n")
  553. option = io.read("*l")
  554. if option == n then
  555. goto home
  556. else
  557. ress = ress + 1
  558. os.execute("cls")
  559. print("you reach for the glowing object")
  560. os.sleep(3)
  561. print("you can hear a humming sound comming from it")
  562. os.sleep(3)
  563. os.execute("cls")
  564. gpu.setBackground(0xb5001e)
  565. os.execute("cls")
  566. os.sleep(0.5)
  567. gpu.setBackground(0x000000)
  568. os.execute("cls")
  569. os.sleep(0.5)
  570. gpu.setBackground(0xb5001e)
  571. os.execute("cls")
  572. os.sleep(0.5)
  573. gpu.setBackground(0x000000)
  574. os.execute("cls")
  575. os.sleep(0.5)
  576. gpu.setBackground(0xb5001e)
  577. os.execute("cls")
  578. os.sleep(0.5)
  579. gpu.setBackground(0x000000)
  580. os.execute("cls")
  581. os.sleep(0.5)
  582. gpu.setBackground(0xb5001e)
  583. os.execute("cls")
  584. os.sleep(0.5)
  585. gpu.setBackground(0x000000)
  586. os.execute("cls")
  587. os.sleep(0.5)
  588. gpu.setBackground(0xb5001e)
  589. os.execute("cls")
  590. os.sleep(0.5)
  591. gpu.setBackground(0x000000)
  592. os.execute("cls")
  593. os.sleep(0.5)
  594. gpu.setBackground(0xffffff)
  595. os.execute("cls")
  596. os.sleep(2)
  597. gpu.setBackground(0x0042b5)
  598. os.execute("cls")
  599. print("your resistance has gone up!")
  600. os.sleep(5)
  601. end
  602. end
  603. goto home
  604. ::inventory::
  605. ::theend::
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement