Skip to content

Row 3023: mob skill grants pick one listed skill, then check it (Cosmic) - #1519

Merged
neeerp merged 1 commit into
masterfrom
v83/mob-grant-1
Nov 9, 2026
Merged

neeerp merged 1 commit into
masterfrom
v83/mob-grant-1

Conversation

@neeerp

@neeerp neeerp commented Nov 9, 2026

Copy link
Copy Markdown
Owner

What

LiveMob::grant (runtime/src/actor/field_mobs.rs) used to pick at random among the skills a mob could cast right now. A skill whose MobSkill level has no interval key (a 0 s cooldown) therefore came back on every move while the mob's other skills cooled down. The client casts a granted skill before it picks an attack, so the mob never attacked.

Found in play (P431): Prototype Lord 8120103 in Neo City (240070401/402) has Seal 123/20 (interval 20) and Confusion 132/5 (no interval, prop 100). It recast Confusion over and over and never used its 415-MAD magic or its physical attack.

Now the roll picks one of the listed skills and grants it only if the mob may cast it (MP, cooldown, HP limit, summon limit, not sealed). If it can't, the mob attacks. This matches Cosmic's MoveLifeHandler (getRandomSkill, then canUseSkill, HP and MP checks). Mobs whose skills are all castable behave exactly as before.

Other mobs listed in P424 with an interval-less skill: 9001010, 9300367–9300377, 9400593 and 9400609.

Tests

  • Unit test skills_are_granted_then_cast, updated: a pick that can't be cast grants nothing, rather than another skill.
  • Harness: the tests that waited for a grant after a single move now call the new trace::ask_for_skill, which asks until a grant comes. Changed: mob_skills, mob_dispel_banish, mob_counters, papulatus_boss.
  • Run on the lane world: mob_skills, mob_dispel_banish, mob_counters, papulatus_boss, pianus_boss, mob_mists, heros_will, player_diseases. All pass. runtime lib: 271 passed.
  • Played again after the fix: the Prototype Lords fired their attack about 12 times in 38 s (before: about once), and Confusion still lands now and then.

agent_docs/combat.md "The grant" is updated.

… as Cosmic

grant() picked at random among the skills a mob could cast right now, so a
skill with no `interval` (a 0 s cooldown) was handed over on every move
while its others cooled down. Prototype Lord 8120103 (Neo City 240070401/
402) cast Confusion 132/5 over and over and never used its attacks.

Now, as Cosmic's MoveLifeHandler, the roll picks one of the listed skills
and grants it only if the mob may cast it (MP, cooldown, HP limit, summon
limit); otherwise the mob attacks. Played after the fix: its attack rings
every 2-3 s, Confusion now and then.

The harness tests that waited for a grant after one move now ask until one
comes (trace::ask_for_skill).
@neeerp
neeerp merged commit c9d844f into master Nov 9, 2026
1 check passed
@neeerp
neeerp deleted the v83/mob-grant-1 branch November 9, 2026 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant