local cid,id=GetID() function cid.initial_effect(c) aux.AddOrigConjointType(c) -- aux.EnableConjointAttribute(c,1) c:EnableReviveLimit() aux.AddOrigEvoluteType(c) aux.AddEvoluteProc(c,nil,6,cid.filter1,cid.filter1,2,99) --discard deck & draw local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,1)) e1:SetCategory(CATEGORY_DECKDES+CATEGORY_ATKCHANGE) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) e1:SetCost(cid.drcost) e1:SetTarget(cid.distg) e1:SetOperation(cid.drop) c:RegisterEffect(e1) --damage local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_DAMAGE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetCode(EVENT_BATTLE_DESTROYING) e2:SetCondition(cid.damcon) e2:SetTarget(cid.damtg) e2:SetOperation(cid.damop) c:RegisterEffect(e2) end function cid.filter1(c,ec,tp) return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsType(TYPE_EFFECT) end function cid.drcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsCanRemoveEC(tp,3,REASON_COST) end e:GetHandler():RemoveEC(tp,3,REASON_COST) end function cid.distg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,3) end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(3) Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,3) end function cid.cfilter(c) return c:IsRace(RACE_PLANT) and c:IsLocation(LOCATION_GRAVE) end function cid.drop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.DiscardDeck(p,d,REASON_EFFECT) local g=Duel.GetOperatedGroup() local ct=g:FilterCount(cid.cfilter,nil) if ct>0 then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e1:SetValue(ct*500) c:RegisterEffect(e1) end end function cid.damcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local bc=c:GetBattleTarget() return c:IsRelateToBattle() and bc:IsType(TYPE_MONSTER) end function cid.damtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local bc=e:GetHandler():GetBattleTarget() Duel.SetTargetCard(bc) local dam=bc:GetBaseAttack() if dam<0 then dam=0 end Duel.SetTargetPlayer(1-tp) Duel.SetTargetParam(dam) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam) end function cid.damop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) local dam=tc:GetBaseAttack() if dam<0 then dam=0 end Duel.Damage(p,dam,REASON_EFFECT) end end