Commit 26cff335 authored by Tachibana's avatar Tachibana

eme

parent 214ecad2
Pipeline #7298 passed with stages
in 34 minutes and 45 seconds
......@@ -13,11 +13,11 @@ function cm.initial_effect(c)
e1:SetOperation(cm.activate)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_BATTLE_START)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(aux.bfgcost)
e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return Duel.GetTurnPlayer()~=tp end)
e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return Duel.GetTurnPlayer()~=tp and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)>0 end)
e2:SetOperation(cm.op)
C9.RegisterEffect_Batch(c,e1,e2)
......@@ -65,15 +65,6 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
if Duel.IsExistingMatchingCard(C9.CodeCheck,tp,LOCATION_MZONE,0,1,nil,m-10) then
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
......@@ -81,5 +72,14 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetValue(1)
Duel.RegisterEffect(e2,tp)
if Duel.IsExistingMatchingCard(C9.CodeCheck,tp,LOCATION_MZONE,0,1,nil,m-10) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
......@@ -60,7 +60,7 @@ end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local g=Duel.GetMatchingGroup(cm.tdfilter,tp,LOCATION_GRAVE,0,e:GetHandler(),e)
local g=Duel.GetMatchingGroup(cm.tdfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,e:GetHandler(),e)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and g:GetClassCount(Card.GetCode)>4 end --摆烂,感觉检测写起来好鸽啊XD
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
aux.GCheckAdditional=aux.dncheck
......
......@@ -15,7 +15,7 @@ function cm.initial_effect(c)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_TODECK)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_TODECK+CATEGORY_LEAVE_GRAVE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
......@@ -47,9 +47,12 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function cm.filter1(c)
return c:IsSetCard(561) and c:IsAbleToDeck()
end
function cm.atttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsControler(tp) and cm.filter1(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.filter1,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,e:GetHandler()) end
if chk==0 then return Duel.IsExistingTarget(cm.filter1,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,e:GetHandler()) and e:GetHandler():IsAbleToHand() end
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,tp,LOCATION_GRAVE)
......
......@@ -83,8 +83,8 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local lv1=math.abs(chihanecore.Mathgroup2(g1,Card.GetOriginalLevel,2))
local lv2=math.abs(chihanecore.Mathgroup2(g1,Card.GetOriginalLevel,1))
local sel,r1,r2=nil
if Duel.GetMatchingGroupCount(cm.spfilter,tp,LOCATION_DECK,0,nil,e,tp,lv1)>0 then r1=1 end
if Duel.GetMatchingGroupCount(cm.spfilter,tp,LOCATION_DECK,0,nil,e,tp,lv2)>0 then r2=1 end
if Duel.GetMatchingGroupCount(cm.spfilter,tp,LOCATION_DECK,0,nil,e,tp,lv1)>0 then r1=1 else r1=0 end
if Duel.GetMatchingGroupCount(cm.spfilter,tp,LOCATION_DECK,0,nil,e,tp,lv2)>0 then r2=1 else r2=0 end
if r1==1 and r2==1 then sel=Duel.SelectOption(tp,aux.Stringid(m,2),aux.Stringid(m,3)) end
if r1==1 and r2==0 then sel=0 end
if r1==0 and r2==1 then sel=1 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