So i have some questions:
Example 1: Attack deals damage equal to strength, unless the target has equipped equipment X, otherwise less by Y
Example 1a: Attack deals damage equal to strength, unless the target has equipped equipment of type X (I don't know some notetag), otherwise less by Y
Example 2: Attack deals damage equal to X, and if the attacker has equipped Y, then the damage is greater by Z
Hey,
To check whether any equipped item contains <notetag> in its notebox, you could try this:
b.feature_objects.any? { |o| o.note["<notetag>"] }
This will technically also check states, the class and the actor/enemy database entries, but an upside would be that you don't have to modify the code to make it work on enemies, which don't have equipment.
If you strictly want to only check equipment, you could try this:
b.actor? && b.equips.any? { |o| o && o.note["<notetag>"] }
With that in mind, your examples:
1a: a.atk - (b.feature_objects.any?{|o| o.note["<type x>"]} ? 12300 : 0)
2: 12350 + (a.feature_objects.any?{|o| o.note["<type y>"]} ? 13500 : 0)
You're using the attacker's current HP to deal damage... but it's already dead!! So the opponent wins. He has no reason to complain about it, anyway. 🤣