mob_combat
mob_combat is the generic monster combat switch scheme. It listens for monster combat events and uses common switch
conditions to move the object to another section.
Parameters
mob_combat has no scheme-specific config fields. It reads common switch fields from the section.
on_info, on_info1, …
Type: condlist.
Switch when the condlist selects another section.
on_timer, on_timer1, …
Type: milliseconds | condlist.
Switch after the section has been active for the duration.
on_signal, on_signal1, …
Type: signal | condlist.
Switch when a signal is set.
Runtime behavior
The manager only acts on the combat event. If the scheme is enabled, the monster has an enemy, and the object has an active scheme, it calls the common section switcher.
The scheme can be disabled through SchemeMobCombat.disable, which sets its runtime enabled flag to false.
Runtime sequence
SchemeMobCombat.activateparses common switch fields and setsenabled = true.SchemeMobCombat.addsubscribes aMobCombatManager.MobCombatManager.onCombatruns only when the state is enabled,object.get_enemy()is not null, and the object still has an active scheme.- The manager calls
trySwitchToAnotherSection. disableleaves the action in place but setsenabled = false, so later combat events are ignored.
Example
[logic]
active = mob_home@idle
on_combat = mob_combat@combat
[mob_combat@combat]
on_info = mob_walker@attack
Notes
- This is normally referenced from a monster logic section through
on_combat. - It does not perform combat movement by itself.
- Put movement behavior in the target monster section, such as
mob_home,mob_walker, or another monster scheme.