Commit 56f27fbb authored by salix5's avatar salix5

add Auxiliary.EnableArcanaCoin

parent a0f88331
...@@ -259,6 +259,41 @@ function Auxiliary.NeosReturnTargetOptional(set_category) ...@@ -259,6 +259,41 @@ 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
---
---@param c Card
---@param event1 integer
---@param ... integer
function Auxiliary.EnableArcanaCoin(c,event1,...)
local e1=Effect.CreateEffect(c)
e1:SetDescription(1)
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()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local res=0
if Duel.IsPlayerAffectedByEffect(tp,73206827) then
res=1-Duel.SelectOption(tp,60,61)
else
res=Duel.TossCoin(tp,1)
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