Commit 2a7c3374 authored by Tachibana's avatar Tachibana

1145141919810

parent dbf8d881
...@@ -35,11 +35,18 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -35,11 +35,18 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsRelateToEffect(e) then if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end end
if Duel.IsExistingMatchingCard(cm.lvfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then local g=Duel.GetMatchingGroup(cm.lvfilter,tp,LOCATION_MZONE,0,nil,0)
if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,2)) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,2))
local lvl=Duel.AnnounceLevel(tp,1,4) local lvl=0
if g:GetCount()==1 then
local lv=g:GetFirst():GetLevel()
lvl=Duel.AnnounceLevel(tp,1,4,lv)
else
lvl=Duel.AnnounceLevel(tp,1,4)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local tc=Duel.SelectMatchingCard(tp,cm.lvfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp,nil):GetFirst() local tc=Duel.SelectMatchingCard(tp,cm.lvfilter,tp,LOCATION_MZONE,0,1,1,nil,lvl):GetFirst()
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL) e1:SetCode(EFFECT_CHANGE_LEVEL)
...@@ -48,8 +55,8 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -48,8 +55,8 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
end end
end end
function cm.lvfilter(c) function cm.lvfilter(c,lv)
return c:IsFaceup() and c:IsSetCard(0x480) and c:IsType(TYPE_MONSTER) and c:GetLevel()>0 return c:IsFaceup() and c:IsType(TYPE_MONSTER) and c:GetLevel()>0 and not c:IsLevel(lv)
end end
--setcard --setcard
function cm.ccon(e,tp,eg,ep,ev,re,r,rp) function cm.ccon(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -162,14 +162,14 @@ function cm.disop2(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -162,14 +162,14 @@ function cm.disop2(e,tp,eg,ep,ev,re,r,rp,chk)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE) e1:SetCode(EFFECT_DISABLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
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:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(RESET_TURN_SET) e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD) e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2) tc:RegisterEffect(e2)
end end
end end
......
...@@ -37,7 +37,8 @@ function cm.distg(e,c) ...@@ -37,7 +37,8 @@ function cm.distg(e,c)
end end
--Draw --Draw
function cm.dcon(e,tp,eg,ep,ev,re,r,rp) function cm.dcon(e,tp,eg,ep,ev,re,r,rp)
return re:GetHandler():IsSetCard(0x480) local ph=Duel.GetCurrentPhase()
return ph~=PHASE_DAMAGE and ph~=PHASE_DAMAGE_CAL and e:GetHandler():IsReason(REASON_EFFECT) and re:GetHandler():IsSetCard(0x480)
end end
function cm.dtg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.dtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
......
...@@ -61,14 +61,14 @@ function cm.spfilter(c,e,tp) ...@@ -61,14 +61,14 @@ function cm.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsCode(m) return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsCode(m)
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)
if chk==0 then return Duel.IsExistingMatchingCard(cm.spfilter1,tp,LOCATION_GRAVE,0,1,e:GetHandler(),e,tp) end if chk==0 then return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler(),e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp) function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
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,cm.spfilter1,tp,LOCATION_GRAVE,0,1,1,e:GetHandler(),e,tp) local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler(),e,tp)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end end
......
...@@ -14,7 +14,7 @@ function cm.initial_effect(c) ...@@ -14,7 +14,7 @@ function cm.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0)) e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
......
...@@ -53,6 +53,15 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -53,6 +53,15 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
e:SetOperation(nil) e:SetOperation(nil)
end end
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e)
and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
c:SetCardTarget(tc)
end
Duel.SpecialSummonComplete()
end
function cm.repfilter(c,tp) function cm.repfilter(c,tp)
return c:IsControler(tp) and c:IsLocation(LOCATION_ONFIELD) return c:IsControler(tp) and c:IsLocation(LOCATION_ONFIELD)
and c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE) and c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
......
...@@ -64,9 +64,7 @@ end ...@@ -64,9 +64,7 @@ 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)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,12090085,0xafa0,TYPES_TOKEN_MONSTER,1400,1200,4,RACE_WYRM,ATTRIBUTE_LIGHT) and Duel.IsPlayerCanSpecialSummonMonster(tp,12090085,0xafa0,TYPES_TOKEN_MONSTER,1400,1200,4,RACE_WYRM,ATTRIBUTE_LIGHT)
and e:GetHandler():GetFlagEffect(m)==0 and not Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_MZONE,0,1,nil,TYPE_NORMAL) end
and not Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_MZONE,0,1,nil,TYPE_TOKEN) end
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
......
...@@ -65,15 +65,15 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -65,15 +65,15 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EFFECT) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EFFECT)
local op=Duel.SelectOption(tp,table.unpack(ops)) local op=Duel.SelectOption(tp,table.unpack(ops))
if opval[op]==1 then if opval[op]==0 then
e:SetCategory(CATEGORY_DRAW) e:SetCategory(CATEGORY_DRAW)
e:SetOperation(cm.atop) e:SetOperation(cm.atop)
elseif opval[op]==2 then elseif opval[op]==1 then
e:SetCategory(CATEGORY_DESTROY) e:SetCategory(CATEGORY_DESTROY)
e:SetOperation(cm.tgop) e:SetOperation(cm.tgop)
local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_ONFIELD,nil) local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
elseif opval[op]==3 then elseif opval[op]==2 then
e:SetOperation(cm.spop) e:SetOperation(cm.spop)
end end
end end
......
...@@ -51,9 +51,15 @@ end ...@@ -51,9 +51,15 @@ end
function cm.spcon(e,c) function cm.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
return (Duel.GetCustomActivityCount(m,tp,ACTIVITY_CHAIN)~=0 or Duel.GetCustomActivityCount(m,1-tp,ACTIVITY_CHAIN)~=0) return Duel.GetCustomActivityCount(m,tp,ACTIVITY_CHAIN)~=0
and Duel.CheckReleaseGroup(tp,cm.spfilter,1,nil,c,tp) and Duel.CheckReleaseGroup(tp,cm.spfilter,1,nil,c,tp)
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectReleaseGroup(tp,cm.spfilter,1,1,nil,c,tp)
c:SetMaterial(g)
Duel.Release(g,REASON_COST)
c:CompleteProcedure()
end
function cm.rmcost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
......
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