ID:139162
 
Code:
                proc
Metronome() // Incomplete
var/mob/O = src.Owner
var/mob/M = O.Foe
var/obj/card/P = M.Active_Pokemon
if(Energy() >= 3)
call(src,input(usr,"Attacks") in P.Attacks)()
else
O << output("[src.name] requires at least 3 Colourless Energy to use Metronome!")
return


Problem description: Well the idea is to have Clefairy use any Pokemon's attack. As the code stands, it can only copy the procedure itself.

I had considered giving Clefairy a "Metronome Energy" list. But I realized that the extra effects of each attack could be triggered by that.

Right now I think the only way I can get around this issue is by adding an "Or" clause to every attack (which is no problem, but it would be quite the ways to go to get 1 attack to work properly). Is there an easier way to get around this issue?

In simplified terms/clarification

1. Clefairy has an attack that lets it do any attack on the Opponent's card, regardless of cost

2. Clefairy, using this attack, is not allowed to utilize extra effects, it only does base damage

3. My current code doesn't support this.

EDIT: I'm so sorry. I didn't realize I had re-written the code wrong. It's fixed now.
It sounds like the only real elegant solution here would be to refactor your entire code to not use procedures as attacks, but instead bundle them up in datums / objs. You would then be able to split up the parts of the attack with things like check_energy(caster), do_damage(caster, target), do_effects(caster, target), whatever, and only call the relevant procedures when you want to use the attack in different ways.
In response to Garthor
Yeah, I figured as much. I think I'm just going to add procedure that checks for metronome and does base damage