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:
@@ -48,11 +48,11 @@ func (g *RogueGame) ringOn() {
|
||||
|
||||
// Calculate the effect it has on the poor guy.
|
||||
switch obj.Which {
|
||||
case RAddStr:
|
||||
case RingAddStrength:
|
||||
g.chgStr(obj.Arm)
|
||||
case RSeeInvis:
|
||||
case RingSeeInvisible:
|
||||
g.invisOn()
|
||||
case RAggr:
|
||||
case RingAggravateMonsters:
|
||||
g.aggravate()
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ func (g *RogueGame) gethand() int {
|
||||
|
||||
// ringUses is the rings.c ring_eat static uses[] table: how much food each
|
||||
// ring type uses up per turn (negative = a 1-in-n chance of 1).
|
||||
var ringUses = [MaxRings]int{
|
||||
var ringUses = [NumRingTypes]int{
|
||||
1, // R_PROTECT
|
||||
1, // R_ADDSTR
|
||||
1, // R_SUSTSTR
|
||||
@@ -155,7 +155,7 @@ func (g *RogueGame) ringEat(hand int) int {
|
||||
eat = 0
|
||||
}
|
||||
}
|
||||
if ring.Which == RDigest {
|
||||
if ring.Which == RingSlowDigestion {
|
||||
eat = -eat
|
||||
}
|
||||
return eat
|
||||
@@ -163,11 +163,11 @@ func (g *RogueGame) ringEat(hand int) int {
|
||||
|
||||
// ringNum prints ring bonuses (rings.c ring_num).
|
||||
func ringNum(g *RogueGame, obj *Object) string {
|
||||
if !obj.Flags.Has(IsKnow) {
|
||||
if !obj.Flags.Has(Known) {
|
||||
return ""
|
||||
}
|
||||
switch obj.Which {
|
||||
case RProtect, RAddStr, RAddDam, RAddHit:
|
||||
case RingProtection, RingAddStrength, RingIncreaseDamage, RingDexterity:
|
||||
return fmt.Sprintf(" [%s]", num(obj.Arm, 0, Ring))
|
||||
}
|
||||
return ""
|
||||
|
||||
Reference in New Issue
Block a user