Commit 6346777a authored by xiaoye's avatar xiaoye

fix

parent 0a5ce37d
...@@ -643,10 +643,12 @@ function VgD.CardTriggerOperation(chkop,f) ...@@ -643,10 +643,12 @@ function VgD.CardTriggerOperation(chkop,f)
Duel.HintSelection(g) Duel.HintSelection(g)
VgF.AtkUp(c,g,100000000,nil) VgF.AtkUp(c,g,100000000,nil)
Duel.Draw(tp,1,REASON_TRIGGER) Duel.Draw(tp,1,REASON_TRIGGER)
VgF.Sendto(LOCATION_EXILE,c,REASON_TRIGGER) if c:IsRelateToEffect(e) then VgF.Sendto(LOCATION_EXILE,c,REASON_TRIGGER) end
else else
VgF.Sendto(LOCATION_DAMAGE,c,tp,POS_FACEUP_ATTACK,REASON_EFFECT) if c:IsRelateToEffect(e) then
Duel.Damage(tp,1,REASON_TRIGGER) VgF.Sendto(LOCATION_DAMAGE,c,tp,POS_FACEUP_ATTACK,REASON_EFFECT)
Duel.Damage(tp,1,REASON_TRIGGER)
end
end 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 bc=rc:GetBattleTarget()
...@@ -662,6 +664,7 @@ function VgD.CardTriggerOperation(chkop,f) ...@@ -662,6 +664,7 @@ function VgD.CardTriggerOperation(chkop,f)
Duel.RaiseEvent(rc,EVENT_CUSTOM+EVENT_DAMAGE_TRIGGER,e,0,tp,tp,0) Duel.RaiseEvent(rc,EVENT_CUSTOM+EVENT_DAMAGE_TRIGGER,e,0,tp,tp,0)
end end
else else
VgD.OperationWhenCardTrigger(e,tp,eg,ep,ev,re,r,rp,c)
if c:IsRace(TRIGGER_SUPER) then if c:IsRace(TRIGGER_SUPER) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATKUP)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_MZONE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_MZONE,0,1,1,nil)
...@@ -669,9 +672,9 @@ function VgD.CardTriggerOperation(chkop,f) ...@@ -669,9 +672,9 @@ function VgD.CardTriggerOperation(chkop,f)
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 if f then f(e,tp,eg,ep,ev,re,r,rp) end
Duel.Draw(tp,1,REASON_TRIGGER) Duel.Draw(tp,1,REASON_TRIGGER)
VgF.Sendto(LOCATION_EXILE,c,REASON_TRIGGER) if c:IsRelateToEffect(e) then VgF.Sendto(LOCATION_EXILE,c,REASON_TRIGGER) end
else else
VgF.Sendto(LOCATION_HAND,c,nil,REASON_TRIGGER) if c:IsRelateToEffect(e) then VgF.Sendto(LOCATION_HAND,c,nil,REASON_TRIGGER) end
end 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(FLAG_ATTACK_TRIGGER) local label=rc:GetFlagEffectLabel(FLAG_ATTACK_TRIGGER)
...@@ -688,6 +691,24 @@ function VgD.CardTriggerOperation(chkop,f) ...@@ -688,6 +691,24 @@ function VgD.CardTriggerOperation(chkop,f)
end end
end end
function VgD.OperationWhenCardTrigger(e,tp,eg,ep,ev,re,r,rp,c)
local effect_when_trigger
tabel.copy(effect_when_trigger,c.effect_when_trigger)
local cost,con,tg=true,true,true
if #effect_when_trigger==0 then return end
if VgF.GetValueType(effect_when_trigger[2])=="function" then cost=effect_when_trigger[2](e,tp,eg,ep,ev,re,r,rp,0) end
if VgF.GetValueType(effect_when_trigger[3])=="function" then con=effect_when_trigger[3](e,tp,eg,ep,ev,re,r,rp) end
if VgF.GetValueType(effect_when_trigger[4])=="function" then tg=effect_when_trigger[4](e,tp,eg,ep,ev,re,r,rp,0) end
if VgF.GetValueType(effect_when_trigger[1])=="function" and cost and con and tg and Duel.SelectYesNo(tp,VgF.Stringid(VgID,15)) then
Duel.HintSelection(Group.FromCards(c))
local _,m=c:GetOriginalCode()
Duel.Hint(HINT_CARD,0,m)
if VgF.GetValueType(effect_when_trigger[2])=="function" then effect_when_trigger[2](e,tp,eg,ep,ev,re,r,rp,1) end
if VgF.GetValueType(effect_when_trigger[4])=="function" then effect_when_trigger[4](e,tp,eg,ep,ev,re,r,rp,1) end
effect_when_trigger[1](e,tp,eg,ep,ev,re,r,rp)
end
end
--vg规则 --vg规则
function VgD.Rule(c) function VgD.Rule(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -1078,7 +1099,7 @@ function VgD.EffectTypeTrigger(c,m,loc,typ,code,op,cost,con,tg,count,property,st ...@@ -1078,7 +1099,7 @@ function VgD.EffectTypeTrigger(c,m,loc,typ,code,op,cost,con,tg,count,property,st
e1:SetType(typ+type2) e1:SetType(typ+type2)
if VgF.GetValueType(loc)=="number" then e1:SetRange(loc) end if VgF.GetValueType(loc)=="number" then e1:SetRange(loc) end
e1:SetCode(code) e1:SetCode(code)
e1:SetProperty(property+EFFECT_FLAG_DELAY) e1:SetProperty(property+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
if count and count>0 then e1:SetCountLimit(count) end if count and count>0 then e1:SetCountLimit(count) end
if VgF.GetValueType(con)=="function" then e1:SetCondition(con) end if VgF.GetValueType(con)=="function" then e1:SetCondition(con) end
if VgF.GetValueType(cost)=="function" then e1:SetCost(cost) end if VgF.GetValueType(cost)=="function" then e1:SetCost(cost) end
......
...@@ -92,11 +92,13 @@ SKILL_DEBRIS =0x40 --结晶碎片 ...@@ -92,11 +92,13 @@ SKILL_DEBRIS =0x40 --结晶碎片
--触发类型 --种族 --触发类型 --种族
TRIGGER_ALL =0x3ffffff --All TRIGGER_ALL =0x3ffffff --All
TRIGGER_NONE =0x1 --无 TRIGGER_NONE =0x1 --无
TRIGGER_CRITICAL_STRIKE=0x2 --暴击触发 TRIGGER_CRITICAL_STRIKE =0x2 --暴击触发
TRIGGER_DRAW =0x4 --抽牌触发 TRIGGER_DRAW =0x4 --抽牌触发
TRIGGER_HEAL =0x8 --治愈触发 TRIGGER_HEAL =0x8 --治愈触发
TRIGGER_ADVANCE =0x10 --前列触发 TRIGGER_ADVANCE =0x10 --前列触发
TRIGGER_SUPER =0x20 --超限触发 TRIGGER_SUPER =0x20 --超限触发
--组合类型
TRIGGER_CARDS =0x3e --触发单位卡
--Category 效果分类 --Category 效果分类
CATEGORY_DEFENDER =0x1 --守护者 CATEGORY_DEFENDER =0x1 --守护者
--Reason 卡片到当前位置的原因 --Reason 卡片到当前位置的原因
......
...@@ -1151,6 +1151,11 @@ function VgF.AddMixCostGroupFilter(c,m,...) ...@@ -1151,6 +1151,11 @@ function VgF.AddMixCostGroupFilter(c,m,...)
local cm=_G["c"..m] local cm=_G["c"..m]
cm.cos_filter={...} cm.cos_filter={...}
end end
function VgF.AddEffectWhenTrigger(c,m,op,cost,con,tg)
local cm=_G["c"..m]
cm.effect_when_trigger={op,cost,con,tg}
end
function VgF.ShiftLocationFromString(str) function VgF.ShiftLocationFromString(str)
local loc=0 local loc=0
if str=="POSCHANGE" then return str end if str=="POSCHANGE" then return str end
......
...@@ -3,7 +3,7 @@ local cm,m,o=GetID() ...@@ -3,7 +3,7 @@ local cm,m,o=GetID()
function cm.initial_effect(c) function cm.initial_effect(c)
vgf.VgCard(c) vgf.VgCard(c)
--【自】【V】【1回合1次】:你的攻击判定将等级3的卡判出的战斗结束时,通过【费用】[将手牌中的1张卡舍弃],选择你的1张后防者,重置,这个回合中,那个单位的力量+10000。 --【自】【V】【1回合1次】:你的攻击判定将等级3的卡判出的战斗结束时,通过【费用】[将手牌中的1张卡舍弃],选择你的1张后防者,重置,这个回合中,那个单位的力量+10000。
vgd.EffectTypeTrigger(c,m,LOCATION_MZONE,EFFECT_TYPE_FIELD,EVENT_BATTLED,cm.operation,vgf.DisCardCost(1),cm.condition,nil,1,EFFECT_FLAG_DAMAGE_STEP) vgd.EffectTypeTrigger(c,m,LOCATION_MZONE,EFFECT_TYPE_FIELD,EVENT_BATTLED,cm.operation,vgf.DisCardCost(1),cm.condition,nil,1)
if not cm.global_check then if not cm.global_check then
cm.global_check=true cm.global_check=true
local ge1=Effect.CreateEffect(c) local ge1=Effect.CreateEffect(c)
...@@ -25,7 +25,7 @@ function cm.initial_effect(c) ...@@ -25,7 +25,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function cm.checkfilter(c,tp) function cm.checkfilter(c,tp)
return c:IsLocation(LOCATION_TRIGGER) and c:IsLevel(3) and c:IsControler(tp) and Duel.GetTurnPlayer()==tp return c:IsLocation(LOCATION_TRIGGER) and c:IsLevel(3) and c:IsControler(tp)
end end
function cm.checkcon(e,tp,eg,ep,ev,re,r,rp) function cm.checkcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.checkfilter,1,nil,tp) and Duel.GetTurnPlayer()==tp and Duel.GetAttackTarget() return eg:IsExists(cm.checkfilter,1,nil,tp) and Duel.GetTurnPlayer()==tp and Duel.GetAttackTarget()
......
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)
vgd.EffectTypeTrigger(c,m,LOCATION_MZONE,EFFECT_TYPE_FIELD,EVENT_MOVE,vgf.DamageFill(1),vgf.OverlayCost(2),cm.con,nil,1)
end end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return vgf.RMonsterCondition(e) and eg:IsExists(cm.filter,1,nil,tp) and Duel.GetTurnPlayer()==tp and Duel.GetAttackTarget()
end
function cm.filter(c,tp)
return c:IsRace(TRIGGER_CARDS) and c:IsLocation(LOCATION_TRIGGER) and c:IsControler(tp)
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