I decided to fiddle with the Enemy Thieves notetags a bit and managed to make enemies steal actor's weapons. It works... sort of.
<After Eval>
if (user.isEnemy()) {
var successRate = 0.5;
if (Math.random() < successRate) {
var weapons = [];
var total = target.weapons().length;
for (var i = 0; i < total; ++i) {
var weapon = target.weapons();
}
if (weapon === "null") {
var text = user.name() + ' found nothing to steal!';
} else {
target.discardEquip(weapon);
var text = user.name() + ' stole ' + weapon.name + '!';
SoundManager.playEquip();
}
} else {
var text = user.name() + ' failed to steal a weapon!';
SoundManager.playBuzzer();
}
var window = SceneManager._scene._logWindow;
window._lines.push(text + '<CENTER>');
window.refresh();
}
</After Eval>
There's just one major downside: I haven't managed to figure out how to get the code check if the target has no weapon (i.e. the part with if (weapon === "null") doesn't work). Currently, the game crashes if the enemy tries to steal weapon from a target which doesn't have one equipped because it can't read the 'name' value of 'weapon'.
I can try to find a solution later on, but it might take a couple of days because I am busy with work. I decided to post the code nevertheless in case you or someone else managed to point out where I went wrong. 🙂