Commit e320c9d5 authored by mercury233's avatar mercury233 Committed by GitHub

add Auxiliary.CreateMaterialReasonCardRelation (#2071)

parent b869f295
......@@ -36,6 +36,7 @@ function c21915012.initial_effect(c)
e3:SetTarget(c21915012.thtg)
e3:SetOperation(c21915012.thop)
c:RegisterEffect(e3)
aux.CreateMaterialReasonCardRelation(c,e3)
end
function c21915012.matfilter(c)
return c:IsType(TYPE_TUNER)
......@@ -103,10 +104,14 @@ function c21915012.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local rc=e:GetHandler():GetReasonCard()
local lv=rc:GetLevel()
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,lv*100)
if rc:IsRelateToEffect(e) and rc:IsFaceup() then
Duel.SetTargetCard(rc)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,lv*100)
end
end
function c21915012.thop(e,tp,eg,ep,ev,re,r,rp)
local rc=e:GetHandler():GetReasonCard()
local rc=Duel.GetFirstTarget()
if not rc or not rc:IsRelateToChain() or rc:IsFacedown() then return end
local lv=rc:GetLevel()
if Duel.Damage(1-tp,lv*100,REASON_EFFECT)~=0 and Duel.IsExistingMatchingCard(c21915012.thfilter,tp,LOCATION_DECK,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(21915012,3)) then
......
......@@ -12,38 +12,28 @@ function c30968774.initial_effect(c)
e1:SetTarget(c30968774.drtg)
e1:SetOperation(c30968774.drop)
c:RegisterEffect(e1)
--reg
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetCondition(c30968774.drcon)
e2:SetOperation(c30968774.regop)
c:RegisterEffect(e2)
aux.CreateMaterialReasonCardRelation(c,e1)
end
function c30968774.drcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_LINK
end
function c30968774.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
local rc=e:GetHandler():GetReasonCard()
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and rc:IsAttackAbove(500) and rc:GetFlagEffect(30968774)~=0 end
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and rc:IsRelateToEffect(e) end
Duel.SetTargetCard(rc)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c30968774.drop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
if not rc:IsAttackAbove(500) or rc:IsImmuneToEffect(e) or rc:GetFlagEffect(30968774)==0 then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e1)
if not rc:IsHasEffect(EFFECT_REVERSE_UPDATE) then
local rc=Duel.GetFirstTarget()
if rc:IsRelateToChain() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e1)
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function c30968774.regop(e,tp,eg,ep,ev,re,r,rp)
local rc=e:GetHandler():GetReasonCard()
rc:RegisterFlagEffect(30968774,RESET_EVENT+RESETS_STANDARD,0,1)
Duel.Draw(tp,1,REASON_EFFECT)
end
......@@ -7,31 +7,51 @@ function c40348946.initial_effect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BE_MATERIAL)
e1:SetCondition(c40348946.con)
e1:SetTarget(c40348946.tg)
e1:SetOperation(c40348946.op)
c:RegisterEffect(e1)
aux.CreateMaterialReasonCardRelation(c,e1)
end
function c40348946.con(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsLocation(LOCATION_GRAVE) and r==REASON_SYNCHRO and c:GetReasonCard():IsRace(RACE_DRAGON)
end
function c40348946.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local rc=e:GetHandler():GetReasonCard()
if chk==0 then return rc:IsRelateToEffect(e) and rc:IsFaceup() end
Duel.SetTargetCard(rc)
end
function c40348946.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sync=c:GetReasonCard()
local sync=Duel.GetFirstTarget()
if not sync:IsRelateToChain() or sync:IsFacedown() or sync:IsImmuneToEffect(e) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(800)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
sync:RegisterEffect(e1)
sync:RegisterFlagEffect(40348946,RESET_EVENT+RESETS_STANDARD,0,1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetCountLimit(1)
e2:SetLabelObject(sync)
e2:SetCondition(c40348946.rmcon)
e2:SetOperation(c40348946.rmop)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
sync:RegisterEffect(e2)
Duel.RegisterEffect(e2,tp)
end
function c40348946.rmcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffect(40348946)~=0 then
return true
else
e:Reset()
return false
end
end
function c40348946.rmop(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT)
local tc=e:GetLabelObject()
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
......@@ -10,6 +10,7 @@ function c43014054.initial_effect(c)
e1:SetTarget(c43014054.damtg)
e1:SetOperation(c43014054.damop)
c:RegisterEffect(e1)
aux.CreateMaterialReasonCardRelation(c,e1)
end
function c43014054.damcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_SYNCHRO
......@@ -17,15 +18,18 @@ end
function c43014054.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local rc=e:GetHandler():GetReasonCard()
Duel.SetTargetPlayer(rc:GetControler())
if rc:IsRelateToEffect(e) and rc:IsFaceup() then
Duel.SetTargetCard(rc)
end
Duel.SetTargetPlayer(rp)
Duel.SetTargetParam(2000)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,rc:GetControler(),2000)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,rp,2000)
end
function c43014054.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
local rc=e:GetHandler():GetReasonCard()
if rc:IsFaceup() and rc:IsOnField() then
local rc=Duel.GetFirstTarget()
if rc and rc:IsFaceup() and rc:IsRelateToChain() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
......
......@@ -9,8 +9,10 @@ function c5519829.initial_effect(c)
e1:SetCode(EVENT_BE_MATERIAL)
e1:SetCondition(c5519829.con)
e1:SetCost(c5519829.cost)
e1:SetTarget(c5519829.tg)
e1:SetOperation(c5519829.op)
c:RegisterEffect(e1)
aux.CreateMaterialReasonCardRelation(c,e1)
end
function c5519829.con(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_SYNCHRO
......@@ -19,9 +21,15 @@ function c5519829.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,500) end
Duel.PayLPCost(tp,500)
end
function c5519829.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local rc=e:GetHandler():GetReasonCard()
if chk==0 then return rc:IsRelateToEffect(e) and rc:IsFaceup() end
Duel.SetTargetCard(rc)
end
function c5519829.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sync=c:GetReasonCard()
local sync=Duel.GetFirstTarget()
if not sync:IsRelateToChain() or sync:IsFacedown() then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
......
......@@ -7,8 +7,10 @@ function c67586735.initial_effect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BE_MATERIAL)
e1:SetCondition(c67586735.atkcon)
e1:SetTarget(c67586735.atktg)
e1:SetOperation(c67586735.atkop)
c:RegisterEffect(e1)
aux.CreateMaterialReasonCardRelation(c,e1)
--todeck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(67586735,1))
......@@ -26,10 +28,15 @@ function c67586735.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsLocation(LOCATION_GRAVE) and r==REASON_LINK and c:GetReasonCard():IsSetCard(0xfc)
end
function c67586735.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
local rc=e:GetHandler():GetReasonCard()
if chk==0 then return rc:IsRelateToEffect(e) and rc:IsFaceup() end
Duel.SetTargetCard(rc)
end
function c67586735.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
if rc:IsFaceup() and rc:IsLocation(LOCATION_MZONE) then
local rc=Duel.GetFirstTarget()
if rc:IsFaceup() and rc:IsRelateToChain() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
......
......@@ -12,6 +12,7 @@ function c69550259.initial_effect(c)
e1:SetTarget(c69550259.sptg)
e1:SetOperation(c69550259.spop)
c:RegisterEffect(e1)
aux.CreateMaterialReasonCardRelation(c,e1)
end
function c69550259.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_SYNCHRO
......@@ -19,12 +20,16 @@ end
function c69550259.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local rc=e:GetHandler():GetReasonCard()
local lv=rc:GetOriginalLevel()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,69550260,0x2016,TYPES_TOKEN_MONSTER,0,0,lv,RACE_MACHINE,ATTRIBUTE_WIND) end
if chk==0 then return rc:IsRelateToEffect(e) and rc:IsFaceup()
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,69550260,0x2016,TYPES_TOKEN_MONSTER,0,0,lv,RACE_MACHINE,ATTRIBUTE_WIND) end
Duel.SetTargetCard(rc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
end
function c69550259.spop(e,tp,eg,ep,ev,re,r,rp)
local rc=e:GetHandler():GetReasonCard()
local rc=Duel.GetFirstTarget()
if not rc:IsRelateToChain() or rc:IsFacedown() then return end
local lv=rc:GetOriginalLevel()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if Duel.IsPlayerCanSpecialSummonMonster(tp,69550260,0x2016,TYPES_TOKEN_MONSTER,0,0,lv,RACE_MACHINE,ATTRIBUTE_WIND) then
......
......@@ -35,6 +35,7 @@ function c70939418.initial_effect(c)
e3:SetTarget(c70939418.ddtg)
e3:SetOperation(c70939418.ddop)
c:RegisterEffect(e3)
aux.CreateMaterialReasonCardRelation(c,e3)
end
function c70939418.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE
......@@ -79,15 +80,19 @@ function c70939418.ddcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_SYNCHRO
end
function c70939418.ddtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1) end
local rc=e:GetHandler():GetReasonCard()
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1)
and rc:IsRelateToEffect(e) and rc:IsFaceup() end
Duel.SetTargetCard(rc)
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,1)
end
function c70939418.ddop(e,tp,eg,ep,ev,re,r,rp)
if Duel.DiscardDeck(tp,1,REASON_EFFECT)==0 then return end
local tc=Duel.GetOperatedGroup():GetFirst()
local c=e:GetHandler()
local sync=c:GetReasonCard()
if tc and tc:IsSetCard(0x2016) and tc:IsType(TYPE_MONSTER) and tc:IsLocation(LOCATION_GRAVE) then
local sync=Duel.GetFirstTarget()
if not sync:IsRelateToChain() or sync:IsFacedown() then return end
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
......
......@@ -11,14 +11,6 @@ function c8576764.initial_effect(c)
e1:SetTarget(c8576764.sptg)
e1:SetOperation(c8576764.spop)
c:RegisterEffect(e1)
--chk
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_BE_MATERIAL)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCondition(c8576764.atkcon)
e0:SetOperation(c8576764.chkop)
c:RegisterEffect(e0)
--atk/def
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(8576764,1))
......@@ -30,7 +22,7 @@ function c8576764.initial_effect(c)
e2:SetTarget(c8576764.atktg)
e2:SetOperation(c8576764.atkop)
c:RegisterEffect(e2)
e0:SetLabelObject(e2)
aux.CreateMaterialReasonCardRelation(c,e2)
end
function c8576764.spfilter(c,e,tp,lv)
return c:IsRace(RACE_FISH+RACE_SEASERPENT+RACE_AQUA) and c:IsLevelBelow(lv) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......@@ -55,20 +47,18 @@ function c8576764.spop(e,tp,eg,ep,ev,re,r,rp)
end
Duel.SpecialSummonComplete()
end
function c8576764.chkop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():GetReasonCard():CreateEffectRelation(e:GetLabelObject())
end
function c8576764.atkcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_SYNCHRO
end
function c8576764.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
local rc=e:GetHandler():GetReasonCard()
if chk==0 then return rc:IsRelateToEffect(e) and rc:IsFaceup() and Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end
Duel.SetTargetCard(rc)
end
function c8576764.atkop(e,tp,eg,ep,ev,re,r,rp)
local rc=e:GetHandler():GetReasonCard()
local rc=Duel.GetFirstTarget()
local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)
if rc:IsRelateToEffect(e) and rc:IsFaceup() and ct>0 then
if rc:IsRelateToChain() and rc:IsFaceup() and ct>0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
......
......@@ -23,13 +23,7 @@ function c88093706.initial_effect(c)
e2:SetTarget(c88093706.eftg)
e2:SetOperation(c88093706.efop)
c:RegisterEffect(e2)
--reg
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_BE_MATERIAL)
e3:SetCondition(c88093706.efcon)
e3:SetOperation(c88093706.regop)
c:RegisterEffect(e3)
aux.CreateMaterialReasonCardRelation(c,e2)
end
function c88093706.mfilter(c)
return c:IsLevelAbove(2) and c:IsLinkRace(RACE_CYBERSE)
......@@ -133,14 +127,13 @@ function c88093706.efcon(e,tp,eg,ep,ev,re,r,rp)
end
function c88093706.eftg(e,tp,eg,ep,ev,re,r,rp,chk)
local rc=e:GetHandler():GetReasonCard()
if chk==0 then return Duel.IsAbleToEnterBP()
and rc:GetFlagEffect(88093706)~=0 and rc:GetFlagEffect(88093707)==0 end
rc:RegisterFlagEffect(88093707,RESET_EVENT+RESETS_STANDARD,0,1)
if chk==0 then return rc:IsRelateToEffect(e) and Duel.IsAbleToEnterBP() end
Duel.SetTargetCard(rc)
end
function c88093706.efop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
if rc:GetFlagEffect(88093706)==0 then return end
local rc=Duel.GetFirstTarget()
if not rc:IsRelateToChain() then return end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(88093706,2))
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
......@@ -150,7 +143,3 @@ function c88093706.efop(e,tp,eg,ep,ev,re,r,rp)
e1:SetValue(1)
rc:RegisterEffect(e1)
end
function c88093706.regop(e,tp,eg,ep,ev,re,r,rp)
local rc=e:GetHandler():GetReasonCard()
rc:RegisterFlagEffect(88093706,RESET_EVENT+RESETS_STANDARD,0,1)
end
......@@ -20,8 +20,10 @@ function c93507434.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetCondition(c93507434.atkcon)
e2:SetTarget(c93507434.atktg)
e2:SetOperation(c93507434.atkop)
c:RegisterEffect(e2)
aux.CreateMaterialReasonCardRelation(c,e2)
end
function c93507434.tgcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)<Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)
......@@ -43,10 +45,15 @@ function c93507434.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsLocation(LOCATION_GRAVE) and r==REASON_LINK and c:GetReasonCard():IsSetCard(0x11a)
end
function c93507434.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
local rc=e:GetHandler():GetReasonCard()
if chk==0 then return rc:IsRelateToEffect(e) end
Duel.SetTargetCard(rc)
end
function c93507434.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
if rc:IsFaceup() and rc:IsLocation(LOCATION_MZONE) then
local rc=Duel.GetFirstTarget()
if rc:IsRelateToChain() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
......
......@@ -12,6 +12,7 @@ function c95504778.initial_effect(c)
e1:SetTarget(c95504778.sptg)
e1:SetOperation(c95504778.spop)
c:RegisterEffect(e1)
aux.CreateMaterialReasonCardRelation(c,e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(95504778,1))
......@@ -33,14 +34,20 @@ function c95504778.spcon(e,tp,eg,ep,ev,re,r,rp)
end
function c95504778.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local zone=bit.band(c:GetReasonCard():GetLinkedZone(tp),0x1f)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK,tp,zone) end
local rc=c:GetReasonCard()
if chk==0 then
local zone=bit.band(rc:GetLinkedZone(tp),0x1f)
return rc:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK,tp,zone)
end
Duel.SetTargetCard(rc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c95504778.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local zone=bit.band(c:GetReasonCard():GetLinkedZone(tp),0x1f)
local rc=Duel.GetFirstTarget()
if not rc:IsRelateToChain() then return end
local zone=bit.band(rc:GetLinkedZone(tp),0x1f)
if c:IsRelateToEffect(e) and zone~=0 and Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP_ATTACK,zone) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -2421,6 +2421,21 @@ function Auxiliary.sumreg(e,tp,eg,ep,ev,re,r,rp)
tc=eg:GetNext()
end
end
--for EVENT_BE_MATERIAL effect releated to the summoned monster
function Auxiliary.CreateMaterialReasonCardRelation(c,te)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_BE_MATERIAL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetOperation(Auxiliary.MaterialReasonCardReg)
e1:SetLabelObject(te)
c:RegisterEffect(e1)
end
function Auxiliary.MaterialReasonCardReg(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local te=e:GetLabelObject()
c:GetReasonCard():CreateEffectRelation(te)
end
--sp_summon condition for fusion monster
function Auxiliary.fuslimit(e,se,sp,st)
return st&SUMMON_TYPE_FUSION==SUMMON_TYPE_FUSION
......
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