Commit aff23d43 authored by wyykak's avatar wyykak

refactor and fix by kiritosoft

Signed-off-by: wyykak's avatarwyykak <wyy_1414@126.com>
parent 9d72a152
Pipeline #14360 passed with stage
in 50 seconds
......@@ -61,11 +61,7 @@ function c74563608.cost1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemoveAsCost,tp,LOCATION_ONFIELD+LOCATION_HAND,0,2,2,e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
else
if Duel.IsPlayerAffectedByEffect(tp,74563666) then
Duel.PayLPCost(tp,666)
else
Duel.PayLPCost(tp,3666)
end
end
end
function c74563608.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
......@@ -62,11 +62,7 @@ function c74563609.cost1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemoveAsCost,tp,LOCATION_ONFIELD+LOCATION_HAND,0,2,2,e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
else
if Duel.IsPlayerAffectedByEffect(tp,74563666) then
Duel.PayLPCost(tp,666)
else
Duel.PayLPCost(tp,3666)
end
end
end
function c74563609.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
......@@ -61,11 +61,7 @@ function c74563610.cost1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemoveAsCost,tp,LOCATION_ONFIELD+LOCATION_HAND,0,2,2,e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
else
if Duel.IsPlayerAffectedByEffect(tp,74563666) then
Duel.PayLPCost(tp,666)
else
Duel.PayLPCost(tp,3666)
end
end
end
function c74563610.target(e,tp,eg,ep,ev,re,r,rp,chk)
......@@ -73,14 +69,14 @@ function c74563610.target(e,tp,eg,ep,ev,re,r,rp,chk)
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
local count=sg:GetCount()
local count1=0
count1=math.ceil(count/3*2)
count1=math.ceil(count/3*2)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,count1,0,0)
end
function c74563610.activate(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
local count=sg:GetCount()
local count1=0
count1=math.ceil(count/3*2)
count1=math.ceil(count/3*2)
local sg1=sg:RandomSelect(1-tp,count1)
Duel.Destroy(sg1,REASON_EFFECT)
end
\ No newline at end of file
--冰狱之王·撒旦
function c74563666.initial_effect(c)
--change cost
--Cost Change
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_LPCOST_CHANGE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(74563666)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
e2:SetValue(c74563666.costchange)
c:RegisterEffect(e2)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
......@@ -24,7 +25,7 @@ function c74563666.initial_effect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_FREE_CHAIN)
e5:SetRange(LOCATION_REMOVED)
e5:SetLabelObject(e1)
e5:SetLabelObject(e1)
e5:SetCondition(c74563666.con)
e5:SetOperation(c74563666.sprop1)
c:RegisterEffect(e5)
......@@ -40,6 +41,13 @@ function c74563666.initial_effect(c)
e2:SetOperation(c74563666.cpop)
c:RegisterEffect(e2)
end
function c74563666.costchange(e,re,rp,val)
if re and re:GetHandler():IsSetCard(0x996) then
return 666
else
return val
end
end
function c74563666.sprfilter(c)
return (c:IsRank(6) or c:IsLevel(6) or c:IsLink(6)) and c:IsAbleToRemoveAsCost()
end
......@@ -48,16 +56,16 @@ function c74563666.sprcon(e,c)
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c74563666.sprfilter,tp,LOCATION_MZONE,0,3,nil)
and (c74563666.special or not c:IsLocation(LOCATION_REMOVED))
and (c74563666.special or not c:IsLocation(LOCATION_REMOVED))
end
function c74563666.sprop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c74563666.sprfilter,tp,LOCATION_MZONE,0,3,3,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
c74563666.special=false
c74563666.special=false
end
function c74563666.sprop1(e,tp,eg,ep,ev,re,r,rp,chk)
c74563666.special=true
c74563666.special=true
Duel.SpecialSummonRule(e:GetHandler():GetControler(),e:GetHandler())
end
function c74563666.cpfilter(c)
......@@ -65,9 +73,9 @@ function c74563666.cpfilter(c)
and c:CheckActivateEffect(true,true,false)~=nil
end
function c74563666.con(e,tp,eg,ep,ev,re,r,rp)
c74563666.special=true
local cansp=e:GetHandler():IsCanBeSpecialSummoned(e:GetLabelObject(),0,tp,false,true)
c74563666.special=false
c74563666.special=true
local cansp=e:GetHandler():IsCanBeSpecialSummoned(e:GetLabelObject(),0,tp,false,true)
c74563666.special=false
return Duel.GetCurrentChain()==0 and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 and Duel.IsExistingMatchingCard(c74563666.sprfilter,tp,LOCATION_MZONE,0,3,nil) and cansp
end
function c74563666.cpcost(e,tp,eg,ep,ev,re,r,rp,chk)
......
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