Hellu again! So, I'm trying to create a String for Lunatic Target so a skill I make can only target an enemy that have 3 or more states on them.
Also, I'm using this mini script (that I can't remember where I take from).
This mini script allow me to give states specific notetags to keep record of them and give them special traits with other scripts. ANYWAYS, the problem is, I have an skill that should only target an enemy that have 3 or more states with the notetag <spelltrap>, but I can't figure out how should I create said string.
Any help is welcome. Thanks!
Also, I'm using this mini script (that I can't remember where I take from).
Ruby:
class RPG::State < RPG::BaseItem
def neg_state?
self.note =~ /<neg>/i
end
def spell_state?
self.note =~ /<spell>/i
end
def trap_state?
self.note =~ /<trap>/i
end
def spelltrap_state?
self.note =~ /<spelltrap>/i
end
def faceupst_state?
self.note =~ /<faceupst>/i
end
def monster_state?
self.note =~ /<monst>/i
end
def set_state?
self.note =~ /<set>/i
end
end
class Game_Battler < Game_BattlerBase
def remove_random_state
return if neg_states_and_debuffs.empty?
state_id = neg_states_and_debuffs.sample
state_id.is_a?(Array) ? remove_buff(state_id[0]) : remove_state(state_id)
end
def neg_states_and_debuffs
debuffs = Hash[@buffs.map.with_index { |x,i| [i,x] }]
debuffs = (debuffs.select { |k,v| v < 0 }).to_a
return @states.select { |s| $data_states[s].neg_state? } + debuffs
end
def remove_random_spell
return if neg_spell.empty?
state_id = neg_spell.sample
state_id.is_a?(Array) ? remove_buff(state_id[0]) : remove_state(state_id)
end
def neg_spell
debuffs = Hash[@buffs.map.with_index { |x,i| [i,x] }]
debuffs = (debuffs.select { |k,v| v < 0 }).to_a
return @states.select { |s| $data_states[s].spell_state? } + debuffs
end
def remove_random_trap
return if neg_trap.empty?
state_id = neg_trap.sample
state_id.is_a?(Array) ? remove_buff(state_id[0]) : remove_state(state_id)
end
def neg_trap
debuffs = Hash[@buffs.map.with_index { |x,i| [i,x] }]
debuffs = (debuffs.select { |k,v| v < 0 }).to_a
return @states.select { |s| $data_states[s].trap_state? } + debuffs
end
def remove_random_spelltrap
return if neg_spelltrap.empty?
state_id = neg_spelltrap.sample
state_id.is_a?(Array) ? remove_buff(state_id[0]) : remove_state(state_id)
end
def neg_spelltrap
debuffs = Hash[@buffs.map.with_index { |x,i| [i,x] }]
debuffs = (debuffs.select { |k,v| v < 0 }).to_a
return @states.select { |s| $data_states[s].spelltrap_state? } + debuffs
end
def remove_random_faceupst
return if neg_faceupst.empty?
state_id = neg_faceupst.sample
state_id.is_a?(Array) ? remove_buff(state_id[0]) : remove_state(state_id)
end
def neg_faceupst
debuffs = Hash[@buffs.map.with_index { |x,i| [i,x] }]
debuffs = (debuffs.select { |k,v| v < 0 }).to_a
return @states.select { |s| $data_states[s].faceupst_state? } + debuffs
end
def remove_random_monst
return if neg_monst.empty?
state_id = neg_monst.sample
state_id.is_a?(Array) ? remove_buff(state_id[0]) : remove_state(state_id)
end
def neg_monst
debuffs = Hash[@buffs.map.with_index { |x,i| [i,x] }]
debuffs = (debuffs.select { |k,v| v < 0 }).to_a
return @states.select { |s| $data_states[s].monst_state? } + debuffs
end
def remove_random_set
return if neg_set.empty?
state_id = neg_set.sample
state_id.is_a?(Array) ? remove_buff(state_id[0]) : remove_state(state_id)
end
def neg_set
debuffs = Hash[@buffs.map.with_index { |x,i| [i,x] }]
debuffs = (debuffs.select { |k,v| v < 0 }).to_a
return @states.select { |s| $data_states[s].set_state? } + debuffs
end
end
This mini script allow me to give states specific notetags to keep record of them and give them special traits with other scripts. ANYWAYS, the problem is, I have an skill that should only target an enemy that have 3 or more states with the notetag <spelltrap>, but I can't figure out how should I create said string.
Any help is welcome. Thanks!