Commit 2a5baead authored by Nemo Ma's avatar Nemo Ma

fix

parent f9163ff1
......@@ -51,10 +51,11 @@ 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 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
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(Card.IsFacedown,tp,LOCATION_DECK,0,nil):GetMaxGroup(Card.GetSequence):GetFirst()
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
end
end
......
......@@ -50,10 +50,11 @@ 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 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
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(Card.IsFacedown,tp,LOCATION_DECK,0,nil):GetMaxGroup(Card.GetSequence):GetFirst()
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
end
end
......
......@@ -51,10 +51,11 @@ 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 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
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(Card.IsFacedown,tp,LOCATION_DECK,0,nil):GetMaxGroup(Card.GetSequence):GetFirst()
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
end
end
......
......@@ -48,10 +48,11 @@ 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 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
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(Card.IsFacedown,tp,LOCATION_DECK,0,nil):GetMaxGroup(Card.GetSequence):GetFirst()
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
end
end
......
......@@ -51,10 +51,11 @@ 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 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
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(Card.IsFacedown,tp,LOCATION_DECK,0,nil):GetMaxGroup(Card.GetSequence):GetFirst()
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
end
end
......
......@@ -152,10 +152,11 @@ 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 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
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(Card.IsFacedown,tp,LOCATION_DECK,0,nil):GetMaxGroup(Card.GetSequence):GetFirst()
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
end
end
......
......@@ -153,10 +153,11 @@ 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 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
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(Card.IsFacedown,tp,LOCATION_DECK,0,nil):GetMaxGroup(Card.GetSequence):GetFirst()
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
end
end
......
......@@ -152,10 +152,11 @@ 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 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
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(Card.IsFacedown,tp,LOCATION_DECK,0,nil):GetMaxGroup(Card.GetSequence):GetFirst()
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
end
end
......
......@@ -70,10 +70,11 @@ 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 not c:GetEquipGroup():IsExists(cm.eqfilter,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.GetMatchingGroupCount(Card.IsFacedown,tp,0,LOCATION_EXTRA,nil)>0 then
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(Card.IsFacedown,tp,0,LOCATION_EXTRA,nil):GetMaxGroup(Card.GetSequence):GetFirst()
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
end
end
......
......@@ -65,10 +65,11 @@ 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 not c:GetEquipGroup():IsExists(cm.eqfilter,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.GetMatchingGroupCount(Card.IsFacedown,tp,LOCATION_EXTRA,0,nil)>0 then
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(Card.IsFacedown,tp,LOCATION_EXTRA,0,nil):GetMaxGroup(Card.GetSequence):GetFirst()
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
end
end
......
......@@ -56,7 +56,8 @@ function cm.eqop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
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)
local ec=Duel.SelectMatchingCard(tp,cm.notpublic,tp,LOCATION_HAND,0,1,1,nil):GetFirst()
local ec=Duel.SelectMatchingCard(tp,nil,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
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
......@@ -68,9 +69,6 @@ function cm.eqop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function cm.notpublic(c)
return not c:IsPublic()
end
function cm.acfilter(c,tp)
return c:IsPreviousControler(tp) and c:GetEquipTarget()
end
......
......@@ -50,7 +50,7 @@ function cm.smop(e,tp,eg,ep,ev,re,r,rp)
if sg and sg:GetCount()>0 then
local el=tama.tamas_sumElements(sg)
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
local g1=Duel.GetMatchingGroupCount(cm.thfilter,tp,LOCATION_DECK,0,el)
local g1=Duel.GetMatchingGroupCount(cm.thfilter,tp,LOCATION_DECK,0,nil,el)
if g1:GetCount()>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg1=g1:Select(tp,1,g1:GetCount(),nil)
......
......@@ -105,9 +105,9 @@ function cm.thfilter(c)
end
function cm.pctg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
local ct1=eg:GetCount()
local t1=ct1>0
if chk==0 then return t1 and Duel.IsPlayerCanDraw(tp,1) end
local op=0
local m1={}
local n1={}
......
......@@ -21,6 +21,8 @@ function cm.initial_effect(c)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_SUMMON)
c:RegisterEffect(e2)
cm.deadrose_effect_onfield_splimit=e1
cm.deadrose_effect_onfield_slimit=e2
--cannot remove
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
......@@ -30,6 +32,7 @@ function cm.initial_effect(c)
e3:SetTargetRange(1,1)
e3:SetTarget(cm.crtg)
c:RegisterEffect(e3)
cm.deadrose_effect_onfield=e3
--fusion!
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DECKDES)
......@@ -39,6 +42,7 @@ function cm.initial_effect(c)
e4:SetTarget(cm.tgtg)
e4:SetOperation(cm.tgop)
c:RegisterEffect(e4)
cm.deadrose_effect_three=e4
end
function cm.splimcon(e)
return not e:GetHandler():IsForbidden()
......@@ -67,7 +71,7 @@ function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.tgfilter,tp,LOCATION_HAND+LOCATION_DECK,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=g:SelectSubGroup(tp,cm.fselect,false,2,2)
if g1:GetCount()==2 and Duel.SendtoGrave(g1,REASON_EFFECT)==2 then
if g1 and g1:GetCount()==2 and Duel.SendtoGrave(g1,REASON_EFFECT)==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g3=Duel.SelectMatchingCard(tp,cm.tg3filter,tp,LOCATION_EXTRA,0,1,1,nil)
if g3:GetCount()~=0 then
......
......@@ -21,6 +21,8 @@ function cm.initial_effect(c)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_SUMMON)
c:RegisterEffect(e2)
cm.deadrose_effect_onfield_splimit=e1
cm.deadrose_effect_onfield_slimit=e2
--change effect type
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
......@@ -29,6 +31,7 @@ function cm.initial_effect(c)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(1,0)
c:RegisterEffect(e3)
cm.deadrose_effect_onfield=e3
--synchro!
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TOGRAVE)
......@@ -39,6 +42,7 @@ function cm.initial_effect(c)
e4:SetTarget(cm.tgtg)
e4:SetOperation(cm.tgop)
c:RegisterEffect(e4)
cm.deadrose_effect_three=e4
end
function cm.splimcon(e)
return not e:GetHandler():IsForbidden()
......@@ -66,7 +70,7 @@ function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.tgfilter,tp,LOCATION_HAND,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=g:SelectSubGroup(tp,cm.fselect,false,2,2)
if g1:GetCount()==2 and Duel.SendtoGrave(g1,REASON_EFFECT)==2 then
if g1 and g1:GetCount()==2 and Duel.SendtoGrave(g1,REASON_EFFECT)==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g3=Duel.SelectMatchingCard(tp,cm.tg3filter,tp,LOCATION_EXTRA,0,1,1,nil)
if g3:GetCount()~=0 then
......
......@@ -21,6 +21,8 @@ function cm.initial_effect(c)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_SUMMON)
c:RegisterEffect(e2)
cm.deadrose_effect_onfield_splimit=e1
cm.deadrose_effect_onfield_slimit=e2
--to hand
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOHAND)
......@@ -40,6 +42,7 @@ function cm.initial_effect(c)
e4:SetTarget(cm.tgtg)
e4:SetOperation(cm.tgop)
c:RegisterEffect(e4)
cm.deadrose_effect_three=e4
end
function cm.splimcon(e)
return not e:GetHandler():IsForbidden()
......@@ -86,7 +89,7 @@ function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.tgfilter,tp,LOCATION_HAND,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=g:SelectSubGroup(tp,cm.fselect,false,2,2)
if g1:GetCount()==2 and Duel.SendtoGrave(g1,REASON_EFFECT)==2 then
if g1 and g1:GetCount()==2 and Duel.SendtoGrave(g1,REASON_EFFECT)==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g3=Duel.SelectMatchingCard(tp,cm.tg3filter,tp,LOCATION_EXTRA,0,1,1,nil)
if g3:GetCount()~=0 then
......
......@@ -88,6 +88,7 @@ function cm.drop(e,tp,eg,ep,ev,re,r,rp)
local dc=Duel.GetOperatedGroup():GetFirst()
Duel.ConfirmCards(1-tp,dc)
if dc:IsAttribute(ATTRIBUTE_WATER) and c:IsRelateToEffect(e) and c:IsChainAttackable() then Duel.ChainAttack() end
Duel.ShuffleHand(tp)
end
end
function cm.eqcon(e,tp,eg,ep,ev,re,r,rp)
......
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