game: Inventar und fünf Vollbilder in 1920 — Titel scharf, Startgepäck
This commit is contained in:
parent
5b11e770b8
commit
3fae74b1e8
56 changed files with 795 additions and 84 deletions
40
game/tools/probe_inventar.gd
Normal file
40
game/tools/probe_inventar.gd
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
extends Node
|
||||
## Probe für das Inventar-Modal.
|
||||
##
|
||||
## godot --headless --path game res://tools/probe_inventar.tscn -- --check
|
||||
## godot --path game res://tools/schuss.tscn -- \
|
||||
## res://tools/probe_inventar.tscn art/prep/inventar/_inventar_1920x1080.png
|
||||
|
||||
const SZENE := preload("res://scenes/ui/inventar.tscn")
|
||||
|
||||
var fehler := 0
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
Game.party_schnellstart()
|
||||
# Etwas Inhalt in den Rucksack, damit das Fenster nicht leer ist.
|
||||
var figur: Dictionary = Game.party[0]
|
||||
Game.inventar_hinzufuegen(figur, "leder")
|
||||
Game.inventar_hinzufuegen(figur, "dolch")
|
||||
|
||||
var ui: Control = SZENE.instantiate()
|
||||
add_child(ui)
|
||||
await get_tree().process_frame
|
||||
|
||||
ok("Modal baut", ui.get_child_count() > 0)
|
||||
ok("Partyspalte hat Figuren", Game.party.size() == 4)
|
||||
ok("Ausrüsten aus dem Rucksack", Game.ausruesten(figur, "leder")
|
||||
and str(figur["equipment"].get("armor", "")) == "leder")
|
||||
ok("Kette liegt im Rucksack", Game.inventar_hat(figur, "kette") == 1)
|
||||
ok("Ablegen legt zurück", Game.ablegen(figur, "armor")
|
||||
and Game.inventar_hat(figur, "leder") == 1)
|
||||
|
||||
print("\nProbe: %s" % ("bestanden" if fehler == 0 else "FEHLGESCHLAGEN"))
|
||||
if OS.get_cmdline_user_args().has("--check"):
|
||||
get_tree().quit(0 if fehler == 0 else 1)
|
||||
|
||||
|
||||
func ok(name: String, wahr: bool) -> void:
|
||||
if not wahr:
|
||||
fehler += 1
|
||||
print(" %s %s" % [("ok " if wahr else "FEHL"), name])
|
||||
1
game/tools/probe_inventar.gd.uid
Normal file
1
game/tools/probe_inventar.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://b7j5mdjruaii5
|
||||
6
game/tools/probe_inventar.tscn
Normal file
6
game/tools/probe_inventar.tscn
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
[gd_scene load_steps=2 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://tools/probe_inventar.gd" id="1"]
|
||||
|
||||
[node name="ProbeInventar" type="Node"]
|
||||
script = ExtResource("1")
|
||||
Loading…
Add table
Add a link
Reference in a new issue