oasis-b

Docs / Enemies

LW_EnemyTactics

Enemies
RPG Maker MV and MZ enemy AI plugin

Smarter enemies: a list of rules decides which skill an enemy uses and on whom.

Battle Essentials ($9.99)Full Collection ($19.99)

Needs LW_Core (LWZ_Core in MZ) above all Living World plugins in the Plugin Manager. It's included in every pack.

LW_EnemyTactics in a test project

Enemies that think before they hit.

Highlights

Ideas for your game

Works well with

LW_TauntLW_BattleInsightLW_EnemyScaling

Introduction

Works on its own. With LW_Taunt above it, enemies can respect taunts.

Write a list of rules into the note of an enemy. The first rule whose conditions all pass and whose skill the enemy can use right now is taken. If no rule fits, the enemy acts as set up in the database.

<LW Tactics>
self hp% <= 30%: skill 12, self
target hp% <= 50%: skill Fire, lowest hp%
switch 10 on and chance 50%: skill 9, highest mat
element Ice weak: skill Ice
always: skill 1, lowest hp
</LW Tactics>
<LW Smartness: 90>      overrides the default for this enemy
<LW Respect Taunt>      only targets taunting heroes when there are any

Skills and elements can be written as number or as name.

Conditions

Join several with "and". Conditions that look at targets keep only the targets that pass, so the target rule picks from those.

always
chance 30%
switch 10 on                 switch 10 off
variable 5 >= 3              (== != > >= < <=)
turn > 2
code user.hp < 500           JavaScript, user = the enemy
party alive > 2              party dead >= 1
troop alive < 3              troop dead >= 1
highest party level > 20     lowest troop level < 5
average party level >= 10
self hp% <= 30%              any stat of the enemy itself
target hp% <= 50%            keeps targets that pass
target atk > 100             stats: mhp hp hp% mmp mp mp% tp tp% atk
                             def mat mdf agi luk level states
target state is Poison       target state not Blind     (id or name)
element Fire weak            keeps targets with that reaction:
                             weak, normal, resists, immune, absorbs

Target Rules

first, self, random,
highest or lowest followed by: mhp hp hp% mmp mp mp% tp tp% atk def
mat mdf agi luk level states

Skills for all targets or random targets skip the target rule.

Notes written for older enemy AI plugins are read as well.

For Testing

enemy.lwTacticUsed()      the rule line the enemy used last

Terms of Use

See TERMS_OF_USE.txt in the download. Short version: use it in as many of your own games as you like, free or commercial. Edit it for your game, but keep this header. Don't share or resell the plugin files on their own. Name oasis-b in the credits of your game.

Changelog

Version 1.0.0 - 2026-11-22 - First release.

Introduction

Works on its own. With LWZ_Taunt above it, enemies can respect taunts.

Write a list of rules into the note of an enemy. The first rule whose conditions all pass and whose skill the enemy can use right now is taken. If no rule fits, the enemy acts as set up in the database.

<LW Tactics>
self hp% <= 30%: skill 12, self
target hp% <= 50%: skill Fire, lowest hp%
switch 10 on and chance 50%: skill 9, highest mat
element Ice weak: skill Ice
always: skill 1, lowest hp
</LW Tactics>
<LW Smartness: 90>      overrides the default for this enemy
<LW Respect Taunt>      only targets taunting heroes when there are any

Skills and elements can be written as number or as name.

Conditions

Join several with "and". Conditions that look at targets keep only the targets that pass, so the target rule picks from those.

always
chance 30%
switch 10 on                 switch 10 off
variable 5 >= 3              (== != > >= < <=)
turn > 2
code user.hp < 500           JavaScript, user = the enemy
party alive > 2              party dead >= 1
troop alive < 3              troop dead >= 1
highest party level > 20     lowest troop level < 5
average party level >= 10
self hp% <= 30%              any stat of the enemy itself
target hp% <= 50%            keeps targets that pass
target atk > 100             stats: mhp hp hp% mmp mp mp% tp tp% atk
                             def mat mdf agi luk level states
target state is Poison       target state not Blind     (id or name)
element Fire weak            keeps targets with that reaction:
                             weak, normal, resists, immune, absorbs

Target Rules

first, self, random,
highest or lowest followed by: mhp hp hp% mmp mp mp% tp tp% atk def
mat mdf agi luk level states

Skills for all targets or random targets skip the target rule.

Notes written for older enemy AI plugins are read as well.

For Testing

enemy.lwTacticUsed()      the rule line the enemy used last

Terms of Use

See TERMS_OF_USE.txt in the download. Short version: use it in as many of your own games as you like, free or commercial. Edit it for your game, but keep this header. Don't share or resell the plugin files on their own. Name oasis-b in the credits of your game.

Changelog

Version 1.0.0 - First release for MZ.

Get it

LW_EnemyTactics is in these packs. Every pack comes as an MV and an MZ download at the same price and needs no other plugin collection. Tested in RPG Maker MV 1.6.2 and MZ 1.10.0 games on Windows, macOS and Linux and in current browsers.

Battle Essentials ($9.99)Full Collection ($19.99)
LW_EnemyScaling →