I'm currently attempting to write a script which can be used to check both an elements individual element property (eg. contains dairy) against the character ID to determine a semi-individualized item effects. I originally tried doing this with the pre-existing element_correct function, but that didn't work either. I'm a little new to this and very rusty when it comes to programming at all, so bear with me. Everything I'm editing is under game_battler 3. At the moment, the error is simply that healing items are working normally.
Calling the function:
Here, I modified the pre-existing self.damage = -recover_hp function to try to detect the item's element and give it an additional function after the element_control function has already been used (and thus should be independent of it).
Lookup/determiner function
tried modeling this after the element_correct function, but have obviously failed somewhere. Probably some noob mistake. Any help would be appreciated1
Calling the function:
Code:
if allergy_control(item.element_set) == 1
self.hp == 1
end
if allergy_control(item.element_set) == 0
self.damage = -recover_hp
end
Lookup/determiner function
Code:
def allergy_control(element_set)
if element_set == [19] and self.id == 1
return 1 #Has allergy
end
if element_set == [22] and self.id == 3
return 1 #Has allergy
end
if element_set == [20] and self.id == 5
return 1 #Has allergy
end
if element_set == [18] and self.id == 6
return 1 #Has allergy
end
if element_set == [21] and self.id == 7
return 1 #Has allergy
end
return 0
end