From 22f831e424944feb1cc31e2ace5e4c625aa9bbf1 Mon Sep 17 00:00:00 2001 From: LoafyLemon Date: Fri, 26 Apr 2024 16:06:19 +0100 Subject: [PATCH] Cheaters do not prosper! * Added rollback cheating detection for cardgame packs. --- game/scripts/events/variables.rpy | 1 + game/scripts/minigames/cardgame/_loot_box_.rpy | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/game/scripts/events/variables.rpy b/game/scripts/events/variables.rpy index 768b2c60..c9bf330a 100644 --- a/game/scripts/events/variables.rpy +++ b/game/scripts/events/variables.rpy @@ -42,3 +42,4 @@ default states.paperwork_reports_times = 0 default states.healing_potions = 0 # TODO: This should probably be turned into an item. default states.cardgame.unlocked = False +default states.cardgame.cheater = False diff --git a/game/scripts/minigames/cardgame/_loot_box_.rpy b/game/scripts/minigames/cardgame/_loot_box_.rpy index 6c96da2d..4160426f 100644 --- a/game/scripts/minigames/cardgame/_loot_box_.rpy +++ b/game/scripts/minigames/cardgame/_loot_box_.rpy @@ -16,6 +16,15 @@ screen card_lootbox(): use ctc label card_lootbox: + + if renpy.in_rollback() and not states.cardgame.cheater: + $ states.cardgame.cheater = True + $ renpy.block_rollback() + gen "You cheating bastard!" ("grin", xpos="far_left", ypos="head") + gen "I'll allow it this time..." ("base", xpos="far_left", ypos="head") + + jump card_lootbox + python: card_loot = [] @@ -35,14 +44,14 @@ label card_lootbox: rand_card.copies += 1 card_loot.append(rand_card) - $ lootbox_ITEM.owned -= 1 - show screen card_lootbox with d3 pause hide screen card_lootbox with d3 + $ lootbox_ITEM.owned -= 1 + if lootbox_ITEM.owned > 0: menu: "-Open another pack-":