Commit 70aed50f authored by POLYMER's avatar POLYMER

fix

parent 5073f40c
......@@ -106,14 +106,16 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,cm.setfilter,tp,LOCATION_REMOVED,0,1,1,aux.ExceptThisCard(e),e,tp)
if g:GetCount()>0 then
local tc=g:GetFirst()
local res=false
if tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and (not tc:IsSSetable() or Duel.SelectYesNo(tp,Stringid(m,3))) then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
res=Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
else
Duel.SSet(tp,tc)
res=Duel.SSet(tp,tc)>0
end
if #Duel.GetOperatedGroup()>0 and c:IsRelateToEffect(e) then
if res and c:IsRelateToEffect(e) then
--Duel.BreakEffect()
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP)
end
Duel.SpecialSummonComplete()
end
end
\ No newline at end of file
......@@ -24,7 +24,7 @@ function c11560708.initial_effect(c)
--c:RegisterEffect(e2)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAINING)
e2:SetCode(EVENT_CHAIN_SOLVED)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(c11560708.atkcon)
e2:SetOperation(c11560708.atkop)
......@@ -35,10 +35,7 @@ function c11560708.initial_effect(c)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,21560708)
e3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c==Duel.GetAttacker() or c==Duel.GetAttackTarget() end)
e3:SetCountLimit(1,21560708)
e3:SetCost(c11560708.bdiscost)
e3:SetTarget(c11560708.bdistg)
e3:SetOperation(c11560708.bdisop)
......
......@@ -77,7 +77,9 @@ function s.drcon(e,tp,eg,ep,ev,re)
end
function s.drop(e,tp)
Scl.HintCard(id)
if Duel.Draw(tp,1,REASON_EFFECT) > 0 then
Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT,nil)
for i=0,1 do
if Duel.Draw(i,1,REASON_EFFECT) > 0 then
Duel.DiscardHand(i,nil,1,1,REASON_EFFECT,nil)
end
end
end
\ No newline at end of file
This diff is collapsed.
......@@ -21,6 +21,7 @@ function cm.initial_effect(c)
e4:SetCode(m)
e4:SetRange(0xff)
c:RegisterEffect(e4)
SNNM.ActivatedAsSpellorTrapCheck(c)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
......
......@@ -21,6 +21,7 @@ function cm.initial_effect(c)
e4:SetCode(m)
e4:SetRange(0xff)
c:RegisterEffect(e4)
SNNM.ActivatedAsSpellorTrapCheck(c)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
......
......@@ -122,6 +122,13 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e3:SetLabelObject(e1)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
local hte1=Effect.CreateEffect(c)
hte1:SetType(EFFECT_TYPE_FIELD)
hte1:SetCode(53765050)
hte1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
hte1:SetLabelObject(e3)
hte1:SetTargetRange(1,1)
Duel.RegisterEffect(hte1,0)
Duel.AdjustAll()
Duel.RaiseEvent(Group.FromCards(tc),EVENT_CUSTOM+m,e,0x40,tp,tp,ct)
end
......
if not require and dofile then function require(str) return dofile(str..".lua") end end
if not pcall(function() require("expansions/script/c53702500") end) then require("script/c53702500") end
local m=53756008
local cm=_G["c"..m]
cm.name="永远的黄昏之时"
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
local e1,e1_1,e2,e3=SNNM.ActivatedAsSpellorTrap(c,0x80002,LOCATION_HAND)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_ADJUST)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetLabelObject(e1)
e2:SetOperation(cm.adjustop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_ACTIVATE_COST)
e3:SetRange(LOCATION_HAND)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetLabelObject(e2)
e3:SetTargetRange(1,1)
e3:SetTarget(cm.actarget)
e3:SetOperation(cm.costop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e4:SetCode(m)
e4:SetRange(LOCATION_HAND)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_IMMUNE_EFFECT)
......@@ -63,222 +38,7 @@ function cm.initial_effect(c)
e8:SetTarget(cm.sptg)
e8:SetOperation(cm.spop)
c:RegisterEffect(e8)
if not cm.global_check then
cm.global_check=true
cm[0]=Card.IsOriginalCodeRule
Card.IsOriginalCodeRule=function(tc,...)
if tc:GetFlagEffect(m+66)>0 then return true end
return cm[0](tc,...)
end
cm[1]=Card.GetOriginalCodeRule
Card.GetOriginalCodeRule=function(tc)
if tc:GetFlagEffect(m+66)>0 then
return m
else
return cm[1](tc)
end
end
end
end
function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
local c=te:GetHandler()
local p=te:GetHandlerPlayer()
local pe={Duel.IsPlayerAffectedByEffect(p,EFFECT_CANNOT_ACTIVATE)}
local ae={Duel.IsPlayerAffectedByEffect(p,EFFECT_ACTIVATE_COST)}
local t1,t2={},{}
for _,v in pairs(pe) do
local val=v:GetValue()
if aux.GetValueType(val)=="number" or val(v,te,p) then
table.insert(t1,v)
table.insert(t2,1)
end
end
for _,v in pairs(ae) do
local cost=v:GetCost()
if cost and not cost(v,te,p) then
local tg=v:GetTarget()
if not tg or tg(v,te,p) then
table.insert(t1,v)
table.insert(t2,2)
end
end
end
local dc=Duel.CreateToken(tp,269012)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(m)
dc:RegisterEffect(e1,true)
dc:RegisterFlagEffect(m+66,0,0,0)
local de=dc:GetActivateEffect()
local t3,t4={},{}
for _,v in pairs(pe) do
local val=v:GetValue()
if aux.GetValueType(val)=="number" or val(v,de,p) then
table.insert(t3,v)
table.insert(t4,1)
end
end
for _,v in pairs(ae) do
local cost=v:GetCost()
if cost and not cost(v,de,p) then
local tg=v:GetTarget()
if not tg or tg(v,de,p) then
table.insert(t3,v)
table.insert(t4,2)
end
end
end
local ret1,ret2={},{}
for k,v1 in pairs(t1) do
local equal=false
for _,v2 in pairs(t3) do
if v1==v2 then
equal=true
break
end
end
if not equal then
table.insert(ret1,v1)
table.insert(ret2,t2[k])
end
end
local ret3,ret4={},{}
for k,v1 in pairs(t3) do
local equal=false
for _,v2 in pairs(t1) do
if v1==v2 then
equal=true
break
end
end
if not equal then
table.insert(ret3,v1)
table.insert(ret4,t4[k])
end
end
for k,v in pairs(ret1) do
if ret2[k]==1 then
local val=v:GetValue()
if aux.GetValueType(val)=="number" then val=aux.TRUE end
if val(v,te,p) then
v:SetValue(cm.chval(val,false,de))
end
end
if ret2[k]==2 then
local cost=v:GetCost()
if cost and not cost(v,te,p) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg(aux.TRUE,false))
elseif tg(v,te,p) then
v:SetTarget(cm.chtg(tg,false))
end
end
end
end
for k,v in pairs(ret3) do
if ret4[k]==4 then
local val=v:GetValue()
if aux.GetValueType(val)=="number" then val=aux.TRUE end
if val(v,de,p) then
v:SetValue(cm.chval(val,true,de))
end
end
if ret4[k]==5 then
local cost=v:GetCost()
if cost and not cost(v,de,p) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg(aux.TRUE,true))
elseif tg(v,de,p) then
v:SetTarget(cm.chtg(tg,true))
end
end
end
end
end
function cm.chval(_val,res,de)
return function(e,re,...)
local x=nil
if aux.GetValueType(re)=="Effect" then x=re:GetHandler() elseif aux.GetValueType(re)=="Card" then
local rc=Duel.CreateToken(tp,269012)
local e1=Effect.CreateEffect(rc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(m)
rc:RegisterEffect(e1,true)
rc:RegisterFlagEffect(m+66,0,0,0)
re=rc:GetActivateEffect()
else return res end
if x and x:IsHasEffect(m) then return res end
return _val(e,re,...)
end
end
function cm.chtg(_tg,res)
return function(e,te,...)
local x=te:GetHandler()
if x:IsHasEffect(m) then return res end
return _tg(e,te,...)
end
end
function cm.actarget(e,te,tp)
return te:GetHandler()==e:GetHandler() and te==e:GetLabelObject():GetLabelObject()
end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local te=e:GetLabelObject():GetLabelObject()
c:CreateEffectRelation(te)
local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0)
if fc then Duel.SendtoGrave(fc,REASON_RULE) end
c:SetCardData(4,0x80002)
Duel.MoveToField(c,tp,tp,LOCATION_FZONE,POS_FACEUP,false)
c:SetCardData(4,0x21)
Duel.ShuffleHand(tp)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_CHANGE_TYPE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetValue(0x80002)
e0:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
c:RegisterEffect(e0,true)
local te2=te:Clone()
c:RegisterEffect(te2,true)
e:GetLabelObject():SetLabelObject(te2)
te:SetType(EFFECT_TYPE_ACTIVATE)
local ev0=Duel.GetCurrentChain()+1
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ev==ev0 end)
e1:SetOperation(cm.rsop)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EVENT_CHAIN_NEGATED)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_REMAIN_FIELD)
e3:SetProperty(EFFECT_FLAG_OATH+EFFECT_FLAG_CANNOT_DISABLE)
e3:SetReset(RESET_CHAIN)
c:RegisterEffect(e3)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if e:GetCode()==EVENT_CHAIN_SOLVED and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_ACTIVATE_DISABLED,true)
rc:CancelToGrave(false)
end
re:Reset()
SNNM.ActivatedAsSpellorTrapCheck(c)
end
function cm.immval(e,te)
local c=e:GetHandler()
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -40,7 +40,7 @@ function c75000810.posop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(c:GetBaseAttack()*2)
e1:SetValue(tc:GetBaseAttack()*2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
......
......@@ -137,9 +137,6 @@ function c9910976.chop(e,tp,eg,ep,ev,re,r,rp)
return Duel.ChangeChainOperation(ev,c9910976.repop)
end
end
function c9910976.desfilter(c)
return c:IsFacedown() and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c9910976.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,9910976)
local g=Duel.GetMatchingGroup(c9910976.lvfilter,tp,0,LOCATION_MZONE,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