--The Commander's March function c155275.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,155275+EFFECT_COUNT_CODE_OATH) e1:SetTarget(c155275.target) e1:SetOperation(c155275.activate) c:RegisterEffect(e1) end function c155275.filter(c) return c:IsSetCard(0x45) or c:IsCode(123365) or c:IsCode(123365) or c:IsCode(65338781) or c:IsCode(72318602) or c:IsCode(50215517) or c:IsCode(69313735) or c:IsCode(87614611) or c:IsCode(32919136) or c:IsCode(94585852) or c:IsCode(2542230) or c:IsCode(50584941) or c:IsCode(18634367) or c:IsCode(60433216) or c:IsCode(94463200) or c:IsCode(24566654) and c:IsAbleToHand() end function c155275.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c155275.filter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function c155275.cfilter(c) return c:IsFaceup() and c:IsCode(68371799) end function c155275.activate(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,c155275.filter,tp,LOCATION_DECK,0,1,1,nil) if g:GetCount()>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) local tc=g:GetFirst() if tc:IsType(TYPE_TRAP) or tc:IsType(TYPE_SPELL) and tc:CheckActivateEffect(false,false,false)~=nil and Duel.GetLocationCount(tp,LOCATION_SZONE) and Duel.IsExistingMatchingCard(c155275.cfilter,tp,LOCATION_ONFIELD,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(155275,1)) then local tpe=tc:GetType() local te=tc:GetActivateEffect() local tg=te:GetTarget() local co=te:GetCost() local op=te:GetOperation() e:SetCategory(te:GetCategory()) e:SetProperty(te:GetProperty()) Duel.ClearTargetCard() if bit.band(tpe,TYPE_FIELD)~=0 then local of=Duel.GetFieldCard(1-tp,LOCATION_SZONE,5) if of then Duel.Destroy(of,REASON_RULE) end of=Duel.GetFieldCard(tp,LOCATION_SZONE,5) if of and Duel.Destroy(of,REASON_RULE)==0 then Duel.SendtoGrave(tc,REASON_RULE) end end Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) Duel.Hint(HINT_CARD,0,tc:GetCode()) tc:CreateEffectRelation(te) if bit.band(tpe,TYPE_EQUIP+TYPE_CONTINUOUS+TYPE_FIELD)==0 then tc:CancelToGrave(false) end if co then co(te,tp,eg,ep,ev,re,r,rp,1) end if tg then tg(te,tp,eg,ep,ev,re,r,rp,1) end Duel.BreakEffect() local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) if g then local etc=g:GetFirst() while etc do etc:CreateEffectRelation(te) etc=g:GetNext() end end if op then op(te,tp,eg,ep,ev,re,r,rp) end tc:ReleaseEffectRelation(te) if etc then etc=g:GetFirst() while etc do etc:ReleaseEffectRelation(te) etc=g:GetNext() end end Duel.ShuffleHand(tp) end end end