Commit a5468a08 authored by Nemo Ma's avatar Nemo Ma

fix

parent c4537df5
......@@ -35,6 +35,7 @@ function cm.eqlimit(e,c)
return e:GetOwner()==c
end
function cm.equipfd(c,tp,tc)
if tc:IsPosition(POS_FACEUP) then Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEDOWN,false) end
if not Duel.Equip(tp,tc,c,false) then return false end
--Add Equip limit
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,0)
......@@ -50,13 +51,18 @@ end
function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local phase=Duel.GetCurrentPhase()
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) or not Duel.IsPlayerCanSSet(tp) then return end
if not c:GetEquipGroup():IsExists(cm.eqfilter,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.GetMatchingGroupCount(nil,tp,LOCATION_DECK,0,nil)>0 then
Duel.Hint(HINT_CARD,0,m)
local tc=Duel.GetMatchingGroup(nil,tp,LOCATION_DECK,0,nil):GetMaxGroup(Card.GetSequence):GetFirst()
Duel.DisableShuffleCheck()
if tc:IsPosition(POS_FACEUP) then Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEDOWN,false) end
if cm.equipfd(c,tp,tc) then Duel.Readjust() end
if tc:IsForbidden() then
Duel.DiscardDeck(tp,1,REASON_RULE)
Duel.Readjust()
elseif cm.equipfd(c,tp,tc) then
Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
Duel.Readjust()
end
end
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -34,6 +34,7 @@ function cm.eqlimit(e,c)
return e:GetOwner()==c
end
function cm.equipfd(c,tp,tc)
if tc:IsPosition(POS_FACEUP) then Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEDOWN,false) end
if not Duel.Equip(tp,tc,c,false) then return false end
--Add Equip limit
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,0)
......@@ -49,13 +50,18 @@ end
function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local phase=Duel.GetCurrentPhase()
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) or not Duel.IsPlayerCanSSet(tp) then return end
if not c:GetEquipGroup():IsExists(cm.eqfilter,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.GetMatchingGroupCount(nil,tp,LOCATION_DECK,0,nil)>0 then
Duel.Hint(HINT_CARD,0,m)
local tc=Duel.GetMatchingGroup(nil,tp,LOCATION_DECK,0,nil):GetMaxGroup(Card.GetSequence):GetFirst()
Duel.DisableShuffleCheck()
if tc:IsPosition(POS_FACEUP) then Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEDOWN,false) end
if cm.equipfd(c,tp,tc) then Duel.Readjust() end
if tc:IsForbidden() then
Duel.DiscardDeck(tp,1,REASON_RULE)
Duel.Readjust()
elseif cm.equipfd(c,tp,tc) then
Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
Duel.Readjust()
end
end
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -35,6 +35,7 @@ function cm.eqlimit(e,c)
return e:GetOwner()==c
end
function cm.equipfd(c,tp,tc)
if tc:IsPosition(POS_FACEUP) then Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEDOWN,false) end
if not Duel.Equip(tp,tc,c,false) then return false end
--Add Equip limit
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,0)
......@@ -50,13 +51,18 @@ end
function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local phase=Duel.GetCurrentPhase()
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) or not Duel.IsPlayerCanSSet(tp) then return end
if not c:GetEquipGroup():IsExists(cm.eqfilter,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.GetMatchingGroupCount(nil,tp,LOCATION_DECK,0,nil)>0 then
Duel.Hint(HINT_CARD,0,m)
local tc=Duel.GetMatchingGroup(nil,tp,LOCATION_DECK,0,nil):GetMaxGroup(Card.GetSequence):GetFirst()
Duel.DisableShuffleCheck()
if tc:IsPosition(POS_FACEUP) then Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEDOWN,false) end
if cm.equipfd(c,tp,tc) then Duel.Readjust() end
if tc:IsForbidden() then
Duel.DiscardDeck(tp,1,REASON_RULE)
Duel.Readjust()
elseif cm.equipfd(c,tp,tc) then
Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
Duel.Readjust()
end
end
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -32,6 +32,7 @@ function cm.eqlimit(e,c)
return e:GetOwner()==c
end
function cm.equipfd(c,tp,tc)
if tc:IsPosition(POS_FACEUP) then Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEDOWN,false) end
if not Duel.Equip(tp,tc,c,false) then return false end
--Add Equip limit
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,0)
......@@ -47,13 +48,18 @@ end
function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local phase=Duel.GetCurrentPhase()
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) or not Duel.IsPlayerCanSSet(tp) then return end
if not c:GetEquipGroup():IsExists(cm.eqfilter,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.GetMatchingGroupCount(nil,tp,LOCATION_DECK,0,nil)>0 then
Duel.Hint(HINT_CARD,0,m)
local tc=Duel.GetMatchingGroup(nil,tp,LOCATION_DECK,0,nil):GetMaxGroup(Card.GetSequence):GetFirst()
Duel.DisableShuffleCheck()
if tc:IsPosition(POS_FACEUP) then Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEDOWN,false) end
if cm.equipfd(c,tp,tc) then Duel.Readjust() end
if tc:IsForbidden() then
Duel.DiscardDeck(tp,1,REASON_RULE)
Duel.Readjust()
elseif cm.equipfd(c,tp,tc) then
Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
Duel.Readjust()
end
end
end
function cm.filter(c,type1)
......
......@@ -35,6 +35,7 @@ function cm.eqlimit(e,c)
return e:GetOwner()==c
end
function cm.equipfd(c,tp,tc)
if tc:IsPosition(POS_FACEUP) then Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEDOWN,false) end
if not Duel.Equip(tp,tc,c,false) then return false end
--Add Equip limit
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,0)
......@@ -50,13 +51,18 @@ end
function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local phase=Duel.GetCurrentPhase()
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) or not Duel.IsPlayerCanSSet(tp) then return end
if not c:GetEquipGroup():IsExists(cm.eqfilter,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.GetMatchingGroupCount(nil,tp,LOCATION_DECK,0,nil)>0 then
Duel.Hint(HINT_CARD,0,m)
local tc=Duel.GetMatchingGroup(nil,tp,LOCATION_DECK,0,nil):GetMaxGroup(Card.GetSequence):GetFirst()
Duel.DisableShuffleCheck()
if tc:IsPosition(POS_FACEUP) then Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEDOWN,false) end
if cm.equipfd(c,tp,tc) then Duel.Readjust() end
if tc:IsForbidden() then
Duel.DiscardDeck(tp,1,REASON_RULE)
Duel.Readjust()
elseif cm.equipfd(c,tp,tc) then
Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
Duel.Readjust()
end
end
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -136,6 +136,7 @@ function cm.eqlimit(e,c)
return e:GetOwner()==c
end
function cm.equipfd(c,tp,tc)
if tc:IsPosition(POS_FACEUP) then Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEDOWN,false) end
if not Duel.Equip(tp,tc,c,false) then return false end
--Add Equip limit
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,0)
......@@ -151,13 +152,18 @@ end
function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local phase=Duel.GetCurrentPhase()
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) or not Duel.IsPlayerCanSSet(tp) then return end
if not c:GetEquipGroup():IsExists(cm.eqfilter,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.GetMatchingGroupCount(nil,tp,LOCATION_DECK,0,nil)>0 then
Duel.Hint(HINT_CARD,0,m)
local tc=Duel.GetMatchingGroup(nil,tp,LOCATION_DECK,0,nil):GetMaxGroup(Card.GetSequence):GetFirst()
Duel.DisableShuffleCheck()
if tc:IsPosition(POS_FACEUP) then Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEDOWN,false) end
if cm.equipfd(c,tp,tc) then Duel.Readjust() end
if tc:IsForbidden() then
Duel.DiscardDeck(tp,1,REASON_RULE)
Duel.Readjust()
elseif cm.equipfd(c,tp,tc) then
Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
Duel.Readjust()
end
end
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -137,6 +137,7 @@ function cm.eqlimit(e,c)
return e:GetOwner()==c
end
function cm.equipfd(c,tp,tc)
if tc:IsPosition(POS_FACEUP) then Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEDOWN,false) end
if not Duel.Equip(tp,tc,c,false) then return false end
--Add Equip limit
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,0)
......@@ -152,13 +153,18 @@ end
function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local phase=Duel.GetCurrentPhase()
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) or not Duel.IsPlayerCanSSet(tp) then return end
if not c:GetEquipGroup():IsExists(cm.eqfilter,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.GetMatchingGroupCount(nil,tp,LOCATION_DECK,0,nil)>0 then
Duel.Hint(HINT_CARD,0,m)
local tc=Duel.GetMatchingGroup(nil,tp,LOCATION_DECK,0,nil):GetMaxGroup(Card.GetSequence):GetFirst()
Duel.DisableShuffleCheck()
if tc:IsPosition(POS_FACEUP) then Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEDOWN,false) end
if cm.equipfd(c,tp,tc) then Duel.Readjust() end
if tc:IsForbidden() then
Duel.DiscardDeck(tp,1,REASON_RULE)
Duel.Readjust()
elseif cm.equipfd(c,tp,tc) then
Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
Duel.Readjust()
end
end
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -136,6 +136,7 @@ function cm.eqlimit(e,c)
return e:GetOwner()==c
end
function cm.equipfd(c,tp,tc)
if tc:IsPosition(POS_FACEUP) then Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEDOWN,false) end
if not Duel.Equip(tp,tc,c,false) then return false end
--Add Equip limit
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,0)
......@@ -151,13 +152,18 @@ end
function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local phase=Duel.GetCurrentPhase()
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) or not Duel.IsPlayerCanSSet(tp) then return end
if not c:GetEquipGroup():IsExists(cm.eqfilter,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.GetMatchingGroupCount(nil,tp,LOCATION_DECK,0,nil)>0 then
Duel.Hint(HINT_CARD,0,m)
local tc=Duel.GetMatchingGroup(nil,tp,LOCATION_DECK,0,nil):GetMaxGroup(Card.GetSequence):GetFirst()
Duel.DisableShuffleCheck()
if tc:IsPosition(POS_FACEUP) then Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEDOWN,false) end
if cm.equipfd(c,tp,tc) then Duel.Readjust() end
if tc:IsForbidden() then
Duel.DiscardDeck(tp,1,REASON_RULE)
Duel.Readjust()
elseif cm.equipfd(c,tp,tc) then
Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
Duel.Readjust()
end
end
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -54,6 +54,7 @@ function cm.eqlimit(e,c)
return e:GetOwner()==c
end
function cm.equipfd(c,tp,tc)
if tc:IsPosition(POS_FACEUP) then Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEDOWN,false) end
if not Duel.Equip(tp,tc,c,false) then return false end
--Add Equip limit
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,0)
......@@ -69,13 +70,18 @@ end
function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local phase=Duel.GetCurrentPhase()
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) or not Duel.IsPlayerCanSSet(tp) then return end
if not c:GetEquipGroup():IsExists(cm.eqfilter,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.GetMatchingGroupCount(nil,tp,0,LOCATION_EXTRA,nil)>0 then
Duel.Hint(HINT_CARD,0,m)
local tc=Duel.GetMatchingGroup(nil,tp,0,LOCATION_EXTRA,nil):GetMaxGroup(Card.GetSequence):GetFirst()
Duel.DisableShuffleCheck()
if tc:IsPosition(POS_FACEUP) then Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEDOWN,false) end
if cm.equipfd(c,tp,tc) then Duel.Readjust() end
if tc:IsForbidden() then
Duel.DiscardDeck(tp,1,REASON_RULE)
Duel.Readjust()
elseif cm.equipfd(c,tp,tc) then
Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
Duel.Readjust()
end
end
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -49,6 +49,7 @@ function cm.eqlimit(e,c)
return e:GetOwner()==c
end
function cm.equipfd(c,tp,tc)
if tc:IsPosition(POS_FACEUP) then Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEDOWN,false) end
if not Duel.Equip(tp,tc,c,false) then return false end
--Add Equip limit
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,0)
......@@ -64,13 +65,18 @@ end
function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local phase=Duel.GetCurrentPhase()
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) or not Duel.IsPlayerCanSSet(tp) then return end
if not c:GetEquipGroup():IsExists(cm.eqfilter,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.GetMatchingGroupCount(nil,tp,LOCATION_EXTRA,0,nil)>0 then
Duel.Hint(HINT_CARD,0,m)
local tc=Duel.GetMatchingGroup(nil,tp,LOCATION_EXTRA,0,nil):GetMaxGroup(Card.GetSequence):GetFirst()
Duel.DisableShuffleCheck()
if tc:IsPosition(POS_FACEUP) then Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEDOWN,false) end
if cm.equipfd(c,tp,tc) then Duel.Readjust() end
if tc:IsForbidden() then
Duel.DiscardDeck(tp,1,REASON_RULE)
Duel.Readjust()
elseif cm.equipfd(c,tp,tc) then
Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
Duel.Readjust()
end
end
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -43,22 +43,26 @@ end
function cm.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tc=re:GetHandler():GetPreviousEquipTarget()
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 and Duel.IsPlayerCanSSet(tp) end
Duel.SetTargetCard(tc)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_HAND)
end
function cm.nffilter(c)
return not c:IsForbidden()
end
function cm.eqlimit(e,c)
return c==e:GetLabelObject()
end
function cm.eqop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
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 and Duel.IsPlayerCanSSet(tp) then
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.nffilter,tp,LOCATION_HAND,0,1,1,nil):GetFirst()
if ec and ec:IsPublic() then Duel.MoveToField(ec,tp,tp,LOCATION_SZONE,POS_FACEDOWN,false) end
if ec and Duel.Equip(tp,ec,tc,false) then
Duel.RaiseEvent(ec,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
......
......@@ -93,7 +93,7 @@ function cm.thop2(e,tp,eg,ep,ev,re,r,rp)
local g2=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if #g2>0 then
Duel.HintSelection(g2)
if Duel.Destroy(g2,REASON_EFFECT)~=0 and Duel.IsExistingMatchingCard(tp,aux.disfilter1,tp,LOCATION_ONFIELD,0,1,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,3)) then
if Duel.Destroy(g2,REASON_EFFECT)~=0 and Duel.IsExistingMatchingCard(aux.disfilter1,tp,LOCATION_ONFIELD,0,1,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,3)) then
local tg=Duel.SelectMatchingCard(tp,aux.disfilter1,tp,LOCATION_ONFIELD,0,1,1,nil)
local tc=tg:GetFirst()
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
......
......@@ -14,15 +14,15 @@ function cm.initial_effect(c)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.refilter(c)
return ((c:IsType(TYPE_EFFECT) and c:IsDisabled()) or c:IsType(TYPE_NORMAL) or c:IsType(TYPE_TOKEN)) and c:IsReleasable()
function cm.refilter(c,tp)
return ((c:IsType(TYPE_EFFECT) and c:IsDisabled()) or c:IsType(TYPE_NORMAL) or c:IsType(TYPE_TOKEN)) and c:IsReleasable() and Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_MZONE,0,1,c,tp)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x34f,2,REASON_COST) or Duel.IsExistingMatchingCard(cm.refilter,tp,LOCATION_MZONE,0,1,nil) end
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x34f,2,REASON_COST) or Duel.IsExistingMatchingCard(cm.refilter,tp,LOCATION_MZONE,0,1,nil,tp) end
local b1=Duel.IsCanRemoveCounter(tp,1,0,0x34f,2,REASON_COST)
local b2=Duel.IsExistingMatchingCard(cm.refilter,tp,LOCATION_MZONE,0,1,nil)
local b2=Duel.IsExistingMatchingCard(cm.refilter,tp,LOCATION_MZONE,0,1,nil,tp)
if b2 and (not b1 or Duel.SelectYesNo(tp,aux.Stringid(m,2))) then
local g=Duel.SelectMatchingCard(tp,cm.refilter,tp,LOCATION_MZONE,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,cm.refilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.Release(g,REASON_COST)
e:SetLabel(1)
else
......@@ -30,17 +30,17 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.RemoveCounter(tp,1,0,0x34f,2,REASON_COST)
end
end
function cm.tgfilter(c,e,tp)
return c:IsAbleToGrave() and (c:GetSequence()<5 or Duel.GetLocationCount(tp,LOCATION_MZONE)>0)
function cm.tgfilter(c,tp)
return c:IsReleasable() and (c:GetSequence()<5 or Duel.GetLocationCount(tp,LOCATION_MZONE)>0)
end
function cm.spfilter(c,e,tp)
return c:IsSetCard(0x9344) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingTarget(cm.tgfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp)
if chk==0 then return Duel.IsExistingTarget(cm.tgfilter,tp,LOCATION_MZONE,0,1,nil,tp) and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
Duel.SelectTarget(tp,cm.tgfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SelectTarget(tp,cm.tgfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
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