Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ grants a second Rite is not implemented yet.
* turn/energy based critters with faction-aware cardinal A* pathfinding,
zombie, observer and animal AI
* melee combat with recovered weapon AV/DV and damage values
* throwing is deferred; HE grenade and molotov data are retained for a future pass
* throwing is deferred; thematic holy, fire, incense and alchemical flask data is retained for a future pass
* recovered weapon table (attack/defense value and damage range per subtype)
* one priest character with a randomly generated name and starting Rite
* HP and AP: equipped robe shards provide a depletable armour-point pool
Expand Down
1 change: 1 addition & 0 deletions documentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ build file lives here.
- [Project README](../README.md) — build, controls and current gameplay features
- [Feature plans](plans/README.md) — roadmap and links to all planned work
- [Reverse-engineering reference](reference/reverse-engineering.md) — how the original binary was analysed and what was recovered
- [Item theme review](reference/item-review.md) — which recovered items are kept, renamed or removed from normal play

## Current focus

Expand Down
7 changes: 4 additions & 3 deletions documentation/plans/systems/command-scope-reduction.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Command & Scope Reduction — Melee-Focused Redesign

Status: **in progress**
Status: **done**
Parent: [Feature plans](../README.md)
Scope: global player command set and combat systems; first validated in the woods

Implementation status: first pass implemented on branch
`feature/command-scope-reduction`; pending review and merge.
Implementation status: first pass implemented and merged. Item names have since
been refitted by the [item theme review](../../reference/item-review.md): the HE
grenade and molotov data now appear as holy water and holy fire flasks.

This document proposes cutting the command surface down to what fits a
zombie-slashing, melee-focused roguelike. The goal is not to remove depth — it
Expand Down
62 changes: 62 additions & 0 deletions documentation/reference/item-review.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Item Theme Review

Status: **done**
Parent: [Documentation index](../README.md)
Related: [Reverse-engineering reference](reverse-engineering.md), [Priest player revamp](../plans/systems/priest-player-revamp.md)

The recovered item table contains modern military and science-fiction
prototypes. Recovered IDs are kept stable for data and save references, but
only thematic items may appear in normal play.

## Theme rules

- Village, woodland, medieval, priest, holy and horror items are allowed.
- Guns, ammunition, clips, energy weapons and old body armour are removed from
normal play.
- Modern grenades are refitted as priest flasks.
- Raw removed prototypes remain in `ItemDefs` for historical reference but fail
`ItemAvailable`.

## Renamed and refitted items

| Old recovered name | Current name | Role |
|---|---|---|
| jacket | padded jerkin | legacy armour data |
| flak armor | reinforced hide coat | legacy armour data |
| power jacket | penitent's mail | legacy armour data |
| plasteel stick | iron-shod staff | melee |
| chainsaw | relic chainblade | melee relic |
| power sword | silvered longsword | melee |
| meta dagger | consecrated dagger | melee |
| vibra knife | blessed knife | melee |
| multiaxe | penitent's axe | melee |
| shock mace | censer mace | melee |
| battle hammer | war hammer | melee |
| he grenade | holy water flask | throwable flask |
| incendiary grenade | holy fire flask | throwable flask |
| acid grenade | alchemical acid flask | throwable flask |
| smoke grenade | incense flask | throwable flask |
| flashbang grenade | radiant flask | throwable flask |
| first aid kit | healer's kit | healing |
| medkit | surgeon's kit | healing |

## Removed from normal play

- all recovered ranged weapons and energy weapons
- all ammunition and clips
- body armour and old armour pieces
- mobile-phone-era military equipment that has no thematic replacement

The priest uses the permanent robe and attachable shards instead of body armour.
The first-playable item families are woodland food/tools/weapons, priest
vials/shards/relics, holy flasks and ordinary medical supplies.

## Validation

`internal/game/item_theme_test.go` checks that:

- old out-of-theme names are gone from the active item set
- renamed thematic replacements exist
- available items do not contain banned terms such as grenade, gun, ammo, clip,
plasma, laser, flak, plasteel or flashbang
- ranged weapons, ammunition and old body armour are unavailable
6 changes: 3 additions & 3 deletions internal/game/armor.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ func ArmorStatsFor(d *ItemDef) (ArmorStats, bool) {
return ArmorStats{}, false
}
switch d.Name {
case "jacket":
case "jacket", "padded jerkin":
return ArmorStats{MaxAP: 20, Absorb: 50, DV: -1}, true
case "flak armor":
case "flak armor", "reinforced hide coat":
return ArmorStats{MaxAP: 35, Absorb: 60, DV: -2}, true
case "power jacket":
case "power jacket", "penitent's mail":
return ArmorStats{MaxAP: 50, Absorb: 70, DV: -3}, true
case "leather jacket":
return ArmorStats{MaxAP: 25, Absorb: 55, DV: -1}, true
Expand Down
14 changes: 7 additions & 7 deletions internal/game/combat.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,9 +368,9 @@ func (g *Game) CreateRemains(c *Critter) {
g.PlaceGroundItemNear(&Item{Proto: proto, X: -1, Y: -1}, c.X, c.Y)
}
if g.Chance(15) {
proto := 41 // HE grenade
proto := 41 // holy water flask
if g.Roll(2) == 0 {
proto = 42 // molotov cocktail
proto = 42 // holy fire flask
}
g.PlaceGroundItemNear(&Item{Proto: proto, X: -1, Y: -1}, c.X, c.Y)
}
Expand Down Expand Up @@ -416,8 +416,8 @@ func (g *Game) CheckLevelUp() {
}
}

// Explode damages everything in a radius. kind 1 leaves fire behind
// (molotov); kind 0 is a plain high-explosive blast.
// Explode damages everything in a radius. kind 1 leaves fire behind
// (holy fire flask); kind 0 is a direct holy/alchemical burst.
func (g *Game) Explode(x, y, radius, damage, kind int) {
if radius < 1 {
radius = 1
Expand Down Expand Up @@ -463,8 +463,8 @@ func (g *Game) hasThrowable() bool {
return false
}

// ThrowGrenade throws the selected HE grenade or molotov at a visible tile
// within the player's current FOV radius.
// ThrowGrenade throws the selected thematic flask at a visible tile within
// the player's current FOV radius.
func (g *Game) ThrowGrenade(x, y int) {
it := g.Player.ThrowableItem()
if it == nil || !ItemIsThrowable(it.Proto) {
Expand Down Expand Up @@ -520,7 +520,7 @@ func (g *Game) ThrowGrenade(x, y int) {
dmg = g.RollRange(wd.DmgMin, wd.DmgMax)
}
kind := 0
if d.Name == "molotov cocktail" {
if d.Name == "holy fire flask" {
kind = 1
}
g.Explode(lx, ly, blastRadius, dmg+g.Player.Skill(SkillThrowing)/4, kind)
Expand Down
15 changes: 4 additions & 11 deletions internal/game/game_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,23 +347,16 @@ func TestPlayerSlotSaveRoundtrip(t *testing.T) {
}
}

func TestPlayerSlotMigration(t *testing.T) {
func TestPlayerSlotMigrationDropsOldBodyArmour(t *testing.T) {
sc := saveCritter{Player: true, Equip: []saveItem{
{Proto: 16}, {Proto: 5}, {Proto: 41}, {Proto: 46},
}, Inv: []saveItem{{Proto: 47, Charges: 1}}}
c, removed := critterFromSave(sc, 2)
if removed != 0 {
t.Fatalf("unexpected removals: %d", removed)
}
c, _ := critterFromSave(sc, 2)
if c.Slots.Hands == nil || c.Slots.Hands.Proto != 16 {
t.Fatal("hands migration failed")
}
if c.Slots.Body == nil || c.Slots.Body.Proto != 5 {
t.Fatal("body migration failed")
}
ensureArmorAP(c.Slots.Body)
if c.Slots.Body.AP != 20 {
t.Fatalf("migrated body AP = %d, want 20", c.Slots.Body.AP)
if c.Slots.Body != nil {
t.Fatal("old body armour should not be migrated")
}
want := []int{41, 46, 47}
for i, proto := range want {
Expand Down
101 changes: 101 additions & 0 deletions internal/game/item_theme.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
package game

// The recovered item table contains modern military and science-fiction
// prototypes. This pass keeps the recovered IDs stable but refits the items
// that still exist in normal play to the priest/village/horror theme. Ranged
// weapons, ammunition and old body armour remain raw data only and are filtered
// out by ItemAvailable.
type itemThemeOverride struct {
Name string
Desc string
Glyph byte
Color uint8
}

var itemThemeOverrides = map[string]itemThemeOverride{
"jacket": {
Name: "padded jerkin", Desc: "a layered cloth jerkin with old stains.",
Glyph: '[', Color: 6,
},
"flak armor": {
Name: "reinforced hide coat", Desc: "a heavy coat reinforced with boiled hide.",
Glyph: '[', Color: 6,
},
"power jacket": {
Name: "penitent's mail", Desc: "a heavy mail shirt worn as an act of penance.",
Glyph: '[', Color: 7,
},
"plasteel stick": {
Name: "iron-shod staff", Desc: "a village staff capped with iron.",
Glyph: '|', Color: 6,
},
"chainsaw": {
Name: "relic chainblade", Desc: "a strange bladed chain relic decorated with demon faces.",
Glyph: '/', Color: 8,
},
"power sword": {
Name: "silvered longsword", Desc: "an old longsword with a silvered edge.",
Glyph: '/', Color: 15,
},
"meta dagger": {
Name: "consecrated dagger", Desc: "a small dagger marked with old prayers.",
Glyph: '/', Color: 15,
},
"vibra knife": {
Name: "blessed knife", Desc: "a knife etched with a blessing against the dead.",
Glyph: '/', Color: 15,
},
"multiaxe": {
Name: "penitent's axe", Desc: "a heavy axe carried by the village penitents.",
Glyph: '/', Color: 7,
},
"shock mace": {
Name: "censer mace", Desc: "a mace whose head still smells of incense.",
Glyph: '/', Color: 14,
},
"battle hammer": {
Name: "war hammer", Desc: "a heavy war hammer from the village militia.",
Glyph: '/', Color: 7,
},
"he grenade": {
Name: "holy water flask", Desc: "a flask of blessed water that bursts into purifying steam.",
Glyph: '!', Color: 11,
},
"incendiary grenade": {
Name: "holy fire flask", Desc: "a flask of blessed oil that burns with a pale flame.",
Glyph: '!', Color: 12,
},
"acid grenade": {
Name: "alchemical acid flask", Desc: "a stoppered flask of biting alchemical acid.",
Glyph: '!', Color: 10,
},
"smoke grenade": {
Name: "incense flask", Desc: "a flask of heavy incense for driving off the restless dead.",
Glyph: '!', Color: 8,
},
"flashbang grenade": {
Name: "radiant flask", Desc: "a flask of captured daylight, painful to creatures of the dark.",
Glyph: '!', Color: 14,
},
"first aid kit": {
Name: "healer's kit", Desc: "a worn kit of needles, thread and clean cloth.",
Glyph: '!', Color: 10,
},
"medkit": {
Name: "surgeon's kit", Desc: "a heavy kit of proper medical tools.",
Glyph: '!', Color: 10,
},
}

func init() {
for i := range ItemDefs {
override, ok := itemThemeOverrides[ItemDefs[i].Name]
if !ok {
continue
}
ItemDefs[i].Name = override.Name
ItemDefs[i].Desc = override.Desc
ItemDefs[i].Glyph = override.Glyph
ItemDefs[i].Color = override.Color
}
}
53 changes: 53 additions & 0 deletions internal/game/item_theme_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package game

import (
"strings"
"testing"
)

func TestOutOfThemeItemsAreRenamedOrUnavailable(t *testing.T) {
for _, old := range []string{"he grenade", "incendiary grenade", "molotov cocktail", "flak armor", "power jacket", "plasteel stick", "power sword", "meta dagger", "vibra knife", "shock mace"} {
if proto := itemProtoByName(old); proto >= 0 {
t.Fatalf("old out-of-theme item %q still exists as proto %d", old, proto)
}
}
for _, name := range []string{"holy water flask", "holy fire flask", "incense flask", "radiant flask", "padded jerkin", "silvered longsword", "consecrated dagger", "blessed knife", "censer mace", "healer's kit", "surgeon's kit"} {
if proto := itemProtoByName(name); proto < 0 {
t.Fatalf("themed item %q is missing", name)
}
}
}

func TestAvailableItemsFitTheme(t *testing.T) {
banned := []string{"grenade", "gun", "pistol", "ammo", "clip", "rifle", "laser", "plasma", "flak", "power jacket", "plasteel", "meta ", "vibra", "shock ", "flashbang", "he grenade"}
for proto, def := range ItemDefs {
if !ItemAvailable(proto) {
continue
}
name := strings.ToLower(def.Name)
for _, word := range banned {
if strings.Contains(name, word) {
t.Fatalf("available item %d %q still uses out-of-theme term %q", proto, def.Name, word)
}
}
}
}

func TestRangedWeaponsAmmoAndOldArmourAreUnavailable(t *testing.T) {
for _, name := range []string{"lasgun", "personal pistol clip", "padded jerkin", "leather jacket"} {
proto := itemProtoByName(name)
if proto < 0 {
continue
}
if ItemAvailable(proto) {
t.Fatalf("%q should not be available in normal play", name)
}
}
armour := itemProtoByName("padded jerkin")
if armour < 0 || !CritterItemAvailable(armour) {
t.Fatal("monsters should still be able to use armour prototypes")
}
if proto := itemProtoByName("holy fire flask"); proto < 0 || !ItemAvailable(proto) {
t.Fatal("holy fire flask should be available")
}
}
10 changes: 5 additions & 5 deletions internal/game/palette_roles.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,15 @@ func ItemColorRole(proto int) (ColorRole, bool) {
return RoleFireEmber, true
case 39: // acid canister
return RoleAcid, true
case 41, 42: // HE and incendiary grenades
case 41, 42: // holy water and holy fire flasks
return RoleFireEmber, true
case 43: // acid grenade
case 43: // alchemical acid flask
return RoleAcid, true
case 44: // smoke grenade
case 44: // incense flask
return RoleSmoke, true
case 45: // flashbang
case 45: // radiant flask
return RoleFlameCore, true
case 46, 48: // first aid kit, medkit
case 46, 48: // healer's kit, surgeon's kit
return RoleHealthGood, true
case 47: // bandage
return RoleCloth, true
Expand Down
7 changes: 2 additions & 5 deletions internal/game/player_experience_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ func TestPlayerClassRoster(t *testing.T) {
if proto < 0 || proto >= len(ItemDefs) {
t.Fatalf("%s kit references invalid item %d", c.Name, proto)
}
if !ItemAvailable(proto) {
t.Fatalf("%s kit references unavailable item %d", c.Name, proto)
}
}
}
}
Expand Down Expand Up @@ -304,8 +301,8 @@ func TestSaveMigrationGrantsTwoBeltSlots(t *testing.T) {
},
}
c, removed := critterFromSave(sc, 3)
if removed != 0 {
t.Fatalf("unexpected removed items: %d", removed)
if removed != 1 {
t.Fatalf("expected 1 removed item, got %d", removed)
}
if c.Slots.BeltUnlocked != 2 {
t.Fatalf("migrated belt unlock = %d, want 2", c.Slots.BeltUnlocked)
Expand Down
Loading
Loading