Commit f9163ff1 authored by Nemo Ma's avatar Nemo Ma

fix

parent ca73e7f5
...@@ -51,9 +51,9 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -51,9 +51,9 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local phase=Duel.GetCurrentPhase() local phase=Duel.GetCurrentPhase()
local c=e:GetHandler() local c=e:GetHandler()
if (phase==PHASE_DAMAGE and not Duel.IsDamageCalculated()) or phase==PHASE_DAMAGE_CAL or c:IsStatus(STATUS_BATTLE_DESTROYED) then return end if (phase==PHASE_DAMAGE and not Duel.IsDamageCalculated()) or phase==PHASE_DAMAGE_CAL or c:IsStatus(STATUS_BATTLE_DESTROYED) then return end
if not c:GetEquipGroup():IsExists(cm.eqfilter,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>3 and Duel.GetMatchingGroupCount(Card.IsFacedown,tp,0,LOCATION_DECK,nil)>0 then if not c:GetEquipGroup():IsExists(cm.eqfilter,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.GetMatchingGroupCount(Card.IsFacedown,tp,LOCATION_DECK,0,nil)>0 then
Duel.Hint(HINT_CARD,0,m) Duel.Hint(HINT_CARD,0,m)
local tc=Duel.GetMatchingGroup(Card.IsFacedown,tp,0,LOCATION_DECK,nil):GetMaxGroup(Card.GetSequence):GetFirst() local tc=Duel.GetMatchingGroup(Card.IsFacedown,tp,LOCATION_DECK,0,nil):GetMaxGroup(Card.GetSequence):GetFirst()
Duel.DisableShuffleCheck() Duel.DisableShuffleCheck()
if cm.equipfd(c,tp,tc) then Duel.Readjust() end if cm.equipfd(c,tp,tc) then Duel.Readjust() end
end end
......
...@@ -50,9 +50,9 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -50,9 +50,9 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local phase=Duel.GetCurrentPhase() local phase=Duel.GetCurrentPhase()
local c=e:GetHandler() local c=e:GetHandler()
if (phase==PHASE_DAMAGE and not Duel.IsDamageCalculated()) or phase==PHASE_DAMAGE_CAL or c:IsStatus(STATUS_BATTLE_DESTROYED) then return end if (phase==PHASE_DAMAGE and not Duel.IsDamageCalculated()) or phase==PHASE_DAMAGE_CAL or c:IsStatus(STATUS_BATTLE_DESTROYED) then return end
if not c:GetEquipGroup():IsExists(cm.eqfilter,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>3 and Duel.GetMatchingGroupCount(Card.IsFacedown,tp,0,LOCATION_DECK,nil)>0 then if not c:GetEquipGroup():IsExists(cm.eqfilter,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.GetMatchingGroupCount(Card.IsFacedown,tp,LOCATION_DECK,0,nil)>0 then
Duel.Hint(HINT_CARD,0,m) Duel.Hint(HINT_CARD,0,m)
local tc=Duel.GetMatchingGroup(Card.IsFacedown,tp,0,LOCATION_DECK,nil):GetMaxGroup(Card.GetSequence):GetFirst() local tc=Duel.GetMatchingGroup(Card.IsFacedown,tp,LOCATION_DECK,0,nil):GetMaxGroup(Card.GetSequence):GetFirst()
Duel.DisableShuffleCheck() Duel.DisableShuffleCheck()
if cm.equipfd(c,tp,tc) then Duel.Readjust() end if cm.equipfd(c,tp,tc) then Duel.Readjust() end
end end
......
...@@ -51,9 +51,9 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -51,9 +51,9 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local phase=Duel.GetCurrentPhase() local phase=Duel.GetCurrentPhase()
local c=e:GetHandler() local c=e:GetHandler()
if (phase==PHASE_DAMAGE and not Duel.IsDamageCalculated()) or phase==PHASE_DAMAGE_CAL or c:IsStatus(STATUS_BATTLE_DESTROYED) then return end if (phase==PHASE_DAMAGE and not Duel.IsDamageCalculated()) or phase==PHASE_DAMAGE_CAL or c:IsStatus(STATUS_BATTLE_DESTROYED) then return end
if not c:GetEquipGroup():IsExists(cm.eqfilter,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>3 and Duel.GetMatchingGroupCount(Card.IsFacedown,tp,0,LOCATION_DECK,nil)>0 then if not c:GetEquipGroup():IsExists(cm.eqfilter,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.GetMatchingGroupCount(Card.IsFacedown,tp,LOCATION_DECK,0,nil)>0 then
Duel.Hint(HINT_CARD,0,m) Duel.Hint(HINT_CARD,0,m)
local tc=Duel.GetMatchingGroup(Card.IsFacedown,tp,0,LOCATION_DECK,nil):GetMaxGroup(Card.GetSequence):GetFirst() local tc=Duel.GetMatchingGroup(Card.IsFacedown,tp,LOCATION_DECK,0,nil):GetMaxGroup(Card.GetSequence):GetFirst()
Duel.DisableShuffleCheck() Duel.DisableShuffleCheck()
if cm.equipfd(c,tp,tc) then Duel.Readjust() end if cm.equipfd(c,tp,tc) then Duel.Readjust() end
end end
......
...@@ -48,9 +48,9 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -48,9 +48,9 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local phase=Duel.GetCurrentPhase() local phase=Duel.GetCurrentPhase()
local c=e:GetHandler() local c=e:GetHandler()
if (phase==PHASE_DAMAGE and not Duel.IsDamageCalculated()) or phase==PHASE_DAMAGE_CAL or c:IsStatus(STATUS_BATTLE_DESTROYED) then return end if (phase==PHASE_DAMAGE and not Duel.IsDamageCalculated()) or phase==PHASE_DAMAGE_CAL or c:IsStatus(STATUS_BATTLE_DESTROYED) then return end
if not c:GetEquipGroup():IsExists(cm.eqfilter,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>3 and Duel.GetMatchingGroupCount(Card.IsFacedown,tp,0,LOCATION_DECK,nil)>0 then if not c:GetEquipGroup():IsExists(cm.eqfilter,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.GetMatchingGroupCount(Card.IsFacedown,tp,LOCATION_DECK,0,nil)>0 then
Duel.Hint(HINT_CARD,0,m) Duel.Hint(HINT_CARD,0,m)
local tc=Duel.GetMatchingGroup(Card.IsFacedown,tp,0,LOCATION_DECK,nil):GetMaxGroup(Card.GetSequence):GetFirst() local tc=Duel.GetMatchingGroup(Card.IsFacedown,tp,LOCATION_DECK,0,nil):GetMaxGroup(Card.GetSequence):GetFirst()
Duel.DisableShuffleCheck() Duel.DisableShuffleCheck()
if cm.equipfd(c,tp,tc) then Duel.Readjust() end if cm.equipfd(c,tp,tc) then Duel.Readjust() end
end end
......
...@@ -51,9 +51,9 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -51,9 +51,9 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local phase=Duel.GetCurrentPhase() local phase=Duel.GetCurrentPhase()
local c=e:GetHandler() local c=e:GetHandler()
if (phase==PHASE_DAMAGE and not Duel.IsDamageCalculated()) or phase==PHASE_DAMAGE_CAL or c:IsStatus(STATUS_BATTLE_DESTROYED) then return end if (phase==PHASE_DAMAGE and not Duel.IsDamageCalculated()) or phase==PHASE_DAMAGE_CAL or c:IsStatus(STATUS_BATTLE_DESTROYED) then return end
if not c:GetEquipGroup():IsExists(cm.eqfilter,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>3 and Duel.GetMatchingGroupCount(Card.IsFacedown,tp,0,LOCATION_DECK,nil)>0 then if not c:GetEquipGroup():IsExists(cm.eqfilter,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.GetMatchingGroupCount(Card.IsFacedown,tp,LOCATION_DECK,0,nil)>0 then
Duel.Hint(HINT_CARD,0,m) Duel.Hint(HINT_CARD,0,m)
local tc=Duel.GetMatchingGroup(Card.IsFacedown,tp,0,LOCATION_DECK,nil):GetMaxGroup(Card.GetSequence):GetFirst() local tc=Duel.GetMatchingGroup(Card.IsFacedown,tp,LOCATION_DECK,0,nil):GetMaxGroup(Card.GetSequence):GetFirst()
Duel.DisableShuffleCheck() Duel.DisableShuffleCheck()
if cm.equipfd(c,tp,tc) then Duel.Readjust() end if cm.equipfd(c,tp,tc) then Duel.Readjust() end
end end
......
...@@ -152,9 +152,9 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -152,9 +152,9 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local phase=Duel.GetCurrentPhase() local phase=Duel.GetCurrentPhase()
local c=e:GetHandler() local c=e:GetHandler()
if (phase==PHASE_DAMAGE and not Duel.IsDamageCalculated()) or phase==PHASE_DAMAGE_CAL or c:IsStatus(STATUS_BATTLE_DESTROYED) then return end if (phase==PHASE_DAMAGE and not Duel.IsDamageCalculated()) or phase==PHASE_DAMAGE_CAL or c:IsStatus(STATUS_BATTLE_DESTROYED) then return end
if not c:GetEquipGroup():IsExists(cm.eqfilter,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>3 and Duel.GetMatchingGroupCount(Card.IsFacedown,tp,0,LOCATION_DECK,nil)>0 then if not c:GetEquipGroup():IsExists(cm.eqfilter,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.GetMatchingGroupCount(Card.IsFacedown,tp,LOCATION_DECK,0,nil)>0 then
Duel.Hint(HINT_CARD,0,m) Duel.Hint(HINT_CARD,0,m)
local tc=Duel.GetMatchingGroup(Card.IsFacedown,tp,0,LOCATION_DECK,nil):GetMaxGroup(Card.GetSequence):GetFirst() local tc=Duel.GetMatchingGroup(Card.IsFacedown,tp,LOCATION_DECK,0,nil):GetMaxGroup(Card.GetSequence):GetFirst()
Duel.DisableShuffleCheck() Duel.DisableShuffleCheck()
if cm.equipfd(c,tp,tc) then Duel.Readjust() end if cm.equipfd(c,tp,tc) then Duel.Readjust() end
end end
......
...@@ -153,9 +153,9 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -153,9 +153,9 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local phase=Duel.GetCurrentPhase() local phase=Duel.GetCurrentPhase()
local c=e:GetHandler() local c=e:GetHandler()
if (phase==PHASE_DAMAGE and not Duel.IsDamageCalculated()) or phase==PHASE_DAMAGE_CAL or c:IsStatus(STATUS_BATTLE_DESTROYED) then return end if (phase==PHASE_DAMAGE and not Duel.IsDamageCalculated()) or phase==PHASE_DAMAGE_CAL or c:IsStatus(STATUS_BATTLE_DESTROYED) then return end
if not c:GetEquipGroup():IsExists(cm.eqfilter,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>3 and Duel.GetMatchingGroupCount(Card.IsFacedown,tp,0,LOCATION_DECK,nil)>0 then if not c:GetEquipGroup():IsExists(cm.eqfilter,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.GetMatchingGroupCount(Card.IsFacedown,tp,LOCATION_DECK,0,nil)>0 then
Duel.Hint(HINT_CARD,0,m) Duel.Hint(HINT_CARD,0,m)
local tc=Duel.GetMatchingGroup(Card.IsFacedown,tp,0,LOCATION_DECK,nil):GetMaxGroup(Card.GetSequence):GetFirst() local tc=Duel.GetMatchingGroup(Card.IsFacedown,tp,LOCATION_DECK,0,nil):GetMaxGroup(Card.GetSequence):GetFirst()
Duel.DisableShuffleCheck() Duel.DisableShuffleCheck()
if cm.equipfd(c,tp,tc) then Duel.Readjust() end if cm.equipfd(c,tp,tc) then Duel.Readjust() end
end end
......
...@@ -152,9 +152,9 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -152,9 +152,9 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local phase=Duel.GetCurrentPhase() local phase=Duel.GetCurrentPhase()
local c=e:GetHandler() local c=e:GetHandler()
if (phase==PHASE_DAMAGE and not Duel.IsDamageCalculated()) or phase==PHASE_DAMAGE_CAL or c:IsStatus(STATUS_BATTLE_DESTROYED) then return end if (phase==PHASE_DAMAGE and not Duel.IsDamageCalculated()) or phase==PHASE_DAMAGE_CAL or c:IsStatus(STATUS_BATTLE_DESTROYED) then return end
if not c:GetEquipGroup():IsExists(cm.eqfilter,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>3 and Duel.GetMatchingGroupCount(Card.IsFacedown,tp,0,LOCATION_DECK,nil)>0 then if not c:GetEquipGroup():IsExists(cm.eqfilter,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.GetMatchingGroupCount(Card.IsFacedown,tp,LOCATION_DECK,0,nil)>0 then
Duel.Hint(HINT_CARD,0,m) Duel.Hint(HINT_CARD,0,m)
local tc=Duel.GetMatchingGroup(Card.IsFacedown,tp,0,LOCATION_DECK,nil):GetMaxGroup(Card.GetSequence):GetFirst() local tc=Duel.GetMatchingGroup(Card.IsFacedown,tp,LOCATION_DECK,0,nil):GetMaxGroup(Card.GetSequence):GetFirst()
Duel.DisableShuffleCheck() Duel.DisableShuffleCheck()
if cm.equipfd(c,tp,tc) then Duel.Readjust() end if cm.equipfd(c,tp,tc) then Duel.Readjust() end
end end
......
...@@ -14,7 +14,7 @@ function cm.initial_effect(c) ...@@ -14,7 +14,7 @@ function cm.initial_effect(c)
e2:SetCategory(CATEGORY_DRAW+CATEGORY_EQUIP) e2:SetCategory(CATEGORY_DRAW+CATEGORY_EQUIP)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_FZONE) e2:SetRange(LOCATION_FZONE)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_CHAINING) e2:SetCode(EVENT_CHAINING)
e2:SetCondition(cm.eqcon) e2:SetCondition(cm.eqcon)
e2:SetTarget(cm.eqtg) e2:SetTarget(cm.eqtg)
...@@ -45,7 +45,6 @@ function cm.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -45,7 +45,6 @@ function cm.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end if chkc then return false end
if chk==0 then return tc and Duel.IsPlayerCanDraw(tp,1) and tc:IsLocation(LOCATION_MZONE) and tc:IsFaceup() and tc:IsCanBeEffectTarget(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end if chk==0 then return tc and Duel.IsPlayerCanDraw(tp,1) and tc:IsLocation(LOCATION_MZONE) and tc:IsFaceup() and tc:IsCanBeEffectTarget(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
Duel.SetTargetCard(tc) Duel.SetTargetCard(tc)
Duel.HintSelection(Group.FromCards(tc))
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_HAND)
end end
...@@ -57,7 +56,7 @@ function cm.eqop(e,tp,eg,ep,ev,re,r,rp) ...@@ -57,7 +56,7 @@ function cm.eqop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if Duel.Draw(tp,1,REASON_EFFECT)>0 and tc:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then if Duel.Draw(tp,1,REASON_EFFECT)>0 and tc:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local ec=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_HAND,0,1,1,nil):GetFirst() local ec=Duel.SelectMatchingCard(tp,cm.notpublic,tp,LOCATION_HAND,0,1,1,nil):GetFirst()
if ec and Duel.Equip(tp,ec,tc,false) then if ec and Duel.Equip(tp,ec,tc,false) then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
...@@ -69,6 +68,9 @@ function cm.eqop(e,tp,eg,ep,ev,re,r,rp) ...@@ -69,6 +68,9 @@ function cm.eqop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
function cm.notpublic(c)
return not c:IsPublic()
end
function cm.acfilter(c,tp) function cm.acfilter(c,tp)
return c:IsPreviousControler(tp) and c:GetEquipTarget() return c:IsPreviousControler(tp) and c:GetEquipTarget()
end end
......
...@@ -72,9 +72,9 @@ end ...@@ -72,9 +72,9 @@ end
function cm.imval(e,te) function cm.imval(e,te)
if te:GetHandlerPlayer()==e:GetHandlerPlayer() then return false end if te:GetHandlerPlayer()==e:GetHandlerPlayer() then return false end
if not te:IsActivated() then return true end if not te:IsActivated() then return true end
local lab=e:GetHandler():GetFlagEffectLabel(m)
local ev=Duel.GetChainInfo(0,CHAININFO_CHAIN_COUNT) local ev=Duel.GetChainInfo(0,CHAININFO_CHAIN_COUNT)
local re=Duel.GetChainInfo(ev+1,CHAININFO_TRIGGERING_EFFECT) return ev and ev>0 and not (lab and lab==ev+1)
return not (re and re:GetHandler() and e:GetHandler()==re:GetHandler())
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():IsSummonType(SUMMON_TYPE_FUSION) return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
...@@ -91,7 +91,8 @@ function cm.spfilter2(c,e,tp,mc,tc) ...@@ -91,7 +91,8 @@ function cm.spfilter2(c,e,tp,mc,tc)
return c:IsSetCard(0x14f) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetMZoneCount(tp,tc)>0 and math.abs(c:GetOriginalLevel()-mc:GetOriginalLevel())==1 return c:IsSetCard(0x14f) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetMZoneCount(tp,tc)>0 and math.abs(c:GetOriginalLevel()-mc:GetOriginalLevel())==1
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.desfilter,tp,LOCATION_MZONE,0,1,nil,e,tp,false) and not e:GetHandler():IsStatus(STATUS_CHAINING) and not Duel.IsPlayerAffectedByEffect(tp,59822133) end if chk==0 then return Duel.IsExistingMatchingCard(cm.desfilter,tp,LOCATION_MZONE,0,1,nil,e,tp,false) and e:GetHandler():GetFlagEffect(m)==0 and not Duel.IsPlayerAffectedByEffect(tp,59822133) end
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1,Duel.GetCurrentChain())
local g=Duel.GetMatchingGroup(cm.desfilter,tp,LOCATION_MZONE,0,nil,e,tp,false) local g=Duel.GetMatchingGroup(cm.desfilter,tp,LOCATION_MZONE,0,nil,e,tp,false)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_EXTRA+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_EXTRA+LOCATION_GRAVE)
...@@ -113,7 +114,8 @@ function cm.descon(e,tp,eg,ep,ev,re,r,rp) ...@@ -113,7 +114,8 @@ function cm.descon(e,tp,eg,ep,ev,re,r,rp)
end end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end if chkc then return false end
if chk==0 then return not e:GetHandler():IsStatus(STATUS_CHAINING) end if chk==0 then return e:GetHandler():GetFlagEffect(m)==0 end
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1,Duel.GetCurrentChain())
if Duel.IsExistingTarget(nil,tp,0,LOCATION_ONFIELD,1,nil) then if Duel.IsExistingTarget(nil,tp,0,LOCATION_ONFIELD,1,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
Duel.SelectTarget(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil) Duel.SelectTarget(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil)
......
...@@ -55,7 +55,7 @@ function cm.sumfilter(c) ...@@ -55,7 +55,7 @@ function cm.sumfilter(c)
return c:IsSetCard(0x3356) and c:IsSummonable(true,nil) return c:IsSetCard(0x3356) and c:IsSummonable(true,nil)
end end
function cm.smtg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.smtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end end
function cm.smop(e,tp,eg,ep,ev,re,r,rp) function cm.smop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -23,11 +23,10 @@ end ...@@ -23,11 +23,10 @@ end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local el={{TAMA_ELEMENT_ORDER,1}} local el={{TAMA_ELEMENT_ORDER,1}}
local mg=tama.tamas_checkGroupElements(Duel.GetFieldGroup(tp,LOCATION_GRAVE,0),el) local mg=tama.tamas_checkGroupElements(Duel.GetFieldGroup(tp,LOCATION_GRAVE,0),el)
local sg=Group.CreateGroup()
if chk==0 then if chk==0 then
return mg:GetCount()>0 and mg:IsExists(tama.tamas_selectElementsForAbove,1,nil,mg,sg,el) return mg:GetCount()>0 and tama.tamas_isCanSelectElementsForAbove(mg,el)
end end
local sg=tama.tamas_selectAllSelectForAbove(mg,el,tp) local sg=tama.tamas_selectElementsMaterial(mg,el,tp)
Duel.SendtoDeck(sg,nil,2,REASON_COST) Duel.SendtoDeck(sg,nil,2,REASON_COST)
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)
......
...@@ -38,7 +38,7 @@ function cm.smtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -38,7 +38,7 @@ function cm.smtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_GRAVE)
end end
function cm.smop(e,tp,eg,ep,ev,re,r,rp) function cm.smop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroupCount(cm.tdfilter,tp,LOCATION_GRAVE,0,nil) local g=Duel.GetMatchingGroup(cm.tdfilter,tp,LOCATION_GRAVE,0,nil)
--[[ --[[
if g:GetCount()<=0 then return end if g:GetCount()<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
......
...@@ -7,6 +7,7 @@ function cm.initial_effect(c) ...@@ -7,6 +7,7 @@ function cm.initial_effect(c)
e1:SetCategory(CATEGORY_DRAW+CATEGORY_TODECK+CATEGORY_TOEXTRA+CATEGORY_RECOVER) e1:SetCategory(CATEGORY_DRAW+CATEGORY_TODECK+CATEGORY_TOEXTRA+CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCost(cm.cost) e1:SetCost(cm.cost)
e1:SetTarget(cm.target) e1:SetTarget(cm.target)
e1:SetOperation(cm.activate) e1:SetOperation(cm.activate)
......
...@@ -20,8 +20,8 @@ function cm.initial_effect(c) ...@@ -20,8 +20,8 @@ function cm.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST) Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
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)
if chk==0 then return eg:IsExists(Card.IsFaceup,1,nil) end if chk==0 then return eg:IsExists(Card.IsFaceup,1,nil) end
......
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