--灯火之魔女 local m=28327000 local cm=_G["c"..m] if not Yukino then Yukino=Yukino or {} ------ function Yukino.ShikiNoAkari(c) c:EnableReviveLimit() aux.AddCodeList(c,28327000) aux.EnableChangeCode(c,28327000,LOCATION_MZONE+LOCATION_HAND) end ------ end if cm then function cm.initial_effect(c) c:EnableReviveLimit() --search local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCountLimit(1,m) e1:SetCondition(cm.srcon) e1:SetTarget(cm.srtg) e1:SetOperation(cm.srop) c:RegisterEffect(e1) --atk up local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_ATKCHANGE) e3:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE) e3:SetCode(EVENT_PRE_DAMAGE_CALCULATE) e3:SetCountLimit(1,m+900) e3:SetCondition(cm.atkcon) e3:SetOperation(cm.atkop) c:RegisterEffect(e3) end function cm.srfilter(c) return c:IsRace(RACE_SPELLCASTER) and c:IsType(TYPE_RITUAL) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() end function cm.srcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL) end function cm.srtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(cm.srfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function cm.srop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,cm.srfilter,tp,LOCATION_DECK,0,1,1,nil) if g:GetCount()>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end function cm.atkfilter(c) return c:IsRace(RACE_SPELLCASTER) and c:IsType(TYPE_RITUAL) and c:IsType(TYPE_MONSTER) and c:IsFaceup() end function cm.atkcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local d=c:GetBattleTarget() local gc=Duel.GetMatchingGroupCount(cm.atkfilter,tp,LOCATION_MZONE,0,nil) return c==Duel.GetAttacker() and d and d:IsFaceup() and not d:IsControler(tp) and gc>0 end function cm.atkop(e,tp,eg,ep,ev,re,r,rp) local d=Duel.GetAttacker():GetBattleTarget() local gc=Duel.GetMatchingGroupCount(cm.atkfilter,tp,LOCATION_MZONE,0,nil) if d:IsRelateToBattle() and d:IsFaceup() then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE_CAL) e1:SetValue(-gc*1000) d:RegisterEffect(e1) end end ------ end