My game uses a system where guns can be buffed by using ammo items to give it extra damage or specialized element. It also includes energy weapons and melee, which naturally would not work with ammo items, so YEP Item Requirements works great for this feature. In battle it works fine since the item only buffs the user, I just use the "Weapon Type" requirement to check whether or not the actor trying to use the ammo item is a weapon that's compatible with ammo items (I'm just going to call it a "gun" as a shorthand).
The problem is that when I try to use the ammo items out of battle, which I'd like to keep to let the player prep for upcoming battles. It seems that if the party leader is using an energy or melee weapon, no one in the party can use the item even if they are using a gun. And if the party leader is using a gun, the ammo item can then be used on any party member, even those wielding energy or melee weapons. So far I've solved the latter problem by making energy and melee weapons resist the ammo buff state, but it still consumes the item which is not ideal.
As far as I can tell, nothing in the built in requirements would help here. I suspect that there's some script that can be used to make this work, maybe something like "condition = target.equipweapontype != 1, 2"? Unfortunately I'm not familiar with javascript so I don't know what the proper code would be. If anyone could help with the code or provide some work around, that be greatly appreciated. Thanks in advance!
The problem is that when I try to use the ammo items out of battle, which I'd like to keep to let the player prep for upcoming battles. It seems that if the party leader is using an energy or melee weapon, no one in the party can use the item even if they are using a gun. And if the party leader is using a gun, the ammo item can then be used on any party member, even those wielding energy or melee weapons. So far I've solved the latter problem by making energy and melee weapons resist the ammo buff state, but it still consumes the item which is not ideal.
As far as I can tell, nothing in the built in requirements would help here. I suspect that there's some script that can be used to make this work, maybe something like "condition = target.equipweapontype != 1, 2"? Unfortunately I'm not familiar with javascript so I don't know what the proper code would be. If anyone could help with the code or provide some work around, that be greatly appreciated. Thanks in advance!