Commit 6208d785 authored by jwyxym's avatar jwyxym Committed by GitHub

Add files via upload

parent b8f3f183
......@@ -460,7 +460,7 @@ function VgD.SendToGCost(e,tp,eg,ep,ev,re,r,rp,chk)
if c:IsLocation(LOCATION_MZONE) then
if chk==0 then return true end
else
if chk==0 then return (not Duel.IsPlayerAffectedByEffect(tp,OAFFECT_CODE_SENDTOG) or Duel.IsExistingMatchingCard(nil,tp,LOCATION_GZONE,0,1,nil) or Duel.IsExistingMatchingCard(VgF.IsAbleToGZone,tp,LOCATION_HAND,0,1,c)) end
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,OAFFECT_CODE_SENDTOG) or Duel.IsExistingMatchingCard(nil,tp,LOCATION_GZONE,0,1,nil) or Duel.IsExistingMatchingCard(VgF.IsAbleToGZone,tp,LOCATION_HAND,0,1,c) end
if Duel.IsPlayerAffectedByEffect(tp,OAFFECT_CODE_SENDTOG) and not Duel.IsExistingMatchingCard(nil,tp,LOCATION_GZONE,0,1,nil) then
local tc=Duel.SelectMatchingCard(tp,VgF.IsAbleToGZone,tp,LOCATION_HAND,0,1,1,c)
tc=VgF.ReturnCard(tc)
......@@ -1020,27 +1020,30 @@ function VgD.EffectTypeContinuousChangeAttack(c,typ,val,con,tg,mc,code,reset,loc
e1:SetValue(val)
mc:RegisterEffect(e1)
end
function VgD.TriggerCountUp(c,num,reset)
function VgD.TriggerCountUp(c,num,reset,tc)
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)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_CUSTOM+EVENT_TRIGGERCOUNTUP)
e1:SetProperty(EFFECT_FLAG_DELAY)
if reset and reset>0 then e1:SetReset(reset) end
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)
e1:SetOperation(VgD.TriggerCountUpOperation(num))
c:RegisterEffect(e1)
tc:RegisterEffect(e1)
end
function VgD.TriggerCountUpOperation(num)
return function (e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local label=c:GetFlagEffectLabel(AttackTriggerFlag)
if label and label>0 then
label=label+num
if label<0 then label=0 end
c:ResetFlagEffect(AttackTriggerFlag)
c:RegisterFlagEffect(AttackTriggerFlag,RESET_EVENT+RESETS_STANDARD,0,1,label)
else
c:RegisterFlagEffect(AttackTriggerFlag,RESET_EVENT+RESETS_STANDARD,0,1,num)
end
if not label then label=0 end
label=label+num
Debug.Message(label)
if label<0 then label=0 end
c:ResetFlagEffect(AttackTriggerFlag)
c:RegisterFlagEffect(AttackTriggerFlag,RESET_EVENT+RESETS_STANDARD,0,1,label)
end
end
\ No newline at end of file
......@@ -309,9 +309,10 @@ end
---@param pos integer 表示形式
---@return integer Call成功的数量
function VgF.Call(g,sumtype,tp,zone,pos)
if not g then return 0 end
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 zone and zone>0 then
local sc=VgF.ReturnCard(g)
local z=VgF.GetAvailableLocation(tp,zone)
local ct=bit.ReturnCount(z)
local szone
......@@ -323,11 +324,19 @@ function VgF.Call(g,sumtype,tp,zone,pos)
else
szone=z
end
if Duel.IsExistingMatchingCard(VgD.CallFilter,tp,LOCATION_MZONE,0,1,nil,tp,szone) then
if szone==0x20 and Duel.GetMatchingGroupCount(VgF.VMonsterFilter,tp,LOCATION_MZONE,0,nil)>0 then
local tc=Duel.GetMatchingGroup(VgF.VMonsterFilter,tp,LOCATION_MZONE,0,nil):GetFirst()
local mg=tc:GetOverlayGroup()
if mg:GetCount()~=0 then
Duel.Overlay(sc,mg)
end
sc:SetMaterial(Group.FromCards(tc))
Duel.Overlay(sc,Group.FromCards(tc))
elseif Duel.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()
Duel.SendtoGrave(tc,REASON_COST)
end
return Duel.SpecialSummon(g,sumtype,tp,tp,false,false,pos,szone)
return Duel.SpecialSummon(sc,sumtype,tp,tp,false,false,pos,szone)
else
local sg
local z=bit.bnot(VgF.GetAvailableLocation(tp))
......@@ -478,10 +487,8 @@ end
---@return boolean 指示c能否去到G区域。
function VgF.IsAbleToGZone(c)
local tp=c:GetControler()
if c:IsLocation(LOCATION_MZONE) and c:IsFaceup() then
return c:IsAttribute(SKILL_BLOCK) and VgF.IsSequence(c,0,4) and not Duel.IsPlayerAffectedByEffect(tp,AFFECT_CODE_SENDTOG_MZONE)
end
return c:IsLocation(LOCATION_HAND)
return (c:IsAttribute(SKILL_BLOCK) and VgF.IsSequence(c,0,4) and not Duel.IsPlayerAffectedByEffect(tp,AFFECT_CODE_SENDTOG_MZONE) and c:IsLocation(LOCATION_MZONE) and c:IsFaceup())
or c:IsLocation(LOCATION_HAND)
end
---用于效果的Cost。它返回一个执行“【费用】[将手牌中的num张卡舍弃]”的函数。
---@param num integer 要舍弃的卡的数量
......
......@@ -24,7 +24,8 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CALL)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if vgf.Call(g,SUMMON_VALUE_REVOLT,tp,0x20)>0 then
vgd.TriggerCountUp(c,-2,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
local mg=Duel.GetOperatedGroup()
vgd.TriggerCountUp(c,-2,RESET_PHASE+PHASE_END,mg)
end
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -31,6 +31,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.DisableShuffleCheck()
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleHand(tp)
g:RemoveCard(vgf.ReturnCard(sg))
elseif (sel==1 and a and b) or (sel==0 and not a and b) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CALL)
......
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