Advertisement
Yamian

c999999992.lua (YGOPRO-Cocoon of Evolution)

Jun 2nd, 2016
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.44 KB | None | 0 0
  1. --Cocoon of Evolution
  2. --COPYRIGHT by YAMI AN
  3. function c999999992.initial_effect(c)
  4.     --Equip
  5.     local e1=Effect.CreateEffect(c)
  6.     e1:SetType(EFFECT_TYPE_IGNITION)
  7.     e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  8.     e1:SetCategory(CATEGORY_EQUIP)
  9.     e1:SetRange(LOCATION_HAND)
  10.     e1:SetTarget(c999999992.eqtg)
  11.     e1:SetOperation(c999999992.eqop)
  12.     c:RegisterEffect(e1)
  13. end
  14. function c999999992.filter(c)
  15.     return c:IsFaceup() and c:IsCode(58192742) or c:IsCode(87756343)
  16. end
  17. function c999999992.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
  18.     if chkc then
  19.         return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c999999992.filter(chkc)
  20.     end
  21.     if chk==0 then
  22.         return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingTarget(c999999992.filter,tp,LOCATION_MZONE,0,1,nil)
  23.     end
  24.     Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
  25.     Duel.SelectTarget(tp,c999999992.filter,tp,LOCATION_MZONE,0,1,1,nil)
  26. end
  27. function c999999992.eqop(e,tp,eg,ep,ev,re,r,rp)
  28.     local c=e:GetHandler()
  29.     if not c:IsRelateToEffect(e) then return end
  30.     local tc=Duel.GetFirstTarget()
  31.     if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:GetControler()~=tp or tc:IsFacedown() or not tc:IsRelateToEffect(e) then
  32.         Duel.SendtoGrave(c,REASON_EFFECT)
  33.         return
  34.     end
  35.     Duel.Equip(tp,c,tc,true)
  36.     local e1=Effect.CreateEffect(c)
  37.     e1:SetType(EFFECT_TYPE_SINGLE)
  38.     e1:SetCode(EFFECT_EQUIP_LIMIT)
  39.     e1:SetValue(c999999992.eqlimit)
  40.     e1:SetReset(RESET_EVENT+0x1fe0000)
  41.     c:RegisterEffect(e1)
  42.     local e2=Effect.CreateEffect(c)
  43.     e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
  44.     e2:SetRange(LOCATION_SZONE)
  45.     e2:SetCode(EVENT_PHASE+PHASE_END)
  46.     e2:SetCondition(c999999992.checkcon)
  47.     e2:SetOperation(c999999992.checkop)
  48.     e2:SetCountLimit(1)
  49.     e2:SetReset(RESET_EVENT+0x1fe0000)
  50.     c:RegisterEffect(e2)
  51.     --Equip effect
  52.     local e3=Effect.CreateEffect(c)
  53.     e3:SetType(EFFECT_TYPE_EQUIP)
  54.     e3:SetCode(EFFECT_SET_ATTACK)
  55.     e3:SetValue(0)
  56.     e3:SetReset(RESET_EVENT+0x1fe0000)
  57.     c:RegisterEffect(e3)
  58.     local e4=Effect.CreateEffect(c)
  59.     e4:SetType(EFFECT_TYPE_EQUIP)
  60.     e4:SetCode(EFFECT_SET_DEFENCE)
  61.     e4:SetValue(2000)
  62.     e4:SetReset(RESET_EVENT+0x1fe0000)
  63.     c:RegisterEffect(e4)
  64.     c:SetTurnCounter(0)
  65. end
  66. function c999999992.checkcon(e,tp,eg,ep,ev,re,r,rp)
  67.     return Duel.GetTurnPlayer()==tp
  68. end
  69. function c999999992.checkop(e,tp,eg,ep,ev,re,r,rp)
  70.     local c=e:GetHandler()
  71.     local ct=c:GetTurnCounter()
  72.     ct=ct+1
  73.     c:SetTurnCounter(ct)
  74. end
  75. function c999999992.eqlimit(e,c)
  76.     return c:IsCode(58192742) or c:IsCode(87756343)
  77. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement