--Paracyclis Skirmisher, Twilight Madness local s,id=GetID() function s.initial_effect(c) --spsummon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_HANDES) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EVENT_TO_GRAVE) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) e1:SetCountLimit(1,id) c:RegisterEffect(e1) --atkup local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_ATKCHANGE) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_GRAVE) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCost(aux.bfgcost) e2:SetTarget(s.atktg) e2:SetOperation(s.atkop) e2:SetCountLimit(1,id+100) c:RegisterEffect(e2) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsReason(REASON_EFFECT) and re and re:GetHandler():IsSetCard(0x308) and Duel.IsExistingMatchingCard(Card.IsPosition,tp,0,LOCATION_MZONE,2,nil,POS_FACEDOWN_DEFENSE) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(tp) Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,PLAYER_ALL,1) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) local g=Duel.GetFieldGroup(p,0,LOCATION_HAND) if #g<=0 then return end local ct=Duel.GetMatchingGroupCount(Card.IsPosition,p,0,LOCATION_MZONE,nil,POS_FACEDOWN_DEFENSE) if ct<=0 then return end local n=math.min(#g,ct) local tg=g:RandomSelect(p,n) Duel.ConfirmCards(p,tg) Duel.Hint(HINT_SELECTMSG,p,HINTMSG_DISCARD) local sg=tg:FilterSelect(p,Card.IsDiscardable,1,1,nil,REASON_EFFECT) if #sg>0 then Duel.SendtoGrave(sg,REASON_EFFECT+REASON_DISCARD) end Duel.ShuffleHand(1-p) end function s.filter(c) return c:IsFaceup() and c:IsRace(RACE_INSECT) end function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(Card.IsPosition,tp,0,LOCATION_MZONE,1,nil,POS_FACEDOWN_DEFENSE) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil) local ct=Duel.GetMatchingGroupCount(Card.IsPosition,tp,0,LOCATION_MZONE,nil,POS_FACEDOWN_DEFENSE) Duel.SetCustomOperationInfo(0,CATEGORY_ATKCHANGE,g,#g,tp,LOCATION_MZONE,ct*300) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToChain() and tc:IsFaceup() then local ct=Duel.GetMatchingGroupCount(Card.IsPosition,tp,0,LOCATION_MZONE,nil,POS_FACEDOWN_DEFENSE) if ct>0 then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e1:SetValue(300*ct) tc:RegisterEffect(e1) end if not Duel.IsExistingMatchingCard(aux.NOT(Card.IsPosition),tp,0,LOCATION_MZONE,1,nil,POS_FACEDOWN_DEFENSE) then local e1=Effect.CreateEffect(c) e1:Desc(2) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DIRECT_ATTACK) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) tc:RegisterEffect(e1) end end end