Advertisement
Yamian

c999999995.lua (YGOPRO-Dragon Piper)

Apr 15th, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.31 KB | None | 0 0
  1. --Dragon Piper
  2. --COPYRIGHT by YAMI AN
  3. function c999999995.initial_effect(c)
  4.     --Activate
  5.     local e1=Effect.CreateEffect(c)
  6.     e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  7.     e1:SetType(EFFECT_TYPE_IGNITION)
  8.     e1:SetRange(LOCATION_MZONE)
  9.     e1:SetCountLimit(1)
  10.     e1:SetCondition(c999999995.condition)
  11.     e1:SetTarget(c999999995.target)
  12.     e1:SetOperation(c999999995.activate)
  13.     c:RegisterEffect(e1)
  14. end
  15. function c999999995.cfilter(c)
  16.     return c:IsFaceup() and c:IsCode(50045299)
  17. end
  18. function c999999995.spfilter(c,e,tp)
  19.     return c:IsRace(RACE_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
  20. end
  21. function c999999995.condition(e,tp,eg,ep,ev,re,r,rp)
  22.     return Duel.IsExistingMatchingCard(c999999995.cfilter,tp,LOCATION_SZONE,0,1,nil)
  23. end
  24. function c999999995.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
  25.     if chk==0 then
  26.         return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(c999999995.spfilter,tp,0,LOCATION_REMOVED,1,nil,e,tp)
  27.     end
  28.     Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
  29.     local g=Duel.SelectTarget(tp,c999999995.spfilter,tp,0,LOCATION_REMOVED,1,1,nil,e,tp)
  30.     Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
  31. end
  32. function c999999995.activate(e,tp,eg,ep,ev,re,r,rp)
  33.     local tc=Duel.GetFirstTarget()
  34.     if tc:IsRelateToEffect(e) then
  35.         Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
  36.     end
  37. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement