Fluorohydride / ygopro-scripts

scripts of official cards for ygopro.
GNU General Public License v2.0
142 stars 132 forks source link

add Auxiliary.EnableArcanaCoin #2733

Closed salix5 closed 2 weeks ago

salix5 commented 3 weeks ago
---@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

The coin-tossing effect of Arcana Force.

FLAG_ID_ARCANA_COIN The flag effect for coin result. If the effect is chosen by Light Barrier, the card will get this flag effect. 硬幣結果的標記 用光之結界選擇也會得到

FLAG_ID_REVERSAL_OF_FATE The flag effect for "get an effect from tossing coin". If the effect is chosen by Light Barrier, the card will not get this flag effect. 「投擲硬幣得到效果」的標記 用光之結界選擇不會得到 「逆轉的命運」的發動條件

Light Barrier add EFFECT_FLAG_PLAYER_TARGET 現在是玩家為對象的效果

@Wind2009-Louse @kiritosoft

Wind2009-Louse commented 3 weeks ago

秘仪之力」怪兽的召唤·反转召唤·特殊召唤时发动效果,那个效果处理时不在怪兽区域表侧表示存在的场合,仍会投掷硬币,这个效果处理完毕。24/10/24

秘仪之力5-教皇」「秘仪之力19-太阳」「秘仪之力EX-混沌之支配者」的包含投掷硬币的效果是在那个处理时适用的效果,没有得到效果,因此即使投掷过硬币,也不能以它们为对象发动「逆转的命运」「秘仪呼唤」。24/10/26

purerosefallen commented 3 weeks ago

We've already tossed too much archetype-specific methods in utility.lua. As the development goes, it would expand more and more. How about we make a Duel.LoadScript("archetypes/arcana.lua") and reference it in those Arcana cards?

function c97574404.initial_effect(c)
  Duel.LoadScript("archetypes/arcana.lua")

 aux.EnableArcanaCoin(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP_SUMMON_SUCCESS,EVENT_SPSUMMON_SUCCESS)
end
salix5 commented 3 weeks ago

秘仪之力」怪兽的召唤·反转召唤·特殊召唤时发动效果,那个效果处理时不在怪兽区域表侧表示存在的场合,仍会投掷硬币,这个效果处理完毕。24/10/24

已修正,非常感謝

秘仪之力5-教皇」「秘仪之力19-太阳」「秘仪之力EX-混沌之支配者」的包含投掷硬币的效果是在那个处理时适用的效果,没有得到效果,因此即使投掷过硬币,也不能以它们为对象发动「逆转的命运」「秘仪呼唤」。24/10/26

這個函數是給投擲硬幣然後按照正反面得到效果的秘儀之力 新的秘儀沒有得到效果就按照一般的誘發效果來寫就好