Commit a7570a36 authored by Chen Bill's avatar Chen Bill

fix: chkc

parent 1e10dded
......@@ -25,7 +25,7 @@ function c10497636.initial_effect(c)
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCountLimit(1)
e3:SetCondition(c10497636.atkcon)
......
......@@ -18,7 +18,6 @@ function c14365823.initial_effect(c)
e2:SetDescription(aux.Stringid(14365823,0))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c14365823.damcon2)
......
......@@ -55,8 +55,9 @@ function c24557335.tgfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c24557335.descfilter(c,tp)
and c:IsCanBeEffectTarget(e) and c:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED)
end
function c24557335.destg(e,tp,eg,ep,ev,re,r,rp,chk)
function c24557335.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=eg:Filter(c24557335.tgfilter,nil,e,tp)
if chkc then return eg:IsContains(chkc) and c24557335.tgfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and g:GetCount()>0 end
local c=nil
if g:GetCount()>1 then
......
......@@ -20,7 +20,6 @@ function c50588353.initial_effect(c)
e2:SetDescription(aux.Stringid(50588353,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_MAIN_END+TIMING_BATTLE_START+TIMING_BATTLE_END)
e2:SetRange(LOCATION_MZONE)
......
......@@ -18,7 +18,8 @@ end
function c55488859.filter(c,e,tp)
return c:IsSetCard(0x604e) and c:IsCanBeSpecialSummoned(e,SUMMON_VALUE_EVOLTILE,tp,false,false)
end
function c55488859.target(e,tp,eg,ep,ev,re,r,rp,chk)
function c55488859.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c55488859.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c55488859.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
......@@ -16,7 +16,8 @@ function s.dfilter(c,tp)
if c:IsControler(tp) and c:GetBaseAttack()<2 then return false end
return c:IsFaceup() and c:GetBaseAttack()>0 and c:IsRace(RACE_PYRO)
end
function s.tg(e,tp,eg,ep,ev,re,r,rp,chk)
function s.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.dfilter(chkc,tp) end
local b1=Duel.GetFlagEffect(tp,id)==0
and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil,e,tp)
local b2=Duel.GetFlagEffect(tp,id+o)==0
......
......@@ -93,7 +93,8 @@ function s.odescon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return (Duel.GetAttacker()==c or Duel.GetAttackTarget()==c) and c:GetFlagEffectLabel(id)==1
end
function s.odestg(e,tp,eg,ep,ev,re,r,rp,chk)
function s.odestg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
......
......@@ -15,7 +15,7 @@ function c65664792.initial_effect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_DESTROYED)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,65664793)
e2:SetCondition(c65664792.thcon)
e2:SetTarget(c65664792.thtg)
......
......@@ -29,7 +29,8 @@ function c68941332.filter(c,check)
return c:IsFaceup() and (c:IsType(TYPE_EFFECT) or bit.band(c:GetOriginalType(),TYPE_EFFECT)==TYPE_EFFECT)
and (check or c:IsAbleToChangeControler())
end
function c68941332.target(e,tp,eg,ep,ev,re,r,rp,chk)
function c68941332.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and c68941332.filter(chkc,true) end
if chk==0 then return Duel.IsExistingTarget(c68941332.filter,tp,0,LOCATION_MZONE,1,nil,true) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c68941332.filter,tp,0,LOCATION_MZONE,1,1,nil,true)
......@@ -55,10 +56,11 @@ function c68941332.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.SelectReleaseGroup(tp,c68941332.rfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function c68941332.target2(e,tp,eg,ep,ev,re,r,rp,chk)
function c68941332.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and c68941332.filter(chkc,false) end
if chk==0 then return e:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsExistingTarget(c68941332.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c68941332.filter,tp,0,LOCATION_MZONE,1,1,nil)
local g=Duel.SelectTarget(tp,c68941332.filter,tp,0,LOCATION_MZONE,1,1,nil,false)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
end
function c68941332.activate2(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -32,7 +32,8 @@ function s.initial_effect(c)
e3:SetOperation(s.hlpop)
c:RegisterEffect(e3)
end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk)
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and aux.NegateEffectMonsterFilter(chkc) end
if chk==0 then return true end
if Duel.IsExistingTarget(aux.NegateEffectMonsterFilter,tp,0,LOCATION_MZONE,1,nil)
and Duel.SelectEffectYesNo(tp,e:GetHandler(),aux.Stringid(id,2)) then
......
......@@ -5,7 +5,7 @@ function c81263643.initial_effect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,81263643)
e1:SetCost(c81263643.cost)
e1:SetTarget(c81263643.target)
......
......@@ -26,7 +26,8 @@ end
function c83554231.thfilter(c,e)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x119) and c:IsAbleToHand() and c:IsCanBeEffectTarget(e)
end
function c83554231.target(e,tp,eg,ep,ev,re,r,rp,chk)
function c83554231.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c83554231.thfilter(chkc,e) end
local g=Duel.GetMatchingGroup(c83554231.thfilter,tp,LOCATION_GRAVE,0,nil,e)
if chk==0 then return g:GetClassCount(Card.GetCode)>=2 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
......
......@@ -11,7 +11,8 @@ end
function c84117021.filter(c)
return c:IsFaceup() and c:IsRace(RACE_SPELLCASTER)
end
function c84117021.target(e,tp,eg,ep,ev,re,r,rp,chk)
function c84117021.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c84117021.filter(chkc) end
if chk==0 then return true end
local opt=0
if Duel.IsExistingTarget(c84117021.filter,tp,LOCATION_MZONE,0,1,nil) then
......
......@@ -31,7 +31,8 @@ function c88962829.thfilter(c,e)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x170) and c:IsAbleToHand()
and (not c:IsLocation(LOCATION_REMOVED) or c:IsFaceup()) and c:IsCanBeEffectTarget(e)
end
function c88962829.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
function c88962829.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and c88962829.thfilter(chkc,e) end
local g=Duel.GetMatchingGroup(c88962829.thfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e)
if chk==0 then return g:GetClassCount(Card.GetCode)>=2 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
......
......@@ -27,7 +27,7 @@ function c92015800.initial_effect(c)
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e3:SetValue(c92015800.indval2)
c:RegisterEffect(e3)
--
--3rd: get material
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(92015800,0))
e4:SetType(EFFECT_TYPE_QUICK_O)
......@@ -71,7 +71,8 @@ end
function c92015800.xyzfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsCanOverlay()
end
function c92015800.xyztg(e,tp,eg,ep,ev,re,r,rp,chk)
function c92015800.xyztg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_GRAVE) and c92015800.xyzfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c92015800.xyzfilter,tp,0,LOCATION_GRAVE,1,nil)
and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_EFFECT) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
......
......@@ -31,7 +31,8 @@ function c93612434.spfilter(c,e,tp)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x102) and c:IsCanBeEffectTarget(e)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c93612434.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
function c93612434.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c93612434.spfilter(chkc,e,tp) end
local g=Duel.GetMatchingGroup(c93612434.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp)
if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler())>=2 and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and g:GetClassCount(Card.GetCode)>=2 end
......
......@@ -23,7 +23,8 @@ end
function c97648103.thfilter(c,e)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0xfd) and c:IsAbleToHand() and c:IsCanBeEffectTarget(e)
end
function c97648103.target(e,tp,eg,ep,ev,re,r,rp,chk)
function c97648103.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c97648103.thfilter(chkc,e) end
local g=Duel.GetMatchingGroup(c97648103.thfilter,tp,LOCATION_GRAVE,0,nil,e)
if chk==0 then return g:GetClassCount(Card.GetCode)>=2 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
......
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