Commit 7f25e2e6 authored by nanahira's avatar nanahira

Merge branch 'master' of github.com:mycard/ygopro-scripts

parents 0e970000 3d486ee7
......@@ -9,7 +9,7 @@ function s.initial_effect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,id)
e1:SetTarget(s.destg)
......@@ -43,7 +43,7 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp)
end
end
function s.setcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0
return r&(REASON_EFFECT+REASON_BATTLE)~=0
end
function s.setfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
......
......@@ -39,7 +39,6 @@ function c10833828.initial_effect(c)
e4:SetOperation(c10833828.damop)
c:RegisterEffect(e4)
end
c10833828.fusion_effect=true
function c10833828.spfilter1(c,e,tp)
return c:IsSetCard(0x10af) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
......
......@@ -19,7 +19,6 @@ function c10960419.initial_effect(c)
c:RegisterEffect(e2)
end
c10960419.material_race=RACE_SPELLCASTER
c10960419.toss_dice=true
function c10960419.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() and chkc~=e:GetHandler() end
if chk==0 then return true end
......
......@@ -42,8 +42,7 @@ function c11443677.initial_effect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_DAMAGE_STEP_END)
e5:SetProperty(EFFECT_FLAG_CARD_TARGET)
e5:SetCountLimit(1)
e5:SetCondition(aux.dsercon)
e5:SetCondition(c11443677.setcon)
e5:SetTarget(c11443677.settg)
e5:SetOperation(c11443677.setop)
c:RegisterEffect(e5)
......@@ -80,6 +79,9 @@ end
function c11443677.efilter(e,te)
return te:IsActiveType(TYPE_TRAP)
end
function c11443677.setcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(11443677)==0 and aux.dsercon(e,tp,eg,ep,ev,re,r,rp)
end
function c11443677.setfilter(c)
return c:IsType(TYPE_TRAP) and c:IsSSetable()
end
......@@ -89,6 +91,9 @@ function c11443677.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectTarget(tp,c11443677.setfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
if e:IsCostChecked() then
e:GetHandler():RegisterFlagEffect(11443677,RESET_EVENT|RESET_TOFIELD|RESET_TURN_SET|RESET_PHASE|PHASE_END,0,0,1)
end
end
function c11443677.setop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
......
......@@ -66,7 +66,7 @@ function s.tgop(e,tp,eg,ep,ev,re,r,rp)
end
end
function s.eqfilter(c)
return c:IsFaceup() and c:IsSetCard(0x1b0) and bit.band(c:GetType(),TYPE_SPELL+TYPE_EQUIP)==TYPE_SPELL+TYPE_EQUIP
return c:IsFaceup() and c:IsSetCard(0x1b0) and c:IsAllTypes(TYPE_SPELL+TYPE_EQUIP)
end
function s.imcon(e)
local sg=e:GetHandler():GetEquipGroup()
......
......@@ -29,7 +29,6 @@ function c11493868.initial_effect(c)
e3:SetOperation(c11493868.activate)
c:RegisterEffect(e3)
end
c11493868.fusion_effect=true
function c11493868.atkfilter(c)
return c:IsFaceup() and c:IsSetCard(0x9b)
end
......
......@@ -20,7 +20,6 @@ function c11808215.initial_effect(c)
e2:SetOperation(c11808215.diceop)
c:RegisterEffect(e2)
end
c11808215.toss_dice=true
function c11808215.thfilter(c)
return c:IsCode(47292920) and c:IsAbleToHand()
end
......
......@@ -24,9 +24,8 @@ function c11819473.initial_effect(c)
e2:SetOperation(c11819473.sumop)
c:RegisterEffect(e2)
end
c11819473.toss_coin=true
function c11819473.thfilter1(c)
return not c:IsCode(11819473) and c.toss_coin and c:IsAbleToHand()
return not c:IsCode(11819473) and c:IsEffectProperty(aux.EffectPropertyFilter(EFFECT_FLAG_COIN)) and c:IsAbleToHand()
end
function c11819473.thfilter2(c,p)
return c:IsAbleToHand(p)
......
......@@ -11,7 +11,6 @@ function c11827244.initial_effect(c)
e1:SetOperation(c11827244.activate)
c:RegisterEffect(e1)
end
c11827244.fusion_effect=true
function c11827244.filter0(c)
return c:IsOnField() and c:IsAbleToRemove()
end
......
......@@ -11,7 +11,6 @@ function c12071500.initial_effect(c)
e1:SetOperation(c12071500.activate)
c:RegisterEffect(e1)
end
c12071500.fusion_effect=true
function c12071500.filter0(c)
return c:IsLocation(LOCATION_HAND) and c:IsAbleToRemove()
end
......
......@@ -12,7 +12,6 @@ function c12148078.initial_effect(c)
e1:SetOperation(c12148078.activate)
c:RegisterEffect(e1)
end
c12148078.toss_dice=true
function c12148078.cfilter(c,e,tp)
return c:IsDiscardable()
and Duel.IsExistingMatchingCard(c12148078.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,c,e,tp,6)
......
......@@ -45,7 +45,6 @@ function c12289247.initial_effect(c)
Duel.RegisterEffect(ge1,0)
end
end
c12289247.fusion_effect=true
c12289247.hnchecks=aux.CreateChecks(Card.IsSetCard,{0x10f2,0x2073,0x2017,0x1046})
function c12289247.spcfilter(c,tp)
return c:IsReason(REASON_BATTLE+REASON_EFFECT)
......
......@@ -28,7 +28,6 @@ function c12450071.initial_effect(c)
e2:SetOperation(c12450071.spop)
c:RegisterEffect(e2)
end
c12450071.fusion_effect=true
function c12450071.filter1(c,e)
return not c:IsImmuneToEffect(e)
end
......
......@@ -3,7 +3,7 @@
function c126218.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetCategory(CATEGORY_DICE+CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_FREE_CHAIN)
......@@ -13,7 +13,6 @@ function c126218.initial_effect(c)
e1:SetOperation(c126218.activate)
c:RegisterEffect(e1)
end
c126218.toss_dice=true
function c126218.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,1)
......
......@@ -21,7 +21,6 @@ function c1264319.initial_effect(c)
e2:SetOperation(c1264319.thop)
c:RegisterEffect(e2)
end
c1264319.fusion_effect=true
function c1264319.filter1(c,e)
return not c:IsImmuneToEffect(e)
end
......
......@@ -47,12 +47,12 @@ function s.spfilter(c,e,tp)
return c:IsSetCard(0x5) and c:IsLevel(10) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function s.thfilter(c)
return c.toss_coin and c:IsAbleToHand()
return c:IsEffectProperty(aux.EffectPropertyFilter(EFFECT_FLAG_COIN)) and c:IsAbleToHand()
end
function s.coinop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local res=-1
if c:IsHasEffect(73206827) then
if Duel.IsPlayerAffectedByEffect(tp,73206827) then
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp)
local b2=Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil)
if b1 and not b2 then
......@@ -90,5 +90,5 @@ function s.condition(e)
end
function s.aclimit(e,re,tp)
local loc=re:GetActivateLocation()
return bit.band(loc,LOCATION_ONFIELD)~=0 and re:IsActiveType(TYPE_MONSTER)
return loc&LOCATION_ONFIELD~=0 and re:IsActiveType(TYPE_MONSTER)
end
......@@ -23,7 +23,6 @@ function c13234975.initial_effect(c)
e2:SetOperation(c13234975.thop)
c:RegisterEffect(e2)
end
c13234975.fusion_effect=true
function c13234975.filter1(c,e)
return not c:IsImmuneToEffect(e)
end
......
......@@ -27,7 +27,6 @@ function c13258285.initial_effect(c)
e2:SetOperation(c13258285.scop)
c:RegisterEffect(e2)
end
c13258285.fusion_effect=true
function c13258285.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,600) end
Duel.PayLPCost(tp,600)
......
--メタトロンの影霊衣
local s,id,o=GetID()
---@param c Card
function s.initial_effect(c)
c:EnableReviveLimit()
aux.EnablePendulumAttribute(c)
--Cannot Special Summon
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(aux.ritlimit)
c:RegisterEffect(e0)
--remove
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_REMOVE)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,id)
e1:SetCondition(s.rmcon)
e1:SetTarget(s.rmtg)
e1:SetOperation(s.rmop)
c:RegisterEffect(e1)
--remove 2
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,id+o)
e2:SetHintTiming(0,TIMING_MAIN_END+TIMINGS_CHECK_MONSTER)
e2:SetCondition(s.rmcon2)
e2:SetTarget(s.rmtg2)
e2:SetOperation(s.rmop2)
c:RegisterEffect(e2)
--bp remove
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_BATTLE_DESTROY_REDIRECT)
e3:SetValue(LOCATION_REMOVED)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(s.immtg)
c:RegisterEffect(e3)
end
function s.mat_filter(c)
return not c:IsLevel(9)
end
function s.cfilter(c,tp)
return c:IsFaceupEx() and c:IsPreviousControler(tp) and c:IsControler(tp) and c:IsSetCard(0xb4)
end
function s.rmcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp) and e:GetHandler():IsStatus(STATUS_EFFECT_ENABLED)
end
function s.rmfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToRemove()
end
function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and s.rmfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.rmfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,s.rmfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function s.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
function s.rmcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsMainPhase()
end
function s.rmfilter2(c)
return c:IsType(TYPE_MONSTER) and c:IsFaceup() and c:IsAbleToRemove()
end
function s.rmtg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return c:IsAbleToRemove() and chkc:IsOnField() and chkc:IsControler(1-tp) and s.rmfilter2(chkc) end
if chk==0 then return c:IsAbleToRemove() and Duel.IsExistingTarget(s.rmfilter2,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,s.rmfilter2,tp,0,LOCATION_MZONE,1,1,nil)
g:AddCard(e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function s.rmop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsAbleToRemove() and Duel.Remove(c,0,REASON_EFFECT+REASON_TEMPORARY)~=0 then
if c:GetOriginalCode()==id then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetLabelObject(tc)
e1:SetCountLimit(1)
e1:SetOperation(s.retop)
Duel.RegisterEffect(e1,tp)
end
if tc:IsRelateToEffect(e) and tc:IsType(TYPE_MONSTER) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
end
function s.retop(e,tp,eg,ep,ev,re,r,rp)
Duel.ReturnToField(e:GetHandler())
end
function s.immtg(e,c)
return c:IsFaceup() and c:IsSetCard(0xb4)
end
......@@ -36,7 +36,6 @@ function c15130912.initial_effect(c)
e3:SetOperation(c15130912.coinop2)
c:RegisterEffect(e3)
end
c15130912.toss_coin=true
function c15130912.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local zone=1<<c:GetSequence()
......
......@@ -38,7 +38,6 @@ function c15317640.initial_effect(c)
e4:SetOperation(c15317640.desop)
c:RegisterEffect(e4)
end
c15317640.toss_coin=true
function c15317640.addct(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,2,0,0x1f)
......
......@@ -16,7 +16,7 @@ function c15521027.initial_effect(c)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(15521027,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetCategory(CATEGORY_DICE+CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
......@@ -27,6 +27,7 @@ function c15521027.initial_effect(c)
--sort deck
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(15521027,2))
e3:SetCategory(CATEGORY_DICE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
......@@ -35,7 +36,6 @@ function c15521027.initial_effect(c)
e3:SetOperation(c15521027.opd)
c:RegisterEffect(e3)
end
c15521027.toss_dice=true
function c15521027.spfilter(c)
return c:IsSetCard(0x26) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
......
......@@ -11,7 +11,6 @@ function c15543940.initial_effect(c)
e1:SetOperation(c15543940.activate)
c:RegisterEffect(e1)
end
c15543940.fusion_effect=true
function c15543940.filter1(c,e)
return c:IsOnField() and not c:IsImmuneToEffect(e)
end
......
......@@ -12,7 +12,6 @@ function c15744417.initial_effect(c)
e1:SetOperation(c15744417.operation)
c:RegisterEffect(e1)
end
c15744417.toss_dice=true
function c15744417.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,3)
......
--Double Dai
local s,id,o=GetID()
function s.initial_effect(c)
--Sp Sm from deck
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.sdcon)
e1:SetTarget(s.sdtg)
e1:SetOperation(s.sdop)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--Sp Sm below level
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_ACTION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e2:SetTarget(s.sltg)
e2:SetOperation(s.slop)
c:RegisterEffect(e2)
end
function s.sdcon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(nil,tp,LOCATION_MZONE,0,1,nil)
end
function s.sdfilter(c,e,tp)
return c:IsRace(RACE_WARRIOR) and c:IsLevel(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.sdfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.sdop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.sdfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function s.slfilter(c,e,tp)
local lv=c:GetLevel()
return c:IsFaceup() and lv>0 and Duel.IsExistingMatchingCard(s.lvfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,lv,e,tp)
return c:IsRace(RACE_WARRIOR) and c:IsFaceup() and lv>0 and Duel.IsExistingMatchingCard(s.lvfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,lv,e,tp)
end
function s.lvfilter(c,lv,e,tp)
return c:IsAttribute(ATTRIBUTE_EARTH) and c:IsRace(RACE_WARRIOR) and c:IsLevelBelow(lv) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sltg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.slfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(s.slfilter,tp,LOCATION_MZONE,0,1,e:GetHandler(),e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,s.slfilter,tp,LOCATION_MZONE,0,1,1,e:GetHandler(),e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return e:GetLabel()==1 and chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) end
local b1 = not Duel.IsExistingMatchingCard(nil,tp,LOCATION_MZONE,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.sdfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
local b2 = Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(s.slfilter,tp,LOCATION_MZONE,0,1,nil,e,tp)
if chk==0 then return b1 or b2 end
local op=aux.SelectFromOptions(tp,
{b1,aux.Stringid(id,0),0},
{b2,aux.Stringid(id,1),1})
e:SetLabel(op)
if op==0 then
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,s.slfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
end
function s.slop(e,tp,eg,ep,ev,re,r,rp)
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or tc:IsFacedown() or not tc:IsType(TYPE_MONSTER) then return end
local op = e:GetLabel()
local g
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.lvfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,tc:GetLevel(),e,tp)
if sg:GetCount()>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
if op==0 then
g = Duel.SelectMatchingCard(tp,s.sdfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
else
local tc = Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or tc:IsFacedown() or not tc:IsType(TYPE_MONSTER) then return end
g = Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.lvfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,tc:GetLevel(),e,tp)
end
if g and g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
......@@ -12,7 +12,6 @@ function c16135253.initial_effect(c)
e1:SetOperation(c16135253.operation)
c:RegisterEffect(e1)
end
c16135253.toss_dice=true
function c16135253.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
end
......
......@@ -25,7 +25,6 @@ function c16625614.initial_effect(c)
e4:SetOperation(c16625614.operation)
c:RegisterEffect(e4)
end
c16625614.toss_coin=true
function c16625614.efilter(e,te)
local tc=te:GetHandler()
return not tc:IsCode(94212438)
......
......@@ -26,19 +26,17 @@ function s.initial_effect(c)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
--material
local custom_code=aux.RegisterMergedDelayedEvent_ToSingleCard(c,id,{EVENT_TO_GRAVE,EVENT_REMOVE})
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_CUSTOM+id)
e3:SetCode(custom_code)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,id+o)
e3:SetTarget(s.mttg)
e3:SetOperation(s.mtop)
c:RegisterEffect(e3)
local g=Group.CreateGroup()
aux.RegisterMergedDelayedEvent(c,id,EVENT_TO_GRAVE,g)
aux.RegisterMergedDelayedEvent(c,id,EVENT_REMOVE,g)
end
function s.imcon(e)
local c=e:GetHandler()
......
......@@ -27,7 +27,6 @@ function c17032740.initial_effect(c)
c:RegisterEffect(e5)
end
c17032740.material_setcode=0x8
c17032740.toss_coin=true
function c17032740.splimit(e,se,sp,st)
return not e:GetHandler():IsLocation(LOCATION_EXTRA)
end
......
......@@ -11,7 +11,6 @@ function c17236839.initial_effect(c)
e1:SetOperation(c17236839.activate)
c:RegisterEffect(e1)
end
c17236839.fusion_effect=true
function c17236839.filter1(c,e)
return c:IsOnField() and not c:IsImmuneToEffect(e)
end
......
......@@ -12,7 +12,6 @@ function c17530001.initial_effect(c)
e1:SetOperation(c17530001.operation)
c:RegisterEffect(e1)
end
c17530001.toss_dice=true
function c17530001.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,1)
......
......@@ -19,7 +19,6 @@ function c1784686.initial_effect(c)
e2:SetValue(10000050)
c:RegisterEffect(e2)
end
c1784686.fusion_effect=true
function c1784686.tgfilter(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0x10a2) and c:IsCanBeFusionMaterial()
and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_FMATERIAL)
......
......@@ -12,7 +12,6 @@ function c1845204.initial_effect(c)
e1:SetOperation(c1845204.activate)
c:RegisterEffect(e1)
end
c1845204.fusion_effect=true
function c1845204.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
......
......@@ -21,15 +21,16 @@ function s.initial_effect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_REMOVE)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1)
e2:SetTarget(s.efilter)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(id)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(s.eftg)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
--remove and tograve
local e4=Effect.CreateEffect(c)
......@@ -64,7 +65,7 @@ function s.tgop(e,tp,eg,ep,ev,re,r,rp)
end
end
function s.efilter(e,c,rp,r,re)
return c==e:GetHandler() and r&REASON_EFFECT>0
return c:IsHasEffect(id) and r&REASON_EFFECT>0
end
function s.eftg(e,c)
return c:IsSetCard(0x38) and c:IsFaceup()
......
......@@ -68,7 +68,6 @@ function s.negop(e,tp,eg,ep,ev,re,r,rp)
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
e1:SetValue(-1000)
......
--ジュラック・メガロ
local s,id,o=GetID()
---@param c Card
function s.initial_effect(c)
aux.AddCodeList(c,id)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DESTROY|CATEGORY_TOGRAVE|CATEGORY_SPECIAL_SUMMON|CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_DESTROYED)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
end
function s.tgfilter(c,e,tp)
return c:IsLevelAbove(1) and c:IsRace(RACE_DINOSAUR) and c:IsAbleToGrave()
end
function s.spfilter(c,e,tp)
return not c:IsCode(id) and c:IsSetCard(0x22) and c:IsLevelAbove(1) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function s.gcheck(g,lv)
return g:GetSum(Card.GetLevel)==lv
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,0,nil,e,tp)
if chk==0 then return #g>0 and Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,0,1,1,nil,e,tp)
Duel.HintSelection(g)
if Duel.Destroy(g,REASON_EFFECT)>0 then
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local gc=sg:GetFirst()
if gc and Duel.SendtoGrave(gc,REASON_EFFECT)~=0 and gc:IsLocation(LOCATION_GRAVE) and ft>0 then
local lv=gc:GetLevel()
if ft>1 and Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local tg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,nil,e,tp)
if tg:CheckSubGroup(s.gcheck,1,ft,lv) and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local ssg=tg:SelectSubGroup(tp,s.gcheck,false,1,ft,lv)
if ssg:GetCount()>0 then
Duel.BreakEffect()
Duel.SpecialSummon(ssg,0,tp,tp,true,false,POS_FACEUP)
end
end
end
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.splimit(e,c)
return not c:IsRace(RACE_DINOSAUR)
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.IsAbleToHand),tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_ONFIELD)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,aux.AND(Card.IsFaceup,Card.IsAbleToHand),tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
......@@ -19,7 +19,6 @@ function c21011044.initial_effect(c)
e1:SetOperation(c21011044.activate)
c:RegisterEffect(e1)
end
c21011044.fusion_effect=true
function c21011044.filter0(c)
return c:IsOnField() and c:IsAbleToRemove()
end
......
--魔轟神レヴェルゼブル
local s,id,o=GetID()
---@param c Card
function s.initial_effect(c)
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--get
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_RELEASE|CATEGORY_CONTROL)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER|TIMING_MAIN_END)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(s.ctcon)
e1:SetTarget(s.cttg)
e1:SetOperation(s.ctop)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOEXTRA|CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,id+o)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
end
function s.ctcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsMainPhase()
end
function s.rfilter(c,tp)
return c:IsSetCard(0x35) and c:IsType(TYPE_MONSTER) and Duel.GetMZoneCount(tp,c,tp,LOCATION_REASON_CONTROL)>0
and Duel.IsExistingMatchingCard(s.ctfilter,tp,0,LOCATION_MZONE,1,c)
end
function s.ctfilter(c)
return c:IsFaceup() and c:IsControlerCanBeChanged(true)
end
function s.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.CheckReleaseGroupEx(tp,s.rfilter,1,REASON_EFFECT,false,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_RELEASE,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,nil,1,0,0)
end
function s.ctop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local og=Duel.GetMatchingGroup(s.ctfilter,tp,0,LOCATION_MZONE,nil)
if og:GetCount()==0 then return end
local rg=Duel.GetReleaseGroup(tp,false,REASON_EFFECT):Filter(s.rfilter,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=rg:Select(tp,1,og:GetCount(),nil)
local ct=Duel.Release(sg,REASON_EFFECT)
if ct>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local tg=Duel.SelectMatchingCard(tp,s.ctfilter,tp,0,LOCATION_MZONE,ct,ct,nil)
Duel.HintSelection(tg)
if not Duel.GetControl(tg,tp) then return end
local cg=tg:Filter(Card.IsControler,nil,tp)
for tc in aux.Next(cg) do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
end
end
end
function s.thfilter(c)
return c:IsSetCard(0x35) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.thfilter(chkc) and chkc~=e:GetHandler() end
if chk==0 then return e:GetHandler():IsAbleToExtra()
and Duel.IsExistingTarget(s.thfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,e:GetHandler(),1,0,0)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local c=e:GetHandler()
if c:IsRelateToEffect(e) and aux.NecroValleyFilter()(c) and Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)~=0
and c:IsLocation(LOCATION_EXTRA) and tc:IsRelateToEffect(e) and aux.NecroValleyFilter()(tc) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
......@@ -28,7 +28,6 @@ function c21598948.initial_effect(c)
e3:SetOperation(c21598948.mtop)
c:RegisterEffect(e3)
end
c21598948.toss_coin=true
function c21598948.atkcon(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer()
end
......
......@@ -12,7 +12,6 @@ function c2196767.initial_effect(c)
e1:SetOperation(c2196767.desop)
c:RegisterEffect(e1)
end
c2196767.toss_coin=true
function c2196767.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,3)
......
......@@ -11,7 +11,6 @@ function c22802010.initial_effect(c)
e1:SetOperation(c22802010.activate)
c:RegisterEffect(e1)
end
c22802010.toss_dice=true
function c22802010.filter(c,lv)
return c:IsFaceup() and (c:IsLevelBelow(lv) or c:IsRankBelow(lv))
end
......
......@@ -10,7 +10,6 @@ function c23299957.initial_effect(c)
e1:SetOperation(c23299957.activate)
c:RegisterEffect(e1)
end
c23299957.fusion_effect=true
function c23299957.filter1(c,e)
return not c:IsImmuneToEffect(e)
end
......
......@@ -2,36 +2,7 @@
---@param c Card
function c23846921.initial_effect(c)
--coin
local e1=Effect.CreateEffect(c)
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
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)
aux.EnableArcanaCoin(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP_SUMMON_SUCCESS,EVENT_SPSUMMON_SUCCESS)
--coin effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(23846921,1))
......@@ -43,7 +14,6 @@ function c23846921.arcanareg(c,coin)
e1:SetCost(c23846921.skipcost)
e1:SetTarget(c23846921.skiptg)
e1:SetOperation(c23846921.skipop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
......@@ -56,12 +26,10 @@ function c23846921.arcanareg(c,coin)
e2:SetCondition(c23846921.thcon)
e2:SetTarget(c23846921.thtg)
e2:SetOperation(c23846921.thop)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e2)
c:RegisterFlagEffect(36690018,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,coin,63-coin)
end
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
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
......@@ -82,7 +50,7 @@ function c23846921.skipop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e1,tp)
end
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
function c23846921.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -10,7 +10,6 @@ function c24094653.initial_effect(c)
e1:SetOperation(c24094653.activate)
c:RegisterEffect(e1)
end
c24094653.fusion_effect=true
function c24094653.filter1(c,e)
return not c:IsImmuneToEffect(e)
end
......
--ジェムナイト・ディスパージョン
local s,id,o=GetID()
---@param c Card
function s.initial_effect(c)
aux.AddCodeList(c,1264319)
--Activate 1
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON|CATEGORY_FUSION_SUMMON|CATEGORY_SEARCH|CATEGORY_TOHAND|CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.filter0(c)
return c:IsSetCard(0x1047) and not c:IsRace(RACE_ROCK)
and c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToGrave()
end
function s.filter1(c,e)
return not c:IsImmuneToEffect(e)
end
function s.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x1047) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function s.thfilter(c)
return c:IsFaceupEx() and c:IsSetCard(0x47) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function s.fcheck(tp,sg,fc)
return sg:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)<=2
end
function s.gcheck(sg)
return sg:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)<=2
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(s.filter1,nil,e)
if Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,1264319) then
local sg=Duel.GetMatchingGroup(s.filter0,tp,LOCATION_DECK+LOCATION_EXTRA,0,nil)
mg1:Merge(sg)
aux.FCheckAdditional=s.fcheck
aux.GCheckAdditional=s.gcheck
end
local res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
aux.FCheckAdditional=nil
aux.GCheckAdditional=nil
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
local b1=res and (Duel.GetFlagEffect(tp,id)==0 or not e:IsCostChecked())
local b2=Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK+LOCATION_REMOVED,0,1,nil)
and (Duel.GetFlagEffect(tp,id+o)==0 or not e:IsCostChecked())
if chk==0 then return b1 or b2 end
local op=0
if b1 and not b2 then
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(id,1))
op=1
end
if b2 and not b1 then
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(id,2))
op=2
end
if b1 and b2 then
op=aux.SelectFromOptions(tp,
{b1,aux.Stringid(id,1)},
{b2,aux.Stringid(id,2)})
end
e:SetLabel(op)
if op==1 then
if e:IsCostChecked() then
e:SetCategory(CATEGORY_SPECIAL_SUMMON|CATEGORY_FUSION_SUMMON|CATEGORY_DECKDES)
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
elseif op==2 then
if e:IsCostChecked() then
e:SetCategory(CATEGORY_SEARCH|CATEGORY_TOHAND)
Duel.RegisterFlagEffect(tp,id+o,RESET_PHASE+PHASE_END,0,1)
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_REMOVED)
end
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==1 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(s.filter1,nil,e)
local exmat=false
if Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,1264319) then
local sg=Duel.GetMatchingGroup(s.filter0,tp,LOCATION_DECK+LOCATION_EXTRA,0,nil,e)
if sg:GetCount()>0 then
mg1:Merge(sg)
exmat=true
end
end
if exmat then
aux.FCheckAdditional=s.fcheck
aux.GCheckAdditional=s.gcheck
end
local sg1=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
aux.FCheckAdditional=nil
aux.GCheckAdditional=nil
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
mg1:RemoveCard(tc)
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or ce and not Duel.SelectYesNo(tp,ce:GetDescription())) then
if exmat then
aux.FCheckAdditional=s.fcheck
aux.GCheckAdditional=s.gcheck
end
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
aux.FCheckAdditional=nil
aux.GCheckAdditional=nil
tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
elseif ce~=nil then
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
elseif e:GetLabel()==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK+LOCATION_REMOVED,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
if Duel.GetFlagEffect(tp,51831560)==0 then
Duel.RegisterFlagEffect(tp,51831560,RESET_PHASE+PHASE_END,0,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetCondition(s.damcon)
e1:SetValue(s.damval)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
end
function s.damcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2
end
function s.damval(e,re,val,r,rp,rc)
if r&REASON_EFFECT==REASON_EFFECT then
return math.ceil(val/2)
else return val end
end
......@@ -28,7 +28,6 @@ function c24484270.initial_effect(c)
e2:SetOperation(c24484270.spop)
c:RegisterEffect(e2)
end
c24484270.fusion_effect=true
function c24484270.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
......
......@@ -30,9 +30,9 @@ function s.checkzone(tp)
local zone=0
local g=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
for tc in aux.Next(g) do
zone=bit.bor(zone,tc:GetLinkedZone(tp))
zone=zone|tc:GetLinkedZone(tp)
end
return bit.band(zone,0x1f)
return zone&0x1f
end
function s.spcon(e,c)
if c==nil then return true end
......
......@@ -2,14 +2,6 @@
local s,id,o=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--Traitor_chaining_effect
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e0:SetCode(EVENT_ADJUST)
e0:SetRange(0xff)
e0:SetOperation(s.adjustop)
c:RegisterEffect(e0)
--special summon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......@@ -19,7 +11,7 @@ function s.initial_effect(c)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e2:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
......@@ -58,38 +50,11 @@ function s.initial_effect(c)
e8:SetValue(s.efilter)
c:RegisterEffect(e8)
end
function s.adjustop(e,tp,eg,ep,ev,re,r,rp)
if not s.globle_check then
s.globle_check=true
s.Traitor_RegisterEffect=Card.RegisterEffect
function Card.RegisterEffect(Card_c,Effect_e,bool)
if Effect_e:GetType() and bit.band(Effect_e:GetType(),EFFECT_TYPE_QUICK_O+EFFECT_TYPE_QUICK_F)~=0 then
if Effect_e:GetCode() and Effect_e:GetCode()==EVENT_CHAINING then
Card_c:RegisterFlagEffect(id,0,0,1)
end
end
if bool then
s.Traitor_RegisterEffect(Card_c,Effect_e,bool)
else
s.Traitor_RegisterEffect(Card_c,Effect_e,false)
end
end
local rg=Duel.GetMatchingGroup(Card.IsType,tp,0xff,0xff,nil,TYPE_MONSTER)
for tc in aux.Next(rg) do
if tc.initial_effect then
local Traitor_initial_effect=s.initial_effect
s.initial_effect=function() end
tc:ReplaceEffect(id,0)
s.initial_effect=Traitor_initial_effect
tc.initial_effect(tc)
end
end
Card.RegisterEffect=s.Traitor_RegisterEffect
end
function s.quick_filter(e)
return e:GetCode()==EVENT_CHAINING and e:IsHasType(EFFECT_TYPE_QUICK_O+EFFECT_TYPE_QUICK_F) and e:IsHasRange(LOCATION_HAND+LOCATION_MZONE)
end
function s.cfilter(c)
return (c:GetFlagEffect(id)>0 or c.Traitor_chaining_effect) and bit.band(c:GetOriginalType(),TYPE_MONSTER)==TYPE_MONSTER
and c:IsFaceupEx()
return c:IsOriginalEffectProperty(s.quick_filter) and c:GetOriginalType()&TYPE_MONSTER==TYPE_MONSTER and c:IsFaceupEx()
end
function s.spcon(e,c)
if c==nil then return true end
......
......@@ -15,9 +15,8 @@ function s.initial_effect(c)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCode(EVENT_PHASE+PHASE_BATTLE)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id)
e2:SetTarget(s.sptg)
......
--ジェムナイトマスター・ダイヤ-ディスパージョン
local s,id,o=GetID()
---@param c Card
function s.initial_effect(c)
--fusion material
aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x47),3,true)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetCondition(s.spcon)
e1:SetCost(s.spcost)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--spsummon from grave
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_DESTROYED)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,id+o)
e2:SetCondition(s.spcon2)
e2:SetTarget(s.sptg2)
e2:SetOperation(s.spop2)
c:RegisterEffect(e2)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsMainPhase()
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function s.spfilter1(c,e,tp,ec)
return c:IsSetCard(0x47) and not c:IsRace(RACE_ROCK) and c:IsType(TYPE_MONSTER)
and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
and (c:IsLocation(LOCATION_GRAVE) and Duel.GetMZoneCount(tp,c)>0
or c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp,tp,ec,c)>0)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local ect=c29724053 and Duel.IsPlayerAffectedByEffect(tp,29724053) and c29724053[tp]
if chk==0 then return (not ect or ect>0) and Duel.IsExistingMatchingCard(s.spfilter1,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil,e,tp,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_EXTRA)
end
function s.spfilter2(c,e,tp)
if not (c:IsSetCard(0x47) and not c:IsRace(RACE_ROCK) and c:IsType(TYPE_MONSTER)
and c:IsCanBeSpecialSummoned(e,0,tp,true,false)) then return false end
if c:IsLocation(LOCATION_EXTRA) then
return Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
else
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
end
end
function s.exfilter1(c)
return c:IsLocation(LOCATION_EXTRA) and c:IsFacedown() and c:IsType(TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ)
end
function s.exfilter2(c)
return c:IsLocation(LOCATION_EXTRA) and (c:IsType(TYPE_LINK) or (c:IsFaceup() and c:IsType(TYPE_PENDULUM)))
end
function s.gcheck(g,ft1,ft2,ft3,ect,ft)
return aux.dncheck(g) and #g<=ft
and g:FilterCount(Card.IsLocation,nil,LOCATION_GRAVE)<=ft1
and g:FilterCount(s.exfilter1,nil)<=ft2
and g:FilterCount(s.exfilter2,nil)<=ft3
and g:FilterCount(Card.IsLocation,nil,LOCATION_EXTRA)<=ect
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local eft1=Duel.GetLocationCount(tp,LOCATION_MZONE)
local eft2=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ)
local eft3=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_PENDULUM+TYPE_LINK)
local ft=Duel.GetUsableMZoneCount(tp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then
if eft1>0 then eft1=1 end
if eft2>0 then eft2=1 end
if eft3>0 then eft3=1 end
ft=1
end
local ect=(c29724053 and Duel.IsPlayerAffectedByEffect(tp,29724053) and c29724053[tp]) or ft
local loc=0
if eft1>0 then loc=loc+LOCATION_GRAVE end
if ect>0 and (eft2>0 or eft3>0) then loc=loc+LOCATION_EXTRA end
if loc~=0 then
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.spfilter2),tp,loc,0,nil,e,tp)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroup(tp,s.gcheck,false,1,3,eft1,eft2,eft3,ect,ft)
if sg:GetCount()>0 then
local exg1=sg:Filter(s.exfilter2,nil)
sg:Sub(exg1)
if exg1:GetCount()>0 then
for tc in aux.Next(exg1) do
Duel.SpecialSummonStep(tc,0,tp,tp,true,false,POS_FACEUP)
end
end
local exg2=sg:Filter(s.exfilter1,nil)
sg:Sub(exg2)
if exg2:GetCount()>0 then
for tc in aux.Next(exg2) do
Duel.SpecialSummonStep(tc,0,tp,tp,true,false,POS_FACEUP)
end
end
if sg:GetCount()>0 then
for tc in aux.Next(sg) do
Duel.SpecialSummonStep(tc,0,tp,tp,true,false,POS_FACEUP)
end
end
Duel.SpecialSummonComplete()
end
end
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.splimit(e,c)
return not c:IsType(TYPE_FUSION) and c:IsLocation(LOCATION_EXTRA)
end
function s.cfilter(c,tp)
return c:IsType(TYPE_FUSION) and c:IsPreviousControler(tp)
and c:IsPreviousSetCard(0x1047)
and c:IsSetCard(0x1047)
end
function s.spcon2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,e:GetHandler(),tp)
end
function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function s.spop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and aux.NecroValleyFilter()(c) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
......@@ -13,7 +13,6 @@ function c25551951.initial_effect(c)
e1:SetOperation(c25551951.desop)
c:RegisterEffect(e1)
end
c25551951.toss_coin=true
function c25551951.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end
......
......@@ -11,7 +11,6 @@ function c25800447.initial_effect(c)
e1:SetOperation(c25800447.activate)
c:RegisterEffect(e1)
end
c25800447.fusion_effect=true
function c25800447.filter0(c)
return c:IsFaceup() and c:IsCanBeFusionMaterial()
end
......
......@@ -24,7 +24,6 @@ function s.initial_effect(c)
e2:SetOperation(s.drop)
c:RegisterEffect(e2)
end
s.toss_coin=true
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -24,7 +24,6 @@ function c26273196.initial_effect(c)
e2:SetOperation(c26273196.matop)
c:RegisterEffect(e2)
end
c26273196.toss_coin=true
function c26273196.matcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
end
......
......@@ -23,7 +23,6 @@ function c26631975.initial_effect(c)
e2:SetOperation(c26631975.cdop)
c:RegisterEffect(e2)
end
c26631975.fusion_effect=true
function c26631975.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
......
......@@ -60,8 +60,7 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
end
end
function s.cfilter(c,tp)
return bit.band(c:GetType(),TYPE_TRAP+TYPE_CONTINUOUS)==TYPE_TRAP+TYPE_CONTINUOUS
and c:IsPreviousLocation(LOCATION_SZONE) and c:IsControler(tp)
return c:IsAllTypes(TYPE_TRAP+TYPE_CONTINUOUS) and c:IsPreviousLocation(LOCATION_SZONE) and c:IsControler(tp)
end
function s.damcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp)
......@@ -75,8 +74,7 @@ function s.cfilter2(c)
end
function s.discon(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
return bit.band(rc:GetType(),TYPE_TRAP+TYPE_CONTINUOUS)==TYPE_TRAP+TYPE_CONTINUOUS
and re:GetActivateLocation()==LOCATION_MZONE
return rc:IsAllTypes(TYPE_TRAP+TYPE_CONTINUOUS) and re:GetActivateLocation()==LOCATION_MZONE
and Duel.IsExistingMatchingCard(s.cfilter2,tp,LOCATION_REMOVED,0,1,nil)
end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
......@@ -10,7 +10,6 @@ function c26841274.initial_effect(c)
e1:SetOperation(c26841274.activate)
c:RegisterEffect(e1)
end
c26841274.fusion_effect=true
function c26841274.filter1(c,e)
return c:IsOnField() and c:IsSetCard(0xc008) and (not e or not c:IsImmuneToEffect(e))
end
......
......@@ -39,7 +39,7 @@ function s.initial_effect(c)
c:RegisterEffect(e3)
end
function s.mfilter(ft,lv,race,att)
return ft==1 and lv>=5 and bit.band(race,RACE_WARRIOR)==RACE_WARRIOR
return ft==1 and lv>=5 and race&RACE_WARRIOR~=0
end
s.Metallization_material=s.mfilter
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -31,7 +31,6 @@ function c28112535.initial_effect(c)
e5:SetOperation(c28112535.desop)
c:RegisterEffect(e5)
end
c28112535.toss_coin=true
function c28112535.atklimit(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -12,7 +12,6 @@ function c29062925.initial_effect(c)
e1:SetOperation(c29062925.activate)
c:RegisterEffect(e1)
end
c29062925.fusion_effect=true
function c29062925.exconfilter(c)
return c:IsCode(25652259,64788463,90876561) and c:IsFaceup()
end
......
......@@ -22,7 +22,6 @@ function c29143457.initial_effect(c)
e2:SetOperation(c29143457.thop)
c:RegisterEffect(e2)
end
c29143457.fusion_effect=true
function c29143457.filter1(c,e)
return not c:IsImmuneToEffect(e)
end
......
......@@ -25,7 +25,6 @@ function c29280589.initial_effect(c)
e2:SetValue(c29280589.repval)
c:RegisterEffect(e2)
end
c29280589.fusion_effect=true
function c29280589.condition(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and Duel.GetTurnPlayer()==1-tp
end
......
......@@ -35,7 +35,6 @@ function c29719112.initial_effect(c)
e3:SetOperation(c29719112.thop)
c:RegisterEffect(e3)
end
c29719112.fusion_effect=true
function c29719112.spfilter(c,tp)
return c:IsRace(RACE_MACHINE)
and Duel.GetMZoneCount(tp,c)>0 and (c:IsControler(tp) or c:IsFaceup())
......
......@@ -83,7 +83,7 @@ function c29913783.spcon2(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer()
end
function c29913783.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c29913783.spop2(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -28,7 +28,6 @@ function c30118701.initial_effect(c)
e2:SetOperation(c30118701.spop)
c:RegisterEffect(e2)
end
c30118701.fusion_effect=true
function c30118701.hspcfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end
......
......@@ -56,10 +56,10 @@ function c30439101.discon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c30439101.cfilter,1,nil,tp)
end
function c30439101.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and aux.NegateMonsterFilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(aux.NegateMonsterFilter,tp,0,LOCATION_MZONE,1,nil) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local g=Duel.SelectTarget(tp,aux.NegateMonsterFilter,tp,0,LOCATION_MZONE,1,1,nil)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
end
function c30439101.disop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -12,7 +12,6 @@ function c30707994.initial_effect(c)
e1:SetOperation(c30707994.operation)
c:RegisterEffect(e1)
end
c30707994.toss_dice=true
function c30707994.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_ADVANCE)
end
......
......@@ -24,7 +24,6 @@ function c3078380.initial_effect(c)
e2:SetOperation(c3078380.fspop)
c:RegisterEffect(e2)
end
c3078380.fusion_effect=true
function c3078380.cfilter(c,tp)
return (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and Duel.GetMZoneCount(tp,c)>0 and c:IsAbleToGraveAsCost()
and (c:IsRace(RACE_SPELLCASTER) and c:IsType(TYPE_MONSTER) or aux.IsCodeListed(c,46986414) and c:IsType(TYPE_SPELL+TYPE_TRAP))
......
......@@ -34,7 +34,6 @@ function c31444249.initial_effect(c)
e4:SetOperation(c31444249.spop)
c:RegisterEffect(e4)
end
c31444249.fusion_effect=true
function c31444249.lvtg(e,c)
return c:IsSetCard(0xbb) and c:GetOriginalLevel()>=2
end
......
......@@ -48,7 +48,7 @@ function s.indtg(e,c)
return c:IsSetCard(0xea)
end
function s.indct(e,re,r,rp)
if bit.band(r,REASON_BATTLE)~=0 then
if r&REASON_BATTLE~=0 then
return 1
else return 0 end
end
......
......@@ -13,7 +13,6 @@ function c31855260.initial_effect(c)
e1:SetOperation(c31855260.activate)
c:RegisterEffect(e1)
end
c31855260.fusion_effect=true
function c31855260.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
......
......@@ -3,6 +3,7 @@
function c31863912.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DICE+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_SPSUMMON)
......@@ -12,6 +13,7 @@ function c31863912.initial_effect(c)
--
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(31863912,0))
e1:SetCategory(CATEGORY_DICE+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_SZONE)
......@@ -20,7 +22,6 @@ function c31863912.initial_effect(c)
e2:SetLabel(1)
c:RegisterEffect(e2)
end
c31863912.toss_dice=true
function c31863912.cfilter(c,sp)
return c:IsFaceup() and c:IsSummonPlayer(sp)
end
......
......@@ -36,7 +36,6 @@ function s.initial_effect(c)
e4:SetOperation(s.operation)
c:RegisterEffect(e4)
end
s.fusion_effect=true
function s.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
......
......@@ -20,7 +20,6 @@ function c32015116.initial_effect(c)
e2:SetOperation(c32015116.rdop)
c:RegisterEffect(e2)
end
c32015116.toss_dice=true
function c32015116.rdcon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer()
end
......
......@@ -22,7 +22,6 @@ function c32104431.initial_effect(c)
e2:SetOperation(c32104431.fusionop)
c:RegisterEffect(e2)
end
c32104431.fusion_effect=true
function c32104431.costfilter(c)
return c:IsSetCard(0xd6) and c:IsDiscardable()
end
......
......@@ -40,7 +40,6 @@ function c32615065.initial_effect(c)
e3:SetOperation(c32615065.spop)
c:RegisterEffect(e3)
end
c32615065.fusion_effect=true
function c32615065.ffilter(c)
return c:IsRace(RACE_WARRIOR) and c:IsLevelAbove(5)
end
......
......@@ -10,7 +10,6 @@ function c3280747.initial_effect(c)
e1:SetOperation(c3280747.activate)
c:RegisterEffect(e1)
end
c3280747.toss_dice=true
function c3280747.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=6 end
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,2)
......
......@@ -27,7 +27,6 @@ function s.initial_effect(c)
e3:SetOperation(s.fsop)
c:RegisterEffect(e3)
end
s.fusion_effect=true
function s.filter(c,tp)
return c:IsType(TYPE_FUSION) and Duel.IsExistingMatchingCard(s.sfilter,tp,LOCATION_DECK,0,1,nil,c)
end
......
......@@ -14,6 +14,7 @@ function c33114323.initial_effect(c)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(0x34,0x34)
e2:SetCondition(c33114323.effcon)
......
......@@ -64,7 +64,6 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp)
if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsControler(1-tp) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-600)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
......
......@@ -17,7 +17,6 @@ function c33550694.initial_effect(c)
e2:SetOperation(c33550694.operation)
c:RegisterEffect(e2)
end
c33550694.fusion_effect=true
function c33550694.filter1(c,e)
return c:IsAbleToRemove() and not c:IsImmuneToEffect(e)
end
......
......@@ -106,7 +106,7 @@ end
function s.coinop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local res=-1
if c:IsHasEffect(73206827) then
if Duel.IsPlayerAffectedByEffect(tp,73206827) then
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
local b2=Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter2,tp,LOCATION_DECK,0,1,nil,e,tp)
if b1 and not b2 then
......
......@@ -8,18 +8,18 @@ function s.initial_effect(c)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--to deck
local custom_code=aux.RegisterMergedDelayedEvent_ToSingleCard(c,id,EVENT_REMOVE)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_CUSTOM+id)
e1:SetCode(custom_code)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,id)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(s.tdtg)
e1:SetOperation(s.tdop)
c:RegisterEffect(e1)
aux.RegisterMergedDelayedEvent(c,id,EVENT_REMOVE)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
......
--葬角のカルノヴルス
local s,id,o=GetID()
---@param c Card
function s.initial_effect(c)
--Synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--synchro summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_MAIN_END+TIMING_BATTLE_START+TIMING_BATTLE_END)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetCondition(s.sccon)
e1:SetTarget(s.sctg)
e1:SetOperation(s.scop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id+o)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
end
function s.sccon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE) or ph==PHASE_MAIN2
end
function s.scfilter(c,mc)
return c:IsSynchroSummonable(mc) and c:IsRace(RACE_DINOSAUR)
end
function s.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.scfilter,tp,LOCATION_EXTRA,0,1,nil,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function s.scop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsControler(1-tp) or not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local g=Duel.GetMatchingGroup(s.scfilter,tp,LOCATION_EXTRA,0,nil,c)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),c)
end
end
function s.spfilter(c,e,tp)
return c:IsRace(RACE_DINOSAUR) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)
end
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsRace(RACE_DINOSAUR)
end
......@@ -53,6 +53,7 @@ function c3428069.eqop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.Equip(tp,tc,c,false) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c3428069.eqlimit)
......
......@@ -24,7 +24,6 @@ function c34325937.initial_effect(c)
e2:SetOperation(c34325937.spop)
c:RegisterEffect(e2)
end
c34325937.fusion_effect=true
function c34325937.filter1(c,e)
return not c:IsImmuneToEffect(e)
end
......
......@@ -7,7 +7,7 @@ function c34568403.initial_effect(c)
e1:SetCategory(CATEGORY_COIN)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c34568403.cointg)
e1:SetTarget(aux.ArcanaCoinTarget)
e1:SetOperation(c34568403.coinop)
c:RegisterEffect(e1)
local e2=e1:Clone()
......@@ -16,41 +16,39 @@ function c34568403.initial_effect(c)
local e3=e1:Clone()
e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e3)
end
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)
--coin effect
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(34568403,1))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_BATTLE_DESTROYING)
e4:SetCondition(c34568403.spcon)
e4:SetTarget(c34568403.sptg)
e4:SetOperation(c34568403.spop)
c:RegisterEffect(e4)
end
function c34568403.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
local toss=false
if Duel.IsPlayerAffectedByEffect(tp,73206827) then
res=1-Duel.SelectOption(tp,60,61)
else res=Duel.TossCoin(tp,1) end
c34568403.arcanareg(c,res)
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:RegisterFlagEffect(FLAG_ID_ARCANA_COIN,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,res,63-res)
if res==0 then
Duel.GetControl(c,1-tp)
end
end
function c34568403.arcanareg(c,coin)
--coin effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(34568403,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetCondition(c34568403.spcon)
e1:SetTarget(c34568403.sptg)
e1:SetOperation(c34568403.spop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
c:RegisterFlagEffect(36690018,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,coin,63-coin)
end
function c34568403.spcon(e,tp,eg,ep,ev,re,r,rp)
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
function c34568403.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=e:GetHandler():GetBattleTarget()
......
......@@ -29,7 +29,6 @@ function c34813545.initial_effect(c)
e3:SetOperation(c34813545.fsop)
c:RegisterEffect(e3)
end
c34813545.fusion_effect=true
function c34813545.spfilter(c,e,tp)
return c:IsSetCard(0x2a) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
......
......@@ -11,7 +11,6 @@ function c3493058.initial_effect(c)
e1:SetOperation(c3493058.activate)
c:RegisterEffect(e1)
end
c3493058.toss_dice=true
function c3493058.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
......
......@@ -11,7 +11,6 @@ function c34933456.initial_effect(c)
e1:SetOperation(c34933456.activate)
c:RegisterEffect(e1)
end
c34933456.fusion_effect=true
function c34933456.mttg(e,c)
local tc=c:GetEquipTarget()
return tc and tc:IsSetCard(0x150) and c:GetOriginalType()&TYPE_MONSTER~=0
......
......@@ -32,7 +32,6 @@ function c34995106.initial_effect(c)
e3:SetOperation(c34995106.setop)
c:RegisterEffect(e3)
end
c34995106.fusion_effect=true
function c34995106.filter1(c,e)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemove() and c:IsCanBeFusionMaterial() and not c:IsImmuneToEffect(e)
end
......
......@@ -22,7 +22,6 @@ function c35098357.initial_effect(c)
e2:SetOperation(c35098357.thop)
c:RegisterEffect(e2)
end
c35098357.fusion_effect=true
function c35098357.filter1(c,e)
return not c:IsImmuneToEffect(e)
end
......
......@@ -9,7 +9,6 @@ function c3549275.initial_effect(c)
e1:SetOperation(c3549275.operation)
c:RegisterEffect(e1)
end
c3549275.toss_dice=true
function c3549275.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,PLAYER_ALL,1)
......
......@@ -40,7 +40,6 @@ function c35606858.initial_effect(c)
e3:SetOperation(c35606858.dcop)
c:RegisterEffect(e3)
end
c35606858.toss_dice=true
function c35606858.mtcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
......
......@@ -11,7 +11,6 @@ function c35705817.initial_effect(c)
e1:SetOperation(c35705817.activate)
c:RegisterEffect(e1)
end
c35705817.fusion_effect=true
function c35705817.filter0(c)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToRemove() and c:IsRace(RACE_ZOMBIE)
end
......
......@@ -26,7 +26,6 @@ function c35772782.initial_effect(c)
c:RegisterEffect(e2)
end
aux.xyz_number[35772782]=67
c35772782.toss_dice=true
function c35772782.dccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1
end
......
......@@ -2,36 +2,7 @@
---@param c Card
function c35781051.initial_effect(c)
--coin
local e1=Effect.CreateEffect(c)
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
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)
aux.EnableArcanaCoin(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP_SUMMON_SUCCESS,EVENT_SPSUMMON_SUCCESS)
--coin effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(35781051,1))
......@@ -42,7 +13,6 @@ function c35781051.arcanareg(c,coin)
e1:SetCondition(c35781051.spcon)
e1:SetTarget(c35781051.sptg)
e1:SetOperation(c35781051.spop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_MSET)
......@@ -57,15 +27,13 @@ function c35781051.arcanareg(c,coin)
e3:SetCondition(c35781051.tgcon)
e3:SetTarget(c35781051.tgtg)
e3:SetOperation(c35781051.tgop)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_MSET)
c:RegisterEffect(e4)
c:RegisterFlagEffect(36690018,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,coin,63-coin)
end
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
function c35781051.spfilter(c,e,tp)
return c:IsSetCard(0x5) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......@@ -84,7 +52,7 @@ function c35781051.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
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
function c35781051.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -14,12 +14,12 @@ function c35798491.initial_effect(c)
--disable and destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCategory(CATEGORY_DICE)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetRange(LOCATION_MZONE)
e2:SetOperation(c35798491.disop)
c:RegisterEffect(e2)
end
c35798491.toss_dice=true
function c35798491.mtcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
......
......@@ -23,6 +23,7 @@ function c35975813.initial_effect(c)
--disable and destroy
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCategory(CATEGORY_DICE)
e4:SetCode(EVENT_CHAIN_SOLVING)
e4:SetRange(LOCATION_MZONE)
e4:SetOperation(c35975813.disop)
......@@ -35,7 +36,6 @@ function c35975813.initial_effect(c)
e5:SetOperation(c35975813.disop2)
c:RegisterEffect(e5)
end
c35975813.toss_dice=true
function c35975813.exfilter(c)
return c:IsFaceup() and c:IsSetCard(0x45)
end
......
......@@ -23,7 +23,6 @@ function c36328300.initial_effect(c)
e2:SetOperation(c36328300.plop)
c:RegisterEffect(e2)
end
c36328300.fusion_effect=true
function c36328300.confilter(c,tp)
return c:IsPreviousSetCard(0x1034) and c:IsPreviousControler(tp)
end
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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