Commit ae02b9af authored by Nemo Ma's avatar Nemo Ma

fix

parent 0148d854
......@@ -243,11 +243,11 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
end
function cm.distg(e,c)
local tp=e:GetHandlerPlayer()
return c:IsType(TYPE_SPELL+TYPE_TRAP) and not c:IsType(TYPE_TRAPMONSTER) and aux.GetColumn(c,tp)==aux.GetColumn(e:GetHandler(),tp)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and not c:IsType(TYPE_TRAPMONSTER) and aux.GetColumn(c,tp)==aux.GetColumn(e:GetHandler(),tp) and c~=e:GetHandler()
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE)
if loc&LOCATION_ONFIELD~=0 and seq<=4 and re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and seq==aux.GetColumn(e:GetHandler(),rp) and not re:GetHandler():IsType(TYPE_TRAPMONSTER) then
if loc&LOCATION_ONFIELD~=0 and seq<=4 and re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and seq==aux.GetColumn(e:GetHandler(),rp) and not re:GetHandler():IsType(TYPE_TRAPMONSTER) and re:GetHandler()~=e:GetHandler() then
Duel.NegateEffect(ev)
end
end
......@@ -284,15 +284,15 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
e2:SetCode(EVENT_CHAIN_NEGATED)
Duel.RegisterEffect(e2,tp)
--control
c:RegisterFlagEffect(m+100,RESET_EVENT+RESETS_WITHOUT_TEMP_REMOVE,0,1,c:GetFieldID())
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_SET_CONTROL)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
e3:SetLabel(c:GetFieldID())
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(function(se,sc) return se:GetLabel()==sc:GetFieldID() end)
e3:SetTarget(function(se,sc) return sc:GetFlagEffect(m+100)>0 and se:GetLabel()==sc:GetFlagEffectLabel(m+100) end)
e3:SetValue(tp)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
Duel.RegisterEffect(e3,tp)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -285,15 +285,15 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
e2:SetCode(EVENT_CHAIN_NEGATED)
Duel.RegisterEffect(e2,tp)
--control
c:RegisterFlagEffect(m+100,RESET_EVENT+RESETS_WITHOUT_TEMP_REMOVE,0,1,c:GetFieldID())
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_SET_CONTROL)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
e3:SetLabel(c:GetFieldID())
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(function(se,sc) return se:GetLabel()==sc:GetFieldID() end)
e3:SetTarget(function(se,sc) return sc:GetFlagEffect(m+100)>0 and se:GetLabel()==sc:GetFlagEffectLabel(m+100) end)
e3:SetValue(tp)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
Duel.RegisterEffect(e3,tp)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -230,15 +230,15 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
e2:SetCode(EVENT_CHAIN_NEGATED)
Duel.RegisterEffect(e2,tp)
--control
c:RegisterFlagEffect(m+100,RESET_EVENT+RESETS_WITHOUT_TEMP_REMOVE,0,1,c:GetFieldID())
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_SET_CONTROL)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
e3:SetLabel(c:GetFieldID())
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(function(se,sc) return se:GetLabel()==sc:GetFieldID() end)
e3:SetTarget(function(se,sc) return sc:GetFlagEffect(m+100)>0 and se:GetLabel()==sc:GetFlagEffectLabel(m+100) end)
e3:SetValue(tp)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
Duel.RegisterEffect(e3,tp)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -236,15 +236,15 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
e2:SetCode(EVENT_CHAIN_NEGATED)
Duel.RegisterEffect(e2,tp)
--control
c:RegisterFlagEffect(m+100,RESET_EVENT+RESETS_WITHOUT_TEMP_REMOVE,0,1,c:GetFieldID())
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_SET_CONTROL)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
e3:SetLabel(c:GetFieldID())
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(function(se,sc) return se:GetLabel()==sc:GetFieldID() end)
e3:SetTarget(function(se,sc) return sc:GetFlagEffect(m+100)>0 and se:GetLabel()==sc:GetFlagEffectLabel(m+100) end)
e3:SetValue(tp)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
Duel.RegisterEffect(e3,tp)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -247,15 +247,15 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
e2:SetCode(EVENT_CHAIN_NEGATED)
Duel.RegisterEffect(e2,tp)
--control
c:RegisterFlagEffect(m+100,RESET_EVENT+RESETS_WITHOUT_TEMP_REMOVE,0,1,c:GetFieldID())
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_SET_CONTROL)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
e3:SetLabel(c:GetFieldID())
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(function(se,sc) return se:GetLabel()==sc:GetFieldID() end)
e3:SetTarget(function(se,sc) return sc:GetFlagEffect(m+100)>0 and se:GetLabel()==sc:GetFlagEffectLabel(m+100) end)
e3:SetValue(tp)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
Duel.RegisterEffect(e3,tp)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
......@@ -276,7 +276,6 @@ function cm.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToDeckOrExtraAsCost() end
Duel.SendtoDeck(c,nil,2,REASON_COST)
Duel.ConfirmCards(1-tp,c)
end
function cm.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
......
......@@ -206,15 +206,15 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
e2:SetCode(EVENT_CHAIN_NEGATED)
Duel.RegisterEffect(e2,tp)
--control
c:RegisterFlagEffect(m+100,RESET_EVENT+RESETS_WITHOUT_TEMP_REMOVE,0,1,c:GetFieldID())
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_SET_CONTROL)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
e3:SetLabel(c:GetFieldID())
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(function(se,sc) return se:GetLabel()==sc:GetFieldID() end)
e3:SetTarget(function(se,sc) return sc:GetFlagEffect(m+100)>0 and se:GetLabel()==sc:GetFlagEffectLabel(m+100) end)
e3:SetValue(tp)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
Duel.RegisterEffect(e3,tp)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
......@@ -222,6 +222,7 @@ function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
if e:GetCode()==EVENT_CHAIN_SOLVING and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED then rc:ResetFlagEffect(m) end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) and not (rc:IsOnField() and rc:IsFacedown()) then
rc:SetStatus(STATUS_ACTIVATE_DISABLED,true)
rc:CancelToGrave(false)
......
......@@ -47,7 +47,7 @@ function cm.initial_effect(c)
--accumulate
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(0x10000000+15004387)
e5:SetCode(EFFECT_FLAG_EFFECT+15004387)
e5:SetRange(LOCATION_MZONE)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e5:SetTargetRange(0,1)
......
......@@ -5378,7 +5378,7 @@ function cm.ActivatedAsSpellorTrapCheck(c)
local xe={rc:IsHasEffect(53765099)}
local b=false
local seq,typ=0,0
for _,v in pairs(xe) do if rc==v:GetLabelObject():GetHandler() then b=true seq,typ=v:GetLabel() end end
for _,v in pairs(xe) do if v:GetLabelObject() and rc==v:GetLabelObject():GetHandler() then b=true seq,typ=v:GetLabel() end end
if b and typ and typ~=0 and rc:IsHasEffect(53765098) then
local e1=Effect.CreateEffect(rc)
e1:SetCode(EFFECT_CHANGE_TYPE)
......@@ -6189,13 +6189,13 @@ function cm.HelltakerActivate(c,code)
return ADHT_MoveToField(sc,mp,tp,dest,pos,bool,czone)
end
ADHT_GetLocationCount=Duel.GetLocationCount
Duel.GetLocationCount=function(tp,loc,...)
local ct=ADHT_GetLocationCount(tp,loc,...)
if ad_ht_zc then ct=ct+ad_ht_zc end
Duel.GetLocationCount=function(...)
local ct=ADHT_GetLocationCount(...)+ad_ht_zc
return ct
end
end
end
ad_ht_zc=0
function cm.HTAfactarget(e,te,tp)
return te:GetHandler()==e:GetHandler() and te==e:GetLabelObject()
end
......@@ -6256,7 +6256,7 @@ function cm.HTAmvop(e,tp,eg,ep,ev,re,r,rp)
for _,v in pairs(pe) do
local val=v:GetValue()
if aux.GetValueType(val)=="number" then val=aux.TRUE end
v:SetValue(cm.bchval(val,e1))
v:SetValue(cm.AASTbchval(val,e1))
end
local zone=0xff
if te:IsActiveType(TYPE_PENDULUM) then zone=0x11 end
......@@ -6369,22 +6369,24 @@ function cm.HTAfaccost(_cost,fe,zone)
if aux.GetValueType(val)=="number" or val(v,fe,tp) then check=false end
end
if not check then
ad_ht_zc=nil
ad_ht_zc=0
return false
end
ad_ht_zc=0
local c=e:GetHandler()
local xe={c:IsHasEffect(53765099)}
for _,v in pairs(xe) do v:Reset() end
if te:IsActiveType(TYPE_QUICKPLAY) and Duel.GetTurnPlayer()~=tp and not c:IsHasEffect(EFFECT_QP_ACT_IN_NTPHAND) then return false end
if te:IsActiveType(TYPE_TRAP) and not c:IsHasEffect(EFFECT_TRAP_ACT_IN_HAND) then return false end
if not c:CheckUniqueOnField(tp) then return false end
ad_ht_zc=1
if not Duel.IsExistingMatchingCard(cm.HTAmvfilter,tp,LOCATION_SZONE,0,1,nil,e,tp,zone) then
ad_ht_zc=nil
ad_ht_zc=0
return false
end
local res=false
if _cost(e,te,tp) then res=true end
ad_ht_zc=nil
ad_ht_zc=0
--Debug.Message(res)
return res
end
......@@ -6408,6 +6410,7 @@ function cm.HTAmvcostop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
local c=te:GetHandler()
local typ=c:GetType()
if te:IsActiveType(TYPE_PENDULUM) then typ=TYPE_PENDULUM+TYPE_SPELL end
local xe1=cm.AASTregi(c,te)
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,false)
xe1:SetLabel(c:GetSequence()+1,typ)
......
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