Commit 52029053 authored by jwyxym's avatar jwyxym Committed by GitHub

Add files via upload

parent 7964230f
...@@ -25,7 +25,7 @@ function VgD.RideUpFilter1(c,e,lv,code,rc) ...@@ -25,7 +25,7 @@ function VgD.RideUpFilter1(c,e,lv,code,rc)
if rc:IsAttribute(SKILL_SELF_RIDE) and c:IsCode(code) then if rc:IsAttribute(SKILL_SELF_RIDE) and c:IsCode(code) then
return false return false
end end
return ((c:IsLevel(lv,lv+1) and c:IsLocation(LOCATION_HAND)) or (c:IsLevel(lv+1) and c:IsLocation(LOCATION_RIDE))) and c:IsType(TYPE_MONSTER) and Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,c) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RIDE,tp,false,false,POS_FACEUP_ATTACK) return ((c:IsLevel(lv,lv+1) and c:IsLocation(LOCATION_HAND)) or (c:IsLevel(lv+1) and c:IsLocation(LOCATION_RIDE) and Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil))) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RIDE,tp,false,false,POS_FACEUP_ATTACK)
end end
function VgD.DisCardRideUpFilter(c,e,lv,code,rc) function VgD.DisCardRideUpFilter(c,e,lv,code,rc)
local tp=c:GetControler() local tp=c:GetControler()
...@@ -68,12 +68,14 @@ function VgD.RideUpOperation(e,tp,eg,ep,ev,re,r,rp) ...@@ -68,12 +68,14 @@ function VgD.RideUpOperation(e,tp,eg,ep,ev,re,r,rp)
ops[off]=VgF.Stringid(VgID,5) ops[off]=VgF.Stringid(VgID,5)
local sel=Duel.SelectOption(tp,table.unpack(ops)) local sel=Duel.SelectOption(tp,table.unpack(ops))
if sel==0 and a then if sel==0 and a then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,VgD.DisCardRideUpFilter,tp,LOCATION_HAND,0,1,1,nil,e,lv,code,rc)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CALL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CALL)
local sg=rg1:FilterSelect(tp,Card.IsLocation,1,1,nil,LOCATION_HAND+LOCATION_RIDE) local sg=rg1:FilterSelect(tp,Card.IsLocation,1,1,nil,LOCATION_HAND+LOCATION_RIDE)
local sc=sg:GetFirst() local sc=sg:GetFirst()
if sc:IsLocation(LOCATION_EXTRA) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,VgD.DisCardRideUpFilter,tp,LOCATION_HAND,0,1,1,nil,e,lv,code,rc)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
end
local mg=rc:GetOverlayGroup() local mg=rc:GetOverlayGroup()
if mg:GetCount()~=0 then if mg:GetCount()~=0 then
Duel.Overlay(sc,mg) Duel.Overlay(sc,mg)
...@@ -140,7 +142,28 @@ function VgD.CallToR(c) ...@@ -140,7 +142,28 @@ function VgD.CallToR(c)
e1:SetCondition(VgD.CallCondition) e1:SetCondition(VgD.CallCondition)
e1:SetOperation(VgD.CallOperation) e1:SetOperation(VgD.CallOperation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
if c:IsSetCard(0x201) then end
function VgD.CallCondition(e,c)
if c==nil then return true end
local tp=e:GetHandlerPlayer()
return VgF.LvCondition(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK)
end
function VgD.CallFilter(c,tp,zone)
return VgF.RMonsterFilter(c) and zone==VgF.SequenceToGlobal(tp,c:GetLocation(),c:GetSequence())
end
function VgD.CallOperation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CallZONE)
local zone=Duel.SelectField(tp,1,LOCATION_MZONE,0,0xe0)
if Duel.IsExistingMatchingCard(VgD.CallFilter,tp,LOCATION_MZONE,0,1,nil,tp,zone) then
local tc=Duel.GetMatchingGroup(VgD.CallFilter,tp,LOCATION_MZONE,0,nil,tp,zone):GetFirst()
Duel.SendtoGrave(tc,REASON_COST)
end
e:SetValue(function () return 0,zone end)
end
--超限舞装
function VgD.OverArm(c,f)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(VgF.Stringid(VgID,9)) e2:SetDescription(VgF.Stringid(VgID,9))
e2:SetType(EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_FIELD)
...@@ -148,8 +171,8 @@ function VgD.CallToR(c) ...@@ -148,8 +171,8 @@ function VgD.CallToR(c)
e2:SetRange(LOCATION_HAND) e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_SPSUM_PARAM) e2:SetProperty(EFFECT_FLAG_SPSUM_PARAM)
e2:SetTargetRange(POS_FACEUP_ATTACK,0) e2:SetTargetRange(POS_FACEUP_ATTACK,0)
e2:SetCondition(VgD.OverArmCondition) e2:SetCondition(VgD.OverArmCondition(f))
e2:SetOperation(VgD.OverArmOperation) e2:SetOperation(VgD.OverArmOperation(f))
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
...@@ -157,14 +180,15 @@ function VgD.CallToR(c) ...@@ -157,14 +180,15 @@ function VgD.CallToR(c)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetOperation(VgD.OverArmSum) e3:SetOperation(VgD.OverArmSum)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end
end end
function VgD.OverArmCondition(e,c) function VgD.OverArmCondition(f)
return function (e,c)
if c==nil then return true end if c==nil then return true end
local tp=e:GetHandlerPlayer() local tp=e:GetHandlerPlayer()
return VgF.LvCondition(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK) and Duel.IsExistingMatchingCard(VgD.OverArmFilter,tp,LOCATION_MZONE,0,1,nil,e:GetHandler()) return VgF.LvCondition(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK) and Duel.IsExistingMatchingCard(VgD.OverArmFilter,tp,LOCATION_MZONE,0,1,nil,f)
end
end end
function VgD.OverArmFilter(c,mc,zone) function VgD.OverArmFilter(c,f,zone)
local seq local seq
if zone and zone>0 then if zone and zone>0 then
if zone==0x1 then seq=0 end if zone==0x1 then seq=0 end
...@@ -174,11 +198,12 @@ function VgD.OverArmFilter(c,mc,zone) ...@@ -174,11 +198,12 @@ function VgD.OverArmFilter(c,mc,zone)
if zone==0x10 then seq=4 end if zone==0x10 then seq=4 end
if not VgF.IsSequence(c,seq) then return false end if not VgF.IsSequence(c,seq) then return false end
end end
return VgF.IsCodeListed(mc,c:GetOriginalCode()) return (VgF.GetValueType(f)=="function" and f(c)) or (VgF.GetValueType(f)=="number" and c:IsCode(f))
end end
function VgD.OverArmOperation(e,tp,eg,ep,ev,re,r,rp) function VgD.OverArmOperation(f)
return function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local g=Duel.GetMatchingGroup(VgD.OverArmFilter,tp,LOCATION_MZONE,0,nil,c,code) local g=Duel.GetMatchingGroup(VgD.OverArmFilter,tp,LOCATION_MZONE,0,nil,f,code)
local szone local szone
if Duel.GetTurnPlayer()==tp and tp==1 then if Duel.GetTurnPlayer()==tp and tp==1 then
local zone=0xff local zone=0xff
...@@ -203,7 +228,7 @@ function VgD.OverArmOperation(e,tp,eg,ep,ev,re,r,rp) ...@@ -203,7 +228,7 @@ function VgD.OverArmOperation(e,tp,eg,ep,ev,re,r,rp)
szone=Duel.SelectField(tp,1,LOCATION_MZONE,0,zone) szone=Duel.SelectField(tp,1,LOCATION_MZONE,0,zone)
end end
e:SetValue(function () return 0,szone end) e:SetValue(function () return 0,szone end)
local tc=Duel.GetMatchingGroup(VgD.OverArmFilter,tp,LOCATION_MZONE,0,nil,c,szone):GetFirst() local tc=Duel.GetMatchingGroup(VgD.OverArmFilter,tp,LOCATION_MZONE,0,nil,f,szone):GetFirst()
if not tc then return end if not tc then return end
local mg=tc:GetOverlayGroup() local mg=tc:GetOverlayGroup()
if mg:GetCount()~=0 then if mg:GetCount()~=0 then
...@@ -211,29 +236,12 @@ function VgD.OverArmOperation(e,tp,eg,ep,ev,re,r,rp) ...@@ -211,29 +236,12 @@ function VgD.OverArmOperation(e,tp,eg,ep,ev,re,r,rp)
end end
c:SetMaterial(Group.FromCards(tc)) c:SetMaterial(Group.FromCards(tc))
Duel.Overlay(c,Group.FromCards(tc)) Duel.Overlay(c,Group.FromCards(tc))
end
end end
function VgD.OverArmSum(e,tp,eg,ep,ev,re,r,rp) function VgD.OverArmSum(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
c:RegisterFlagEffect(ConditionFlag,RESET_EVENT+RESETS_STANDARD,0,1,201) c:RegisterFlagEffect(ConditionFlag,RESET_EVENT+RESETS_STANDARD,0,1,201)
end end
function VgD.CallCondition(e,c)
if c==nil then return true end
local tp=e:GetHandlerPlayer()
return VgF.LvCondition(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK)
end
function VgD.CallFilter(c,tp,zone)
return VgF.RMonsterFilter(c) and zone==VgF.SequenceToGlobal(tp,c:GetLocation(),c:GetSequence())
end
function VgD.CallOperation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CallZONE)
local zone=Duel.SelectField(tp,1,LOCATION_MZONE,0,0xe0)
if Duel.IsExistingMatchingCard(VgD.CallFilter,tp,LOCATION_MZONE,0,1,nil,tp,zone) then
local tc=Duel.GetMatchingGroup(VgD.CallFilter,tp,LOCATION_MZONE,0,nil,tp,zone):GetFirst()
Duel.SendtoGrave(tc,REASON_COST)
end
e:SetValue(function () return 0,zone end)
end
--战斗阶段 --战斗阶段
function VgD.MonsterBattle(c) function VgD.MonsterBattle(c)
......
...@@ -52,23 +52,6 @@ function VgF.SequenceToGlobal(p,loc,seq) ...@@ -52,23 +52,6 @@ function VgF.SequenceToGlobal(p,loc,seq)
return 0 return 0
end end
end end
function VgF.AddCodeList(c,...)
if c:IsStatus(STATUS_COPYING_EFFECT) then return end
if c.card_code_list==nil then
local mt=getmetatable(c)
mt.card_code_list={}
for _,code in ipairs{...} do
mt.card_code_list[code]=true
end
else
for _,code in ipairs{...} do
c.card_code_list[code]=true
end
end
end
function VgF.IsCodeListed(c,code)
return c.card_code_list and c.card_code_list[code]
end
function VgF.True() function VgF.True()
return true return true
end end
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
local cm,m,o=GetID() local cm,m,o=GetID()
function cm.initial_effect(c) function cm.initial_effect(c)
vgf.VgCard(c) vgf.VgCard(c)
vgf.AddCodeList(c,10101009) VgD.OverArm(c,10101009)
vgd.EffectTypeTrigger(c,m,LOCATION_MZONE,EFFECT_TYPE_SINGLE,EVENT_ATTACK_ANNOUNCE,cm.operation2,nil,cm.condition2) vgd.EffectTypeTrigger(c,m,LOCATION_MZONE,EFFECT_TYPE_SINGLE,EVENT_ATTACK_ANNOUNCE,cm.operation2,nil,cm.condition2)
end end
function cm.operation2(e,tp,eg,ep,ev,re,r,rp) function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
......
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