--created by Jake, coded by Lyris --Steinitz's Tactics local s,id,o=GetID() function s.initial_effect(c) local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_ACTIVATE) e0:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e0) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_SZONE) e1:HOPT() e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetDescription(1068) e1:SetCategory(CATEGORY_EQUIP) e1:SetTarget(s.eqtg) e1:SetOperation(s.eqop) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetDescription(1152) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_BE_BATTLE_TARGET) e3:SetRange(LOCATION_SZONE) e3:HOPT() e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetCondition(s.zonecon) e3:SetTarget(s.zonetg) e3:SetOperation(s.zoneop) c:RegisterEffect(e3) local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e4:SetCode(EVENT_PHASE+PHASE_END) e4:SetRange(LOCATION_GRAVE) e4:HOPT() e4:SetCategory(CATEGORY_TODECK) e4:SetTarget(s.tdtg) e4:SetOperation(s.tdop) c:RegisterEffect(e4) end function s.eqtarget(c) return c:IsFaceup() and c:IsSetCard(0x63d0) end function s.eqcard(c,tp) return c:IsSetCard(0x63d0) and c:CheckUniqueOnField(tp) and c:IsType(TYPE_MONSTER) and not c:IsForbidden() end function s.sptarget(c,e,tp) return c:IsSetCard(0x63d0) and c:GetEquipTarget() and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.eqlimit(e,c) return c==e:GetLabelObject() end function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local c=e:GetHandler() if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.eqtarget(chkc) end if chk==0 then return Duel.IsExistingTarget(s.eqtarget,tp,LOCATION_MZONE,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(s.eqcard,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,s.eqtarget,tp,LOCATION_MZONE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE) end function s.eqop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_SZONE)<1 then return end local c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc:IsFacedown() or not tc:IsRelateToEffect(e) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) local ec=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.eqcard),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,tp):GetFirst() if ec then Duel.Equip(tp,ec,tc) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_EQUIP_LIMIT) e1:SetReset(RESET_EVENT+0x1fe0000) e1:SetValue(s.eqlimit) e1:SetLabelObject(tc) ec:RegisterEffect(e1) end end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_SZONE) and s.sptarget(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.sptarget,tp,LOCATION_SZONE,LOCATION_SZONE,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,Duel.SelectTarget(tp,s.sptarget,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,nil,e,tp),1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end function s.zonecon(e,tp,eg) local tc=eg:GetFirst() return tc:IsFaceup() and tc:IsSetCard(0x63d0) and tc:IsControler(tp) end function s.zonetg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsSetCard(0x63d0) end if chk==0 then return Duel.IsExistingTarget(Card.IsSetCard,tp,LOCATION_MZONE,0,1,nil,0x63d0) and Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_CONTROL)>0 end Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(88392300,0)) Duel.SelectTarget(tp,Card.IsSetCard,tp,LOCATION_MZONE,0,1,1,nil,0x63d0) end function s.zoneop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if not tc:IsRelateToEffect(e) or tc:IsFacedown() or tc:IsControler(1-tp) or Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE) Duel.MoveSequence(tc,math.log(Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,0),2)) end function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsAbleToDeck() and Duel.GetFlagEffect(tp,25386884)<1 end Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,0,0) end function s.tdop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToChain() or Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)<1 or not c:IsLocation(LOCATION_DECK) then return end local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_TO_HAND) e1:SetTargetRange(LOCATION_MZONE,0) e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x63d0)) e1:SetReset(RESET_PHASE+PHASE_END) Duel.RegisterEffect(e1,tp) Duel.RegisterFlagEffect(tp,25386884,RESET_PHASE+PHASE_END,0,1) end