Commit a4f01c28 authored by POLYMER's avatar POLYMER

fix

parent 6e3ccd9d
...@@ -31,6 +31,45 @@ function cm.initial_effect(c) ...@@ -31,6 +31,45 @@ function cm.initial_effect(c)
e3:SetTarget(cm.sptg) e3:SetTarget(cm.sptg)
e3:SetOperation(cm.spop) e3:SetOperation(cm.spop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetCode(EFFECT_UPDATE_LEVEL)
e4:SetRange(LOCATION_MZONE)
e4:SetValue(cm.val)
c:RegisterEffect(e4)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetCondition(cm.checkcon)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function cm.checkfilter(c)
return aux.IsCodeListed(c,40020183) and c:IsType(TYPE_MONSTER) and not c:IsOriginalCodeRule(40020150)
end
function cm.checkcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.checkfilter,1,nil)
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(cm.checkfilter,nil)
local tc=g:GetFirst()
while tc do
Duel.RegisterFlagEffect(tc:GetControler(),m,0,0,0)
tc=g:GetNext()
end
end
function cm.val(e,c)
local tp=c:GetControler()
local ct=Duel.GetFlagEffect(tp,m)
if ct>4 then
ct=4
end
return ct
end end
function cm.thfilter(c) function cm.thfilter(c)
return aux.IsCodeListed(c,40020183) and c:IsType(TYPE_MONSTER) and not c:IsCode(m) and c:IsAbleToHand() return aux.IsCodeListed(c,40020183) and c:IsType(TYPE_MONSTER) and not c:IsCode(m) and c:IsAbleToHand()
...@@ -57,7 +96,8 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -57,7 +96,8 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp) function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_COST) and re:IsActivated() and re:IsActiveType(TYPE_MONSTER) and not e:GetHandler():IsPublic() return e:GetHandler():IsReason(REASON_EFFECT) and re:IsActiveType(TYPE_MONSTER) and not e:GetHandler():IsPublic() and e:GetHandler():IsPreviousPosition(POS_FACEUP)
and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
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)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -59,16 +59,15 @@ function cm.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -59,16 +59,15 @@ function cm.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp) function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then if tc:IsFaceup() and tc:IsRelateToEffect(e) and c:IsRelateToEffect(e) and c:IsLocation(LOCATION_HAND) then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1400) e1:SetValue(1400)
e1: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)
end
if c:IsRelateToEffect(e) and c:IsLocation(LOCATION_HAND) then
Duel.BreakEffect() Duel.BreakEffect()
local op=0 local op=0
if (ft>0 or c:GetSequence()<5) and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_MZONE,0,1,nil,e,tp,c) then if (ft>0 or c:GetSequence()<5) and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_MZONE,0,1,nil,e,tp,c) then
...@@ -86,7 +85,7 @@ function cm.thcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -86,7 +85,7 @@ function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return (c==Duel.GetAttacker() or c==Duel.GetAttackTarget()) return (c==Duel.GetAttacker() or c==Duel.GetAttackTarget())
end end
function cm.thfilter(c) function cm.thfilter1(c)
return aux.IsCodeListed(c,40020183) and c:IsType(TYPE_SPELL+TYPE_TRAP) and not c:IsCode(m) and c:IsAbleToHand() return aux.IsCodeListed(c,40020183) and c:IsType(TYPE_SPELL+TYPE_TRAP) and not c:IsCode(m) 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)
...@@ -98,9 +97,9 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -98,9 +97,9 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetDecktopGroup(tp,5) local g=Duel.GetDecktopGroup(tp,5)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.DisableShuffleCheck() Duel.DisableShuffleCheck()
if g:IsExists(cm.thfilter,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,4)) then if g:IsExists(cm.thfilter1,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,4)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:FilterSelect(tp,cm.thfilter,1,1,nil) local sg=g:FilterSelect(tp,cm.thfilter1,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT) Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg) Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
......
...@@ -65,17 +65,16 @@ function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -65,17 +65,16 @@ function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function cm.desop(e,tp,eg,ep,ev,re,r,rp) function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g=Duel.GetMatchingGroup(cm.desfilter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.desfilter,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
local tg=g:GetMinGroup(Card.GetAttack) local tg=g:GetMinGroup(Card.GetAttack)
if tg:GetCount()>1 then if tg:GetCount()>1 and c:IsRelateToEffect(e) and c:IsLocation(LOCATION_HAND) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=tg:Select(tp,1,1,nil) local sg=tg:Select(tp,1,1,nil)
Duel.HintSelection(sg) Duel.HintSelection(sg)
Duel.Destroy(sg,REASON_EFFECT) Duel.Destroy(sg,REASON_EFFECT)
else Duel.Destroy(tg,REASON_EFFECT) end else Duel.Destroy(tg,REASON_EFFECT) end
end
if c:IsRelateToEffect(e) and c:IsLocation(LOCATION_HAND) then
Duel.BreakEffect() Duel.BreakEffect()
local op=0 local op=0
if (ft>0 or c:GetSequence()<5) and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_MZONE,0,1,nil,e,tp,c) then if (ft>0 or c:GetSequence()<5) and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_MZONE,0,1,nil,e,tp,c) then
......
...@@ -69,6 +69,7 @@ end ...@@ -69,6 +69,7 @@ end
function cm.desop(e,tp,eg,ep,ev,re,r,rp) function cm.desop(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 ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)>0 and c:IsRelateToEffect(e) and c:IsLocation(LOCATION_HAND) then if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)>0 and c:IsRelateToEffect(e) and c:IsLocation(LOCATION_HAND) then
Duel.BreakEffect() Duel.BreakEffect()
......
--假面骑士 空我/升华天马 --假面骑士 空我/升华天马
local m=40020160 local s,id,o=GetID()
local cm=_G["c"..m] function s.initial_effect(c)
function cm.initial_effect(c)
aux.AddCodeList(c,40020183) aux.AddCodeList(c,40020183)
--change name --change name
aux.EnableChangeCode(c,40020183,LOCATION_MZONE) aux.EnableChangeCode(c,40020183,LOCATION_MZONE)
--destroy --destroy
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0)) e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND) e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m) e1:SetCountLimit(1,id)
e1:SetCost(cm.descost) e1:SetCost(s.descost)
e1:SetTarget(cm.destg) e1:SetTarget(s.destg)
e1:SetOperation(cm.desop) e1:SetOperation(s.desop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=e1:Clone() local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING) e2:SetCode(EVENT_CHAINING)
e2:SetCondition(cm.descon) e2:SetCondition(s.descon)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--negate spell --negate spell
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(m,3)) e5:SetDescription(aux.Stringid(id,3))
e5:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY) e5:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e5:SetType(EFFECT_TYPE_QUICK_O) e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_CHAINING) e5:SetCode(EVENT_CHAINING)
e5:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e5:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e5:SetRange(LOCATION_MZONE) e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1,m+1) e5:SetCountLimit(1)
e5:SetCondition(cm.negcon) e5:SetCondition(s.negcon)
e5:SetTarget(cm.negtg) e5:SetTarget(s.negtg)
e5:SetOperation(cm.negop) e5:SetOperation(s.negop)
c:RegisterEffect(e5) c:RegisterEffect(e5)
if not cm.global_check then if not s.global_check then
cm.global_check=true s.global_check=true
local ge1=Effect.CreateEffect(c) local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS) ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetOperation(cm.checkop) ge1:SetOperation(s.checkop)
Duel.RegisterEffect(ge1,0) Duel.RegisterEffect(ge1,0)
end end
end end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp) function s.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst() local tc=eg:GetFirst()
while tc do while tc do
if tc:GetReasonEffect() and tc:GetReasonEffect():IsHasType(EFFECT_TYPE_ACTIONS) and aux.IsCodeListed(tc:GetReasonEffect():GetHandler(),40020183) then if tc:GetReasonEffect() and tc:GetReasonEffect():IsHasType(EFFECT_TYPE_ACTIONS) and aux.IsCodeListed(tc:GetReasonEffect():GetHandler(),40020183) then
tc:RegisterFlagEffect(40020183,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,4)) tc:RegisterFlagEffect(40020183,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,4))
end end
tc=eg:GetNext() tc=eg:GetNext()
end end
end end
function cm.fselect(g,tp,sc) function s.fselect(g,tp,sc)
local atk=0 local atk=0
local matk=0 local matk=0
local tc=g:GetFirst() local tc=g:GetFirst()
...@@ -66,24 +65,24 @@ function cm.fselect(g,tp,sc) ...@@ -66,24 +65,24 @@ function cm.fselect(g,tp,sc)
end end
return matk>=2600 return matk>=2600
end end
function cm.costfilter(c,tp) function s.costfilter(c,tp)
return aux.IsCodeListed(c,40020183) and c:IsAbleToRemoveAsCost() return aux.IsCodeListed(c,40020183) and c:IsAbleToRemoveAsCost()
end end
function cm.descost(e,tp,eg,ep,ev,re,r,rp,chk) function s.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,e:GetHandler(),tp) end if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,e:GetHandler(),tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,e:GetHandler(),tp) local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,e:GetHandler(),tp)
Duel.Remove(g,POS_FACEUP,REASON_COST) Duel.Remove(g,POS_FACEUP,REASON_COST)
end end
function cm.desfilter(c) function s.desfilter(c)
return c:IsType(TYPE_MONSTER) and not c:IsAttack(0) and c:IsFaceup() return c:IsType(TYPE_MONSTER) and not c:IsAttack(0) and c:IsFaceup()
end end
function cm.thfilter(c,e,tp,ec) function s.thfilter(c,e,tp,ec,ft)
return c:IsCode(40020183) and c:IsLevelAbove(5) and c:IsAbleToHand() and ec:IsCanBeSpecialSummoned(e,0,tp,false,false) return (ft>0 or c:GetSequence()<5) and c:IsCode(40020183) and c:IsLevelAbove(5) and c:IsAbleToHand() and ec:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and cm.desfilter(chkc) end if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and s.desfilter(chkc) end
local mg=Duel.GetMatchingGroup(cm.desfilter,tp,0,LOCATION_MZONE,nil) local mg=Duel.GetMatchingGroup(s.desfilter,tp,0,LOCATION_MZONE,nil)
if chk==0 then if chk==0 then
local mgck=0 local mgck=0
local tc=mg:GetFirst() local tc=mg:GetFirst()
...@@ -98,11 +97,11 @@ function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -98,11 +97,11 @@ function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
return mgck==1 end return mgck==1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=mg:SelectSubGroup(tp,cm.fselect,false,1,99,tp,c) local g=mg:SelectSubGroup(tp,s.fselect,false,1,99,tp,c)
Duel.SetTargetCard(g) Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end end
function cm.desop(e,tp,eg,ep,ev,re,r,rp) function s.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
...@@ -110,33 +109,33 @@ function cm.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -110,33 +109,33 @@ function cm.desop(e,tp,eg,ep,ev,re,r,rp)
if tg:GetCount()>0 and Duel.Destroy(tg,REASON_EFFECT)~=0 and c:IsRelateToEffect(e) and c:IsLocation(LOCATION_HAND) then if tg:GetCount()>0 and Duel.Destroy(tg,REASON_EFFECT)~=0 and c:IsRelateToEffect(e) and c:IsLocation(LOCATION_HAND) then
Duel.BreakEffect() Duel.BreakEffect()
local op=0 local op=0
if (ft>0 or c:GetSequence()<5) and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_MZONE,0,1,nil,e,tp,c) then if Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_MZONE,0,1,nil,e,tp,c,ft) then
op=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2)) op=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2))
end end
if op==0 then Duel.SendtoGrave(c,REASON_DISCARD) end if op==0 then Duel.SendtoGrave(c,REASON_DISCARD) end
if op==1 then if op==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local thc=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_MZONE,0,1,1,e:GetHandler(),e,tp,c):GetFirst() local thc=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_MZONE,0,1,1,e:GetHandler(),e,tp,c):GetFirst()
if thc and Duel.SendtoHand(thc,nil,REASON_EFFECT)~=0 then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end if thc and Duel.SendtoHand(thc,nil,REASON_EFFECT)~=0 then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end
end end
end end
end end
function cm.descon(e,tp,eg,ep,ev,re,r,rp) function s.descon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and ep~=tp return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and ep~=tp
end end
function cm.negcon(e,tp,eg,ep,ev,re,r,rp) function s.negcon(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) or e:GetHandler():GetFlagEffect(40020183)==0 then return false end if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) or e:GetHandler():GetFlagEffect(40020183)==0 then return false end
return ep~=tp and re:IsActiveType(TYPE_SPELL) and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev) return ep~=tp and re:IsActiveType(TYPE_SPELL) and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
end end
function cm.negtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end end
end end
function cm.negop(e,tp,eg,ep,ev,re,r,rp) function s.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT) Duel.Destroy(eg,REASON_EFFECT)
end end
......
...@@ -77,6 +77,7 @@ function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -77,6 +77,7 @@ function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function cm.desop(e,tp,eg,ep,ev,re,r,rp) function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if Duel.Draw(p,d,REASON_EFFECT)~=0 and c:IsRelateToEffect(e) and c:IsLocation(LOCATION_HAND) then if Duel.Draw(p,d,REASON_EFFECT)~=0 and c:IsRelateToEffect(e) and c:IsLocation(LOCATION_HAND) then
Duel.BreakEffect() Duel.BreakEffect()
......
...@@ -104,6 +104,7 @@ function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -104,6 +104,7 @@ function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function cm.desop(e,tp,eg,ep,ev,re,r,rp) function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
...@@ -137,6 +138,7 @@ function cm.descon(e,tp,eg,ep,ev,re,r,rp) ...@@ -137,6 +138,7 @@ function cm.descon(e,tp,eg,ep,ev,re,r,rp)
end end
function cm.negcon(e,tp,eg,ep,ev,re,r,rp) function cm.negcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) or e:GetHandler():GetFlagEffect(40020183)==0 then return false end if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) or e:GetHandler():GetFlagEffect(40020183)==0 then return false end
return Duel.IsChainNegatable(ev) and not c:IsStatus(STATUS_BATTLE_DESTROYED) return Duel.IsChainNegatable(ev) and not c:IsStatus(STATUS_BATTLE_DESTROYED)
and re:GetHandler()~=c and re:IsActiveType(TYPE_MONSTER) and re:GetHandler()~=c and re:IsActiveType(TYPE_MONSTER)
......
...@@ -66,6 +66,7 @@ function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -66,6 +66,7 @@ function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function cm.desop(e,tp,eg,ep,ev,re,r,rp) function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g=Duel.GetMatchingGroup(cm.desfilter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(cm.desfilter,tp,0,LOCATION_MZONE,nil)
if Duel.Destroy(g,REASON_EFFECT)~=0 and c:IsRelateToEffect(e) and c:IsLocation(LOCATION_HAND) then if Duel.Destroy(g,REASON_EFFECT)~=0 and c:IsRelateToEffect(e) and c:IsLocation(LOCATION_HAND) then
Duel.BreakEffect() Duel.BreakEffect()
...@@ -88,14 +89,14 @@ function cm.thcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -88,14 +89,14 @@ function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return (c==Duel.GetAttacker() or c==Duel.GetAttackTarget()) return (c==Duel.GetAttacker() or c==Duel.GetAttackTarget())
end end
function cm.thfilter(c) function cm.thfilter1(c)
return c:IsFaceupEx() and aux.IsCodeListed(c,40020183) and c:IsAbleToHand() and not c:IsCode(m) return c:IsFaceupEx() and aux.IsCodeListed(c,40020183) and c:IsAbleToHand() and not c:IsCode(m)
end end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsControler(tp) and cm.thfilter(chkc) end if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsControler(tp) and cm.thfilter1(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.thfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end if chk==0 then return Duel.IsExistingTarget(cm.thfilter1,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,cm.thfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil) local g=Duel.SelectTarget(tp,cm.thfilter1,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end end
function cm.thop(e,tp,eg,ep,ev,re,r,rp) function cm.thop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -80,6 +80,7 @@ function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -80,6 +80,7 @@ function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function cm.disop(e,tp,eg,ep,ev,re,r,rp) function cm.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.NegateSummon(eg) Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT) Duel.Destroy(eg,REASON_EFFECT)
if c:IsRelateToEffect(e) and c:IsLocation(LOCATION_HAND) then if c:IsRelateToEffect(e) and c:IsLocation(LOCATION_HAND) then
...@@ -111,7 +112,7 @@ function cm.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -111,7 +112,7 @@ function cm.desop(e,tp,eg,ep,ev,re,r,rp)
if #g>0 then if #g>0 then
Duel.HintSelection(g) Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT) Duel.Destroy(g,REASON_EFFECT)
if e:GetHandler():GetFlagEffect(40020183)==0 then if e:GetHandler():GetFlagEffect(40020183)>0 then
Duel.BreakEffect() Duel.BreakEffect()
Duel.SetLP(1-tp,math.ceil(Duel.GetLP(1-tp)/2)) Duel.SetLP(1-tp,math.ceil(Duel.GetLP(1-tp)/2))
end end
......
...@@ -140,8 +140,8 @@ function s.geop(e,tp,eg,ep,ev,re,r,rp) ...@@ -140,8 +140,8 @@ function s.geop(e,tp,eg,ep,ev,re,r,rp)
s[0]=Duel.CreateToken(0,id) s[0]=Duel.CreateToken(0,id)
s[1]=Duel.CreateToken(1,id) s[1]=Duel.CreateToken(1,id)
if KOISHI_CHECK then if KOISHI_CHECK then
s[0]:SetCardData(CARDDATA_TYPE,TYPE_QUICKPLAY+TYPE_SPELL) s[0]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
s[1]:SetCardData(CARDDATA_TYPE,TYPE_QUICKPLAY+TYPE_SPELL) s[1]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
end end
e:Reset() e:Reset()
end end
...@@ -222,7 +222,7 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -222,7 +222,7 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.GetTurnPlayer()==tp then if Duel.GetTurnPlayer()==tp then
if chk==0 then return if chk==0 then return
--Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil) and --Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil) and
Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,tp) end
e:SetCategory(CATEGORY_SEARCH+CATEGORY_TOGRAVE) e:SetCategory(CATEGORY_SEARCH+CATEGORY_TOGRAVE)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
......
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