Commit 28dd4b28 authored by 聖園ミカ's avatar 聖園ミカ 🐟

1+1=3

parent 7b014ebc
...@@ -1277,6 +1277,7 @@ end ...@@ -1277,6 +1277,7 @@ end
function Chikichikibanban.c4a71tohandthop(e,tp,eg,ep,ev,re,r,rp) function Chikichikibanban.c4a71tohandthop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,Chikichikibanban.c4a71tohandthfilter,tp,LOCATION_GRAVE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,Chikichikibanban.c4a71tohandthfilter,tp,LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
local tc=g:GetFirst() local tc=g:GetFirst()
if tc:IsCode(12825601) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if tc:IsCode(12825601) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and tc:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.SelectYesNo(tp,2) then and tc:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.SelectYesNo(tp,2) then
...@@ -1285,6 +1286,7 @@ function Chikichikibanban.c4a71tohandthop(e,tp,eg,ep,ev,re,r,rp) ...@@ -1285,6 +1286,7 @@ function Chikichikibanban.c4a71tohandthop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(tc,nil,REASON_EFFECT) Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc) Duel.ConfirmCards(1-tp,tc)
end end
end
end end
--铳影通用康型效果(代写) --铳影通用康型效果(代写)
......
...@@ -3,6 +3,15 @@ AD_Database=true ...@@ -3,6 +3,15 @@ AD_Database=true
SNNM=SNNM or {} SNNM=SNNM or {}
local cm=SNNM local cm=SNNM
--53702700 alleffectreset --53702700 alleffectreset
function Group.ForEach(group,func,...)
if aux.GetValueType(group)=="Group" and group:GetCount()>0 then
local d_group=group:Clone()
for tc in aux.Next(d_group) do
func(tc,...)
end
end
end
--
function cm.AllGlobalCheck(c) function cm.AllGlobalCheck(c)
if not cm.snnm_global_check then if not cm.snnm_global_check then
cm.snnm_global_check=true cm.snnm_global_check=true
...@@ -517,12 +526,12 @@ function cm.ALCYakuNew(c,code,cf,loc,t) ...@@ -517,12 +526,12 @@ function cm.ALCYakuNew(c,code,cf,loc,t)
e1:SetTarget(cm.NALCTtg(code,loc,t)) e1:SetTarget(cm.NALCTtg(code,loc,t))
e1:SetOperation(cm.NALCTac(code,cf,t)) e1:SetOperation(cm.NALCTac(code,cf,t))
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c) --[[local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EVENT_ADJUST) e2:SetCode(EVENT_ADJUST)
e2:SetRange(0x7f) e2:SetRange(0x7f)
e2:SetOperation(cm.ALCReload) e2:SetOperation(cm.ALCReload)
c:RegisterEffect(e2) c:RegisterEffect(e2)--]]
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE) e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN) e3:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
...@@ -530,7 +539,7 @@ function cm.ALCYakuNew(c,code,cf,loc,t) ...@@ -530,7 +539,7 @@ function cm.ALCYakuNew(c,code,cf,loc,t)
e3:SetCondition(cm.ALCYakuActCondition) e3:SetCondition(cm.ALCYakuActCondition)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function cm.ALCReload(e,tp) --[[function cm.ALCReload(e,tp)
aux.AddFusionProcCode2=_tmp aux.AddFusionProcCode2=_tmp
aux.AddFusionProcCode2FunRep=_tmp_1 aux.AddFusionProcCode2FunRep=_tmp_1
aux.AddFusionProcCode3=_tmp_2 aux.AddFusionProcCode3=_tmp_2
...@@ -757,7 +766,7 @@ function aux.AddFusionProcShaddoll(c,att) ...@@ -757,7 +766,7 @@ function aux.AddFusionProcShaddoll(c,att)
ccodem.fst=2 ccodem.fst=2
end end
return _tmp_1_4(c,att) return _tmp_1_4(c,att)
end end--]]
function cm.NALCTtg(code,loc,t) function cm.NALCTtg(code,loc,t)
return return
function(e,tp,eg,ep,ev,re,r,rp,chk) function(e,tp,eg,ep,ev,re,r,rp,chk)
...@@ -790,15 +799,17 @@ function cm.NALCTac(code,cf,t) ...@@ -790,15 +799,17 @@ function cm.NALCTac(code,cf,t)
e1:SetReset(RESET_EVENT+0x7e0000) e1:SetReset(RESET_EVENT+0x7e0000)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local chkf=tp local chkf=tp
local mtf=function(c,e,tp)return c:IsLocation(LOCATION_MZONE) and bit.band(c:GetOriginalType(),TYPE_TRAP)~=0 and c:CheckUniqueOnField(tp) and not c:IsForbidden() and not c:IsImmuneToEffect(e)end
local fuf=function(c,e,tp,m,f,chkf,ft)return c:IsType(TYPE_FUSION) and (not f or f(c)) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)end
local fchk=function(tp,sg,fc)
local mt=getmetatable(fc)
local t=mt.material_count
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE) local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
local mtf=function(c,e,tp)return bit.band(c:GetOriginalType(),TYPE_TRAP)~=0 and c:IsType(TYPE_MONSTER) and c:CheckUniqueOnField(tp) and not c:IsForbidden() and not c:IsImmuneToEffect(e)end return not t or ft>=t[1]
local fuf=function(c,e,tp,m,f,chkf,ft) end
return c:IsType(TYPE_FUSION) and (not f or f(c)) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf) and (not c.fst or ft>=c.fst) local mg1=Duel.GetFusionMaterial(tp):Filter(mtf,nil,e,tp)
end aux.FCheckAdditional=fchk
local zck=function(g,c,chkf,ft)return c:CheckFusionMaterial(g,nil,chkf) and ft>=#g end local sg1=Duel.GetMatchingGroup(fuf,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg1=Duel.GetFusionMaterial(tp):Filter(Card.IsOnField,nil):Filter(mtf,nil,e,tp)
if #mg1==0 then return end
local sg1=Duel.GetMatchingGroup(fuf,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf,ft)
local mg2=nil local mg2=nil
local sg2=nil local sg2=nil
local ce=Duel.GetChainMaterial(tp) local ce=Duel.GetChainMaterial(tp)
...@@ -806,9 +817,9 @@ function cm.NALCTac(code,cf,t) ...@@ -806,9 +817,9 @@ function cm.NALCTac(code,cf,t)
local fgroup=ce:GetTarget() local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp) mg2=fgroup(ce,e,tp)
local mf=ce:GetValue() local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(fuf,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf,114) sg2=Duel.GetMatchingGroup(fuf,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end end
if (#sg1>0 or (sg2~=nil and sg2:GetCount()>0)) and Duel.SelectYesNo(tp,aux.Stringid(code,0)) then if (sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0)) and Duel.SelectYesNo(tp,aux.Stringid(code,0)) then
Duel.BreakEffect() Duel.BreakEffect()
local sg=sg1:Clone() local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end if sg2 then sg:Merge(sg2) end
...@@ -816,13 +827,9 @@ function cm.NALCTac(code,cf,t) ...@@ -816,13 +827,9 @@ function cm.NALCTac(code,cf,t)
local tg=sg:Select(tp,1,1,nil) local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst() local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
if tc.fst then local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(53702600,3))
local mat1=mg1:SelectSubGroup(tp,zck,false,tc.fst,#mg1,tc,chkf,ft)
--local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1) tc:SetMaterial(mat1)
for mvc in aux.Next(mat1) do Duel.MoveToField(mvc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) end for mvc in aux.Next(mat1) do Duel.MoveToField(mvc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) mvc:SetReason(REASON_EFFECT+REASON_MATERIAL+REASON_FUSION) end
end
Duel.BreakEffect() Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else else
...@@ -831,6 +838,7 @@ function cm.NALCTac(code,cf,t) ...@@ -831,6 +838,7 @@ function cm.NALCTac(code,cf,t)
fop(ce,e,tp,tc,mat2) fop(ce,e,tp,tc,mat2)
end end
tc:CompleteProcedure() tc:CompleteProcedure()
aux.FCheckAdditional=nil
end end
end end
end end
...@@ -4667,7 +4675,7 @@ function cm.ActivatedAsSpellorTrap(c,otyp,loc,setava,owne) ...@@ -4667,7 +4675,7 @@ function cm.ActivatedAsSpellorTrap(c,otyp,loc,setava,owne)
e1:SetHintTiming(0,TIMING_DRAW_PHASE+TIMINGS_CHECK_MONSTER+TIMING_END_PHASE) e1:SetHintTiming(0,TIMING_DRAW_PHASE+TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
else e1:SetType(EFFECT_TYPE_IGNITION) end else e1:SetType(EFFECT_TYPE_IGNITION) end
e1:SetRange(loc) e1:SetRange(loc)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
local e1_1=Effect.CreateEffect(c) local e1_1=Effect.CreateEffect(c)
...@@ -5380,6 +5388,33 @@ function cm.MultipleGroupCheck(c) ...@@ -5380,6 +5388,33 @@ function cm.MultipleGroupCheck(c)
end end
end end
--2 --2
function cm.SetAsSpellorTrapCheck(c,type)
local mt=getmetatable(c)
mt.SSetableMonster=true
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_MONSTER_SSET)
e0:SetValue(type)
c:RegisterEffect(e0)
if not AD_SetAsSpellorTrap_Check then
AD_SetAsSpellorTrap_Check=true
ADIMI_IsSSetable=Card.IsSSetable
Card.IsSSetable=function(sc,bool)
local ly=0
for i=1,114 do
if not cm["Card_Prophecy_Layer_"..i] then
ly=i-1
break
end
end
local b=true
if sc.SSetableMonster and (ly>0 or Duel.GetFlagEffectLabel(0,53759000)==0) then
if ly>0 then cm["Card_Prophecy_Certain_ACST_"..ly]=true end
else b=ADIMI_IsSSetable(sc,bool) end
return b
end
end
end
function cm.ActivatedAsSpellorTrapCheck(c) function cm.ActivatedAsSpellorTrapCheck(c)
if not AD_ActivatedAsSpellorTrap_Check then if not AD_ActivatedAsSpellorTrap_Check then
AD_ActivatedAsSpellorTrap_Check=true AD_ActivatedAsSpellorTrap_Check=true
...@@ -5549,7 +5584,7 @@ function cm.ActivatedAsSpellorTrapCheck(c) ...@@ -5549,7 +5584,7 @@ function cm.ActivatedAsSpellorTrapCheck(c)
for _,v in pairs(xe) do if re==v:GetLabelObject() then b=true seq,typ=v:GetLabel() end end for _,v in pairs(xe) do if re==v:GetLabelObject() then b=true seq,typ=v:GetLabel() end end
if b then return typ else return ADIMI_GetActiveType(re) end if b then return typ else return ADIMI_GetActiveType(re) end
end end
ADIMI_GetActivateLocation=Effect.GetActivateLocation --[[ADIMI_GetActivateLocation=Effect.GetActivateLocation
Effect.GetActivateLocation=function(re) Effect.GetActivateLocation=function(re)
local rc=re:GetHandler() local rc=re:GetHandler()
local xe={} local xe={}
...@@ -5562,7 +5597,7 @@ function cm.ActivatedAsSpellorTrapCheck(c) ...@@ -5562,7 +5597,7 @@ function cm.ActivatedAsSpellorTrapCheck(c)
end end
end end
if ls>5 then return LOCATION_FZONE elseif ls>0 then return LOCATION_SZONE else return ADIMI_GetActivateLocation(re) end if ls>5 then return LOCATION_FZONE elseif ls>0 then return LOCATION_SZONE else return ADIMI_GetActivateLocation(re) end
end end]]--
ADIMI_GetActivateSequence=Effect.GetActivateSequence ADIMI_GetActivateSequence=Effect.GetActivateSequence
Effect.GetActivateSequence=function(re) Effect.GetActivateSequence=function(re)
local rc=re:GetHandler() local rc=re:GetHandler()
...@@ -7603,3 +7638,334 @@ function cm.IsActivatable(e,p) ...@@ -7603,3 +7638,334 @@ function cm.IsActivatable(e,p)
end end
return check return check
end end
function cm.WhitkinsToGrave(g,reason)
local out=Group.CreateGroup()
if Duel.SendtoGrave(g,reason)~=0 then
out=Duel.GetOperatedGroup()
local og=out:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
local tp=Duel.GetTurnPlayer()
local x=(tp==0 and 1) or -1
for p=tp,1-tp,x do
local sg=Group.CreateGroup()
cm[201]={}
local ct=0
local mg=og:Filter(Card.IsControler,nil,p)
local gct=mg:GetCount()
if gct>1 then
while true do
if #mg==0 then break end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(53767028,15))
local sc=mg:SelectUnselect(sg,tp,false,#sg>0,#mg,gct)
if not sc then break elseif mg:IsContains(sc) then
mg:RemoveCard(sc)
sg:AddCard(sc)
ct=ct+1
cm[201][sc]=ct
else
sg:RemoveCard(sc)
mg:AddCard(sc)
cm[201][sc]=nil
end
end
for i=ct,0,-1 do
for tc in aux.Next(sg) do
if cm[201][tc]==i then Duel.MoveSequence(tc,0) end
end
end
end
cm[201]={}
end
end
return out
end
function cm.Whitkins(c,id,att)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetTarget(cm.Whitkinssdtg)
e2:SetOperation(cm.Whitkinssdop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetTarget(cm.Whitkinsfstg)
e3:SetOperation(cm.Whitkinsfsop(id,att))
c:RegisterEffect(e3)
end
function cm.Whitkinssdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGrave() end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,e:GetHandler(),1,0,0)
end
function cm.Whitkinssdop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT)
end
function cm.WhitkinsGetSequenceMinus(c,seq)
return math.abs(c:GetSequence()-seq)
end
function cm.Whitkinsfilter(c,e)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsCanBeEffectTarget(e)
end
function cm.Whitkinsmfilter(c,tseq,seq,e)
local res=false
local cseq=c:GetSequence()
return cseq>math.min(tseq,seq) and cseq<math.max(tseq,seq) and c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToRemove() and (not e or not c:IsImmuneToEffect(e))
end
function cm.Whitkinsffilter(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsRace(RACE_INSECT) and (not f or f(c)) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function cm.Whitkinsfilter2(c,e,tp,seq)
local chkf=tp
local mg1=Duel.GetMatchingGroup(cm.Whitkinsmfilter,tp,LOCATION_GRAVE,0,nil,c:GetSequence(),seq,nil)
local le=cm.Whitkinsmust(e,mg1)
mg1:Merge(Duel.GetFusionMaterial(tp):Filter(Card.IsHasEffect,nil,EFFECT_EXTRA_FUSION_MATERIAL))
local res=Duel.IsExistingMatchingCard(cm.Whitkinsffilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
for _,v in pairs(le) do v:Reset() end
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(cm.Whitkinsffilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
return res
end
function cm.Whitkinsfstg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
local seq=c:GetSequence()
local g=Duel.GetMatchingGroup(cm.Whitkinsfilter,tp,LOCATION_GRAVE,0,c,e)
if g:GetCount()==0 then return false end
local ag=g:GetMinGroup(cm.WhitkinsGetSequenceMinus,seq)
local tg=ag:Filter(cm.Whitkinsfilter2,nil,e,tp,seq)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and tg:IsContains(chkc) end
if chk==0 then return #tg>0 and c:IsAbleToRemove() and c:IsCanBeEffectTarget(e) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELF)
local sg=tg:Select(tp,1,1,nil)
local mg=Duel.GetMatchingGroup(cm.Whitkinsmfilter,tp,LOCATION_GRAVE,0,nil,sg:GetFirst():GetSequence(),seq,nil)
sg:AddCard(c)
Duel.SetTargetCard(sg)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,mg,1,tp,LOCATION_GRAVE)
end
function cm.Whitkinsfsop(id,att)
return function(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetTargetsRelateToChain()
if #tg~=2 then return end
local chkf=tp
local mg1=Duel.GetMatchingGroup(cm.Whitkinsmfilter,tp,LOCATION_GRAVE,0,nil,tg:GetFirst():GetSequence(),tg:GetNext():GetSequence(),e)
local le=cm.Whitkinsmust(e,mg1)
local mg3=Duel.GetFusionMaterial(tp):Filter(aux.NOT(Card.IsImmuneToEffect),nil,e):Filter(Card.IsHasEffect,nil,EFFECT_EXTRA_FUSION_MATERIAL)
local sg1=Duel.GetMatchingGroup(cm.Whitkinsffilter,tp,LOCATION_EXTRA,0,nil,e,tp,Group.__add(mg1,mg3),nil,chkf)
for _,v in pairs(le) do v:Reset() end
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(cm.Whitkinsffilter,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if #sg1>0 or (sg2~=nil and #sg2>0) then
local sg=sg1:Clone()
if sg2~=nil then sg:Merge(sg2) end
::cancel::
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=sg:Select(tp,1,1,nil):GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc)
or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=nil
if #mg3>0 then
local le2=cm.Whitkinsmust(e,mg1)
mat1=Duel.SelectFusionMaterial(tp,tc,Group.__add(mg1,mg3),nil,chkf)
for _,v in pairs(le2) do v:Reset() end
else mat1=mg1 end
tc:SetMaterial(mat1)
Duel.Remove(mat1,POS_FACEUP,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
if Duel.SpecialSummonStep(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP) then cm.Whitkinsimmune(tc,tp,id,att) Duel.SpecialSummonComplete() end
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
if #mat2<2 then goto cancel end
local fop=ce:GetOperation()
local f=Duel.SpecialSummon
Duel.SpecialSummon=function(tgs,sumtyp,sump,...)
local tgsg=Group.__add(tgs,tgs)
if #tgsg==1 then
if Duel.SpecialSummonStep(tgsg:GetFirst(),sumtyp,sump,...) then
cm.Whitkinsimmune(tgsg:GetFirst(),sump) Duel.SpecialSummonComplete()
return 1
else return 0 end
else return f(tgs,sumtyp,sump,...) end
end
fop(ce,e,tp,tc,mat2)
Duel.SpecialSummon=f
end
tc:CompleteProcedure()
end
end
end
function cm.Whitkinsmust(e,g)
local le={}
for mtc in aux.Next(g) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_GRAVE)
e1:SetCode(EFFECT_MUST_BE_FMATERIAL)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetTargetRange(1,0)
mtc:RegisterEffect(e1,true)
table.insert(le,e1)
end
return le
end
function cm.Whitkinsimmune(c,tp,id,att)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetRange(LOCATION_MZONE)
e1:SetAbsoluteRange(tp,LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsRace,RACE_INSECT))
e1:SetValue(cm.Whitkinsefilter(att))
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1,true)
c:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,3))
end
function cm.Whitkinsefilter(att)
return function(e,te,c)
return te:GetOwnerPlayer()~=c:GetControler() and te:IsActiveType(TYPE_MONSTER) and te:GetHandler():IsAttribute(att)
end
end
-----------
--[[ local dam=tc:GetAttack()
local seta={tc:IsHasEffect(EFFECT_SET_BATTLE_ATTACK)}
if #seta>0 then
seta=seta[#seta]
dam=seta:GetValue()
if aux.GetValueType(dam)=="function" then val=val(dam) end
end
local le={tc:IsHasEffect(EFFECT_DEFENSE_ATTACK)}
local val=0
for _,v in pairs(le) do
val=v:GetValue()
if aux.GetValueType(val)=="function" then val=val(e) end
end
if val==1 then
local setd={tc:IsHasEffect(EFFECT_SET_BATTLE_DEFENSE)}
if #setd>0 then
setd=setd[#setd]
dam=setd:GetValue()
if aux.GetValueType(dam)=="function" then val=val(dam) end
end
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(id)
e1:SetRange(LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE)
c:RegisterEffect(e1)
if not s.global_check then
s.global_check=true
local ge0=Effect.GlobalEffect()
ge0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge0:SetCode(EVENT_ADJUST)
ge0:SetLabelObject(sg)
ge0:SetOperation(s.geop)
Duel.RegisterEffect(ge0,0)
s.OAe={}
end
end
function s.geop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(function(c)return c:IsOriginalCodeRule(46173679) and c:GetActivateEffect()end,0,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,nil)
for tc in aux.Next(g) do
local le={tc:GetActivateEffect()}
for _,v in pairs(le) do
if v:GetRange()&0x10a~=0 and not SNNM.IsInTable(v,s.OAe) then
table.insert(s.OAe,v)
local e1=v:Clone()
e1:SetRange(LOCATION_DECK+LOCATION_GRAVE)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
tc:RegisterEffect(e1,true)
local e2=SNNM.Act(tc,e1)
e2:SetRange(LOCATION_DECK+LOCATION_GRAVE)
e2:SetCost(s.costchk)
e2:SetOperation(s.costop2)
tc:RegisterEffect(e2,true)
local e3=Effect.CreateEffect(tc)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_ACTIVATE_COST)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
e3:SetRange(LOCATION_HAND)
e3:SetLabelObject(v)
e3:SetTargetRange(1,0)
e3:SetTarget(s.costtg)
e3:SetOperation(s.costop1)
tc:RegisterEffect(e3,true)
end
end
end
end
function s.costchk(e,te,tp)
return Duel.IsExistingMatchingCard(Card.IsHasEffect,tp,0xff,0,1,nil,id)
end
function s.costtg(e,te,tp)
return te:GetHandler()==e:GetHandler() and te==e:GetLabelObject() and Duel.IsExistingMatchingCard(Card.IsHasEffect,tp,0xff,0,nil,id)
end
function s.costop1(e,tp,eg,ep,ev,re,r,rp)
if not Duel.SelectYesNo(tp,aux.Stringid(id,0)) then return end
s.costop(e,tp,eg,ep,ev,re,r,rp)
end
function s.costop2(e,tp,eg,ep,ev,re,r,rp)
s.costop(e,tp,eg,ep,ev,re,r,rp)
SNNM.BaseActOp(e,tp,eg,ep,ev,re,r,rp)
end
function s.costop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,1))
local tc=Duel.SelectMatchingCard(tp,Card.IsHasEffect,tp,0xff,0,1,1,nil,id):GetFirst()
Duel.ConfirmCards(1-tp,tc)
local ev0=Duel.GetCurrentChain()+1
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetCountLimit(1)
e1:SetLabelObject(tc)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)return ev==ev0 end)
e1:SetOperation(s.op)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
tc:CreateEffectRelation(e1)
end
function s.op(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if not tc:IsRelateToEffect(e) then return end
local le={Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_SUMMON)}
for _,v in pairs(le) do
if v:GetOwner()==e:GetOwner() then
local tg=v:GetTarget() or aux.TRUE
if tg(v,tc,tp,SUMMON_TYPE_ADVANCE,POS_FACEUP,tp,e) then v:SetTarget(s.chtg(tg,tc)) end
end
end
if not (tc:IsAbleToHand() or tc:IsSummonable(true,nil,1) or c:IsMSetable(true,nil,1)) or not Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,tc,REASON_EFFECT) or not Duel.SelectYesNo(tp,aux.Stringid(id,2)) then return end
if Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_EFFECT+REASON_DISCARD,tc)==0 then return end
if not tc:IsLocation(LOCATION_HAND) then Duel.SendtoHand(tc,nil,REASON_EFFECT) else
local s1=tc:IsSummonable(true,nil,1)
local s2=tc:IsMSetable(true,nil,1)
if (s1 and s2 and Duel.SelectPosition(tp,tc,POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)==POS_FACEUP_ATTACK) or not s2 then
Duel.Summon(tp,tc,true,nil,1)
else
Duel.MSet(tp,tc,true,nil,1)
end
end
end
function s.chtg(_tg,tc)
return function(e,c,...)
return _tg(e,c,...) and c~=tc
end
end--]]
\ No newline at end of file
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=53703015
local cm=_G["c"..m]
cm.name="布莱克星"
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetRange(LOCATION_DECK)
e2:SetCost(cm.cost)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_ACTIVATE_COST)
e3:SetRange(LOCATION_DECK)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,0)
e3:SetLabelObject(e2)
e3:SetTarget(cm.actarget)
e3:SetOperation(cm.costop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetRange(LOCATION_FZONE)
e4:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetTargetRange(0,1)
e4:SetTarget(cm.splimit)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_CANNOT_ACTIVATE)
e5:SetValue(cm.aclimit)
c:RegisterEffect(e5)
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(m,0))
e6:SetCategory(CATEGORY_TOHAND+CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e6:SetCode(EVENT_SPSUMMON_SUCCESS)
e6:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e6:SetRange(LOCATION_FZONE)
e6:SetCondition(cm.spcon)
e6:SetTarget(cm.sptg)
e6:SetOperation(cm.spop)
c:RegisterEffect(e6)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_TO_GRAVE)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function cm.cfilter(c,tp,re)
return c:IsReason(REASON_EFFECT) and c:IsControler(1-tp) and re:GetHandler():IsLocation(LOCATION_PZONE)
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(cm.cfilter,nil,tp,re)
g:ForEach(Card.RegisterFlagEffect,m,RESET_EVENT+RESETS_STANDARD,0,0)
end
function cm.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return c:IsLocation(LOCATION_GRAVE) and c:GetFlagEffect(m)>0
end
function cm.aclimit(e,re,tp)
local rc=re:GetHandler()
return rc:IsLocation(LOCATION_GRAVE) and rc:GetFlagEffect(m)>0
end
function cm.costfilter(c)
return c:IsFaceup() and c:IsCode(m-2) and c:IsAbleToHandAsCost()
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SendtoHand(g,nil,REASON_COST)
end
function cm.actarget(e,te,tp)
e:SetLabelObject(te)
return te:GetHandler()==e:GetHandler()
end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_FZONE,POS_FACEUP,false)
e:GetHandler():CreateEffectRelation(te)
local c=e:GetHandler()
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)
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) and not (rc:IsOnField() and rc:IsFacedown()) then
rc:SetStatus(STATUS_ACTIVATE_DISABLED,true)
end
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
if eg:GetCount()~=1 then return false end
local tc=eg:GetFirst()
return tc:IsSummonPlayer(tp) and tc:GetPreviousLocation(LOCATION_PZONE)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_GRAVE) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end
Duel.SetTargetCard(eg)
e:SetLabelObject(eg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,1-tp,LOCATION_GRAVE)
end
function cm.spfilter(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0x3533) and c:IsType(TYPE_PENDULUM) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject():GetFirst()
local tg=Duel.GetTargetsRelateToChain()
if not tc or not tg:IsContains(tc) then return end
local lc=tg:GetFirst()
if lc==tc then lc=tg:GetNext() end
if Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_HAND) and lc and Duel.Remove(lc,POS_FACEUP,REASON_EFFECT) and lc:IsLocation(LOCATION_REMOVED) and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
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=53705024 local m=53705024
local cm=_G["c"..m] local cm=_G["c"..m]
cm.name="幻海袭杀魄散" cm.name="幻海袭杀魄散"
......
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=53727012 local m=53727012
local cm=_G["c"..m] local cm=_G["c"..m]
cm.name="电脑深域N 解址死装" cm.name="电脑深域N 解址死装"
......
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=53756006 local m=53756006
local cm=_G["c"..m] local cm=_G["c"..m]
cm.name="指导教师 濑美奈" cm.name="指导教师 濑美奈"
......
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=53799156 local m=53799156
local cm=_G["c"..m] local cm=_G["c"..m]
cm.name="五等分的魔理沙" cm.name="五等分的魔理沙"
......
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=53799216 local m=53799216
local cm=_G["c"..m] local cm=_G["c"..m]
cm.name="木毛的爱女 RI" cm.name="木毛的爱女 RI"
...@@ -46,8 +48,9 @@ function cm.initial_effect(c) ...@@ -46,8 +48,9 @@ function cm.initial_effect(c)
end end
Duel.SpecialSummon(sc,0,sumplayer,sumplayer,false,false,POS_FACEUP) Duel.SpecialSummon(sc,0,sumplayer,sumplayer,false,false,POS_FACEUP)
end end
cm[0](g,sumtype,sumplayer,...) local fin=cm[0](g,sumtype,sumplayer,...)
fing:ForEach(Card.ResetFlagEffect,m) fing:ForEach(Card.ResetFlagEffect,m)
return fin
end end
cm[1]=Duel.SpecialSummonStep cm[1]=Duel.SpecialSummonStep
Duel.SpecialSummonStep=function(targets,sumtype,sumplayer,...) Duel.SpecialSummonStep=function(targets,sumtype,sumplayer,...)
...@@ -63,10 +66,10 @@ function cm.initial_effect(c) ...@@ -63,10 +66,10 @@ function cm.initial_effect(c)
Duel.SpecialSummon(sc,0,sumplayer,sumplayer,false,false,POS_FACEUP) Duel.SpecialSummon(sc,0,sumplayer,sumplayer,false,false,POS_FACEUP)
tc=sc tc=sc
end end
cm[1](tc,sumtype,sumplayer,...) return cm[1](tc,sumtype,sumplayer,...)
end end
cm[2]=Duel.SynchroSummon cm[2]=Duel.SynchroSummon
Duel.SynchroSummon=function(p,c,tuner) Duel.SynchroSummon=function(p,c,tuner,...)
local sg=Duel.GetMatchingGroup(function(c)return c:IsHasEffect(m)end,p,LOCATION_PZONE,0,nil) local sg=Duel.GetMatchingGroup(function(c)return c:IsHasEffect(m)end,p,LOCATION_PZONE,0,nil)
if #sg>0 and Duel.SelectYesNo(p,aux.Stringid(m,0)) then if #sg>0 and Duel.SelectYesNo(p,aux.Stringid(m,0)) then
Duel.Hint(HINT_CARD,0,m) Duel.Hint(HINT_CARD,0,m)
...@@ -76,6 +79,7 @@ function cm.initial_effect(c) ...@@ -76,6 +79,7 @@ function cm.initial_effect(c)
Duel.SendtoGrave(c,REASON_EFFECT) Duel.SendtoGrave(c,REASON_EFFECT)
Duel.SpecialSummon(sc,0,p,p,false,false,POS_FACEUP) Duel.SpecialSummon(sc,0,p,p,false,false,POS_FACEUP)
end end
return cm[2](p,c,tuner,...)
end end
cm[3]=Duel.XyzSummon cm[3]=Duel.XyzSummon
Duel.XyzSummon=function(p,c,...) Duel.XyzSummon=function(p,c,...)
...@@ -88,6 +92,7 @@ function cm.initial_effect(c) ...@@ -88,6 +92,7 @@ function cm.initial_effect(c)
Duel.SendtoGrave(c,REASON_EFFECT) Duel.SendtoGrave(c,REASON_EFFECT)
Duel.SpecialSummon(sc,0,p,p,false,false,POS_FACEUP) Duel.SpecialSummon(sc,0,p,p,false,false,POS_FACEUP)
end end
return cm[3](p,c,...)
end end
cm[4]=Duel.LinkSummon cm[4]=Duel.LinkSummon
Duel.LinkSummon=function(p,c,...) Duel.LinkSummon=function(p,c,...)
...@@ -100,6 +105,7 @@ function cm.initial_effect(c) ...@@ -100,6 +105,7 @@ function cm.initial_effect(c)
Duel.SendtoGrave(c,REASON_EFFECT) Duel.SendtoGrave(c,REASON_EFFECT)
Duel.SpecialSummon(sc,0,p,p,false,false,POS_FACEUP) Duel.SpecialSummon(sc,0,p,p,false,false,POS_FACEUP)
end end
return cm[4](p,c,...)
end end
end end
end end
......
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