Commit 25da195e authored by Nemo Ma's avatar Nemo Ma

fix

parent 8d68b401
......@@ -38,7 +38,7 @@ function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) and e:GetHandler():IsLocation(LOCATION_MZONE) end
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) and (e:GetHandler():IsLocation(LOCATION_MZONE) or Duel.GetMasterRule()<=4) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -32,10 +32,10 @@ function cm.retfilter(c)
return Duel.GetLocationCount(p,LOCATION_MZONE)>0
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and cm.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_REMOVED,0,1,nil) end
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and cm.tffilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.tffilter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_REMOVED,0,1,1,nil)
local g=Duel.SelectTarget(tp,cm.tffilter,tp,LOCATION_REMOVED,0,1,1,nil)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
......
......@@ -38,6 +38,8 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local fid=c:GetFieldID()
local sg=Duel.GetMatchingGroup(cm.rmfilter2,0,0xff,0xff,nil)
local sg2=Duel.GetOverlayGroup(0,1,1):Filter(cm.rmfilter2,nil)
sg:Merge(sg2)
for sc in aux.Next(sg) do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
......
......@@ -49,7 +49,7 @@ function c115043.initial_effect(c)
end
function c115043.cecon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetFlagEffect(115043)~=0 and c:GetFlagEffect(215043)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,115046,nil,TYPES_TOKEN_MONSTER,0,2000,6,RACE_WARRIOR,ATTRIBUTE_LIGHT)
return c:GetFlagEffect(115043)~=0 and c:GetFlagEffect(215043)==0 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummonMonster(1-tp,115046,nil,TYPES_TOKEN_MONSTER,0,2000,6,RACE_WARRIOR,ATTRIBUTE_LIGHT) and rp==1-tp
end
function c115043.ceop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -81,10 +81,8 @@ function c22348230.retg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,0,LOCATION_ONFIELD+LOCATION_GRAVE)
end
function c22348230.reop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
if re:GetHandler():IsRelateToEffect(re) then
Duel.Remove(eg,POS_FACEUP,REASON_EFFECT)
end
end
function c22348230.retop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -99,7 +99,7 @@ function cm.desop(e,tp,eg,ep,ev,re,r,rp)
end
end
function cm.cpcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and not re:IsHasType(EFFECT_TYPE_ACTIVATE) and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
return rp==1-tp and not (re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_PENDULUM)) and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
end
function cm.cpcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
......
......@@ -11,7 +11,8 @@ function cm.initial_effect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCountLimit(1)
e1:SetTarget(cm.atktg)
e1:SetOperation(cm.atkop)
......@@ -69,7 +70,7 @@ function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
end
end
function cm.negcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and rp~=tp and Duel.IsChainNegatable(ev) and e:GetLabel()==1
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and rp~=tp and Duel.IsChainNegatable(ev) and e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) and e:GetLabel()==1
end
function cm.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......
......@@ -34,7 +34,6 @@ function c29002019.itarget(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c29002019.ioperation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
......@@ -42,20 +41,28 @@ function c29002019.ioperation(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetValue(c29002019.val)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetValue(c29002019.efilter)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetReset(RESET_PHASE+PHASE_END)
c:RegisterEffect(e2)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetOwnerPlayer(tp)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(29002019,2))
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(29002019)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e3:SetTargetRange(1,0)
Duel.RegisterEffect(e3,tp)
end
function c29002019.val(e,c)
return c:GetBaseDefense()/2
end
function c29002019.efilter(e,te)
return te:GetOwner():GetControler()~=e:GetOwner():GetControler() and not te:IsHasProperty(EFFECT_FLAG_CARD_TARGET)
return te:GetOwnerPlayer()~=e:GetOwnerPlayer() and te:IsActivated() and not te:IsHasProperty(EFFECT_FLAG_CARD_TARGET)
end
function c29002019.lrop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ) then return false end
......
......@@ -11,7 +11,7 @@ function c29065511.initial_effect(c)
c:RegisterEffect(e1)
end
function c29065511.spfil1(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsSetCard(0x87af)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight))
end
function c29065511.spfil2(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsCode(29065502)
......
......@@ -212,12 +212,8 @@ function cm.copy(c,e)
end
function cm.cytg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
local g=c:GetOverlayGroup():Filter(cm.copy,nil,e)
if chkc then
local te=e:GetLabelObject()
local tg=te:GetTarget()
return tg(e,tp,eg,ep,ev,re,r,rp,0,chkc) and g:IsContains(chkc) and cm.copy(chkc,e)
end
local g=c:GetOverlayGroup():Filter(cm.copy,nil,e)
if chkc then return false end
if chk==0 then
return g:GetCount()>0 and e:GetHandler():GetFlagEffect(m+2)==0
end
......@@ -232,6 +228,7 @@ function cm.cytg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
e:GetHandler():RegisterFlagEffect(m+2,RESET_CHAIN,0,1)
e:GetHandler():RegisterFlagEffect(m+7,RESET_EVENT+RESETS_STANDARD,0,75)
local tg=te:GetTarget()
local re=Duel.GetChainInfo(ev-1,CHAININFO_TRIGGERING_EFFECT)
if tg then tg(e,tp,eg,ep,ev,re,r,rp,1) end
if Duel.GetCurrentPhase()==PHASE_STANDBY then
e:GetHandler():RegisterFlagEffect(m+3,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY,EFFECT_FLAG_OATH,2,Duel.GetTurnCount())
......@@ -251,6 +248,7 @@ function cm.cyop(e,tp,eg,ep,ev,re,r,rp)
if c:IsFaceup() then
local op=te:GetOperation()
if op then
local re=Duel.GetChainInfo(ev-1,CHAININFO_TRIGGERING_EFFECT)
op(e,tp,eg,ep,ev,re,r,rp)
end
local code=tc
......
......@@ -61,7 +61,7 @@ function cm.disfilter(c)
return c:IsCode(95440946) and c:IsFaceup()
end
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(cm.disfilter,e:GetHandler(),LOCATION_MZONE,0,nil)>0
return Duel.GetMatchingGroupCount(cm.disfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,nil)>0
end
function cm.disable(e,c)
if c:IsCode(95440946) then return false end
......
......@@ -31,5 +31,9 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if p==2 and d==0 then
p=tp
d=2
end
Duel.Draw(p,d,REASON_EFFECT)
end
\ No newline at end of file
......@@ -30,8 +30,8 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
g=grg:Filter(cm.filter,nil)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
Duel.BreakEffect()
local num=g:FilterCount(cm.td_filter,nil)
--local num=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK)
--local num=g:FilterCount(cm.td_filter,nil)
local num=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK)
for i=1,num do
local tk=Duel.CreateToken(1-tp,Seine_space_ghoti.sfcode)
Duel.SendtoDeck(tk,1-tp,SEQ_DECKBOTTOM,REASON_EFFECT)
......
......@@ -54,7 +54,7 @@ end
function s.spop0(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectMatchingCard(tp,s.spf0,tp,LOCATION_GRAVE+LOCATION_HAND+LOCATION_MZONE,0,1,1,e:GetHandler(),e:GetHandler(),ft)
local g1=Duel.SelectMatchingCard(tp,s.spf0,tp,LOCATION_GRAVE+LOCATION_HAND+LOCATION_MZONE,0,1,1,e:GetHandler(),e:GetHandler(),ft,tp)
local rc=g1:GetFirst()
local g2=Duel.SelectMatchingCard(tp,s.spf1,tp,LOCATION_GRAVE+LOCATION_HAND+LOCATION_MZONE,0,1,1,e:GetHandler(),rc,ft)
g1:Merge(g2)
......
......@@ -85,13 +85,19 @@ function c33200907.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,c33200907.setfilter,tp,LOCATION_DECK,0,1,1,nil)
local tc2=g:GetFirst()
if tc2 and Duel.SSet(tp,tc2)~=0 then
if tc2:IsType(TYPE_QUICKPLAY) then
if tc2:IsType(TYPE_QUICKPLAY) or tc2:IsType(TYPE_TRAP) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetCode(EFFECT_QP_ACT_IN_SET_TURN)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc2:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc2:RegisterEffect(e1)
end
Duel.SendtoExtraP(e:GetHandler(),tp,REASON_EFFECT)
end
......
......@@ -117,8 +117,8 @@ function c33200917.target(e,tp,eg,ep,ev,re,r,rp,chk)
local fc=Duel.GetFlagEffect(tp,33200917)
if fc>8 then fc=8 end
local cc=10-fc
if chk==0 then return Duel.IsCanRemoveCounter(tp,LOCATION_ONFIELD,LOCATION_ONFIELD,0x132a,cc,REASON_EFFECT) and c:GetFlagEffect(33200917)==0 end
c:RegisterFlagEffect(33200917,RESET_CHAIN,0,1)
if chk==0 then return Duel.IsCanRemoveCounter(tp,LOCATION_ONFIELD,LOCATION_ONFIELD,0x132a,cc,REASON_EFFECT) and c:GetFlagEffect(33200918)==0 end
c:RegisterFlagEffect(33200918,RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
end
function c33200917.operation(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -91,7 +91,7 @@ function cm.top(e,tp)
if sg:GetClassCount(Card.GetCode)==#sg and sg:IsExists(cm.rfilter2,1,nil) then
local rg=sg:Filter(cm.rfilter2,nil)
Duel.Recover(tp,rg:GetSum(Card.GetAttack),REASON_EFFECT)
else
elseif sg:GetClassCount(Card.GetCode)<#sg then
Duel.Damage(tp,#sg*2000,REASON_EFFECT)
end
end
......
......@@ -85,20 +85,23 @@ function cm.top(e,tp)
local g=Duel.GetOperatedGroup()
local sg=g:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
Duel.BreakEffect()
if sg:GetClassCount(Card.GetCode)==#sg and sg:IsExists(cm.rfilter2,1,nil) then
local rg=sg:Filter(cm.rfilter2,nil)
if sg:GetClassCount(Card.GetCode)==#sg then
local rct=sg:FilterCount(cm.rfilter2,nil)
local num=Duel.GetMatchingGroupCount(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,nil)
if rct==0 or num==0 then return end
if rct>num then rct=num end
if not Duel.SelectYesNo(tp,aux.Stringid(9910024,0)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg1=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,#rg,nil)
local sg1=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,rct,nil)
if sg1:GetCount()>0 then
Duel.SendtoHand(sg1,nil,REASON_EFFECT)
end
else
elseif sg:GetClassCount(Card.GetCode)<#sg then
local num=Duel.GetMatchingGroupCount(Card.IsAbleToGrave,tp,LOCATION_HAND+LOCATION_ONFIELD,0,nil)
if num<1 then return end
if num>#sg then num=#sg end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local ct=math.min(#sg,num)
local sg1=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_ONFIELD+LOCATION_HAND,0,ct,ct,nil)
local sg1=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_ONFIELD+LOCATION_HAND,0,num,num,nil)
if sg1:GetCount()>0 then
Duel.SendtoGrave(sg1,REASON_EFFECT)
end
......
......@@ -111,7 +111,7 @@ end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=e:GetHandler():GetOverlayGroup()
if chk==0 then
local res=e:GetLabel()==0 or #g>2
local res=e:GetLabel()==0 or #g>=2
e:SetLabel(0)
return res and g:IsExists(Card.IsAbleToHand,1,nil)
end
......
......@@ -3,6 +3,7 @@ function c35399020.initial_effect(c)
--
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(35399020,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DRAW+CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,35399020)
......
......@@ -9,7 +9,7 @@ end
function cm.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunRep2(c,cm.mfilter,2,63,false)
aux.AddFusionProcFunRep2(c,cm.mfilter,2,63,true)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
......
......@@ -9,7 +9,7 @@ end
function cm.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunRep2(c,cm.mfilter,2,63,false)
aux.AddFusionProcFunRep2(c,cm.mfilter,2,63,true)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
......
......@@ -9,7 +9,7 @@ end
function cm.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunRep2(c,cm.mfilter,2,63,false)
aux.AddFusionProcFunRep2(c,cm.mfilter,2,63,true)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
......
......@@ -9,7 +9,7 @@ end
function cm.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunRep2(c,cm.mfilter,2,63,false)
aux.AddFusionProcFunRep2(c,cm.mfilter,2,63,true)
--banish
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
......
......@@ -18,8 +18,8 @@ function cm.initial_effect(c)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetCost(cm.setcost)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
e1:SetTarget(cm.settg)
e1:SetOperation(cm.setop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
......
......@@ -30,7 +30,7 @@ function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
if chk==0 then return Duel.GetFlagEffect(tp,m)==0 and Duel.GetCustomActivityCount(m,tp,ACTIVITY_CHAIN)==0 and Duel.GetCurrentPhase()==PHASE_MAIN1 and not Duel.CheckPhaseActivity() end
if chk==0 then return Duel.GetFlagEffect(tp,m)==0 and Duel.GetCustomActivityCount(m,tp,ACTIVITY_CHAIN)==0 and Duel.GetCurrentPhase()==PHASE_MAIN1 and Duel.GetTurnPlayer()==tp and not Duel.CheckPhaseActivity() end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
......
......@@ -65,6 +65,6 @@ function cm.postg(e,c)
end
function cm.damval(e,re,dam,r,rp,rc)
if bit.band(r,REASON_BATTLE)~=0 and Duel.GetAttacker()==e:GetHandler() and e:GetHandler():GetBattleTarget()~=nil and e:GetHandler():GetBattleTarget():IsPosition(POS_DEFENSE) then
return dam*4
return dam*3
else return dam end
end
\ No newline at end of file
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