Commit e305cf83 authored by nekrozar's avatar nekrozar

fix field check

parent 5bf4218d
......@@ -45,7 +45,7 @@ end
function c1872843.spcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return (ph==PHASE_MAIN1 or (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE) or ph==PHASE_MAIN2)
and Duel.IsEnvironment(1050355)
and Duel.IsEnvironment(1050355,PLAYER_ALL,LOCATION_FZONE)
end
function c1872843.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
......
......@@ -39,7 +39,7 @@ function c34031284.lcheck(g,lc)
return g:IsExists(Card.IsLinkSetCard,1,nil,0xf)
end
function c34031284.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsEnvironment(90011152)
return Duel.IsEnvironment(90011152,PLAYER_ALL,LOCATION_FZONE)
end
function c34031284.refcon(e)
return Duel.GetAttackTarget()==e:GetHandler()
......
......@@ -46,7 +46,7 @@ end
function c38267552.spcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return (ph==PHASE_MAIN1 or (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE) or ph==PHASE_MAIN2)
and Duel.IsEnvironment(74665651)
and Duel.IsEnvironment(74665651,PLAYER_ALL,LOCATION_FZONE)
end
function c38267552.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
......
......@@ -44,7 +44,7 @@ function c41916534.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
if not Duel.IsEnvironment(72283691) then
if not Duel.IsEnvironment(72283691,PLAYER_ALL,LOCATION_FZONE) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
......@@ -59,7 +59,7 @@ function c41916534.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return c:IsLocation(LOCATION_EXTRA)
end
function c41916534.atkcon(e)
return Duel.IsEnvironment(72283691)
return Duel.IsEnvironment(72283691,PLAYER_ALL,LOCATION_FZONE)
end
function c41916534.atkfilter(c)
return c:IsFaceup() and c:IsCode(73405179)
......
......@@ -11,12 +11,9 @@ function c42175079.initial_effect(c)
e1:SetOperation(c42175079.activate)
c:RegisterEffect(e1)
end
function c42175079.filter(c)
return c:IsFaceup() and c:IsCode(10080320)
end
function c42175079.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_END and Duel.GetTurnPlayer()==tp
and Duel.IsExistingMatchingCard(c42175079.filter,tp,LOCATION_ONFIELD,0,1,nil)
and Duel.IsEnvironment(10080320,tp)
end
function c42175079.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
......
......@@ -24,14 +24,14 @@ function c45072394.initial_effect(c)
end
function c45072394.target(e,tp,eg,ep,ev,re,r,rp,chk)
local loc=0
if Duel.IsEnvironment(72283691) then
if Duel.IsEnvironment(72283691,PLAYER_ALL,LOCATION_FZONE) then
loc=LOCATION_MZONE
end
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_MZONE,loc,1,nil) end
end
function c45072394.operation(e,tp,eg,ep,ev,re,r,rp)
local loc=0
if Duel.IsEnvironment(72283691) then
if Duel.IsEnvironment(72283691,PLAYER_ALL,LOCATION_FZONE) then
loc=LOCATION_MZONE
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
......
......@@ -35,11 +35,11 @@ function c46294982.initial_effect(c)
end
function c46294982.ntcon(e,c,minc)
if c==nil then return true end
return minc==0 and c:IsLevelAbove(5) and Duel.IsEnvironment(72283691)
return minc==0 and c:IsLevelAbove(5) and Duel.IsEnvironment(72283691,PLAYER_ALL,LOCATION_FZONE)
and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
function c46294982.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsEnvironment(72283691)
return Duel.IsEnvironment(72283691,PLAYER_ALL,LOCATION_FZONE)
end
function c46294982.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
......
......@@ -48,7 +48,7 @@ end
function c49389190.spcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return (ph==PHASE_MAIN1 or (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE) or ph==PHASE_MAIN2)
and Duel.IsEnvironment(1050355)
and Duel.IsEnvironment(1050355,PLAYER_ALL,LOCATION_FZONE)
end
function c49389190.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
......
......@@ -42,7 +42,7 @@ function c6133894.hdtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,1-tp,3)
end
function c6133894.hdop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsEnvironment(94585852) then
if Duel.IsEnvironment(94585852,tp) then
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND):RandomSelect(tp,3)
Duel.SendtoGrave(g,REASON_EFFECT+REASON_DISCARD)
end
......
......@@ -37,7 +37,7 @@ function c73405179.thcon(e,tp,eg,ep,ev,re,r,rp)
return c:IsReason(REASON_EFFECT) and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function c73405179.thfilter(c)
return (c:IsCode(41916534) or (Duel.IsEnvironment(72283691) and c:IsRace(RACE_WARRIOR))) and c:IsAbleToHand()
return (c:IsCode(41916534) or (Duel.IsEnvironment(72283691,PLAYER_ALL,LOCATION_FZONE) and c:IsRace(RACE_WARRIOR))) and c:IsAbleToHand()
end
function c73405179.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c73405179.thfilter,tp,LOCATION_DECK,0,1,nil) end
......
......@@ -5,7 +5,7 @@ function c75375465.initial_effect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_SZONE,0)
e1:SetTargetRange(LOCATION_ONFIELD,0)
e1:SetTarget(c75375465.indtg)
e1:SetValue(c75375465.indval)
c:RegisterEffect(e1)
......
......@@ -49,7 +49,7 @@ end
function c75888208.spcon2(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return (ph==PHASE_MAIN1 or (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE) or ph==PHASE_MAIN2)
and Duel.IsEnvironment(74665651)
and Duel.IsEnvironment(74665651,PLAYER_ALL,LOCATION_FZONE)
end
function c75888208.spcost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
......
......@@ -44,7 +44,7 @@ function c78527720.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c78527720.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0
and Duel.IsEnvironment(72283691) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsEnvironment(72283691,PLAYER_ALL,LOCATION_FZONE) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c78527720.efilter,tp,LOCATION_DECK,0,1,nil,c)
and c:IsRelateToEffect(e) and c:IsFaceup() and Duel.SelectYesNo(tp,aux.Stringid(78527720,1)) then
Duel.BreakEffect()
......
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