health_effects.lua 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416
  1. -------------------------------------
  2. --HEALTH EFFECTS
  3. ------------------------------------
  4. --[[
  5. Persistent changes e.g. disease, drug trips, venom, parasites
  6. Names
  7. A string name is used both for checks and is displayed on Char Tab (Lore)
  8. This string has an associated function.
  9. Effects List:
  10. Stored as string in the player meta. {{name, order},{name2, order},... }
  11. Run health function:
  12. Applies the health effect. Returns modifiers to main helath loop, runs
  13. other health processes (e.g. vomiting, staggering). Checks for internal means
  14. of progression or ending (timers, chance).
  15. Called by malus_bonus (i.e. the players internal metabolism)
  16. Triggers for adding:
  17. e.g. from eating, getting bitten, ...
  18. update_list_add_new,
  19. Triggers for swapping or removal
  20. -Internal:
  21. - on_timer:
  22. - chance:
  23. - conditional:
  24. -external: something outside the disease process itself e.g eat item.
  25. each health effect has its three functions:
  26. - one for adding symptoms and calls for internal adding, swapping, removing (e.g. due to timers)
  27. - progression: for adding, worsening effects. Called internally and can be called externally (e.g. when eating items).
  28. - regression: for removing, lessening effects. Ditto
  29. (can use defaults for progress and regress)
  30. Any new effect must be listed in:
  31. - do_effects_list (so it can be run at all)
  32. - HEALTH.remove_new_effect (so it can be removed externally - not everything will need this)
  33. - HEALTH.add_new_effect (so it can be added)
  34. component effects:
  35. various minor effects (symptoms) shared by many diseases (e.g. vomiting). Called by the health effects internal function
  36. ]]
  37. local random = math.random
  38. ------------------------------------------------------------------
  39. --COMPONENT EFFECTS
  40. ------------------------------------------------------------------
  41. --throw up losing some food and water
  42. local function vomit(player, meta, repeat_min, repeat_max, delay_min, delay_max, t_min, t_max, h_min, h_max )
  43. --vomit repeatedly after time
  44. local ranrep = random(repeat_min, repeat_max)
  45. local randel = 0
  46. for i=1, ranrep do
  47. randel = randel + random(delay_min, delay_max)
  48. minetest.after(randel, function()
  49. local pos = player:get_pos()
  50. minetest.sound_play("health_vomit", {pos = pos, gain = 0.5, max_hear_distance = 2})
  51. rant = random(t_min, t_max)
  52. ranh = random(h_min, h_max)
  53. --must directly set them, as time delay means it isn't feeding into main health loop
  54. local thirst = meta:get_int("thirst")
  55. local hunger = meta:get_int("hunger")
  56. thirst = thirst - rant
  57. hunger = hunger - ranh
  58. if thirst < 0 then
  59. thirst = 0
  60. end
  61. if hunger < 0 then
  62. hunger = 0
  63. end
  64. meta:set_int("thirst", thirst)
  65. meta:set_int("hunger", hunger)
  66. end)
  67. end
  68. end
  69. --stagger, make player hard to control
  70. local function stagger(player, repeat_min, repeat_max, delay_min, delay_max, stag)
  71. local name = player:get_player_name()
  72. --move erraticly repeatedly after time
  73. local ranrep = random(repeat_min, repeat_max)
  74. local randel = 0
  75. for i=1, ranrep do
  76. randel = randel + random(delay_min, delay_max)
  77. minetest.after(randel, function()
  78. if not bed_rest.player[name] then
  79. local xr = random(-stag, stag)
  80. local zr = random(-stag, stag)
  81. player:add_player_velocity({x=xr, y=0, z=zr})
  82. --player_api.set_animation(player, "walk", 10) --doesn't work
  83. end
  84. end)
  85. end
  86. end
  87. --organ failure... time to die...
  88. local function organ_failure(player, repeat_min, repeat_max, delay_min, delay_max, dam_min, dam_max)
  89. local ranrep = random(repeat_min, repeat_max)
  90. minetest.sound_play("health_heart", {to_player = name, gain = 0.5})
  91. local randel = 0
  92. for i=1, ranrep do
  93. randel = randel + random(delay_min, delay_max)
  94. minetest.after(randel, function()
  95. ran_dam = random(dam_min, dam_max)
  96. local health = player:get_hp()
  97. health = health - ran_dam
  98. if health < 0 then
  99. health = 0
  100. elseif health > 20 then
  101. health = 20
  102. end
  103. player:set_hp(health)
  104. end)
  105. end
  106. end
  107. --hallucinate
  108. local function auditory_hallucination(player, repeat_min, repeat_max, delay_min, delay_max, min_gain, max_gain)
  109. --hear things repeatedly after time
  110. local ranrep = random(repeat_min, repeat_max)
  111. local name = player:get_player_name()
  112. local randel = 0
  113. for i=1, ranrep do
  114. randel = randel + random(delay_min, delay_max)
  115. minetest.after(randel, function()
  116. local pos = player:get_pos()
  117. pos = {x=pos.x+random(-15,15), y=pos.y+random(-15,15), z=pos.z+random(-15,15)}
  118. minetest.sound_play("health_hallucinate", {to_player = name, pos = pos, gain = random(min_gain,max_gain)})
  119. end)
  120. end
  121. end
  122. --tunnel vision
  123. --collapse
  124. ---------------------------------------------------------------------------
  125. --Timers for ending:
  126. ---------------------------------------------------------------------------
  127. --if not set will set the timer, save to meta
  128. --otherwise it will tick down
  129. --if zero it will return true so progression can take place
  130. local function do_timer(meta, t_name, t_min, t_max)
  131. --is timer present?
  132. if not meta:contains(t_name) then
  133. local duration = random(t_min, t_max)
  134. meta:set_int(t_name, duration)
  135. return false
  136. else
  137. --count down
  138. local time = meta:get_int(t_name)
  139. time = time - 1
  140. if time <= 0 then
  141. meta:set_int(t_name,0)
  142. return true
  143. else
  144. meta:set_int(t_name,time)
  145. return false
  146. end
  147. end
  148. end
  149. --add (or subtract) to the value for a timer that already exists
  150. local function extend_timer(meta, t_name, t_min, t_max)
  151. local time = meta:get_int(t_name)
  152. local duration = random(t_min, t_max)
  153. time = time + duration
  154. if time <= 0 then
  155. time = 0
  156. end
  157. meta:set_int(t_name,time)
  158. end
  159. --end timer, e.g. when removing an effect
  160. local function end_timer(meta, t_name)
  161. local time = meta:get_int(t_name)
  162. meta:set_int(t_name,0)
  163. end
  164. ---------------------------------------------------------------------------
  165. --Update Effects List
  166. ---------------------------------------------------------------------------
  167. --swap an effect that currently exists, including swap to nil
  168. --finds given effect, removes it and replaces it (optional)
  169. -- name e.g. "Food Poisoning" (the general type of effect)
  170. --replace is the table inserted e.g. {"Food Poisoning", 2}
  171. local function update_list_swap(meta, effects_list, name, replace)
  172. for i, effect in ipairs(effects_list) do
  173. if effect[1] == name then
  174. table.remove(effects_list, i)
  175. end
  176. end
  177. --replace
  178. if replace then
  179. table.insert(effects_list, replace)
  180. end
  181. -- update HUD number, save
  182. local num = #effects_list or 0
  183. meta:set_int("effects_num", num )
  184. meta:set_string("effects_list", minetest.serialize(effects_list))
  185. end
  186. ---------------------------------------------------------------------------
  187. --RUN health functions:
  188. ---------------------------------------------------------------------------
  189. --Default progression and regression, for effects with timers
  190. local function default_timer_progress(effect_name, t_min, t_max, max_order, c_boost, meta, effects_list, current_order, added_order, internal)
  191. --was called internally so can skip comparisons (it will be higher)
  192. if internal == true then
  193. update_list_swap(meta, effects_list, effect_name, {effect_name, added_order})
  194. extend_timer(meta, effect_name, t_min, t_max)
  195. return
  196. end
  197. --current order vs the order of what we are trying to add
  198. --higher replaces lower, and extends the timer.
  199. if current_order < added_order then
  200. update_list_swap(meta, effects_list, effect_name, {effect_name, added_order})
  201. extend_timer(meta, effect_name, t_min, t_max)
  202. else
  203. --lower and equal extends the timer
  204. extend_timer(meta, effect_name, t_min, t_max)
  205. --with chance to increase severity
  206. if current_order < max_order and random() < c_boost then
  207. current_order = current_order + 1
  208. if current_order > max_order then
  209. current_order = max_order
  210. end
  211. update_list_swap(meta, effects_list, effect_name, {effect_name, current_order})
  212. end
  213. end
  214. end
  215. local function default_timer_regress(player, effect_name, t_min, t_max, meta, effects_list, current_order, removed_order, replace_nil, internal)
  216. --was called internally so can skip comparisons
  217. if internal == true then
  218. if current_order <= 0 then
  219. --remove from effects list
  220. update_list_swap(meta, effects_list, effect_name)
  221. end_timer(meta, effect_name)
  222. if replace_nil then
  223. --swtich to a different effect rather than nothing
  224. HEALTH.add_new_effect(player, replace_nil)
  225. end
  226. else
  227. --swap with new lower value
  228. update_list_swap(meta, effects_list, effect_name, {effect_name, current_order})
  229. extend_timer(meta, effect_name, t_min, t_max)
  230. end
  231. return
  232. end
  233. --current order vs the order of what we are trying to remove
  234. if current_order > removed_order then
  235. --trying to remove lower than current (i.e. not powerful enough)
  236. --chance it does some small help
  237. if random() <0.1 then
  238. extend_timer(meta, effect_name, -t_max, -t_min)
  239. end
  240. else
  241. --removing higher or equal than current (i.e. effective treatment)
  242. --lower the order
  243. local order = current_order - 1
  244. if order <= 0 then
  245. --remove from effects list
  246. update_list_swap(meta, effects_list, effect_name)
  247. end_timer(meta, effect_name)
  248. if replace_nil then
  249. --swtich to a different effect rather than nothing
  250. HEALTH.add_new_effect(player, replace_nil)
  251. end
  252. else
  253. --swap with new lower value
  254. update_list_swap(meta, effects_list, effect_name, {effect_name, order})
  255. extend_timer(meta, effect_name, t_min, t_max)
  256. end
  257. end
  258. end
  259. ----------------------------------
  260. --Food Poisoning
  261. --[[
  262. effect_name = "Food Poisoning"
  263. Ate something bad.
  264. vomiting, fever, etc
  265. ]]
  266. function HEALTH.food_poisoning(order, player, meta, effects_list, r_rate, mov, jum, temperature)
  267. --APPLY SYMPTOMS
  268. if order == 1 then
  269. --slow recovery, movement
  270. r_rate = r_rate - 1
  271. mov = mov - 2
  272. jum = jum - 2
  273. --some vomiting
  274. if random()<0.3 then
  275. vomit(player, meta, 1, 3, 1, 10, 1, 5, 1, 5 )
  276. end
  277. elseif order == 2 then
  278. --slow recovery, movement
  279. r_rate = r_rate - 2
  280. mov = mov - 4
  281. jum = jum - 4
  282. --some vomiting
  283. if random()<0.6 then
  284. vomit(player, meta, 1, 4, 1, 10, 1, 10, 1, 10 )
  285. end
  286. elseif order == 3 then
  287. --slow recovery, movement
  288. r_rate = r_rate - 4
  289. mov = mov - 20
  290. jum = jum - 20
  291. --fever
  292. if temperature <= 42 then
  293. temperature = temperature + random(2,3)
  294. end
  295. --vomiting
  296. vomit(player, meta, 1, 5, 1, 10, 5, 10, 5, 10 )
  297. --mild staggering
  298. stagger(player, 1, 5, 1, 5, 3)
  299. elseif order == 4 then
  300. --slow recovery, movement
  301. r_rate = r_rate - 8
  302. mov = mov - 30
  303. jum = jum - 30
  304. --fever
  305. if temperature <= 42 then
  306. temperature = temperature + random(2,3)
  307. end
  308. --vomiting
  309. vomit(player, meta, 5, 10, 1, 10, 5, 10, 5, 10 )
  310. --mild staggering
  311. stagger(player, 1, 5, 1, 5, 3)
  312. end
  313. --PROGRESSION (timers, conditionals, chance)
  314. if do_timer(meta, "Food Poisoning", 3, 6) == true then
  315. --small chance of worsening, otherwise recover
  316. if random()<0.1 then
  317. local added_order = order + 1
  318. if added_order > 4 then
  319. added_order = 4
  320. end
  321. --food_poisoning_progress(meta, effects_list, order, added_order, true)
  322. default_timer_progress("Food Poisoning", 3, 6, 4, 0.2, meta, effects_list, current_order, added_order, true)
  323. else
  324. --food_poisoning_regress(meta, effects_list, order-1, nil, true)
  325. default_timer_regress(player, "Food Poisoning", 3, 6, meta, effects_list, order-1, nil, nil, true)
  326. end
  327. end
  328. --send back modified values
  329. return r_rate, mov, jum, temperature
  330. end
  331. ----------------------------------
  332. --Fungal Infection
  333. --[[
  334. effect_name = "Fungal Infection"
  335. Soil fungus got into your skin. Something vaguely like Mycetoma.
  336. For Exile, you get it from wet soil, a reason not to live in a mud hole.
  337. ]]
  338. function HEALTH.fungal_infection(order, player, meta, effects_list, r_rate, mov, jum, temperature)
  339. --APPLY SYMPTOMS
  340. if order == 1 then
  341. --slow recovery, movement
  342. r_rate = r_rate - 1
  343. mov = mov - 1
  344. jum = jum - 1
  345. elseif order == 2 then
  346. --slow recovery, movement
  347. r_rate = r_rate - 2
  348. mov = mov - 2
  349. jum = jum - 2
  350. elseif order == 3 then
  351. --slow recovery, movement
  352. r_rate = r_rate - 4
  353. mov = mov - 8
  354. jum = jum - 8
  355. elseif order == 4 then
  356. --slow recovery, movement
  357. r_rate = r_rate - 8
  358. mov = mov - 16
  359. jum = jum - 16
  360. --fever
  361. if temperature <= 39 then
  362. temperature = temperature + 1
  363. end
  364. end
  365. --PROGRESSION (timers, conditionals, chance)
  366. if do_timer(meta, "Fungal Infection", 6, 12) == true then
  367. --small chance of worsening, otherwise recover
  368. if random()<0.1 then
  369. local added_order = order + 1
  370. if added_order > 4 then
  371. added_order = 4
  372. end
  373. default_timer_progress("Fungal Infection", 6, 12, 4, 0.2, meta, effects_list, current_order, added_order, true)
  374. else
  375. default_timer_regress(player, "Fungal Infection", 6, 12, meta, effects_list, order-1, nil, nil, true)
  376. end
  377. end
  378. --send back modified values
  379. return r_rate, mov, jum, temperature
  380. end
  381. ----------------------------------
  382. --Dust Fever
  383. --[[
  384. effect_name = "Dust Fever"
  385. Dust storm born soil fungus got into your lungs. Something vaguely like Valley Fever.
  386. ]]
  387. function HEALTH.dust_fever(order, player, meta, effects_list, r_rate, mov, jum, temperature)
  388. --APPLY SYMPTOMS
  389. if order == 1 then
  390. --slow recovery, movement
  391. r_rate = r_rate - 4
  392. jum = jum - 1
  393. --fever
  394. if temperature <= 39 then
  395. temperature = temperature + 1
  396. end
  397. elseif order == 2 then
  398. --slow recovery, movement
  399. r_rate = r_rate - 8
  400. mov = mov - 1
  401. jum = jum - 2
  402. --fever
  403. if temperature <= 39 then
  404. temperature = temperature + 1
  405. end
  406. elseif order == 3 then
  407. --slow recovery, movement
  408. r_rate = r_rate - 16
  409. mov = mov - 2
  410. jum = jum - 4
  411. --fever
  412. if temperature <= 40 then
  413. temperature = temperature + 1
  414. end
  415. elseif order == 4 then
  416. --slow recovery, movement
  417. r_rate = r_rate - 32
  418. mov = mov - 4
  419. jum = jum - 8
  420. --fever
  421. if temperature <= 41 then
  422. temperature = temperature + 1
  423. end
  424. end
  425. --PROGRESSION (timers, conditionals, chance)
  426. if do_timer(meta, "Dust Fever", 6, 12) == true then
  427. --small chance of worsening, otherwise recover
  428. if random()<0.1 then
  429. local added_order = order + 1
  430. if added_order > 4 then
  431. added_order = 4
  432. end
  433. default_timer_progress("Dust Fever", 6, 12, 4, 0.2, meta, effects_list, current_order, added_order, true)
  434. else
  435. default_timer_regress(player, "Dust Fever", 6, 12, meta, effects_list, order-1, nil, nil, true)
  436. end
  437. end
  438. --send back modified values
  439. return r_rate, mov, jum, temperature
  440. end
  441. ----------------------------------
  442. --Drunkeness
  443. --[[
  444. effect_name = "Drunk"
  445. Alcohol intoxication. Stumble around. Extreme level is alcohol poisoning
  446. ]]
  447. function HEALTH.drunk(order, player, meta, effects_list, r_rate, mov, jum, h_rate, temperature)
  448. local max_drunk = meta:get_int("max_hangover") or 0
  449. --APPLY SYMPTOMS
  450. if order == 1 then
  451. if max_drunk < 1 then
  452. max_drunk = 1
  453. meta:set_int("max_hangover", max_drunk)
  454. end
  455. r_rate = r_rate - 1
  456. mov = mov - 2
  457. jum = jum - 5
  458. --mild staggering
  459. stagger(player, 1, 5, 1, 5, 3)
  460. elseif order == 2 then
  461. if max_drunk < 2 then
  462. max_drunk = 2
  463. meta:set_int("max_hangover", max_drunk)
  464. end
  465. r_rate = r_rate - 2
  466. mov = mov - 5
  467. jum = jum - 10
  468. --staggering
  469. stagger(player, 5, 10, 0.5, 5, 4)
  470. elseif order == 3 then
  471. if max_drunk < 3 then
  472. max_drunk = 3
  473. meta:set_int("max_hangover", max_drunk)
  474. end
  475. r_rate = r_rate - 4
  476. mov = mov - 10
  477. jum = jum - 15
  478. --vomit chance
  479. if random()<0.5 then
  480. vomit(player, meta, 1, 3, 1, 10, 1, 5, 1, 5 )
  481. end
  482. --major staggering
  483. stagger(player, 30, 60, 0.5, 1, 4)
  484. elseif order == 4 then
  485. if max_drunk < 4 then
  486. max_drunk = 4
  487. meta:set_int("max_hangover", max_drunk)
  488. end
  489. r_rate = r_rate - 4
  490. h_rate = h_rate - 2
  491. mov = mov - 20
  492. jum = jum - 20
  493. --vomiting and hypothermia
  494. vomit(player, meta, 1, 5, 1, 10, 5, 10, 5, 10 )
  495. if temperature >= 34 then
  496. temperature = temperature - random(1,3)
  497. end
  498. --damage
  499. if random()<0.25 then
  500. organ_failure(player, 1, 3, 1, 8, 2, 3)
  501. end
  502. --major staggering
  503. stagger(player, 30, 60, 0.5, 1, 4)
  504. end
  505. --PROGRESSION (timers, conditionals, chance)
  506. if do_timer(meta, "Drunk", 3, 6) == true then
  507. order = order - 1
  508. -- recover with a hangover that matches most extreme point achieved
  509. default_timer_regress(player, "Drunk", 3, 6, meta, effects_list, order, nil, {"Hangover", max_drunk}, true)
  510. --reset to zero
  511. if order <= 0 then
  512. meta:set_int("max_hangover", 0)
  513. end
  514. end
  515. --send back modified values
  516. return r_rate, mov, jum, h_rate, temperature
  517. end
  518. ----------------------------------
  519. --Hangover
  520. --[[
  521. effect_name = "Hangover"
  522. After effects of drugs and alcohol
  523. ]]
  524. function HEALTH.hangover(order, player, meta, effects_list, mov, jum )
  525. --APPLY SYMPTOMS
  526. if order == 1 then
  527. mov = mov - 2
  528. jum = jum - 2
  529. elseif order == 2 then
  530. mov = mov - 4
  531. jum = jum - 4
  532. elseif order == 3 then
  533. mov = mov - 6
  534. jum = jum - 6
  535. --mild staggering
  536. stagger(player, 1, 5, 1, 5, 3)
  537. elseif order == 4 then
  538. mov = mov - 8
  539. jum = jum - 8
  540. --mild staggering
  541. stagger(player, 1, 5, 1, 5, 3)
  542. end
  543. --PROGRESSION (timers, conditionals, chance)
  544. if do_timer(meta, "Hangover", 4, 8) == true then
  545. order = order - 1
  546. -- recover
  547. default_timer_regress(player, "Hangover", 4, 8, meta, effects_list, order, nil, nil, true)
  548. end
  549. --send back modified values
  550. return mov, jum
  551. end
  552. ----------------------------------
  553. --Intestinal Parasites
  554. --[[
  555. effect_name = "Intestinal Parasites"
  556. Gut worms etc. Increased hunger.
  557. ]]
  558. function HEALTH.intestinal_parasites(order, player, meta, effects_list, r_rate, hun_rate)
  559. --no orders, or progression.
  560. --you get them, then hope they go away (or cure them)
  561. --hunger quicker, recover slower
  562. r_rate = r_rate - 2
  563. hun_rate = hun_rate - 6
  564. --end chance
  565. if random()<0.001 then
  566. update_list_swap(meta, effects_list, "Intestinal Parasites")
  567. end
  568. --send back modified values
  569. return r_rate, hun_rate
  570. end
  571. ----------------------------------
  572. --Tiku Stimulants
  573. --[[
  574. effect_name = "Tiku High"
  575. For a crazy drug fueled bender, with a chance of losing control of it.
  576. Extreme is an overdose
  577. ]]
  578. function HEALTH.tiku_high(order, player, meta, effects_list, r_rate, hun_rate, mov, jum, temperature)
  579. local max_drunk = meta:get_int("max_hangover") or 0
  580. --APPLY SYMPTOMS
  581. if order == 1 then
  582. if max_drunk < 1 then
  583. max_drunk = 1
  584. meta:set_int("max_hangover", max_drunk)
  585. end
  586. r_rate = r_rate + 6
  587. hun_rate = hun_rate - 2
  588. mov = mov + 24
  589. jum = jum + 12
  590. if random()<0.1 then
  591. auditory_hallucination(player, 1, 3, 3, 10, 0.01, 0.02)
  592. end
  593. elseif order == 2 then
  594. if max_drunk < 2 then
  595. max_drunk = 2
  596. meta:set_int("max_hangover", max_drunk)
  597. end
  598. r_rate = r_rate + 12
  599. hun_rate = hun_rate - 4
  600. mov = mov + 36
  601. jum = jum + 24
  602. -- mild fever
  603. if temperature < 38 and random()<0.3 then
  604. temperature = temperature + random(2,3)
  605. end
  606. if random()<0.1 then
  607. auditory_hallucination(player, 1, 4, 2, 10, 0.02, 0.08)
  608. end
  609. elseif order == 3 then
  610. if max_drunk < 3 then
  611. max_drunk = 3
  612. meta:set_int("max_hangover", max_drunk)
  613. end
  614. r_rate = r_rate + 24
  615. hun_rate = hun_rate - 8
  616. mov = mov + 48
  617. jum = jum + 45
  618. -- mild fever
  619. if temperature <= 38 and random()<0.6 then
  620. temperature = temperature + random(2,3)
  621. end
  622. --time to go crazy
  623. auditory_hallucination(player, 30, 60, 0.4, 1, 0.5, 4)
  624. --mild staggering
  625. stagger(player, 1, 5, 1, 5, 3)
  626. elseif order == 4 then
  627. if max_drunk < 4 then
  628. max_drunk = 4
  629. meta:set_int("max_hangover", max_drunk)
  630. end
  631. r_rate = r_rate - 24
  632. hun_rate = hun_rate - 8
  633. mov = mov - 5
  634. jum = jum - 5
  635. -- fever
  636. if temperature <= 43 then
  637. temperature = temperature + random(2,4)
  638. end
  639. --time to go crazy
  640. auditory_hallucination(player, 30, 60, 0.5, 1, 1, 4)
  641. --major staggering
  642. stagger(player, 30, 60, 0.5, 1, 4)
  643. --vomit chance
  644. if random()<0.75 then
  645. vomit(player, meta, 1, 3, 1, 10, 1, 5, 1, 5 )
  646. end
  647. --damage
  648. if random()<0.33 then
  649. organ_failure(player, 1, 5, 1, 8, 1, 2)
  650. end
  651. end
  652. --PROGRESSION (timers, conditionals, chance)
  653. if do_timer(meta, "Tiku High", 6, 12) == true then
  654. --small chance of worsening, otherwise recover
  655. if random()<0.1 then
  656. local added_order = order + 1
  657. if added_order > 4 then
  658. added_order = 4
  659. end
  660. default_timer_progress("Tiku High", 3, 6, 3, 0.2, meta, effects_list, current_order, added_order, true)
  661. else
  662. order = order - 1
  663. -- recover with a hangover that matches most extreme point achieved
  664. default_timer_regress(player, "Tiku High", 3, 6, meta, effects_list, order, nil, {"Hangover", max_drunk}, true)
  665. --reset to zero
  666. if order <= 0 then
  667. meta:set_int("max_hangover", 0)
  668. end
  669. end
  670. end
  671. --send back modified values
  672. return r_rate, hun_rate, mov, jum, temperature
  673. end
  674. ----------------------------------
  675. --Neurotoxicity (brain)
  676. --[[
  677. effect_name = "Neurotoxicity"
  678. nerve poison. staggering, movement problems, death
  679. ]]
  680. function HEALTH.neurotoxicity(order, player, meta, effects_list, mov, jum)
  681. --APPLY SYMPTOMS
  682. if order == 1 then
  683. --restrict movement
  684. mov = mov - 7
  685. jum = jum - 7
  686. --major staggering
  687. stagger(player, 10, 15, 0.3, 1, 4)
  688. elseif order == 2 then
  689. --restrict movement
  690. mov = mov - 15
  691. jum = jum - 15
  692. --major staggering
  693. stagger(player, 20, 30, 0.3, 1, 4)
  694. --damage
  695. if random()<0.05 then
  696. organ_failure(player, 1, 3, 1, 5, 1, 5)
  697. end
  698. elseif order == 3 then
  699. --restrict movement
  700. mov = mov - 30
  701. jum = jum - 30
  702. --major staggering
  703. stagger(player, 50, 60, 0.3, 1, 4)
  704. --damage
  705. if random()<0.25 then
  706. organ_failure(player, 1, 3, 1, 5, 1, 5)
  707. end
  708. elseif order == 4 then
  709. --restrict movement
  710. mov = mov - 30
  711. jum = jum - 30
  712. --major staggering
  713. stagger(player, 50, 60, 0.3, 1, 4)
  714. --damage
  715. organ_failure(player, 1, 3, 1, 5, 1, 5)
  716. end
  717. --PROGRESSION (timers, conditionals, chance)
  718. if do_timer(meta, "Neurotoxicity", 6, 12) == true then
  719. -- recover
  720. default_timer_regress(player, "Neurotoxicity", 3, 6, meta, effects_list, order-1, nil, nil, true)
  721. end
  722. --send back modified values
  723. return mov, jum
  724. end
  725. ----------------------------------
  726. --Hepatotoxicity (liver)
  727. --[[
  728. effect_name = "Hepatotoxicity"
  729. liver poison. vomiting, death
  730. ]]
  731. function HEALTH.hepatotoxicity(order, player, meta, effects_list, mov, jum, r_rate, h_rate)
  732. --APPLY SYMPTOMS
  733. --you're fine until you really aren't
  734. if random()<0.3 then
  735. if order == 1 then
  736. vomit(player, meta, 2, 6, 0.75, 3, 1, 2, 5, 10 )
  737. mov = mov - 7
  738. jum = jum - 7
  739. r_rate = r_rate - 7
  740. h_rate = h_rate - 1
  741. --damage
  742. if random()<0.05 then
  743. organ_failure(player, 1, 2, 1, 5, 5, 8)
  744. end
  745. elseif order == 2 then
  746. vomit(player, meta, 5, 10, 0.75, 3, 1, 5, 10, 20 )
  747. mov = mov - 15
  748. jum = jum - 15
  749. r_rate = r_rate - 15
  750. h_rate = h_rate - 3
  751. --damage
  752. if random()<0.25 then
  753. organ_failure(player, 1, 2, 1, 5, 5, 8)
  754. end
  755. elseif order == 3 then
  756. vomit(player, meta, 10, 20, 0.75, 3, 1, 5, 20, 40 )
  757. mov = mov - 30
  758. jum = jum - 30
  759. r_rate = r_rate - 30
  760. h_rate = h_rate - 6
  761. --damage
  762. if random()<0.5 then
  763. organ_failure(player, 1, 2, 1, 5, 5, 8)
  764. end
  765. elseif order == 4 then
  766. vomit(player, meta, 10, 20, 0.75, 3, 2, 10, 40, 60 )
  767. mov = mov - 30
  768. jum = jum - 30
  769. r_rate = r_rate - 60
  770. h_rate = h_rate - 6
  771. --damage
  772. organ_failure(player, 1, 2, 1, 5, 5, 8)
  773. end
  774. end
  775. --PROGRESSION (timers, conditionals, chance)
  776. if do_timer(meta, "Hepatotoxicity", 6, 12) == true then
  777. -- recover
  778. default_timer_regress(player, "Hepatotoxicity", 6, 12, meta, effects_list, order-1, nil, nil, true)
  779. end
  780. --send back modified values
  781. return mov, jum, r_rate, h_rate
  782. end
  783. ----------------------------------
  784. --Phototoxin (light and skin)
  785. --[[
  786. effect_name = "Photosensitivity"
  787. Light sensitivity
  788. i.e. you are coming up in blisters if exposed to sun
  789. ]]
  790. function HEALTH.photosensitivity(order, player, meta, effects_list, h_rate, r_rate )
  791. --APPLY SYMPTOMS
  792. --you're fine unless in the sun
  793. local pos = player:get_pos()
  794. pos.y = pos.y + 0.8
  795. local light = minetest.get_node_light(pos) or 0
  796. if light >= 13 then
  797. if order == 1 then
  798. h_rate = h_rate - 3
  799. r_rate = r_rate - 8
  800. stagger(player, 1, 2, 1, 5, 1)
  801. elseif order == 2 then
  802. h_rate = h_rate - 6
  803. r_rate = r_rate - 12
  804. stagger(player, 1, 3, 1, 5, 1)
  805. elseif order == 3 then
  806. h_rate = h_rate - 12
  807. r_rate = r_rate - 24
  808. stagger(player, 1, 2, 1, 5, 1)
  809. elseif order == 4 then
  810. h_rate = h_rate - 9
  811. r_rate = r_rate - 48
  812. stagger(player, 1, 4, 1, 5, 1)
  813. end
  814. end
  815. --PROGRESSION (timers, conditionals, chance)
  816. if do_timer(meta, "Photosensitivity", 12, 24) == true then
  817. -- recover
  818. default_timer_regress(player, "Photosensitivity", 12, 24, meta, effects_list, order-1, nil, nil, true)
  819. end
  820. --send back modified values
  821. return h_rate, r_rate
  822. end
  823. ----------------------------------
  824. --Meta-Stim
  825. --[[
  826. effect_name = Meta-Stim
  827. from artifact. Super powers for a price.
  828. Increasing powers unlocked the more you inject.
  829. A slight bit of a techno-vampire vibe
  830. ]]
  831. function HEALTH.meta_stim(order, player, meta, effects_list, h_rate, r_rate, hun_rate, t_rate)
  832. local max_metastim = meta:get_int("max_metastim") or 0
  833. --only applies effect if not in bright light
  834. local pos = player:get_pos()
  835. pos.y = pos.y + 0.8
  836. local light = minetest.get_node_light(pos) or 0
  837. if light <= 14 then
  838. --APPLY SYMPTOMS
  839. if order == 1 then
  840. if max_metastim < 1 then
  841. max_metastim = 1
  842. meta:set_int("max_metastim", max_metastim)
  843. end
  844. --Get boosters
  845. h_rate = h_rate + 8
  846. r_rate = r_rate + 32
  847. hun_rate = hun_rate + 5
  848. t_rate = t_rate + 5
  849. elseif order == 2 then
  850. if max_metastim < 2 then
  851. max_metastim = 2
  852. meta:set_int("max_metastim", max_metastim)
  853. end
  854. --Get boosters
  855. h_rate = h_rate + 16
  856. r_rate = r_rate + 64
  857. hun_rate = hun_rate + 10
  858. t_rate = t_rate + 10
  859. --cures mild ailments
  860. HEALTH.remove_new_effect(player, {"Food Poisoning", 2})
  861. HEALTH.remove_new_effect(player, {"Dust Fever", 2})
  862. HEALTH.remove_new_effect(player, {"Fungal Infection", 2})
  863. HEALTH.remove_new_effect(player, {"Hangover", 2})
  864. HEALTH.remove_new_effect(player, {"Intestinal Parasites"})
  865. elseif order == 3 then
  866. if max_metastim < 3 then
  867. max_metastim = 3
  868. meta:set_int("max_metastim", max_metastim)
  869. end
  870. --Get boosters
  871. h_rate = h_rate + 32
  872. r_rate = r_rate + 128
  873. hun_rate = hun_rate + 20
  874. t_rate = t_rate + 20
  875. --cures serious ailments
  876. HEALTH.remove_new_effect(player, {"Food Poisoning", 4})
  877. HEALTH.remove_new_effect(player, {"Dust Fever", 4})
  878. HEALTH.remove_new_effect(player, {"Fungal Infection", 4})
  879. HEALTH.remove_new_effect(player, {"Drunk", 4})
  880. HEALTH.remove_new_effect(player, {"Hangover", 4})
  881. HEALTH.remove_new_effect(player, {"Intestinal Parasites"})
  882. HEALTH.remove_new_effect(player, {"Tiku High", 4})
  883. HEALTH.remove_new_effect(player, {"Neurotoxicity", 4})
  884. HEALTH.remove_new_effect(player, {"Hepatotoxicity", 4})
  885. elseif order == 4 then
  886. if max_metastim < 4 then
  887. max_metastim = 4
  888. meta:set_int("max_metastim", max_metastim)
  889. end
  890. --Get boosters
  891. h_rate = h_rate + 32
  892. r_rate = r_rate + 128
  893. hun_rate = hun_rate + 20
  894. t_rate = t_rate + 20
  895. --cures serious ailments
  896. HEALTH.remove_new_effect(player, {"Food Poisoning", 4})
  897. HEALTH.remove_new_effect(player, {"Dust Fever", 4})
  898. HEALTH.remove_new_effect(player, {"Fungal Infection", 4})
  899. HEALTH.remove_new_effect(player, {"Drunk", 4})
  900. HEALTH.remove_new_effect(player, {"Hangover", 4})
  901. HEALTH.remove_new_effect(player, {"Intestinal Parasites"})
  902. HEALTH.remove_new_effect(player, {"Tiku High", 4})
  903. HEALTH.remove_new_effect(player, {"Neurotoxicity", 4})
  904. HEALTH.remove_new_effect(player, {"Hepatotoxicity", 4})
  905. --Achieve God like powers
  906. if pos.y < 200 then
  907. player_monoids.fly:add_change(player, true, "health:metastim")
  908. player_monoids.gravity:add_change(player, 0.1, "health:metastim")
  909. --player_monoids.noclip:add_change(player, true, "health:metastim") --does weird stuff with stagger?
  910. else
  911. --no flying into space!
  912. player_monoids.fly:del_change(player, "health:metastim")
  913. player_monoids.gravity:del_change(player, "health:metastim")
  914. end
  915. --I am a GOD!
  916. minetest.sound_play( {name="health_superpower", gain=1}, {pos=pos, max_hear_distance=20})
  917. minetest.add_particlespawner({
  918. amount = 80,
  919. time = 18,
  920. minpos = {x=pos.x+7, y=pos.y+7, z=pos.z+7},
  921. maxpos = {x=pos.x-7, y=pos.y-7, z=pos.z-7},
  922. minvel = {x = -5, y = -5, z = -5},
  923. maxvel = {x = 5, y = 5, z = 5},
  924. minacc = {x = -3, y = -3, z = -3},
  925. maxacc = {x = 3, y = 3, z = 3},
  926. minexptime = 0.2,
  927. maxexptime = 1,
  928. minsize = 0.5,
  929. maxsize = 2,
  930. texture = "health_superpower.png",
  931. glow = 15,
  932. })
  933. end
  934. else
  935. --in bright light
  936. --can't fly
  937. player_monoids.fly:del_change(player, "health:metastim")
  938. player_monoids.gravity:del_change(player, "health:metastim")
  939. --get photosensitivity
  940. if order == 1 then
  941. HEALTH.add_new_effect(player, {"Photosensitivity", 1})
  942. elseif order == 2 then
  943. HEALTH.add_new_effect(player, {"Photosensitivity", 2})
  944. elseif order == 3 then
  945. HEALTH.add_new_effect(player, {"Photosensitivity", 3})
  946. elseif order == 4 then
  947. HEALTH.add_new_effect(player, {"Photosensitivity", 4})
  948. end
  949. end
  950. --PROGRESSION (timers, conditionals, chance)
  951. if do_timer(meta, "Meta-Stim", 12, 24) == true then
  952. order = order - 1
  953. -- end with a toxic hangover that matches most extreme point achieved
  954. default_timer_regress(player, "Meta-Stim", 12, 24, meta, effects_list, order, nil, {"Neurotoxicity", max_metastim}, true)
  955. --reset to zero
  956. if order <= 0 then
  957. meta:set_int("max_metastim", 0)
  958. player_monoids.fly:del_change(player, "health:metastim")
  959. player_monoids.gravity:del_change(player, "health:metastim")
  960. --player_monoids.noclip:del_change(player, "health:metastim")
  961. end
  962. end
  963. --send back modified values
  964. return h_rate, r_rate, hun_rate, t_rate
  965. end
  966. ----------------------------------
  967. --Stimulant addiction, withdrawal
  968. ----------------------------------
  969. --Enterotoxin (gut)
  970. --Cytotoxin (all cells)
  971. --Necrotoxin (necrotizing)
  972. --Myotoxin (muscles)
  973. ----------------------------------
  974. --indigestion (eat too much and throw up)?
  975. --infection
  976. --venom (requires duplicating chains of stuff from mobkit just to add one line to attacking??)
  977. --radiation
  978. --plague
  979. --trench foot
  980. --frost bite
  981. -------------------------------------------------------------------
  982. --ADD/REMOVE NEW
  983. -------------------------------------------------------------------
  984. --add a new effect
  985. --if it finds the effect currently in place, it must know how to progress it.
  986. --this is specific to each health effect so must call that function
  987. function HEALTH.add_new_effect(player, name)
  988. local meta = player:get_meta()
  989. local effects_list = meta:get_string("effects_list")
  990. effects_list = minetest.deserialize(effects_list) or {}
  991. --effect already present. call function to decide how to progress it
  992. for i, effect in ipairs(effects_list) do
  993. if effect[1] == name[1] then
  994. --min timer, max timer (for extensions), max order, chance of adding an equal or lower boosting to a higher order
  995. if name[1] == "Food Poisoning" then
  996. default_timer_progress("Food Poisoning", 3, 6, 4, 0.2, meta, effects_list, effect[2], name[2])
  997. elseif name[1] == "Fungal Infection" then
  998. default_timer_progress("Fungal Infection", 6, 12, 4, 0.2, meta, effects_list, effect[2], name[2])
  999. elseif name[1] == "Dust Fever" then
  1000. default_timer_progress("Dust Fever", 6, 12, 4, 0.2, meta, effects_list, effect[2], name[2])
  1001. elseif name[1] == "Drunk" then
  1002. default_timer_progress("Drunk", 3, 6, 4, 0.2, meta, effects_list, effect[2], name[2])
  1003. elseif name[1] == "Hangover" then
  1004. default_timer_progress("Hangover", 4, 8, 4, 0.4, meta, effects_list, effect[2], name[2])
  1005. elseif name[1] == "Intestinal Parasites" then
  1006. --no progression, only need to block it
  1007. return
  1008. elseif name[1] == "Tiku High" then
  1009. default_timer_progress("Tiku High", 3, 6, 4, 0.3, meta, effects_list, effect[2], name[2])
  1010. elseif name[1] == "Neurotoxicity" then
  1011. default_timer_progress("Neurotoxicity", 3, 6, 4, 0.75, meta, effects_list, effect[2], name[2])
  1012. elseif name[1] == "Hepatotoxicity" then
  1013. default_timer_progress("Hepatotoxicity", 6, 12, 4, 0.75, meta, effects_list, effect[2], name[2])
  1014. elseif name[1] == "Photosensitivity" then
  1015. default_timer_progress("Photosensitivity", 12, 24, 4, 0.1, meta, effects_list, effect[2], name[2])
  1016. elseif name[1] == "Meta-Stim" then
  1017. default_timer_progress("Meta-Stim", 12, 24, 4, 1, meta, effects_list, effect[2], name[2])
  1018. end
  1019. return
  1020. end
  1021. end
  1022. --doesn't currently exist, so add and update HUD, list
  1023. table.insert(effects_list, name)
  1024. local num = #effects_list or 0
  1025. meta:set_int("effects_num", num )
  1026. meta:set_string("effects_list", minetest.serialize(effects_list))
  1027. end
  1028. --Remove a new effect
  1029. --(new in the sense that we don't know if it is actually on or not)
  1030. --if it finds the effect currently in place, it must know how to regress it.
  1031. --this is specific to each health effect so must call that function
  1032. function HEALTH.remove_new_effect(player, name)
  1033. local meta = player:get_meta()
  1034. local effects_list = meta:get_string("effects_list")
  1035. effects_list = minetest.deserialize(effects_list) or {}
  1036. --effect is present. call function to decide how to regress it
  1037. for i, effect in ipairs(effects_list) do
  1038. if effect[1] == name[1] then
  1039. --min timer, max timer,
  1040. if name[1] == "Food Poisoning" then
  1041. default_timer_regress(player, "Food Poisoning", 3, 6, meta, effects_list, effect[2], name[2])
  1042. elseif name[1] == "Fungal Infection" then
  1043. default_timer_regress(player, "Fungal Infection", 6, 12, meta, effects_list, effect[2], name[2])
  1044. elseif name[1] == "Dust Fever" then
  1045. default_timer_regress(player, "Dust Fever", 6, 12, meta, effects_list, effect[2], name[2])
  1046. elseif name[1] == "Drunk" then
  1047. default_timer_regress(player, "Drunk", 3, 6, meta, effects_list, effect[2], name[2], {"Hangover", meta:get_int("max_hangover") or 1})
  1048. elseif name[1] == "Hangover" then
  1049. default_timer_regress(player, "Hangover", 4, 8, meta, effects_list, effect[2], name[2])
  1050. elseif name[1] == "Intestinal Parasites" then
  1051. update_list_swap(meta, effects_list, "Intestinal Parasites")
  1052. elseif name[1] == "Tiku High" then
  1053. default_timer_regress(player, "Tiku High", 3, 6, meta, effects_list, effect[2], name[2], {"Hangover", meta:get_int("max_hangover") or 1})
  1054. elseif name[1] == "Neurotoxicity" then
  1055. default_timer_regress(player, "Neurotoxicity", 3, 6, meta, effects_list, effect[2], name[2])
  1056. elseif name[1] == "Hepatotoxicity" then
  1057. default_timer_regress(player, "Hepatotoxicity", 6, 12, meta, effects_list, effect[2], name[2])
  1058. elseif name[1] == "Photosensitivity" then
  1059. default_timer_regress(player, "Photosensitivity", 12, 24, meta, effects_list, effect[2], name[2])
  1060. --elseif name[1] == "Meta-Stim" then
  1061. --note, this wont remove flying effects. Not needed at this point,
  1062. -- but will need something better if want to have an item that removes meta-stim
  1063. -- default_timer_regress(player, "Meta-Stim", 12, 24, meta, effects_list, effect[2], name[2], {"Neurotoxicity", meta:get_int("max_metastim") or 1})
  1064. end
  1065. end
  1066. end
  1067. --Otherwise doesn't currently exist, so nothing to do...
  1068. end
  1069. -------------------------------------------------------------------
  1070. --TEST!!!!
  1071. -------------------------------------------------------------------
  1072. --[[
  1073. minetest.register_craftitem("health:bug_test_food", {
  1074. description = "Bug TESTING FOOD",
  1075. inventory_image = "tech_vegetable_oil.png",
  1076. stack_max = 500,
  1077. groups = {flammable = 1},
  1078. on_use = function(itemstack, user, pointed_thing)
  1079. --HEALTH.add_new_effect(user, {"Food Poisoning", 1})
  1080. --HEALTH.add_new_effect(user, {"Drunk", 1})
  1081. --HEALTH.add_new_effect(user, {"Intestinal Parasites"})
  1082. --HEALTH.add_new_effect(user, {"Tiku High", 1})
  1083. --HEALTH.add_new_effect(user, {"Neurotoxicity", 1})
  1084. --HEALTH.add_new_effect(user, {"Hepatotoxicity", 1})
  1085. --HEALTH.add_new_effect(user, {"Photosensitivity", 1})
  1086. --HEALTH.add_new_effect(user, {"Meta-Stim", 1})
  1087. end,
  1088. })
  1089. minetest.register_craftitem("health:bug_test_food2", {
  1090. description = "Bug TESTING FOOD 2",
  1091. inventory_image = "tech_vegetable_oil.png",
  1092. stack_max = 500,
  1093. groups = {flammable = 1},
  1094. on_use = function(itemstack, user, pointed_thing)
  1095. --HEALTH.remove_new_effect(user, {"Food Poisoning", 3})
  1096. --HEALTH.remove_new_effect(user, {"Drunk", 4})
  1097. --HEALTH.remove_new_effect(user, {"Hangover", 4})
  1098. --HEALTH.remove_new_effect(user, {"Intestinal Parasites"})
  1099. --HEALTH.remove_new_effect(user, {"Tiku High", 4})
  1100. --HEALTH.remove_new_effect(user, {"Neurotoxicity", 4})
  1101. --HEALTH.remove_new_effect(user, {"Hepatotoxicity", 4})
  1102. --HEALTH.remove_new_effect(user, {"Photosensitivity", 4})
  1103. --HEALTH.remove_new_effect(user, {"Meta-Stim", 4})
  1104. end,
  1105. })
  1106. ]]