--HDD Neptune --coded by Concordia function c68709367.initial_effect(c) --fusion material c:EnableReviveLimit() aux.AddFusionProcCodeFun(c,68709329,aux.FilterBoolFunction(Card.IsFusionSetCard,0xf08),1,true,true) aux.AddContactFusionProcedure(c,c68709367.cfilter,LOCATION_ONFIELD,0,aux.tdcfop(c)) --spsummon condition local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetCode(EFFECT_SPSUMMON_CONDITION) e1:SetValue(c68709367.splimit) c:RegisterEffect(e1) --recover local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(40975574,1)) e3:SetCategory(CATEGORY_RECOVER) e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetCountLimit(1,68709367) e3:SetTarget(c68709367.rectg) e3:SetOperation(c68709367.recop) c:RegisterEffect(e3) --special summon local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(58820853,0)) e4:SetCategory(CATEGORY_SPECIAL_SUMMON) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetCode(EVENT_BATTLE_DESTROYING) e4:SetCountLimit(1,68719367) e4:SetCondition(aux.bdogcon) e4:SetTarget(c68709367.target) e4:SetOperation(c68709367.operation) c:RegisterEffect(e4) --on leaving field SS 2 Arc. M local e5=Effect.CreateEffect(c) e5:SetDescription(aux.Stringid(68709367,3)) e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e5:SetCountLimit(1,68729367) e5:SetCategory(CATEGORY_SPECIAL_SUMMON) e5:SetCode(EVENT_BE_MATERIAL) e5:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) e5:SetCost(c68709367.sp2cost) e5:SetCondition(c68709367.sp2con) e5:SetTarget(c68709367.sp2tg) e5:SetOperation(c68709367.sp2op) c:RegisterEffect(e5) Duel.AddCustomActivityCounter(68709367,ACTIVITY_SPSUMMON,c68709367.counterfilter) end function c68709367.splimit(e,se,sp,st) return e:GetHandler():GetLocation()~=LOCATION_EXTRA end function c68709367.cfilter(c) return (c:IsFusionCode(68709329) or c:IsFusionSetCard(0xf08) and c:IsType(TYPE_MONSTER)) and c:IsAbleToDeckOrExtraAsCost() end function c68709367.filter(c) return c:IsFaceup() and c:GetAttack()>0 end function c68709367.rectg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and c68709367.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(c68709367.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) local g=Duel.SelectTarget(tp,c68709367.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,g:GetFirst():GetAttack()/2) end function c68709367.recop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:GetAttack()>0 then Duel.Recover(tp,tc:GetBaseAttack()/2,REASON_EFFECT) end end function c68709367.sfilter(c,e,tp) return c:IsSetCard(0xf08) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c68709367.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c68709367.sfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function c68709367.operation(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end local c=e:GetHandler() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,c68709367.sfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) local tc=g:GetFirst() if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)>0 then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESET_EVENT+0x1fe0000) tc:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetReset(RESET_EVENT+0x1fe0000) tc:RegisterEffect(e2) end end -- on leaving field SS 2 Arc. M function c68709367.counterfilter(c) return c:GetSummonLocation()~=LOCATION_EXTRA or c:IsSetCard(0xf09) end function c68709367.sp2cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetCustomActivityCount(68709367,tp,ACTIVITY_SPSUMMON)==0 end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) e1:SetTargetRange(1,0) e1:SetTarget(c68709367.sp2limit) e1:SetReset(RESET_PHASE+PHASE_END) Duel.RegisterEffect(e1,tp) end function c68709367.sp2con(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsLocation(LOCATION_GRAVE) and r==REASON_LINK and c:GetReasonCard():IsSetCard(0xf09) end function c68709367.filter1(c,e,tp) return c:IsSetCard(0xf08) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c68709367.filter2(c,g) return g:IsExists(c68709367.filter3,1,c,c:GetCode()) end function c68709367.filter3(c,code) return not c:IsCode(code) end function c68709367.sp2tg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then if Duel.IsPlayerAffectedByEffect(tp,59822133) then return false end if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return false end local g=Duel.GetMatchingGroup(c68709367.filter1,tp,LOCATION_DECK,0,nil,e,tp) return g:IsExists(c68709367.filter2,1,nil,g) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK) end function c68709367.sp2op(e,tp,eg,ep,ev,re,r,rp) if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end local g=Duel.GetMatchingGroup(c68709367.filter1,tp,LOCATION_DECK,0,nil,e,tp) local dg=g:Filter(c68709367.filter2,nil,g) if dg:GetCount()>=1 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=dg:Select(tp,1,1,nil) local tc1=sg:GetFirst() dg:Remove(Card.IsCode,nil,tc1:GetCode()) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local tc2=dg:Select(tp,1,1,nil):GetFirst() Duel.SpecialSummonStep(tc1,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummonStep(tc2,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummonComplete() local g=Group.FromCards(tc1,tc2) Duel.ConfirmCards(1-tp,g) end end function c68709367.sp2limit(e,c,sump,sumtype,sumpos,targetp) return c:IsLocation(LOCATION_EXTRA) and not c:IsSetCard(0xf09) end