Advertisement
Yamian

c999999979.lua (YGOPRO-Mystical Elf)

Jun 28th, 2016
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.18 KB | None | 0 0
  1. --Mystical Elf
  2. --COPYRIGHT by Yami An
  3. function c999999979.initial_effect(c)
  4.     --ATK
  5.     local e1=Effect.CreateEffect(c)
  6.     e1:SetCategory(CATEGORY_ATKCHANGE)
  7.     e1:SetType(EFFECT_TYPE_IGNITION)
  8.     e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_NO_TURN_RESET)
  9.     e1:SetRange(LOCATION_MZONE)
  10.     e1:SetCountLimit(1)
  11.     e1:SetTarget(c999999979.atktg)
  12.     e1:SetOperation(c999999979.atkop)
  13.     c:RegisterEffect(e1)
  14. end
  15. function c999999979.filter(c)
  16.     return c:IsFaceup()
  17. end
  18. function c999999979.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
  19.     if chkc then return
  20.         chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c999999979.filter(chkc) and chkc~=e:GetHandler()
  21.     end
  22.     if chk==0 then return
  23.         Duel.IsExistingTarget(c999999979.filter,tp,LOCATION_MZONE,0,1,e:GetHandler())
  24.     end
  25.     Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
  26.     Duel.SelectTarget(tp,c999999979.filter,tp,LOCATION_MZONE,0,1,1,e:GetHandler())
  27. end
  28. function c999999979.atkop(e,tp,eg,ep,ev,re,r,rp)
  29.     local c=e:GetHandler()
  30.     local tc=Duel.GetFirstTarget()
  31.     local atk=c:GetTextAttack()
  32.     local e1=Effect.CreateEffect(e:GetHandler())
  33.     e1:SetType(EFFECT_TYPE_SINGLE)
  34.     e1:SetCode(EFFECT_UPDATE_ATTACK)
  35.     e1:SetValue(atk)
  36.     tc:RegisterEffect(e1)
  37. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement