Commit 336e32d3 authored by 花桃白音's avatar 花桃白音

fix 161s and others

parent bd304a20
--零界的外包
if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end
if not pcall(function() dofile("expansions/script/c10199990.lua") end) then dofile("expansions/script/c10199990.lua") end
--[[
DIY Record
......
--魔帝连结
if not pcall(function() require("expansions/script/c16199990") end) then require("script/c16199990") end
if not pcall(function() dofile("expansions/script/c16199990.lua") end) then dofile("expansions/script/c16199990.lua") end
local m,cm=rk.set(16101108)
function cm.initial_effect(c)
aux.AddCodeList(c,16172004)
......
--特殊召唤钩子测试
if not pcall(function() require("expansions/script/c16199990") end) then require("script/c16199990") end
if not pcall(function() dofile("expansions/script/c16199990.lua") end) then dofile("expansions/script/c16199990.lua") end
local m,cm=rk.set(16101111)
cm.code=16101111
cm.side_code=16101112
......
--特殊召唤钩子测试
if not pcall(function() require("expansions/script/c16199990") end) then require("script/c16199990") end
if not pcall(function() dofile("expansions/script/c16199990.lua") end) then dofile("expansions/script/c16199990.lua") end
local m,cm=rk.set(16101112)
cm.code=16101111
cm.side_code=16101112
......
--魔城的霸者 欧尔基亚斯
if not pcall(function() require("expansions/script/c16199990") end) then require("script/c16199990") end
if not pcall(function() dofile("expansions/script/c16199990.lua") end) then dofile("expansions/script/c16199990.lua") end
local m,cm=rk.set(16101113)
function cm.give(c,reset)
--
......
--大欲的招来
if not pcall(function() require("expansions/script/c16199990") end) then require("script/c16199990") end
if not pcall(function() dofile("expansions/script/c16199990.lua") end) then dofile("expansions/script/c16199990.lua") end
local m,cm=rk.set(16172000)
local code=16172004
function cm.initial_effect(c)
......
--禁时王的大噬
local m=16172001
local cm=_G["c"..m]
Duel.LoadScript("c16199990.lua")
function cm.initial_effect(c)
aux.AddCodeList(c,16172004)
local e1=Effect.CreateEffect(c)
......
--禁时王的凶仆
if not pcall(function() require("expansions/script/c16199990") end) then require("script/c16199990") end
if not pcall(function() dofile("expansions/script/c16199990.lua") end) then dofile("expansions/script/c16199990.lua") end
local m,cm=rk.set(16172002)
cm.code=16172002
cm.side_code=16172003
......
--禁时王的凶仆 贾巴兰卡
if not pcall(function() require("expansions/script/c16199990") end) then require("script/c16199990") end
if not pcall(function() dofile("expansions/script/c16199990.lua") end) then dofile("expansions/script/c16199990.lua") end
local m,cm=rk.set(16172003)
cm.code=16172002
cm.side_code=16172003
......
--禁时王
if not pcall(function() require("expansions/script/c16199990") end) then require("script/c16199990") end
if not pcall(function() dofile("expansions/script/c16199990.lua") end) then dofile("expansions/script/c16199990.lua") end
local m,cm=rk.set(16172004)
cm.code=16172004
cm.side_code=16172005
......@@ -115,7 +115,7 @@ function cm.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.spop1(e,tp,eg,ep,ev,re,r,rp)
if Duel.SetLP(1-tp,Duel.GetLP(1-tp)/2) then
Duel.SetLP(1-tp,Duel.GetLP(1-tp)/2)
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.spfilter1,tp,LOCATION_DECK,0,1,1,nil)
......@@ -123,7 +123,6 @@ function cm.spop1(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(g,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(16172004)~=0 and not re:GetHandler():IsImmuneToEffect(e) and rp~=tp
......
--禁时王的大欲
if not pcall(function() require("expansions/script/c16199990") end) then require("script/c16199990") end
if not pcall(function() dofile("expansions/script/c16199990.lua") end) then dofile("expansions/script/c16199990.lua") end
local m,cm=rk.set(16172005)
cm.code=16172004
cm.side_code=16172005
......@@ -102,8 +102,8 @@ function cm.counterop(e,tp,eg,ep,ev,re,r,rp)
end
end
function cm.costct(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,LOCATION_ONFIELD,LOCATION_ONFIELD,0x2cc,10,REASON_COST) end
Duel.RemoveCounter(tp,LOCATION_ONFIELD,LOCATION_ONFIELD,0x2cc,10,REASON_COST)
if chk==0 then return Duel.IsCanRemoveCounter(tp,LOCATION_ONFIELD,LOCATION_ONFIELD,0x2cc,8,REASON_COST) end
Duel.RemoveCounter(tp,LOCATION_ONFIELD,LOCATION_ONFIELD,0x2cc,8,REASON_COST)
end
function cm.targetct(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,true,true) end
......
--大欲的魔龙
if not pcall(function() require("expansions/script/c16199990") end) then require("script/c16199990") end
if not pcall(function() dofile("expansions/script/c16199990.lua") end) then dofile("expansions/script/c16199990.lua") end
local m,cm=rk.set(16172006)
cm.code=16172006
cm.side_code=16172007
......
--大欲的魔龙 卡伊扎
if not pcall(function() require("expansions/script/c16199990") end) then require("script/c16199990") end
if not pcall(function() dofile("expansions/script/c16199990.lua") end) then dofile("expansions/script/c16199990.lua") end
local m,cm=rk.set(16172007)
cm.code=16172006
cm.side_code=16172007
......
--恶性的斩魔
if not pcall(function() require("expansions/script/c16199990") end) then require("script/c16199990") end
if not pcall(function() dofile("expansions/script/c16199990.lua") end) then dofile("expansions/script/c16199990.lua") end
local m,cm=rk.set(16172008)
cm.code=16172008
cm.side_code=16172009
......
--恶性的斩魔 亚克亚马苏特
if not pcall(function() require("expansions/script/c16199990") end) then require("script/c16199990") end
if not pcall(function() dofile("expansions/script/c16199990.lua") end) then dofile("expansions/script/c16199990.lua") end
local m,cm=rk.set(16172009)
cm.code=16172008
cm.side_code=16172009
......
--不死鸟缝合
if not pcall(function() require("expansions/script/c16199990") end) then require("script/c16199990") end
if not pcall(function() dofile("expansions/script/c16199990.lua") end) then dofile("expansions/script/c16199990.lua") end
local m,cm=rk.set(16172010)
function cm.initial_effect(c)
aux.AddCodeList(c,16172004)
......
--恶击缝合
if not pcall(function() require("expansions/script/c16199990") end) then require("script/c16199990") end
if not pcall(function() dofile("expansions/script/c16199990.lua") end) then dofile("expansions/script/c16199990.lua") end
local m,cm=rk.set(16172012)
function cm.initial_effect(c)
aux.AddCodeList(c,16172004)
......
--灭界的魔将 巴弗洛梅亚
if not pcall(function() require("expansions/script/c16199990") end) then require("script/c16199990") end
if not pcall(function() dofile("expansions/script/c16199990.lua") end) then dofile("expansions/script/c16199990.lua") end
local m=16172018
local cm=_G["c"..m]
function cm.initial_effect(c)
......
......@@ -13,7 +13,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
end
function cm.filter(c,tp)
return c:IsCode(16172015,16172017,16172018) and c:IsAbleToHand()
return c:IsCode(16172004,16172015,16172017,16172018) and c:IsAbleToHand()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,tp) end
......
if not pcall(function() require("expansions/script/c16101100") end) then require("script/c16101100") end
if not pcall(function() dofile("expansions/script/c16101100.lua") end) then dofile("script/c16101100.lua") end
rk=rk or {}
local loc_table_for_reikai={
['dk'] = LOCATION_DECK,
......
......@@ -28,8 +28,9 @@ function c16362009.initial_effect(c)
c:RegisterEffect(e3)
end
function c16362009.spcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
local rc=re:GetHandler()
return re:IsActiveType(TYPE_MONSTER)
return Duel.GetTurnPlayer()==tp and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2) and re:IsActiveType(TYPE_MONSTER)
and rc:IsLocation(LOCATION_MZONE) and rc:IsControler(tp) and rc:IsSetCard(0xdc0)
end
function c16362009.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -97,7 +97,7 @@ function c16362028.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.BreakEffect()
Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT)
end
local e2=Effect.CreateEffect(c)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
......
--异界王的威严
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,30900609)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id)
e1:SetCondition(s.skipcon)
e1:SetOperation(s.skipop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(s.thcon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(s.target)
e2:SetOperation(s.activate)
c:RegisterEffect(e2)
end
function s.cfilter(c)
return c:IsFaceup() and c:IsCode(30900609)
end
function s.skipcon(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil)
and not Duel.IsExistingMatchingCard(aux.NOT(s.cfilter),tp,LOCATION_MZONE,0,1,nil)
and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)<Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)
end
function s.skipop(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
Duel.SkipPhase(Duel.GetTurnPlayer(),ph,RESET_PHASE+ph,1)
end
function s.ffilter(c)
return c:IsFaceup() and c:IsCode(30900609)
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.ffilter,tp,LOCATION_MZONE,0,1,nil)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
local sg=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,sg,sg:GetCount(),0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sg=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
if sg:GetCount()>0 then
Duel.ChangePosition(sg,POS_FACEUP_ATTACK,0,POS_FACEUP_ATTACK,0)
local tc=sg:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_MUST_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
tc=sg:GetNext()
end
end
end
function s.befilter(c)
return c:GetFlagEffect(id)~=0 and c:IsAttackable()
end
......@@ -81,12 +81,3 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
c:RegisterEffect(e1,true)
end
end
\ No newline at end of file
function cm.effcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_XYZ)~=0 and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
and e:GetHandler():GetReasonCard():IsSetCard(0xc87)
end
function cm.effop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
local e1=Effect.CreateEffect(rc)
......@@ -101,7 +101,7 @@ function c35100424.ovltgfilter(c)
end
function c35100424.discost(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST)
local b2=Duel.IsExistingMatchingCard(c35100424.ovltgfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,2,nil))
local b2=Duel.IsExistingMatchingCard(c35100424.ovltgfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,2,nil)
if chk==0 then return b1 or b2 end
local op=aux.SelectFromOptions(tp,{b1,aux.Stringid(35100424,2)},{b2,aux.Stringid(35100424,3)})
if op==1 then
......
......@@ -58,7 +58,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e,tp)
local ctype=bit.band(g:GetFirst():GetType(),TYPE_RITUAL+TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK)
local dg=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,nil,e,tp,ctype)
local dg=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,nil,e,tp,ctype,tgc)
Duel.HintSelection(g)
local tc=dg:GetFirst()
if g:GetCount()>0 and Duel.SendtoGrave(g,REASON_EFFECT)~=0 then
......
--上里翔流
local s,id,o=GetID()
s.MoJin=true
function s.initial_effect(c)
c:SetUniqueOnField(1,1,id)
c:SetSPSummonOnce(id)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCodeFun(c,5012604,aux.FilterBoolFunction(Card.IsFusionSetCard,0x50a),1,true,true)
aux.AddFusionProcCodeFun(c,5012604,aux.FilterBoolFunction(Card.IsFusionSetCard,MoJin==true),1,true,true)
--special summon rule
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCountLimit(1,id)
e1:SetCondition(s.hspcon)
e1:SetTarget(s.hsptg)
e1:SetOperation(s.hspop)
......@@ -50,13 +52,13 @@ function s.regop(e,tp,eg,ep,ev,re,r,rp)
end
end
function s.cfilter(c,mc)
return ((c:IsFusionSetCard(0x50a) and c:IsLocation(LOCATION_MZONE+LOCATION_GRAVE)) or c:IsFusionCode(5012604))
return ((c.MoJin==true and c:IsLocation(LOCATION_MZONE+LOCATION_GRAVE)) or c:IsFusionCode(5012604))
and c:IsAbleToRemoveAsCost() and c:IsCanBeFusionMaterial(mc)
and bit.band(c:GetOriginalType(),TYPE_MONSTER)~=0
end
function s.fselect(g,tp,mc)
return Duel.GetLocationCountFromEx(tp,tp,g,mc)>0
and g:IsExists(Card.IsFusionCode,1,nil,5012604) and g:IsExists(Card.IsFusionSetCard,1,nil,0x50a)
and g:IsExists(Card.IsFusionCode,1,nil,5012604) and g:IsExists(Card.IsFusionSetCard,1,nil,MoJin==true)
end
function s.hspcon(e,c)
if c==nil then return true end
......
......@@ -21,9 +21,9 @@ function cm.initial_effect(c)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e2:SetCountLimit(1,m+900)
e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
e2:SetCondition(cm.fuscon)
e2:SetTarget(cm.fustg)
e2:SetOperation(cm.fusop)
c:RegisterEffect(e2)
end
function cm.cfilter(c,ft)
......@@ -49,42 +49,43 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
function cm.fuscon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2
end
function cm.spfilter1(c,e)
function cm.filter1(c,e)
return not c:IsImmuneToEffect(e)
end
function cm.spfilter2(c,e,tp,m,f,gc,chkf)
function cm.filter2(c,e,tp,m,f,gc,chkf)
return c:IsType(TYPE_FUSION) and c:IsAttack(1550) and c:IsDefense(1050) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,gc,chkf)
and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
function cm.fustg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(Card.IsOnField,nil)
local res=Duel.IsExistingMatchingCard(cm.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,c,chkf)
local mg1=Duel.GetFusionMaterial(tp)
local res=Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,c,chkf)
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.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,c,chkf)
res=Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,c,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
function cm.fusop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local chkf=tp
if not c:IsRelateToEffect(e) or c:IsImmuneToEffect(e) then return end
local mg1=Duel.GetFusionMaterial(tp):Filter(cm.spfilter1,nil,e)
local sg1=Duel.GetMatchingGroup(cm.spfilter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,c,chkf)
local mg1=Duel.GetFusionMaterial(tp):Filter(cm.filter1,nil,e)
local sg1=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,c,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
......@@ -92,7 +93,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(cm.spfilter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,c,chkf)
sg2=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,c,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
......
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