Commit 165e62ef authored by xiaoye's avatar xiaoye

fix

parent ff9425c4
......@@ -228,7 +228,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if vgf.GetMatchingGroup(vgf.VMonsterFilter,tp,LOCATION_MZONE,0,nil,nil):GetFirst():GetOverlayCount()>=2 and Duel.SelectEffectYesNo(tp,vgf.stringid(VgID,10)) then
local cg=vgf.GetMatchingGroup(vgf.VMonsterFilter,tp,LOCATION_MZONE,0,nil):GetFirst():GetOverlayGroup():Select(tp,2,2,nil)
if vgf.Sendto(LOCATION_DROP,cg,REASON_COST)==2 then
local g=vgf.SelectMatchingCard(HINTMSG_LEAVEONFIELD,e,tp,vgf.RMonsterFilter,tp,0,LOCATION_MZONE,1,1,nil)
local g=vgf.SelectMatchingCard(HINTMSG_LEAVEFIELD,e,tp,vgf.RMonsterFilter,tp,0,LOCATION_MZONE,1,1,nil)
vgf.Sendto(LOCATION_DROP,g,REASON_EFFECT)
end
end
......
......@@ -279,7 +279,7 @@ function VgD.OverDressOperation(f)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CallZONE)
szone=Duel.SelectField(tp,1,LOCATION_MZONE,0,zone)
end
e:SetValue(function () return SUMMON_VALUE_CALL,szone end)
e:SetValue(function () return SUMMON_VALUE_CALL+SUMMON_VALUE_OverDress,szone end)
local tc=Duel.GetMatchingGroup(VgD.OverDressFilter,tp,LOCATION_MZONE,0,nil,f,szone):GetFirst()
if not tc then return end
local mg=tc:GetOverlayGroup()
......@@ -542,7 +542,7 @@ function VgD.MonsterCannotBeAttackedCondition(e,c)
end
--送去g区
function VgD.CardToG(c,cost,op)
function VgD.CardToG(c,m,cost,op)
local cm=_G["c"..m]
if not cm.is_has_trigger then cm.is_has_trigger=true end
local type=EFFECT_TYPE_TRIGGER_F
......@@ -742,7 +742,7 @@ end
function VgD.OperationWhenCardTrigger(e,tp,eg,ep,ev,re,r,rp,c,chk)
local effect_when_trigger=c.effect_when_trigger
local cost,con,tg=true,true,true
if #effect_when_trigger==0 then return end
if not effect_when_trigger or #effect_when_trigger==0 then return end
if (VgF.GetValueType(effect_when_trigger[5])=="boolean" and not effect_when_trigger[5]) or (VgF.GetValueType(effect_when_trigger[5])~="boolean" and Duel.GetTurnPlayer()~=c:GetControler()) then return false end
if VgF.GetValueType(effect_when_trigger[2])=="function" then cost=effect_when_trigger[2](e,tp,eg,ep,ev,re,r,rp,0) end
if VgF.GetValueType(effect_when_trigger[3])=="function" then con=effect_when_trigger[3](e,tp,eg,ep,ev,re,r,rp) end
......@@ -1021,7 +1021,7 @@ function VgD.MixCostOperation(c,bc,e,tp)
if VgF.GetValueType(tg_to)=="number" then
if tg_to==LOCATION_DROP then
if tg_from==LOCATION_MZONE then
hintmsg=HINTMSG_LEAVEONFIELD
hintmsg=HINTMSG_LEAVEFIELD
elseif tg_from==LOCATION_OVERLAY then hintmsg=HINTMSG_REMOVEXYZ
else hintmsg=HINTMSG_TODROP end
ext_params={REASON_COST}
......@@ -1261,7 +1261,7 @@ function VgD.EffectTypeContinuousChangeAttack(c,m,typ,val,con,tg,loc_self,loc_op
e1:SetType(typ)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
if VgF.GetValueType(reset)=="number" then e1:SetReset(reset) end
if VgF.GetValueType(reset)=="number" then e1:SetReset(RESET_EVENT+RESETS_STANDARD+reset) end
if typ==EFFECT_TYPE_FIELD then e1:SetTargetRange(loc_self,loc_op) end
if VgF.GetValueType(con)=="function" then e1:SetCondition(con) end
if VgF.GetValueType(tg)=="function" then e1:SetTarget(tg) end
......@@ -1279,7 +1279,7 @@ function VgD.EffectTypeContinuousChangeDefense(c,m,typ,val,con,tg,loc_self,loc_o
e1:SetType(typ)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetRange(LOCATION_GZONE)
if VgF.GetValueType(reset)=="number" then e1:SetReset(reset) end
if VgF.GetValueType(reset)=="number" then e1:SetReset(RESET_EVENT+RESETS_STANDARD+reset) end
if typ==EFFECT_TYPE_FIELD then e1:SetTargetRange(loc_self,loc_op) end
if VgF.GetValueType(con)=="function" then e1:SetCondition(con) end
if VgF.GetValueType(tg)=="function" then e1:SetTarget(tg) end
......@@ -1297,7 +1297,7 @@ function VgD.EffectTypeContinuousChangeStar(c,m,typ,val,con,tg,loc_self,loc_op,r
e1:SetType(typ)
e1:SetCode(EFFECT_UPDATE_LSCALE)
e1:SetRange(LOCATION_MZONE)
if VgF.GetValueType(reset)=="number" then e1:SetReset(reset) end
if VgF.GetValueType(reset)=="number" then e1:SetReset(RESET_EVENT+RESETS_STANDARD+reset) end
if typ==EFFECT_TYPE_FIELD then e1:SetTargetRange(loc_self,loc_op) end
if VgF.GetValueType(con)=="function" then e1:SetCondition(con) end
if VgF.GetValueType(tg)=="function" then e1:SetTarget(tg) end
......@@ -1310,7 +1310,6 @@ end
function VgD.TriggerCountUp(c,m,num,reset,tc)
local cm=_G["c"..m]
if not cm.is_has_continuous and not reset then cm.is_has_continuous=true end
if not reset then reset=0 end
if tc then tc=VgF.ReturnCard(tc) else tc=c end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
......@@ -1320,7 +1319,7 @@ function VgD.TriggerCountUp(c,m,num,reset,tc)
e1:SetCondition(function (e,tp,eg,ep,ev,re,r,rp)
return VgF.ReturnCard(eg)==e:GetHandler()
end)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+reset)
if VgF.GetValueType(reset)=="number" then e1:SetReset(RESET_EVENT+RESETS_STANDARD+reset) end
e1:SetOperation(VgD.TriggerCountUpOperation(num))
tc:RegisterEffect(e1)
end
......@@ -1372,7 +1371,7 @@ function VgD.CannotBeTarget(c,m,con,val,loc)
end
function VgD.NightEffect(c,m)
local cm=_G["c"..m]
if not cm.is_has_continuous and not reset then cm.is_has_continuous=true end
if not cm.is_has_continuous then cm.is_has_continuous=true end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
......@@ -1387,7 +1386,7 @@ function VgD.NightEffect(c,m)
end
function VgD.DeepNightEffect(c,m)
local cm=_G["c"..m]
if not cm.is_has_continuous and not reset then cm.is_has_continuous=true end
if not cm.is_has_continuous then cm.is_has_continuous=true end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
......@@ -1402,4 +1401,64 @@ function VgD.DeepNightEffect(c,m)
end
function VgD.NightFilter(c)
return not c:IsSetCard(0x5040) and c:IsType(TYPE_CONTINUOUS)
end
function VgD.CallInPrison(c,m)
local cm=_G["c"..m]
if not cm.is_has_continuous then cm.is_has_continuous=true end
local e1=Effect.CreateEffect(c)
e1:SetDescription(VgF.Stringid(VgID,11))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC_G)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_BOTH_SIDE)
e1:SetRange(LOCATION_ORDER)
e1:SetCondition(VgD.CallInPrisonCondition(1))
e1:SetOperation(VgD.CallInPrisonOperation(1))
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetDescription(VgF.Stringid(VgID,12))
e2:SetCondition(VgD.CallInPrisonCondition(2))
e2:SetOperation(VgD.CallInPrisonOperation(2))
c:RegisterEffect(e2)
end
function VgD.CallInPrisonCondition(val)
return function (e,c,og)
local tp=1-e:GetHandlerPlayer()
local eg,ep,ev,re,r,rp
if Duel.GetTurnPlayer()==e:GetHandlerPlayer() then return false end
if val==1 then
return (VgF.OverlayCost(1)(e,tp,eg,ep,ev,re,r,rp,0) and VgF.IsExistingMatchingCard(VgD.CallInPrisonFilter,tp,LOCATION_HAND,0,1,nil,e,tp))
elseif val==2 then
return (VgF.DamageCost(1)(e,tp,eg,ep,ev,re,r,rp,0) and VgF.IsExistingMatchingCard(VgD.CallInPrisonFilter,tp,LOCATION_HAND,0,2,nil,e,tp))
end
end
end
function VgD.CallInPrisonOperation(val)
return function(e,p,eg,ep,ev,re,r,rp,c,sg,og)
local tp=1-p
if val==1 then
VgF.OverlayCost(1)(e,tp,eg,ep,ev,re,r,rp,1)
local g=VgF.SelectMatchingCard(HINTMSG_CALL,e,tp,VgD.CallInPrisonFilter,tp,0,LOCATION_ORDER,1,1,nil,e,tp)
if g:GetFirst():IsType(TYPE_MONSTER) then
VgF.Sendto(LOCATION_MZONE,g,0,tp)
else
VgF.Sendto(LOCATION_DROP,g,REASON_EFFECT)
end
sg=Group.CreateGroup()
elseif val==2 then
VgF.DamageCost(1)(e,tp,eg,ep,ev,re,r,rp,1)
local tg=VgF.SelectMatchingCard(HINTMSG_CALL,e,tp,VgD.CallInPrisonFilter,tp,0,LOCATION_ORDER,2,2,nil,e,tp)
local g=tg:Filter(Card.IsType,nil,TYPE_MONSTER)
if g:GetCount()>0 then
VgF.Sendto(LOCATION_MZONE,g,0,tp)
tg:Sub(g)
end
if tg:GetCount()>0 then
VgF.Sendto(LOCATION_DROP,tg,REASON_EFFECT)
end
sg=Group.CreateGroup()
end
end
end
function VgD.CallInPrisonFilter(c,e,tp)
return c:GetFlagEffect(FLAG_IMPRISON)>0 and (vgf.IsCanBeCalled(c,e,tp) or not c:IsType(TYPE_MONSTER))
end
\ No newline at end of file
......@@ -153,6 +153,7 @@ SUMMON_TYPE_LINK =0x4c000000 --连接召唤
--Summon Value --特定的召唤方式
SUMMON_VALUE_CALL =0x1 --通常CALL出场
SUMMON_VALUE_REVOLT =0x2 --反抗舞装
SUMMON_VALUE_OverDress =0x4 --超限舞装
SUMMON_VALUE_DARK_SANCTUARY =0x12 --暗黑圣域
SUMMON_VALUE_MONSTER_REBORN =0x13 --死者苏生(千年的启示)
SUMMON_VALUE_MASK_CHANGE =0x14 --
......@@ -729,7 +730,7 @@ OPCODE_ISATTRIBUTE =0x40000104
DOUBLE_DAMAGE =-2147483648
HALF_DAMAGE =-2147483647
--Hint Message --提示消息,显示在窗口的上面
HINTMSG_LEAVEONFIELD =500 --请选择要退场的卡
HINTMSG_LEAVEFIELD =500 --请选择要退场的卡
HINTMSG_DISCARD =501 --请选择要丢弃的手牌
HINTMSG_IMPRISON =502 --请选择要收容的卡
HINTMSG_REMOVE =503 --请选择要除外的卡
......
......@@ -312,13 +312,12 @@ end
---@param zone integer|nil 指示要Call到的格子。<br>前列的R:17; 后列的R:14; 全部的R:31; V:32
---@param pos integer|nil 表示形式
---@return integer Call成功的数量
function VgF.Call(g,sumtype,tp,zone,pos,chk)
function VgF.Call(g,sumtype,tp,zone,pos)
if (VgF.GetValueType(g)~="Card" and VgF.GetValueType(g)~="Group") or (VgF.GetValueType(g)=="Group" and g:GetCount()==0) then return 0 end
if VgF.GetValueType(pos)~="number" then pos=POS_FACEUP_ATTACK end
if chk==0 then
if VgF.GetValueType(zone)=="string" and zone=="NoMonster" then
return Duel.SpecialSummon(g,sumtype,tp,tp,false,false,pos)
end
if zone and zone>0 then
elseif VgF.GetValueType(zone)=="number" and zone>0 then
local sc=VgF.ReturnCard(g)
local z=VgF.GetAvailableLocation(tp,zone)
local ct=bit.ReturnCount(z)
......@@ -334,7 +333,7 @@ function VgF.Call(g,sumtype,tp,zone,pos,chk)
if szone==0x20 and Duel.GetMatchingGroupCount(VgF.VMonsterFilter,tp,LOCATION_MZONE,0,nil)>0 then
if VgF.VMonsterFilter(sc:GetOverlayTarget()) then
VgF.Sendto(0,sc,tp,POS_FACEUP,REASON_EFFECT)
local _,code=c:GetOriginalCode()
local _,code=sc:GetOriginalCode()
sc=Duel.CreateToken(tp,code)
end
local tc=Duel.GetMatchingGroup(VgF.VMonsterFilter,tp,LOCATION_MZONE,0,nil):GetFirst()
......@@ -346,7 +345,9 @@ function VgF.Call(g,sumtype,tp,zone,pos,chk)
VgF.Sendto(LOCATION_OVERLAY,Group.FromCards(tc),sc)
elseif VgF.IsExistingMatchingCard(VgD.CallFilter,tp,LOCATION_MZONE,0,1,nil,tp,szone) then
local tc=Duel.GetMatchingGroup(VgD.CallFilter,tp,LOCATION_MZONE,0,nil,tp,szone):GetFirst()
VgF.Sendto(LOCATION_DROP,tc,REASON_COST)
if bit.band(sumtype,SUMMON_VALUE_OverDress)>0 then VgF.Sendto(LOCATION_OVERLAY,Group.FromCards(tc),sc)
else VgF.Sendto(LOCATION_DROP,tc,REASON_COST)
end
end
return Duel.SpecialSummon(sc,sumtype,tp,tp,false,false,pos,szone)
else
......@@ -669,6 +670,37 @@ function VgF.DamageCost(val)
return Duel.GetOperatedGroup():GetCount()
end
end
function VgF.LeaveFieldCost(card_or_code_or_func,val_max,val_min,...)
local ext_params={...}
if VgF.GetValueType(val_max)~="number" then val_max=1 end
if VgF.GetValueType(val_min)~="number" or val_min>val_max then val_min=val_max end
return function (e,tp,eg,ep,ev,re,r,rp,chk)
local filter=VgF.True
if VgF.GetValueType(card_or_code_or_func)=="function" then filter=card_or_code_or_func
elseif VgF.GetValueType(card_or_code_or_func)=="number" then
filter=function (tc)
return tc:IsCode(card_or_code_or_func)
end
elseif VgF.GetValueType(card_or_code_or_func)=="Card" then
if chk==0 then return card_or_code_or_func:IsAbleToGraveAsCost() end
VgF.Sendto(LOCATION_DROP,card_or_code_or_func,REASON_COST)
elseif VgF.GetValueType(card_or_code_or_func)=="Group" then
if chk==0 then return not card_or_code_or_func:IsExists(function (tc)
return not tc:IsAbleToGraveAsCost()
end,1,nil) end
VgF.Sendto(LOCATION_DROP,card_or_code_or_func,REASON_COST)
end
if chk==0 then
return VgF.IsExistingMatchingCard(function (tc)
return filter(tc,table.unpack(ext_params)) and tc:IsAbleToGraveAsCost()
end,tp,LOCATION_MZONE,0,val_min,nil)
end
local g=vgf.SelectMatchingCard(HINTMSG_LEAVEFIELD,e,tp,function (tc)
return filter(tc,table.unpack(ext_params)) and tc:IsAbleToGraveAsCost()
end,tp,LOCATION_MZONE,0,val_min,val_max,nil)
VgF.Sendto(LOCATION_DROP,g,REASON_COST)
end
end
function VgF.IsCanBeCalled(c,e,tp,sumtype,pos,zone)
if VgF.GetValueType(zone)~="number" then zone=VgF.GetAvailableLocation(tp) end
if VgF.GetValueType(sumtype)~="number" then sumtype=0 end
......
......@@ -14,7 +14,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if vgf.GetMatchingGroup(vgf.VMonsterFilter,tp,LOCATION_MZONE,0,nil,nil):GetFirst():GetOverlayCount()>=2 and Duel.SelectEffectYesNo(tp,vgf.stringid(VgID,10)) then
local cg=vgf.GetMatchingGroup(vgf.VMonsterFilter,tp,LOCATION_MZONE,0,nil):GetFirst():GetOverlayGroup():Select(tp,2,2,nil)
if vgf.Sendto(LOCATION_DROP,cg,REASON_COST)==2 then
local g=vgf.SelectMatchingCard(HINTMSG_LEAVEONFIELD,e,tp,vgf.RMonsterFilter,tp,0,LOCATION_MZONE,1,1,nil)
local g=vgf.SelectMatchingCard(HINTMSG_LEAVEFIELD,e,tp,vgf.RMonsterFilter,tp,0,LOCATION_MZONE,1,1,nil)
vgf.Sendto(LOCATION_DROP,g,REASON_EFFECT)
end
end
......
......@@ -2,8 +2,8 @@ local cm,m,o=GetID()
function cm.initial_effect(c)
vgf.VgCard(c)
vgd.ContinuousSpell(c)
vgd.EffectTypeTrigger(c,m,loc,EFFECT_TYPE_SINGLE,EVENT_MOVE,vgf.OverlayFill(3),cost,cm.con)
vgd.EffectTypeTrigger(c,m,LOCATION_ORDER,EFFECT_TYPE_FIELD,EVENT_SPSUMMON_SUCCESS,cm.op1,cm.cost1,cm.con1,tg,count,EFFECT_FLAG_BOTH_SIDE)
vgd.EffectTypeTrigger(c,m,loc,EFFECT_TYPE_SINGLE,EVENT_MOVE,vgf.OverlayFill(3),nil,cm.con)
VgD.CallInPrison(c,m)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return vgf.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil) end
......@@ -16,51 +16,3 @@ end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_ORDER)
end
function cm.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
local a=vgf.GetMatchingGroup(vgf.VMonsterFilter,tp,LOCATION_MZONE,0,nil,nil):GetFirst():GetOverlayCount()>=1
local b=vgf.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_DAMAGE,0,1,nil)
if chk==0 then return a or b end
local off=1
local ops={}
if a then
ops[off]=vgf.Stringid(VgID,11)
off=off+1
end
if b then
ops[off]=vgf.Stringid(VgID,12)
off=off+1
end
local sel=Duel.SelectOption(tp,table.unpack(ops))
if sel==0 and a then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVEXYZ)
local g=vgf.GetMatchingGroup(vgf.VMonsterFilter,tp,LOCATION_MZONE,0,nil):GetFirst():GetOverlayGroup():Select(tp,1,1,nil)
vgf.Sendto(LOCATION_DROP,g,REASON_COST)
e:SetLabel(1)
else
local g=vgf.SelectMatchingCard(HINTMSG_DAMAGE,e,tp,Card.IsFaceup,tp,LOCATION_DAMAGE,0,num,num,nil)
Duel.ChangePosition(g,POS_FACEDOWN_ATTACK)
e:SetLabel(2)
end
end
function cm.con1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.filter,1,nil,e) and eg:GetCount()==1
end
function cm.filter(c,e)
return c:IsSummonType(SUMMON_VALUE_CALL) and c:GetControler()~=e:GetHandler():GetControler()
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local zone=vgf.GetAvailableLocation(tp)
local ct=bit.ReturnCount(zone)
if ct>e:GetLabel() then ct=e:GetLabel() end
local g=vgf.SelectMatchingCard(HINTMSG_CALL,e,tp,cm.filter1,tp,0,LOCATION_ORDER,ct,ct,nil,e,tp)
for tc in vgf.Next(g) do
if vgf.IsCanBeCalled(tc,e,tp) then
vgf.Sendto(LOCATION_MZONE,tc,0,tp)
else
vgf.Sendto(LOCATION_DROP,tc,REASON_EFFECT)
end
end
end
function cm.filter1(c,e,tp)
return c:GetFlagEffect(FLAG_IMPRISON)>0 and (vgf.IsCanBeCalled(c,e,tp) or not c:IsType(TYPE_MONSTER))
end
\ No newline at end of file
local cm,m,o=GetID()
function cm.initial_effect(c)
vgf.VgCard(c)
vgd.EffectTypeTrigger(c,m,LOCATION_MZONE,EFFECT_TYPE_SINGLE,EVENT_ATTACK_ANNOUNCE,cm.operation,vgf.OverlayCost(1),cm.condition)
vgd.EffectTypeTrigger(c,m,LOCATION_MZONE,EFFECT_TYPE_SINGLE,EVENT_ATTACK_ANNOUNCE,cm.operation,vgf.OverlayCost(1),vgf.VMonsterCondition)
vgd.EffectTypeTrigger(c,m,LOCATION_MZONE,EFFECT_TYPE_SINGLE,EVENT_BATTLED,cm.operation1,nil,cm.condition1)
vgd.GlobalCheckEffect(c,m,EVENT_SPSUMMON_SUCCESS,cm.checkcon)
end
function cm.checkcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsSummonType,1,nil,SUMMON_TYPE_SELFRIDE)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return vgf.VMonsterFilter(c)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=vgf.SelectMatchingCard(HINTMSG_RTOHAND,e,tp,cm.filter,tp,LOCATION_MZONE,0,1,2,nil)
......@@ -21,8 +17,7 @@ function cm.filter(c)
return vgf.RMonsterFilter(c)
end
function cm.condition1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return Duel.GetFlagEffect(tp,m)>0
return Duel.GetFlagEffect(tp,m)>0 and vgf.VMonsterCondition(e) and Duel.GetAttacker()==e:GetHandler()
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -7,7 +7,7 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=vgf.SelectMatchingCard(HINTMSG_VMONSTER,e,tp,vgf.VMonsterFilter,tp,LOCATION_MZONE,0,1,1,nil)
vgd.EffectTypeContinuousChangeAttack(c,m,EFFECT_TYPE_FIELD,5000,nil,cm.tg,LOCATION_MZONE,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,g:GetFirst())
vgd.EffectTypeContinuousChangeAttack(c,m,EFFECT_TYPE_FIELD,5000,nil,cm.tg,LOCATION_MZONE,0,RESET_PHASE+PHASE_END,g:GetFirst())
end
function cm.tg(e,c)
return vgf.RMonsterFilter(c)
......
......@@ -15,7 +15,7 @@ function cm.filter(c)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=vgf.SelectMatchingCard(HINTMSG_LEAVEONFIELD,e,tp,vgf.VMonsterFilter,tp,0,LOCATION_MZONE,1,1,nil)
local g=vgf.SelectMatchingCard(HINTMSG_LEAVEFIELD,e,tp,vgf.VMonsterFilter,tp,0,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then vgf.Sendto(LOCATION_DROP,g,REASON_EFFECT) end
if c:IsRelateToEffect(e) and c:IsFaceup() then
vgf.AtkUp(c,c,10000)
......
......@@ -17,6 +17,6 @@ function cm.con1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,m)>0 and cm.con(e,tp,eg,ep,ev,re,r,rp)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local g=vgf.SelectMatchingCard(HINTMSG_LEAVEONFIELD,e,tp,vgf.RMonsterFilter,tp,0,LOCATION_MZONE,1,1,nil)
local g=vgf.SelectMatchingCard(HINTMSG_LEAVEFIELD,e,tp,vgf.RMonsterFilter,tp,0,LOCATION_MZONE,1,1,nil)
vgf.Sendto(LOCATION_DROP,g,REASON_EFFECT)
end
\ No newline at end of file
......@@ -8,7 +8,7 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
vgf.OverlayFill(1)(e,tp,eg,ep,ev,re,r,rp)
local g=vgf.SelectMatchingCard(HINTMSG_LEAVEONFIELD,e,tp,vgf.RMonsterFilter,tp,0,LOCATION_MZONE,1,1,nil)
local g=vgf.SelectMatchingCard(HINTMSG_LEAVEFIELD,e,tp,vgf.RMonsterFilter,tp,0,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then
vgf.Sendto(LOCATION_DROP,g,REASON_EFFECT)
end
......
......@@ -14,7 +14,7 @@ end
--选择对手的1张等级2以上的后防者
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=vgf.SelectMatchingCard(HINTMSG_LEAVEONFIELD,e,tp,cm.filter,tp,0,LOCATION_MZONE,1,1,nil)
local g=vgf.SelectMatchingCard(HINTMSG_LEAVEFIELD,e,tp,cm.filter,tp,0,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then
vgf.Sendto(LOCATION_DROP,g,REASON_EFFECT)
end
......
......@@ -9,7 +9,7 @@ function cm.con(e,tp,eg,ep,ev,re,r,rp)
and vgf.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local g=vgf.SelectMatchingCard(HINTMSG_LEAVEONFIELD,e,tp,vgf.RMonsterFilter,tp,0,LOCATION_MZONE,1,1,nil)
local g=vgf.SelectMatchingCard(HINTMSG_LEAVEFIELD,e,tp,vgf.RMonsterFilter,tp,0,LOCATION_MZONE,1,1,nil)
vgf.Sendto(LOCATION_DROP,g,REASON_EFFECT)
end
function cm.filter(c)
......
......@@ -5,7 +5,7 @@ function cm.initial_effect(c)
vgd.EffectTypeTrigger(c,m,LOCATION_MZONE,EFFECT_TYPE_FIELD,EVENT_TO_GRAVE,cm.op,cm.cost,cm.con)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local g=vgf.SelectMatchingCard(HINTMSG_LEAVEONFIELD,e,tp,vgf.RMonsterFilter,tp,0,LOCATION_MZONE,1,1,nil)
local g=vgf.SelectMatchingCard(HINTMSG_LEAVEFIELD,e,tp,vgf.RMonsterFilter,tp,0,LOCATION_MZONE,1,1,nil)
vgf.Sendto(LOCATION_DROP,g,REASON_EFFECT)
end
function cm.filter(c,tp)
......
......@@ -25,7 +25,7 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
local ct1=vgf.GetMatchingGroupCount(nil,tp,0,LOCATION_MZONE,nil)
if ct>ct1 then ct=ct1 end
if ct==0 then return end
local g=vgf.SelectMatchingCard(HINTMSG_LEAVEONFIELD,e,tp,nil,tp,0,LOCATION_MZONE,1,ct,nil)
local g=vgf.SelectMatchingCard(HINTMSG_LEAVEFIELD,e,tp,nil,tp,0,LOCATION_MZONE,1,ct,nil)
if g:GetCount()>0 then
vgf.Sendto(LOCATION_DROP,g,REASON_EFFECT)
end
......
......@@ -14,7 +14,7 @@ function cm.initial_effect(c)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return vgf.IsExistingMatchingCard(vgf.RMonsterFilter,tp,LOCATION_MZONE,0,2,nil) end
local g=vgf.SelectMatchingCard(HINTMSG_LEAVEONFIELD,e,tp,vgf.RMonsterFilter,tp,LOCATION_MZONE,0,2,2,nil)
local g=vgf.SelectMatchingCard(HINTMSG_LEAVEFIELD,e,tp,vgf.RMonsterFilter,tp,LOCATION_MZONE,0,2,2,nil)
vgf.Sendto(LOCATION_DROP,g,REASON_COST)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
......
local cm,m,o=GetID()
function cm.initial_effect(c)
vgf.VgCard(c)
cm.is_has_continuous=true
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,1)
e1:SetValue(function (e,re,tp)
return re:IsHasCategory(CATEGORY_DEFENDER) and re:GetHandler():IsLocation(LOCATION_HAND)
end)
e1:SetCondition(function (e)
return Duel.GetAttacker()==e:GetHandler() and vgf.RMonsterFilter(Duel.GetAttackTarget())
end)
c:RegisterEffect(e1)
vgd.EffectTypeTriggerWhenHitting(c,m,LOCATION_MZONE,EFFECT_TYPE_SINGLE,cm.op,cm.cost,nil,nil,1)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
Duel.ChangePosition(c,POS_FACEUP_ATTACK)
vgd.TriggerCountUp(c,m,-1,RESET_PHASE+PHASE_END)
end
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return vgf.DamageCost(1)(e,tp,eg,ep,ev,re,r,rp,chk) and vgf.DisCardCost(1)(e,tp,eg,ep,ev,re,r,rp,chk) end
vgf.DamageCost(1)(e,tp,eg,ep,ev,re,r,rp,chk)
vgf.DisCardCost(1)(e,tp,eg,ep,ev,re,r,rp,chk)
end
\ No newline at end of file
local cm,m,o=GetID()
function cm.initial_effect(c)
vgf.VgCard(c)
vgd.OverDress(c,10101009)
vgd.EffectTypeTrigger(c,m,LOCATION_HAND,EFFECT_TYPE_FIELD,EVENT_BATTLED,cm.op,vgf.OverlayCost(2),cm.con)
vgd.EffectTypeContinuousChangeAttack(c,m,EFFECT_TYPE_SINGLE,10000,cm.con2)
vgd.EffectTypeContinuousChangeDefense(c,m,EFFECT_TYPE_SINGLE,10000,cm.con2)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=vgf.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,0,nil)
if c:IsRelateToEffect(e) or not c:IsFaceup() then
if g:GetCount()>1 then
g=g:Select(tp,1,1,nil)
end
if g:GetCount()>0 then
vgf.Sendto(LOCATION_MZONE,c,SUMMON_VALUE_OverDress,tp,vgf.SequenceToGlobal(tp,g:GetFirst():GetLocation(),g:GetFirst():GetSequence()))
end
end
vgf.OverlayFill(1)(e,tp,eg,ep,ev,re,r,rp)
end
function cm.filter(c)
return c:IsCode(10101009) and vgf.RMonsterFilter(c)
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsCode(10101009) and vgf.GetVMonster(tp):IsCode(10101001)
end
function cm.con2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetFlagEffectLabel(FLAG_CONDITION)==201 and (vgf.RMonsterCondition(e) or not c:IsLocation(LOCATION_MZONE))
end
\ No newline at end of file
local cm,m,o=GetID()
function cm.initial_effect(c)
vgf.VgCard(c)
vgd.EffectTypeTrigger(c,m,cm,LOCATION_MZONE,EFFECT_TYPE_SINGLE,EVENT_ATTACK_ANNOUNCE,vgf.OverlayFill(1),nil,cm.con)
vgd.EffectTypeIgnition(c,m,LOCATION_OVERLAY,cm.op,cm.cost)
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return vgf.VMonsterFilter(Duel.GetAttackTarget())
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return vgf.DamageCost(1)(e,tp,eg,ep,ev,re,r,rp,chk) and e:GetHandler():IsAbleToGraveAsCost() end
vgf.DamageCost(1)(e,tp,eg,ep,ev,re,r,rp,chk)
vgf.Sendto(LOCATION_GRAVE,e:GetHandler(),REASON_COST)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=vgf.SelectMatchingCard(HINTMSG_ATKUP,e,tp,vgf.VMonsterFilter,tp,LOCATION_MZONE,0,1,1,nil)
vgf.AtkUp(c,g,10000)
end
\ No newline at end of file
local cm,m,o=GetID()
function cm.initial_effect(c)
vgf.VgCard(c)
vgd.EffectTypeTriggerWhenHitting(c,m,LOCATION_MZONE,EFFECT_TYPE_SINGLE,cm.op,nil,cm.con)
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return vgf.RMonsterCondition(e) and vgf.GetVMonster(tp):IsCode(10102001)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local g=vgf.SelectMatchingCard(HINTMSG_CALL,e,tp,cm.filter,tp,LOCATION_OVERLAY,0,0,1,nil,e,tp)
vgf.Sendto(LOCATION_MZONE,g,0,tp,"NoMonster")
end
function cm.filter(c,e,tp)
return vgf.IsCanBeCalled(c,e,tp)
end
\ No newline at end of file
local cm,m,o=GetID()
function cm.initial_effect(c)
vgf.VgCard(c)
vgd.EffectTypeContinuousChangeAttack(c,m,EFFECT_TYPE_SINGLE,cm.val,vgf.RMonsterCondition)
vgd.EffectTypeTrigger(c,m,LOCATION_MZONE,EFFECT_TYPE_SINGLE,EVENT_BATTLED,cm.op,vgf.LeaveFieldCost(10000001),cm.con)
end
function cm.val(e)
local tp=e:GetHandlerPlayer()
local val=0
if Duel.IsPlayerAffectedByEffect(tp,AFFECT_CODE_NIGHT) then val=2000
elseif Duel.IsPlayerAffectedByEffect(tp,AFFECT_CODE_DEEP_NIGHT) then val=5000
end
return val
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return vgf.RMonsterCondition(e) and Duel.GetAttacker()==e:GetHandler()
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local g=vgf.SelectMatchingCard(HINTMSG_LEAVEONFIELD,e,tp,vgf.RMonsterFilter,tp,0,LOCATION_MZONE,0,1,nil)
vgf.Sendto(LOCATION_DROP,g,REASON_EFFECT)
end
\ No newline at end of file
......@@ -16,7 +16,7 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CALL)
local sg=g:FilterSelect(tp,cm.filter,0,2,nil,e,tp)
if #sg>0 then
vgf.Sendto(LOCATION_MZONE,sg,0,tp,31,POS_FACEUP_ATTACK,0)
vgf.Sendto(LOCATION_MZONE,sg,0,tp,"NoMonster")
end
Duel.ShuffleDeck(tp)
end
......
......@@ -9,7 +9,7 @@ end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and vgf.IsCanBeCalled(c,e,tp) then
vgf.Sendto(LOCATION_MZONE,c,0,tp,nil,nil,0)
vgf.Sendto(LOCATION_MZONE,c,0,tp,"NoMonster")
end
end
......
......@@ -27,7 +27,7 @@ end
--效果二处理
function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=vgf.SelectMatchingCard(HINTMSG_LEAVEONFIELD,e,tp,vgf.RMonsterFilter,tp,0,LOCATION_MZONE,1,1,nil)
local g=vgf.SelectMatchingCard(HINTMSG_LEAVEFIELD,e,tp,vgf.RMonsterFilter,tp,0,LOCATION_MZONE,1,1,nil)
vgf.Sendto(LOCATION_DROP,g,REASON_EFFECT)
if c:IsRelateToEffect(e) and c:IsFaceup() then
vgf.AtkUp(c,c,5000)
......
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