aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-07-17 20:30:50 -0400
committerhistoria <[not public]>2026-07-17 20:30:50 -0400
commit467944adfa41673a3758d9622873abbe7ae35a49 (patch)
tree152a57e9e88f228147301544100ed0b7f5f9fa89
parent9898d42f2d4ef61b5cbec7e212914d1495e04772 (diff)
downloadthehouseoficarus-467944adfa41673a3758d9622873abbe7ae35a49.tar.gz
clean up tick_order.md, MoveTick, SequenceTick wording
-rw-r--r--building_guide/tick_order.md8
-rw-r--r--internal/game/sys_combat.go16
2 files changed, 12 insertions, 12 deletions
diff --git a/building_guide/tick_order.md b/building_guide/tick_order.md
index 2d22ac9..6138fbe 100644
--- a/building_guide/tick_order.md
+++ b/building_guide/tick_order.md
@@ -125,10 +125,10 @@ When writing content that depends on per-tick ordering (a trigger that
should fire *after* regen, a sequence whose step messages should appear
*before* the move completes, etc.), consult the table above and remember:
-- Trigger `sequences` advance in step 3, **before** movement completes in
- step 2 has any knock-on effects like enter-room triggers — wait, step 2
- (MoveTick) actually runs *before* step 3 (SequenceTick) because the table
- is fired top-to-bottom. Double-check the exact step your event lives in.
+- `MoveTick` (step 2) runs before `SequenceTick` (step 3) — the table
+ fires top-to-bottom, so a move that completes this tick will have its
+ enter-room knock-on triggers fire (inside step 1 or step 2) before
+ trigger `sequences` advance in step 3.
- `on_enter` / `on_exit` room triggers fire from command execution, not
from a per-tick system; they run inside `ProcessQueuedCommands` (step 1)
or `MoveTick` (step 2) when the move actually completes.
diff --git a/internal/game/sys_combat.go b/internal/game/sys_combat.go
index e05cfed..b37459e 100644
--- a/internal/game/sys_combat.go
+++ b/internal/game/sys_combat.go
@@ -104,18 +104,18 @@ func (g *Game) checkAggro(sess *net.Session) {
}
aggMob := mob
- rollAggro := func() (stop bool) {
+ keepRolling := func() (keep bool) {
if g.Combat.Get(p.Name) != nil {
- return true
+ return false
}
if aggMob.HP <= 0 || aggMob.RoomID != p.RoomID {
- return true
+ return false
}
if g.Combat.IsMobInCombat(aggMob.InstanceID) {
- return true
+ return false
}
if rollAggroRand() >= aggroChancePerTick {
- return false
+ return true
}
attacker := aggMob.Name
if !aggMob.Unique {
@@ -123,13 +123,13 @@ func (g *Game) checkAggro(sess *net.Session) {
}
sess.WriteLine(fmt.Sprintf("%s attacks you!", g.colorize(sess, "mob", attacker)))
g.startCombat(sess, p, aggMob)
- return true
+ return false
}
- if rollAggro() {
+ if !keepRolling() {
break
}
- g.Ticks.Subscribe(1, func() bool { return !rollAggro() })
+ g.Ticks.Subscribe(1, keepRolling)
break
}
}