Commit c2e307f5 authored by REIKAI's avatar REIKAI 💬

update lua 2

parent 2be8eb01
Pipeline #18861 passed with stages
in 24 minutes and 23 seconds
...@@ -67,15 +67,16 @@ function c1009018.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -67,15 +67,16 @@ function c1009018.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.RegisterFlagEffect(tp,1009018,RESET_CHAIN,0,1) Duel.RegisterFlagEffect(tp,1009018,RESET_CHAIN,0,1)
end end
function c1009018.spfilter(c,e,sp) function c1009018.spfilter(c,e,sp)
return c:IsFaceup() and c:IsSetCard(0x520c) and c:IsType(TYPE_MONSTER) and (c:IsLocation(LOCATION_GRAVE) or (c:IsLocation(LOCATION_EXTRA) and c:IsSetCard(0x520c) and Duel.GetLocationCountFromEx(tp,tp,c)>0)) return c:IsFaceup() and c:IsSetCard(0x520c) and c:IsType(TYPE_MONSTER) and ((c:IsLocation(LOCATION_GRAVE) and c:IsCanBeEffectTarget(e)) or (c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp,tp,c)>0))
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end end
function c1009018.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c1009018.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE+LOCATION_EXTRA) and c1009018.spfilter(chkc,e,tp) end if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE+LOCATION_EXTRA) and c1009018.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c1009018.spfilter,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(c1009018.spfilter,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c1009018.spfilter,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,c1009018.spfilter,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,1,nil,e,tp)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end end
function c1009018.spop(e,tp,eg,ep,ev,re,r,rp) function c1009018.spop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -40,7 +40,6 @@ function c1009027.initial_effect(c) ...@@ -40,7 +40,6 @@ function c1009027.initial_effect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_PRE_BATTLE_DAMAGE) e3:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e3:SetRange(LOCATION_MZONE) e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c1009027.damcon)
e3:SetOperation(c1009027.damop) e3:SetOperation(c1009027.damop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--pendulum --pendulum
...@@ -113,39 +112,33 @@ function c1009027.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -113,39 +112,33 @@ function c1009027.desop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
function c1009027.damcon(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
return ep~=tp and tc:IsSetCard(0x520c) and tc:GetBattleTarget()~=nil
end
function c1009027.damop(e,tp,eg,ep,ev,re,r,rp) function c1009027.damop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetAttackTarget() local tc=Duel.GetAttackTarget()
if not tc then return end local rc = Duel.GetAttacker()
if tc:IsControler(tp) then tc=Duel.GetAttacker() end if not tc then
c:CreateRelation(tc,RESET_EVENT+RESETS_STANDARD) return
end
if not (tc:IsControler(tp) and tc:IsSetCard(0x520c)) and not rc:IsControler(tp) and rc:IsSetCard(0x520c) then
return
end
if tc:IsControler(tp) and tc:IsSetCard(0x520c) then
tc=Duel.GetAttacker()
end
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE) e1:SetCode(EFFECT_DISABLE)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x520c))
e1:SetCondition(c1009027.discon2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x520c))
e2:SetCondition(c1009027.discon2)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE) e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE)
tc:RegisterEffect(e2) tc:RegisterEffect(e2)
Duel.ChangeBattleDamage(ep,ev*2) Duel.ChangeBattleDamage(ep,ev*2)
end end
function c1009027.discon2(e)
return e:GetOwner():IsRelateToCard(e:GetHandler())
end
function c1009027.pencon(e,tp,eg,ep,ev,re,r,rp) function c1009027.pencon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsFaceup() return c:IsPreviousLocation(LOCATION_MZONE) and c:IsFaceup()
......
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