Commit 55d99c07 authored by xiaoye's avatar xiaoye

update deepnight

parent 6622dadb
......@@ -1318,4 +1318,33 @@ function VgD.CannotBeTarget(c,con,val,loc)
end)
end
c:RegisterEffect(e1)
end
function VgD.NightEffect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(AFFECT_CODE_NIGHT)
e1:SetRange(LOCATION_ORDER)
e1:SetTargetRange(1,0)
e1:SetCondition(function (e)
local tp=e:GetHandlerPlayer()
return not vgf.IsExistingMatchingCard(VgD.NightFilter,tp,LOCATION_ORDER,0,1,nil) and vgf.GetMatchingGroupCount(nil,tp,LOCATION_ORDER,0,nil)==1
end)
c:RegisterEffect(e1)
end
function VgD.DeepNightEffect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(AFFECT_CODE_DEEP_NIGHT)
e1:SetRange(LOCATION_ORDER)
e1:SetTargetRange(1,0)
e1:SetCondition(function (e)
local tp=e:GetHandlerPlayer()
return not vgf.IsExistingMatchingCard(VgD.NightFilter,tp,LOCATION_ORDER,0,1,nil) and vgf.GetMatchingGroupCount(nil,tp,LOCATION_ORDER,0,nil)>=2
end)
c:RegisterEffect(e1)
end
function VgD.NightFilter(c)
return not c:IsSetCard(0x5040) and c:IsType(TYPE_CONTINUOUS)
end
\ No newline at end of file
......@@ -1076,25 +1076,7 @@ function VgF.Sendto(loc,sg,...)
end
if loc==LOCATION_DROP then
AddOverlayGroup(g,LOCATION_DROP)
local function repfilter(c,tp)
return c:IsControler(tp) and (c:IsLocation(LOCATION_GZONE) or VgF.RMonsterFilter(c)) and c:IsType(TYPE_MONSTER) and c:GetLevel()%2==1
end
local print=0
for tp=0,1 do
local replace_to_overlay_group=g:Filter(repfilter,nil,tp)
local ct=replace_to_overlay_group:GetCount()
if Duel.IsPlayerAffectedByEffect(tp,10501118) and ct>0 and Duel.SelectYesNo(tp,VgF.Stringid(10501118,0)) then
if ct>1 then replace_to_overlay_group=replace_to_overlay_group:Select(tp,1,ct,nil) end
local ct1=VgF.Sendto(LOCATION_OVERLAY,replace_to_overlay_group,VgF.GetVMonster(tp))
print=print+ct1
g:Sub(replace_to_overlay_group)
end
end
if g:GetCount()>0 then
local ct=Duel.SendtoGrave(g,...)
print=print+ct
end
return print
return Duel.SendtoGrave(g,...)
elseif loc==LOCATION_DECK then
return Duel.SendtoDeck(g,...)
elseif loc==LOCATION_HAND then
......
......@@ -3,34 +3,12 @@ function cm.initial_effect(c)
vgf.VgCard(c)
vgd.ContinuousSpell(c,vgf.OverlayCost(1))
vgd.EffectTypeTrigger(c,m,nil,EFFECT_TYPE_SINGLE,EVENT_MOVE,cm.operation,nil,cm.condition)
--黑夜
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(AFFECT_CODE_NIGHT)
e1:SetRange(LOCATION_ORDER)
e1:SetTargetRange(1,0)
e1:SetCondition(cm.con1)
c:RegisterEffect(e1)
--深渊黑夜
local e2=e1:Clone()
e2:SetCode(AFFECT_CODE_DEEP_NIGHT)
e2:SetCondition(cm.con2)
c:RegisterEffect(e2)
vgd.NightEffect(c)--黑夜
vgd.DeepNightEffect(c)--深渊黑夜
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Draw(tp,1,REASON_EFFECT)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_ORDER)
end
function cm.con1(e,tp,eg,ep,ev,re,r,rp)
return not vgf.IsExistingMatchingCard(cm.filter,tp,LOCATION_ORDER,0,1,nil) and vgf.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_ORDER,0,1,nil,0x5040)
and not vgf.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_ORDER,0,2,nil,0x5040)
end
function cm.con2(e,tp,eg,ep,ev,re,r,rp)
return not vgf.IsExistingMatchingCard(cm.filter,tp,LOCATION_ORDER,0,1,nil) and vgf.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_ORDER,0,2,nil,0x5040)
end
function cm.filter(c)
return not c:IsSetCard(0x5040) and c:IsType(TYPE_CONTINUOUS)
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