Commit 089cb0e6 authored by wind2009's avatar wind2009

Merge remote-tracking branch 'upstream/master' into master

parents 658c58cc 5acfe9ea
......@@ -100,7 +100,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
function s.tffilter(c,tp)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsType(TYPE_CONTINUOUS) and c:IsSetCard(0xae) and not c:IsForbidden() and c:CheckUniqueOnField(tp)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsType(TYPE_CONTINUOUS) and c:IsSetCard(0xae) and c:IsFaceupEx() and not c:IsForbidden() and c:CheckUniqueOnField(tp)
end
function s.mfilter(c)
return c:IsFaceup() and c:IsSetCard(0x10af)
......@@ -120,7 +120,8 @@ function s.tftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function s.tfop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetTargetsRelateToChain()
local ct=math.min(g:GetCount(),Duel.GetLocationCount(tp,LOCATION_SZONE))
local sct=Duel.GetLocationCount(tp,LOCATION_SZONE)
local ct=math.min(g:GetCount(),sct)
local pg=g
if ct<=0 then
pg=Group.CreateGroup()
......
......@@ -66,7 +66,7 @@ function s.descost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) end
if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) and Duel.IsPlayerCanRemove(tp) end
local sg=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_DECK)
......@@ -74,8 +74,11 @@ end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sg=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
local rtc=sg:IsExists(Card.IsType,1,nil,TYPE_TOKEN) and Duel.IsPlayerCanRemove(tp)
local ct=Duel.Destroy(sg,REASON_EFFECT,LOCATION_REMOVED)
if ct==0 then return end
local rg=sg:Filter(Card.IsLocation,nil,LOCATION_REMOVED)
if not rtc and rg:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
......
......@@ -4,11 +4,30 @@ function c27870337.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_LIMIT_ZONE)
e1:SetCountLimit(1,27870337+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c27870337.target)
e1:SetOperation(c27870337.activate)
e1:SetValue(c27870337.zones)
c:RegisterEffect(e1)
end
function c27870337.sel3(tp)
return Duel.IsExistingMatchingCard(c27870337.toexfilter1,tp,LOCATION_PZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c27870337.toexfilter2,tp,LOCATION_PZONE,0,1,nil)
and Duel.IsPlayerCanDraw(tp,2)
end
function c27870337.zones(e,tp,eg,ep,ev,re,r,rp)
local zone=0xff
local b3=c27870337.sel3(tp)
if b3 then return zone end
local p0=Duel.CheckLocation(tp,LOCATION_PZONE,0)
local p1=Duel.CheckLocation(tp,LOCATION_PZONE,1)
local b=e:IsHasType(EFFECT_TYPE_ACTIVATE) and not e:GetHandler():IsLocation(LOCATION_SZONE)
if not b or p0 and p1 then return zone end
if p0 then zone=zone-0x1 end
if p1 then zone=zone-0x10 end
return zone
end
function c27870337.pendfilter(c)
return c:IsSetCard(0x162) and c:IsType(TYPE_PENDULUM) and not c:IsForbidden()
end
......@@ -34,9 +53,7 @@ function c27870337.target(e,tp,eg,ep,ev,re,r,rp,chk)
and Duel.IsExistingMatchingCard(c27870337.pendfilter1,tp,LOCATION_DECK,0,1,nil)
and Duel.IsExistingMatchingCard(c27870337.pendfilter2,tp,LOCATION_DECK,0,1,nil)
and Duel.CheckLocation(tp,LOCATION_PZONE,0) and Duel.CheckLocation(tp,LOCATION_PZONE,1)
local b3=Duel.IsExistingMatchingCard(c27870337.toexfilter1,tp,LOCATION_PZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c27870337.toexfilter2,tp,LOCATION_PZONE,0,1,nil)
and Duel.IsPlayerCanDraw(tp,2)
local b3=c27870337.sel3(tp)
if chk==0 then return b1 or b2 or b3 end
local off=1
local ops,opval={},{}
......@@ -62,7 +79,7 @@ function c27870337.target(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetCategory(0)
elseif sel==1 then
e:SetCategory(0)
else
elseif sel==2 then
e:SetCategory(CATEGORY_DRAW)
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
......@@ -100,7 +117,7 @@ function c27870337.activate(e,tp,eg,ep,ev,re,r,rp)
end
end
end
else
elseif sel==2 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(27870337,3))
local g1=Duel.SelectMatchingCard(tp,c27870337.toexfilter1,tp,LOCATION_PZONE,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(27870337,3))
......
......@@ -6,7 +6,7 @@ function c32302078.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_XYZ_LEVEL)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetRange(LOCATION_EXTRA)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c32302078.lvtg)
......
......@@ -54,18 +54,15 @@ end
function c38811586.spfilter(c,e,tp)
return c:IsCanBeEffectTarget(e) and c:IsType(TYPE_MONSTER)
end
function c38811586.spsumfilter1(c,e,tp)
function c38811586.spsumfilter1(c,e,tp,g)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp)
and g:IsExists(c38811586.spsumfilter2,1,c,e,tp)
end
function c38811586.spsumfilter2(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp)
end
function c38811586.gcheck(g,e,tp)
if #g~=2 then return false end
local ac=g:GetFirst()
local bc=g:GetNext()
return c38811586.spsumfilter1(ac,e,tp) and c38811586.spsumfilter2(bc,e,tp)
or c38811586.spsumfilter1(bc,e,tp) and c38811586.spsumfilter2(ac,e,tp)
return g:IsExists(c38811586.spsumfilter1,1,nil,e,tp,g)
end
function c38811586.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
......@@ -74,7 +71,7 @@ function c38811586.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local ft1=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ft2=Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)
return not Duel.IsPlayerAffectedByEffect(tp,59822133) and ft1>0 and ft2>0
and g:CheckSubGroup(c38811586.gcheck,2,2,e,tp)
and g:IsExists(c38811586.spsumfilter1,1,nil,e,tp,g)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroup(tp,c38811586.gcheck,false,2,2,e,tp)
......@@ -86,9 +83,10 @@ function c38811586.spop(e,tp,eg,ep,ev,re,r,rp)
local ft2=Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) or ft1<=0 or ft2<=0 then return end
local g=Duel.GetTargetsRelateToChain()
if not g:CheckSubGroup(c38811586.gcheck,2,2,e,tp) then return end
if #g~=2 then return end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(38811586,1))
local sg=g:FilterSelect(tp,c38811586.spsumfilter1,1,1,nil,e,tp)
local sg=g:FilterSelect(tp,c38811586.spsumfilter1,1,1,nil,e,tp,g)
if #sg==0 then return end
Duel.SpecialSummonStep(sg:GetFirst(),0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummonStep((g-sg):GetFirst(),0,tp,1-tp,false,false,POS_FACEUP)
Duel.SpecialSummonComplete()
......
......@@ -70,7 +70,7 @@ end
function s.ctcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
and ep==1-tp
and (re:GetActivateLocation()&LOCATION_ONFIELD)>0
and ((re:GetActivateLocation()&LOCATION_ONFIELD)>0 or re:IsHasType(EFFECT_TYPE_ACTIVATE))
end
function s.ctcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
......
......@@ -36,11 +36,11 @@ function c61728808.eqfilter(c)
return c:IsFaceup() and c:IsSetCard(0xe1)
end
function c61728808.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c61728808.filter(chkc) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c61728808.eqfilter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c61728808.filter,tp,LOCATION_MZONE,0,1,nil) end
and Duel.IsExistingTarget(c61728808.eqfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c61728808.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SelectTarget(tp,c61728808.eqfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
function c61728808.eqop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -62,7 +62,8 @@ function s.nttg(e,c)
return c:IsLevelAbove(5)
end
function s.costchange(e,re,rp,val)
if re and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetHandler():IsType(TYPE_SPELL+TYPE_TRAP) then
if re and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetHandler():IsType(TYPE_SPELL+TYPE_TRAP)
and not Duel.IsChainSolving() then
return 0
else return val end
end
......
......@@ -6,7 +6,7 @@ function c73082255.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_XYZ_LEVEL)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetRange(LOCATION_EXTRA)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c73082255.lvtg)
......
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