Advertisement
Guest User

Cartel Simulator

a guest
Oct 23rd, 2014
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.21 KB | None | 0 0
  1. --GAME VARIABLES--
  2.  
  3. win=0
  4.  
  5. ep1=""
  6. ep2=""
  7. ep3=""
  8. ep4=""
  9.  
  10. name=readline ("Please type your name:")
  11. salary=0
  12. money=0
  13. purity=1
  14. worth=10
  15. day=1
  16. cooks=0
  17. distrs=0
  18. resrs=0
  19. locs=0
  20. tired=0
  21.  
  22. b1="|Available]"
  23. b2="|Available]"
  24. b3="|Available]"
  25. b4="|Available]"
  26.  
  27. rsc=0
  28. rs1=0
  29. rs2=0
  30. rs3=0
  31. rs4=0
  32. rs5=0
  33. rs6=0
  34.  
  35. hc1=0
  36. hc2=0
  37. hc3=0
  38. hd1=0
  39. hd2=0
  40. hd3=0
  41. hr1=0
  42. hr2=0
  43. hr3=0
  44. mhc1=0
  45. mhc2=0
  46. mhc3=0
  47. meth=0
  48. methd1=0
  49. methd2=0
  50. methd3=0
  51. meths1=0
  52. meths2=0
  53. meths3=0
  54. rr1=hr1*0.1
  55. rr2=hr2*0.2
  56. rr3=hr3*0.3
  57. rrate=rr1+rr2+rr3
  58.  
  59. if name=="Winner" then purity=100 end
  60.  
  61. if name=="Heisenberg" then purity=100 end
  62.  
  63. if name=="Walter White" then purity=50 end
  64.  
  65. if name=="Jesse Pinkman" then purity=25 end
  66.  
  67. if name=="Gus Fring" then
  68. rs5=1
  69. rs6=1
  70. rsc=96
  71. money=15000
  72. end
  73.  
  74. --GAME AND WORKERS LOGIC--
  75.  
  76. function CheckResearchers()
  77. rr1=hr1*0.1
  78. rr2=hr2*0.2
  79. rr3=hr3*0.3
  80. rrate=rr1+rr2+rr3
  81. end
  82.  
  83. function CheckCooks()
  84. if cooks>0 then
  85. if distrs>=cooks then
  86. salary=distrs*20
  87. end
  88. end
  89. end
  90.  
  91. function Research()
  92. if resrs>0 then
  93. purity=purity+rrate
  94. end
  95. end
  96.  
  97. function CheckPurity()
  98. if purity>100 then
  99. purity=100
  100. end
  101. end
  102.  
  103. function CheckLocations()
  104. locs=rs1+rs2+rs3+rs4+rs5+rs6
  105. end
  106.  
  107. function CheckWorkers()
  108. cooks=hc1+hc2+hc3
  109. distrs=hd1+hd2+hd3
  110. resrs=hr1+hr2+hr3
  111. end
  112.  
  113. function CheckSalary()
  114. if distrs>=cooks then
  115. mhc1=hc1
  116. mhc2=hc2*2
  117. mhc3=hc3*3
  118. meth=mhc1+mhc2+mhc3
  119. if hd2==0 and hd3==0 then
  120. methd1=meth
  121. elseif hd1==0 and hd3==0 then
  122. methd2=meth
  123. elseif hd1==0 and hd2==0 then
  124. methd3=meth
  125. elseif hd1==0 then
  126. methd2=meth/2
  127. methd3=meth/2
  128. elseif hd2==0 then
  129. methd1=meth/2
  130. methd3=meth/2
  131. elseif hd3==0 then
  132. methd1=meth/2
  133. methd2=meth/2
  134. else
  135. methd1=meth/3
  136. methd2=meth/3
  137. methd3=meth/3
  138. end
  139. meths1=methd1*25
  140. meths2=methd2*50
  141. meths3=methd3*100
  142. salary=meths1+meths2+meths3
  143. end
  144. end
  145.  
  146. function WinGame()
  147. if purity==100 and name~="Heisenberg" then
  148. win=1
  149. print("!! YOU WIN !!","Congratulations! You have reached 100% purity and won the game in "..day.." days.")
  150. exit()
  151. end
  152. end
  153.  
  154. function CheckWorth()
  155. if purity<11 and purity<20 then
  156. worth=20
  157. elseif purity<21 and purity<50 then
  158. worth=40
  159. elseif purity<31 and purity<75 then
  160. worth=50
  161. elseif purity<51 and purity<90 then
  162. worth=75
  163. elseif purity<90 then
  164. worth=100
  165. elseif purity<91 then
  166. worth=125
  167. elseif purity<92 then
  168. worth=150
  169. elseif purity<93 then
  170. worth=200
  171. elseif purity<94 then
  172. worth=250
  173. elseif purity<95 then
  174. worth=250
  175. elseif purity<96 then
  176. worth=300
  177. elseif purity<97 then
  178. worth=350
  179. elseif purity<98 then
  180. worth=400
  181. elseif purity<99 then
  182. worth=450
  183. elseif purity<100 then
  184. worth=500
  185. elseif purity==100 then
  186. worth=1000
  187. end
  188. end
  189.  
  190. --TUTORIAL--
  191.  
  192. print("WELCOME","Welcome to Cartel Simulator. The basics of the game is this.. cook meth to get money and use that money to hire more cooks, distributors, researchers, etc to make the most money you can. Throughout the menus you will be asked questions of what you want to do. Your options will be in CAPS and you will input the CAPS option after you press Done. Note that these inputs are NOT case sensitive. Also keep in mind that you can leave any input option blank to return to the main menu.\n\nExpansions(ignore this)\n-------------\n"..ep1.."\n"..ep2.."\n"..ep3.."\n"..ep4.."")
  193.  
  194. --GAME MENU--
  195.  
  196.  
  197. function m()
  198. CheckResearchers()
  199. CheckWorkers()
  200. CheckPurity()
  201. CheckWorth()
  202. CheckCooks()
  203. CheckLocations()
  204. CheckSalary()
  205. print("MENU","Hello "..name..". It is Day "..day..". You currently have $"..money.." and make $"..salary.." a day. Your meth purity is "..purity.."%. You have "..cooks.." cooks, "..distrs.." distributors, and "..resrs.." researchers all at "..locs.." different locations, which all have "..rsc.." staff slots combined. You own "..rs1.." shacks, "..rs2.." treehouses, "..rs3.." apartments, "..rs4.." houses, "..rs5.." commercial buildings, and "..rs6.." industrial buildings.")
  206.  
  207. WinGame()
  208.  
  209. print("MENU","What would you like to do? BUY equipment, HIRE workers, check REAL ESTATE, COOK a batch of meth, or SLEEP for the night?\n\n\n\n\n\nDEBUG for debug menu")
  210.  
  211. manage=readline("manage")
  212. end
  213.  
  214.  
  215. --MENU OPTIONS--
  216.  
  217. function o()
  218.  
  219. if strlower(manage)=="sleep" then
  220. print("SLEEP","You sleep for the night")
  221. day=day+1
  222. money=money+salary
  223. tired=0
  224. Research()
  225. end
  226.  
  227.  
  228. if strlower(manage)=="cook" then
  229. if tired>=5 then
  230. print("NOPE","You are too tired! You need to sleep.")
  231. else
  232. print("COOK","You cook a batch for $"..worth.."!")
  233. money=money+worth
  234. tired=tired+1
  235. end
  236. end
  237.  
  238. if strlower(manage)=="buy" then
  239. print("BUY","Welcome to the equipment shop! From here you can buy equipment that will raise your purity level. Here are your options...")
  240. print("BUY","[OP1|Extra lab equipment|$100"..b1.."\n\n[OP2|Uncle Jim's chemistry kit|$500"..b2.."\n\n[OP3|ServX Chemical Purifier|$1,500"..b3.."\n\n[OP4|Shady underground lab contruction deal|$10,000"..b4..".")
  241. bc=readline("Which do you want to buy?")
  242.  
  243. if strlower(bc)=="op1" then
  244. if b1=="|Available]" then
  245. if money>=100 then
  246. money=money-100
  247. b1="|Purchased"
  248. purity=purity+5
  249. print("PURCHASED","You have bought some extra lab equipment")
  250. elseif money<100 then
  251. print("INVALID","You dont have enough money")
  252. end
  253. end
  254. if b1=="|Purchased]" then
  255. print("","You already bought that")
  256. end
  257. end
  258.  
  259. if strlower(bc)=="op2" then
  260. if b2=="|Available]" then
  261. if money>=500 then
  262. money=money-500
  263. b2="|Purchased]"
  264. purity=purity+10
  265. print("PURCHASED","You have bought Uncle Jim's lab kit")
  266. elseif money<500 then
  267. print("INVALID","You dont have enough money")
  268. end
  269. elseif b2=="|Purchased]" then
  270. print("","You already bought that")
  271. end
  272. end
  273.  
  274. if strlower(bc)=="op3" then
  275. if b3=="|Available]" then
  276. if money>=1500 then
  277. money=money-1500
  278. b3="|Purchased"
  279. purity=purity+15
  280. print("PURCHASED","You have bought a chemical purifier")
  281. elseif money<1500 then
  282. print("INVALID","You dont have enough money")
  283. end
  284. elseif b3=="|Purchased]" then
  285. print("","You already bought that")
  286. end
  287. end
  288.  
  289. if strlower(bc)=="op4" then
  290. if b4=="|Available]" then
  291. if money>=10000 then
  292. money=money-10000
  293. b4="|Purchased"
  294. purity=purity+20
  295. print("PURCHASED","You have constructed an underground lab")
  296. elseif money<10000 then
  297. print("INVALID","You dont have enough money")
  298. end
  299. elseif b4=="|Purchased]" then
  300. print("","You already bought that")
  301. end
  302. end
  303. end
  304.  
  305.  
  306. if strlower(manage)=="real estate" then
  307. print("REAL ESTATE","Welcome to the real estate menu! From here you can purchase additional buildings to hide your cartel staff in. Here are your options...")
  308. print("REAL ESTATE","[OP1|Backyard shack|$100|Fits 2 people]\n\n[OP2|Treehouse|$250|Fits 5 people]\n\n[OP3|Apartment|$600|Fits 8 people]\n\n[OP4|House|$1800|Fits 19 people]\n\n[OP5|Commercial building|$5600|Fits 32]\n\n[OP6|Industrial building|$10400|Fits 64]")
  309. rc=readline("Which do you want to buy?")
  310.  
  311. if strlower(rc)=="op1" then
  312. if money>=100 then
  313. print("","You bought a backyard shack")
  314. rs1=rs1+1
  315. rsc=rsc+2
  316. money=money-100
  317. elseif money<100 then
  318. print("You dont have enough money")
  319. end
  320. end
  321.  
  322. if strlower(rc)=="op2" then
  323. if money>=250 then
  324. print("","You bought a treehouse")
  325. rs2=rs2+1
  326. rsc=rsc+5
  327. money=money-250
  328. elseif money<250 then
  329. print("You dont have enough money")
  330. end
  331. end
  332.  
  333. if strlower(rc)=="op3" then
  334. if money>=600 then
  335. print("","You bought an apartment")
  336. rs3=rs3+1
  337. rsc=rsc+8
  338. money=money-600
  339. elseif money<600 then
  340. print("You dont have enough money")
  341. end
  342. end
  343.  
  344. if strlower(rc)=="op4" then
  345. if money>=1800 then
  346. print("","You bought a house")
  347. rs4=rs4+1
  348. rsc=rsc+19
  349. money=money-1800
  350. elseif money<1800 then
  351. print("You dont have enough money")
  352. end
  353. end
  354.  
  355. if strlower(rc)=="op5" then
  356. if money>=5600 then
  357. print("","You bought a commercial building")
  358. rs5=rs5+1
  359. rsc=rsc+32
  360. money=money-5600
  361. elseif money<5600 then
  362. print("You dont have enough money")
  363. end
  364. end
  365.  
  366. if strlower(rc)=="op6" then
  367. if money>=10400 then
  368. print("","You bought an industrial building")
  369. rs6=rs6+1
  370. rsc=rsc+64
  371. money=money-10400
  372. elseif money<10400 then
  373. print("You dont have enough money")
  374. end
  375. end
  376. end
  377.  
  378.  
  379. if strlower(manage)=="hire" then
  380. print("WORKERS","Welcome to the hire menu. Here you can hire illegal immigrants of different skill levels to do different things. Cooks automatically cook batches of meth each day, distributors sell the meth that the cooks produce, and researches add percentage to your purity level each day. Keep in mind that cooks can only get their meth sold if you have an equal amount of distributors! Here are your options...")
  381. print("WORKERS","[C1|Low-skill meth cook|$200]\n\n[C2|Medium-skill meth cook|$450]\n\n[C3|High-skill meth cook|$1000]\n\n[D1|Low-skill distributor|$100]\n\n[D2|Medium-skill distributor|$300]\n\n[D3|High-skill distributor|$600]\n\n[R1|Low-skill researcher|$500]\n\n[R2|Medium-skill researcher|$1000]\n\n[R3|High-skill researcher|$2000]")
  382. hc=readline("Which would you like to hire?")
  383.  
  384. if strlower(hc)=="c1" then
  385. if rsc==0 then
  386. print("","You do not have any open staff slots")
  387. elseif money>=200 then
  388. print("","You hired a low skill cook")
  389. hc1=hc1+1
  390. money=money-200
  391. rsc=rsc-1
  392. elseif money<200 then
  393. print("","You do not have enough money")
  394. end
  395. end
  396.  
  397. if strlower(hc)=="c2" then
  398. if rsc==0 then
  399. print("","You do not have any open staff slots")
  400. elseif money>=450 then
  401. print("","You hired a medium skill cook")
  402. hc2=hc2+1
  403. money=money-450
  404. rsc=rsc-1
  405. elseif money<450 then
  406. print("","You do not have enough money")
  407. end
  408. end
  409.  
  410. if strlower(hc)=="c3" then
  411. if rsc==0 then
  412. print("","You do not have any open staff slots")
  413. elseif money>=1000 then
  414. print("","You hired a high skill cook")
  415. hc3=hc3+1
  416. money=money-1000
  417. rsc=rsc-1
  418. elseif money<1000 then
  419. print("","You do not have enough money")
  420. end
  421. end
  422.  
  423. if strlower(hc)=="d1" then
  424. if rsc==0 then
  425. print("","You do not have any open staff slots")
  426. elseif money>=100 then
  427. print("","You hired a low skill distributor")
  428. hd1=hd1+1
  429. money=money-100
  430. rsc=rsc-1
  431. elseif money<100 then
  432. print("","You do not have enough money")
  433. end
  434. end
  435.  
  436. if strlower(hc)=="d2" then
  437. if rsc==0 then
  438. print("","You do not have any open staff slots")
  439. elseif money>=300 then
  440. print("","You hired a medium skill distributor")
  441. hd2=hd2+1
  442. money=money-300
  443. rsc=rsc-1
  444. elseif money<300 then
  445. print("","You do not have enough money")
  446. end
  447. end
  448.  
  449. if strlower(hc)=="d3" then
  450. if rsc==0 then
  451. print("","You do not have any open staff slots")
  452. elseif money>=600 then
  453. print("","You hired a high skill distributor")
  454. hd3=hd3+1
  455. money=money-600
  456. rsc=rsc-1
  457. elseif money<600 then
  458. print("","You do not have enough money")
  459. end
  460. end
  461.  
  462. if strlower(hc)=="r1" then
  463. if rsc==0 then
  464. print("","You do not have any open staff slots")
  465. elseif money>=500 then
  466. print("","You hired a low skill researcher")
  467. hr1=hr1+1
  468. money=money-500
  469. rsc=rsc-1
  470. elseif money<500 then
  471. print("","You do not have enough money")
  472. end
  473. end
  474.  
  475. if strlower(hc)=="r2" then
  476. if rsc==0 then
  477. print("","You do not have any open staff slots")
  478. elseif money>=1000 then
  479. print("","You hired a medium skill researcher")
  480. hr2=hr2+1
  481. money=money-1000
  482. rsc=rsc-1
  483. elseif money<1000 then
  484. print("","You do not have enough money")
  485. end
  486. end
  487.  
  488. if strlower(hc)=="r3" then
  489. if rsc==0 then
  490. print("","You do not have any open staff slots")
  491. elseif money>=1000 then
  492. print("","You hired a high skill researcher")
  493. hr3=hr3+1
  494. money=money-2000
  495. rsc=rsc-1
  496. elseif money<2000 then
  497. print("","You do not have enough money")
  498. end
  499. end
  500. end
  501.  
  502.  
  503.  
  504.  
  505.  
  506. end
  507. --LOOPER--
  508. while win==0 do
  509. m()
  510. o()
  511. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement