I wanted to compare an armor id to an array. As part of what I have asked quite some time ago, I tried what Theo told me to do using the any method. However I came across a line where it seems not to be working if I am going to give a value out of it. First is, I tried to do an armor check into a character:
class Game_Actor def a_equip?(armor_id) return armors.any? {|armor| armor.id == armor_id} end endnow, I created an array called green_armor.
Green_Armor = [1, 2, 3, 4, 5]So, what I wanted to do is to make a check:
if $game_party.members.a_equip?(Green_Armor.any?)it doesn't seem to give me anything. The a_equip? was merely to check the armor id and returns the armor id of my part members. I was meaning to check if any of them has the Green Armors. Am I missing something?
I tried .include? but somehow it only works with a specific number, not an array.
class Game_Actor def a_equip?(armor_id) return armors.any? {|armor| armor.id == armor_id} end endnow, I created an array called green_armor.
Green_Armor = [1, 2, 3, 4, 5]So, what I wanted to do is to make a check:
if $game_party.members.a_equip?(Green_Armor.any?)it doesn't seem to give me anything. The a_equip? was merely to check the armor id and returns the armor id of my part members. I was meaning to check if any of them has the Green Armors. Am I missing something?
I tried .include? but somehow it only works with a specific number, not an array.