Commit aa35d60e authored by salix5's avatar salix5

Merge pull request #254 from DailyShana/patch-8

fix
parents c0feb657 4f7d63d3
--竜星の具象化 --竜星の具象化
function c30398342.initial_effect(c) function c30398342.initial_effect(c)
Duel.EnableGlobalFlag(GLOBALFLAG_DELAYED_QUICKEFFECT)
--Activate --Activate
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(30398342,1))
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--spsummon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(30398342,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_DESTROYED)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetHintTiming(TIMING_DESTROY) e1:SetCondition(c30398342.spcon)
e1:SetCondition(c30398342.spcon1) e1:SetCost(c30398342.spcost)
e1:SetTarget(c30398342.sptg1) e1:SetTarget(c30398342.sptg1)
e1:SetOperation(c30398342.spop) e1:SetOperation(c30398342.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
...@@ -19,7 +28,7 @@ function c30398342.initial_effect(c) ...@@ -19,7 +28,7 @@ function c30398342.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1) e2:SetCountLimit(1)
e2:SetCondition(c30398342.spcon2) e2:SetCondition(c30398342.spcon)
e2:SetCost(c30398342.spcost) e2:SetCost(c30398342.spcost)
e2:SetTarget(c30398342.sptg2) e2:SetTarget(c30398342.sptg2)
e2:SetOperation(c30398342.spop) e2:SetOperation(c30398342.spop)
...@@ -34,34 +43,11 @@ function c30398342.initial_effect(c) ...@@ -34,34 +43,11 @@ function c30398342.initial_effect(c)
e3:SetTarget(c30398342.sumlimit) e3:SetTarget(c30398342.sumlimit)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c30398342.spcon1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetCurrentPhase()~=PHASE_DAMAGE then return true end
local res,teg,tep,tev,tre,tr,trp=Duel.CheckEvent(EVENT_DESTROYED,true)
return res and teg:IsExists(c30398342.cfilter,1,nil,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c30398342.filter,tp,LOCATION_DECK,0,1,nil,e,tp)
end
function c30398342.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local res,teg,tep,tev,tre,tr,trp=Duel.CheckEvent(EVENT_DESTROYED,true)
if Duel.GetCurrentPhase()==PHASE_DAMAGE
or (res and teg:IsExists(c30398342.cfilter,1,nil,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c30398342.filter,tp,LOCATION_DECK,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,aux.Stringid(30398342,1))) then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
e:GetHandler():RegisterFlagEffect(30398342,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
e:GetHandler():RegisterFlagEffect(0,RESET_CHAIN,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(30398342,2))
else
e:SetCategory(0)
end
end
function c30398342.cfilter(c,tp) function c30398342.cfilter(c,tp)
return c:IsReason(REASON_BATTLE+REASON_EFFECT) return c:IsReason(REASON_BATTLE+REASON_EFFECT)
and c:IsPreviousLocation(LOCATION_MZONE) and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE) and c:GetPreviousControler()==tp
end end
function c30398342.spcon2(e,tp,eg,ep,ev,re,r,rp) function c30398342.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c30398342.cfilter,1,nil,tp) return eg:IsExists(c30398342.cfilter,1,nil,tp)
end end
function c30398342.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function c30398342.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
...@@ -71,6 +57,11 @@ end ...@@ -71,6 +57,11 @@ end
function c30398342.filter(c,e,tp) function c30398342.filter(c,e,tp)
return c:IsSetCard(0x9e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0x9e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c30398342.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c30398342.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c30398342.sptg2(e,tp,eg,ep,ev,re,r,rp,chk) function c30398342.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToEffect(e) if chk==0 then return e:GetHandler():IsRelateToEffect(e)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
...@@ -78,7 +69,6 @@ function c30398342.sptg2(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -78,7 +69,6 @@ function c30398342.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
function c30398342.spop(e,tp,eg,ep,ev,re,r,rp) function c30398342.spop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetFlagEffect(30398342)==0 then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c30398342.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,c30398342.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
......
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