Alrighty, so... I just need to change this bit of it, then?
if target.is_a?(Game_Enemy)
ids = []
target.actions.each {|act| ids.push(act.skill_id) if act.kind == 1}
elsif target.is_a?(Game_Actor)
ids = target.skills.clone
end
...and I have no use for the randomization, so I can just check for the enemy ID, then assign a skill ID to
ids based on that. Hmm... I'm not really well-versed in Ruby stuffs, so... I need to study other scripts for examples, I suppose.
Ok. I was thinking about doing it with arrays, but I'm not sure how to go about it. The best I can think of is this:
def do_the_thing_with_the_skillz(enemy)
case enemy
when 1 then return 1
when 2 then return 1
when 3 then return 2
when 4 then return 3
end
return nil
end
Is it possible to do something like...
when [1, 2, 3].include? then return 1
...just for brevity's sake? I realize
include doesn't work that way, but... something?
EDIT: Maybe something like this is better?
def do_the_thing_with_the_skillz(enemy)
return 1 if [1,2,3].include?(enemy)
return 2 if [4,5].include?(enemy)
return 3 if [6,7,8,23].include?(enemy)
return nil
end
/EDITAnyway, then I'd have to have the other part be something like...
if target.is_a?(Game_Enemy)
ids = do_the_thing_with_the_skillz(target.id)
else # It should never be targeting an actor, so this part shouldn't even come up.
ids = nil
end
Right?
Did I do all that correctly? Will it work with the rest of the script the way it is?
EDIT: Oh! A final, more complex question!
Would it be possible to have something like "Skill already learned!" be displayed in the help window, while selecting targets with this skill? Well... I'm sure it's
possible, but is it not unreasonably difficult? It'd just be a QOL improvement, so it's not terribly necessary.