Commit ab6eba7a authored by Chen Bill's avatar Chen Bill Committed by GitHub

add Auxiliary.EnableArcanaCoin (#2733)

* add FLAG_ID_ARCANA_COIN

* fix 逆転する運命

* add Auxiliary.EnableArcanaCoin

* use Auxiliary.EnableArcanaCoin

* fix アルカナフォースⅦ-THE CHARIOT

* fix Auxiliary.ArcanaCoinOperation
parent ed779ce7
...@@ -2,35 +2,9 @@ ...@@ -2,35 +2,9 @@
---@param c Card ---@param c Card
function c23846921.initial_effect(c) function c23846921.initial_effect(c)
--coin --coin
local e1=Effect.CreateEffect(c) aux.EnableArcanaCoin(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP_SUMMON_SUCCESS,EVENT_SPSUMMON_SUCCESS)
e1:SetDescription(aux.Stringid(23846921,0))
e1:SetCategory(CATEGORY_COIN)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c23846921.cointg)
e1:SetOperation(c23846921.coinop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e3)
end end
c23846921.toss_coin=true c23846921.toss_coin=true
function c23846921.cointg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1)
end
function c23846921.coinop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local res=0
if c:IsHasEffect(73206827) then
res=1-Duel.SelectOption(tp,60,61)
else res=Duel.TossCoin(tp,1) end
c23846921.arcanareg(c,res)
end
function c23846921.arcanareg(c,coin) function c23846921.arcanareg(c,coin)
--coin effect --coin effect
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -58,10 +32,10 @@ function c23846921.arcanareg(c,coin) ...@@ -58,10 +32,10 @@ function c23846921.arcanareg(c,coin)
e2:SetOperation(c23846921.thop) e2:SetOperation(c23846921.thop)
e2:SetReset(RESET_EVENT+RESETS_STANDARD) e2:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e2) c:RegisterEffect(e2)
c:RegisterFlagEffect(36690018,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,coin,63-coin) c:RegisterFlagEffect(FLAG_ID_ARCANA_COIN,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,coin,63-coin)
end end
function c23846921.skipcon(e,tp,eg,ep,ev,re,r,rp) function c23846921.skipcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and e:GetHandler():GetFlagEffectLabel(36690018)==1 return ep==tp and e:GetHandler():GetFlagEffectLabel(FLAG_ID_ARCANA_COIN)==1
end end
function c23846921.skipcost(e,tp,eg,ep,ev,re,r,rp,chk) function c23846921.skipcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_MZONE,0,2,nil) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_MZONE,0,2,nil) end
...@@ -82,7 +56,7 @@ function c23846921.skipop(e,tp,eg,ep,ev,re,r,rp) ...@@ -82,7 +56,7 @@ function c23846921.skipop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
end end
function c23846921.thcon(e,tp,eg,ep,ev,re,r,rp) function c23846921.thcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and e:GetHandler():GetFlagEffectLabel(36690018)==0 return ep~=tp and e:GetHandler():GetFlagEffectLabel(FLAG_ID_ARCANA_COIN)==0
end end
function c23846921.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function c23846921.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
......
...@@ -7,7 +7,7 @@ function c34568403.initial_effect(c) ...@@ -7,7 +7,7 @@ function c34568403.initial_effect(c)
e1:SetCategory(CATEGORY_COIN) e1:SetCategory(CATEGORY_COIN)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c34568403.cointg) e1:SetTarget(aux.ArcanaCoinTarget)
e1:SetOperation(c34568403.coinop) e1:SetOperation(c34568403.coinop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=e1:Clone() local e2=e1:Clone()
...@@ -18,17 +18,20 @@ function c34568403.initial_effect(c) ...@@ -18,17 +18,20 @@ function c34568403.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
c34568403.toss_coin=true c34568403.toss_coin=true
function c34568403.cointg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1)
end
function c34568403.coinop(e,tp,eg,ep,ev,re,r,rp) function c34568403.coinop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local res=0 local res=0
local toss=false
if c:IsHasEffect(73206827) then if c:IsHasEffect(73206827) then
res=1-Duel.SelectOption(tp,60,61) res=1-Duel.SelectOption(tp,60,61)
else res=Duel.TossCoin(tp,1) end else
res=Duel.TossCoin(tp,1)
toss=true
end
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
if toss then
c:RegisterFlagEffect(FLAG_ID_REVERSAL_OF_FATE,RESET_EVENT+RESETS_STANDARD,0,1)
end
c34568403.arcanareg(c,res) c34568403.arcanareg(c,res)
if res==0 then if res==0 then
Duel.GetControl(c,1-tp) Duel.GetControl(c,1-tp)
...@@ -46,11 +49,11 @@ function c34568403.arcanareg(c,coin) ...@@ -46,11 +49,11 @@ function c34568403.arcanareg(c,coin)
e1:SetOperation(c34568403.spop) e1:SetOperation(c34568403.spop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1) c:RegisterEffect(e1)
c:RegisterFlagEffect(36690018,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,coin,63-coin) c:RegisterFlagEffect(FLAG_ID_ARCANA_COIN,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,coin,63-coin)
end end
function c34568403.spcon(e,tp,eg,ep,ev,re,r,rp) function c34568403.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c:GetFlagEffectLabel(36690018)==1 and c:IsRelateToBattle() and c:IsStatus(STATUS_OPPO_BATTLE) return c:GetFlagEffectLabel(FLAG_ID_ARCANA_COIN)==1 and c:IsRelateToBattle() and c:IsStatus(STATUS_OPPO_BATTLE)
end end
function c34568403.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c34568403.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=e:GetHandler():GetBattleTarget() local tc=e:GetHandler():GetBattleTarget()
......
...@@ -2,35 +2,9 @@ ...@@ -2,35 +2,9 @@
---@param c Card ---@param c Card
function c35781051.initial_effect(c) function c35781051.initial_effect(c)
--coin --coin
local e1=Effect.CreateEffect(c) aux.EnableArcanaCoin(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP_SUMMON_SUCCESS,EVENT_SPSUMMON_SUCCESS)
e1:SetDescription(aux.Stringid(35781051,0))
e1:SetCategory(CATEGORY_COIN)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c35781051.cointg)
e1:SetOperation(c35781051.coinop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e3)
end end
c35781051.toss_coin=true c35781051.toss_coin=true
function c35781051.cointg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1)
end
function c35781051.coinop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local res=0
if c:IsHasEffect(73206827) then
res=1-Duel.SelectOption(tp,60,61)
else res=Duel.TossCoin(tp,1) end
c35781051.arcanareg(c,res)
end
function c35781051.arcanareg(c,coin) function c35781051.arcanareg(c,coin)
--coin effect --coin effect
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -62,10 +36,10 @@ function c35781051.arcanareg(c,coin) ...@@ -62,10 +36,10 @@ function c35781051.arcanareg(c,coin)
local e4=e3:Clone() local e4=e3:Clone()
e4:SetCode(EVENT_MSET) e4:SetCode(EVENT_MSET)
c:RegisterEffect(e4) c:RegisterEffect(e4)
c:RegisterFlagEffect(36690018,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,coin,63-coin) c:RegisterFlagEffect(FLAG_ID_ARCANA_COIN,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,coin,63-coin)
end end
function c35781051.spcon(e,tp,eg,ep,ev,re,r,rp) function c35781051.spcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and e:GetHandler():GetFlagEffectLabel(36690018)==1 return ep~=tp and e:GetHandler():GetFlagEffectLabel(FLAG_ID_ARCANA_COIN)==1
end end
function c35781051.spfilter(c,e,tp) function c35781051.spfilter(c,e,tp)
return c:IsSetCard(0x5) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0x5) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
...@@ -84,7 +58,7 @@ function c35781051.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -84,7 +58,7 @@ function c35781051.spop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c35781051.tgcon(e,tp,eg,ep,ev,re,r,rp) function c35781051.tgcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and e:GetHandler():GetFlagEffectLabel(36690018)==0 return ep~=tp and e:GetHandler():GetFlagEffectLabel(FLAG_ID_ARCANA_COIN)==0
end end
function c35781051.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) function c35781051.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
......
...@@ -11,7 +11,7 @@ function c36690018.initial_effect(c) ...@@ -11,7 +11,7 @@ function c36690018.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c36690018.filter(c) function c36690018.filter(c)
return c:GetFlagEffect(36690018)~=0 return c:IsFaceup() and c:IsSetCard(0x5) and c:GetFlagEffect(FLAG_ID_REVERSAL_OF_FATE)~=0
end end
function c36690018.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c36690018.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c36690018.filter(chkc) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c36690018.filter(chkc) end
...@@ -21,8 +21,8 @@ function c36690018.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -21,8 +21,8 @@ function c36690018.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function c36690018.activate(e,tp,eg,ep,ev,re,r,rp) function c36690018.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and c36690018.filter(tc) then if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:GetFlagEffect(FLAG_ID_REVERSAL_OF_FATE)~=0 and tc:GetFlagEffect(FLAG_ID_ARCANA_COIN)~=0 then
local val=tc:GetFlagEffectLabel(36690018) local val=tc:GetFlagEffectLabel(FLAG_ID_ARCANA_COIN)
tc:SetFlagEffectLabel(36690018,1-val) tc:SetFlagEffectLabel(FLAG_ID_ARCANA_COIN,1-val)
end end
end end
...@@ -19,14 +19,7 @@ function c5861892.initial_effect(c) ...@@ -19,14 +19,7 @@ function c5861892.initial_effect(c)
e2:SetCode(EFFECT_SPSUMMON_CONDITION) e2:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--coin --coin
local e3=Effect.CreateEffect(c) aux.EnableArcanaCoin(c,EVENT_SPSUMMON_SUCCESS)
e3:SetDescription(aux.Stringid(5861892,0))
e3:SetCategory(CATEGORY_COIN)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetTarget(c5861892.cointg)
e3:SetOperation(c5861892.coinop)
c:RegisterEffect(e3)
end end
c5861892.toss_coin=true c5861892.toss_coin=true
function c5861892.spfilter(c) function c5861892.spfilter(c)
...@@ -53,19 +46,6 @@ function c5861892.spop(e,tp,eg,ep,ev,re,r,rp,c) ...@@ -53,19 +46,6 @@ function c5861892.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.SendtoGrave(g,REASON_SPSUMMON) Duel.SendtoGrave(g,REASON_SPSUMMON)
g:DeleteGroup() g:DeleteGroup()
end end
function c5861892.cointg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1)
end
function c5861892.coinop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local res=0
if c:IsHasEffect(73206827) then
res=1-Duel.SelectOption(tp,60,61)
else res=Duel.TossCoin(tp,1) end
c5861892.arcanareg(c,res)
end
function c5861892.arcanareg(c,coin) function c5861892.arcanareg(c,coin)
--coin effect --coin effect
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -92,11 +72,11 @@ function c5861892.arcanareg(c,coin) ...@@ -92,11 +72,11 @@ function c5861892.arcanareg(c,coin)
e2:SetOperation(c5861892.negop) e2:SetOperation(c5861892.negop)
e2:SetReset(RESET_EVENT+RESETS_STANDARD) e2:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e2) c:RegisterEffect(e2)
c:RegisterFlagEffect(36690018,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,coin,63-coin) c:RegisterFlagEffect(FLAG_ID_ARCANA_COIN,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,coin,63-coin)
end end
function c5861892.thcon(e,tp,eg,ep,ev,re,r,rp) function c5861892.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c:GetFlagEffectLabel(36690018)==1 and c:IsRelateToBattle() return c:GetFlagEffectLabel(FLAG_ID_ARCANA_COIN)==1 and c:IsRelateToBattle()
and c:GetBattleTarget():IsLocation(LOCATION_GRAVE) and c:GetBattleTarget():IsLocation(LOCATION_GRAVE)
end end
function c5861892.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c5861892.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
...@@ -118,7 +98,7 @@ function c5861892.negcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -118,7 +98,7 @@ function c5861892.negcon(e,tp,eg,ep,ev,re,r,rp)
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not g or not g:IsContains(c) then return false end if not g or not g:IsContains(c) then return false end
return c:GetFlagEffectLabel(36690018)==0 and (re:IsHasType(EFFECT_TYPE_ACTIVATE) or re:IsActiveType(TYPE_MONSTER)) return c:GetFlagEffectLabel(FLAG_ID_ARCANA_COIN)==0 and (re:IsHasType(EFFECT_TYPE_ACTIVATE) or re:IsActiveType(TYPE_MONSTER))
end end
function c5861892.negtg(e,tp,eg,ep,ev,re,r,rp,chk) function c5861892.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -14,20 +14,7 @@ function s.initial_effect(c) ...@@ -14,20 +14,7 @@ function s.initial_effect(c)
e1:SetOperation(s.thop) e1:SetOperation(s.thop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--coin --coin
local e2=Effect.CreateEffect(c) aux.EnableArcanaCoin(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP_SUMMON_SUCCESS,EVENT_SPSUMMON_SUCCESS)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_COIN)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetTarget(s.cointg)
e2:SetOperation(s.coinop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
local e4=e2:Clone()
e4:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e4)
end end
s.toss_coin=true s.toss_coin=true
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk) function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
...@@ -50,19 +37,6 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -50,19 +37,6 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
end end
function s.cointg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1)
end
function s.coinop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local res=0
if c:IsHasEffect(73206827) then
res=1-Duel.SelectOption(tp,60,61)
else res=Duel.TossCoin(tp,1) end
s.arcanareg(c,res)
end
function s.arcanareg(c,coin) function s.arcanareg(c,coin)
--heads: optional destroy --heads: optional destroy
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
......
...@@ -12,20 +12,7 @@ function c60953118.initial_effect(c) ...@@ -12,20 +12,7 @@ function c60953118.initial_effect(c)
e1:SetOperation(c60953118.damop) e1:SetOperation(c60953118.damop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--coin --coin
local e2=Effect.CreateEffect(c) aux.EnableArcanaCoin(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP_SUMMON_SUCCESS,EVENT_SPSUMMON_SUCCESS)
e2:SetDescription(aux.Stringid(60953118,0))
e2:SetCategory(CATEGORY_COIN)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetTarget(c60953118.cointg)
e2:SetOperation(c60953118.coinop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
local e4=e2:Clone()
e4:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e4)
end end
c60953118.toss_coin=true c60953118.toss_coin=true
function c60953118.damcon(e,tp,eg,ep,ev,re,r,rp) function c60953118.damcon(e,tp,eg,ep,ev,re,r,rp)
...@@ -44,19 +31,6 @@ function c60953118.damop(e,tp,eg,ep,ev,re,r,rp) ...@@ -44,19 +31,6 @@ function c60953118.damop(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_PHASE+PHASE_DAMAGE_CAL) e1:SetReset(RESET_PHASE+PHASE_DAMAGE_CAL)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
end end
function c60953118.cointg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1)
end
function c60953118.coinop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local res=0
if c:IsHasEffect(73206827) then
res=1-Duel.SelectOption(tp,60,61)
else res=Duel.TossCoin(tp,1) end
c60953118.arcanareg(c,res)
end
function c60953118.arcanareg(c,coin) function c60953118.arcanareg(c,coin)
--coin effect --coin effect
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -73,11 +47,11 @@ function c60953118.arcanareg(c,coin) ...@@ -73,11 +47,11 @@ function c60953118.arcanareg(c,coin)
e2:SetTargetRange(0,1) e2:SetTargetRange(0,1)
e2:SetCondition(c60953118.rdcon2) e2:SetCondition(c60953118.rdcon2)
c:RegisterEffect(e2) c:RegisterEffect(e2)
c:RegisterFlagEffect(36690018,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,coin,63-coin) c:RegisterFlagEffect(FLAG_ID_ARCANA_COIN,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,coin,63-coin)
end end
function c60953118.rdcon1(e) function c60953118.rdcon1(e)
return e:GetHandler():GetFlagEffectLabel(36690018)==1 return e:GetHandler():GetFlagEffectLabel(FLAG_ID_ARCANA_COIN)==1
end end
function c60953118.rdcon2(e) function c60953118.rdcon2(e)
return e:GetHandler():GetFlagEffectLabel(36690018)==0 return e:GetHandler():GetFlagEffectLabel(FLAG_ID_ARCANA_COIN)==0
end end
...@@ -2,35 +2,9 @@ ...@@ -2,35 +2,9 @@
---@param c Card ---@param c Card
function c61175706.initial_effect(c) function c61175706.initial_effect(c)
--coin --coin
local e1=Effect.CreateEffect(c) aux.EnableArcanaCoin(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP_SUMMON_SUCCESS,EVENT_SPSUMMON_SUCCESS)
e1:SetDescription(aux.Stringid(61175706,0))
e1:SetCategory(CATEGORY_COIN)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c61175706.cointg)
e1:SetOperation(c61175706.coinop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e3)
end end
c61175706.toss_coin=true c61175706.toss_coin=true
function c61175706.cointg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1)
end
function c61175706.coinop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local res=0
if c:IsHasEffect(73206827) then
res=1-Duel.SelectOption(tp,60,61)
else res=Duel.TossCoin(tp,1) end
c61175706.arcanareg(c,res)
end
function c61175706.arcanareg(c,coin) function c61175706.arcanareg(c,coin)
--coin effect --coin effect
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -43,13 +17,13 @@ function c61175706.arcanareg(c,coin) ...@@ -43,13 +17,13 @@ function c61175706.arcanareg(c,coin)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1) c:RegisterEffect(e1)
-- --
c:RegisterFlagEffect(36690018,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,coin,63-coin) c:RegisterFlagEffect(FLAG_ID_ARCANA_COIN,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,coin,63-coin)
end end
function c61175706.atktg(e,c) function c61175706.atktg(e,c)
return c:IsSetCard(0x5) return c:IsSetCard(0x5)
end end
function c61175706.atkval(e,c) function c61175706.atkval(e,c)
if e:GetHandler():GetFlagEffectLabel(36690018)==1 then if e:GetHandler():GetFlagEffectLabel(FLAG_ID_ARCANA_COIN)==1 then
return 500 return 500
else return -500 end else return -500 end
end end
...@@ -14,38 +14,12 @@ function c62892347.initial_effect(c) ...@@ -14,38 +14,12 @@ function c62892347.initial_effect(c)
e2:SetCondition(c62892347.poscon) e2:SetCondition(c62892347.poscon)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--coin --coin
local e3=Effect.CreateEffect(c) aux.EnableArcanaCoin(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP_SUMMON_SUCCESS,EVENT_SPSUMMON_SUCCESS)
e3:SetDescription(aux.Stringid(62892347,0))
e3:SetCategory(CATEGORY_COIN)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetTarget(c62892347.cointg)
e3:SetOperation(c62892347.coinop)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e4)
local e5=e3:Clone()
e5:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e5)
end end
c62892347.toss_coin=true c62892347.toss_coin=true
function c62892347.poscon(e) function c62892347.poscon(e)
return e:GetHandler():IsPosition(POS_FACEUP_ATTACK) return e:GetHandler():IsPosition(POS_FACEUP_ATTACK)
end end
function c62892347.cointg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1)
end
function c62892347.coinop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local res=0
if c:IsHasEffect(73206827) then
res=1-Duel.SelectOption(tp,60,61)
else res=Duel.TossCoin(tp,1) end
c62892347.arcanareg(c,res)
end
function c62892347.arcanareg(c,coin) function c62892347.arcanareg(c,coin)
--disable --disable
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -73,12 +47,12 @@ function c62892347.arcanareg(c,coin) ...@@ -73,12 +47,12 @@ function c62892347.arcanareg(c,coin)
e3:SetTarget(c62892347.distg) e3:SetTarget(c62892347.distg)
e3:SetReset(RESET_EVENT+RESETS_STANDARD) e3:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e3) c:RegisterEffect(e3)
c:RegisterFlagEffect(36690018,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,coin,63-coin) c:RegisterFlagEffect(FLAG_ID_ARCANA_COIN,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,coin,63-coin)
end end
function c62892347.distg(e,c) function c62892347.distg(e,c)
local ec=e:GetHandler() local ec=e:GetHandler()
if c==ec or c:GetCardTargetCount()==0 then return false end if c==ec or c:GetCardTargetCount()==0 then return false end
local val=ec:GetFlagEffectLabel(36690018) local val=ec:GetFlagEffectLabel(FLAG_ID_ARCANA_COIN)
if val==1 then if val==1 then
return c:GetControler()==ec:GetControler() and c:GetCardTarget():IsContains(ec) return c:GetControler()==ec:GetControler() and c:GetCardTarget():IsContains(ec)
else return c:GetControler()~=ec:GetControler() and c:GetCardTarget():IsContains(ec) end else return c:GetControler()~=ec:GetControler() and c:GetCardTarget():IsContains(ec) end
...@@ -87,7 +61,7 @@ function c62892347.disop(e,tp,eg,ep,ev,re,r,rp) ...@@ -87,7 +61,7 @@ function c62892347.disop(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetHandler() local ec=e:GetHandler()
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return end if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return end
if not ec:IsRelateToEffect(re) then return end if not ec:IsRelateToEffect(re) then return end
local val=ec:GetFlagEffectLabel(36690018) local val=ec:GetFlagEffectLabel(FLAG_ID_ARCANA_COIN)
if (val==1 and rp==1-ec:GetControler()) or (val==0 and rp==ec:GetControler()) then return end if (val==1 and rp==1-ec:GetControler()) or (val==0 and rp==ec:GetControler()) then return end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not g or not g:IsContains(ec) then return end if not g or not g:IsContains(ec) then return end
......
...@@ -19,14 +19,7 @@ function c69831560.initial_effect(c) ...@@ -19,14 +19,7 @@ function c69831560.initial_effect(c)
e2:SetCode(EFFECT_SPSUMMON_CONDITION) e2:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--coin --coin
local e3=Effect.CreateEffect(c) aux.EnableArcanaCoin(c,EVENT_SPSUMMON_SUCCESS)
e3:SetDescription(aux.Stringid(69831560,0))
e3:SetCategory(CATEGORY_COIN)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetTarget(c69831560.cointg)
e3:SetOperation(c69831560.coinop)
c:RegisterEffect(e3)
end end
c69831560.toss_coin=true c69831560.toss_coin=true
function c69831560.spfilter(c) function c69831560.spfilter(c)
...@@ -53,19 +46,6 @@ function c69831560.spop(e,tp,eg,ep,ev,re,r,rp,c) ...@@ -53,19 +46,6 @@ function c69831560.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.SendtoGrave(g,REASON_SPSUMMON) Duel.SendtoGrave(g,REASON_SPSUMMON)
g:DeleteGroup() g:DeleteGroup()
end end
function c69831560.cointg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1)
end
function c69831560.coinop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local res=0
if c:IsHasEffect(73206827) then
res=1-Duel.SelectOption(tp,60,61)
else res=Duel.TossCoin(tp,1) end
c69831560.arcanareg(c,res)
end
function c69831560.arcanareg(c,coin) function c69831560.arcanareg(c,coin)
--coin effect --coin effect
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -99,14 +79,14 @@ function c69831560.arcanareg(c,coin) ...@@ -99,14 +79,14 @@ function c69831560.arcanareg(c,coin)
e4:SetReset(RESET_EVENT+RESET_OVERLAY+RESET_TOFIELD) e4:SetReset(RESET_EVENT+RESET_OVERLAY+RESET_TOFIELD)
e4:SetLabelObject(e3) e4:SetLabelObject(e3)
c:RegisterEffect(e4) c:RegisterEffect(e4)
c:RegisterFlagEffect(36690018,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,coin,63-coin) c:RegisterFlagEffect(FLAG_ID_ARCANA_COIN,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,coin,63-coin)
end end
function c69831560.macon(e) function c69831560.macon(e)
return e:GetHandler():GetFlagEffectLabel(36690018)==1 return e:GetHandler():GetFlagEffectLabel(FLAG_ID_ARCANA_COIN)==1
end end
function c69831560.poscon(e,tp,eg,ep,ev,re,r,rp) function c69831560.poscon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c:GetFlagEffectLabel(36690018)==1 and c:GetAttackAnnouncedCount()>=2 return c:GetFlagEffectLabel(FLAG_ID_ARCANA_COIN)==1 and c:GetAttackAnnouncedCount()>=2
end end
function c69831560.posop(e,tp,eg,ep,ev,re,r,rp) function c69831560.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
...@@ -121,7 +101,7 @@ function c69831560.posop(e,tp,eg,ep,ev,re,r,rp) ...@@ -121,7 +101,7 @@ function c69831560.posop(e,tp,eg,ep,ev,re,r,rp)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c69831560.desop1(e,tp,eg,ep,ev,re,r,rp) function c69831560.desop1(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsReason(REASON_DESTROY) and e:GetHandler():GetFlagEffectLabel(36690018)==0 then if e:GetHandler():IsReason(REASON_DESTROY) and e:GetHandler():GetFlagEffectLabel(FLAG_ID_ARCANA_COIN)==0 then
e:SetLabel(1) e:SetLabel(1)
else e:SetLabel(0) end else e:SetLabel(0) end
end end
......
...@@ -22,9 +22,9 @@ function c73206827.initial_effect(c) ...@@ -22,9 +22,9 @@ function c73206827.initial_effect(c)
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD) e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(73206827) e3:SetCode(73206827)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetRange(LOCATION_FZONE) e3:SetRange(LOCATION_FZONE)
e3:SetTargetRange(LOCATION_MZONE,0) e3:SetTargetRange(1,0)
e3:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x5))
e3:SetCondition(c73206827.effectcon) e3:SetCondition(c73206827.effectcon)
c:RegisterEffect(e3) c:RegisterEffect(e3)
-- --
...@@ -61,8 +61,7 @@ end ...@@ -61,8 +61,7 @@ end
function c73206827.reccon(e,tp,eg,ep,ev,re,r,rp) function c73206827.reccon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local rc=eg:GetFirst() local rc=eg:GetFirst()
return rc:IsRelateToBattle() and rc:IsSetCard(0x5) and rc:IsFaceup() and rc:IsControler(tp) return c73206827.effectcon(e) and rc:IsRelateToBattle() and rc:IsSetCard(0x5) and rc:IsFaceup() and rc:IsControler(tp)
and (c:GetFlagEffect(73206828)==0 or c:IsHasEffect(EFFECT_CANNOT_DISABLE))
end end
function c73206827.rectg(e,tp,eg,ep,ev,re,r,rp,chk) function c73206827.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
...@@ -75,5 +74,7 @@ function c73206827.rectg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -75,5 +74,7 @@ function c73206827.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function c73206827.recop(e,tp,eg,ep,ev,re,r,rp) function c73206827.recop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT) if d>0 then
Duel.Recover(p,d,REASON_EFFECT)
end
end end
...@@ -2,35 +2,9 @@ ...@@ -2,35 +2,9 @@
---@param c Card ---@param c Card
function c8396952.initial_effect(c) function c8396952.initial_effect(c)
--coin --coin
local e1=Effect.CreateEffect(c) aux.EnableArcanaCoin(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP_SUMMON_SUCCESS,EVENT_SPSUMMON_SUCCESS)
e1:SetDescription(aux.Stringid(8396952,0))
e1:SetCategory(CATEGORY_COIN)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c8396952.cointg)
e1:SetOperation(c8396952.coinop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e3)
end end
c8396952.toss_coin=true c8396952.toss_coin=true
function c8396952.cointg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1)
end
function c8396952.coinop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local res=0
if c:IsHasEffect(73206827) then
res=1-Duel.SelectOption(tp,60,61)
else res=Duel.TossCoin(tp,1) end
c8396952.arcanareg(c,res)
end
function c8396952.arcanareg(c,coin) function c8396952.arcanareg(c,coin)
--disable effect --disable effect
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -40,12 +14,12 @@ function c8396952.arcanareg(c,coin) ...@@ -40,12 +14,12 @@ function c8396952.arcanareg(c,coin)
e1:SetOperation(c8396952.speop) e1:SetOperation(c8396952.speop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1) c:RegisterEffect(e1)
c:RegisterFlagEffect(36690018,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,coin,63-coin) c:RegisterFlagEffect(FLAG_ID_ARCANA_COIN,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,coin,63-coin)
end end
function c8396952.speop(e,tp,eg,ep,ev,re,r,rp) function c8396952.speop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not re:IsActiveType(TYPE_SPELL) or not re:IsHasType(EFFECT_TYPE_ACTIVATE) then return end if not re:IsActiveType(TYPE_SPELL) or not re:IsHasType(EFFECT_TYPE_ACTIVATE) then return end
local val=c:GetFlagEffectLabel(36690018) local val=c:GetFlagEffectLabel(FLAG_ID_ARCANA_COIN)
if val==1 then if val==1 then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
......
...@@ -2,35 +2,9 @@ ...@@ -2,35 +2,9 @@
---@param c Card ---@param c Card
function c97452817.initial_effect(c) function c97452817.initial_effect(c)
--coin --coin
local e1=Effect.CreateEffect(c) aux.EnableArcanaCoin(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP_SUMMON_SUCCESS,EVENT_SPSUMMON_SUCCESS)
e1:SetDescription(aux.Stringid(97452817,0))
e1:SetCategory(CATEGORY_COIN)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c97452817.cointg)
e1:SetOperation(c97452817.coinop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e3)
end end
c97452817.toss_coin=true c97452817.toss_coin=true
function c97452817.cointg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1)
end
function c97452817.coinop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local res=0
if c:IsHasEffect(73206827) then
res=1-Duel.SelectOption(tp,60,61)
else res=Duel.TossCoin(tp,1) end
c97452817.arcanareg(c,res)
end
function c97452817.arcanareg(c,coin) function c97452817.arcanareg(c,coin)
--coin effect --coin effect
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -59,10 +33,10 @@ function c97452817.arcanareg(c,coin) ...@@ -59,10 +33,10 @@ function c97452817.arcanareg(c,coin)
e2:SetOperation(c97452817.ctop) e2:SetOperation(c97452817.ctop)
e2:SetReset(RESET_EVENT+RESETS_STANDARD) e2:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e2) c:RegisterEffect(e2)
c:RegisterFlagEffect(36690018,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,coin,63-coin) c:RegisterFlagEffect(FLAG_ID_ARCANA_COIN,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,coin,63-coin)
end end
function c97452817.spcon(e,tp,eg,ep,ev,re,r,rp) function c97452817.spcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and e:GetHandler():GetFlagEffectLabel(36690018)==1 return ep==tp and e:GetHandler():GetFlagEffectLabel(FLAG_ID_ARCANA_COIN)==1
end end
function c97452817.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c97452817.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
...@@ -77,7 +51,7 @@ function c97452817.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -77,7 +51,7 @@ function c97452817.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
end end
function c97452817.ctcon(e,tp,eg,ep,ev,re,r,rp) function c97452817.ctcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and e:GetHandler():GetFlagEffectLabel(36690018)==0 return ep==tp and e:GetHandler():GetFlagEffectLabel(FLAG_ID_ARCANA_COIN)==0
end end
function c97452817.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c97452817.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsAbleToChangeControler() end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsAbleToChangeControler() end
......
...@@ -2,35 +2,9 @@ ...@@ -2,35 +2,9 @@
---@param c Card ---@param c Card
function c97574404.initial_effect(c) function c97574404.initial_effect(c)
--coin --coin
local e1=Effect.CreateEffect(c) aux.EnableArcanaCoin(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP_SUMMON_SUCCESS,EVENT_SPSUMMON_SUCCESS)
e1:SetDescription(aux.Stringid(97574404,0))
e1:SetCategory(CATEGORY_COIN)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c97574404.cointg)
e1:SetOperation(c97574404.coinop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e3)
end end
c97574404.toss_coin=true c97574404.toss_coin=true
function c97574404.cointg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1)
end
function c97574404.coinop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local res=0
if c:IsHasEffect(73206827) then
res=1-Duel.SelectOption(tp,60,61)
else res=Duel.TossCoin(tp,1) end
c97574404.arcanareg(c,res)
end
function c97574404.arcanareg(c,coin) function c97574404.arcanareg(c,coin)
--coin effect --coin effect
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -54,16 +28,16 @@ function c97574404.arcanareg(c,coin) ...@@ -54,16 +28,16 @@ function c97574404.arcanareg(c,coin)
local e3=e2:Clone() local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_MSET) e3:SetCode(EFFECT_CANNOT_MSET)
c:RegisterEffect(e3) c:RegisterEffect(e3)
c:RegisterFlagEffect(36690018,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,coin,63-coin) c:RegisterFlagEffect(FLAG_ID_ARCANA_COIN,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,coin,63-coin)
end end
function c97574404.dtcon(e) function c97574404.dtcon(e)
return e:GetHandler():GetFlagEffectLabel(36690018)==1 return e:GetHandler():GetFlagEffectLabel(FLAG_ID_ARCANA_COIN)==1
end end
function c97574404.dtval(e,c) function c97574404.dtval(e,c)
return c:IsSetCard(0x5) return c:IsSetCard(0x5)
end end
function c97574404.sumcon(e) function c97574404.sumcon(e)
return e:GetHandler():GetFlagEffectLabel(36690018)==0 return e:GetHandler():GetFlagEffectLabel(FLAG_ID_ARCANA_COIN)==0
end end
function c97574404.sumtg(e,c,tp,sumtp) function c97574404.sumtg(e,c,tp,sumtp)
return bit.band(sumtp,SUMMON_TYPE_ADVANCE)==SUMMON_TYPE_ADVANCE and c:IsSetCard(0x5) return bit.band(sumtp,SUMMON_TYPE_ADVANCE)==SUMMON_TYPE_ADVANCE and c:IsSetCard(0x5)
......
...@@ -11,7 +11,7 @@ function c99189322.initial_effect(c) ...@@ -11,7 +11,7 @@ function c99189322.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c99189322.filter(c) function c99189322.filter(c)
return c:GetFlagEffect(36690018)~=0 return c:IsFaceup() and c:IsSetCard(0x5) and c:GetFlagEffect(FLAG_ID_REVERSAL_OF_FATE)~=0
end end
function c99189322.rfilter(c) function c99189322.rfilter(c)
return c:IsSetCard(0x5) and c:IsAbleToRemove() return c:IsSetCard(0x5) and c:IsAbleToRemove()
...@@ -33,11 +33,12 @@ function c99189322.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -33,11 +33,12 @@ function c99189322.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc==regc then tc=g:GetNext() end if tc==regc then tc=g:GetNext() end
if tc:IsRelateToEffect(e) and tc:IsFaceup() and c99189322.filter(tc) and regc:IsRelateToEffect(e) then if not regc:IsRelateToEffect(e) then return end
Duel.Remove(regc,POS_FACEUP,REASON_EFFECT) if Duel.Remove(regc,POS_FACEUP,REASON_EFFECT)==0 or not regc:IsLocation(LOCATION_REMOVED) then return end
if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:GetFlagEffect(FLAG_ID_REVERSAL_OF_FATE)~=0 and tc:GetFlagEffect(FLAG_ID_ARCANA_COIN)~=0 then
local regfun=regc.arcanareg local regfun=regc.arcanareg
if not regfun then return end if not regfun then return end
local val=tc:GetFlagEffectLabel(36690018) local val=tc:GetFlagEffectLabel(FLAG_ID_ARCANA_COIN)
tc:ResetEffect(RESET_DISABLE,RESET_EVENT) tc:ResetEffect(RESET_DISABLE,RESET_EVENT)
regfun(tc,val) regfun(tc,val)
tc:RegisterFlagEffect(99189322,RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END,0,1) tc:RegisterFlagEffect(99189322,RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END,0,1)
...@@ -53,10 +54,10 @@ function c99189322.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -53,10 +54,10 @@ function c99189322.activate(e,tp,eg,ep,ev,re,r,rp)
end end
function c99189322.rec_effect(e,tp,eg,ep,ev,re,r,rp) function c99189322.rec_effect(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject() local tc=e:GetLabelObject()
if tc:GetFlagEffect(99189322)==0 or tc:GetFlagEffect(36690018)==0 then return end if tc:GetFlagEffect(99189322)==0 then return end
local regfun=tc.arcanareg local regfun=tc.arcanareg
if not regfun then return end if not regfun then return end
local val=tc:GetFlagEffectLabel(36690018) local val=tc:GetFlagEffectLabel(FLAG_ID_ARCANA_COIN)
tc:ResetEffect(RESET_DISABLE,RESET_EVENT) tc:ResetEffect(RESET_DISABLE,RESET_EVENT)
regfun(tc,val) regfun(tc,val)
end end
...@@ -892,3 +892,5 @@ FLAG_ID_CHAINING =1 ...@@ -892,3 +892,5 @@ FLAG_ID_CHAINING =1
FLAG_ID_UNION =2 FLAG_ID_UNION =2
FLAG_ID_NO_NORMAL_DRAW =3 FLAG_ID_NO_NORMAL_DRAW =3
FLAG_ID_ALLURE_QUEEN =4 FLAG_ID_ALLURE_QUEEN =4
FLAG_ID_ARCANA_COIN =5
FLAG_ID_REVERSAL_OF_FATE=36690018
...@@ -259,6 +259,45 @@ function Auxiliary.NeosReturnTargetOptional(set_category) ...@@ -259,6 +259,45 @@ function Auxiliary.NeosReturnTargetOptional(set_category)
if set_category then set_category(e,tp,eg,ep,ev,re,r,rp) end if set_category then set_category(e,tp,eg,ep,ev,re,r,rp) end
end end
end end
---add "Toss a coin and get the following effects" effect to Arcana Force monsters
---@param c Card
---@param event1 integer
---@param ... integer
function Auxiliary.EnableArcanaCoin(c,event1,...)
local e1=Effect.CreateEffect(c)
e1:SetDescription(1623)
e1:SetCategory(CATEGORY_COIN)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(event1)
e1:SetTarget(Auxiliary.ArcanaCoinTarget)
e1:SetOperation(Auxiliary.ArcanaCoinOperation)
c:RegisterEffect(e1)
for _,event in ipairs{...} do
local e2=e1:Clone()
e2:SetCode(event)
c:RegisterEffect(e2)
end
end
function Auxiliary.ArcanaCoinTarget(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1)
end
function Auxiliary.ArcanaCoinOperation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local res=0
local toss=false
if Duel.IsPlayerAffectedByEffect(tp,73206827) then
res=1-Duel.SelectOption(tp,60,61)
else
res=Duel.TossCoin(tp,1)
toss=true
end
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
if toss then
c:RegisterFlagEffect(FLAG_ID_REVERSAL_OF_FATE,RESET_EVENT+RESETS_STANDARD,0,1)
end
c.arcanareg(c,res)
end
function Auxiliary.IsUnionState(effect) function Auxiliary.IsUnionState(effect)
local c=effect:GetHandler() local c=effect:GetHandler()
return c:IsHasEffect(EFFECT_UNION_STATUS) and c:GetEquipTarget() return c:IsHasEffect(EFFECT_UNION_STATUS) and c:GetEquipTarget()
......
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