Commit 49b75064 authored by mercury233's avatar mercury233

fix

parent e6b3e5e9
......@@ -22,6 +22,7 @@ function s.initial_effect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_HAND+LOCATION_MZONE)
e3:SetCountLimit(1,id+o)
e3:SetCondition(s.spcon)
......@@ -56,7 +57,7 @@ end
function s.spfilter(c,e,tp)
return c:IsSetCard(0x28a) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and s.filter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
......@@ -62,7 +62,7 @@ function s.atkcon(e)
return Duel.IsExistingMatchingCard(s.atkfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function s.qfilter(e,c)
return c:IsSetCard(0x28a) and c:GetFlagEffect(id)>0
return c:GetFlagEffect(id)>0
end
function s.filter(c)
return c:IsSetCard(0x28a) and c:IsType(TYPE_MONSTER)
......
......@@ -65,10 +65,10 @@ end
function s.setop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if ft<=0 then return end
if ft>=4 then ft=4 end
local g=Duel.GetMatchingGroup(s.setfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
if ft>=4 then ft=4 end
local sg=g:SelectSubGroup(tp,aux.dncheck,false,1,ft)
if sg:GetCount()>0 then
Duel.SSet(tp,sg)
......
......@@ -9,13 +9,14 @@ function s.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.spfilter(c,e,tp,check)
return c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and (check and c:IsControler(1-tp) or c:IsSetCard(0x28a) and c:IsControler(tp))
end
function s.checkfilter(c)
......
......@@ -7,6 +7,7 @@ function s.initial_effect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_GRAVE_ACTION)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
......
......@@ -18,8 +18,8 @@ function s.initial_effect(c)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetTarget(s.sptg)
......@@ -34,7 +34,6 @@ function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
return result
end
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_DECK)
end
function s.tdfilter(c)
return c:IsAbleToHand() and c:IsSetCard(0x28c) and c:IsType(TYPE_SPELL+TYPE_TRAP)
......@@ -45,25 +44,21 @@ function s.tdop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetDecktopGroup(p,3)
if not g or #g<3 then return end
g=g:Filter(s.tdfilter,nil)
local ct=3
if #g>0 and Duel.SelectYesNo(p,aux.Stringid(id,2)) then
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_ATOHAND)
local sg=g:Select(p,1,1,nil)
Duel.DisableShuffleCheck()
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-p,sg)
Duel.SortDecktop(p,p,3-#sg)
for i=1,3-#sg do
local mg=Duel.GetDecktopGroup(p,1)
Duel.MoveSequence(mg:GetFirst(),SEQ_DECKBOTTOM)
end
Duel.ShuffleHand(p)
else
Duel.SortDecktop(p,p,3)
for i=1,3 do
ct=ct-1
end
Duel.SortDecktop(p,p,ct)
for i=1,ct do
local mg=Duel.GetDecktopGroup(p,1)
Duel.MoveSequence(mg:GetFirst(),SEQ_DECKBOTTOM)
end
end
end
function s.sptgexfilter(c,e,tp,code)
local sc=e:GetHandler()
......
......@@ -54,9 +54,10 @@ function s.gmattg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SelectTarget(tp,s.gmattgfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,2,nil,c)
end
function s.gmatop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetTargetsRelateToChain():Filter(aux.NOT(Card.IsImmuneToEffect),nil,e)
if #g>0 then
Duel.Overlay(e:GetHandler(),g)
if c:IsRelateToChain() and #g>0 then
Duel.Overlay(c,g)
end
end
function s.matcon(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -18,8 +18,9 @@ function s.initial_effect(c)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,2))
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCondition(s.damcon)
e2:SetTarget(s.damtg)
......@@ -68,7 +69,8 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp)
end
end
function s.damcon(e)
return e:GetHandler():GetOverlayCount()>=5
local c=e:GetHandler()
return (c==Duel.GetAttacker() or c==Duel.GetAttackTarget()) and c:GetOverlayCount()>=5
end
function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -23,7 +23,7 @@ function s.initial_effect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1)
e3:SetCondition(s.spcon)
......@@ -35,7 +35,7 @@ function s.initial_effect(c)
e4:SetDescription(aux.Stringid(id,1))
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetRange(LOCATION_FZONE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetTarget(s.mattg)
e4:SetOperation(s.matop)
......@@ -87,6 +87,8 @@ function s.matop(e,tp,eg,ep,ev,re,r,rp)
if tc:IsRelateToChain() then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.matfilter2),tp,LOCATION_GRAVE+LOCATION_DECK,0,1,1,nil,tc)
if #g>0 then
Duel.Overlay(tc,g)
end
end
end
......@@ -24,7 +24,7 @@ function s.initial_effect(c)
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,id+o)
e3:SetCondition(s.thcon2)
......
......@@ -4,7 +4,7 @@ local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DECKDES+CATEGORY_HANDES)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES+CATEGORY_HANDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
......@@ -39,7 +39,7 @@ function s.op(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_NO_TURN_RESET)
e1:SetCountLimit(1)
e1:SetValue(s.valcon)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,2)
......@@ -68,11 +68,7 @@ function s.xcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsSetCard(0x28c)
end
function s.check(c)
return c:IsCode(id)
end
function s.xval(e,c)
function s.xval(e)
local c=e:GetHandler()
local g=c:GetOverlayGroup():Filter(s.check,1,nil)
return #g
return c:GetOverlayGroup():FilterCount(Card.IsCode,nil,id)
end
\ No newline at end of file
......@@ -4,9 +4,8 @@ local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_RECOVER+CATEGORY_DECKDES+CATEGORY_HANDES)
e1:SetCategory(CATEGORY_RECOVER+CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES+CATEGORY_HANDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.tg)
e1:SetOperation(s.op)
......
......@@ -4,9 +4,8 @@ local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DECKDES+CATEGORY_HANDES)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES+CATEGORY_HANDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.tg)
e1:SetOperation(s.op)
......
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