Commit 14294917 authored by REIKAI's avatar REIKAI 💬

rep 9.21

parent a8e16141
......@@ -36,23 +36,29 @@ function cm.spfilter2(c,e,tp,lv)
end
function cm.filter(c,e,tp)
local lv=c:GetLevel()
return c:IsFaceup() and c:IsType(TYPE_MONSTER) and c:IsReleasable() and Duel.IsExistingMatchingCard(cm.spfilter1,tp,LOCATION_DECK,0,1,nil,e,tp,lv)
local ct=2
if c:GetLocation(LOCATION_MZONE) then ct=1 end
return c:IsFaceup() and c:IsType(TYPE_MONSTER) and c:IsReleasable() and Duel.IsExistingMatchingCard(cm.spfilter1,tp,LOCATION_DECK,0,1,nil,e,tp,lv) Duel.GetMZoneCount(tp)>=ct
end
function cm.hfilter(c)
return c:IsDiscardable(REASON_EFFECT)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE+LOCATION_HAND) and cm.filter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_MZONE+LOCATION_HAND,0,1,nil,e,tp) and Duel.GetMZoneCount(tp)>1 and Duel.IsExistingMatchingCard(cm.hfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) and not Duel.IsPlayerAffectedByEffect(tp,59822133) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_MZONE+LOCATION_HAND,0,1,nil,e,tp)
and Duel.IsExistingMatchingCard(cm.hfilter,tp,LOCATION_HAND,0,1,e:GetHandler())
and not Duel.IsPlayerAffectedByEffect(tp,59822133) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_MZONE+LOCATION_HAND,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFacedown() or not tc:IsRelateToEffect(e) and Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.DiscardHand(tp,cm.hfilter,1,1,REASON_EFFECT+REASON_DISCARD,nil)==0
or tc:IsFacedown() or not tc:IsRelateToEffect(e)
then return end
local lv=tc:GetLevel()
if Duel.Release(tc,REASON_EFFECT)~=0 and Duel.GetMZoneCount(tp)>1 and Duel.DiscardHand(tp,cm.hfilter,1,1,REASON_EFFECT+REASON_DISCARD,nil)~=0 then
if Duel.Release(tc,REASON_EFFECT)==0 and not Duel.IsPlayerAffectedByEffect(tp,59822133) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=Duel.SelectMatchingCard(tp,cm.spfilter1,tp,LOCATION_DECK,0,1,1,nil,e,tp,lv)
local t=g1:GetFirst()
......
......@@ -129,7 +129,7 @@ function cm.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function cm.drop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetFieldGroup(pt,0,LOCATION_HAND)
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
if c:IsRelateToEffect(e) and Duel.SendtoHand(c,nil,REASON_EFFECT)>0 and c:IsLocation(LOCATION_HAND) and g:GetCount()>0 then
Duel.ConfirmCards(tp,g)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
......
......@@ -76,10 +76,10 @@ function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetFieldGroup(p,0,LOCATION_HAND)
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
if g:GetCount()>0 then
Duel.ConfirmCards(tp,g)
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_ATOHAND)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
g=g:Filter(cm.bfilter,nil,tp)
local sg=g:Select(tp,1,1,nil)
if Duel.SendtoHand(sg,tp,REASON_EFFECT)>0 then
......
......@@ -65,10 +65,10 @@ function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetFieldGroup(p,0,LOCATION_HAND)
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
if g:GetCount()>0 then
Duel.ConfirmCards(tp,g)
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_OPERATECARD)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
g=g:Filter(cm.bfilter,nil,e,tp)
local sg=g:Select(tp,1,1,nil)
if sg:GetCount()>0 then
......
......@@ -45,7 +45,7 @@ function cm.spcon(e,c)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
end
function cm.thfilter(c)
return c:IsRace(RACE_BEASTWARRIOR) and c:IsLevel(8) and c:IsAbleToHand()
return c:IsRace(RACE_BEASTWARRIOR) and c:IsLevel(8) and c:IsAbleToHand() and not c:IsCode(m)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
......
......@@ -50,7 +50,7 @@ function cm.ssop(e,tp,eg,ep,ev,re,r,rp)
end
end
function cm.costfilter(c)
return c:IsLevel(8) and c:IsRace(RACE_BEASTWARRIOR) and (c:IsFaceup() or c:IsLocation(LOCATION_HAND)) and c:IsAbleToGraveAsCost()
return c:IsLevel(8) and c:IsRace(RACE_BEASTWARRIOR) and not c:IsCode(m) and (c:IsFaceup() or c:IsLocation(LOCATION_HAND)) and c:IsAbleToGraveAsCost()
end
function cm.excost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end
......
......@@ -34,7 +34,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e3)
end
function cm.filter(c,e)
return c:IsFaceup() and c:IsCanBeEffectTarget(e)
return c:IsCanBeEffectTarget(e)
end
function cm.fselect(g,tp)
return g:IsExists(Card.IsRace,1,nil,RACE_BEAST) and Duel.GetMZoneCount(tp,g)>0
......
......@@ -370,13 +370,12 @@ function cm.FanippetTrapSPCost(code)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_SOLVING)
e3:SetOperation(cm.Fanippetready)
e3:SetLabelObject(e)
e3:SetLabelObject(c)
Duel.RegisterEffect(e3,tp)
end
end
function cm.Fanippetready(e,tp)
e:GetLabelObject():GetHandler():SetStatus(STATUS_EFFECT_ENABLED,true)
e:GetLabelObject():Reset()
e:GetLabelObject():SetStatus(STATUS_EFFECT_ENABLED,true)
e:Reset()
end
function cm.FanippetTrapSPTarget(code,dt)
......@@ -3087,8 +3086,9 @@ function cm.GCSpiritop(gc)
local et=Effect.CreateEffect(c)
et:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
et:SetRange(LOCATION_SZONE)
et:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
et:SetLabelObject(pc)
et:SetCode(c:GetOriginalCode())
et:SetCode(EVENT_CUSTOM+c:GetOriginalCode())
et:SetCost(cm.GCSpiritcost)
et:SetOperation(cm.GCSpiritac(gc))
et:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
......@@ -3112,7 +3112,7 @@ function cm.GCSpiritop(gc)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
Duel.Readjust()
Duel.RaiseSingleEvent(c,c:GetOriginalCode(),re,r,rp,ep,ev)
Duel.RaiseSingleEvent(c,EVENT_CUSTOM+c:GetOriginalCode(),re,r,rp,ep,ev)
end
end
function cm.GCSpiritreset1(e,tp,eg,ep,ev,re,r,rp)
......@@ -3129,7 +3129,7 @@ function cm.GCSpiritcost(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_REMAIN_FIELD)
e1:SetProperty(EFFECT_FLAG_OATH)
e1:SetProperty(EFFECT_FLAG_OATH+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_CHAIN)
c:RegisterEffect(e1)
end
......@@ -3173,6 +3173,7 @@ function cm.GCSpiritac(gc)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
c:SetStatus(STATUS_EFFECT_ENABLED,true)
e:Reset()
end
end
function cm.GCSpiritregcon1(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -46,12 +46,11 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetOperation(cm.ready)
e1:SetLabelObject(e)
e1:SetLabelObject(c)
Duel.RegisterEffect(e1,tp)
end
function cm.ready(e,tp)
e:GetLabelObject():GetHandler():SetStatus(STATUS_EFFECT_ENABLED,true)
e:GetLabelObject():Reset()
e:GetLabelObject():SetStatus(STATUS_EFFECT_ENABLED,true)
e:Reset()
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -47,12 +47,11 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetOperation(cm.ready)
e1:SetLabelObject(e)
e1:SetLabelObject(c)
Duel.RegisterEffect(e1,tp)
end
function cm.ready(e,tp)
e:GetLabelObject():GetHandler():SetStatus(STATUS_EFFECT_ENABLED,true)
e:GetLabelObject():Reset()
e:GetLabelObject():SetStatus(STATUS_EFFECT_ENABLED,true)
e:Reset()
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -34,12 +34,11 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetOperation(cm.ready)
e1:SetLabelObject(e)
e1:SetLabelObject(c)
Duel.RegisterEffect(e1,tp)
end
function cm.ready(e,tp)
e:GetLabelObject():GetHandler():SetStatus(STATUS_EFFECT_ENABLED,true)
e:GetLabelObject():Reset()
e:GetLabelObject():SetStatus(STATUS_EFFECT_ENABLED,true)
e:Reset()
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -31,12 +31,11 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetOperation(cm.ready)
e1:SetLabelObject(e)
e1:SetLabelObject(c)
Duel.RegisterEffect(e1,tp)
end
function cm.ready(e,tp)
e:GetLabelObject():GetHandler():SetStatus(STATUS_EFFECT_ENABLED,true)
e:GetLabelObject():Reset()
e:GetLabelObject():SetStatus(STATUS_EFFECT_ENABLED,true)
e:Reset()
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -51,12 +51,11 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetOperation(cm.ready)
e1:SetLabelObject(e)
e1:SetLabelObject(c)
Duel.RegisterEffect(e1,tp)
end
function cm.ready(e,tp)
e:GetLabelObject():GetHandler():SetStatus(STATUS_EFFECT_ENABLED,true)
e:GetLabelObject():Reset()
e:GetLabelObject():SetStatus(STATUS_EFFECT_ENABLED,true)
e:Reset()
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -34,12 +34,11 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetOperation(cm.ready)
e1:SetLabelObject(e)
e1:SetLabelObject(c)
Duel.RegisterEffect(e1,tp)
end
function cm.ready(e,tp)
e:GetLabelObject():GetHandler():SetStatus(STATUS_EFFECT_ENABLED,true)
e:GetLabelObject():Reset()
e:GetLabelObject():SetStatus(STATUS_EFFECT_ENABLED,true)
e:Reset()
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -16,8 +16,8 @@ function Suyu_02_x.gi(c,code)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or not c:IsRelateToEffect(e) then return end
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCode(EFFECT_CHANGE_TYPE)
......
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