Commit 8eceac44 authored by linmeng's avatar linmeng

更新小写

parent 5e5e6208
VgD={}
vgd={}
--骑升
function VgD.RideUp(c)
function vgd.RideUp(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PREDRAW)
e1:SetCountLimit(1,VgID)
e1:SetCountLimit(1,vgID)
e1:SetRange(LOCATION_ALL)
e1:SetCondition(VgD.RideZeroCondition)
e1:SetOperation(VgD.RideZeroOperation)
e1:SetCondition(vgd.RideZeroCondition)
e1:SetOperation(vgd.RideZeroOperation)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE_START+PHASE_STANDBY)
e2:SetRange(LOCATION_ALL)
e2:SetCountLimit(1,VgID+1)
e2:SetCondition(VgD.RideUpCondition)
e2:SetOperation(VgD.RideUpOperation)
e2:SetCountLimit(1,vgID+1)
e2:SetCondition(vgd.RideUpCondition)
e2:SetOperation(vgd.RideUpOperation)
c:RegisterEffect(e2)
end
function VgD.RideUpFilter1(c,e,lv,code,rc)
function vgd.RideUpFilter1(c,e,lv,code,rc)
local tp=c:GetControler()
if rc:IsAttribute(SKILL_SELF_RIDE) and c:IsCode(code) then
return false
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)
end
function VgD.DisCardRideUpFilter(c,e,lv,code,rc)
function vgd.DisCardRideUpFilter(c,e,lv,code,rc)
local tp=c:GetControler()
return c:IsDiscardable() and Duel.IsExistingMatchingCard(VgD.RideUpFilter1,tp,LOCATION_HAND+LOCATION_RIDE,0,1,c,e,lv,code,rc)
return c:IsDiscardable() and Duel.IsExistingMatchingCard(vgd.RideUpFilter1,tp,LOCATION_HAND+LOCATION_RIDE,0,1,c,e,lv,code,rc)
end
function VgD.RideUpFilter2(c,e,lv,code,rc)
function vgd.RideUpFilter2(c,e,lv,code,rc)
return c:IsLevel(lv) and c:IsType(TYPE_MONSTER) and c:IsCode(code) and rc:IsAttribute(SKILL_SELF_RIDE) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RIDE,tp,false,false,POS_FACEUP_ATTACK)
end
function VgD.RideUpCondition(e,tp,eg,ep,ev,re,r,rp)
local rc=Duel.GetMatchingGroup(VgF.VMonsterFilter,tp,LOCATION_MZONE,0,nil):GetFirst()
function vgd.RideUpCondition(e,tp,eg,ep,ev,re,r,rp)
local rc=Duel.GetMatchingGroup(vgf.VMonsterFilter,tp,LOCATION_MZONE,0,nil):GetFirst()
if not rc then return false end
local lv=rc:GetLevel()
local code=rc:GetCode()
local rg1=Duel.GetMatchingGroup(VgD.RideUpFilter1,tp,LOCATION_HAND+LOCATION_RIDE,0,nil,e,lv,code,rc)
local rg2=Duel.GetMatchingGroup(VgD.RideUpFilter2,tp,LOCATION_HAND,0,nil,e,lv,code,rc)
local rg1=Duel.GetMatchingGroup(vgd.RideUpFilter1,tp,LOCATION_HAND+LOCATION_RIDE,0,nil,e,lv,code,rc)
local rg2=Duel.GetMatchingGroup(vgd.RideUpFilter2,tp,LOCATION_HAND,0,nil,e,lv,code,rc)
local a=rg1:GetCount()>0
local b=rg2:GetCount()>0
return Duel.GetTurnPlayer()==tp and VgF.RuleCardCondtion(e) and (a or b)
return Duel.GetTurnPlayer()==tp and vgf.RuleCardCondtion(e) and (a or b)
end
function VgD.RideUpOperation(e,tp,eg,ep,ev,re,r,rp)
function vgd.RideUpOperation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=Duel.GetMatchingGroup(VgF.VMonsterFilter,tp,LOCATION_MZONE,0,nil):GetFirst()
local rc=Duel.GetMatchingGroup(vgf.VMonsterFilter,tp,LOCATION_MZONE,0,nil):GetFirst()
if not rc then return end
local lv=rc:GetLevel()
local code=rc:GetCode()
local rg1=Duel.GetMatchingGroup(VgD.RideUpFilter1,tp,LOCATION_HAND+LOCATION_RIDE,0,nil,e,lv,code,rc)
local rg2=Duel.GetMatchingGroup(VgD.RideUpFilter2,tp,LOCATION_HAND,0,nil,e,lv,code,rc)
local rg1=Duel.GetMatchingGroup(vgd.RideUpFilter1,tp,LOCATION_HAND+LOCATION_RIDE,0,nil,e,lv,code,rc)
local rg2=Duel.GetMatchingGroup(vgd.RideUpFilter2,tp,LOCATION_HAND,0,nil,e,lv,code,rc)
local a=rg1:GetCount()>0
local b=rg2:GetCount()>0
local off=1
local ops={}
if a then
ops[off]=VgF.Stringid(VgID,3)
ops[off]=vgf.Stringid(vgID,3)
off=off+1
end
if b then
ops[off]=VgF.Stringid(VgID,4)
ops[off]=vgf.Stringid(vgID,4)
off=off+1
end
ops[off]=VgF.Stringid(VgID,5)
ops[off]=vgf.Stringid(vgID,5)
local sel=Duel.SelectOption(tp,table.unpack(ops))
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)
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)
local sg=rg1:FilterSelect(tp,Card.IsLocation,1,1,nil,LOCATION_HAND+LOCATION_RIDE)
......@@ -79,7 +79,7 @@ function VgD.RideUpOperation(e,tp,eg,ep,ev,re,r,rp)
end
sc:SetMaterial(Group.FromCards(rc))
Duel.Overlay(sc,Group.FromCards(rc))
VgF.Call(sc,SUMMON_TYPE_RIDE,tp,0x20)
vgf.Call(sc,SUMMON_TYPE_RIDE,tp,0x20)
if Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_RIDE,0,1,nil,10400855) then
local tc=Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_RIDE,0,nil,10400855):GetFirst()
Duel.Sendto(tc,tp,LOCATION_EMBLEM,POS_FACEUP,REASON_EFFECT)
......@@ -94,7 +94,7 @@ function VgD.RideUpOperation(e,tp,eg,ep,ev,re,r,rp)
end
sc:SetMaterial(Group.FromCards(rc))
Duel.Overlay(sc,Group.FromCards(rc))
VgF.Call(sc,SUMMON_TYPE_RIDE,tp,0x20)
vgf.Call(sc,SUMMON_TYPE_RIDE,tp,0x20)
Duel.Draw(tp,1,REASON_EFFECT)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
......@@ -105,26 +105,26 @@ function VgD.RideUpOperation(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e1,tp)
end
end
function VgD.RideZeroCondition(e,tp,eg,ep,ev,re,r,rp)
local rc=Duel.GetMatchingGroup(VgF.VMonsterFilter,tp,LOCATION_MZONE,0,nil):GetFirst()
function vgd.RideZeroCondition(e,tp,eg,ep,ev,re,r,rp)
local rc=Duel.GetMatchingGroup(vgf.VMonsterFilter,tp,LOCATION_MZONE,0,nil):GetFirst()
if rc then return false end
local ct=Duel.GetMatchingGroupCount(VgD.RideZeroFilter,tp,LOCATION_RIDE,0,nil,e,tp)
return VgF.RuleTurnCondtion(e) and ct>0 and VgF.RuleCardCondtion(e)
local ct=Duel.GetMatchingGroupCount(vgd.RideZeroFilter,tp,LOCATION_RIDE,0,nil,e,tp)
return vgf.RuleTurnCondtion(e) and ct>0 and vgf.RuleCardCondtion(e)
end
function VgD.RideZeroOperation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(VgD.RideZeroFilter,tp,LOCATION_RIDE,0,nil,e,tp)
function vgd.RideZeroOperation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(vgd.RideZeroFilter,tp,LOCATION_RIDE,0,nil,e,tp)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CALL)
g=g:Select(tp,1,1,nil)
end
VgF.Call(g,SUMMON_TYPE_RIDE,tp,0x20)
vgf.Call(g,SUMMON_TYPE_RIDE,tp,0x20)
end
function VgD.RideZeroFilter(c,e,tp)
function vgd.RideZeroFilter(c,e,tp)
return c:IsLevel(1) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RIDE,tp,false,false,POS_FACEUP_ATTACK)
end
--Call到R位
function VgD.CallToR(c)
function vgd.CallToR(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
......@@ -132,11 +132,11 @@ function VgD.CallToR(c)
e1:SetProperty(EFFECT_FLAG_SPSUM_PARAM)
e1:SetTargetRange(POS_FACEUP_ATTACK,0)
e1:SetValue(SUMMON_TYPE_CALL)
e1:SetCondition(VgD.CallCondition)
e1:SetOperation(VgD.CallOperation)
e1:SetCondition(vgd.CallCondition)
e1:SetOperation(vgd.CallOperation)
c:RegisterEffect(e1)
end
function VgD.CallVal(zone)
function vgd.CallVal(zone)
if zone>0 then
return function (e,c)
return 0,zone
......@@ -147,72 +147,72 @@ function VgD.CallVal(zone)
end
end
end
function VgD.CallCondition(e,c)
function vgd.CallCondition(e,c)
if c==nil then return true end
return VgF.LvCondition(e) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_CALL,tp,false,false,POS_FACEUP_ATTACK)
return vgf.LvCondition(e) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_CALL,tp,false,false,POS_FACEUP_ATTACK)
end
function VgD.CallOperation(e,tp,eg,ep,ev,re,r,rp)
function vgd.CallOperation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local zone=0
if Duel.IsExistingMatchingCard(VgF.RMonsterFilter,tp,LOCATION_MZONE,0,1,nil) and Duel.SelectYesNo(tp,VgF.Stringid(VgID,7)) then
if Duel.IsExistingMatchingCard(vgf.RMonsterFilter,tp,LOCATION_MZONE,0,1,nil) and Duel.SelectYesNo(tp,vgf.Stringid(vgID,7)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LEAVEONFIELD)
local tc=Duel.SelectMatchingCard(tp,VgF.RMonsterFilter,tp,LOCATION_MZONE,0,1,1,nil):GetFirst()
local tc=Duel.SelectMatchingCard(tp,vgf.RMonsterFilter,tp,LOCATION_MZONE,0,1,1,nil):GetFirst()
if tc then
zone=VgF.SequenceToGlobal(tp,tc:GetLocation(),tc:GetSequence())
zone=vgf.SequenceToGlobal(tp,tc:GetLocation(),tc:GetSequence())
Duel.SendtoGrave(tc,REASON_COST)
end
end
e:SetValue(VgD.CallVal(zone))
e:SetValue(vgd.CallVal(zone))
end
--战斗阶段
function VgD.MonsterBattle(c)
function vgd.MonsterBattle(c)
--攻击转守备
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetOperation(VgD.MonsterPosDefenseOperation)
e1:SetOperation(vgd.MonsterPosDefenseOperation)
c:RegisterEffect(e1)
--回合开始转攻
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PREDRAW)
e2:SetRange(LOCATION_ONFIELD)
e2:SetCondition(VgD.MonsterPosAttackCondition)
e2:SetOperation(VgD.MonsterPosAttackOperation)
e2:SetCondition(vgd.MonsterPosAttackCondition)
e2:SetOperation(vgd.MonsterPosAttackOperation)
c:RegisterEffect(e2)
--扣血
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_BATTLED)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(VgD.MonsterBattleDamageCondition)
e3:SetOperation(VgD.MonsterBattleDamageOperation)
e3:SetCondition(vgd.MonsterBattleDamageCondition)
e3:SetOperation(vgd.MonsterBattleDamageOperation)
c:RegisterEffect(e3)
--攻击判定
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_QUICK_F)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e4:SetCondition(VgD.MonsterAttackCondition)
e4:SetCost(VgD.MonsterAttackCost)
e4:SetOperation(VgD.TriggerCard)
e4:SetCondition(vgd.MonsterAttackCondition)
e4:SetCost(vgd.MonsterAttackCost)
e4:SetOperation(vgd.TriggerCard)
c:RegisterEffect(e4)
--多次判定
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e5:SetCode(EVENT_CUSTOM+EVENT_TRIGGER)
e5:SetRange(LOCATION_MZONE)
e5:SetCondition(VgD.MonsterNextTrigger)
e5:SetOperation(VgD.TriggerCard)
e5:SetCondition(vgd.MonsterNextTrigger)
e5:SetOperation(vgd.TriggerCard)
c:RegisterEffect(e5)
--支援
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e6:SetRange(LOCATION_MZONE)
e6:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e6:SetCondition(VgD.SupportCondition)
e6:SetOperation(VgD.SupportOperation)
e6:SetCondition(vgd.SupportCondition)
e6:SetOperation(vgd.SupportOperation)
c:RegisterEffect(e6)
--防御
local e7=Effect.CreateEffect(c)
......@@ -220,8 +220,8 @@ function VgD.MonsterBattle(c)
e7:SetCode(EVENT_ATTACK_ANNOUNCE)
e7:SetRange(LOCATION_HAND+LOCATION_MZONE)
e7:SetCountLimit(1)
e7:SetCondition(VgD.SendToGCondition)
e7:SetOperation(VgD.SendToGOperation)
e7:SetCondition(vgd.SendToGCondition)
e7:SetOperation(vgd.SendToGOperation)
c:RegisterEffect(e7)
--其他永续
local e10=Effect.CreateEffect(c)
......@@ -232,7 +232,7 @@ function VgD.MonsterBattle(c)
local e11=Effect.CreateEffect(c)
e11:SetType(EFFECT_TYPE_SINGLE)
e11:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e11:SetCondition(VgD.MonsterAttackAnnounceCondition)
e11:SetCondition(vgd.MonsterAttackAnnounceCondition)
c:RegisterEffect(e11)
local e12=Effect.CreateEffect(c)
e12:SetType(EFFECT_TYPE_SINGLE)
......@@ -248,7 +248,7 @@ function VgD.MonsterBattle(c)
e14:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e14:SetRange(LOCATION_MZONE)
e14:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e14:SetCondition(VgF.VMonsterCondition)
e14:SetCondition(vgf.VMonsterCondition)
e14:SetValue(1)
c:RegisterEffect(e14)
local e15=Effect.CreateEffect(c)
......@@ -260,16 +260,16 @@ function VgD.MonsterBattle(c)
e16:SetType(EFFECT_TYPE_SINGLE)
e16:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e16:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e16:SetCondition(VgD.MonsterCannotBeAttackedCondition)
e16:SetValue(VgF.True)
e16:SetCondition(vgd.MonsterCannotBeAttackedCondition)
e16:SetValue(vgf.True)
c:RegisterEffect(e16)
end
function VgD.TriggerCard(e,tp,eg,ep,ev,re,r,rp)
function vgd.TriggerCard(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetDecktopGroup(tp,1)
Duel.DisableShuffleCheck()
Duel.MoveToField(tg:GetFirst(),tp,tp,LOCATION_TRIGGER,POS_FACEUP,true)
end
function VgD.MonsterPosDefenseOperation(e,tp,eg,ep,ev,re,r,rp)
function vgd.MonsterPosDefenseOperation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.ChangePosition(c,POS_FACEUP_DEFENSE)
local label=0
......@@ -280,39 +280,39 @@ function VgD.MonsterPosDefenseOperation(e,tp,eg,ep,ev,re,r,rp)
end
c:RegisterFlagEffect(AttackTriggerFlag,RESET_EVENT+RESETS_STANDARD+EVENT_PRE_BATTLE_DAMAGE,0,1,label)
end
function VgD.MonsterPosAttackCondition(e,tp,eg,ep,ev,re,r,rp)
function vgd.MonsterPosAttackCondition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return Duel.GetTurnPlayer()==tp and c:IsPosition(POS_DEFENSE) and (VgF.RMonsterFilter(c) or VgF.VMonsterFilter(c))
return Duel.GetTurnPlayer()==tp and c:IsPosition(POS_DEFENSE) and (vgf.RMonsterFilter(c) or vgf.VMonsterFilter(c))
end
function VgD.MonsterPosAttackOperation(e,tp,eg,ep,ev,re,r,rp)
function vgd.MonsterPosAttackOperation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.ChangePosition(c,POS_FACEUP_ATTACK)
Duel.Hint(HINT_LINES,tp,VgF.Stringid(VgID,0))
Duel.Hint(HINT_LINES,tp,vgf.Stringid(vgID,0))
end
function VgD.MonsterBattleDamageCondition(e,tp,eg,ep,ev,re,r,rp)
function vgd.MonsterBattleDamageCondition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
if not bc or not bc:IsRelateToBattle() then return false end
local atk=bc:GetAttack()
local def=c:GetAttack()
return VgF.VMonsterFilter(c) and c==Duel.GetAttackTarget() and atk>=def and bc:GetLeftScale()>0
return vgf.VMonsterFilter(c) and c==Duel.GetAttackTarget() and atk>=def and bc:GetLeftScale()>0
end
function VgD.MonsterBattleDamageOperation(e,tp,eg,ep,ev,re,r,rp)
function vgd.MonsterBattleDamageOperation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
local label=bc:GetLeftScale()-1
bc:RegisterFlagEffect(DamageTriggerFlag,RESET_EVENT+RESETS_STANDARD+EVENT_PRE_BATTLE_DAMAGE,0,1,label)
VgD.TriggerCard(e,tp,eg,ep,ev,re,r,rp)
vgd.TriggerCard(e,tp,eg,ep,ev,re,r,rp)
end
function VgD.MonsterNextTrigger(e,tp,eg,ep,ev,re,r,rp)
function vgd.MonsterNextTrigger(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return eg:GetFirst():GetControler()==tp and VgF.VMonsterFilter(c)
return eg:GetFirst():GetControler()==tp and vgf.VMonsterFilter(c)
end
function VgD.SupportCondition(e,tp,eg,ep,ev,re,r,rp)
return VgF.GetColumnGroup(Duel.GetAttacker()):IsContains(e:GetHandler()) and Duel.GetTurnPlayer()==tp and e:GetHandler():IsAttribute(SKILL_SUPPORT)
function vgd.SupportCondition(e,tp,eg,ep,ev,re,r,rp)
return vgf.GetColumnGroup(Duel.GetAttacker()):IsContains(e:GetHandler()) and Duel.GetTurnPlayer()==tp and e:GetHandler():IsAttribute(SKILL_SUPPORT)
end
function VgD.SupportOperation(e,tp,eg,ep,ev,re,r,rp)
if not Duel.SelectYesNo(tp,VgF.Stringid(VgID,8)) then return end
function vgd.SupportOperation(e,tp,eg,ep,ev,re,r,rp)
if not Duel.SelectYesNo(tp,vgf.Stringid(vgID,8)) then return end
local c=e:GetHandler()
Duel.ChangePosition(c,POS_FACEUP_DEFENSE)
local e1=Effect.CreateEffect(c)
......@@ -322,15 +322,15 @@ function VgD.SupportOperation(e,tp,eg,ep,ev,re,r,rp)
e1:SetValue(c:GetAttack())
Duel.GetAttacker():RegisterEffect(e1)
end
function VgD.SendToGCost(e,tp,eg,ep,ev,re,r,rp,chk)
function vgd.SendToGCost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsPublic() and (not Duel.IsPlayerAffectedByEffect(tp,AFFECT_CODE_SendtoG) or Duel.IsExistingMatchingCard(VgF.Not(Card.IsPublic),tp,LOCATION_HAND,0,1,c)) end
if chk==0 then return c:IsPublic() and (not Duel.IsPlayerAffectedByEffect(tp,AFFECT_CODE_SendtoG) or Duel.IsExistingMatchingCard(vgf.Not(Card.IsPublic),tp,LOCATION_HAND,0,1,c)) end
local g=Group.FromCards(c)
if Duel.IsPlayerAffectedByEffect(tp,AFFECT_CODE_SendtoG) then
local sg=Duel.SelectMatchingCard(tp,VgF.Not(Card.IsPublic),tp,LOCATION_HAND,0,1,1,c)
local sg=Duel.SelectMatchingCard(tp,vgf.Not(Card.IsPublic),tp,LOCATION_HAND,0,1,1,c)
g:Merge(sg)
end
for tc in VgF.Next(g) do
for tc in vgf.Next(g) do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
......@@ -338,52 +338,52 @@ function VgD.SendToGCost(e,tp,eg,ep,ev,re,r,rp,chk)
tc:RegisterEffect(e1)
end
end
function VgD.SendToGCondition(e,tp,eg,ep,ev,re,r,rp)
function vgd.SendToGCondition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=Duel.GetAttackTarget()
return bc and bc:IsControler(tp) and bc~=c and VgF.IsAbleToGZone(c)
return bc and bc:IsControler(tp) and bc~=c and vgf.IsAbleToGZone(c)
end
function VgD.SendToGOperation(e,tp,eg,ep,ev,re,r,rp)
function vgd.SendToGOperation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=Duel.GetAttackTarget()
if not bc or not VgF.IsAbleToGZone(c) or not c:IsRelateToEffect(e) then return false end
if not bc or not vgf.IsAbleToGZone(c) or not c:IsRelateToEffect(e) then return false end
Duel.Sendto(c,tp,LOCATION_GZONE,POS_FACEUP,REASON_EFFECT)
local def=c:GetDefense()
VgF.AtkUp(c,bc,def,nil)
vgf.AtkUp(c,bc,def,nil)
end
function VgD.MonsterAttackAnnounceCondition(e,c)
return e:GetHandler():IsPosition(POS_DEFENSE) or VgF.IsSequence(e:GetHandler(),1,2,3)
function vgd.MonsterAttackAnnounceCondition(e,c)
return e:GetHandler():IsPosition(POS_DEFENSE) or vgf.IsSequence(e:GetHandler(),1,2,3)
end
function VgD.MonsterAttackCondition(e,tp,eg,ep,ev,re,r,rp)
function vgd.MonsterAttackCondition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and Duel.GetAttackTarget()==bc and VgF.VMonsterFilter(c)
return bc and Duel.GetAttackTarget()==bc and vgf.VMonsterFilter(c)
end
function VgD.MonsterAttackCost(e,tp,eg,ep,ev,re,r,rp,chk)
function vgd.MonsterAttackCost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(CountTriggerFlag)==0 end
c:RegisterFlagEffect(CountTriggerFlag,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE_CAL,0,1)
end
function VgD.MonsterCannotBeAttackedCondition(e,c)
return VgF.IsSequence(e:GetHandler(),1,2,3)
function vgd.MonsterCannotBeAttackedCondition(e,c)
return vgf.IsSequence(e:GetHandler(),1,2,3)
end
--判定
function VgD.CardTrigger(c,f)
function vgd.CardTrigger(c,f)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_MOVE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(VgD.CardTriggerCondtion(0))
e1:SetOperation(VgD.CardTriggerOperation(0,f))
e1:SetCondition(vgd.CardTriggerCondtion(0))
e1:SetOperation(vgd.CardTriggerOperation(0,f))
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCondition(VgD.CardTriggerCondtion(1))
e2:SetOperation(VgD.CardTriggerOperation(1,f))
e2:SetCondition(vgd.CardTriggerCondtion(1))
e2:SetOperation(vgd.CardTriggerOperation(1,f))
c:RegisterEffect(e2)
end
function VgD.CardTriggerCondtion(chkcon)
function vgd.CardTriggerCondtion(chkcon)
return function (e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local cp=tp
......@@ -391,24 +391,24 @@ function VgD.CardTriggerCondtion(chkcon)
return Duel.GetTurnPlayer()==cp and c:IsLocation(LOCATION_TRIGGER)
end
end
function VgD.CardTriggerOperation(chkop,f)
function vgd.CardTriggerOperation(chkop,f)
return function (e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRace(TRRIGGER_CRITICAL_STRIKE) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CRITICAL_STRIKE)
local g1=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_MZONE,0,1,1,nil)
Duel.HintSelection(g1)
VgF.StarUp(c,g1,1,nil)
vgf.StarUp(c,g1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKUP)
local g2=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_MZONE,0,1,1,nil)
Duel.HintSelection(g2)
VgF.AtkUp(c,g2,10000,nil)
vgf.AtkUp(c,g2,10000,nil)
elseif c:IsRace(TRRIGGER_DRAW) then
Duel.Draw(tp,1,REASON_TRIGGER)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKUP)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_MZONE,0,1,1,nil)
Duel.HintSelection(g)
VgF.AtkUp(c,g,10000,nil)
vgf.AtkUp(c,g,10000,nil)
elseif c:IsRace(TRRIGGER_HEAL) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODROP)
local tc=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_DAMAGE,0,1,1,nil):GetFirst()
......@@ -418,11 +418,11 @@ function VgD.CardTriggerOperation(chkop,f)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKUP)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_MZONE,0,1,1,nil)
Duel.HintSelection(g)
VgF.AtkUp(c,g,10000,nil)
vgf.AtkUp(c,g,10000,nil)
elseif c:IsRace(TRRIGGER_ADVANCE) then
local g=Duel.GetMatchingGroup(VgF.IsSequence,tp,LOCATION_MZONE,0,nil,0,4,5)
for tc in VgF.Next(g) do
VgF.AtkUp(c,tc,10000,nil)
local g=Duel.GetMatchingGroup(vgf.IsSequence,tp,LOCATION_MZONE,0,nil,0,4,5)
for tc in vgf.Next(g) do
vgf.AtkUp(c,tc,10000,nil)
end
end
if chkop==0 then
......@@ -432,12 +432,12 @@ function VgD.CardTriggerOperation(chkop,f)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKUP)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_MZONE,0,1,1,nil)
Duel.HintSelection(g)
VgF.AtkUp(c,g,100000000,nil)
vgf.AtkUp(c,g,100000000,nil)
else
Duel.Sendto(c,tp,LOCATION_DAMAGE,POS_FACEUP,REASON_EFFECT)
Duel.Damage(tp,1,REASON_TRIGGER)
end
local rc=Duel.GetMatchingGroup(VgF.VMonsterFilter,tp,LOCATION_MZONE,0,nil):GetFirst()
local rc=Duel.GetMatchingGroup(vgf.VMonsterFilter,tp,LOCATION_MZONE,0,nil):GetFirst()
local bc=rc:GetBattleTarget()
local label=bc:GetFlagEffectLabel(DamageTriggerFlag)
if not label then return end
......@@ -455,14 +455,14 @@ function VgD.CardTriggerOperation(chkop,f)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKUP)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_MZONE,0,1,1,nil)
Duel.HintSelection(g)
VgF.AtkUp(c,g,100000000,nil)
vgf.AtkUp(c,g,100000000,nil)
if f then f(e,tp,eg,ep,ev,re,r,rp) end
Duel.Exile(c,REASON_TRIGGER)
else
Duel.SendtoHand(c,nil,REASON_TRIGGER)
Duel.ConfirmCards(1-tp,c)
end
local rc=Duel.GetMatchingGroup(VgF.VMonsterFilter,tp,LOCATION_MZONE,0,nil):GetFirst()
local rc=Duel.GetMatchingGroup(vgf.VMonsterFilter,tp,LOCATION_MZONE,0,nil):GetFirst()
local label=rc:GetFlagEffectLabel(AttackTriggerFlag)
if not label then return end
if label>0 then
......@@ -478,14 +478,14 @@ function VgD.CardTriggerOperation(chkop,f)
end
--vg规则
function VgD.Rule(c)
function vgd.Rule(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_DRAW)
e1:SetRange(LOCATION_ALL)
e1:SetCountLimit(1,VgID+2)
e1:SetCondition(VgD.RuelDrawCondition)
e1:SetOperation(VgD.RuelDrawOperation)
e1:SetCountLimit(1,vgID+2)
e1:SetCondition(vgd.RuelDrawCondition)
e1:SetOperation(vgd.RuelDrawOperation)
c:RegisterEffect(e1)
local e10=Effect.CreateEffect(c)
e10:SetType(EFFECT_TYPE_FIELD)
......@@ -494,14 +494,14 @@ function VgD.Rule(c)
e10:SetRange(LOCATION_ALL)
e10:SetTargetRange(1,0)
e10:SetValue(100)
e10:SetCondition(VgF.RuleCardCondtion)
e10:SetCondition(vgf.RuleCardCondtion)
c:RegisterEffect(e10)
local e11=Effect.CreateEffect(c)
e11:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e11:SetCode(EVENT_ADJUST)
e11:SetRange(LOCATION_ALL)
e11:SetCondition(VgF.RuleCardCondtion)
e11:SetOperation(VgD.RuleWin)
e11:SetCondition(vgf.RuleCardCondtion)
e11:SetOperation(vgd.RuleWin)
c:RegisterEffect(e11)
local e12=Effect.CreateEffect(c)
e12:SetType(EFFECT_TYPE_FIELD)
......@@ -520,7 +520,7 @@ function VgD.Rule(c)
e15:SetCode(EFFECT_CANNOT_SSET)
c:RegisterEffect(e15)
end
function VgD.RuleWin(e,tp,eg,ep,ev,re,r,rp)
function vgd.RuleWin(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetCurrentChain()>0 then return end
for WinReason=0x1, 0xff, 1 do
if WinReason==0x2 then
......@@ -536,10 +536,10 @@ function VgD.RuleWin(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function VgD.RuelDrawCondition(e,tp,eg,ep,ev,re,r,rp)
return VgF.RuleTurnCondtion(e) and VgF.RuleCardCondtion(e)
function vgd.RuelDrawCondition(e,tp,eg,ep,ev,re,r,rp)
return vgf.RuleTurnCondtion(e) and vgf.RuleCardCondtion(e)
end
function VgD.RuelDrawOperation(e,tp,eg,ep,ev,re,r,rp)
function vgd.RuelDrawOperation(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0):Select(tp,0,ct,nil)
......@@ -554,24 +554,24 @@ function VgD.RuelDrawOperation(e,tp,eg,ep,ev,re,r,rp)
end
--指令卡cost
function VgD.SpellActivate(c,m,op,con,specialchk,num1,num2,num3,num4,num5)
function vgd.SpellActivate(c,m,op,con,specialchk,num1,num2,num3,num4,num5)
if not specialchk then specialchk=0 end
if not num1 then num1=0 end
if not num2 then num2=0 end
if not num3 then num3=0 end
if not num4 then num4=0 end
if not num5 then num5=0 end
VgD.SpellCostCategory(m,specialchk,num1,num2,num3,num4,num5)
vgd.SpellCostCategory(m,specialchk,num1,num2,num3,num4,num5)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,VgID+EFFECT_COUNT_CODE_OATH)
e1:SetCost(VgD.SpellCost(num1,num2,num3,num4,num5))
e1:SetCountLimit(1,vgID+EFFECT_COUNT_CODE_OATH)
e1:SetCost(vgd.SpellCost(num1,num2,num3,num4,num5))
if con then e1:SetCondition(con) end
e1:SetOperation(VgD.SpellOperation(op))
e1:SetOperation(vgd.SpellOperation(op))
c:RegisterEffect(e1)
end
function VgD.SpellCost(num1,num2,num3,num4,num5)
function vgd.SpellCost(num1,num2,num3,num4,num5)
return function (e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local mg=Group.FromCards(c)
......@@ -579,88 +579,88 @@ function VgD.SpellCost(num1,num2,num3,num4,num5)
if chk==0 then
local b1,b2,b3,b4,b5=true,true,true,true,true
local b6=false
if c.Vg_SpecialCost>0 then g=VgD.SpellSpecialChk(c,mg) else g=mg end
if g:GetCount()>0 or c.Vg_SpecialCost==0 then
if c.vg_SpecialCost>0 then g=vgd.SpellSpecialChk(c,mg) else g=mg end
if g:GetCount()>0 or c.vg_SpecialCost==0 then
if g then mg:Merge(g) end
b6=true
end
if num1>0 then b1=Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,num1,mg) end
if num2>0 then b2=Duel.IsCanRemoveCounter(tp,1,0,COUNTER_ENERGE,num2,REASON_COST) end
if num3>0 then b3=Duel.GetMatchingGroup(VgF.VMonsterFilter,tp,LOCATION_MZONE,0,nil,mg):GetFirst():GetOverlayGroup():FilterCount(VgF.True,mg)>=num3 end
if num3>0 then b3=Duel.GetMatchingGroup(vgf.VMonsterFilter,tp,LOCATION_MZONE,0,nil,mg):GetFirst():GetOverlayGroup():FilterCount(vgf.True,mg)>=num3 end
if num4>0 then b4=Duel.GetFieldGroupCount(tp,LOCATION_DECK,num4)>0 end
if num5>0 then b5=Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_DAMAGE,0,num5,mg) end
return b1 and b2 and b3 and b4 and b5 and b6
end
local rc=nil
if Duel.IsPlayerAffectedByEffect(tp,AFFECT_CODE_MIX) and Duel.IsExistingMatchingCard(VgD.SpellMixFilter,tp,LOCATION_DROP,0,1,nil,c,num1,num2,num3,num4,num5)
and Duel.SelectYesNo(tp,VgF.Stringid(VgID,6)) then
rc=Duel.SelectMatchingCard(tp,VgD.SpellMixFilter,tp,LOCATION_DROP,0,1,1,nil,c,num1,num2,num3,num4,num5):GetFirst()
if Duel.IsPlayerAffectedByEffect(tp,AFFECT_CODE_MIX) and Duel.IsExistingMatchingCard(vgd.SpellMixFilter,tp,LOCATION_DROP,0,1,nil,c,num1,num2,num3,num4,num5)
and Duel.SelectYesNo(tp,vgf.Stringid(vgID,6)) then
rc=Duel.SelectMatchingCard(tp,vgd.SpellMixFilter,tp,LOCATION_DROP,0,1,1,nil,c,num1,num2,num3,num4,num5):GetFirst()
end
VgD.SpellCostOp(e,tp,eg,ep,ev,re,r,rp,chk,c,rc,num1,num2,num3,num4,num5)
vgd.SpellCostOp(e,tp,eg,ep,ev,re,r,rp,chk,c,rc,num1,num2,num3,num4,num5)
end
end
function VgD.SpellCostCategory(m,specialchk,num1,num2,num3,num4,num5)
function vgd.SpellCostCategory(m,specialchk,num1,num2,num3,num4,num5)
local cm=_G["c"..m]
cm.Vg_SpecialCost=specialchk
cm.Vg_DisCard=num1
cm.Vg_Counter=num2
cm.Vg_OverLay=num3
cm.Vg_OverLayFill=num4
cm.Vg_Damage=num5
end
function VgD.SpellMixFilter(c,mc,num1,num2,num3,num4,num5)
cm.vg_SpecialCost=specialchk
cm.vg_DisCard=num1
cm.vg_Counter=num2
cm.vg_OverLay=num3
cm.vg_OverLayFill=num4
cm.vg_Damage=num5
end
function vgd.SpellMixFilter(c,mc,num1,num2,num3,num4,num5)
local mg=Group.FromCards(c,mc)
local tp=c:GetControler()
local b1,b2,b3,b4,b5=true,true,true,true,true
local b6,b7=false,false
local g1=Group.CreateGroup()
local g2=Group.CreateGroup()
if c.Vg_DisCard>0 then num1=num1+c.Vg_DisCard end
if c.Vg_Counter>0 then num2=num2+c.Vg_Counter end
if c.Vg_OverLay>0 then num3=num3+c.Vg_OverLay end
if c.Vg_OverLayFill>0 then num4=num4+c.Vg_OverLayFill end
if c.Vg_Damage>0 then num5=num5+c.Vg_Damage end
if c.Vg_SpecialCost>0 then g1=VgD.SpellSpecialChk(c,mg) end
if g1:GetCount()>0 or c.Vg_SpecialCost==0 then
if c.vg_DisCard>0 then num1=num1+c.vg_DisCard end
if c.vg_Counter>0 then num2=num2+c.vg_Counter end
if c.vg_OverLay>0 then num3=num3+c.vg_OverLay end
if c.vg_OverLayFill>0 then num4=num4+c.vg_OverLayFill end
if c.vg_Damage>0 then num5=num5+c.vg_Damage end
if c.vg_SpecialCost>0 then g1=vgd.SpellSpecialChk(c,mg) end
if g1:GetCount()>0 or c.vg_SpecialCost==0 then
if g1 then mg:Merge(g1) end
b6=true
end
if mc.Vg_SpecialCost>0 then g2=VgD.SpellSpecialChk(c,mg) end
if g2:GetCount()>0 or mc.Vg_SpecialCost==0 then
if mc.vg_SpecialCost>0 then g2=vgd.SpellSpecialChk(c,mg) end
if g2:GetCount()>0 or mc.vg_SpecialCost==0 then
if g2 then mg:Merge(g2) end
b7=true
end
if num1>0 then b1=Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,num1,mg) end
if num2>0 then b2=Duel.IsCanRemoveCounter(tp,1,0,COUNTER_ENERGE,num2,REASON_COST) end
if num3>0 then b3=Duel.GetMatchingGroup(VgF.VMonsterFilter,tp,LOCATION_MZONE,0,nil,mg):GetFirst():GetOverlayGroup():FilterCount(Card.IsAbleToGraveAsCost,mg)>=num3 end
if num3>0 then b3=Duel.GetMatchingGroup(vgf.VMonsterFilter,tp,LOCATION_MZONE,0,nil,mg):GetFirst():GetOverlayGroup():FilterCount(Card.IsAbleToGraveAsCost,mg)>=num3 end
if num4>0 then b4=Duel.GetFieldGroupCount(tp,LOCATION_DECK,num4)>0 end
if num5>0 then b5=Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_DAMAGE,0,num5,mg) end
return b1 and b2 and b3 and b4 and b5 and b6 and b7
end
function VgD.SpellSpecialChk(c,mg)
function vgd.SpellSpecialChk(c,mg)
local t={}
local g
for i, v in ipairs(t) do
if c.Vg_SpecialCost==v then
if c.vg_SpecialCost==v then
local a
end
end
return mg
end
function VgD.SpellCostOp(e,tp,eg,ep,ev,re,r,rp,chk,c,mc,num1,num2,num3,num4,num5)
function vgd.SpellCostOp(e,tp,eg,ep,ev,re,r,rp,chk,c,mc,num1,num2,num3,num4,num5)
local mg=Group.FromCards(c)
if mc then
Duel.Remove(mc,POS_FACEUP,REASON_COST)
e:SetLabelObject(mc)
mg:AddCard(mc)
if mc.Vg_DisCard>0 then num1=num1+mc.Vg_DisCard end
if mc.Vg_Counter>0 then num2=num2+mc.Vg_Counter end
if mc.Vg_OverLay>0 then num3=num3+mc.Vg_OverLay end
if mc.Vg_OverLayFill>0 then num4=num4+mc.Vg_OverLayFill end
if mc.Vg_Damage>0 then num5=num5+mc.Vg_Damage end
if mc.vg_DisCard>0 then num1=num1+mc.vg_DisCard end
if mc.vg_Counter>0 then num2=num2+mc.vg_Counter end
if mc.vg_OverLay>0 then num3=num3+mc.vg_OverLay end
if mc.vg_OverLayFill>0 then num4=num4+mc.vg_OverLayFill end
if mc.vg_Damage>0 then num5=num5+mc.vg_Damage end
local t={}
for i, v in ipairs(t) do
if mc.Vg_SpecialCost==v then
if mc.vg_SpecialCost==v then
local a
end
end
......@@ -674,11 +674,11 @@ function VgD.SpellCostOp(e,tp,eg,ep,ev,re,r,rp,chk,c,mc,num1,num2,num3,num4,num5
Duel.RemoveCounter(tp,1,0,COUNTER_ENERGE,num2,REASON_COST)
end
if num3>0 then
local g=Duel.GetMatchingGroup(VgF.VMonsterFilter,tp,LOCATION_MZONE,0,nil):GetFirst():GetOverlayGroup():FilterSelect(tp,Card.IsAbleToGraveAsCost,num3,num3,mg)
local g=Duel.GetMatchingGroup(vgf.VMonsterFilter,tp,LOCATION_MZONE,0,nil):GetFirst():GetOverlayGroup():FilterSelect(tp,Card.IsAbleToGraveAsCost,num3,num3,mg)
Duel.SendtoGrave(g,REASON_COST)
end
if num4>0 then
local rc=Duel.GetMatchingGroup(VgF.VMonsterFilter,tp,LOCATION_MZONE,0,nil):GetFirst()
local rc=Duel.GetMatchingGroup(vgf.VMonsterFilter,tp,LOCATION_MZONE,0,nil):GetFirst()
local g=Duel.GetDecktopGroup(tp,num4)
Duel.DisableShuffleCheck()
Duel.Overlay(rc,g)
......@@ -689,7 +689,7 @@ function VgD.SpellCostOp(e,tp,eg,ep,ev,re,r,rp,chk,c,mc,num1,num2,num3,num4,num5
Duel.ChangePosition(g,POS_FACEDOWN)
end
end
function VgD.SpellOperation(op)
function vgd.SpellOperation(op)
return function (e,tp,eg,ep,ev,re,r,rp,bool)
if op then op(e,tp,eg,ep,ev,re,r,rp) end
local mc=e:GetLabelObject()
......
VgDefinition={}
VgID=10101001
vgdefinition={}
vgID=10101001
--min/max value
MIN_ID =1000 --4 digits, by DataManager::GetDesc()
MAX_ID =268435455 --28 bits, by DataManager::GetDesc()
......@@ -875,17 +875,17 @@ FLAG_ID_CHAINING =1
FLAG_ID_UNION =2
FLAG_ID_NO_NORMAL_DRAW =3
--Flag
CountTriggerFlag =VgID --计数标识
AttackTriggerFlag =VgID+1 --多次攻击判定标识
DamageTriggerFlag =VgID+2 --多次伤害判定标识
CountTriggerFlag =vgID --计数标识
AttackTriggerFlag =vgID+1 --多次攻击判定标识
DamageTriggerFlag =vgID+2 --多次伤害判定标识
--AffectedByEffect
AFFECT_CODE_MIX =VgID --魔合成
AFFECT_CODE_SendtoG =VgID+1 --
AFFECT_CODE_MIX =vgID --魔合成
AFFECT_CODE_SendtoG =vgID+1 --
--Counter
COUNTER_ENERGE =0x1 --能量爆发
--自定时点
EVENT_TRIGGER =VgID --判定时点
EVENT_CRITICAL_STRIKE =VgID+1 --暴击值结算时点
EVENT_TRIGGER =vgID --判定时点
EVENT_CRITICAL_STRIKE =vgID+1 --暴击值结算时点
POS_FACEUP_DEFENCE=POS_FACEUP_DEFENSE
......
VgF={}
vgf={}
function GetID()
local offset=self_code<100000000 and 1 or 100
return self_table,self_code,offset
end
function VgF.Stringid(code,id)
function vgf.Stringid(code,id)
return code*16+id
end
function VgF.SequenceToGlobal(p,loc,seq)
function vgf.SequenceToGlobal(p,loc,seq)
if p~=0 and p~=1 then
return 0
end
......@@ -27,17 +27,17 @@ function VgF.SequenceToGlobal(p,loc,seq)
return 0
end
end
function VgF.True()
function vgf.True()
return true
end
function VgF.Next(g)
function vgf.Next(g)
local first=true
return function()
if first then first=false return g:GetFirst()
else return g:GetNext() end
end
end
function VgF.GetValueType(v)
function vgf.GetValueType(v)
local t=type(v)
if t=="userdata" then
local mt=getmetatable(v)
......@@ -46,11 +46,11 @@ function VgF.GetValueType(v)
else return "Card" end
else return t end
end
function VgF.ReturnCard(g)
function vgf.ReturnCard(g)
local tc
if VgF.GetValueType(g)=="Group" then
if vgf.GetValueType(g)=="Group" then
tc=g:GetFirst()
elseif VgF.GetValueType(g)=="Card" then
elseif vgf.GetValueType(g)=="Card" then
tc=g
end
return tc
......@@ -74,19 +74,19 @@ end
function bit.bnot(a)
return ~a
end
function VgF.VMonsterFilter(c)
return VgF.IsSequence(c,5)
function vgf.VMonsterFilter(c)
return vgf.IsSequence(c,5)
end
function VgF.RMonsterFilter(c)
function vgf.RMonsterFilter(c)
return c:GetSequence()<5
end
function VgF.RMonsterCondition(e,c)
return VgF.RMonsterFilter(e:GetHandler())
function vgf.RMonsterCondition(e,c)
return vgf.RMonsterFilter(e:GetHandler())
end
function VgF.VMonsterCondition(e,c)
return VgF.VMonsterFilter(e:GetHandler())
function vgf.VMonsterCondition(e,c)
return vgf.VMonsterFilter(e:GetHandler())
end
function VgF.IsSequence(c,...)
function vgf.IsSequence(c,...)
for i,v in ipairs{...} do
if c:GetSequence()==v then
return true
......@@ -94,78 +94,78 @@ function VgF.IsSequence(c,...)
end
return false
end
function VgF.RuleCardCondtion(e)
function vgf.RuleCardCondtion(e)
local tp=e:GetHandlerPlayer()
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ALL,0,nil)
return e:GetHandler()==g:GetFirst()
end
function VgF.RuleTurnCondtion(e)
function vgf.RuleTurnCondtion(e)
local tp=e:GetHandlerPlayer()
local a=Duel.GetTurnCount(tp)
local b=Duel.GetTurnCount(1-tp)
return a+b==1
end
function VgF.Not(c,f)
function vgf.Not(c,f)
return not f(c)
end
function VgF.GetColumnGroup(c)
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)
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)
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)
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)
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)
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)
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)
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)
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)
return Duel.IsExistingMatchingCard(vgf.LvConditionFilter,tp,LOCATION_MZONE,0,1,nil,lv)
end
function VgF.LvConditionFilter(c,lv)
return VgF.VMonsterFilter(c) and c:IsLevelAbove(lv)
function vgf.LvConditionFilter(c,lv)
return vgf.VMonsterFilter(c) and c:IsLevelAbove(lv)
end
function VgF.AtkUp(c,g,val,reset)
function vgf.AtkUp(c,g,val,reset)
if not c or not g then return end
if not reset then reset=RESET_PHASE+PHASE_END end
local tc=VgF.ReturnCard(g)
local tc=vgf.ReturnCard(g)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
......@@ -173,10 +173,10 @@ function VgF.AtkUp(c,g,val,reset)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+reset)
tc:RegisterEffect(e1)
end
function VgF.StarUp(c,g,val,reset)
function vgf.StarUp(c,g,val,reset)
if not c or not g then return end
if not reset then reset=RESET_PHASE+PHASE_END end
local tc=VgF.ReturnCard(g)
local tc=vgf.ReturnCard(g)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LSCALE)
......@@ -189,7 +189,7 @@ function VgF.StarUp(c,g,val,reset)
e2:SetCode(EFFECT_UPDATE_RSCALE)
tc:RegisterEffect(e2)
end
function VgF.IsAbleToGZone(c)
function vgf.IsAbleToGZone(c)
if c:IsLocation(LOCATION_MZONE) then
return c:IsAttribute(SKILL_BLOCK)
end
......
--
local cm,m,o=GetID()
function cm.initial_effect(c)
VgD.Rule(c)
VgD.RideUp(c)
VgD.CallToR(c)
VgD.MonsterBattle(c)
VgD.CardTrigger(c,nil)
vgd.Rule(c)
vgd.RideUp(c)
vgd.CallToR(c)
vgd.MonsterBattle(c)
vgd.CardTrigger(c,nil)
end
\ No newline at end of file
--
local cm,m,o=GetID()
function cm.initial_effect(c)
VgD.Rule(c)
VgD.RideUp(c)
VgD.CallToR(c)
VgD.MonsterBattle(c)
VgD.CardTrigger(c,nil)
vgd.Rule(c)
vgd.RideUp(c)
vgd.CallToR(c)
vgd.MonsterBattle(c)
vgd.CardTrigger(c,nil)
end
\ No newline at end of file
--
local cm,m,o=GetID()
function cm.initial_effect(c)
VgD.Rule(c)
VgD.RideUp(c)
VgD.CallToR(c)
VgD.MonsterBattle(c)
VgD.CardTrigger(c,nil)
vgd.Rule(c)
vgd.RideUp(c)
vgd.CallToR(c)
vgd.MonsterBattle(c)
vgd.CardTrigger(c,nil)
end
\ No newline at end of file
--
local cm,m,o=GetID()
function cm.initial_effect(c)
VgD.Rule(c)
VgD.RideUp(c)
VgD.CallToR(c)
VgD.MonsterBattle(c)
VgD.CardTrigger(c,nil)
vgd.Rule(c)
vgd.RideUp(c)
vgd.CallToR(c)
vgd.MonsterBattle(c)
vgd.CardTrigger(c,nil)
end
\ No newline at end of file
--
local cm,m,o=GetID()
function cm.initial_effect(c)
VgD.Rule(c)
VgD.RideUp(c)
VgD.CallToR(c)
VgD.MonsterBattle(c)
VgD.CardTrigger(c,nil)
vgd.Rule(c)
vgd.RideUp(c)
vgd.CallToR(c)
vgd.MonsterBattle(c)
vgd.CardTrigger(c,nil)
end
\ No newline at end of file
--
local cm,m,o=GetID()
function cm.initial_effect(c)
VgD.Rule(c)
VgD.RideUp(c)
VgD.CallToR(c)
VgD.MonsterBattle(c)
VgD.CardTrigger(c,nil)
vgd.Rule(c)
vgd.RideUp(c)
vgd.CallToR(c)
vgd.MonsterBattle(c)
vgd.CardTrigger(c,nil)
end
\ No newline at end of file
--
local cm,m,o=GetID()
function cm.initial_effect(c)
VgD.Rule(c)
VgD.RideUp(c)
VgD.CallToR(c)
VgD.MonsterBattle(c)
VgD.CardTrigger(c,nil)
vgd.Rule(c)
vgd.RideUp(c)
vgd.CallToR(c)
vgd.MonsterBattle(c)
vgd.CardTrigger(c,nil)
end
\ No newline at end of file
--
local cm,m,o=GetID()
function cm.initial_effect(c)
VgD.Rule(c)
VgD.RideUp(c)
VgD.CallToR(c)
VgD.MonsterBattle(c)
VgD.CardTrigger(c,nil)
vgd.Rule(c)
vgd.RideUp(c)
vgd.CallToR(c)
vgd.MonsterBattle(c)
vgd.CardTrigger(c,nil)
end
\ No newline at end of file
--
local cm,m,o=GetID()
function cm.initial_effect(c)
VgD.Rule(c)
VgD.RideUp(c)
VgD.CallToR(c)
VgD.MonsterBattle(c)
VgD.CardTrigger(c,nil)
vgd.Rule(c)
vgd.RideUp(c)
vgd.CallToR(c)
vgd.MonsterBattle(c)
vgd.CardTrigger(c,nil)
end
\ No newline at end of file
--
local cm,m,o=GetID()
function cm.initial_effect(c)
VgD.Rule(c)
VgD.RideUp(c)
VgD.CallToR(c)
VgD.MonsterBattle(c)
VgD.CardTrigger(c,nil)
vgd.Rule(c)
vgd.RideUp(c)
vgd.CallToR(c)
vgd.MonsterBattle(c)
vgd.CardTrigger(c,nil)
end
\ No newline at end of file
--
local cm,m,o=GetID()
function cm.initial_effect(c)
VgD.Rule(c)
VgD.RideUp(c)
VgD.CallToR(c)
VgD.MonsterBattle(c)
VgD.CardTrigger(c,nil)
vgd.Rule(c)
vgd.RideUp(c)
vgd.CallToR(c)
vgd.MonsterBattle(c)
vgd.CardTrigger(c,nil)
end
\ No newline at end of file
--
local cm,m,o=GetID()
function cm.initial_effect(c)
VgD.Rule(c)
VgD.RideUp(c)
VgD.CallToR(c)
VgD.MonsterBattle(c)
VgD.CardTrigger(c,nil)
vgd.Rule(c)
vgd.RideUp(c)
vgd.CallToR(c)
vgd.MonsterBattle(c)
vgd.CardTrigger(c,nil)
end
\ No newline at end of file
--
local cm,m,o=GetID()
function cm.initial_effect(c)
VgD.Rule(c)
VgD.RideUp(c)
VgD.CallToR(c)
VgD.MonsterBattle(c)
VgD.CardTrigger(c,nil)
vgd.Rule(c)
vgd.RideUp(c)
vgd.CallToR(c)
vgd.MonsterBattle(c)
vgd.CardTrigger(c,nil)
end
\ No newline at end of file
--
local cm,m,o=GetID()
function cm.initial_effect(c)
VgD.Rule(c)
VgD.RideUp(c)
VgD.CallToR(c)
VgD.MonsterBattle(c)
VgD.CardTrigger(c,nil)
vgd.Rule(c)
vgd.RideUp(c)
vgd.CallToR(c)
vgd.MonsterBattle(c)
vgd.CardTrigger(c,nil)
end
\ No newline at end of file
--
local cm,m,o=GetID()
function cm.initial_effect(c)
VgD.Rule(c)
VgD.RideUp(c)
VgD.CardTrigger(c,nil)
VgD.SpellActivate(c,m,cm.op)
vgd.Rule(c)
vgd.RideUp(c)
vgd.CardTrigger(c,nil)
vgd.SpellActivate(c,m,cm.op)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
......
--
local cm,m,o=GetID()
function cm.initial_effect(c)
VgD.Rule(c)
VgD.RideUp(c)
VgD.CardTrigger(c,nil)
VgD.SpellActivate(c,m,nil,cm.op,0,1)
vgd.Rule(c)
vgd.RideUp(c)
vgd.CardTrigger(c,nil)
vgd.SpellActivate(c,m,nil,cm.op,0,1)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
......
--能量发生器
local cm,m,o=GetID()
function cm.initial_effect(c)
VgD.Rule(c)
vgd.Rule(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_DELAY)
......
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