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:
@@ -27,7 +27,7 @@ func (g *RogueGame) createObj() {
|
||||
bless := g.readchar()
|
||||
g.Msgs.Mpos = 0
|
||||
if bless == '-' {
|
||||
obj.Flags.Set(IsCursed)
|
||||
obj.Flags.Set(Cursed)
|
||||
}
|
||||
if obj.Type == Weapon {
|
||||
g.initWeapon(obj, obj.Which)
|
||||
@@ -48,18 +48,18 @@ func (g *RogueGame) createObj() {
|
||||
}
|
||||
case obj.Type == Ring:
|
||||
switch obj.Which {
|
||||
case RProtect, RAddStr, RAddHit, RAddDam:
|
||||
case RingProtection, RingAddStrength, RingDexterity, RingIncreaseDamage:
|
||||
g.msg("blessing? (+,-,n)")
|
||||
bless := g.readchar()
|
||||
g.Msgs.Mpos = 0
|
||||
if bless == '-' {
|
||||
obj.Flags.Set(IsCursed)
|
||||
obj.Flags.Set(Cursed)
|
||||
obj.Arm = -1
|
||||
} else {
|
||||
obj.Arm = g.rnd(2) + 1
|
||||
}
|
||||
case RAggr, RTeleport:
|
||||
obj.Flags.Set(IsCursed)
|
||||
case RingAggravateMonsters, RingTeleportation:
|
||||
obj.Flags.Set(Cursed)
|
||||
}
|
||||
case obj.Type == Stick:
|
||||
g.fixStick(obj)
|
||||
@@ -131,7 +131,7 @@ func (g *RogueGame) whatis(insist bool, typ int) {
|
||||
case Stick:
|
||||
setKnow(obj, g.Items.Sticks[:])
|
||||
case Weapon, Armor:
|
||||
obj.Flags.Set(IsKnow)
|
||||
obj.Flags.Set(Known)
|
||||
case Ring:
|
||||
setKnow(obj, g.Items.Rings[:])
|
||||
}
|
||||
@@ -142,7 +142,7 @@ func (g *RogueGame) whatis(insist bool, typ int) {
|
||||
// set_know).
|
||||
func setKnow(obj *Object, info []ObjInfo) {
|
||||
info[obj.Which].Know = true
|
||||
obj.Flags.Set(IsKnow)
|
||||
obj.Flags.Set(Known)
|
||||
info[obj.Which].Guess = ""
|
||||
}
|
||||
|
||||
@@ -187,8 +187,8 @@ func (g *RogueGame) teleport() {
|
||||
g.mvaddch(p.Pos.Y, p.Pos.X, PlayerCh)
|
||||
// turn off ISHELD in case teleportation was done while fighting a
|
||||
// Flytrap
|
||||
if p.On(IsHeld) {
|
||||
p.Flags.Clear(IsHeld)
|
||||
if p.On(Held) {
|
||||
p.Flags.Clear(Held)
|
||||
p.VfHit = 0
|
||||
g.Monsters['F'-'A'].Stats.Dmg = "000x0"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user