Commit 9035a3bb authored by TanakaKotoha's avatar TanakaKotoha

fix

parent 0fd50142
...@@ -93,10 +93,7 @@ function cm.spfilters(c,e,tp,code) ...@@ -93,10 +93,7 @@ function cm.spfilters(c,e,tp,code)
return c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) return c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end end
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk) function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133) if chk==0 then return true end
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and Duel.IsExistingMatchingCard(cm.spfilters,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp,14801308)
and Duel.IsExistingMatchingCard(cm.spfilters,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp,14801309) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end end
......
...@@ -93,10 +93,7 @@ function cm.spfilters(c,e,tp,code) ...@@ -93,10 +93,7 @@ function cm.spfilters(c,e,tp,code)
return c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk) function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133) if chk==0 then return true end
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and Duel.IsExistingMatchingCard(cm.spfilters,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil,e,tp,14801325)
and Duel.IsExistingMatchingCard(cm.spfilters,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil,e,tp,14801326) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_GRAVE+LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_GRAVE+LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end end
......
...@@ -2,45 +2,48 @@ ...@@ -2,45 +2,48 @@
local m=14801352 local m=14801352
local cm=_G["c"..m] local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY) e1:SetCategory(CATEGORY_DESTROY)
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:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(cm.tgcon) e1:SetCondition(cm.tgcon)
e1:SetTarget(cm.target) e1:SetTarget(cm.target)
e1:SetOperation(cm.activate) e1:SetOperation(cm.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end
function cm.dafilter(c)
return c:IsFaceup() and c:IsSetCard(0x4808)
end end
function cm.tgcon(e) function cm.tgcon(e)
return Duel.IsExistingMatchingCard(Card.IsSetCard,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil,0x4808) return Duel.IsExistingMatchingCard(cm.dafilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end end
function cm.filter(c) function cm.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) return c:IsType(TYPE_SPELL+TYPE_TRAP)
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)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_ONFIELD,1,c) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_ONFIELD,1,c) end
local sg=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_ONFIELD,c) local sg=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_ONFIELD,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_ONFIELD,aux.ExceptThisCard(e)) local sg=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_ONFIELD,aux.ExceptThisCard(e))
if sg:GetCount()>0 then if sg:GetCount()>0 then
Duel.Destroy(sg,REASON_EFFECT) Duel.Destroy(sg,REASON_EFFECT)
local e2=Effect.CreateEffect(e:GetHandler()) local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CHANGE_DAMAGE) e2:SetCode(EFFECT_CHANGE_DAMAGE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1) e2:SetTargetRange(1,1)
e2:SetValue(cm.val2) e2:SetValue(cm.val2)
e2:SetReset(RESET_PHASE+PHASE_END) e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp) Duel.RegisterEffect(e2,tp)
end end
end end
function cm.val2(e,re,dam,r,rp,rc) function cm.val2(e,re,dam,r,rp,rc)
if bit.band(r,REASON_BATTLE+REASON_EFFECT)~=0 then if bit.band(r,REASON_BATTLE+REASON_EFFECT)~=0 then
return dam/2 return dam/2
else return dam end else return dam end
end end
\ No newline at end of file
...@@ -87,8 +87,7 @@ function cm.spfilter(c,e,tp,code) ...@@ -87,8 +87,7 @@ function cm.spfilter(c,e,tp,code)
return c:IsCode(14801326) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsCode(14801326) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk) function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCountFromEx(tp)>0 if chk==0 then return true end
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end end
......
...@@ -16,10 +16,7 @@ function cm.cfilter(c) ...@@ -16,10 +16,7 @@ function cm.cfilter(c)
return c:IsFacedown() or not c:IsSetCard(0x4808) return c:IsFacedown() or not c:IsSetCard(0x4808)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
if c==nil then return true end return not Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil)
local tp=c:GetControler()
return minc==0 and c:IsLevelAbove(5) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and (Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 or not Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil))
end end
function cm.filter(c,e,tp) function cm.filter(c,e,tp)
return c:IsSetCard(0x4808) and c:IsSummonable(true,nil) return c:IsSetCard(0x4808) and c:IsSummonable(true,nil)
......
...@@ -17,10 +17,7 @@ function cm.cfilter(c) ...@@ -17,10 +17,7 @@ function cm.cfilter(c)
return c:IsFacedown() or not c:IsSetCard(0x4808) return c:IsFacedown() or not c:IsSetCard(0x4808)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
if c==nil then return true end return not Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil)
local tp=c:GetControler()
return minc==0 and c:IsLevelAbove(5) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and (Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 or not Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil))
end end
function cm.filter(c,e,tp) function cm.filter(c,e,tp)
return c:IsSetCard(0x4808) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0x4808) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
...@@ -5,32 +5,17 @@ function c65071063.initial_effect(c) ...@@ -5,32 +5,17 @@ function c65071063.initial_effect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c65071063.cost) e1:SetCost(c65071063.dacost)
e1:SetTarget(c65071063.target) e1:SetTarget(c65071063.target)
e1:SetOperation(c65071063.activate) e1:SetOperation(c65071063.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
if not c65071063.global_check then Duel.AddCustomActivityCounter(65071063,ACTIVITY_CHAIN,c65071063.chainfilter)
c65071063.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAINING)
ge1:SetOperation(c65071063.checkop)
Duel.RegisterEffect(ge1,0)
end
end end
function c65071063.checkop(e,tp,eg,ep,ev,re,r,rp) function c65071063.chainfilter(re,tp,cid)
if re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and not re:GetHandler()==e:GetHandler() then return not (re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL+TYPE_TRAP))
Duel.RegisterFlagEffect(rp,65071063,RESET_PHASE+PHASE_END,0,1)
end
end end
function c65071063.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c65071063.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_HAND,0,e:GetHandler()) if chk==0 then return Duel.GetCustomActivityCount(65071063,tp,ACTIVITY_CHAIN)==0 end
local g2=Duel.GetMatchingGroup(Card.IsFacedown,tp,LOCATION_SZONE,0,e:GetHandler())
g:Merge(g2)
if chk==0 then return Duel.GetFlagEffect(tp,65071063)==0
and g:GetCount()>0 and g:GetCount()==g:FilterCount(Card.IsAbleToRemoveAsCost,nil) end
Duel.Remove(g,POS_FACEUP,REASON_COST)
--oath effects
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
...@@ -41,7 +26,16 @@ function c65071063.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -41,7 +26,16 @@ function c65071063.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
end end
function c65071063.aclimit(e,re,tp) function c65071063.aclimit(e,re,tp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL) and not re:GetHandler()==e:GetHandler() return re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function c65071063.dacost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_HAND,0,e:GetHandler())
local g2=Duel.GetMatchingGroup(Card.IsFacedown,tp,LOCATION_SZONE,0,e:GetHandler())
g:Merge(g2)
if chk==0 then return c65071063.cost(e,tp,eg,ep,ev,re,r,rp,0)
and g:GetCount()>0 and g:GetCount()==g:FilterCount(Card.IsAbleToRemoveAsCost,nil) end
c65071063.cost(e,tp,eg,ep,ev,re,r,rp,1)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end end
function c65071063.filter(c) function c65071063.filter(c)
return c:IsType(TYPE_SPELL) and c:IsType(TYPE_QUICKPLAY) and c:IsAbleToHand() return c:IsType(TYPE_SPELL) and c:IsType(TYPE_QUICKPLAY) and c:IsAbleToHand()
......
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