--Paracyclis Domain local s,id=GetID() function s.initial_effect(c) --activate local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_ACTIVATE) e0:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e0) --atkup local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetRange(LOCATION_FZONE) e1:SetTargetRange(LOCATION_MZONE,0) e1:SetTarget(aux.TargetBoolFunction(Card.IsRace,RACE_INSECT)) e1:SetValue(s.val) c:RegisterEffect(e1) --direct attack local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_FZONE) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCondition(s.condition) e2:SetTarget(s.target) e2:SetOperation(s.operation) e2:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH) c:RegisterEffect(e2) --search local e3=Effect.CreateEffect(c) e3:Desc(2) e3:SetCategory(CATEGORIES_SEARCH) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetCode(EVENT_BATTLE_DAMAGE) e3:SetRange(LOCATION_FZONE) e3:SetCondition(s.descon) e3:SetTarget(s.destg) e3:SetOperation(s.desop) e3:SetCountLimit(1,id+100+EFFECT_COUNT_CODE_OATH) c:RegisterEffect(e3) end function s.val(e,c) return Duel.GetMatchingGroupCount(Card.IsPosition,e:GetHandlerPlayer(),0,LOCATION_MZONE,nil,POS_FACEDOWN_DEFENSE)*100 end function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.IsAbleToEnterBP() end function s.sfilter(c) return c:IsFaceup() and c:IsSetCard(0x308) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.sfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.sfilter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,s.sfilter,tp,LOCATION_MZONE,0,1,1,nil) end function s.operation(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 e1=Effect.CreateEffect(c) e1:Desc(1) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DIRECT_ATTACK) e1:SetCondition(s.dircon) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) tc:RegisterEffect(e1) end end function s.dircon(e) local tp=e:GetHandlerPlayer() return not Duel.IsExistingMatchingCard(aux.NOT(Card.IsPosition),tp,0,LOCATION_MZONE,1,nil,POS_FACEDOWN_DEFENSE) end function s.descon(e,tp,eg,ep,ev,re,r,rp) local tc=eg:GetFirst() return tc and tc:IsFaceup() and tc:IsControler(tp) and tc:IsLocation(LOCATION_MZONE) and tc:IsRace(RACE_INSECT) and Duel.IsExistingMatchingCard(Card.IsPosition,tp,0,LOCATION_MZONE,1,nil,POS_FACEDOWN_DEFENSE) end function s.filter(c) return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSetCard(0x308) and c:IsAbleToHand() end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.desop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil) if g:GetCount()>0 then Duel.Search(g,tp) end end