Commit 6d1b9075 authored by jwyxym's avatar jwyxym Committed by GitHub

Add files via upload

parent a56c7ba6
This diff is collapsed.
This diff is collapsed.
VgF={}
vgf=VgF
POS_FACEUP_DEFENCE=POS_FACEUP_DEFENSE
POS_FACEDOWN_DEFENCE=POS_FACEDOWN_DEFENSE
function GetID()
local offset=self_code<100000000 and 1 or 100
return self_table,self_code,offset
end
function VgF.Stringid(code,id)
return code*16+id
end
function VgF.SequenceToGlobal(p,loc,seq)
if p~=0 and p~=1 then
return 0
end
if loc==LOCATION_MZONE then
if seq<=6 then
return 0x0001<<(16*p+seq)
else
return 0
end
elseif loc == LOCATION_SZONE then
if seq<=4 then
return 0x0100<<(16*p+seq)
else
return 0
end
else
return 0
end
end
function VgF.True()
return true
end
function VgF.Next(g)
local first=true
return function()
if first then first=false return g:GetFirst()
else return g:GetNext() end
end
end
bit={}
function bit.band(a,b)
return a&b
end
function bit.bor(a,b)
return a|b
end
function bit.bxor(a,b)
return a~b
end
function bit.lshift(a,b)
return a<<b
end
function bit.rshift(a,b)
return a>>b
end
function bit.bnot(a)
return ~a
end
function VgF.RMonsterFilter(c)
return VgF.IsSequence(c,5)
end
function VgF.VMonsterFilter(c)
return c:GetSequence()<5
end
function VgF.VMonsterCondition(e,c)
return VgF.VMonsterFilter(e:GetHandler())
end
function VgF.RMonsterCondition(e,c)
return VgF.RMonsterFilter(e:GetHandler())
end
function VgF.IsSequence(c,...)
for i,v in ipairs{...} do
if c:GetSequence()==v then
return true
end
end
return false
end
function VgF.GetColumnGroup(c)
local tp=c:GetControler()
local g=Group.CreateGroup()
if c:GetSequence()==0 then
local sg1=Duel.GetMatchingGroup(VgF.IsSequence,tp,LOCATION_MZONE,0,nil,1)
local sg2=Duel.GetMatchingGroup(VgF.IsSequence,tp,0,LOCATION_MZONE,nil,3,4)
if sg1 then g:Merge(sg1) end
if sg2 then g:Merge(sg2) end
end
if c:GetSequence()==1 then
local sg1=Duel.GetMatchingGroup(VgF.IsSequence,tp,LOCATION_MZONE,0,nil,0)
local sg2=Duel.GetMatchingGroup(VgF.IsSequence,tp,0,LOCATION_MZONE,nil,3,4)
if sg1 then g:Merge(sg1) end
if sg2 then g:Merge(sg2) end
end
if c:GetSequence()==2 then
local sg1=Duel.GetMatchingGroup(VgF.IsSequence,tp,LOCATION_MZONE,0,nil,5)
local sg2=Duel.GetMatchingGroup(VgF.IsSequence,tp,0,LOCATION_MZONE,nil,2,5)
if sg1 then g:Merge(sg1) end
if sg2 then g:Merge(sg2) end
end
if c:GetSequence()==3 then
local sg1=Duel.GetMatchingGroup(VgF.IsSequence,tp,LOCATION_MZONE,0,nil,4)
local sg2=Duel.GetMatchingGroup(VgF.IsSequence,tp,0,LOCATION_MZONE,nil,0,1)
if sg1 then g:Merge(sg1) end
if sg2 then g:Merge(sg2) end
end
if c:GetSequence()==4 then
local sg1=Duel.GetMatchingGroup(VgF.IsSequence,tp,LOCATION_MZONE,0,nil,3)
local sg2=Duel.GetMatchingGroup(VgF.IsSequence,tp,0,LOCATION_MZONE,nil,0,1)
if sg1 then g:Merge(sg1) end
if sg2 then g:Merge(sg2) end
end
if c:GetSequence()==5 then
local sg1=Duel.GetMatchingGroup(VgF.IsSequence,tp,LOCATION_MZONE,0,nil,2)
local sg2=Duel.GetMatchingGroup(VgF.IsSequence,tp,0,LOCATION_MZONE,nil,2,5)
if sg1 then g:Merge(sg1) end
if sg2 then g:Merge(sg2) end
end
return g
end
function VgF.Call(g,sumtype,sp,zone)
if not zone then zone=0x7f end
return Duel.SpecialSummon(g,sumtype,sp,sp,true,true,POS_FACEUP_ATTACK,zone)
end
function VgF.LvCondition(e)
local c=e:GetHandler()
local tp=c:GetControler()
local lv=c:GetLevel()
return Duel.IsExistingMatchingCard(VgF.LvConditionFilter,tp,LOCATION_MZONE,0,1,nil,lv)
end
function VgF.LvConditionFilter(c,lv)
return VgF.RMonsterFilter(c) and c:IsLevelAbove(lv)
end
\ No newline at end of file
--
local cm,m,o=GetID()
function cm.initial_effect(c)
vg.VgMonster(c)
local e100=Effect.CreateEffect(c)
e100:SetType(EFFECT_TYPE_IGNITION)
e100:SetRange(LOCATION_MZONE)
e100:SetOperation(cm.op)
c:RegisterEffect(e100)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(-100)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e:GetHandler():RegisterEffect(e1)
local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_MZONE,nil)
for tc in vg.Next(g) do
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_ATTACK)
e2:SetValue(-500)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
local def=e:GetHandler():GetAttack()
Debug.Message(def)
end
\ No newline at end of file
--
local cm,m,o=GetID()
function cm.initial_effect(c)
vg.VgMonster(c)
end
--
local cm,m,o=GetID()
function cm.initial_effect(c)
vg.VgMonster(c)
end
--
local cm,m,o=GetID()
function cm.initial_effect(c)
vg.VgMonster(c)
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