Commit 4bb51fc1 authored by CubeRuler's avatar CubeRuler

FIX

parent a650addb
......@@ -64,11 +64,11 @@ function cm.onfilter(c,mc)
if c:GetLevel()==mc:GetLevel() then flag=flag+1 end
if c:GetTextAttack()==mc:GetTextAttack() then flag=flag+1 end
if c:GetTextDefense()==mc:GetTextDefense() then flag=flag+1 end
return flag~=1
return flag==1
end
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsChainNegatable(ev)
and rp==1-tp and re:IsActiveType(TYPE_MONSTER) and not cm.onfilter(e:GetHandler(),re:GetHandler())
and rp==1-tp and re:IsActiveType(TYPE_MONSTER) and cm.onfilter(e:GetHandler(),re:GetHandler())
end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGrave() end
......@@ -86,20 +86,20 @@ end
function cm.negcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end
return true
return rp==1-tp
end
function cm.filter(c,rc)
return c:IsAbleToHand() and not cm.onfilter(c,rc)
return c:IsAbleToHand() and cm.onfilter(c,rc)
end
function cm.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
local rc=re:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,LOCATION_DECK,1,rc,rc) end
if chk==0 then return rc and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,rc,rc) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,0)
end
function cm.negop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,LOCATION_DECK,1,1,rc,rc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,rc,rc)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
......
......@@ -21,10 +21,10 @@ function cm.initial_effect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
cm.FlipEffect_Deobra=e1
--be target
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
......@@ -37,7 +37,7 @@ function cm.initial_effect(c)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
cm.self_flip_effect2=e2
cm.TargetEffect_Deobra=e2
--immune
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
......@@ -102,9 +102,6 @@ end
function cm.filter(c)
return c:IsCanOverlay()
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(m)==0
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD+LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsCanOverlay() end
if chk==0 then return Duel.IsExistingTarget(Card.IsCanOverlay,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil) end
......@@ -134,8 +131,7 @@ end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local pos=Duel.SelectPosition(tp,e:GetHandler(),POS_FACEUP_ATTACK+POS_FACEUP_DEFENSE)
Duel.ChangePosition(e:GetHandler(),pos)
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
Duel.ChangePosition(e:GetHandler(),pos,pos,pos,pos,true)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD+LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsCanOverlay() end
......
......@@ -8,10 +8,10 @@ function cm.initial_effect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
cm.FlipEffect_Deobra=e1
--be target
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
......@@ -25,7 +25,7 @@ function cm.initial_effect(c)
e2:SetTarget(cm.sp2tg)
e2:SetOperation(cm.sp2op)
c:RegisterEffect(e2)
cm.self_flip_effect2=e2
cm.TargetEffect_Deobra=e2
--special summon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
......@@ -43,9 +43,6 @@ end
function cm.filter(c,e,tp)
return c:IsSetCard(0xf3b) and c:IsType(TYPE_MONSTER) and not c:IsCode(15000541) and (c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK) or c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE))
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(m)==0
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) end
......@@ -73,8 +70,7 @@ function cm.sp2con(e,tp,eg,ep,ev,re,r,rp)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.ChangePosition(e:GetHandler(),POS_FACEUP)
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,true)
end
function cm.sp2tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
......@@ -8,10 +8,10 @@ function cm.initial_effect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
cm.FlipEffect_Deobra=e1
--be target
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DISABLE)
......@@ -25,7 +25,7 @@ function cm.initial_effect(c)
e2:SetTarget(cm.tgtg)
e2:SetOperation(cm.tgop)
c:RegisterEffect(e2)
cm.self_flip_effect2=e2
cm.TargetEffect_Deobra=e2
--special summon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
......@@ -40,9 +40,6 @@ function cm.initial_effect(c)
e3:SetOperation(cm.spop1)
c:RegisterEffect(e3)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(m)==0
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(aux.TURE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
local g=Duel.SelectTarget(tp,aux.TURE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
......@@ -63,8 +60,7 @@ function cm.tgcon(e,tp,eg,ep,ev,re,r,rp)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.ChangePosition(e:GetHandler(),POS_FACEUP)
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,true)
end
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(aux.TURE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
......
......@@ -8,10 +8,10 @@ function cm.initial_effect(c)
e1:SetDescription(aux.Stringid(m,2))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
cm.FlipEffect_Deobra=e1
--be target
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
......@@ -25,7 +25,7 @@ function cm.initial_effect(c)
e2:SetTarget(cm.sp2tg)
e2:SetOperation(cm.sp2op)
c:RegisterEffect(e2)
cm.self_flip_effect2=e2
cm.TargetEffect_Deobra=e2
--special summon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
......@@ -43,9 +43,6 @@ end
function cm.filter(c,e,tp)
return c:IsSetCard(0xf3b) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(m)==0
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
......@@ -64,8 +61,7 @@ function cm.sp2con(e,tp,eg,ep,ev,re,r,rp)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.ChangePosition(e:GetHandler(),POS_FACEUP)
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,true)
end
function cm.sp2tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
......
......@@ -8,10 +8,10 @@ function cm.initial_effect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
cm.FlipEffect_Deobra=e1
--be target
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
......@@ -25,7 +25,7 @@ function cm.initial_effect(c)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
cm.self_flip_effect2=e2
cm.TargetEffect_Deobra=e2
--special summon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
......@@ -43,9 +43,6 @@ end
function cm.filter(c)
return c:IsType(TYPE_FLIP) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and not c:IsCode(15000547)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(m)==0
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
......@@ -63,8 +60,7 @@ function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE)
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,true)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.filter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
......
......@@ -8,10 +8,10 @@ function cm.initial_effect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
cm.FlipEffect_Deobra=e1
--be target
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
......@@ -25,7 +25,7 @@ function cm.initial_effect(c)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
cm.self_flip_effect2=e2
cm.TargetEffect_Deobra=e2
--special summon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
......@@ -43,9 +43,6 @@ end
function cm.filter(c)
return ((c:IsType(TYPE_FLIP) and c:IsType(TYPE_MONSTER)) or c:IsSetCard(0xf3b)) and c:IsAbleToDeck()
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(m)==0
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE,0,1,nil) and Duel.IsPlayerCanDraw(tp,1) end
......@@ -69,8 +66,7 @@ function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE)
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,true)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......
......@@ -33,7 +33,7 @@ end
function c33310201.sccon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return Duel.GetTurnPlayer()=tp and (ph==PHASE_MAIN1 or (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE) or ph==PHASE_MAIN2)
return Duel.GetTurnPlayer()==tp and Duel.GetCurrentChain()==0 and (ph==PHASE_MAIN1 or (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE) or ph==PHASE_MAIN2)
end
function c33310201.thcon(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -30,7 +30,7 @@ function c33310203.initial_effect(c)
end
function c33310203.sccon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return Duel.GetTurnPlayer()=tp and (ph==PHASE_MAIN1 or (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE) or ph==PHASE_MAIN2)
return Duel.GetTurnPlayer()==tp and Duel.GetCurrentChain()==0 and (ph==PHASE_MAIN1 or (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE) or ph==PHASE_MAIN2)
end
function c33310203.thcon(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -91,5 +91,4 @@ function c33310212.op(e,tp,eg,ep,ev,re,r,rp)
tc:RegisterEffect(e1)
end
end
end
end
\ No newline at end of file
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