Commit d920c4f9 authored by oilloillo's avatar oilloillo

fix eff2 not include changePos & SpSummon with faceDown

parent 75589ab8
--遮雨荷✿濑笈叶 --遮雨荷✿濑笈叶
local M = c999018 local M = c999018
local Mid = 999018 local Mid = 999018
function M.initial_effect(c) function M.initial_effect(c)
-- fusion material -- fusion material
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddFusionProcFun2(c, aux.FilterBoolFunction(Card.IsFusionSetCard, 0xaa6), aux.FilterBoolFunction(Card.IsFusionSetCard, 0x229), true) aux.AddFusionProcFun2(c, aux.FilterBoolFunction(Card.IsFusionSetCard, 0xaa6), aux.FilterBoolFunction(Card.IsFusionSetCard, 0x229), true)
M.addEff1(c) M.addEff1(c)
M.addEff2(c) M.addEff2(c)
M.addCommonEff(c) M.addCommonEff(c)
end end
M.hana_mat={
aux.FilterBoolFunction(Card.IsFusionSetCard,0xaa6), function M.addEff1(c)
aux.FilterBoolFunction(Card.IsFusionSetCard,0x229), function filter(c, tp)
} return c:IsPreviousLocation(LOCATION_HAND) and c:IsType(TYPE_MONSTER) and c:GetPreviousControler() == tp
function M.addEff1(c) end
function filter(c, tp)
return c:IsPreviousLocation(LOCATION_HAND) and c:IsType(TYPE_MONSTER) and c:GetPreviousControler() == tp local function cond(e,tp,eg,ep,ev,re,r,rp)
end return eg:IsExists(filter, 1, nil, tp)
end
local function cond(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(filter, 1, nil, tp) local function target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end if chk == 0 then return e:GetHandler():GetFlagEffect(Mid) < 1 and Duel.IsPlayerCanDraw(tp, 1) end
Duel.SetOperationInfo(0, CATEGORY_DRAW, nil, 1, 0, 0)
local function target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) c:RegisterFlagEffect(Mid, RESET_EVENT+0x1fe0000, 0, 1)
if chk == 0 then return e:GetHandler():GetFlagEffect(Mid) < 1 and Duel.IsPlayerCanDraw(tp, 1) end end
Duel.SetOperationInfo(0, CATEGORY_DRAW, nil, 1, 0, 0)
c:RegisterFlagEffect(Mid, RESET_EVENT+0x1fe0000, 0, 1) local function operation(e,tp,eg,ep,ev,re,r,rp)
end Duel.Draw(tp, 1, REASON_EFFECT)
if bit.band(r, REASON_FUSION) == REASON_FUSION then
local function operation(e,tp,eg,ep,ev,re,r,rp) Duel.Draw(tp, 1, REASON_EFFECT)
Duel.Draw(tp, 1, REASON_EFFECT) end
if bit.band(r, REASON_FUSION) == REASON_FUSION then end
Duel.Draw(tp, 1, REASON_EFFECT)
end local e2 = Effect.CreateEffect(c)
end e2:SetDescription(aux.Stringid(Mid, 0))
e2:SetCategory(CATEGORY_DRAW)
local e2 = Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetDescription(aux.Stringid(Mid, 0)) e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCategory(CATEGORY_DRAW) e2:SetCode(EVENT_TO_GRAVE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCountLimit(1, Mid*10+1)
e2:SetCode(EVENT_TO_GRAVE) e2:SetCondition(cond)
e2:SetRange(LOCATION_MZONE) e2:SetTarget(target)
e2:SetCountLimit(1, Mid*10+1) e2:SetOperation(operation)
e2:SetCondition(cond) c:RegisterEffect(e2)
e2:SetTarget(target) local e3 = e2:Clone()
e2:SetOperation(operation) e3:SetCode(EVENT_REMOVE)
c:RegisterEffect(e2) c:RegisterEffect(e3)
local e3 = e2:Clone() local e4 = e2:Clone()
e3:SetCode(EVENT_REMOVE) e4:SetCode(EVENT_TO_DECK)
c:RegisterEffect(e3) c:RegisterEffect(e4)
local e4 = e2:Clone() end
e4:SetCode(EVENT_TO_DECK)
c:RegisterEffect(e4) function M.addEff2(c)
end local function tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c = e:GetHandler()
function M.addEff2(c) if chk == 0 then return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0
local function tg(e,tp,eg,ep,ev,re,r,rp,chk) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
local c = e:GetHandler() and c:IsLocation(LOCATION_GRAVE)
if chk == 0 then return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 end
and c:IsCanBeSpecialSummoned(e, 0, tp, false, false) Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, c, 1, 0, 0)
and c:IsLocation(LOCATION_GRAVE) end
end
Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, c, 1, 0, 0) local function op(e,tp,eg,ep,ev,re,r,rp)
end local c = e:GetHandler()
if c:IsRelateToEffect(e) and c:IsLocation(LOCATION_GRAVE) then
local function op(e,tp,eg,ep,ev,re,r,rp) if Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP) > 0 then
local c = e:GetHandler() local e1 = Effect.CreateEffect(c)
if c:IsRelateToEffect(e) and c:IsLocation(LOCATION_GRAVE) then e1:SetType(EFFECT_TYPE_SINGLE)
if Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP) > 0 then e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
local e1 = Effect.CreateEffect(c) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e1:SetValue(LOCATION_DECKSHF)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) c:RegisterEffect(e1, true)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT) end
e1:SetValue(LOCATION_DECKSHF) end
c:RegisterEffect(e1, true) end
end
end local e2 = Effect.CreateEffect(c)
end e2:SetDescription(aux.Stringid(Mid, 1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
local e2 = Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetDescription(aux.Stringid(Mid, 1)) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetCode(EVENT_MSET)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e2:SetCountLimit(1, Mid * 10 + 2)
e2:SetCode(EVENT_MSET) e2:SetTarget(tg)
e2:SetRange(LOCATION_GRAVE) e2:SetOperation(op)
e2:SetCountLimit(1, Mid * 10 + 2) c:RegisterEffect(e2)
e2:SetTarget(tg)
e2:SetOperation(op)
c:RegisterEffect(e2) local function tg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end if chk == 0 then
local sg = eg:Filter(Card.IsPosition, nil, POS_FACEDOWN_DEFENSE)
function M.addCommonEff(c) return sg:GetCount() > 0
local function thfilter(c) end
return c:IsAbleToHand() and (c:IsSetCard(0x229) or c:GetCode() == 24235) Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, c, 1, 0, 0)
end end
local e32 = e2:Clone()
local function thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) e32:SetTarget(tg2)
if chk == 0 then return Duel.IsExistingMatchingCard(thfilter, tp, LOCATION_GRAVE+LOCATION_DECK, 0, 1, nil) end e32:SetCode(EVENT_SPSUMMON_SUCCESS)
Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 1, 0, 0) c:RegisterEffect(e32)
end
local e22 = e32:Clone()
local function thop(e,tp,eg,ep,ev,re,r,rp) e22:SetCode(EVENT_CHANGE_POS)
if not Duel.IsExistingMatchingCard(thfilter, tp, LOCATION_GRAVE+LOCATION_DECK, 0, 1, nil) then return end c:RegisterEffect(e22)
local g = Duel.SelectMatchingCard(tp, thfilter, tp, LOCATION_GRAVE+LOCATION_DECK, 0, 1, 1, nil) end
if g:GetCount() > 0 then
Duel.SendtoHand(g, nil, REASON_EFFECT) function M.addCommonEff(c)
Duel.ConfirmCards(1-tp, g) local function thfilter(c)
end return c:IsAbleToHand() and (c:IsSetCard(0x229) or c:GetCode() == 24235)
end end
local function thcon(e,tp,eg,ep,ev,re,r,rp) local function thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
return e:GetHandler():IsPreviousPosition(POS_FACEUP) and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) if chk == 0 then return Duel.IsExistingMatchingCard(thfilter, tp, LOCATION_GRAVE+LOCATION_DECK, 0, 1, nil) end
end Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 1, 0, 0)
end
local function repop(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler() local function thop(e,tp,eg,ep,ev,re,r,rp)
local e1 = Effect.CreateEffect(c) if not Duel.IsExistingMatchingCard(thfilter, tp, LOCATION_GRAVE+LOCATION_DECK, 0, 1, nil) then return end
e1:SetDescription(aux.Stringid(Mid, 2)) local g = Duel.SelectMatchingCard(tp, thfilter, tp, LOCATION_GRAVE+LOCATION_DECK, 0, 1, 1, nil)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) if g:GetCount() > 0 then
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) Duel.SendtoHand(g, nil, REASON_EFFECT)
e1:SetCode(EVENT_PHASE+PHASE_END) Duel.ConfirmCards(1-tp, g)
e1:SetCountLimit(1) end
e1:SetTarget(thtg) end
e1:SetOperation(thop)
e1:SetReset(RESET_PHASE+PHASE_END) local function thcon(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e1, tp) return e:GetHandler():IsPreviousPosition(POS_FACEUP) and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end end
local e2 = Effect.CreateEffect(c) local function repop(e,tp,eg,ep,ev,re,r,rp)
e2:SetCategory(CATEGORY_TODECK) local c = e:GetHandler()
e2:SetDescription(aux.Stringid(Mid, 2)) local e1 = Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetDescription(aux.Stringid(Mid, 2))
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetCode(EVENT_TO_GRAVE) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCountLimit(1, Mid*10+3) e1:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCondition(thcon) e1:SetCountLimit(1)
e2:SetOperation(repop) e1:SetTarget(thtg)
c:RegisterEffect(e2) e1:SetOperation(thop)
local e3 = e2:Clone() e1:SetReset(RESET_PHASE+PHASE_END)
e3:SetCode(EVENT_REMOVE) Duel.RegisterEffect(e1, tp)
c:RegisterEffect(e3) end
local e4 = e2:Clone()
e4:SetCode(EVENT_TO_DECK) local e2 = Effect.CreateEffect(c)
c:RegisterEffect(e4) e2:SetCategory(CATEGORY_TODECK)
e2:SetDescription(aux.Stringid(Mid, 2))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1, Mid*10+3)
e2:SetCondition(thcon)
e2:SetOperation(repop)
c:RegisterEffect(e2)
local e3 = e2:Clone()
e3:SetCode(EVENT_REMOVE)
c:RegisterEffect(e3)
local e4 = e2:Clone()
e4:SetCode(EVENT_TO_DECK)
c:RegisterEffect(e4)
end end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment