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:
16
game/rip.go
16
game/rip.go
@@ -121,12 +121,12 @@ func (g *RogueGame) totalWinner() {
|
||||
case Weapon:
|
||||
worth = it.Weapons[obj.Which].Worth
|
||||
worth *= 3*(obj.HPlus+obj.DPlus) + obj.Count
|
||||
obj.Flags.Set(IsKnow)
|
||||
obj.Flags.Set(Known)
|
||||
case Armor:
|
||||
worth = it.Armors[obj.Which].Worth
|
||||
worth += (9 - obj.Arm) * 100
|
||||
worth += 10 * (aClass[obj.Which] - obj.Arm)
|
||||
obj.Flags.Set(IsKnow)
|
||||
obj.Flags.Set(Known)
|
||||
case Scroll:
|
||||
op := &it.Scrolls[obj.Which]
|
||||
worth = op.Worth * obj.Count
|
||||
@@ -144,27 +144,27 @@ func (g *RogueGame) totalWinner() {
|
||||
case Ring:
|
||||
op := &it.Rings[obj.Which]
|
||||
worth = op.Worth
|
||||
if obj.Which == RAddStr || obj.Which == RAddDam ||
|
||||
obj.Which == RProtect || obj.Which == RAddHit {
|
||||
if obj.Which == RingAddStrength || obj.Which == RingIncreaseDamage ||
|
||||
obj.Which == RingProtection || obj.Which == RingDexterity {
|
||||
if obj.Arm > 0 {
|
||||
worth += obj.Arm * 100
|
||||
} else {
|
||||
worth = 10
|
||||
}
|
||||
}
|
||||
if !obj.Flags.Has(IsKnow) {
|
||||
if !obj.Flags.Has(Known) {
|
||||
worth /= 2
|
||||
}
|
||||
obj.Flags.Set(IsKnow)
|
||||
obj.Flags.Set(Known)
|
||||
op.Know = true
|
||||
case Stick:
|
||||
op := &it.Sticks[obj.Which]
|
||||
worth = op.Worth
|
||||
worth += 20 * obj.Charges()
|
||||
if !obj.Flags.Has(IsKnow) {
|
||||
if !obj.Flags.Has(Known) {
|
||||
worth /= 2
|
||||
}
|
||||
obj.Flags.Set(IsKnow)
|
||||
obj.Flags.Set(Known)
|
||||
op.Know = true
|
||||
case Amulet:
|
||||
worth = 1000
|
||||
|
||||
Reference in New Issue
Block a user