Doigt

Undead Flames YGOPRO Card

Apr 12th, 2019
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.11 KB | None | 0 0
  1. -- Undead Flames
  2. function c33.initial_effect(c)
  3.  
  4.     --send to grave
  5.     local e1=Effect.CreateEffect(c)
  6.     e1:SetCategory(CATEGORY_TOGRAVE)
  7.     e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
  8.     e1:SetCode(EVENT_SUMMON_SUCCESS)
  9.     e1:SetTarget(c33.tgtg)
  10.     e1:SetOperation(c33.tgop)
  11.     c:RegisterEffect(e1)
  12.    
  13.     --damage
  14.     local e2=Effect.CreateEffect(c)
  15.     e2:SetCategory(CATEGORY_DAMAGE)
  16.     e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  17.     e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
  18.     e2:SetCode(EVENT_TO_GRAVE)
  19.     e2:SetTarget(c33.dmtg)
  20.     e2:SetOperation(c33.dmop)
  21.     c:RegisterEffect(e2)
  22.    
  23.     --atk
  24.     local e3=Effect.CreateEffect(c)
  25.     e3:SetType(EFFECT_TYPE_SINGLE)
  26.     e3:SetCode(EFFECT_SET_ATTACK)
  27.     e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  28.     e3:SetRange(LOCATION_MZONE)
  29.     e3:SetValue(c33.atk)
  30.     c:RegisterEffect(e3)
  31.    
  32.     --other conditions for send to grave
  33.     local e4=e1:Clone()
  34.     e4:SetCode(EVENT_SPSUMMON_SUCCESS)
  35.     c:RegisterEffect(e4)
  36.    
  37.     local e5=e1:Clone()
  38.     e5:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
  39.     c:RegisterEffect(e5)
  40. end
  41. function c33.tgfilter(c)
  42.  
  43.     return c:IsCode(33) and c:IsAbleToGrave()
  44. end
  45.  
  46. function c33.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
  47.  
  48.     if chk==0 then return Duel.IsExistingMatchingCard(c33.tgfilter,tp,LOCATION_DECK,0,1,nil) end
  49.     Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
  50. end
  51.  
  52. function c33.tgop(e,tp,eg,ep,ev,re,r,rp)
  53.  
  54.     Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
  55.  
  56.     local g=Duel.SelectMatchingCard(tp,c33.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
  57.  
  58.     if g:GetCount()>0 then
  59.  
  60.         Duel.SendtoGrave(g,REASON_EFFECT)
  61.     end
  62. end
  63.  
  64. function c33.atk(e,c)
  65.  
  66.     return Duel.GetMatchingGroupCount(Card.IsCode,c:GetControler(),LOCATION_GRAVE,0,nil,33)*100
  67. end
  68.  
  69. function c33.dmtg(e,tp,eg,ep,ev,re,r,rp,chk)
  70.  
  71.     if chk==0 then return true end
  72.     local damage=Duel.GetMatchingGroupCount(Card.IsCode,tp,LOCATION_GRAVE,0,nil,33)*100
  73.     Duel.SetTargetPlayer(1-tp)
  74.     Duel.SetTargetParam(damage)
  75.     Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,damage)
  76. end
  77.  
  78. function c33.dmop(e,tp,eg,ep,ev,re,r,rp)
  79.  
  80.     local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
  81.     Duel.Damage(p,d,REASON_EFFECT)
  82. end
Advertisement
Add Comment
Please, Sign In to add comment