Commit 98d8f17a authored by Nemo Ma's avatar Nemo Ma

fix

parent 45ddd623
...@@ -66,7 +66,7 @@ function cm.fselect1(g,tp) ...@@ -66,7 +66,7 @@ function cm.fselect1(g,tp)
return g:GetClassCount(Card.GetCode)==1 and g:GetCount()>=2 and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.thfilter1),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,g:GetFirst():GetCode()) return g:GetClassCount(Card.GetCode)==1 and g:GetCount()>=2 and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.thfilter1),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,g:GetFirst():GetCode())
end end
function cm.thfilter1(c,code) function cm.thfilter1(c,code)
return c:IsCode(tc:GetCode()) and c:IsAbleToHand() return c:IsCode(code) and c:IsAbleToHand()
end end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsSetCard,tp,LOCATION_MZONE+LOCATION_HAND,0,nil,0x5356) local g=Duel.GetMatchingGroup(Card.IsSetCard,tp,LOCATION_MZONE+LOCATION_HAND,0,nil,0x5356)
......
...@@ -93,7 +93,7 @@ function cm.damop1(e,tp,eg,ep,ev,re,r,rp) ...@@ -93,7 +93,7 @@ function cm.damop1(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetHandler():GetEquipTarget() local ec=e:GetHandler():GetEquipTarget()
local ct=eg:FilterCount(cm.damfilter,nil,1-tp) local ct=eg:FilterCount(cm.damfilter,nil,1-tp)
if ec then if ec then
local ct1=ec:GetFlagEffectLabel(13257200)*150 local ct1=tama.cosmicBattleship_getCoreLevel(ec)*150
if ct>0 and ct1>0 then if ct>0 and ct1>0 then
Duel.Hint(HINT_CARD,1,m) Duel.Hint(HINT_CARD,1,m)
Duel.Damage(1-tp,ct*ct1,REASON_EFFECT) Duel.Damage(1-tp,ct*ct1,REASON_EFFECT)
......
...@@ -99,7 +99,7 @@ function cm.chkfilter(c,tp) ...@@ -99,7 +99,7 @@ function cm.chkfilter(c,tp)
return c:IsSetCard(0x353) and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE) return c:IsSetCard(0x353) and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE)
end end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp) function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.chkfilter,1,nil,tp) and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)>0 return eg:IsExists(cm.chkfilter,1,nil,tp) and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsLevelAbove(6) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsLevelAbove(6) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
...@@ -45,7 +45,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -45,7 +45,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
end end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp) function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,m)>0 then return end if Duel.GetFlagEffect(tp,m)>0 then return end
Duel.RegisterFlagEffect(tp,m,0,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,1)) Duel.RegisterFlagEffect(tp,m,0,EFFECT_FLAG_CLIENT_HINT,1,aux.Stringid(m,1))
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetCode(EVENT_SUMMON_SUCCESS)
......
...@@ -32,6 +32,9 @@ function cm.initial_effect(c) ...@@ -32,6 +32,9 @@ function cm.initial_effect(c)
cm[c]=eflist cm[c]=eflist
end end
function cm.eqfilter(c,ec)
return c:IsSetCard(0x352) and c:IsType(TYPE_MONSTER) and c:CheckEquipTarget(ec)
end
function cm.pcfilter(c,tp) function cm.pcfilter(c,tp)
return c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:IsPreviousLocation(LOCATION_MZONE) and c:GetPreviousControler()==tp return c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:IsPreviousLocation(LOCATION_MZONE) and c:GetPreviousControler()==tp
end end
......
...@@ -17,6 +17,7 @@ function cm.initial_effect(c) ...@@ -17,6 +17,7 @@ function cm.initial_effect(c)
e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e2) c:RegisterEffect(e2)
]] ]]
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,5)) e1:SetDescription(aux.Stringid(m,5))
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE+CATEGORY_DESTROY) e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_QUICK_O)
......
...@@ -3,6 +3,7 @@ local m=13257358 ...@@ -3,6 +3,7 @@ local m=13257358
local cm=_G["c"..m] local cm=_G["c"..m]
xpcall(function() require("expansions/script/tama") end,function() require("script/tama") end) xpcall(function() require("expansions/script/tama") end,function() require("script/tama") end)
function cm.initial_effect(c) function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0)) e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
......
--Orth Saints
if not pcall(function() require("expansions/script/c16199990") end) then require("script/c16199990") end
local m,cm=rk.set(16104200)
if rkch then return end
rkch=cm
function rkch.PenTri(c,code,cost)-- Tribute Summon From Pendulum-Zone
--pendulum summon
aux.EnablePendulumAttribute(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCategory(CATEGORY_SUMMON)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,code)
if cost then
e1:SetCost(cost)
end
e1:SetCondition(cm.PenTriCondition1)
e1:SetTarget(cm.PenTriTarget)
e1:SetOperation(cm.PenTriOp)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCategory(CATEGORY_SUMMON)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1,code)
if cost then
e2:SetCost(cost)
end
e2:SetCondition(cm.PenTriCondition2)
e2:SetTarget(cm.PenTriTarget)
e2:SetOperation(cm.PenTriOp)
c:RegisterEffect(e2)
return e1,e2
end
function rkch.PenSpLimit(c,flag)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetRange(LOCATION_PZONE)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.splimit)
c:RegisterEffect(e1)
end
function cm.splimit(e,c,tp,sumtp,sumpos)
return not c:IsSetCard(0xccd) and not c:IsSetCard(0xccb)
end
function cm.PenTriCondition1(e,tp)
return Duel.GetFlagEffect(tp,16104242)==0
end
function cm.PenTriCondition2(e,tp)
return Duel.GetFlagEffect(tp,16104242)>0
end
function cm.PenTriTarget(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local minc,maxc=c:GetTributeRequirement()
if chk==0 then return Duel.IsPlayerCanSummon(tp,SUMMON_TYPE_ADVANCE,c) and Duel.CheckTribute(c,minc,maxc) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,c,1,tp,LOCATION_PZONE)
end
function cm.PenTriOp(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local minc,maxc=c:GetTributeRequirement()
if not c:IsRelateToEffect(e) or not Duel.CheckTribute(c,minc,maxc) or not Duel.IsPlayerCanSummon(tp,SUMMON_TYPE_ADVANCE,c) then return end
local SummonCheck=Duel.CheckTribute(c,minc,maxc)
if SummonCheck then
Duel.Summon(tp,c,true,nil,1)
end
end
function rkch.GainEffect(c,code)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_NO_TURN_RESET+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetCountLimit(1)
e1:SetCondition(cm.gecon)
e1:SetOperation(cm.geop)
c:RegisterEffect(e1)
e1:SetLabel(code)
return e1
end
function cm.gecon(e,tp,eg)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc:GetPreviousControler()~=tp and c:GetFlagEffect(e:GetLabel())==0
end
function cm.geop(e,tp)
local c=e:GetHandler()
Duel.Hint(HINT_CARD,0,e:GetLabel())
if not c:IsLocation(LOCATION_MZONE) or not c:IsFaceup() then return end
c:RegisterFlagEffect(e:GetLabel(),rsreset.est,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,3))
end
function rkch.gaincon(code)
return function(e)
return e:GetHandler():GetFlagEffect(code)>0
end
end
function rkch.MonzToPen(c,code,code1,flag)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(code1)
if flag==true then
e2:SetOperation(cm.MontoPenop)
else
e2:SetOperation(cm.MonToPenOp2)
end
c:RegisterEffect(e2)
end
function cm.MontoPenop(e,tp)
local c=e:GetHandler()
if c:IsFacedown() or c:IsLocation(LOCATION_DECK) then return false end
if not c:IsPreviousLocation(LOCATION_MZONE) then return end
if (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) and not c:IsForbidden() and c:CheckUniqueOnField(tp) then
Duel.Hint(HINT_CARD,0,c:GetOriginalCode())
local g=Group.FromCards(c)
g=g:Select(tp,1,1,nil)
Duel.MoveToField(g:GetFirst(),tp,tp,LOCATION_PZONE,POS_FACEUP,false)
c:SetStatus(STATUS_EFFECT_ENABLED,true)
end
end
function cm.MonToPenOp2(e,tp)
local c=e:GetHandler()
if c:IsFacedown() or c:IsLocation(LOCATION_DECK) then return false end
if not c:IsPreviousLocation(LOCATION_MZONE) then return end
if (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) and not c:IsForbidden() and c:CheckUniqueOnField(tp) then
Duel.Hint(HINT_CARD,0,c:GetOriginalCode())
if Duel.SelectYesNo(tp,aux.Stringid(m,4)) then
local g=Group.FromCards(c)
g=g:Select(tp,1,1,nil)
Duel.MoveToField(g:GetFirst(),tp,tp,LOCATION_PZONE,POS_FACEUP,false)
c:SetStatus(STATUS_EFFECT_ENABLED,true)
end
end
end
function rkch.PenAdd(c,deslist,codelist,functionlist,flag)
local e=Effect.CreateEffect(c)
e:SetDescription(aux.Stringid(table.unpack(deslist)))
if flag==true then
e:SetType(EFFECT_TYPE_QUICK_O)
else
e:SetType(EFFECT_TYPE_IGNITION)
end
e:SetRange(LOCATION_PZONE)
e:SetCode(EVENT_FREE_CHAIN)
e:SetCountLimit(table.unpack(codelist))
for i=1,4 do
if functionlist[i] and aux.GetValueType(functionlist[i])~="function" then
error(string.format("the %d Param of functionlist must be func",i),2)
end
if functionlist[i] and i==1 then
e:SetCost(functionlist[i])
end
if functionlist[i] and i==2 then
e:SetCondition(functionlist[i])
end
if functionlist[i] and i==3 then
e:SetTarget(functionlist[i])
elseif i==3 then
e:SetTarget(cm.AddTarget)
end
if functionlist[i] and i==4 then
e:SetOperation(functionlist[i])
elseif i==4 then
e:SetOperation(cm.AddOp)
end
end
c:RegisterEffect(e)
return e
end
function cm.AddFilter(c)
return c:IsSetCard(0xccd) and c:IsAbleToHand() and c:IsType(TYPE_MONSTER)
end
function cm.AddTarget(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.AddFilter,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil) end
e:SetCategory(CATEGORY_TOHAND+CATEGORY_LEAVE_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_EXTRA+LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,tp,nil)
end
function cm.AddOp(e,tp)
if not e:GetHandler():IsRelateToEffect(e) then return false end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.AddFilter),tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.SendtoHand(g,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.DoubleFilter(c)
return rk.check(c,"DAIOU") or c:IsSetCard(0xccd)
end
function rkch.DoubleTriFun(c,tc,reset,filter)
tc = tc or c
local tg = aux.TargetBoolFunction(cm.DoubleFilter)
if filter then tg = aux.TargetBoolFunction(filter) end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DOUBLE_TRIBUTE)
if reset then
e1:SetReset(reset)
end
e1:SetValue(tg)
tc:RegisterEffect(e1)
return e1
end
--------------------------------------
if not cm then return end
function cm.initial_effect(c)
aux.EnablePendulumAttribute(c)
local e0=rkch.PenSpLimit(c,true)
local e1=rsef.STO(c,EVENT_SPSUMMON_SUCCESS,{m,0},nil,"sp","de,dsp",nil,nil,rsop.target(cm.spfilter,"sp",LOCATION_DECK),cm.spop)
local e2=rsef.RegisterClone(c,e1,"code",EVENT_SUMMON_SUCCESS)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_PZONE)
e3:SetCountLimit(1,m)
e3:SetCost(cm.cost)
e3:SetTarget(cm.target)
e3:SetOperation(cm.operation)
c:RegisterEffect(e3)
local e4=rkch.DoubleTriFun(c)
local e5=rkch.MonzToPen(c,m,EVENT_LEAVE_FIELD,true)
end
function cm.spfilter(c,e,tp)
return c:IsLevelBelow(4) and c:IsSetCard(0xccd) and rscf.spfilter2()(c,e,tp) and not c:IsCode(m)
end
function cm.spop(e,tp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
local tc=g:GetFirst()
if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e13=Effect.CreateEffect(c)
e13:SetType(EFFECT_TYPE_SINGLE)
e13:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e13:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e13:SetReset(RESET_EVENT+RESETS_STANDARD)
e13:SetValue(1)
tc:RegisterEffect(e13,true)
local e14=e13:Clone()
e14:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
tc:RegisterEffect(e14,true)
local e15=e13:Clone()
e15:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
tc:RegisterEffect(e15,true)
local e15=e13:Clone()
e15:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
tc:RegisterEffect(e15,true)
end
Duel.SpecialSummonComplete()
end
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
end
function cm.thfilter(c)
return c:IsSetCard(0xccd) and not c:IsCode(m) and c:IsAbleToHand() and (c:IsFaceup() or c:IsLocation(LOCATION_DECK))
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_EXTRA)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
...@@ -3,7 +3,7 @@ function c29010013.initial_effect(c) ...@@ -3,7 +3,7 @@ function c29010013.initial_effect(c)
--fusion material --fusion material
c:EnableReviveLimit() c:EnableReviveLimit()
--fusion material --fusion material
aux.AddFusionProcCodeFunRep(c,29010010,aux.FilterBoolFunction(Card.IsRace,RACE_AQUA),1,99,true,true) aux.AddFusionProcCodeFunRep(c,29010010,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_WATER),1,99,true,true)
aux.AddContactFusionProcedure(c,Card.IsAbleToGraveAsCost,LOCATION_MZONE,0,Duel.SendtoGrave,REASON_COST+REASON_MATERIAL) aux.AddContactFusionProcedure(c,Card.IsAbleToGraveAsCost,LOCATION_MZONE,0,Duel.SendtoGrave,REASON_COST+REASON_MATERIAL)
--spsummon condition --spsummon condition
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
......
...@@ -97,7 +97,7 @@ function c53705003.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -97,7 +97,7 @@ function c53705003.activate(e,tp,eg,ep,ev,re,r,rp)
local sg=g:Select(tp,1,1,nil) local sg=g:Select(tp,1,1,nil)
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT) Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
local tc=Duel.GetOperatedGroup():GetFirst() local tc=Duel.GetOperatedGroup():GetFirst()
if tc:IsLocation(LOCATION_DECK+LOCATION_EXTRA) and tc:IsPreviousSetCard(0x3534) and tc:IsPreviousPosition(POS_FACEUP) then if tc and tc:IsLocation(LOCATION_DECK+LOCATION_EXTRA) and tc:IsPreviousSetCard(0x3534) and tc:IsPreviousPosition(POS_FACEUP) then
Duel.ShuffleDeck(tp) Duel.ShuffleDeck(tp)
Duel.BreakEffect() Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT) Duel.Draw(tp,1,REASON_EFFECT)
......
...@@ -109,7 +109,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -109,7 +109,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local sg=g:Select(tp,1,1,nil) local sg=g:Select(tp,1,1,nil)
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT) Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
local tc=Duel.GetOperatedGroup():GetFirst() local tc=Duel.GetOperatedGroup():GetFirst()
if tc:IsLocation(LOCATION_DECK+LOCATION_EXTRA) and tc:IsPreviousSetCard(0x3534) and tc:IsPreviousPosition(POS_FACEUP) then if tc and tc:IsLocation(LOCATION_DECK+LOCATION_EXTRA) and tc:IsPreviousSetCard(0x3534) and tc:IsPreviousPosition(POS_FACEUP) then
Duel.ShuffleDeck(tp) Duel.ShuffleDeck(tp)
Duel.BreakEffect() Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT) Duel.Draw(tp,1,REASON_EFFECT)
......
...@@ -103,7 +103,7 @@ function c53705007.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -103,7 +103,7 @@ function c53705007.operation(e,tp,eg,ep,ev,re,r,rp)
local sg=g:Select(tp,1,1,nil) local sg=g:Select(tp,1,1,nil)
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT) Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
local tc=Duel.GetOperatedGroup():GetFirst() local tc=Duel.GetOperatedGroup():GetFirst()
if tc:IsLocation(LOCATION_DECK+LOCATION_EXTRA) and tc:IsPreviousSetCard(0x3534) and tc:IsPreviousPosition(POS_FACEUP) then if tc and tc:IsLocation(LOCATION_DECK+LOCATION_EXTRA) and tc:IsPreviousSetCard(0x3534) and tc:IsPreviousPosition(POS_FACEUP) then
Duel.ShuffleDeck(tp) Duel.ShuffleDeck(tp)
Duel.BreakEffect() Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT) Duel.Draw(tp,1,REASON_EFFECT)
......
...@@ -4,10 +4,22 @@ cm.name="断片折光 幻想愚间" ...@@ -4,10 +4,22 @@ cm.name="断片折光 幻想愚间"
if not pcall(function() require("expansions/script/c53702500") end) then require("script/c53702500") end if not pcall(function() require("expansions/script/c53702500") end) then require("script/c53702500") end
function cm.initial_effect(c) function cm.initial_effect(c)
SNNM.FanippetTrap(c,800,m,1400,1500,RACE_FIEND,ATTRIBUTE_EARTH) SNNM.FanippetTrap(c,800,m,1400,1500,RACE_FIEND,ATTRIBUTE_EARTH)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_GRAVE)
e3:SetCondition(cm.spcon)
e3:SetCost(SNNM.FanippetTrapSPCost(800,code))
e3:SetTarget(SNNM.FanippetTrapSPTarget(code,atk,def,rac,att))
e3:SetOperation(SNNM.FanippetTrapSPOperation(code,atk,def,rac,att,0))
c:RegisterEffect(e3)
end end
function cm.cfilter(c) function cm.cfilter(c)
return c:IsFaceup() and bit.band(c:GetType(),0x20004)==0x20004 and not c:IsCode(m) return c:IsFaceup() and bit.band(c:GetType(),0x20004)==0x20004 and not c:IsCode(m)
end end
function SNNM.FanippetTrapSPCondition(e,tp,eg,ep,ev,re,r,rp) function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil) return eg:IsExists(cm.cfilter,1,nil)
end end
...@@ -19,7 +19,7 @@ function cm.initial_effect(c) ...@@ -19,7 +19,7 @@ function cm.initial_effect(c)
e2:SetCategory(CATEGORY_TOHAND) e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1) e2:SetCountLimit(1,m+50)
e2:SetCondition(cm.con1) e2:SetCondition(cm.con1)
e2:SetCost(cm.cost) e2:SetCost(cm.cost)
e2:SetTarget(cm.tg) e2:SetTarget(cm.tg)
......
...@@ -2,7 +2,6 @@ local m=53799120 ...@@ -2,7 +2,6 @@ local m=53799120
local cm=_G["c"..m] local cm=_G["c"..m]
cm.name="双魂共斗" cm.name="双魂共斗"
function cm.initial_effect(c) function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_LEAVE_GRAVE) e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_LEAVE_GRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
...@@ -21,32 +20,45 @@ function cm.filter(c) ...@@ -21,32 +20,45 @@ function cm.filter(c)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_DECK,0,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_DECK,0,nil)
if chk==0 then return g:CheckSubGroup(aux.gfcheck,2,2,Card.IsCode,m-1,m+1) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>1 and g:CheckSubGroup(aux.gfcheck,2,2,Card.IsCode,m-1,m+1) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<2 then return end
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil) local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil)
local g1=Duel.GetMatchingGroup(cm.filter1,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
g2=Group.__add(g,g1) local sg=g:SelectSubGroup(tp,aux.gfcheck,false,2,2,Card.IsCode,m-1,m+1)
if #g2>1 then if #sg==2 and Duel.SSet(tp,sg)==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) for tc in aux.Next(sg) do
local tg=g2:FilterSelect(tp,Card.IsAbleToHand,1,1,nil) local e1=Effect.CreateEffect(e:GetHandler())
local tc=tg:GetFirst() e1:SetType(EFFECT_TYPE_SINGLE)
if g:IsContains(tc) then e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
g2:Sub(g) e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
else e1:SetReset(RESET_EVENT+RESETS_STANDARD)
g2:Sub(g1) tc:RegisterEffect(e1)
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) sg:KeepAlive()
local tg1=g2:FilterSelect(tp,Card.IsSSetable,1,1,nil) local e2=Effect.CreateEffect(e:GetHandler())
Duel.SendtoHand(tc,nil,REASON_EFFECT) e2:SetType(EFFECT_TYPE_FIELD)
Duel.ConfirmCards(1-tp,tc) e2:SetCode(EFFECT_ACTIVATE_COST)
Duel.SSet(tp,tg1) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
local e1=Effect.CreateEffect(e:GetHandler()) e2:SetTargetRange(1,0)
e1:SetType(EFFECT_TYPE_SINGLE) e2:SetLabelObject(sg)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN) e2:SetTarget(cm.actarget)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE) e2:SetOperation(cm.costop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e2:SetReset(RESET_PHASE+PHASE_END)
tg1:GetFirst():RegisterEffect(e1) Duel.RegisterEffect(e2,tp)
end end
end end
function cm.actarget(e,te,tp)
return e:GetLabelObject():IsContains(te:GetHandler()) and te:GetHandler():GetFlagEffect(m)>0
end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
for tc in aux.Next(g) do
tc:ResetEffect(EFFECT_TRAP_ACT_IN_SET_TURN,RESET_CODE)
tc:ResetFlagEffect(m)
end
e:Reset()
end
...@@ -65,7 +65,7 @@ function c7409805.drop(e,tp,eg,ep,ev,re,r,rp) ...@@ -65,7 +65,7 @@ function c7409805.drop(e,tp,eg,ep,ev,re,r,rp)
e2:SetCode(EFFECT_UPDATE_DEFENSE) e2:SetCode(EFFECT_UPDATE_DEFENSE)
tc:RegisterEffect(e2) tc:RegisterEffect(e2)
else else
local g=Duel.GetMatchingGroup(c7409805.Grimy_Goons_filter,p,LOCATION_HAND,0,nil) local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,p,LOCATION_HAND,0,nil)
if g:GetCount()==0 then return end if g:GetCount()==0 then return end
Duel.BreakEffect() Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,p,HINTMSG_TODECK)
......
...@@ -44,7 +44,7 @@ function c9910268.activate1(e,tp,eg,ep,ev,re,r,rp) ...@@ -44,7 +44,7 @@ function c9910268.activate1(e,tp,eg,ep,ev,re,r,rp)
end end
local c=e:GetHandler() local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) and e:IsHasType(EFFECT_TYPE_ACTIVATE) if c:IsFaceup() and c:IsRelateToEffect(e) and e:IsHasType(EFFECT_TYPE_ACTIVATE)
and Duel.IsExistingMatchingCard(c9910268.cfilter,tp,LOCATION_MZONE,0,1,nil) then and Duel.IsExistingMatchingCard(c9910268.cfilter1,tp,LOCATION_MZONE,0,1,nil) then
c:CancelToGrave() c:CancelToGrave()
c:AddCounter(0x953,2) c:AddCounter(0x953,2)
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