Commit 46009310 authored by mercury233's avatar mercury233

Merge branch 'master' into patch-sync-workaround

parents da8dba6a 4e664cfe
...@@ -30,9 +30,8 @@ function s.sumfilter(c,ec) ...@@ -30,9 +30,8 @@ function s.sumfilter(c,ec)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetTargetRange(0,LOCATION_MZONE) e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetValue(POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE) e1:SetValue(POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local res=c:IsSummonable(true,nil,1) local res=c:IsSummonable(true,nil,1) or c:IsMSetable(true,nil,1)
e1:Reset() e1:Reset()
return res return res
end end
...@@ -44,28 +43,36 @@ function s.sumop(e,tp,eg,ep,ev,re,r,rp) ...@@ -44,28 +43,36 @@ function s.sumop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local tc=Duel.SelectMatchingCard(tp,s.sumfilter,tp,LOCATION_HAND,0,1,1,nil,c):GetFirst() local tc=Duel.SelectMatchingCard(tp,s.sumfilter,tp,LOCATION_HAND,0,1,1,nil,c):GetFirst()
if tc then if tc then s.summon(e,tp,tc) end
local e1=Effect.CreateEffect(c) end
e1:SetType(EFFECT_TYPE_SINGLE) function s.summon(e,tp,tc)
e1:SetCode(EFFECT_ADD_EXTRA_TRIBUTE) local c=e:GetHandler()
e1:SetRange(LOCATION_HAND) local e1=Effect.CreateEffect(c)
e1:SetTargetRange(0,LOCATION_MZONE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetValue(POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE) e1:SetCode(EFFECT_ADD_EXTRA_TRIBUTE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetRange(LOCATION_HAND)
tc:RegisterEffect(e1) e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetValue(POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local s1=tc:IsSummonable(true,nil,1)
local s2=tc:IsMSetable(true,nil,1)
if (s1 and s2 and Duel.SelectPosition(tp,tc,POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)==POS_FACEUP_ATTACK) or not s2 then
Duel.Summon(tp,tc,true,nil,1) Duel.Summon(tp,tc,true,nil,1)
local e2=Effect.CreateEffect(c) else
e2:SetType(EFFECT_TYPE_SINGLE) Duel.MSet(tp,tc,true,nil,1)
e2:SetCode(EFFECT_UNRELEASABLE_SUM)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetRange(LOCATION_MZONE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD+RESET_PHASE+PHASE_END)
e2:SetValue(1)
tc:RegisterEffect(e2,true)
local e3=e2:Clone()
e3:SetCode(EFFECT_UNRELEASABLE_NONSUM)
tc:RegisterEffect(e3,true)
end end
--cannot be tributed
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UNRELEASABLE_SUM)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD+RESET_PHASE+PHASE_END)
e2:SetValue(1)
tc:RegisterEffect(e2,true)
local e3=e2:Clone()
e3:SetCode(EFFECT_UNRELEASABLE_NONSUM)
tc:RegisterEffect(e3,true)
end end
function s.sumcon2(e,tp,eg,ep,ev,re,r,rp) function s.sumcon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
...@@ -79,27 +86,6 @@ function s.sumop2(e,tp,eg,ep,ev,re,r,rp) ...@@ -79,27 +86,6 @@ function s.sumop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(s.sumfilter,1-tp,LOCATION_HAND,0,1,nil,c) and Duel.SelectYesNo(1-tp,aux.Stringid(id,2)) then if Duel.IsExistingMatchingCard(s.sumfilter,1-tp,LOCATION_HAND,0,1,nil,c) and Duel.SelectYesNo(1-tp,aux.Stringid(id,2)) then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SUMMON) Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SUMMON)
local tc=Duel.SelectMatchingCard(1-tp,s.sumfilter,1-tp,LOCATION_HAND,0,1,1,nil,c):GetFirst() local tc=Duel.SelectMatchingCard(1-tp,s.sumfilter,1-tp,LOCATION_HAND,0,1,1,nil,c):GetFirst()
if tc then s.summon(e,1-tp,tc)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_ADD_EXTRA_TRIBUTE)
e1:SetRange(LOCATION_HAND)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetValue(POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
Duel.Summon(1-tp,tc,true,nil,1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UNRELEASABLE_SUM)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD+RESET_PHASE+PHASE_END)
e2:SetValue(1)
tc:RegisterEffect(e2,true)
local e3=e2:Clone()
e3:SetCode(EFFECT_UNRELEASABLE_NONSUM)
tc:RegisterEffect(e3,true)
end
end end
end end
...@@ -16,31 +16,45 @@ function c16708652.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -16,31 +16,45 @@ function c16708652.condition(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase() local ph=Duel.GetCurrentPhase()
return ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE and aux.dscon(e,tp,eg,ep,ev,re,r,rp) return ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE and aux.dscon(e,tp,eg,ep,ev,re,r,rp)
end end
function c16708652.filter1(c) function c16708652.atkfilter(c)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsSetCard(0x11) and c:IsCanChangePosition() return c:IsPosition(POS_FACEUP_ATTACK) and c:IsCanChangePosition() and c:IsAttackAbove(1)
end
function c16708652.filter1(c,tp)
return c16708652.atkfilter(c) and c:IsSetCard(0x11)
and Duel.IsExistingTarget(c16708652.filter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,c)
end end
function c16708652.filter2(c) function c16708652.filter2(c)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsSetCard(0x11) return c:IsPosition(POS_FACEUP_ATTACK) and c:IsSetCard(0x11)
end end
function c16708652.chkfilter(c,tp) function c16708652.tgfilter(c,e)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsSetCard(0x11) and c:IsCanChangePosition() and Duel.IsExistingTarget(c16708652.filter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,c) return c16708652.filter2(c) and c:IsCanBeEffectTarget(e)
end
function c16708652.gcheck(g)
return g:IsExists(c16708652.atkfilter,1,nil)
end end
function c16708652.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c16708652.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c16708652.chkfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp) end if chk==0 then return Duel.IsExistingTarget(c16708652.filter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(16708652,0)) local g=Duel.GetMatchingGroup(c16708652.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,e)
local g1=Duel.SelectTarget(tp,c16708652.filter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(16708652,1)) local sg=g:SelectSubGroup(tp,c16708652.gcheck,false,2,2)
local g2=Duel.SelectTarget(tp,c16708652.filter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,g1:GetFirst()) Duel.SetTargetCard(sg)
e:SetLabelObject(g1:GetFirst()) end
function c16708652.atkfilter2(c)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsCanChangePosition()
end end
function c16708652.activate(e,tp,eg,ep,ev,re,r,rp) function c16708652.activate(e,tp,eg,ep,ev,re,r,rp)
local tc1=e:GetLabelObject() local g=Duel.GetTargetsRelateToChain()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) if #g==0 then return end
local tc2=g:GetFirst() Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(16708652,0))
if tc1==tc2 then tc2=g:GetNext() end local tc1=g:FilterSelect(tp,c16708652.atkfilter,1,1,nil):GetFirst()
if tc1:IsRelateToEffect(e) and tc1:IsPosition(POS_FACEUP_ATTACK) and tc2:IsRelateToEffect(e) then if not tc1 then
Duel.ChangePosition(tc1,POS_FACEUP_DEFENSE) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(16708652,0))
tc1=g:FilterSelect(tp,c16708652.atkfilter2,1,1,nil):GetFirst()
end
if not tc1 then return end
local tc2=(g-tc1):GetFirst()
if Duel.ChangePosition(tc1,POS_FACEUP_DEFENSE)>0 and tc2 then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetCode(EFFECT_UPDATE_ATTACK)
......
...@@ -66,7 +66,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -66,7 +66,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectTarget(tp,Card.IsReleasableByEffect,tp,LOCATION_MZONE,0,1,1,tc) local g=Duel.SelectMatchingCard(tp,Card.IsReleasableByEffect,tp,LOCATION_MZONE,0,1,1,tc)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.HintSelection(g) Duel.HintSelection(g)
Duel.Release(g,REASON_EFFECT) Duel.Release(g,REASON_EFFECT)
......
...@@ -9,6 +9,7 @@ function s.initial_effect(c) ...@@ -9,6 +9,7 @@ function s.initial_effect(c)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetCondition(s.condition) e1:SetCondition(s.condition)
e1:SetTarget(s.target) e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function s.cfilter(c) function s.cfilter(c)
...@@ -37,22 +38,29 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -37,22 +38,29 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if op==1 then if op==1 then
e:SetCategory(0) e:SetCategory(0)
e:SetProperty(0) e:SetProperty(0)
e:SetOperation(s.protect)
elseif op==2 then elseif op==2 then
e:SetCategory(CATEGORY_CONTROL) e:SetCategory(CATEGORY_CONTROL)
e:SetProperty(EFFECT_FLAG_CARD_TARGET) e:SetProperty(EFFECT_FLAG_CARD_TARGET)
e:SetOperation(s.control)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,s.tfilter,tp,0,LOCATION_MZONE,1,1,nil) local g=Duel.SelectTarget(tp,s.tfilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
else else
e:SetCategory(0) e:SetCategory(0)
e:SetProperty(EFFECT_FLAG_CARD_TARGET) e:SetProperty(EFFECT_FLAG_CARD_TARGET)
e:SetOperation(s.tattack)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,a) Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,a)
end end
end end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local op=e:GetLabel()
if op==1 then
s.protect(e,tp,eg,ep,ev,re,r,rp)
elseif op==2 then
s.control(e,tp,eg,ep,ev,re,r,rp)
elseif op==3 then
s.tattack(e,tp,eg,ep,ev,re,r,rp)
end
end
function s.protect(e,tp,eg,ep,ev,re,r,rp) function s.protect(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
......
...@@ -10,6 +10,7 @@ function s.initial_effect(c) ...@@ -10,6 +10,7 @@ function s.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCondition(s.condition) e1:SetCondition(s.condition)
e1:SetTarget(s.target) e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function s.filter(c,tp) function s.filter(c,tp)
...@@ -24,8 +25,15 @@ end ...@@ -24,8 +25,15 @@ end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk) function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
local op=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2)) local op=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2))
if op==0 then e:SetOperation(s.endthism1) e:SetLabel(op)
else e:SetOperation(s.skipnxtm1) end end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local op=e:GetLabel()
if op==0 then
s.endthism1(e,tp,eg,ep,ev,re,r,rp)
elseif op==1 then
s.skipnxtm1(e,tp,eg,ep,ev,re,r,rp)
end
end end
function s.endthism1(e,tp,eg,ep,ev,re,r,rp) function s.endthism1(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase() local ph=Duel.GetCurrentPhase()
......
...@@ -7,6 +7,7 @@ function c25311006.initial_effect(c) ...@@ -7,6 +7,7 @@ function c25311006.initial_effect(c)
e1:SetCountLimit(1,25311006+EFFECT_COUNT_CODE_OATH) e1:SetCountLimit(1,25311006+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c25311006.condition) e1:SetCondition(c25311006.condition)
e1:SetTarget(c25311006.target) e1:SetTarget(c25311006.target)
e1:SetOperation(c25311006.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(25311006,ACTIVITY_CHAIN,c25311006.chainfilter) Duel.AddCustomActivityCounter(25311006,ACTIVITY_CHAIN,c25311006.chainfilter)
end end
...@@ -42,27 +43,35 @@ function c25311006.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -42,27 +43,35 @@ function c25311006.target(e,tp,eg,ep,ev,re,r,rp,chk)
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EFFECT) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EFFECT)
local op=Duel.SelectOption(tp,table.unpack(ops)) local op=Duel.SelectOption(tp,table.unpack(ops))
e:SetLabel(opval[op])
if opval[op]==1 then if opval[op]==1 then
e:SetCategory(CATEGORY_DRAW) e:SetCategory(CATEGORY_DRAW)
e:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e:SetOperation(c25311006.draw)
Duel.SetTargetPlayer(tp) Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2) Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
elseif opval[op]==2 then elseif opval[op]==2 then
e:SetCategory(CATEGORY_CONTROL) e:SetCategory(CATEGORY_CONTROL)
e:SetProperty(0) e:SetProperty(0)
e:SetOperation(c25311006.control)
local g=Duel.GetFieldGroup(tp,0,LOCATION_MZONE):Filter(Card.IsControlerCanBeChanged,nil) local g=Duel.GetFieldGroup(tp,0,LOCATION_MZONE):Filter(Card.IsControlerCanBeChanged,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
elseif opval[op]==3 then elseif opval[op]==3 then
e:SetCategory(CATEGORY_TODECK) e:SetCategory(CATEGORY_TODECK)
e:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e:SetOperation(c25311006.todeck)
Duel.SetTargetPlayer(tp) Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,0,1-tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,0,1-tp,LOCATION_HAND)
end end
end end
function c25311006.operation(e,tp,eg,ep,ev,re,r,rp)
local op=e:GetLabel()
if op==1 then
c25311006.draw(e,tp,eg,ep,ev,re,r,rp)
elseif op==2 then
c25311006.control(e,tp,eg,ep,ev,re,r,rp)
elseif op==3 then
c25311006.todeck(e,tp,eg,ep,ev,re,r,rp)
end
end
function c25311006.draw(e,tp,eg,ep,ev,re,r,rp) function c25311006.draw(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT) Duel.Draw(p,d,REASON_EFFECT)
......
...@@ -9,36 +9,32 @@ function c26864586.initial_effect(c) ...@@ -9,36 +9,32 @@ function c26864586.initial_effect(c)
e1:SetOperation(c26864586.activate) e1:SetOperation(c26864586.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c26864586.filter1(c,tp) function c26864586.tgfilter(c,e)
local lv=c:GetLevel() return c:IsFaceup() and c:IsLevelAbove(1) and c:IsCanBeEffectTarget(e)
return lv>0 and c:IsFaceup() and Duel.IsExistingTarget(c26864586.filter2,tp,LOCATION_MZONE,0,1,c,c:GetRace(),c:GetAttribute(),lv)
end end
function c26864586.filter2(c,rc,at,lv) function c26864586.gcheck(g)
return not c:IsLevel(lv) and c:IsLevelAbove(1) and c:IsFaceup() and c:IsRace(rc) and c:IsAttribute(at) return aux.dlvcheck(g) and aux.SameValueCheck(g,Card.GetAttribute) and aux.SameValueCheck(g,Card.GetRace)
end end
function c26864586.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c26864586.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c26864586.filter1,tp,LOCATION_MZONE,0,1,nil,tp) end local g=Duel.GetMatchingGroup(c26864586.tgfilter,tp,LOCATION_MZONE,0,nil,e)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) if chk==0 then return g:CheckSubGroup(c26864586.gcheck,2,2) end
local g1=Duel.SelectTarget(tp,c26864586.filter1,tp,LOCATION_MZONE,0,1,1,nil,tp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local tc1=g1:GetFirst() local tg=g:SelectSubGroup(tp,c26864586.gcheck,false,2,2)
e:SetLabelObject(tc1) Duel.SetTargetCard(tg)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(26864586,0))
local g2=Duel.SelectTarget(tp,c26864586.filter2,tp,LOCATION_MZONE,0,1,1,tc1,tc1:GetRace(),tc1:GetAttribute(),tc1:GetLevel())
end end
function c26864586.activate(e,tp,eg,ep,ev,re,r,rp) function c26864586.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local g=Duel.GetTargetsRelateToChain()
local tc1=e:GetLabelObject() if g:FilterCount(Card.IsFaceup,nil)<2 then return end
local tc2=g:GetFirst() if g:GetFirst():GetLevel()==g:GetNext():GetLevel() then return end
if tc1==tc2 then tc2=g:GetNext() end Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(26864586,0))
local tc2=g:Select(tp,1,1,nil):GetFirst()
local tc1=(g-tc2):GetFirst()
local lv=tc1:GetLevel() local lv=tc1:GetLevel()
if tc2:IsLevel(lv) then return end local e1=Effect.CreateEffect(e:GetHandler())
if tc1:IsFaceup() and tc1:IsRelateToEffect(e) and tc2:IsFaceup() and tc2:IsRelateToEffect(e) then e1:SetType(EFFECT_TYPE_SINGLE)
local e1=Effect.CreateEffect(e:GetHandler()) e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetValue(lv)
e1:SetCode(EFFECT_CHANGE_LEVEL) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(lv) tc2:RegisterEffect(e1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc2:RegisterEffect(e1)
end
end end
...@@ -32,19 +32,14 @@ function c32671443.thfilter(c,e,tp) ...@@ -32,19 +32,14 @@ function c32671443.thfilter(c,e,tp)
return c:IsAbleToHand() or (ft>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)) return c:IsAbleToHand() or (ft>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false))
end end
function c32671443.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c32671443.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
if chk==0 then return Duel.IsExistingMatchingCard(c32671443.costfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end if chk==0 then return Duel.IsExistingMatchingCard(c32671443.costfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c32671443.costfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,c32671443.costfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.Remove(g,POS_FACEUP,REASON_COST) Duel.Remove(g,POS_FACEUP,REASON_COST)
end end
function c32671443.target(e,tp,eg,ep,ev,re,r,rp,chk) function c32671443.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then return e:IsCostChecked()
local res=e:GetLabel()==1 or Duel.IsExistingMatchingCard(c32671443.thfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
e:SetLabel(0)
return res or Duel.IsExistingMatchingCard(c32671443.thfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
end
e:SetLabel(0)
end end
function c32671443.activate(e,tp,eg,ep,ev,re,r,rp) function c32671443.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
...@@ -67,27 +62,31 @@ end ...@@ -67,27 +62,31 @@ end
function c32671443.atkfilter2(c,tc) function c32671443.atkfilter2(c,tc)
return c:IsFaceup() and c:IsSetCard(0xc008) and not c:IsAttack(tc:GetAttack()) return c:IsFaceup() and c:IsSetCard(0xc008) and not c:IsAttack(tc:GetAttack())
end end
function c32671443.tgfilter(c,e)
return c:IsFaceup() and c:IsSetCard(0xc008) and c:IsCanBeEffectTarget(e)
end
function c32671443.gcheck(g)
return g:GetFirst():GetAttack()~=g:GetNext():GetAttack()
end
function c32671443.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c32671443.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c32671443.atkfilter1,tp,LOCATION_MZONE,0,1,nil,tp) end if chk==0 then return Duel.IsExistingTarget(c32671443.atkfilter1,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(32671443,2)) local g=Duel.GetMatchingGroup(c32671443.tgfilter,tp,LOCATION_MZONE,0,nil,e)
local g1=Duel.SelectTarget(tp,c32671443.atkfilter1,tp,LOCATION_MZONE,0,1,1,nil,tp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local tc=g1:GetFirst() local tg=g:SelectSubGroup(tp,c32671443.gcheck,false,2,2)
e:SetLabelObject(tc) Duel.SetTargetCard(tg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c32671443.atkfilter2,tp,LOCATION_MZONE,0,1,1,tc,tc)
end end
function c32671443.atkop(e,tp,eg,ep,ev,re,r,rp) function c32671443.atkop(e,tp,eg,ep,ev,re,r,rp)
local hc=e:GetLabelObject() local g=Duel.GetTargetsRelateToChain()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) if g:FilterCount(Card.IsFaceup,nil)<2 then return end
local tc=g:GetFirst() if g:GetFirst():GetAttack()==g:GetNext():GetAttack() then return end
if tc==hc then tc=g:GetNext() end Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(32671443,2))
if hc:IsFaceup() and hc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e) then local tc2=g:Select(tp,1,1,nil):GetFirst()
local e1=Effect.CreateEffect(e:GetHandler()) local tc1=(g-tc2):GetFirst()
e1:SetType(EFFECT_TYPE_SINGLE) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCode(EFFECT_SET_ATTACK_FINAL) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetValue(tc:GetAttack()) e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetValue(tc1:GetAttack())
hc:RegisterEffect(e1) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
end tc2:RegisterEffect(e1)
end end
...@@ -10,34 +10,38 @@ function c34016756.initial_effect(c) ...@@ -10,34 +10,38 @@ function c34016756.initial_effect(c)
e1:SetOperation(c34016756.activate) e1:SetOperation(c34016756.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c34016756.tgfilter(c,e)
return c:IsFaceup() and c:IsCanBeEffectTarget(e)
end
function c34016756.gcheck(g)
return g:IsExists(Card.IsAttackAbove,1,nil,1)
end
function c34016756.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c34016756.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,2,nil) end local g=Duel.GetMatchingGroup(c34016756.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,e)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(34016756,0)) if chk==0 then return g:CheckSubGroup(c34016756.gcheck,2,2) end
local g1=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
e:SetLabelObject(g1:GetFirst()) local tg=g:SelectSubGroup(tp,c34016756.gcheck,false,2,2)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(34016756,1)) Duel.SetTargetCard(tg)
local g2=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,g1:GetFirst())
end end
function c34016756.activate(e,tp,eg,ep,ev,re,r,rp) function c34016756.activate(e,tp,eg,ep,ev,re,r,rp)
local hc=e:GetLabelObject() local g=Duel.GetTargetsRelateToChain()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) if g:FilterCount(Card.IsFaceup,nil)<2 then return end
local tc=g:GetFirst() Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(34016756,0))
if tc==hc then tc=g:GetNext() end local tc1=g:FilterSelect(tp,Card.IsAttackAbove,1,1,nil,1):GetFirst()
if hc:IsFaceup() and hc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e) then local tc2=(g-tc1):GetFirst()
local atk=hc:GetAttack() local atk=tc1:GetAttack()
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL) e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(math.ceil(atk/2)) e1:SetValue(math.ceil(atk/2))
if hc:RegisterEffect(e1) then if tc1:RegisterEffect(e1) then
local e2=Effect.CreateEffect(e:GetHandler()) local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e2:SetValue(math.ceil(atk/2)) e2:SetValue(math.ceil(atk/2))
tc:RegisterEffect(e2) tc2:RegisterEffect(e2)
end
end end
end end
...@@ -9,6 +9,7 @@ function c40456412.initial_effect(c) ...@@ -9,6 +9,7 @@ function c40456412.initial_effect(c)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCondition(c40456412.condition) e1:SetCondition(c40456412.condition)
e1:SetTarget(c40456412.target) e1:SetTarget(c40456412.target)
e1:SetOperation(c40456412.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c40456412.cfilter(c) function c40456412.cfilter(c)
...@@ -50,23 +51,27 @@ function c40456412.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -50,23 +51,27 @@ function c40456412.target(e,tp,eg,ep,ev,re,r,rp,chk)
if e:IsCostChecked() then if e:IsCostChecked() then
Duel.RegisterFlagEffect(tp,40456412+op,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(tp,40456412+op,RESET_PHASE+PHASE_END,0,1)
end end
e:SetLabel(op)
if op==1 then if op==1 then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_EXTRA)
if e:IsCostChecked() then if e:IsCostChecked() then
e:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON) e:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
end end
e:SetOperation(c40456412.spop)
elseif op==2 then
if e:IsCostChecked() then
e:SetCategory(0)
end
e:SetOperation(c40456412.psop)
else else
if e:IsCostChecked() then if e:IsCostChecked() then
e:SetCategory(0) e:SetCategory(0)
end end
e:SetOperation(c40456412.ssop) end
end
function c40456412.operation(e,tp,eg,ep,ev,re,r,rp)
local op=e:GetLabel()
if op==1 then
c40456412.spop(e,tp,eg,ep,ev,re,r,rp)
elseif op==2 then
c40456412.psop(e,tp,eg,ep,ev,re,r,rp)
elseif op==3 then
c40456412.ssop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c40456412.spop(e,tp,eg,ep,ev,re,r,rp) function c40456412.spop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -15,52 +15,49 @@ function c43857222.initial_effect(c) ...@@ -15,52 +15,49 @@ function c43857222.initial_effect(c)
end end
function c43857222.lvfilter1(c,tp) function c43857222.lvfilter1(c,tp)
return c:IsFaceup() and c:IsLevelAbove(2) return c:IsFaceup() and c:IsLevelAbove(2)
and Duel.IsExistingTarget(c43857222.lvfilter2,tp,LOCATION_MZONE,0,1,c) and Duel.IsExistingTarget(c43857222.lvfilter2,tp,LOCATION_MZONE,0,1,c,1)
end end
function c43857222.lvfilter2(c) function c43857222.lvfilter2(c,lv)
return c:IsFaceup() and c:IsLevelAbove(1) return c:IsFaceup() and c:IsLevelAbove(lv)
end end
function c43857222.lvfilter3(c,tp,lv) function c43857222.tgfilter(c,e)
return c:IsFaceup() and c:IsLevelAbove(lv+1) return c:IsFaceup() and c:IsLevelAbove(1) and c:IsCanBeEffectTarget(e)
and Duel.IsExistingTarget(c43857222.lvfilter2,tp,LOCATION_MZONE,0,1,c) end
function c43857222.gcheck(g,lv)
return g:IsExists(Card.IsLevelAbove,1,nil,lv+1)
end end
function c43857222.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c43857222.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c43857222.lvfilter1,tp,LOCATION_MZONE,0,1,nil,tp) end if chk==0 then return Duel.IsExistingTarget(c43857222.lvfilter1,tp,LOCATION_MZONE,0,1,nil,tp) end
local g=Duel.GetMatchingGroup(c43857222.lvfilter1,tp,LOCATION_MZONE,0,nil,tp) local g=Duel.GetMatchingGroup(c43857222.tgfilter,tp,LOCATION_MZONE,0,nil,e)
local mg,lv=g:GetMaxGroup(Card.GetLevel) local _,lv=g:GetMaxGroup(Card.GetLevel)
local alv=0 local alv=Duel.AnnounceLevel(tp,1,math.min(lv-1,6))
if lv>2 then alv=Duel.AnnounceLevel(tp,1,math.min(lv-1,6)) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
else alv=Duel.AnnounceLevel(tp,1,1) end local tg=g:SelectSubGroup(tp,c43857222.gcheck,false,2,2,alv)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(43857222,1)) Duel.SetTargetCard(tg)
local g1=Duel.SelectTarget(tp,c43857222.lvfilter3,tp,LOCATION_MZONE,0,1,1,nil,tp,alv)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(43857222,2))
Duel.SelectTarget(tp,c43857222.lvfilter2,tp,LOCATION_MZONE,0,1,1,g1:GetFirst())
e:SetLabelObject(g1:GetFirst())
e:SetLabel(alv) e:SetLabel(alv)
end end
function c43857222.lvop(e,tp,eg,ep,ev,re,r,rp) function c43857222.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local g=Duel.GetTargetsRelateToChain()
if not c:IsRelateToEffect(e) then return end if #g==0 then return end
local hc=e:GetLabelObject()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tc=g:GetFirst()
if tc==hc then tc=g:GetNext() end
local lv=e:GetLabel() local lv=e:GetLabel()
if hc:IsFaceup() and hc:IsRelateToEffect(e) then Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(43857222,1))
local tc1=g:FilterSelect(tp,c43857222.lvfilter2,1,1,nil,lv+1):GetFirst()
if tc1 then
local c=e:GetHandler()
local tc2=(g-tc1):GetFirst()
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL) e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(-lv) e1:SetValue(-lv)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
hc:RegisterEffect(e1) if tc1:RegisterEffect(e1) and tc2 and tc2:IsFaceup() then
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_LEVEL) e2:SetCode(EFFECT_UPDATE_LEVEL)
e2:SetValue(lv) e2:SetValue(lv)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2) tc2:RegisterEffect(e2)
end end
end end
end end
...@@ -2,60 +2,49 @@ ...@@ -2,60 +2,49 @@
function c46961802.initial_effect(c) function c46961802.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(46961802,0))
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(aux.bpcon)
e1:SetTarget(c46961802.target) e1:SetTarget(c46961802.target)
e1:SetOperation(c46961802.activate) e1:SetOperation(c46961802.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c46961802.filter1(c,tp) function c46961802.filter1(c,tp)
return c:IsFaceup() and Duel.IsExistingTarget(c46961802.filter2,tp,LOCATION_MZONE,0,1,c,c:GetAttack()) return c:IsAttackPos() and Duel.IsExistingTarget(c46961802.filter2,tp,LOCATION_MZONE,0,1,c,c:GetAttack())
end end
function c46961802.filter2(c,atk) function c46961802.filter2(c,atk)
return c:IsFaceup() and c:IsAttack(atk) return c:IsAttackPos() and c:IsAttack(atk)
end
function c46961802.tgfilter(c,e)
return c:IsAttackPos() and c:IsCanBeEffectTarget(e)
end
function c46961802.gcheck(g)
return g:GetFirst():GetAttack()==g:GetNext():GetAttack()
end end
function c46961802.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c46961802.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c46961802.filter1,tp,LOCATION_MZONE,0,1,nil,tp) end if chk==0 then return Duel.IsExistingTarget(c46961802.filter1,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) local g=Duel.GetMatchingGroup(c46961802.tgfilter,tp,LOCATION_MZONE,0,nil,e)
local g1=Duel.SelectTarget(tp,c46961802.filter1,tp,LOCATION_MZONE,0,1,1,nil,tp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) local sg=g:SelectSubGroup(tp,c46961802.gcheck,false,2,2)
local g2=Duel.SelectTarget(tp,c46961802.filter2,tp,LOCATION_MZONE,0,1,1,g1:GetFirst(),g1:GetFirst():GetAttack()) Duel.SetTargetCard(sg)
end end
function c46961802.activate(e,tp,eg,ep,ev,re,r,rp) function c46961802.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local g=Duel.GetTargetsRelateToChain()
local tc1=g:GetFirst() if #g<2 then return end
local tc2=g:GetNext() Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(46961802,1))
if tc1:IsFacedown() or tc2:IsFacedown() or not tc1:IsRelateToEffect(e) or not tc2:IsRelateToEffect(e) local tc1=g:Select(tp,1,1,nil):GetFirst()
or not tc1:IsAttack(tc2:GetAttack()) then return end local tc2=(g-tc1):GetFirst()
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK) e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc1:RegisterEffect(e1) tc1:RegisterEffect(e1)
local e2=e1:Clone() local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_ATTACK)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc2:RegisterEffect(e2) tc2:RegisterEffect(e2)
tc1:RegisterFlagEffect(46961802,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
tc2:RegisterFlagEffect(46961802,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
e3:SetOperation(c46961802.atop)
e3:SetLabelObject(tc2)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc1:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetLabelObject(tc1)
tc2:RegisterEffect(e4)
end
function c46961802.atop(e,tp,eg,ep,ev,re,r,rp)
local oc=e:GetLabelObject()
if oc:GetFlagEffect(46961802)~=0 then
local e1=Effect.CreateEffect(e:GetOwner())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
oc:RegisterEffect(e1,true)
end
end end
...@@ -19,37 +19,42 @@ function c56535497.initial_effect(c) ...@@ -19,37 +19,42 @@ function c56535497.initial_effect(c)
e2:SetOperation(c56535497.operation) e2:SetOperation(c56535497.operation)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c56535497.filter(c)
return c:IsFaceup() and c:IsRace(RACE_BEAST)
end
function c56535497.condition(e,tp,eg,ep,ev,re,r,rp) function c56535497.condition(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase() local ph=Duel.GetCurrentPhase()
if Duel.GetTurnPlayer()==tp then return ph==PHASE_MAIN1 or ph==PHASE_MAIN2 if Duel.GetTurnPlayer()==tp then return ph==PHASE_MAIN1 or ph==PHASE_MAIN2
else return ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE and aux.dscon(e,tp,eg,ep,ev,re,r,rp) end else return ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE and aux.dscon(e,tp,eg,ep,ev,re,r,rp) end
end end
function c56535497.filter(c,e)
return c:IsFaceup() and c:IsRace(RACE_BEAST) and c:IsCanBeEffectTarget(e)
end
function c56535497.atkfilter(c)
return c:IsFaceup() and c:IsAttackAbove(1)
end
function c56535497.gcheck(g)
return g:IsExists(c56535497.atkfilter,1,nil)
end
function c56535497.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c56535497.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c56535497.filter,tp,LOCATION_MZONE,LOCATION_MZONE,2,nil) end local g=Duel.GetMatchingGroup(c56535497.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,e)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(56535497,2)) if chk==0 then return #g>=2 and g:IsExists(c56535497.atkfilter,1,nil) end
local rg=Duel.SelectTarget(tp,c56535497.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
e:SetLabelObject(rg:GetFirst()) local sg=g:SelectSubGroup(tp,c56535497.gcheck,false,2,2)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(56535497,3)) Duel.SetTargetCard(sg)
Duel.SelectTarget(tp,c56535497.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,rg:GetFirst())
end end
function c56535497.operation(e,tp,eg,ep,ev,re,r,rp) function c56535497.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local g=Duel.GetTargetsRelateToChain()
local tc1=e:GetLabelObject() if #g<2 then return end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(56535497,2))
local tc1=g:FilterSelect(tp,c56535497.atkfilter,1,1,nil):GetFirst()
if not tc1 then return end if not tc1 then return end
local tc2=g:GetFirst() local tc2=(g-tc1):GetFirst()
if tc1==tc2 then tc2=g:GetNext() end local atk=math.ceil(tc1:GetAttack()/2)
if tc1:IsFaceup() and tc1:IsRelateToEffect(e) and tc2:IsFaceup() and tc2:IsRelateToEffect(e) then local e1=Effect.CreateEffect(e:GetHandler())
local atk=math.ceil(tc1:GetAttack()/2) e1:SetType(EFFECT_TYPE_SINGLE)
local e1=Effect.CreateEffect(e:GetHandler()) e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetValue(atk)
e1:SetCode(EFFECT_SET_ATTACK_FINAL) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(atk) if tc1:RegisterEffect(e1) and tc2 and tc2:IsFaceup() then
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc1:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler()) local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetCode(EFFECT_UPDATE_ATTACK)
......
...@@ -6,6 +6,7 @@ function s.initial_effect(c) ...@@ -6,6 +6,7 @@ function s.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.tg) e1:SetTarget(s.tg)
e1:SetOperation(s.op)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function s.filter(c,e,tp) function s.filter(c,e,tp)
...@@ -24,13 +25,13 @@ function s.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -24,13 +25,13 @@ function s.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
and Duel.IsExistingTarget(s.dfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp) and Duel.IsExistingTarget(s.dfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp)
if chk==0 then return b1 or b2 end if chk==0 then return b1 or b2 end
local op=aux.SelectFromOptions(tp,{b1,aux.Stringid(id,0)},{b2,aux.Stringid(id,1)}) local op=aux.SelectFromOptions(tp,{b1,aux.Stringid(id,0)},{b2,aux.Stringid(id,1)})
e:SetLabel(op)
if op==1 then if op==1 then
if e:IsCostChecked() then if e:IsCostChecked() then
e:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON) e:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e:SetProperty(0) e:SetProperty(0)
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1)
end end
e:SetOperation(s.sop)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
else else
...@@ -39,7 +40,6 @@ function s.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -39,7 +40,6 @@ function s.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
e:SetProperty(EFFECT_FLAG_CARD_TARGET) e:SetProperty(EFFECT_FLAG_CARD_TARGET)
Duel.RegisterFlagEffect(tp,id+o,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(tp,id+o,RESET_PHASE+PHASE_END,0,1)
end end
e:SetOperation(s.dop)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local tc=Duel.SelectTarget(tp,s.dfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tp):GetFirst() local tc=Duel.SelectTarget(tp,s.dfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tp):GetFirst()
local atk=tc:GetBaseAttack() local atk=tc:GetBaseAttack()
...@@ -47,6 +47,14 @@ function s.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -47,6 +47,14 @@ function s.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,atk) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,atk)
end end
end end
function s.op(e,tp,eg,ep,ev,re,r,rp)
local op=e:GetLabel()
if op==1 then
s.sop(e,tp,eg,ep,ev,re,r,rp)
elseif op==2 then
s.dop(e,tp,eg,ep,ev,re,r,rp)
end
end
function s.sop(e,tp,eg,ep,ev,re,r,rp) function s.sop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local tc=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp):GetFirst() local tc=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp):GetFirst()
......
...@@ -13,37 +13,32 @@ function s.initial_effect(c) ...@@ -13,37 +13,32 @@ function s.initial_effect(c)
e2:SetCode(EVENT_ATTACK_ANNOUNCE) e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetCountLimit(1) e2:SetCountLimit(1)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetCondition(s.effcon)
e2:SetTarget(s.efftg) e2:SetTarget(s.efftg)
e2:SetOperation(s.effop) e2:SetOperation(s.effop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function s.effcon(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
if a:IsControler(tp) then e:SetLabelObject(a) else e:SetLabelObject(d) end
local g=a:GetColumnGroup():Filter(Card.IsLocation,nil,LOCATION_MZONE)
if d and g:IsContains(d) then e:SetLabel(1) else e:SetLabel(0) end
return true
end
function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk) function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end local a,d=Duel.GetBattleMonster(tp)
Duel.SetTargetCard(e:GetLabelObject()) if chk==0 then return a end
if e:GetLabel()~=1 then Duel.SetTargetCard(a)
local g=a:GetColumnGroup():Filter(Card.IsLocation,nil,LOCATION_MZONE)
if d and g:IsContains(d) then
e:SetLabel(1)
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,1) Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,1)
else
e:SetLabel(0)
end end
end end
function s.effop(e,tp,eg,ep,ev,re,r,rp) function s.effop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if not tc:IsRelateToChain() then return end
local d=0 local d=0
if e:GetLabel()==1 then if e:GetLabel()==1 then
if not tc:IsRelateToChain() then return end
d=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2),aux.Stringid(id,3))+1 d=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2),aux.Stringid(id,3))+1
else else
d=Duel.TossDice(tp,1) d=Duel.TossDice(tp,1)
end end
if not tc:IsRelateToChain() then return end
if d==1 or d==4 then if d==1 or d==4 then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,4)) e1:SetDescription(aux.Stringid(id,4))
......
...@@ -21,6 +21,7 @@ function s.initial_effect(c) ...@@ -21,6 +21,7 @@ function s.initial_effect(c)
e2:SetCountLimit(1,id) e2:SetCountLimit(1,id)
e2:SetCondition(s.gycon) e2:SetCondition(s.gycon)
e2:SetTarget(s.gytg) e2:SetTarget(s.gytg)
e2:SetOperation(s.gyop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function s.fscon(e,tp,eg,ep,ev,re,r,rp) function s.fscon(e,tp,eg,ep,ev,re,r,rp)
...@@ -109,17 +110,24 @@ function s.gytg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -109,17 +110,24 @@ function s.gytg(e,tp,eg,ep,ev,re,r,rp,chk)
and g:GetClassCount(Card.GetCode)>1 and g:GetClassCount(Card.GetCode)>1
if chk==0 then return b1 or b2 end if chk==0 then return b1 or b2 end
local op=aux.SelectFromOptions(tp,{b1,aux.Stringid(id,2)},{b2,aux.Stringid(id,3)}) local op=aux.SelectFromOptions(tp,{b1,aux.Stringid(id,2)},{b2,aux.Stringid(id,3)})
e:SetLabel(op)
if op==1 then if op==1 then
e:SetCategory(CATEGORY_TOHAND) e:SetCategory(CATEGORY_TOHAND)
e:SetOperation(s.tohand)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,0,0)
else else
e:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON) e:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON)
e:SetOperation(s.banish)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,c,1,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK+LOCATION_GRAVE)
end end
end end
function s.gyop(e,tp,eg,ep,ev,re,r,rp)
local op=e:GetLabel()
if op==1 then
s.tohand(e,tp,eg,ep,ev,re,r,rp)
elseif op==2 then
s.banish(e,tp,eg,ep,ev,re,r,rp)
end
end
function s.tohand(e,tp,eg,ep,ev,re,r,rp) function s.tohand(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) then Duel.SendtoHand(c,nil,REASON_EFFECT) end if c:IsRelateToEffect(e) then Duel.SendtoHand(c,nil,REASON_EFFECT) end
......
...@@ -32,20 +32,14 @@ function c64038662.eftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -32,20 +32,14 @@ function c64038662.eftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local b1=Duel.IsExistingTarget(c64038662.filter1,tp,LOCATION_MZONE,0,2,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 local b1=Duel.IsExistingTarget(c64038662.filter1,tp,LOCATION_MZONE,0,2,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
local b2=Duel.IsExistingTarget(c64038662.filter2,tp,LOCATION_SZONE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 local b2=Duel.IsExistingTarget(c64038662.filter2,tp,LOCATION_SZONE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chk==0 then return b1 or b2 end if chk==0 then return b1 or b2 end
local op=0 local op=aux.SelectFromOptions(tp,
if b1 and b2 then {b1,aux.Stringid(64038662,2),1},
op=Duel.SelectOption(tp,aux.Stringid(64038662,2),aux.Stringid(64038662,3))+1 {b2,aux.Stringid(64038662,3),2})
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(64038662,2))+1
else op=Duel.SelectOption(tp,aux.Stringid(64038662,3))+2 end
e:SetLabel(op) e:SetLabel(op)
if op==1 then if op==1 then
e:SetCategory(0) e:SetCategory(0)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(64038662,4)) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g1=Duel.SelectTarget(tp,c64038662.filter1,tp,LOCATION_MZONE,0,1,1,nil) Duel.SelectTarget(tp,c64038662.filter1,tp,LOCATION_MZONE,0,2,2,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g2=Duel.SelectTarget(tp,c64038662.filter1,tp,LOCATION_MZONE,0,1,1,g1:GetFirst())
e:SetLabelObject(g1:GetFirst())
else else
e:SetCategory(CATEGORY_SPECIAL_SUMMON) e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
...@@ -55,11 +49,13 @@ function c64038662.eftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -55,11 +49,13 @@ function c64038662.eftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function c64038662.efop(e,tp,eg,ep,ev,re,r,rp) function c64038662.efop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==1 then if e:GetLabel()==1 then
local tc1=e:GetLabelObject() local g=Duel.GetTargetsRelateToChain()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) if g:FilterCount(Card.IsFaceup,nil)<2 then return end
local tc2=g:GetFirst() if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
if tc1==tc2 then tc2=g:GetNext() end Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(64038662,4))
if tc1:IsFaceup() and tc2:IsFaceup() and tc1:IsRelateToEffect(e) and tc2:IsRelateToEffect(e) and Duel.Equip(tp,tc1,tc2,false) then local tc1=g:Select(tp,1,1,nil):GetFirst()
local tc2=(g-tc1):GetFirst()
if Duel.Equip(tp,tc1,tc2,false) then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT) e1:SetCode(EFFECT_EQUIP_LIMIT)
......
...@@ -72,7 +72,8 @@ function c67712104.indcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -72,7 +72,8 @@ function c67712104.indcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if at==c then return true end if at==c then return true end
local lg=c:GetLinkedGroup() local lg=c:GetLinkedGroup()
return at and at:IsControler(tp) and at:IsFaceup() and at:IsSetCard(0x12b) and lg:IsContains(at) return at:IsControler(tp) and at:IsFaceup()
and at:IsSetCard(0x12b) and at:IsType(TYPE_LINK) and lg:IsContains(at)
end end
function c67712104.costfilter(c) function c67712104.costfilter(c)
return c:IsSetCard(0x12b) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost() return c:IsSetCard(0x12b) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
......
...@@ -30,38 +30,28 @@ end ...@@ -30,38 +30,28 @@ end
function c72859417.ovfilter(c,e) function c72859417.ovfilter(c,e)
return c:IsFaceup() and c:IsRace(RACE_WINDBEAST) and c:IsType(TYPE_XYZ) and c:IsCanBeEffectTarget(e) return c:IsFaceup() and c:IsRace(RACE_WINDBEAST) and c:IsType(TYPE_XYZ) and c:IsCanBeEffectTarget(e)
end end
function c72859417.fselect(g) function c72859417.gcheck(g)
return g:IsExists(Card.IsCanOverlay,1,nil) return g:IsExists(Card.IsCanOverlay,1,nil)
end end
function c72859417.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c72859417.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.GetMatchingGroup(c72859417.ovfilter,tp,LOCATION_MZONE,0,nil,e)
if chkc then return false end if chkc then return false end
if chk==0 then return g:CheckSubGroup(c72859417.fselect,2,2) end local g=Duel.GetMatchingGroup(c72859417.ovfilter,tp,LOCATION_MZONE,0,nil,e)
if chk==0 then return g:CheckSubGroup(c72859417.gcheck,2,2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local sg=g:SelectSubGroup(tp,c72859417.fselect,false,2,2) local sg=g:SelectSubGroup(tp,c72859417.gcheck,false,2,2)
Duel.SetTargetCard(sg) Duel.SetTargetCard(sg)
end end
function c72859417.activate(e,tp,eg,ep,ev,re,r,rp) function c72859417.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local g=Duel.GetTargetsRelateToChain()
local c1=g:GetFirst() if #g<2 then return end
local c2=g:GetNext() if g:IsExists(Card.IsImmuneToEffect,1,nil,e) then return end
if not c1:IsRelateToEffect(e) or not c2:IsRelateToEffect(e) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
if c1:IsImmuneToEffect(e) or c2:IsImmuneToEffect(e) then return end local c1=g:FilterSelect(tp,Card.IsCanOverlay,1,1,nil):GetFirst()
local b1=c1:IsCanOverlay() if not c1 then return end
local b2=c2:IsCanOverlay() local c2=(g-c1):GetFirst()
if not b1 and not b2 then return end
if not (b1 and b2) then
if not b1 and b2 then
c1,c2=c2,c1
end
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
c1=g:Select(tp,1,1,nil):GetFirst()
c2=g:Filter(aux.TRUE,c1):GetFirst()
end
local mg=c1:GetOverlayGroup() local mg=c1:GetOverlayGroup()
if mg:GetCount()>0 then Duel.Overlay(c2,mg,false) end if mg:GetCount()>0 then Duel.Overlay(c2,mg,false) end
Duel.Overlay(c2,Group.FromCards(c1)) Duel.Overlay(c2,c1)
end end
function c72859417.drfilter(c) function c72859417.drfilter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:GetOverlayCount()>=3 return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:GetOverlayCount()>=3
......
...@@ -92,6 +92,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c) ...@@ -92,6 +92,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local tc2=g:SelectUnselect(nil,tp,false,true,1,1) local tc2=g:SelectUnselect(nil,tp,false,true,1,1)
if tc2 then if tc2 then
tc2:RegisterFlagEffect(id+o,RESET_EVENT+RESETS_STANDARD,0,1)
local sg=Group.FromCards(tc,tc2) local sg=Group.FromCards(tc,tc2)
sg:KeepAlive() sg:KeepAlive()
e:SetLabelObject(sg) e:SetLabelObject(sg)
...@@ -100,12 +101,15 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c) ...@@ -100,12 +101,15 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
end end
return false return false
end end
function s.disfilter(c)
return c:GetFlagEffect(id+o)==0
end
function s.spop(e,tp,eg,ep,ev,re,r,rp,c) function s.spop(e,tp,eg,ep,ev,re,r,rp,c)
e:GetHandler():RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD+RESET_PHASE+PHASE_END,0,1) e:GetHandler():RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD+RESET_PHASE+PHASE_END,0,1)
local g=e:GetLabelObject() local g=e:GetLabelObject()
local hg=g:Filter(Card.IsLocation,nil,LOCATION_HAND) local dg=g:Filter(s.disfilter,nil)
g:Sub(hg) g:Sub(dg)
Duel.SendtoGrave(hg,REASON_SPSUMMON+REASON_DISCARD) Duel.SendtoGrave(dg,REASON_SPSUMMON+REASON_DISCARD)
Duel.Release(g,REASON_SPSUMMON) Duel.Release(g,REASON_SPSUMMON)
g:DeleteGroup() g:DeleteGroup()
end end
......
...@@ -11,6 +11,7 @@ function s.initial_effect(c) ...@@ -11,6 +11,7 @@ function s.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCondition(s.condition) e1:SetCondition(s.condition)
e1:SetTarget(s.target) e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function s.cfilter(c) function s.cfilter(c)
...@@ -46,17 +47,23 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -46,17 +47,23 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
e:SetLabel(op) e:SetLabel(op)
if op==1 then if op==1 then
e:SetCategory(0) e:SetCategory(0)
e:SetOperation(s.mvop)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=aux.SelectTargetFromFieldFirst(tp,s.mfilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,1,nil,tp,0) local g=aux.SelectTargetFromFieldFirst(tp,s.mfilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,1,nil,tp,0)
else else
e:SetCategory(CATEGORY_SPECIAL_SUMMON) e:SetCategory(CATEGORY_SPECIAL_SUMMON)
e:SetOperation(s.spop)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,s.sfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,s.sfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end end
end end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local op=e:GetLabel()
if op==1 then
s.mvop(e,tp,eg,ep,ev,re,r,rp)
elseif op==2 then
s.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
function s.mvop(e,tp,eg,ep,ev,re,r,rp) function s.mvop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) if tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e)
......
...@@ -13,6 +13,7 @@ function s.initial_effect(c) ...@@ -13,6 +13,7 @@ function s.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP) e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetCondition(aux.dscon)
e1:SetCost(s.discost) e1:SetCost(s.discost)
e1:SetTarget(s.distg) e1:SetTarget(s.distg)
e1:SetOperation(s.disop) e1:SetOperation(s.disop)
......
...@@ -8,6 +8,7 @@ function s.initial_effect(c) ...@@ -8,6 +8,7 @@ function s.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target) e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
s.fusion_effect=true s.fusion_effect=true
...@@ -50,6 +51,7 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -50,6 +51,7 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
{b1,aux.Stringid(id,1)}, {b1,aux.Stringid(id,1)},
{b2,aux.Stringid(id,2)}) {b2,aux.Stringid(id,2)})
end end
e:SetLabel(op)
if op==1 then if op==1 then
if e:IsCostChecked() then if e:IsCostChecked() then
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1)
...@@ -57,14 +59,20 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -57,14 +59,20 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED) Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED)
e:SetOperation(s.fsop)
elseif op==2 then elseif op==2 then
if e:IsCostChecked() then if e:IsCostChecked() then
Duel.RegisterFlagEffect(tp,id+o,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(tp,id+o,RESET_PHASE+PHASE_END,0,1)
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
end end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
e:SetOperation(s.thop) end
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local op=e:GetLabel()
if op==1 then
s.fsop(e,tp,eg,ep,ev,re,r,rp)
elseif op==2 then
s.thop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function s.fsop(e,tp,eg,ep,ev,re,r,rp) function s.fsop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -50,35 +50,40 @@ function c79016563.atkcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -50,35 +50,40 @@ function c79016563.atkcon(e,tp,eg,ep,ev,re,r,rp)
return aux.dscon(e,tp,eg,ep,ev,re,r,rp) return aux.dscon(e,tp,eg,ep,ev,re,r,rp)
and e:GetHandler():GetMutualLinkedGroupCount()>=2 and e:GetHandler():GetMutualLinkedGroupCount()>=2
end end
function c79016563.tgfilter(c,e)
return c:IsFaceup() and c:IsCanBeEffectTarget(e)
end
function c79016563.gcheck(g)
return g:IsExists(Card.IsAttackAbove,1,nil,1)
end
function c79016563.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c79016563.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() end if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,2,nil) end local g=Duel.GetMatchingGroup(c79016563.tgfilter,tp,LOCATION_MZONE,0,nil,e)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) if chk==0 then return g:CheckSubGroup(c79016563.gcheck,2,2) end
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,2,2,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local sg=g:SelectSubGroup(tp,c79016563.gcheck,false,2,2)
Duel.SetTargetCard(sg)
end end
function c79016563.atkop(e,tp,eg,ep,ev,re,r,rp) function c79016563.atkop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local g=Duel.GetTargetsRelateToChain()
local tc1=g:GetFirst() if g:FilterCount(Card.IsFaceup,nil)<2 then return end
local tc2=g:GetNext() Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(79016563,2))
if tc1:IsFaceup() and tc1:IsRelateToEffect(e) and tc2:IsFaceup() and tc2:IsRelateToEffect(e) then local tc1=g:FilterSelect(tp,Card.IsAttackAbove,1,1,nil,1):GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(79016563,2)) local tc2=(g-tc1):GetFirst()
local sg=g:Select(tp,1,1,nil) local atk=tc1:GetAttack()
local atk=sg:GetFirst():GetAttack() local e1=Effect.CreateEffect(e:GetHandler())
local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetCode(EFFECT_SET_ATTACK_FINAL) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e1:SetValue(math.ceil(atk/2))
e1:SetValue(math.ceil(atk/2)) if tc1:RegisterEffect(e1) then
if sg:GetFirst():RegisterEffect(e1) then local e2=Effect.CreateEffect(e:GetHandler())
local e2=Effect.CreateEffect(e:GetHandler()) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e2:SetValue(math.ceil(atk/2))
e2:SetValue(math.ceil(atk/2)) tc2:RegisterEffect(e2)
if sg:GetFirst()==tc1 then tc2:RegisterEffect(e2)
else tc1:RegisterEffect(e2) end
end
end end
end end
...@@ -8,6 +8,7 @@ function s.initial_effect(c) ...@@ -8,6 +8,7 @@ function s.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target) e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function s.filter(c,e,tp) function s.filter(c,e,tp)
...@@ -35,20 +36,27 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -35,20 +36,27 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local b2=s2 and (Duel.GetFlagEffect(tp,id+o)==0 or not e:IsCostChecked()) local b2=s2 and (Duel.GetFlagEffect(tp,id+o)==0 or not e:IsCostChecked())
if chk==0 then return b1 or b2 end if chk==0 then return b1 or b2 end
local op=aux.SelectFromOptions(tp, local op=aux.SelectFromOptions(tp,
{b1,aux.Stringid(id,1)}, {b1,aux.Stringid(id,1),1},
{b2,aux.Stringid(id,2)}) {b2,aux.Stringid(id,2),2})
e:SetLabel(op)
if op==1 then if op==1 then
if e:IsCostChecked() then if e:IsCostChecked() then
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
e:SetOperation(s.spop1)
elseif op==2 then elseif op==2 then
if e:IsCostChecked() then if e:IsCostChecked() then
Duel.RegisterFlagEffect(tp,id+o,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(tp,id+o,RESET_PHASE+PHASE_END,0,1)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
e:SetOperation(s.spop2) end
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local op=e:GetLabel()
if op==1 then
s.spop1(e,tp,eg,ep,ev,re,r,rp)
elseif op==2 then
s.spop2(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function s.spop1(e,tp,eg,ep,ev,re,r,rp) function s.spop1(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -6,6 +6,7 @@ function c82768499.initial_effect(c) ...@@ -6,6 +6,7 @@ function c82768499.initial_effect(c)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetTarget(c82768499.target) e1:SetTarget(c82768499.target)
e1:SetOperation(c82768499.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c82768499.desfilter(c) function c82768499.desfilter(c)
...@@ -28,21 +29,27 @@ function c82768499.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -28,21 +29,27 @@ function c82768499.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
else else
op=Duel.SelectOption(tp,aux.Stringid(82768499,1))+1 op=Duel.SelectOption(tp,aux.Stringid(82768499,1))+1
end end
e:SetLabel(op)
if op==0 then if op==0 then
e:SetCategory(CATEGORY_DESTROY) e:SetCategory(CATEGORY_DESTROY)
e:SetProperty(EFFECT_FLAG_CARD_TARGET) e:SetProperty(EFFECT_FLAG_CARD_TARGET)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler()) local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
e:SetOperation(c82768499.desop)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
else else
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e:SetProperty(0) e:SetProperty(0)
local g=Duel.GetMatchingGroup(c82768499.thfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,nil)
e:SetOperation(c82768499.thop)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_EXTRA)
end end
end end
function c82768499.operation(e,tp,eg,ep,ev,re,r,rp)
local op=e:GetLabel()
if op==0 then
c82768499.desop(e,tp,eg,ep,ev,re,r,rp)
elseif op==1 then
c82768499.thop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c82768499.desop(e,tp,eg,ep,ev,re,r,rp) function c82768499.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end if tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end
......
...@@ -5,16 +5,17 @@ function c83880087.initial_effect(c) ...@@ -5,16 +5,17 @@ function c83880087.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_DISABLED) e1:SetCode(EVENT_ATTACK_DISABLED)
e1:SetTarget(c83880087.target) e1:SetTarget(c83880087.target)
e1:SetOperation(c83880087.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--remove overlay replace --remove overlay replace
local e1=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(83880087,2)) e2:SetDescription(aux.Stringid(83880087,2))
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_OVERLAY_REMOVE_REPLACE) e2:SetCode(EFFECT_OVERLAY_REMOVE_REPLACE)
e1:SetRange(LOCATION_GRAVE) e2:SetRange(LOCATION_GRAVE)
e1:SetCondition(c83880087.rcon) e2:SetCondition(c83880087.rcon)
e1:SetOperation(c83880087.rop) e2:SetOperation(c83880087.rop)
c:RegisterEffect(e1) c:RegisterEffect(e2)
end end
function c83880087.filter(c) function c83880087.filter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsSetCard(0x107f) return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsSetCard(0x107f)
...@@ -28,16 +29,23 @@ function c83880087.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -28,16 +29,23 @@ function c83880087.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
else else
op=Duel.SelectOption(tp,aux.Stringid(83880087,0)) op=Duel.SelectOption(tp,aux.Stringid(83880087,0))
end end
e:SetLabel(op)
if op==0 then if op==0 then
e:SetCategory(0) e:SetCategory(0)
e:SetProperty(0) e:SetProperty(0)
e:SetOperation(c83880087.endop)
else else
e:SetCategory(CATEGORY_ATKCHANGE) e:SetCategory(CATEGORY_ATKCHANGE)
e:SetProperty(EFFECT_FLAG_CARD_TARGET) e:SetProperty(EFFECT_FLAG_CARD_TARGET)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c83880087.filter,tp,LOCATION_MZONE,0,1,1,nil) Duel.SelectTarget(tp,c83880087.filter,tp,LOCATION_MZONE,0,1,1,nil)
e:SetOperation(c83880087.atkop) end
end
function c83880087.operation(e,tp,eg,ep,ev,re,r,rp)
local op=e:GetLabel()
if op==0 then
c83880087.endop(e,tp,eg,ep,ev,re,r,rp)
elseif op==1 then
c83880087.atkop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c83880087.endop(e,tp,eg,ep,ev,re,r,rp) function c83880087.endop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -9,6 +9,7 @@ function s.initial_effect(c) ...@@ -9,6 +9,7 @@ function s.initial_effect(c)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH) e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.condition) e1:SetCondition(s.condition)
e1:SetTarget(s.target) e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function s.condition(e,tp,eg,ep,ev,re,r,rp) function s.condition(e,tp,eg,ep,ev,re,r,rp)
...@@ -24,20 +25,28 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -24,20 +25,28 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
{b1,aux.Stringid(id,1)}, {b1,aux.Stringid(id,1)},
{b2,aux.Stringid(id,2)}, {b2,aux.Stringid(id,2)},
{true,aux.Stringid(id,3)}) {true,aux.Stringid(id,3)})
e:SetLabel(op)
if op==1 then if op==1 then
e:SetCategory(CATEGORY_POSITION) e:SetCategory(CATEGORY_POSITION)
e:SetOperation(s.defense)
Duel.SetOperationInfo(0,CATEGORY_POSITION,a,1,0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,a,1,0,0)
elseif op==2 then elseif op==2 then
e:SetCategory(CATEGORY_TOHAND) e:SetCategory(CATEGORY_TOHAND)
e:SetOperation(s.rtohand)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,d,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,d,1,0,0)
else else
e:SetCategory(CATEGORY_DESTROY) e:SetCategory(CATEGORY_DESTROY)
e:SetOperation(s.destroy)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,Group.FromCards(a,d),2,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,Group.FromCards(a,d),2,0,0)
end end
end end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local op=e:GetLabel()
if op==1 then
s.defense(e,tp,eg,ep,ev,re,r,rp)
elseif op==2 then
s.rtohand(e,tp,eg,ep,ev,re,r,rp)
elseif op==3 then
s.destroy(e,tp,eg,ep,ev,re,r,rp)
end
end
function s.defense(e,tp,eg,ep,ev,re,r,rp) function s.defense(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker() local tc=Duel.GetAttacker()
if tc:IsRelateToBattle() then Duel.ChangePosition(tc,POS_FACEUP_DEFENSE) end if tc:IsRelateToBattle() then Duel.ChangePosition(tc,POS_FACEUP_DEFENSE) end
......
...@@ -43,27 +43,32 @@ function c98918572.rop(e,tp,eg,ep,ev,re,r,rp) ...@@ -43,27 +43,32 @@ function c98918572.rop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.SelectMatchingCard(tp,c98918572.rfilter,tp,LOCATION_MZONE,0,1,1,rc,min,tp) local tg=Duel.SelectMatchingCard(tp,c98918572.rfilter,tp,LOCATION_MZONE,0,1,1,rc,min,tp)
return tg:GetFirst():RemoveOverlayCard(tp,min,max,REASON_EFFECT) return tg:GetFirst():RemoveOverlayCard(tp,min,max,REASON_EFFECT)
end end
function c98918572.xyzfilter(c) function c98918572.xyzfilter(c,e)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsSetCard(0xf1) return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsSetCard(0xf1) and c:IsCanBeEffectTarget(e)
end
function c98918572.gcheck(g)
return g:IsExists(Card.IsCanOverlay,1,nil)
end end
function c98918572.xyztg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c98918572.xyztg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c98918572.xyzfilter,tp,LOCATION_MZONE,0,2,nil) end local g=Duel.GetMatchingGroup(c98918572.xyzfilter,tp,LOCATION_MZONE,0,nil,e)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(98918572,1)) if chk==0 then return g:CheckSubGroup(c98918572.gcheck,2,2) end
Duel.SelectTarget(tp,c98918572.xyzfilter,tp,LOCATION_MZONE,0,2,2,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local sg=g:SelectSubGroup(tp,c98918572.gcheck,false,2,2)
Duel.SetTargetCard(sg)
end end
function c98918572.xyzop(e,tp,eg,ep,ev,re,r,rp) function c98918572.xyzop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e) local g=Duel.GetTargetsRelateToChain()
if g:GetCount()~=2 then return end if g:GetCount()~=2 then return end
if g:IsExists(Card.IsImmuneToEffect,1,nil,e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local xc=g:Select(tp,1,1,nil):GetFirst() local xc=g:FilterSelect(tp,Card.IsCanOverlay,1,1,nil):GetFirst()
g:RemoveCard(xc) if xc then
local tc=g:GetFirst() local tc=(g-xc):GetFirst()
if not tc:IsImmuneToEffect(e) then
local og=xc:GetOverlayGroup() local og=xc:GetOverlayGroup()
if og:GetCount()>0 then if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE) Duel.SendtoGrave(og,REASON_RULE)
end end
Duel.Overlay(tc,Group.FromCards(xc)) Duel.Overlay(tc,xc)
end end
end end
...@@ -13,32 +13,44 @@ function c99890852.initial_effect(c) ...@@ -13,32 +13,44 @@ function c99890852.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c99890852.filter(c,tp) function c99890852.filter(c,tp)
return c:IsFaceup() and c:IsSetCard(0xfb) return c99890852.thfilter(c,tp)
and c:IsAbleToHand() and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,c) and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,c)
end
function c99890852.thfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0xfb) and c:IsControler(tp)
and c:IsAbleToHand() and not c:IsExtraDeckMonster()
end
function c99890852.gcheck(g,tp)
return g:IsExists(c99890852.thfilter,1,nil,tp)
end end
function c99890852.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c99890852.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c99890852.filter,tp,LOCATION_MZONE,0,1,nil,tp) end if chk==0 then return Duel.IsExistingTarget(c99890852.filter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
local g=Duel.SelectTarget(tp,c99890852.filter,tp,LOCATION_MZONE,0,1,1,nil,tp) g=g:Filter(Card.IsCanBeEffectTarget,nil,e)
e:SetLabelObject(g:GetFirst()) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) local sg=g:SelectSubGroup(tp,c99890852.gcheck,false,2,2,tp)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,g) Duel.SetTargetCard(sg)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,0)
end end
function c99890852.activate(e,tp,eg,ep,ev,re,r,rp) function c99890852.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e) local g=Duel.GetTargetsRelateToChain()
if g:GetCount()~=2 then return end if #g==0 then return end
local hc=g:GetFirst() local tg=g:Filter(c99890852.thfilter,nil,tp)
local tc=g:GetNext() local tc1=tg:GetFirst()
if hc~=e:GetLabelObject() then tc,hc=hc,tc end if #tg>1 then
if hc:IsFaceup() and tc:IsFaceup() and Duel.SendtoHand(hc,nil,REASON_EFFECT)~=0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local atk=hc:GetBaseAttack() tc1=tg:Select(tp,1,1,nil):GetFirst()
end
if not tc1 then return end
local tc2=(g-tc1):GetFirst()
if Duel.SendtoHand(tc1,nil,REASON_EFFECT)~=0 and tc2 and tc2:IsFaceup() then
local atk=tc1:GetBaseAttack()
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk) e1:SetValue(atk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1) tc2:RegisterEffect(e1)
end end
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