Commit c803d1c5 authored by mercury233's avatar mercury233 Committed by GitHub

fix エレキングダム

parent 119bb9be
...@@ -57,6 +57,16 @@ function s.splim(e,c) ...@@ -57,6 +57,16 @@ function s.splim(e,c)
return c:GetRace()~=RACE_THUNDER return c:GetRace()~=RACE_THUNDER
end end
function s.operation(e,tp,eg,ep,ev,re,r,rp) function s.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp,tc:GetCode()):GetFirst()
if sc and Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)>0 and aux.nzatk(sc) then
Duel.BreakEffect()
local lp=Duel.GetLP(tp)
Duel.SetLP(tp,lp-sc:GetAttack())
end
end
local c=e:GetHandler() local c=e:GetHandler()
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
...@@ -66,13 +76,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -66,13 +76,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp)
e1:SetTarget(s.splim) e1:SetTarget(s.splim)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or tc:IsFacedown() or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp,tc:GetCode()):GetFirst()
if sc and Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)>0 and aux.nzatk(sc) then
Duel.BreakEffect()
local lp=Duel.GetLP(tp)
Duel.SetLP(tp,lp-sc:GetAttack())
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