Rename constants to descriptive names (refactor step 1)
Pure rename, no behavior change; the full suite (RNG goldens,
generation invariants, scripted sessions, save round trip) is
unchanged and green.
- Creature flags: IsHuh→Confused, IsHalu→Hallucinating,
CanHuh→CanConfuse, CanSee→CanSeeInvisible, IsRun→Awake,
SeeMonst→SenseMonsters, IsCanc→Cancelled, IsLevit→Levitating,
IsBlind/IsGreed/IsHaste/IsTarget/IsHeld/IsInvis/IsMean/IsRegen/
IsFly/IsSlow → Blind/Greedy/Hasted/Targeted/Held/Invisible/Mean/
Regenerates/Flying/Slowed, IsFound→Found
- Object flags: IsCursed→Cursed, IsKnow→Known, IsMissl→Missile,
IsMany→Stackable, ObjIsFound→WasFound, IsProt→Protected
- Room flags: IsDark/IsGone/IsMaze → Dark/Gone/Maze; place flags:
FPass→FPassage, FPNum→FPassNum, FTMask→FTrapMask
- Trap types: TDoor→TrapDoor ... TMyst→TrapMystery
- Item subtypes: P*→Potion* (PLSD→PotionLSD, PMFind→
PotionDetectMonsters, ...), S*→Scroll* (SIDRorS→
ScrollIdentifyRingOrStick, ...), R*→Ring* (RAddHit→RingDexterity,
RNop→RingAdornment, ...), Ws*→Wand* (WsElect→WandLightning, ...),
weapons (TwoSword→WeaponTwoHandedSword, Shiraken→WeaponShuriken,
...), armor (RingMail→ArmorRingMail, ...)
- Counts: Max{Potions,Scrolls,Rings,Sticks,Weapons,Armors} →
Num{Potion,Scroll,Ring,Wand,Weapon,Armor}Types; NTraps→NumTrapTypes
- Level.NTraps field → TrapCount (also in the save snapshot)
- Original C constant names preserved as comment breadcrumbs in
types.go so the lineage stays greppable
TODO.md: step 1 moved to Completed, step 2 (typed kinds) promoted to
Next Step.
This commit is contained in:
@@ -13,11 +13,11 @@ func TestSaveRestoreRoundTrip(t *testing.T) {
|
||||
g.Player.Purse = 123
|
||||
g.Player.FoodLeft = 777
|
||||
g.HasAmulet = true
|
||||
g.Items.Potions[PHealing].Know = true
|
||||
g.Items.Scrolls[SMap].Guess = "map???"
|
||||
g.Items.Potions[PotionHealing].Know = true
|
||||
g.Items.Scrolls[ScrollMagicMapping].Guess = "map???"
|
||||
g.Monsters['F'-'A'].Stats.Dmg = "3x1" // mutated bestiary must survive
|
||||
if len(g.Level.Monsters) > 0 {
|
||||
g.Level.Monsters[0].Flags.Set(IsRun)
|
||||
g.Level.Monsters[0].Flags.Set(Awake)
|
||||
g.Level.Monsters[0].Dest = &g.Player.Pos
|
||||
}
|
||||
|
||||
@@ -42,10 +42,10 @@ func TestSaveRestoreRoundTrip(t *testing.T) {
|
||||
if !h.HasAmulet {
|
||||
t.Error("amulet flag lost")
|
||||
}
|
||||
if !h.Items.Potions[PHealing].Know {
|
||||
if !h.Items.Potions[PotionHealing].Know {
|
||||
t.Error("potion identification lost")
|
||||
}
|
||||
if h.Items.Scrolls[SMap].Guess != "map???" {
|
||||
if h.Items.Scrolls[ScrollMagicMapping].Guess != "map???" {
|
||||
t.Error("scroll guess lost")
|
||||
}
|
||||
if h.Monsters['F'-'A'].Stats.Dmg != "3x1" {
|
||||
|
||||
Reference in New Issue
Block a user