Connect bear-save, massage, farm paywall, cheese catapults, Dressler hijack, final boss phases, fat-stim UI, and scene fixes so the satire path plays through.
69 lines
2.2 KiB
GDScript
69 lines
2.2 KiB
GDScript
extends Node
|
|
## Mock Pay-to-Win shop. 1€ = 1 Dresslerpunkt (no real payments).
|
|
|
|
signal points_changed(points: int)
|
|
signal purchase_made(item_id: String)
|
|
|
|
var dressler_points: int = 0
|
|
|
|
const CATALOG := [
|
|
{"id": "buy_point", "cost": 0, "mock_euro": true},
|
|
{"id": "continue_joke", "cost": 10, "joke_continue": true},
|
|
{"id": "death_ticket", "cost": 1, "gives": "death_ticket"},
|
|
{"id": "sunglasses", "cost": 1, "gives": "sunglasses", "actually_free": true},
|
|
{"id": "burger", "cost": 1, "gives": "tiramisu"},
|
|
{"id": "next_level", "cost": 1, "unlock_next": true},
|
|
]
|
|
|
|
func buy_mock_euro_point() -> void:
|
|
dressler_points += 1
|
|
points_changed.emit(dressler_points)
|
|
GameState.save_game()
|
|
|
|
func purchase(entry_id: String) -> bool:
|
|
if entry_id == "buy_point":
|
|
buy_mock_euro_point()
|
|
return true
|
|
for entry in CATALOG:
|
|
if str(entry["id"]) != entry_id:
|
|
continue
|
|
if bool(entry.get("actually_free", false)):
|
|
Inventory.add_item(str(entry.get("gives", "")), 1)
|
|
if str(entry.get("gives", "")) == "sunglasses":
|
|
Achievements.unlock("cool_sunglasses")
|
|
purchase_made.emit(entry_id)
|
|
var ui := get_node_or_null("/root/UIRoot")
|
|
if ui and ui.has_method("show_dialog"):
|
|
ui.show_dialog(Locale.tr_key("shop_joke_free"), 3.0)
|
|
GameState.save_game()
|
|
return true
|
|
if bool(entry.get("joke_continue", false)):
|
|
## „kostet 10 Punkte“ → Spaß, du darfst weiter
|
|
var ui2 := get_node_or_null("/root/UIRoot")
|
|
if ui2 and ui2.has_method("show_dialog"):
|
|
ui2.show_dialog(Locale.tr_key("shop_joke_continue"), 4.0)
|
|
GameState.set_flag("paywall_cleared", true)
|
|
purchase_made.emit(entry_id)
|
|
GameState.save_game()
|
|
return true
|
|
var cost := int(entry.get("cost", 0))
|
|
if dressler_points < cost:
|
|
return false
|
|
dressler_points -= cost
|
|
var gives := str(entry.get("gives", ""))
|
|
if gives != "":
|
|
Inventory.add_item(gives, 1)
|
|
if bool(entry.get("unlock_next", false)):
|
|
GameState.set_flag("paywall_cleared", true)
|
|
points_changed.emit(dressler_points)
|
|
purchase_made.emit(entry_id)
|
|
GameState.save_game()
|
|
return true
|
|
return false
|
|
|
|
func serialize() -> Dictionary:
|
|
return {"dressler_points": dressler_points}
|
|
|
|
func deserialize(data: Dictionary) -> void:
|
|
dressler_points = int(data.get("dressler_points", 0))
|
|
points_changed.emit(dressler_points)
|