--Runefall Berserker local cid,id=GetID() function cid.initial_effect(c) --link summon c:EnableReviveLimit() aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x522),2,2) --pierce local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_PIERCE) e1:SetRange(LOCATION_MZONE) e1:SetTargetRange(LOCATION_MZONE,0) e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x522)) e1:SetValue(1) c:RegisterEffect(e1) --sset local e4=Effect.CreateEffect(c) e4:SetCategory(CATEGORY_SPECIAL_SUMMON) e4:SetDescription(aux.Stringid(id,1)) e4:SetType(EFFECT_TYPE_QUICK_O) e4:SetCode(EVENT_FREE_CHAIN) e4:SetRange(LOCATION_MZONE) e4:SetCountLimit(1,id+100) e4:SetHintTiming(0,TIMING_BATTLE_START+TIMING_END_PHASE) e4:SetTarget(cid.settg) e4:SetOperation(cid.setop) c:RegisterEffect(e4) end function cid.tdcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) end function cid.tdtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil) end local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,nil) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0) end function cid.tdop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,1,nil) if g:GetCount()>0 then Duel.HintSelection(g) Duel.SendtoDeck(g,nil,2,REASON_EFFECT) end end function cid.spfilter(c,e,tp) return c:IsSetCard(0x522) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function cid.settg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(cid.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE) end function cid.setop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) local tc=e:GetHandler() if tc and tc:IsRelateToEffect(e) then local typ=tc:GetOriginalType() if aux.PandSSetCon(tc,tp) then local e1=Effect.CreateEffect(tc) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_MONSTER_SSET) e1:SetValue(TYPE_TRAP) tc:RegisterEffect(e1,true) Duel.SSet(tp,tc) e1:Reset() tc:SetCardData(CARDDATA_TYPE,TYPE_TRAP) --reset trap status local e2=Effect.CreateEffect(tc) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_ADJUST) e2:SetRange(LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_HAND+LOCATION_EXTRA+LOCATION_OVERLAY+LOCATION_MZONE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE) e2:SetLabelObject(e4) e2:SetOperation(function(ef) local c=ef:GetHandler() if c:GetOriginalType()==TYPE_TRAP then c:AddMonsterAttribute(typ) c:SetCardData(CARDDATA_TYPE,typ) if c:IsSummonType(SUMMON_TYPE_LINK) then c:CompleteProcedure() end ef:Reset() end end) tc:RegisterEffect(e2) local e3=e2:Clone() e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e3:SetRange(0) e3:SetCode(EVENT_LEAVE_FIELD) tc:RegisterEffect(e3) --Icarus Attack local e3=Effect.CreateEffect(tc) e3:SetCategory(CATEGORY_REMOVE) e3:SetType(EFFECT_TYPE_ACTIVATE) e3:SetCode(EVENT_FREE_CHAIN) e3:SetCondition(function(ef) return ef:GetHandler():GetFlagEffect(id)>0 end) e3:SetCost(cid.actcost) e3:SetTarget(cid.acttg) e3:SetOperation(cid.act) tc:RegisterEffect(e3,true) end end if not tc:IsLocation(LOCATION_SZONE) then return end tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE,1) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,cid.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp) if #g>0 then Duel.BreakEffect() Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end --Icarus Attack function cid.costfilter(c) return c:IsSetCard(0x522) end function cid.actcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckReleaseGroup(tp,cid.costfilter,1,nil) end local g=Duel.SelectReleaseGroup(tp,cid.costfilter,1,1,nil) Duel.Release(g,REASON_COST) end function cid.acttg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,0,0) end function cid.act(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) if g:GetCount()>0 then Duel.HintSelection(g) Duel.Remove(g,POS_FACEUP,REASON_EFFECT) end end