Commit 0e89bd09 authored by jwyxym's avatar jwyxym Committed by GitHub

Add files via upload

parent 37ad18e9
......@@ -137,9 +137,9 @@ end
function VgD.CallOperation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local zone=0
if Duel.IsExistingMatchingCard(VgD.VMonsterFilter,tp,LOCATION_MZONE,0,1,nil) and Duel.SelectYesNo(tp,VgF.Stringid(VgID,7)) then
if Duel.IsExistingMatchingCard(VgF.VMonsterFilter,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,VgD.VMonsterFilter,tp,LOCATION_MZONE,0,1,1,nil):GetFirst()
local tc=Duel.SelectMatchingCard(tp,VgF.VMonsterFilter,tp,LOCATION_MZONE,0,1,1,nil):GetFirst()
if tc then
zone=VgF.SequenceToGlobal(tp,tc:GetLocation(),tc:GetSequence())
Duel.SendtoGrave(tc,REASON_COST)
......@@ -264,7 +264,7 @@ function VgD.MonsterPosDefenseOperation(e,tp,eg,ep,ev,re,r,rp)
end
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 (VgD.VMonsterFilter(c) or VgF.RMonsterFilter(c))
return Duel.GetTurnPlayer()==tp and c:IsPosition(POS_DEFENSE) and (VgF.VMonsterFilter(c) or VgF.RMonsterFilter(c))
end
function VgD.MonsterPosAttackOperation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......@@ -324,34 +324,66 @@ function VgD.MonsterCannotBeAttackedCondition(e,c)
end
--判定
function VgD.MonsterTrigger(c)
function VgD.MonsterTrigger(c,f)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_TRIGGER)
e1:SetCode(EVENT_CUSTOM+ToTrigger)
e1:SetCondition(VgD.MonsterTriggerCondtion(0))
e1:SetOperation(VgD.MonsterTriggerOperation(0))
e1:SetOperation(VgD.MonsterTriggerOperation(0,f))
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCondition(VgD.MonsterTriggerCondtion(1))
e2:SetOperation(VgD.MonsterTriggerOperation(1))
e2:SetOperation(VgD.MonsterTriggerOperation(1,f))
c:RegisterEffect(e2)
end
function VgD.MonsterTriggerCondtion(chkcon)
return function (e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rp=tp
if chkcon==0 then rp=1-tp end
return Duel.GetTurnPlayer()==rp
local cp=tp
if chkcon==0 then cp=1-tp end
return Duel.GetTurnPlayer()==cp
end
end
function VgD.MonsterTriggerOperation(chkop)
function VgD.MonsterTriggerOperation(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 tc1=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_MZONE,0,1,1,nil):GetFirst()
VgF.StarUp(c,tc1,1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKUP)
local tc2=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_MZONE,0,1,1,nil):GetFirst()
VgF.AtkUp(c,tc2,10000)
elseif c:IsRace(TRRIGGER_DRAW) then
Duel.Draw(tp,1,REASON_TRIGGER)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKUP)
local tc=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_MZONE,0,1,1,nil):GetFirst()
VgF.AtkUp(c,tc,10000)
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()
if tc then
Duel.SendtoGrave(tc,REASON_TRIGGER)
end
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)
end
end
if chkop==0 then
Duel.SendtoDamage(c)
Duel.Damage(tp,1,REASON_EFFECT)
if c:IsRace(TRRIGGER_SUPER) then
Duel.Exile(c,REASON_TRIGGER)
Duel.Draw(tp,1,REASON_TRIGGER)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKUP)
local tc=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_MZONE,0,1,1,nil):GetFirst()
VgF.AtkUp(c,tc,100000000)
else
Duel.SendtoDamage(c)
Duel.Damage(tp,1,REASON_TRIGGER)
end
local rc=re:GetHandler()
local bc=rc:GetBattleTarget()
local label=bc:GetFlagEffectLabel(DamageTriggerFlag)
......@@ -365,8 +397,17 @@ function VgD.MonsterTriggerOperation(chkop)
bc:ResetFlagEffect(DamageTriggerFlag)
end
else
Duel.SendtoHand(c,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c)
if c:IsRace(TRRIGGER_SUPER) then
Duel.Exile(c,REASON_TRIGGER)
Duel.Draw(tp,1,REASON_TRIGGER)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKUP)
local tc=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_MZONE,0,1,1,nil):GetFirst()
VgF.AtkUp(c,tc,100000000)
if f then f(e,tp,eg,ep,ev,re,r,rp) end
else
Duel.SendtoHand(c,nil,REASON_TRIGGER)
Duel.ConfirmCards(1-tp,c)
end
local rc=re:GetHandler()
local label=rc:GetFlagEffectLabel(AttackTriggerFlag)
if not label then return end
......@@ -479,7 +520,7 @@ function VgD.RuleGOperation(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,sg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=Duel.GetFieldGroup(tp,LOCATION_HAND,0):Select(tp,2,2,nil)
Duel.Exile(rg)
Duel.Exile(rg,REASON_PHASEG)
end
Duel.ShuffleDeck(tp)
end
......
......@@ -15,10 +15,10 @@ LOCATION_REMOVED =0x20 --封锁区
LOCATION_EXTRA =0x40 --额外
LOCATION_OVERLAY =0x80 --灵魂
LOCATION_ONFIELD =0x0c --场上(LOCATION_MZONE+LOCATION_SZONE)
--LOCATION_EXILE --除外区
--LOCATION_DAMAGE --伤害
--LOCATION_ORDER --指令
--LOCATION_SPARE --备用格子(用于怪物箱等)
LOCATION_SPARE =0x110 --备用格子(用于怪物箱等)
LOCATION_EXILE =0x120 --除外
LOCATION_DAMAGE =0x140 --伤害
LOCATION_ORDER =0x180 --指令区
LOCATION_RIDE =LOCATION_EXTRA
LOCATION_DROP =LOCATION_GRAVE
LOCATION_LOCK =LOCATION_REMOVED
......@@ -74,7 +74,7 @@ TYPE_LINK =0x4000000 --连接
TYPES_TOKEN_MONSTER =0x4011
TYPES_NORMAL_TRAP_MONSTER =0x111
TYPES_EFFECT_TRAP_MONSTER =0x121
--技能
--技能 --属性
SKILL_ALL =0x7f --All
SKILL_NONE =0x01 --无
SKILL_SUPPORT =0x02 --支援
......@@ -83,7 +83,7 @@ SKILL_THRICE_TRIGGER=0x08 --双判
SKILL_TWICE_TRIGGER =0x10 --三判
SKILL_SELF_RIDE =0x20 --人格骑升
SKILL_DEBRIS =0x40 --结晶碎片
--触发类型
--触发类型 --种族
TRRIGGER_ALL =0x3ffffff --All
TRRIGGER_NONE =0x1 --无
TRRIGGER_CRITICAL_STRIKE=0x2 --暴击触发
......@@ -124,6 +124,7 @@ REASON_MAINTENANCE =0x40000000 --维持代价
REASON_ACTION =0x80000000 --攻击宣言之际等
REASON_PHASEG =REASON_RULE --G辅助
REASON_PHASEDRAW =REASON_RULE --抽卡
REASON_TRIGGER =REASON_EFFECT --判定
--Location Reason
LOCATION_REASON_TOFIELD =0x1 --Duel.GetLocationCount()預設值,凱薩競技場
LOCATION_REASON_CONTROL =0x2 --Card.IsControlerCanBeChanged()使用
......@@ -387,7 +388,7 @@ EFFECT_TO_GRAVE_REDIRECT =63 --去墓地时重新指定去向
EFFECT_REMOVE_REDIRECT =64 --除外时重新指定去向
EFFECT_CANNOT_TO_HAND =65 --不能加入手牌
EFFECT_CANNOT_TO_DECK =66 --不能回卡组
EFFECT_CANNOT_REMOVE =67 --不能除外
EFFECT_CANNOT_REMOVE =67 --不能封锁
EFFECT_CANNOT_TO_GRAVE =68 --不能去墓地
EFFECT_CANNOT_TURN_SET =69 --不能变里侧
EFFECT_CANNOT_BE_BATTLE_TARGET =70 --不能成为攻击对象
......@@ -585,6 +586,7 @@ EFFECT_TUNER =369 --同调召唤时可以当作调整(百檎龙-苹果鳞
EFFECT_KAISER_COLOSSEUM =370 --皇帝斗技场
EFFECT_REPLACE_DAMAGE =371 --伤害由特定行动代替
EFFECT_FLAG_EFFECT =0x20000000 --标记类效果,即RegisterFlagEffect()创建的效果
EFFECT_CANNOT_TO_EXILE =0x688 ----不能除外
--下面是诱发效果的诱发事件、时点 (如果是TYPE_SINGLE则自己发生以下事件后触发,如果TYPE_FIELD则场上任何卡发生以下事件都触发)
EVENT_STARTUP =1000 --N/A
......@@ -745,7 +747,7 @@ HINTMSG_ATOHAND =506 --请选择要加入手牌的卡
HINTMSG_TODECK =507 --请选择要返回卡组的卡
HINTMSG_SUMMON =508 --请选择要召唤的卡
HINTMSG_SPSUMMON =509 --请选择要特殊召唤的卡
HINTMSG_DAMAGE =510 --请选择要消耗的费用
HINTMSG_SET =510 --请选择要盖放的卡
HINTMSG_FMATERIAL =511 --请选择要作为融合素材的卡
HINTMSG_SMATERIAL =512 --请选择要作为同调素材的卡
HINTMSG_XMATERIAL =513 --请选择要作为超量素材的卡
......@@ -792,7 +794,11 @@ HINTMSG_COUNTER =572 --请选择要放置指示物的卡
HINTMSG_DISABLE =573 --请选择要无效的卡
HINTMSG_OPERATECARD =574 --请选择要操作的卡
HINTMSG_LEAVEONFIELD =HINTMSG_RELEASE --请选择要退场的卡
HINTMSG_TODROP =HINTMSG_TOGRAVE --请选择要置入弃牌区的卡
HINTMSG_RIDEUP =HINTMSG_SUMMON --请选择要骑升的卡
HINTMSG_DAMAGE =HINTMSG_SET --请选择要消耗的费用
HINTMSG_ATKUP =HINTMSG_FMATERIAL --请选择力量上升的卡
HINTMSG_CRITICAL_STRIKE =HINTMSG_SMATERIAL --请选择☆值上升的卡
--Select --请选择
SELECT_HEADS =60 --正面
SELECT_TAILS =61 --反面
......
......@@ -2,13 +2,6 @@ VgF={}
POS_FACEUP_DEFENCE=POS_FACEUP_DEFENSE
POS_FACEDOWN_DEFENCE=POS_FACEDOWN_DEFENSE
function VgF.VgMonster(c)
VgD.Rule(c)
VgD.RideUp(c)
VgD.CallToV(c)
VgD.MonsterBattle(c)
VgD.MonsterTrigger(c)
end
function GetID()
local offset=self_code<100000000 and 1 or 100
return self_table,self_code,offset
......@@ -138,4 +131,27 @@ function VgF.LvCondition(e)
end
function VgF.LvConditionFilter(c,lv)
return VgF.RMonsterFilter(c) and c:IsLevelAbove(lv)
end
function VgF.AtkUp(c,tc,val)
if not tc then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(val)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
function VgF.StarUp(c,tc,val)
if not tc then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LSCALE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(val)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_RSCALE)
tc:RegisterEffect(e2)
end
\ No newline at end of file
--
local cm,m,o=GetID()
function cm.initial_effect(c)
VgF.VgMonster(c)
VgD.Rule(c)
VgD.RideUp(c)
VgD.CallToV(c)
VgD.MonsterBattle(c)
VgD.MonsterTrigger(c,nil)
end
\ No newline at end of file
--
local cm,m,o=GetID()
function cm.initial_effect(c)
VgF.VgMonster(c)
VgD.Rule(c)
VgD.RideUp(c)
VgD.CallToV(c)
VgD.MonsterBattle(c)
VgD.MonsterTrigger(c,nil)
end
\ No newline at end of file
--
local cm,m,o=GetID()
function cm.initial_effect(c)
VgF.VgMonster(c)
VgD.Rule(c)
VgD.RideUp(c)
VgD.CallToV(c)
VgD.MonsterBattle(c)
VgD.MonsterTrigger(c,nil)
end
\ No newline at end of file
--
local cm,m,o=GetID()
function cm.initial_effect(c)
VgF.VgMonster(c)
VgD.Rule(c)
VgD.RideUp(c)
VgD.CallToV(c)
VgD.MonsterBattle(c)
VgD.MonsterTrigger(c,nil)
end
\ No newline at end of file
--
local cm,m,o=GetID()
function cm.initial_effect(c)
VgF.VgMonster(c)
VgD.Rule(c)
VgD.RideUp(c)
VgD.CallToV(c)
VgD.MonsterBattle(c)
VgD.MonsterTrigger(c,nil)
end
\ No newline at end of file
--
local cm,m,o=GetID()
function cm.initial_effect(c)
VgF.VgMonster(c)
VgD.Rule(c)
VgD.RideUp(c)
VgD.CallToV(c)
VgD.MonsterBattle(c)
VgD.MonsterTrigger(c,nil)
end
\ No newline at end of file
--
local cm,m,o=GetID()
function cm.initial_effect(c)
VgF.VgMonster(c)
VgD.Rule(c)
VgD.RideUp(c)
VgD.CallToV(c)
VgD.MonsterBattle(c)
VgD.MonsterTrigger(c,nil)
end
\ No newline at end of file
--
local cm,m,o=GetID()
function cm.initial_effect(c)
VgF.VgMonster(c)
VgD.Rule(c)
VgD.RideUp(c)
VgD.CallToV(c)
VgD.MonsterBattle(c)
VgD.MonsterTrigger(c,nil)
end
\ No newline at end of file
--
local cm,m,o=GetID()
function cm.initial_effect(c)
VgF.VgMonster(c)
VgD.Rule(c)
VgD.RideUp(c)
VgD.CallToV(c)
VgD.MonsterBattle(c)
VgD.MonsterTrigger(c,nil)
end
\ No newline at end of file
--
local cm,m,o=GetID()
function cm.initial_effect(c)
VgF.VgMonster(c)
VgD.Rule(c)
VgD.RideUp(c)
VgD.CallToV(c)
VgD.MonsterBattle(c)
VgD.MonsterTrigger(c,nil)
end
\ No newline at end of file
--
local cm,m,o=GetID()
function cm.initial_effect(c)
VgF.VgMonster(c)
VgD.Rule(c)
VgD.RideUp(c)
VgD.CallToV(c)
VgD.MonsterBattle(c)
VgD.MonsterTrigger(c,nil)
end
\ No newline at end of file
--
local cm,m,o=GetID()
function cm.initial_effect(c)
VgF.VgMonster(c)
VgD.Rule(c)
VgD.RideUp(c)
VgD.CallToV(c)
VgD.MonsterBattle(c)
VgD.MonsterTrigger(c,nil)
end
\ No newline at end of file
--
local cm,m,o=GetID()
function cm.initial_effect(c)
VgF.VgMonster(c)
VgD.Rule(c)
VgD.RideUp(c)
VgD.CallToV(c)
VgD.MonsterBattle(c)
VgD.MonsterTrigger(c,nil)
end
\ No newline at end of file
--
local cm,m,o=GetID()
function cm.initial_effect(c)
VgF.VgMonster(c)
VgD.Rule(c)
VgD.RideUp(c)
VgD.CallToV(c)
VgD.MonsterBattle(c)
VgD.MonsterTrigger(c,nil)
end
\ No newline at end of file
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