Commit 4c6c0f2a authored by wind2009's avatar wind2009

Fix "Case of K9"

parent d4d8b7ab
No preview for this file type
...@@ -30,4 +30,5 @@ ...@@ -30,4 +30,5 @@
100236037 100236037
100236038 100236038
100236039 100236039
100236040
100236041 100236041
...@@ -3,11 +3,11 @@ local s,id,o=GetID() ...@@ -3,11 +3,11 @@ local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH) e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.target)
e1:SetOperation(s.activate) e1:SetOperation(s.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--atk up --atk up
...@@ -22,7 +22,7 @@ function s.initial_effect(c) ...@@ -22,7 +22,7 @@ function s.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--set --set
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1)) e3:SetDescription(aux.Stringid(id,2))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_DESTROYED) e3:SetCode(EVENT_DESTROYED)
...@@ -40,23 +40,21 @@ end ...@@ -40,23 +40,21 @@ end
function s.thfilter(c) function s.thfilter(c)
return c:IsSetCard(0x2cb) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() return c:IsSetCard(0x2cb) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp) function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
if g:GetCount()>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
Duel.SendtoHand(g,nil,REASON_EFFECT) local sg=g:Select(tp,1,1,nil)
Duel.ConfirmCards(1-tp,g) Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end end
end end
function s.atkcon(e,tp,eg,ep,ev,re,r,rp) function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCustomActivityCount(id,1-tp,ACTIVITY_CHAIN)>0 and Duel.IsMainPhase() return Duel.GetCustomActivityCount(id,1-tp,ACTIVITY_CHAIN)>0 and Duel.IsMainPhase()
end end
function s.setcon(e,tp,eg,ep,ev,re,r,rp) function s.setcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_SZONE) and e:GetHandler():IsLocation(LOCATION_GRAVE) local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_SZONE) and c:IsReason(REASON_EFFECT)
end end
function s.setfilter(c) function s.setfilter(c)
return c:IsSetCard(0x2cb) and c:IsType(TYPE_QUICKPLAY) and c:IsSSetable() return c:IsSetCard(0x2cb) and c:IsType(TYPE_QUICKPLAY) and c:IsSSetable()
...@@ -70,4 +68,4 @@ function s.setop(e,tp,eg,ep,ev,re,r,rp) ...@@ -70,4 +68,4 @@ function s.setop(e,tp,eg,ep,ev,re,r,rp)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SSet(tp,g:GetFirst()) Duel.SSet(tp,g:GetFirst())
end end
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