--Seatector Fortress --Keddy was here~ local cod,id=GetID() function cod.initial_effect(c) --Synchro Summon c:EnableReviveLimit() aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_WATER),aux.NonTuner(Card.IsSetCard,0x33F),1) --Equip local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCountLimit(1,id) e1:SetCondition(cod.thcon) e1:SetTarget(cod.thtg) e1:SetOperation(cod.thop) c:RegisterEffect(e1) --Negate local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_CHAINING) e2:SetCountLimit(1) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e2:SetRange(LOCATION_MZONE) e2:SetCondition(cod.discon) e2:SetCost(cod.discost) e2:SetTarget(cod.distg) e2:SetOperation(cod.disop) c:RegisterEffect(e2) --Special Summon local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_EQUIP) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e3:SetCode(EVENT_LEAVE_FIELD) e3:SetCondition(cod.thcon) e3:SetTarget(cod.sptg) e3:SetOperation(cod.spop) c:RegisterEffect(e3) end --Add to hand function cod.thcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO) end function cod.tfilter(c) return c:IsSetCard(0x33F) and c:IsType(TYPE_MONSTER) end function cod.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_DECK+LOCATION_GRAVE) and chkc:IsControler(tp) and cod.tfilter(chkc) end if chk==0 then return Duel.IsExistingMatchingCard(cod.tfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE) end function cod.thop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,cod.tfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,2,nil) if g:GetCount()>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end --Negate function cod.discon(e,tp,eg,ep,ev,re,r,rp) return re:GetHandler()~=e:GetHandler() and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE)) and Duel.IsChainNegatable(ev) end function cod.ecfilter(c,tc) return c:IsFaceup() and c:IsSetCard(0x33F) and c:GetEquipTarget()==tc end function cod.discost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():GetEquipGroup():FilterCount(cod.ecfilter,nil,e:GetHandler())>0 end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=e:GetHandler():GetEquipGroup():FilterSelect(tp,cod.ecfilter,1,1,nil,e:GetHandler()) Duel.Destroy(g,REASON_COST) end function cod.distg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0) end end function cod.disop(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then Duel.Destroy(eg,REASON_EFFECT) end end --Special Summon function cod.spfilter(c,e,tp) return c:IsSetCard(0x33F) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c~=e:GetHandler() and c:IsType(TYPE_MONSTER) end function cod.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cod.spfilter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(cod.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,aux.NecroValleyFilter(cod.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,tp,LOCATION_GRAVE) end function cod.ecfilter2(c,tp,tc) return c:IsSetCard(0x33F) and c:IsType(TYPE_MONSTER) and aux.CheckUnionEquip(c,tc) and c:CheckUnionTarget(tc) and c:CheckUniqueOnField(tp) and not c:IsForbidden() end function cod.spop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)==0 then return end local eg=Duel.GetMatchingGroup(cod.ecfilter2,tp,LOCATION_HAND,0,nil,tc) if Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and eg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(83013180,3)) then local sg=Duel.SelectMatchingCard(tp,cod.ecfilter2,tp,LOCATION_HAND,0,1,1,nil,tp,tc) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) local ec=sg:GetFirst() if ec and Duel.Equip(tp,ec,tc) then aux.SetUnionState(ec) end end end