Commit ad1c4589 authored by mercury233's avatar mercury233

fix missing tp

parent 4fb21466
......@@ -17,7 +17,7 @@ function c23536866.filter(c,e,tp)
return c:IsLevel(5) and c:IsAttribute(ATTRIBUTE_WATER) and not c:IsCode(23536866)
and c:IsCanBeEffectTarget(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c23536866.xyzfilter(c,mg)
function c23536866.xyzfilter(c,mg,tp)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsXyzSummonable(mg,2,2) and Duel.GetLocationCountFromEx(tp,tp,mg,c)>0
end
function c23536866.mfilter1(c,mg,exg)
......@@ -29,7 +29,7 @@ end
function c23536866.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local mg=Duel.GetMatchingGroup(c23536866.filter,tp,LOCATION_GRAVE,0,nil,e,tp)
local exg=Duel.GetMatchingGroup(c23536866.xyzfilter,tp,LOCATION_EXTRA,0,nil,mg)
local exg=Duel.GetMatchingGroup(c23536866.xyzfilter,tp,LOCATION_EXTRA,0,nil,mg,tp)
if chk==0 then return Duel.IsPlayerCanSpecialSummonCount(tp,2)
and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
......@@ -70,7 +70,7 @@ function c23536866.operation(e,tp,eg,ep,ev,re,r,rp)
local e4=e3:Clone()
tc2:RegisterEffect(e4)
Duel.SpecialSummonComplete()
local xyzg=Duel.GetMatchingGroup(c23536866.xyzfilter,tp,LOCATION_EXTRA,0,nil,g)
local xyzg=Duel.GetMatchingGroup(c23536866.xyzfilter,tp,LOCATION_EXTRA,0,nil,g,tp)
if xyzg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local xyz=xyzg:Select(tp,1,1,nil):GetFirst()
......
......@@ -28,7 +28,7 @@ function c25148255.mfilter(c,e,tp,mc)
return c:IsSetCard(0x43) and not c:IsType(TYPE_TUNER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(c25148255.scfilter,tp,LOCATION_EXTRA,0,1,nil,mg)
end
function c25148255.scfilter(c,mg)
function c25148255.scfilter(c,mg,tp)
return aux.IsMaterialListSetCard(c,0x1017) and c:IsSynchroSummonable(nil,mg) and Duel.GetLocationCountFromEx(tp,tp,mg,c)>0
end
function c25148255.sctg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......@@ -48,7 +48,7 @@ function c25148255.scop(e,tp,eg,ep,ev,re,r,rp)
if not tc:IsRelateToEffect(e) or Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)==0 then return end
if not c:IsRelateToEffect(e) then return end
local mg=Group.FromCards(c,tc)
local g=Duel.GetMatchingGroup(c25148255.scfilter,tp,LOCATION_EXTRA,0,nil,mg)
local g=Duel.GetMatchingGroup(c25148255.scfilter,tp,LOCATION_EXTRA,0,nil,mg,tp)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
......
......@@ -56,12 +56,12 @@ function c40227329.initial_effect(c)
c:RegisterEffect(e7)
end
function c40227329.damcon(e)
return Duel.GetFlagEffect(tp,40227329)==0
return Duel.GetFlagEffect(e:GetHandlerPlayer(),40227329)==0
end
function c40227329.damval(e,re,val,r,rp,rc)
local c=e:GetHandler()
if bit.band(r,REASON_EFFECT)~=0 and c:GetFlagEffect(40227329)==0 then
Duel.RegisterFlagEffect(tp,40227329,RESET_PHASE+PHASE_END,0,1)
Duel.RegisterFlagEffect(e:GetHandlerPlayer(),40227329,RESET_PHASE+PHASE_END,0,1)
return 0
end
return val
......
......@@ -24,19 +24,19 @@ function c45943123.initial_effect(c)
e2:SetOperation(c45943123.drop)
c:RegisterEffect(e2)
end
function c45943123.cfilter(c)
function c45943123.cfilter(c,tp)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WATER) and c:IsType(TYPE_XYZ) and c:CheckRemoveOverlayCard(tp,1,REASON_EFFECT)
end
function c45943123.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local b=e:IsHasType(EFFECT_TYPE_ACTIVATE) and e:GetHandler():IsLocation(LOCATION_HAND)
local ct=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
if b then ct=ct-1 end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c45943123.cfilter(chkc) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c45943123.cfilter(chkc,tp) end
if chk==0 then
return Duel.IsExistingTarget(c45943123.cfilter,tp,LOCATION_MZONE,0,1,nil) and ct>0
return Duel.IsExistingTarget(c45943123.cfilter,tp,LOCATION_MZONE,0,1,nil,tp) and ct>0
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c45943123.cfilter,tp,LOCATION_MZONE,0,1,1,nil)
local g=Duel.SelectTarget(tp,c45943123.cfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,ct*400)
end
function c45943123.activate(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -21,8 +21,9 @@ end
function c47128571.desfilter(c,def)
return c:IsFaceup() and c:GetAttack()<=def
end
function c47128571.cfilter(c)
return c:IsType(TYPE_MONSTER) and not c:IsType(TYPE_LINK) and c:IsLocation(LOCATION_GRAVE) and Duel.IsExistingMatchingCard(c47128571.desfilter,tp,0,LOCATION_MZONE,1,nil,c:GetDefense())
function c47128571.cfilter(c,tp)
return c:IsType(TYPE_MONSTER) and not c:IsType(TYPE_LINK) and c:IsLocation(LOCATION_GRAVE)
and Duel.IsExistingMatchingCard(c47128571.desfilter,tp,0,LOCATION_MZONE,1,nil,c:GetDefense())
end
function c47128571.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
......@@ -31,10 +32,10 @@ function c47128571.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
local sg=Duel.GetOperatedGroup()
if sg:GetCount()>0 and Duel.NegateAttack() and sg:IsExists(c47128571.cfilter,1,nil) then
if sg:GetCount()>0 and Duel.NegateAttack() and sg:IsExists(c47128571.cfilter,1,nil,tp) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(47128571,0))
local cg=sg:FilterSelect(tp,c47128571.cfilter,1,1,nil)
local cg=sg:FilterSelect(tp,c47128571.cfilter,1,1,nil,tp)
Duel.HintSelection(cg)
local dg=Duel.GetMatchingGroup(c47128571.desfilter,tp,0,LOCATION_MZONE,nil,cg:GetFirst():GetDefense())
if Duel.Destroy(dg,REASON_EFFECT)~=0 then
......
......@@ -10,7 +10,7 @@ function c81223446.initial_effect(c)
e1:SetOperation(c81223446.activate)
c:RegisterEffect(e1)
end
function c81223446.filter1(c)
function c81223446.filter1(c,tp)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToRemove(tp,POS_FACEDOWN)
end
function c81223446.filter2(c,e,tp,m,f,chkf)
......@@ -20,7 +20,7 @@ end
function c81223446.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetMatchingGroup(c81223446.filter1,tp,LOCATION_GRAVE,0,nil)
local mg1=Duel.GetMatchingGroup(c81223446.filter1,tp,LOCATION_GRAVE,0,nil,tp)
local res=Duel.IsExistingMatchingCard(c81223446.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
......@@ -38,7 +38,7 @@ function c81223446.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c81223446.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetMatchingGroup(aux.NecroValleyFilter(c81223446.filter1),tp,LOCATION_GRAVE,0,nil)
local mg1=Duel.GetMatchingGroup(aux.NecroValleyFilter(c81223446.filter1),tp,LOCATION_GRAVE,0,nil,tp)
local sg1=Duel.GetMatchingGroup(c81223446.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg2=nil
local sg2=nil
......
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