feat: m4 teil 1 — beute, inventar und affixe
- data/: [[loot_tables]] und [[affixes]] als Registries; LootEntry mit guaranteed, nothing, table-in-table, count und affixes - game/loot.rs: EINE Ziehmaschinerie fuer Gegenstaende und Affixe, Tiefendeckel gegen wechselseitigen Bezug - PickUp zieht erst beim Aufheben (Ticket 16) — moeglich nur, weil alle Haufen dasselbe Symbol zeigen - UseItem/Equip/Unequip/Drop, Inventar-Screen als Registry-Schleife - Affixe im Attributpfad, in der Resistenz und in der Trigger-Suche; item_label stellt Affixnamen voran, item_price multipliziert Faktoren - Room haelt eine loot_table (nicht je Haufen eine), Prefab-loot ueberschreibt die Etagentabelle 53 Tests. Offen aus M4: Handel.
This commit is contained in:
@@ -15,8 +15,8 @@ use serde::de::DeserializeOwned;
|
||||
use toml::Spanned;
|
||||
|
||||
use super::registries::{
|
||||
Ability, Category, CharacterOption, CreatureDef, FloorDef, Item, ModifierDef, Prefab,
|
||||
Registries, Slot,
|
||||
Ability, Affix, Category, CharacterOption, CreatureDef, FloorDef, Item, LootTable, ModifierDef,
|
||||
Prefab, Registries, Slot,
|
||||
};
|
||||
|
||||
/// Genau drei harte Fehler (Ticket 04). Alles Uebrige ist Warnung plus
|
||||
@@ -257,6 +257,10 @@ struct ModFile {
|
||||
creatures: Vec<Spanned<toml::Value>>,
|
||||
#[serde(default)]
|
||||
modifiers: Vec<Spanned<toml::Value>>,
|
||||
#[serde(default)]
|
||||
affixes: Vec<Spanned<toml::Value>>,
|
||||
#[serde(default)]
|
||||
loot_tables: Vec<Spanned<toml::Value>>,
|
||||
/// **Keine** Tabelle mit `[[...]]`, sondern ein einzelner Block, der
|
||||
/// feldweise verschmilzt — die ausdrueckliche Ausnahme zu Ticket 03.
|
||||
#[serde(default)]
|
||||
@@ -294,6 +298,8 @@ impl_entry!(FloorDef);
|
||||
impl_entry!(Ability);
|
||||
impl_entry!(CreatureDef);
|
||||
impl_entry!(ModifierDef);
|
||||
impl_entry!(Affix);
|
||||
impl_entry!(LootTable);
|
||||
|
||||
struct FileCtx<'a> {
|
||||
module: &'a str,
|
||||
@@ -502,6 +508,8 @@ pub fn load_mods() -> Result<(Registries, Vec<String>), LoadError> {
|
||||
parse_entries(parsed.abilities, &ctx, &mut reg.abilities, &mut warnings);
|
||||
parse_entries(parsed.creatures, &ctx, &mut reg.creatures, &mut warnings);
|
||||
parse_entries(parsed.modifiers, &ctx, &mut reg.modifiers, &mut warnings);
|
||||
parse_entries(parsed.affixes, &ctx, &mut reg.affixes, &mut warnings);
|
||||
parse_entries(parsed.loot_tables, &ctx, &mut reg.loot_tables, &mut warnings);
|
||||
|
||||
// `[balance]` verschmilzt **feldweise** (Ticket 14): Ein Mod, der
|
||||
// einen Knopf dreht, schreibt eine Zeile — und ein neuer Knopf in
|
||||
|
||||
Reference in New Issue
Block a user