Commit b7c18f4a authored by POLYMER's avatar POLYMER

fix

parent a36aecf6
-- 后悔 -- 后悔
local s,id,o=GetID() local s,id=GetID()
function s.initial_effect(c) function s.initial_effect(c)
local e0=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE) e1:SetDescription(aux.Stringid(id,0))
e0:SetCode(EFFECT_CANNOT_INACTIVATE) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e0:SetValue(1) e1:SetType(EFFECT_TYPE_ACTIVATE)
c:RegisterEffect(e0) e1:SetCode(EVENT_FREE_CHAIN)
local e1=e0:Clone() e1:SetProperty(EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CAN_FORBIDDEN)
e1:SetCode(EFFECT_CANNOT_DISEFFECT) e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0)) e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_ACTIVATE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_TO_GRAVE)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c) e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CAN_FORBIDDEN)
e3:SetDescription(aux.Stringid(id,1)) e2:SetCondition(s.oppcon)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e2:SetTarget(s.opptg)
e3:SetCode(EVENT_TO_GRAVE) e2:SetOperation(s.oppop)
e3:SetCondition(s.oppcon) c:RegisterEffect(e2)
e3:SetOperation(s.oppop)
c:RegisterEffect(e3)
end end
function s.filter(c,tp) function s.filter(c,tp)
return c:IsAbleToHand() and Duel.IsExistingMatchingCard(s.namefilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,c:GetCode()) return c:IsAbleToHand() and Duel.IsExistingMatchingCard(s.namefilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,c:GetCode())
end end
...@@ -72,6 +67,7 @@ function s.endop(e,tp,eg,ep,ev,re,r,rp) ...@@ -72,6 +67,7 @@ function s.endop(e,tp,eg,ep,ev,re,r,rp)
local target_num = count * 3 local target_num = count * 3
local field_count = Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0) local field_count = Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)
local actual_return = math.min(target_num, field_count) local actual_return = math.min(target_num, field_count)
if actual_return > 0 then if actual_return > 0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local dg=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,0,actual_return,actual_return,nil) local dg=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,0,actual_return,actual_return,nil)
...@@ -83,6 +79,10 @@ end ...@@ -83,6 +79,10 @@ end
function s.oppcon(e,tp,eg,ep,ev,re,r,rp) function s.oppcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end end
function s.opptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,1-tp,LOCATION_DECK)
end
function s.oppop(e,tp,eg,ep,ev,re,r,rp) function s.oppop(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectYesNo(1-tp, aux.Stringid(id,2)) then if Duel.SelectYesNo(1-tp, aux.Stringid(id,2)) then
s.thop(e,1-tp,eg,ep,ev,re,r,rp) s.thop(e,1-tp,eg,ep,ev,re,r,rp)
......
...@@ -29,6 +29,7 @@ function c28318606.initial_effect(c) ...@@ -29,6 +29,7 @@ function c28318606.initial_effect(c)
local ge1=Effect.CreateEffect(c) local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_PHASE+PHASE_BATTLE_START) ge1:SetCode(EVENT_PHASE+PHASE_BATTLE_START)
ge1:SetCountLimit(1)
ge1:SetOperation(c28318606.checkop) ge1:SetOperation(c28318606.checkop)
Duel.RegisterEffect(ge1,0) Duel.RegisterEffect(ge1,0)
end end
......
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