Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Undead Flames
- function c33.initial_effect(c)
- --send to grave
- local e1=Effect.CreateEffect(c)
- e1:SetCategory(CATEGORY_TOGRAVE)
- e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
- e1:SetCode(EVENT_SUMMON_SUCCESS)
- e1:SetTarget(c33.tgtg)
- e1:SetOperation(c33.tgop)
- c:RegisterEffect(e1)
- --damage
- local e2=Effect.CreateEffect(c)
- e2:SetCategory(CATEGORY_DAMAGE)
- e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
- e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
- e2:SetCode(EVENT_TO_GRAVE)
- e2:SetTarget(c33.dmtg)
- e2:SetOperation(c33.dmop)
- c:RegisterEffect(e2)
- --atk
- local e3=Effect.CreateEffect(c)
- e3:SetType(EFFECT_TYPE_SINGLE)
- e3:SetCode(EFFECT_SET_ATTACK)
- e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
- e3:SetRange(LOCATION_MZONE)
- e3:SetValue(c33.atk)
- c:RegisterEffect(e3)
- --other conditions for send to grave
- local e4=e1:Clone()
- e4:SetCode(EVENT_SPSUMMON_SUCCESS)
- c:RegisterEffect(e4)
- local e5=e1:Clone()
- e5:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
- c:RegisterEffect(e5)
- end
- function c33.tgfilter(c)
- return c:IsCode(33) and c:IsAbleToGrave()
- end
- function c33.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
- if chk==0 then return Duel.IsExistingMatchingCard(c33.tgfilter,tp,LOCATION_DECK,0,1,nil) end
- Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
- end
- function c33.tgop(e,tp,eg,ep,ev,re,r,rp)
- Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
- local g=Duel.SelectMatchingCard(tp,c33.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
- if g:GetCount()>0 then
- Duel.SendtoGrave(g,REASON_EFFECT)
- end
- end
- function c33.atk(e,c)
- return Duel.GetMatchingGroupCount(Card.IsCode,c:GetControler(),LOCATION_GRAVE,0,nil,33)*100
- end
- function c33.dmtg(e,tp,eg,ep,ev,re,r,rp,chk)
- if chk==0 then return true end
- local damage=Duel.GetMatchingGroupCount(Card.IsCode,tp,LOCATION_GRAVE,0,nil,33)*100
- Duel.SetTargetPlayer(1-tp)
- Duel.SetTargetParam(damage)
- Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,damage)
- end
- function c33.dmop(e,tp,eg,ep,ev,re,r,rp)
- local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
- Duel.Damage(p,d,REASON_EFFECT)
- end
Advertisement
Add Comment
Please, Sign In to add comment