--Woodland Mother local m=79854537 local cm=_G["c"..m] function cm.initial_effect(c) aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_PLANT),aux.NonTuner(nil),1) c:EnableReviveLimit() local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCondition(cm.mtcon) e2:SetOperation(cm.mtop) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_MATERIAL_CHECK) e3:SetValue(cm.valcheck) e3:SetLabelObject(e2) c:RegisterEffect(e3) local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(m,1)) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetCondition(function(e) return e:GetHandler():GetFlagEffect(m)>0 end) e2:SetTarget(cm.atktg) e2:SetOperation(cm.atkop) c:RegisterEffect(e2) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_DESTROY_REPLACE) e1:SetRange(LOCATION_MZONE) e1:SetTarget(cm.desreptg) e1:SetValue(cm.desrepval) e1:SetOperation(cm.desrepop) c:RegisterEffect(e1) end function cm.mfilter(c) return c:GetEquipGroup():GetCount()>0 end function cm.valcheck(e,c) local g=c:GetMaterial() local ct=g:FilterCount(cm.mfilter,nil) e:GetLabelObject():SetLabel(ct) end function cm.mtcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO) and e:GetLabel()>0 end function cm.mtop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() c:RegisterFlagEffect(m,RESET_EVENT+0x1fe0000,0,1) end function cm.eqfilter(c,ec) return c:IsType(TYPE_EQUIP) and c:CheckEquipTarget(ec) end function cm.atktg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsType(TYPE_TUNER) and Duel.IsExistingMatchingCard(cm.eqfilter,tp,LOCATION_GRAVE,0,1,nil,c) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end end function cm.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) or c:IsFacedown() or c:IsControler(1-tp) or c:IsImmuneToEffect(e) or not cm.atktg(e,tp,eg,ep,ev,re,r,rp,0) then return end local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_COPY_INHERIT) e1:SetCode(EFFECT_REMOVE_TYPE) e1:SetValue(TYPE_TUNER) e1:SetReset(RESET_EVENT+0x1ff0000) c:RegisterEffect(e1) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) local ft=Duel.GetLocationCount(tp,LOCATION_SZONE) local g=Duel.SelectMatchingCard(tp,cm.eqfilter,tp,LOCATION_GRAVE,0,1,ft,nil,c) for tc in aux.Next(g) do Duel.Equip(tp,tc,c,true,true) end Duel.EquipComplete() end function cm.repfilter(c,tp) return c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and c:IsRace(RACE_PLANT) and c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE) end function cm.desfilter(c,e,tp) return c:IsAbleToGraveAsCost() and not c:IsStatus(STATUS_DESTROY_CONFIRMED+STATUS_BATTLE_DESTROYED) end function cm.desreptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() local g=c:GetEquipGroup() if chk==0 then return eg:IsExists(cm.repfilter,1,nil,tp) and g:IsExists(cm.desfilter,1,nil,e,tp) and Duel.IsExistingMatchingCard(function(c) return c:IsFaceup() and c:IsAttackAbove(1) end,tp,0,LOCATION_MZONE,1,nil) end if Duel.SelectEffectYesNo(tp,c,96) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE) local sg=g:FilterSelect(tp,cm.desfilter,1,1,nil,e,tp) e:SetLabelObject(sg:GetFirst()) return true else return false end end function cm.desrepval(e,c) return cm.repfilter(c,e:GetHandlerPlayer()) end function cm.desrepop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_CARD,1-tp,m) local tc=e:GetLabelObject() Duel.SendtoGrave(tc,REASON_EFFECT+REASON_REPLACE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPPO) local g=Duel.SelectMatchingCard(tp,function(c) return c:IsFaceup() and c:IsAttackAbove(1) end,tp,0,LOCATION_MZONE,1,1,nil) Duel.HintSelection(g) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SET_ATTACK_FINAL) e1:SetValue(0) e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END) g:GetFirst():RegisterEffect(e1) end