Commit 3018308e authored by 花桃白音's avatar 花桃白音

fix #116,132,172,187s,211,473,819

parent 6e256e33
No preview for this file type
...@@ -29,7 +29,7 @@ function c11600415.initial_effect(c) ...@@ -29,7 +29,7 @@ function c11600415.initial_effect(c)
--special summon --special summon
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(11600415,3)) e2:SetDescription(aux.Stringid(11600415,3))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_REMOVE+CATEGORY_COUNTER) e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_REMOVE+CATEGORY_COUNTER)
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
......
...@@ -20,7 +20,7 @@ function cm.initial_effect(c) ...@@ -20,7 +20,7 @@ function cm.initial_effect(c)
e2:SetDescription(aux.Stringid(m,1)) e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY) e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1) e2:SetCountLimit(1)
......
...@@ -44,7 +44,7 @@ function s.initial_effect(c) ...@@ -44,7 +44,7 @@ function s.initial_effect(c)
e5:SetDescription(aux.Stringid(id,1)) e5:SetDescription(aux.Stringid(id,1))
e5:SetType(EFFECT_TYPE_FIELD) e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_QP_ACT_IN_NTPHAND) e5:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e5:SetRange(LOCATION_SZONE) e5:SetRange(0xff)
e5:SetCondition(s.con) e5:SetCondition(s.con)
e5:SetTarget(aux.TargetBoolFunction(aux.IsCodeListed,17243025)) e5:SetTarget(aux.TargetBoolFunction(aux.IsCodeListed,17243025))
e5:SetTargetRange(LOCATION_HAND,0) e5:SetTargetRange(LOCATION_HAND,0)
......
...@@ -94,7 +94,7 @@ function cm.sprop(e,tp,eg,ep,ev,re,r,rp,c) ...@@ -94,7 +94,7 @@ function cm.sprop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Release(g,REASON_SPSUMMON) Duel.Release(g,REASON_SPSUMMON)
end end
function cm.cfilter(c) function cm.cfilter(c)
return c:IsType(TYPE_SPELL) return c:IsType(TYPE_SPELL)
end end
function cm.sccon1(e) function cm.sccon1(e)
return e:GetHandler()==Duel.GetFieldCard(e:GetHandlerPlayer(),LOCATION_PZONE,0) and Duel.IsExistingMatchingCard(cm.cfilter,e:GetHandlerPlayer(),LOCATION_GRAVE,0,3,nil) return e:GetHandler()==Duel.GetFieldCard(e:GetHandlerPlayer(),LOCATION_PZONE,0) and Duel.IsExistingMatchingCard(cm.cfilter,e:GetHandlerPlayer(),LOCATION_GRAVE,0,3,nil)
...@@ -106,20 +106,22 @@ function cm.thfilter(c) ...@@ -106,20 +106,22 @@ function cm.thfilter(c)
return c:IsSetCard(0x824) and c:IsAbleToHand() return c:IsSetCard(0x824) and c:IsAbleToHand()
end end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) and Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil) end
local g1=Duel.GetMatchingGroup(cm.cfilter1,tp,LOCATION_HAND+LOCATION_ONFIELD,0,c,tp,Card.IsReleasable) local g1=Duel.GetMatchingGroup(cm.cfilter1,tp,LOCATION_HAND+LOCATION_ONFIELD,0,c,tp,Card.IsReleasable)
end end
function cm.thop(e,tp,eg,ep,ev,re,r,rp) function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetMatchingGroup(cm.cfilter1,tp,LOCATION_HAND+LOCATION_ONFIELD,0,c,tp,Card.IsReleasable) local g1=Duel.GetMatchingGroup(cm.cfilter1,tp,LOCATION_HAND+LOCATION_ONFIELD,0,c,tp,Card.IsReleasable)
local tc2=g1:SelectUnselect(nil,tp,false,true,1,1) local tc2=g1:SelectUnselect(nil,tp,false,true,1,1)
Duel.Release(tc2,REASON_RELEASE) if tc2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD) Duel.Release(tc2,REASON_RELEASE)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
if g:GetCount()>0 then local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
local tc=g:GetFirst() if g:GetCount()>0 then
if tc and tc:IsAbleToHand() then local tc=g:GetFirst()
Duel.SendtoHand(tc,nil,REASON_EFFECT) if tc and tc:IsAbleToHand() then
Duel.ConfirmCards(1-tp,tc) Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end end
end end
end end
...@@ -167,14 +169,16 @@ function cm.pencon2(e,tp,eg,ep,ev,re,r,rp) ...@@ -167,14 +169,16 @@ function cm.pencon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFaceup() return e:GetHandler():IsFaceup()
end end
function cm.pentg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.pentg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil) and (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) end
end end
function cm.penop(e,tp,eg,ep,ev,re,r,rp) function cm.penop(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetMatchingGroup(cm.cfilter1,tp,LOCATION_HAND+LOCATION_ONFIELD,0,c,tp,Card.IsReleasable) local g1=Duel.GetMatchingGroup(cm.cfilter1,tp,LOCATION_HAND+LOCATION_ONFIELD,0,c,tp,Card.IsReleasable)
local tc2=g1:SelectUnselect(nil,tp,false,true,1,1) local tc2=g1:SelectUnselect(nil,tp,false,true,1,1)
Duel.Release(tc2,REASON_RELEASE) if tc2 then
local c=e:GetHandler() Duel.Release(tc2,REASON_RELEASE)
if c:IsRelateToEffect(e) and (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) then local c=e:GetHandler()
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true) if c:IsRelateToEffect(e) and (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) then
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end end
end end
...@@ -26,48 +26,56 @@ function cm.initial_effect(c) ...@@ -26,48 +26,56 @@ function cm.initial_effect(c)
e3:SetCategory(CATEGORY_POSITION) e3:SetCategory(CATEGORY_POSITION)
e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN) e3:SetCode(EVENT_FREE_CHAIN)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET) e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE) e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m+1) e3:SetCountLimit(1,m+1)
e3:SetHintTiming(TIMING_DAMAGE_STEP+TIMING_END_PHASE) e3:SetHintTiming(0,TIMING_END_PHASE)
e3:SetTarget(cm.eqtg2) e3:SetTarget(cm.eqtg2)
e3:SetOperation(cm.eqop2) e3:SetOperation(cm.eqop2)
c:RegisterEffect(e3) c:RegisterEffect(e3)
-- --
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD) e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e4:SetCode(EFFECT_UPDATE_DEFENSE)
e4:SetRange(LOCATION_MZONE) e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(LOCATION_MZONE,0) e4:SetTargetRange(LOCATION_MZONE,0)
e4:SetTarget(cm.indtg) e4:SetCondition(cm.con)
e4:SetValue(1) e4:SetTarget(cm.deftg)
e4:SetValue(cm.defval)
c:RegisterEffect(e4) c:RegisterEffect(e4)
--
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD) e5:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e5:SetRange(LOCATION_MZONE) e5:SetRange(LOCATION_MZONE)
e5:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e5:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e5:SetTargetRange(LOCATION_MZONE,0) e5:SetTargetRange(LOCATION_MZONE,0)
e5:SetTarget(cm.attg) e5:SetCondition(cm.con)
e5:SetTarget(cm.bttg)
e5:SetValue(1)
c:RegisterEffect(e5) c:RegisterEffect(e5)
--
local e6=Effect.CreateEffect(c) local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD) e6:SetType(EFFECT_TYPE_FIELD)
e6:SetCode(EFFECT_IMMUNE_EFFECT) e6:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e6:SetRange(LOCATION_MZONE) e6:SetRange(LOCATION_MZONE)
e6:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e6:SetTargetRange(LOCATION_MZONE,0) e6:SetTargetRange(LOCATION_MZONE,0)
e6:SetTarget(cm.attg) e6:SetCondition(cm.con)
e6:SetValue(cm.efilter) e6:SetTarget(cm.ettg)
e6:SetValue(1)
c:RegisterEffect(e6) c:RegisterEffect(e6)
local e7=Effect.CreateEffect(c) local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_FIELD) e7:SetType(EFFECT_TYPE_FIELD)
e7:SetRange(LOCATION_SZONE) e7:SetCode(EFFECT_IMMUNE_EFFECT)
e7:SetRange(LOCATION_MZONE)
e7:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e7:SetTargetRange(LOCATION_MZONE,0) e7:SetTargetRange(LOCATION_MZONE,0)
e7:SetCode(EFFECT_UPDATE_ATTACK) e7:SetCondition(cm.con)
e7:SetTarget(cm.indtg) e7:SetTarget(cm.etfilter)
e7:SetValue(cm.val) e7:SetValue(cm.efilter)
c:RegisterEffect(e7) c:RegisterEffect(e7)
end end
function cm.filter6(c) function cm.filter6(c)
return c:IsFacedown() return c:IsFacedown()
end end
...@@ -82,23 +90,22 @@ function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -82,23 +90,22 @@ function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD) Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end end
function cm.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) local g=Duel.SelectTarget(tp,nil,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end end
function cm.eqop(e,tp,eg,ep,ev,re,r,rp) function cm.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
local b1=Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_HAND,1,nil) local b1=Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_HAND,1,nil)
local zt=tc:GetControler() local zt=tc:GetControler()
if not tc or not tc:IsRelateToEffect(e) then return end
local op=aux.SelectFromOptions(zt, local op=aux.SelectFromOptions(zt,
{true,aux.Stringid(m,2)}, {true,aux.Stringid(m,2)},
{b1,aux.Stringid(m,3)}) {b1,aux.Stringid(m,3)})
if op==1 then if op==1 then
local zt=tc:GetControler() local zt=tc:GetControler()
if Duel.MoveToField(tc,zt,zt,LOCATION_SZONE,POS_FACEDOWN,true) then if Duel.IsPlayerCanSSet(tc) and Duel.GetLocationCount(zt,LOCATION_SZONE)>0 and Duel.MoveToField(tc,tp,zt,LOCATION_SZONE,POS_FACEDOWN,true) then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCode(EFFECT_CHANGE_TYPE) e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
...@@ -114,6 +121,7 @@ function cm.eqop(e,tp,eg,ep,ev,re,r,rp) ...@@ -114,6 +121,7 @@ function cm.eqop(e,tp,eg,ep,ev,re,r,rp)
e2:SetOperation(cm.operation2) e2:SetOperation(cm.operation2)
e2:SetReset(RESET_EVENT+RESETS_STANDARD) e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2) tc:RegisterEffect(e2)
Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
else else
Duel.SendtoDeck(tc,nil,nil,REASON_EFFECT) Duel.SendtoDeck(tc,nil,nil,REASON_EFFECT)
end end
...@@ -204,28 +212,35 @@ function cm.operation2(e,tp,eg,ep,ev,re,r,rp) ...@@ -204,28 +212,35 @@ function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1) e1:SetValue(1)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
local e2=e1:Clone() local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
tc:RegisterEffect(e2) tc:RegisterEffect(e2)
Duel.BreakEffect() Duel.BreakEffect()
c:CancelToGrave() c:CancelToGrave()
Duel.SendtoHand(c,nil,REASON_EFFECT) Duel.SendtoDeck(c,nil,nil,REASON_EFFECT)
end end
end end
function cm.indtg(e,c)
function cm.con(e)
return e:GetHandler():IsFaceup()
end
function cm.bttg(e,c)
return c:IsFaceup() return c:IsFaceup()
end end
function cm.attg(e,c) function cm.deftg(e,c)
return c:IsFacedown() return c:IsFaceup()
end
function cm.defval(e,c)
return Duel.GetMatchingGroupCount(Card.IsFacedown,c:GetControler(),LOCATION_MZONE,0,nil)*100
end end
function cm.efilter(e,re) function cm.ettg(e,c)
return not re:GetOwner():IsAttribute(ATTRIBUTE_WATER) return c:IsFacedown()
end end
function cm.filter2(c) function cm.etfilter(e,c)
return c:IsFaceup() and c:IsRace(RACE_WARRIOR+RACE_SPELLCASTER) return c:IsFacedown()
end end
function cm.val(e,c) function cm.efilter(e,te)
return Duel.GetMatchingGroupCount(cm.filter2,tp,LOCATION_MZONE,LOCATION_MZONE,nil)*100 return te:GetHandler():GetAttribute()~=ATTRIBUTE_WATER
end end
\ No newline at end of file
...@@ -41,19 +41,79 @@ function cm.initial_effect(c) ...@@ -41,19 +41,79 @@ function cm.initial_effect(c)
e3:SetOperation(cm.repop) e3:SetOperation(cm.repop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function cm.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=c:GetMaterial()
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) and g:IsExists(Card.IsLinkSetCard,2,nil,0x822)
end
function cm.filter3(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.tg3(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.filter3),tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function cm.op3(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.filter3),tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=mg:Select(tp,1,1,nil):GetFirst()
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)
end
function cm.filter4(c)
return c:IsType(TYPE_MONSTER)
end
function cm.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanSummon(tp) and Duel.IsPlayerCanAdditionalSummon(tp) and Duel.IsExistingMatchingCard(cm.filter4,tp,LOCATION_HAND+LOCATION_EXTRA,0,1,nil) end
end
function cm.sumop(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetMatchingGroup(cm.filter4,tp,LOCATION_HAND+LOCATION_EXTRA,0,nil)
local sc=mg:Select(tp,1,1,nil):GetFirst()
Duel.ConfirmCards(1-tp,sc)
local ra=sc:GetRace()
local e0=Effect.CreateEffect(e:GetHandler())
e0:SetDescription(aux.Stringid(m,2))
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
e0:SetTargetRange(LOCATION_HAND+LOCATION_MZONE,0)
e0:SetTarget(aux.TargetBoolFunction(Card.IsRace,ra))
e0:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e0,tp)
end
function cm.repfilter(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsControler(tp) and c:IsReason(REASON_EFFECT+REASON_BATTLE) and not c:IsReason(REASON_REPLACE)
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsReleasable() and not c:IsStatus(STATUS_DESTROY_CONFIRMED)
and eg:IsExists(cm.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96)
end
function cm.repval(e,c)
return cm.repfilter(c,e:GetHandlerPlayer())
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLP(tp)>=Duel.GetLP(1-tp) and Duel.SelectYesNo(tp,aux.Stringid(m,3)) then
Duel.SetLP(tp,math.ceil(Duel.GetLP(tp)/2))
else
local tc=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_MZONE,0,1,1,nil):GetFirst()
Duel.Release(tc,REASON_EFFECT)
end
end
function cm.matfilter(c) function cm.matfilter(c)
return (c:IsType(TYPE_MONSTER) and c:IsType(TYPE_EFFECT)) or (c:IsSetCard(0x822) and (c:IsType(TYPE_SPELL) or c:IsType(TYPE_TRAP))) return (c:IsType(TYPE_EFFECT) and c:IsLocation(LOCATION_MZONE)) or (c:IsSetCard(0x822) and c:IsLocation(LOCATION_SZONE))
end end
function cm.lcheck(g,lc) function cm.lcheck(g,lc)
return g:FilterCount(Card.IsLocation,nil,LOCATION_SZONE)<=1 return g:FilterCount(Card.IsLocation,nil,LOCATION_SZONE)<=1
end end
function cm.LConditionFilter(c,f,lc) function cm.LConditionFilter(c,f,lc)
return (c:IsFaceup() or not c:IsLocation(LOCATION_MZONE)) and (c:IsCanBeLinkMaterial(lc) or c:IsSetCard(0x822) and (c:IsType(TYPE_SPELL) or c:IsType(TYPE_TRAP))) and (not f or f(c)) return (c:IsFaceup() or not c:IsLocation(LOCATION_MZONE)) and (c:IsCanBeLinkMaterial(lc) or c:IsSetCard(0x822)) and (not f or f(c))
end end
function cm.LExtraFilter(c,f,lc,tp) function cm.LExtraFilter(c,f,lc,tp)
if c:IsLocation(LOCATION_MZONE) and not c:IsFaceup() then return false end if c:IsLocation(LOCATION_MZONE) and not c:IsFaceup() then return false end
return c:IsHasEffect(EFFECT_EXTRA_LINK_MATERIAL,tp) and (c:IsCanBeLinkMaterial(lc) or c:IsSetCard(0x822) and (c:IsType(TYPE_SPELL) or c:IsType(TYPE_TRAP))) and (not f or f(c)) return c:IsHasEffect(EFFECT_EXTRA_LINK_MATERIAL,tp) and (c:IsCanBeLinkMaterial(lc) or c:IsSetCard(0x822)) and (not f or f(c))
end end
function cm.GetLinkCount(c) function cm.GetLinkCount(c)
if c:IsType(TYPE_LINK) and c:GetLink()>1 then if c:IsType(TYPE_LINK) and c:GetLink()>1 then
...@@ -62,7 +122,7 @@ function cm.GetLinkCount(c) ...@@ -62,7 +122,7 @@ function cm.GetLinkCount(c)
end end
function cm.GetLinkMaterials(tp,f,lc) function cm.GetLinkMaterials(tp,f,lc)
local mg=Duel.GetMatchingGroup(cm.LConditionFilter,tp,LOCATION_ONFIELD,0,nil,f,lc) local mg=Duel.GetMatchingGroup(cm.LConditionFilter,tp,LOCATION_ONFIELD,0,nil,f,lc)
local mg2=Duel.GetMatchingGroup(cm.LExtraFilter,tp,LOCATION_HAND+LOCATION_SZONE,LOCATION_ONFIELD,nil,f,lc,tp) local mg2=Duel.GetMatchingGroup(cm.LExtraFilter,tp,LOCATION_SZONE,0,nil,f,lc,tp)
if mg2:GetCount()>0 then mg:Merge(mg2) end if mg2:GetCount()>0 then mg:Merge(mg2) end
return mg return mg
end end
...@@ -165,61 +225,4 @@ function cm.LinkOperation(f,minc,maxc,gf) ...@@ -165,61 +225,4 @@ function cm.LinkOperation(f,minc,maxc,gf)
Duel.SendtoGrave(g,REASON_MATERIAL+REASON_LINK) Duel.SendtoGrave(g,REASON_MATERIAL+REASON_LINK)
g:DeleteGroup() g:DeleteGroup()
end end
end
function cm.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=c:GetMaterial()
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) and g:IsExists(Card.IsLinkSetCard,2,nil,0x822)
end
function cm.filter3(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.tg3(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.filter3),tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function cm.op3(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.filter3),tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=mg:Select(tp,1,1,nil):GetFirst()
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)
end
function cm.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanSummon(tp) and Duel.IsPlayerCanAdditionalSummon(tp) end
end
function cm.sumop(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_HAND+LOCATION_EXTRA,0,nil)
local sc=mg:Select(tp,1,1,nil):GetFirst()
Duel.ConfirmCards(1-tp,sc)
local ra=sc:GetRace()
local e0=Effect.CreateEffect(e:GetHandler())
e0:SetDescription(aux.Stringid(m,2))
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
e0:SetTargetRange(LOCATION_HAND+LOCATION_MZONE,0)
e0:SetTarget(aux.TargetBoolFunction(Card.IsRace,ra))
e0:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e0,tp)
end
function cm.repfilter(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsControler(tp) and c:IsReason(REASON_EFFECT+REASON_BATTLE) and not c:IsReason(REASON_REPLACE)
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsReleasable() and not c:IsStatus(STATUS_DESTROY_CONFIRMED)
and eg:IsExists(cm.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96)
end
function cm.repval(e,c)
return cm.repfilter(c,e:GetHandlerPlayer())
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLP(tp)>=Duel.GetLP(1-tp) and Duel.SelectYesNo(tp,aux.Stringid(m,3)) then
Duel.SetLP(tp,math.ceil(Duel.GetLP(tp)/2))
else
local tc=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_MZONE,0,1,1,nil):GetFirst()
Duel.Release(tc,REASON_EFFECT)
end
end end
\ No newline at end of file
...@@ -17,10 +17,9 @@ function cm.initial_effect(c) ...@@ -17,10 +17,9 @@ function cm.initial_effect(c)
e2:SetDescription(aux.Stringid(m,1)) e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON) e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(TIMING_DAMAGE_STEP+TIMING_END_PHASE) e2:SetHintTiming(TIMING_END_PHASE)
e2:SetCountLimit(1,m+1) e2:SetCountLimit(1,m+1)
e2:SetCondition(cm.spcon) e2:SetCondition(cm.spcon)
e2:SetTarget(cm.target2) e2:SetTarget(cm.target2)
...@@ -30,7 +29,7 @@ function cm.initial_effect(c) ...@@ -30,7 +29,7 @@ function cm.initial_effect(c)
e3:SetDescription(aux.Stringid(m,2)) e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(EFFECT_CHANGE_RACE) e3:SetCategory(EFFECT_CHANGE_RACE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE) e3:SetCode(EVENT_TO_GRAVE)
e3:SetRange(LOCATION_GRAVE) e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,m+2) e3:SetCountLimit(1,m+2)
...@@ -59,20 +58,21 @@ function cm.initial_effect(c) ...@@ -59,20 +58,21 @@ function cm.initial_effect(c)
e6:SetTarget(cm.hsptg) e6:SetTarget(cm.hsptg)
e6:SetOperation(cm.hspop) e6:SetOperation(cm.hspop)
c:RegisterEffect(e6) c:RegisterEffect(e6)
end end
function cm.splimit(e,se,sp,st) function cm.splimit(e,se,sp,st)
return not e:GetHandler():IsLocation(LOCATION_EXTRA) or aux.fuslimit(e,se,sp,st) return not e:GetHandler():IsLocation(LOCATION_EXTRA) or aux.fuslimit(e,se,sp,st)
end end
function cm.hspfilter(c,tp,sc) function cm.hspfilter(c,tp)
return c:IsSetCard(0x820) and c:IsType(TYPE_MONSTER) and c:IsControler(tp) and c:IsAbleToDeckAsCost() return c:IsSetCard(0x820) and c:IsType(TYPE_MONSTER) and c:IsControler(tp) and c:IsAbleToDeckAsCost()
end end
function cm.hspcon(e,c) function cm.hspcon(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.IsExistingMatchingCard(cm.hspfilter,tp,LOCATION_REMOVED,0,2,nil) return Duel.IsExistingMatchingCard(cm.hspfilter,tp,LOCATION_REMOVED,0,2,nil,tp)
end end
function cm.hsptg(e,tp,eg,ep,ev,re,r,rp,chk,c) function cm.hsptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetMatchingGroup(cm.hspfilter,tp,LOCATION_REMOVED,0,nil) local g=Duel.GetMatchingGroup(cm.hspfilter,tp,LOCATION_REMOVED,0,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=g:CancelableSelect(tp,2,2,nil) local sg=g:CancelableSelect(tp,2,2,nil)
if sg then if sg then
...@@ -136,7 +136,7 @@ function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -136,7 +136,7 @@ function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
return res return res
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_REMOVED) Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED)
end end
function cm.activate2(e,tp,eg,ep,ev,re,r,rp) function cm.activate2(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp local chkf=tp
...@@ -188,6 +188,7 @@ function cm.filter4(c) ...@@ -188,6 +188,7 @@ function cm.filter4(c)
end end
function cm.sptg3(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.sptg3(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter4,tp,LOCATION_MZONE+LOCATION_GRAVE,LOCATION_MZONE+LOCATION_GRAVE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter4,tp,LOCATION_MZONE+LOCATION_GRAVE,LOCATION_MZONE+LOCATION_GRAVE,1,nil) end
local rc=re:GetHandler()
end end
function cm.spop3(e,tp,eg,ep,ev,re,r,rp) function cm.spop3(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -234,13 +234,14 @@ function c21185825.op4(e,tp,eg,ep,ev,re,r,rp) ...@@ -234,13 +234,14 @@ function c21185825.op4(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_IMMUNE_EFFECT) e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE) e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTargetRange(12,0) e1:SetTargetRange(12,0)
e1:SetLabel(tp) e1:SetLabel(tp)
e1:SetCondition(c21185825.con4_1) e1:SetCondition(c21185825.con4_1)
e1:SetValue(c21185825.val4_1) e1:SetValue(c21185825.val4_1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,21185825,RESET_PHASE+PHASE_END,0,1)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_END) e2:SetCode(EVENT_CHAIN_END)
......
...@@ -13,15 +13,14 @@ function s.spfilter(c,e,tp) ...@@ -13,15 +13,14 @@ function s.spfilter(c,e,tp)
end end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return c:IsAbleToGrave() and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return c:IsAbleToGrave() and Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,c,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,c,1,0,0)
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 s.spop(e,tp,eg,ep,ev,re,r,rp) function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) then if c:IsRelateToEffect(e) and Duel.SendtoGrave(c,REASON_EFFECT)~=0 then
Duel.SendtoGrave(c,REASON_EFFECT)
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,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
......
...@@ -43,7 +43,7 @@ function cm.filter1(c,e,tp) ...@@ -43,7 +43,7 @@ function cm.filter1(c,e,tp)
and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL) and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
end end
function cm.filter2(c,e,tp,mc,rk,rac) function cm.filter2(c,e,tp,mc,rk,rac)
return c:IsRank(rk+1,rk-1) and c:IsRace(rac) and mc:IsCanBeXyzMaterial(c) and c:IsType(TYPE_XYZ) return c:IsRank(rk+1,rk-1) and c:IsRace(rac) and mc:IsCanBeXyzMaterial(c) and c:IsType(TYPE_XYZ) and c:IsAttribute(ATTRIBUTE_DARK)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
...@@ -90,7 +90,6 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -90,7 +90,6 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Overlay(sc,mg) Duel.Overlay(sc,mg)
end end
sc:SetMaterial(Group.FromCards(tc)) sc:SetMaterial(Group.FromCards(tc))
sc:SetMaterial(Group.FromCards(tc))
Duel.Overlay(sc,Group.FromCards(tc)) Duel.Overlay(sc,Group.FromCards(tc))
Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
sc:CompleteProcedure() sc:CompleteProcedure()
......
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