Repository navigation
Row 3023: mob skill grants pick one listed skill, then check it (Cosmic) - #1519
Merged
Merged
Conversation
… 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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 nointervalkey (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, thencanUseSkill, 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
skills_are_granted_then_cast, updated: a pick that can't be cast grants nothing, rather than another skill.trace::ask_for_skill, which asks until a grant comes. Changed:mob_skills,mob_dispel_banish,mob_counters,papulatus_boss.mob_skills,mob_dispel_banish,mob_counters,papulatus_boss,pianus_boss,mob_mists,heros_will,player_diseases. All pass.runtimelib: 271 passed.agent_docs/combat.md"The grant" is updated.