From b52c970a4083eb2663483f659a10e8d8ca3269ea Mon Sep 17 00:00:00 2001 From: LDip999 Date: Sun, 22 Dec 2024 23:37:35 +0100 Subject: [PATCH 1/8] Tetris extra monies --- .../game/machinery/computer/arcade/tetris.dm | 31 +++++++++++++++---- tgui/src/interfaces/tetris/tetris.js | 24 ++++++++++++-- 2 files changed, 47 insertions(+), 8 deletions(-) diff --git a/modular_sand/code/game/machinery/computer/arcade/tetris.dm b/modular_sand/code/game/machinery/computer/arcade/tetris.dm index 19b7edde7d..9b25c5957d 100644 --- a/modular_sand/code/game/machinery/computer/arcade/tetris.dm +++ b/modular_sand/code/game/machinery/computer/arcade/tetris.dm @@ -7,7 +7,13 @@ #define TETRIS_SCORE_MAX_SCI 10000 #define TETRIS_TIME_COOLDOWN 600 #define TETRIS_NO_SCIENCE TRUE - +//Line bonus defines, for when you clear a set amount of rows in a single go. Beat Fenny with a newspaper if these values are unbalanced, it was their numbers +#define L1_bonus 1 +#define L2_bonus 3 +#define L3_bonus 9 +#define L4_bonus 15 +//Maximum amount of line bonus monies +#define MaxBonus 1000 // Cooldown defines #define TETRIS_COOLDOWN_MAIN cooldown_timer @@ -26,7 +32,10 @@ // Sanitize score as an integer // Restricts maximum score to (default) 100,000 var/temp_score = sanitize_num_clamp(text2num(href_list["tetrisScore"]), max=TETRIS_SCORE_MAX) - + var/l1 = sanitize_num_clamp(text2num(href_list["Lines1"]),max= 100) + var/l2 = sanitize_num_clamp(text2num(href_list["Lines2"]), max= 100) + var/l3 = sanitize_num_clamp(text2num(href_list["Lines3"]), max= 100) + var/l4 = sanitize_num_clamp(text2num(href_list["Lines4"]), max = 100) // Check for high score if(temp_score > TETRIS_SCORE_HIGH) // Alert admins @@ -34,7 +43,13 @@ // Round and clamp prize count from 0 to (default) 5 var/reward_count = clamp(round(temp_score/TETRIS_REWARD_DIVISOR), 0, TETRIS_PRIZES_MAX) - + var/linesbonus = 0 + linesbonus = (l1 * L1_bonus) + (l2*L2_bonus) + (l3*L3_bonus) + (l4 * L4_bonus) + if(linesbonus > 0) + var/obj/item/stack/f13Cash/caps/linesbonuscash = new /obj/item/stack/f13Cash/caps(); + linesbonuscash.amount = linesbonus; + visible_message(span_notice("[src] dispenses [linesbonuscash]!"), span_notice("I hear a chime and a clunk.")) + linesbonuscash.forceMove(get_turf(src)) // Define score text var/score_text = (reward_count ? temp_score : "PATHETIC! TRY HARDER") @@ -61,7 +76,7 @@ // Vend prizes for(var/i = 0; i < reward_count; i++) prizevend(usr) - + // Check if science points are possible and allowed if((!SSresearch.science_tech) || TETRIS_NO_SCIENCE) return @@ -107,8 +122,8 @@ Telemetry Enhanced Testing and Research Informatic Simulator