--Aircaster Killian --created by Alastar Rainford, coded by Lyris --New auxiliaries by XGlitchy30 local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() aux.AddSynchroMixProcedure(c,aux.Tuner(nil),nil,nil,aux.FilterBoolFunction(Card.IsRace,RACE_PSYCHIC),2,99) --atk/def local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetRange(LOCATION_MZONE) e1:SetValue(s.atkval) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_DEFENSE) c:RegisterEffect(e2) --excavate aux.AddAircasterExcavateEffect(c,3,EFFECT_TYPE_IGNITION,0) --spin local e3=Effect.CreateEffect(c) e3:Desc(1) e3:SetCategory(CATEGORY_REMOVE) e3:SetType(EFFECT_TYPE_SINGLE|EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetCode(EVENT_EQUIP) e3:HOPT(true,2) e3:SetCondition(s.con) e3:SetTarget(s.tdtg) e3:SetOperation(s.tdop) c:RegisterEffect(e3) --choose local e4=Effect.CreateEffect(c) e4:Desc(2) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetRange(LOCATION_MZONE) e4:OPT() e4:SetTarget(s.thtg) e4:SetOperation(s.thop) c:RegisterEffect(e4) end function s.atkval(e,c) return c:GetEquipCount()*500 end function s.con(e,tp,eg) return eg:IsExists(Card.IsPreviousLocation,1,nil,LOCATION_GRAVE) end function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsAbleToRemove() end if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) Duel.SetCardOperationInfo(g,CATEGORY_REMOVE) end function s.tdop(e,tp,eg,ep,ev,re,r,rp) local tg=Duel.GetFirstTarget() if tg:IsRelateToChain() then Duel.Remove(tg,POS_FACEUP,REASON_EFFECT) end end function s.thfilter(c) return c:IsType(TYPE_MONSTER) and c:IsSetCard(ARCHE_AIRCASTER) end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,3,nil) end end function s.thop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil) if #g>=3 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) local sg=g:Select(tp,3,3,nil) if #sg>0 then Duel.ConfirmCards(1-tp,sg) Duel.Hint(HINT_SELECTMSG,1-tp,aux.Stringid(id,3)) local tg=sg:Select(1-tp,1,1,nil) if #tg>0 then Duel.ShuffleDeck(tp) Duel.MoveSequence(tg:GetFirst(),0) Duel.ConfirmDecktop(tp,1) end end end end