game: Party-Erstellung als Einstieg — Roster, Figurenmaske, UI-Probe
This commit is contained in:
parent
b47c392e85
commit
f8d8f56b86
16 changed files with 707 additions and 17 deletions
|
|
@ -18,6 +18,7 @@ const MAX := 18
|
|||
var name := ""
|
||||
var volk_id := "human"
|
||||
var klasse_id := "fighter"
|
||||
var portrait := "portrait_krieger"
|
||||
## Attribute **vor** Volksbonus.
|
||||
var basis: Dictionary = {}
|
||||
## Mensch: die zwei gewählten Attribute für +1.
|
||||
|
|
@ -98,6 +99,24 @@ func mensch_waehlen(a: String, b: String) -> bool:
|
|||
return true
|
||||
|
||||
|
||||
## UI-Variante: an/aus. Bei zwei gewählten ersetzt der dritte den ältesten.
|
||||
func mensch_bonus_umschalten(a: String) -> bool:
|
||||
if volk_id != "human" or not basis.has(a):
|
||||
return false
|
||||
var alt: Array[String] = []
|
||||
alt.assign(mensch_wahl)
|
||||
if mensch_wahl.has(a):
|
||||
mensch_wahl.erase(a)
|
||||
return true
|
||||
if mensch_wahl.size() >= 2:
|
||||
mensch_wahl.remove_at(0)
|
||||
mensch_wahl.append(a)
|
||||
if endwert(a) > MAX:
|
||||
mensch_wahl.assign(alt)
|
||||
return false
|
||||
return true
|
||||
|
||||
|
||||
func volk_setzen(id: String) -> bool:
|
||||
if not Content.table("races").has(id):
|
||||
return false
|
||||
|
|
@ -174,6 +193,7 @@ func vorgabe() -> Dictionary:
|
|||
"name": name.strip_edges(),
|
||||
"race": volk_id,
|
||||
"class": klasse_id,
|
||||
"portrait": portrait,
|
||||
"attributes": basis.duplicate(),
|
||||
"choice": mensch_wahl.duplicate(),
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,8 +15,9 @@ var flags: Dictionary = {}
|
|||
var log_lines: Array[String] = []
|
||||
|
||||
func _ready() -> void:
|
||||
if party.is_empty():
|
||||
_neue_party()
|
||||
# Die Party entsteht in der Erstellung (docs/charaktererstellung.md).
|
||||
# `party_schnellstart()` füllt sie für den Direktstart ohne Erstellung.
|
||||
pass
|
||||
|
||||
## Vier Figuren, wie in docs/systeme.md §11 durchgerechnet.
|
||||
func _neue_party() -> void:
|
||||
|
|
@ -61,6 +62,11 @@ func party_entfernen(id: String) -> bool:
|
|||
func party_bereit() -> bool:
|
||||
return party.size() >= 1 and party.size() <= PARTY_MAX
|
||||
|
||||
|
||||
## Die vier Papierprobe-Figuren als Schnellstart (Titelschirm/Erstellung).
|
||||
func party_schnellstart() -> void:
|
||||
_neue_party()
|
||||
|
||||
func _naechste_pc_id() -> String:
|
||||
var belegt := {}
|
||||
for figur in party:
|
||||
|
|
@ -86,6 +92,7 @@ func neue_figur(id: String, vorgabe: Dictionary) -> Dictionary:
|
|||
return {
|
||||
"id": id, "name": vorgabe["name"],
|
||||
"race": vorgabe["race"], "class": vorgabe["class"],
|
||||
"portrait": str(vorgabe.get("portrait", "")),
|
||||
"level": 1, "xp": 0,
|
||||
"attributes": attrs,
|
||||
"hp": {"current": hp_max, "max": hp_max},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue