Commit db80d0fc authored by 聖園ミカ's avatar 聖園ミカ 🐟

byd

parent 9ff38e69
--FGO·Caster·大黑天
local m=111145
local cm=_G["c"..m]
cm.level_base_side=111145
cm.level_rejuvenation_side=111146
Duel.LoadScript("c100502.lua")
function cm.initial_effect(c)
fgo.spsumself(c,m)
fgo.spsumline(c,m)--召唤台词
fgo.spsum(c,RACE_BEASTWARRIOR+RACE_BEAST,cm.level_base_side,cm.level_rejuvenation_side,0,0)
local e1=Effect.CreateEffect(c)
fgo.effect(e1,0,m,EFFECT_TYPE_IGNITION,CATEGORY_DRAW+CATEGORY_TODECK,0,0,0,cm.drtg,cm.drop,0,EFFECT_FLAG_DELAY,m,0,0)
c:RegisterEffect(e1)
end
function cm.drtgfilter(c)
return c:IsAbleToDeck() and c:IsSetCard(0xc11) and c:IsType(TYPE_MONSTER)
end
function cm.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and Duel.IsExistingMatchingCard(cm.drtgfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cm.drop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.drtgfilter,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.ConfirmCards(1-tp,tc)
if Duel.SendtoDeck(tc,nil,SEQ_DECKBOTTOM,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_DECK) then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
\ No newline at end of file
--FGO·Caster·大黑天(灵基再临第二阶段)
local m=111146
local cm=_G["c"..m]
cm.level_base_side=111146
cm.level_rejuvenation_side=111145
cm.level_rejuvenation_second_side=111147
Duel.LoadScript("c100502.lua")
function cm.initial_effect(c)
fgo.back(c,cm.level_rejuvenation_side,cm.level_base_side)
fgo.spsum(c,RACE_BEASTWARRIOR+RACE_BEAST,cm.level_base_side,cm.level_rejuvenation_second_side,Card.IsLevelAbove,4)
local e1=Effect.CreateEffect(c)
fgo.effect(e1,0,m,EFFECT_TYPE_IGNITION,CATEGORY_DRAW+CATEGORY_TODECK,0,0,0,cm.drtg,cm.drop,0,EFFECT_FLAG_DELAY,1,0,0)
c:RegisterEffect(e1)
local e4=Effect.CreateEffect(c)
fgo.effect(e4,0,m,EFFECT_TYPE_IGNITION,CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN,0,cm.spcost,0,cm.sptg,cm.spop,0,0,0 ,0,0)
c:RegisterEffect(e4)
end
function cm.drtgfilter(c)
return c:IsAbleToDeck() and c:IsSetCard(0xc11) and c:IsType(TYPE_MONSTER)
end
function cm.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) and Duel.IsExistingMatchingCard(cm.drtgfilter,tp,LOCATION_HAND,0,2,nil) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,2,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function cm.drop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.drtgfilter,tp,LOCATION_HAND,0,2,2,nil)
local tc=g:GetFirst()
if tc then
Duel.ConfirmCards(1-tp,tc)
if Duel.SendtoDeck(tc,nil,SEQ_DECKBOTTOM,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_DECK) then
Duel.Draw(tp,2,REASON_EFFECT)
end
end
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and Duel.IsPlayerCanSpecialSummonMonster(tp,30611019,0xc11,TYPES_TOKEN_MONSTER,0,0,4,RACE_BEAST,ATTRIBUTE_EARTH) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=1 then return end
if Duel.IsPlayerCanSpecialSummonMonster(tp,30611019,0xc11,TYPES_TOKEN_MONSTER,0,0,4,RACE_BEAST,ATTRIBUTE_EARTH) then
local token1=Duel.CreateToken(tp,30611019)
Duel.SpecialSummonStep(token1,0,tp,tp,false,false,POS_FACEUP)
local token2=Duel.CreateToken(tp,30611019)
Duel.SpecialSummonStep(token2,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummonComplete()
end
end
\ No newline at end of file
--我无需其他卡展示属于我的实力!
local m=150010
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
c:CancelToGrave()
Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
--神伪坛 天庭龙脉
local m=181010
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_CHANGE_DAMAGE)
e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e0:SetTargetRange(1,1)
e0:SetRange(LOCATION_FZONE)
e0:SetValue(cm.val)
c:RegisterEffect(e0)
end
function cm.val(e,re,dam,r,rp,rc)
local tp=e:GetHandlerPlayer()
if dam>100 then return dam elseif dam*300>3000 then return 3000 else return dam*300 end
end
\ No newline at end of file
--铁驭·加速行动
local m=181508
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.filter(c)
return c:IsSetCard(0xc17,0xc16) and c:IsAbleToDeck()
end
function cm.filter2(c)
return c:IsSetCard(0xc17,0xc16) and c:IsAbleToHand()
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local rg=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_HAND,0,e:GetHandler())
local thg=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_DECK,0,nil)
if chk==0 then
if e:GetLabel()==1 then
return rg:GetCount()>0 and rg:GetCount()<=thg:GetCount()
else
return false
end
end
Duel.SendtoDeck(rg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
Duel.SetTargetParam(rg:GetCount())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,rg:GetCount(),tp,LOCATION_DECK)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local card=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.filter2,tp,LOCATION_DECK,0,card,card,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--泰坦武装
local m=181510
local cm=_G["c"..m]
function cm.initial_effect(c)
--draw
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DRAW+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCost(cm.drcost)
e1:SetTarget(cm.drtg)
e1:SetOperation(cm.drop)
c:RegisterEffect(e1)
end
function cm.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
end
function cm.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and c:IsAbleToDeck() end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,0,0)
end
function cm.drop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
Duel.SendtoDeck(c,nil,SEQ_DECKBOTTOM,REASON_EFFECT)
end
\ No newline at end of file
--古道登仙·圣人
local m=182185
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddFusionProcFunRep(c,cm.ffilter,6,true)
c:EnableReviveLimit()
c:SetUniqueOnField(1,0,m,LOCATION_GRAVE+LOCATION_ONFIELD)
--special summon rule
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(LOCATION_EXTRA)
e0:SetValue(SUMMON_TYPE_FUSION)
e0:SetCountLimit(1,m)
e0:SetCondition(cm.spcon)
e0:SetOperation(cm.spop)
c:RegisterEffect(e0)
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.fuslimit)
e1:SetRange(LOCATION_EXTRA)
c:RegisterEffect(e1)
--indes
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e4:SetValue(1)
c:RegisterEffect(e4)
local e3=e4:Clone()
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e3)
--avoid battle damage
local e5=e4:Clone()
e5:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
c:RegisterEffect(e5)
--disable
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetTarget(cm.disable)
e2:SetCode(EFFECT_DISABLE)
c:RegisterEffect(e2)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD)
e6:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e6:SetCode(EFFECT_CANNOT_ACTIVATE)
e6:SetRange(LOCATION_MZONE)
e6:SetTargetRange(1,1)
e6:SetValue(cm.aclimit)
c:RegisterEffect(e6)
--pierce
local e11=Effect.CreateEffect(c)
e11:SetType(EFFECT_TYPE_SINGLE)
e11:SetCode(EFFECT_PIERCE)
e11:SetCondition(cm.effcon)
e11:SetLabel(3)
c:RegisterEffect(e11)
--attack all
local e12=Effect.CreateEffect(c)
e12:SetType(EFFECT_TYPE_SINGLE)
e12:SetCode(EFFECT_ATTACK_ALL)
e12:SetValue(1)
e12:SetCondition(cm.effcon)
e12:SetLabel(6)
c:RegisterEffect(e12)
--actlimit
local e13=Effect.CreateEffect(c)
e13:SetType(EFFECT_TYPE_FIELD)
e13:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e13:SetCode(EFFECT_CANNOT_ACTIVATE)
e13:SetRange(LOCATION_MZONE)
e13:SetTargetRange(0,1)
e13:SetValue(1)
e13:SetCondition(cm.actcon)
e13:SetLabel(9)
c:RegisterEffect(e13)
--immune
local e15=Effect.CreateEffect(c)
e15:SetType(EFFECT_TYPE_SINGLE)
e15:SetCode(EFFECT_IMMUNE_EFFECT)
e15:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e15:SetRange(LOCATION_MZONE)
e15:SetCondition(cm.effcon)
e15:SetValue(cm.efilter)
e15:SetLabel(12)
c:RegisterEffect(e15)
--negate
local e16=Effect.CreateEffect(c)
e16:SetDescription(aux.Stringid(m,1))
e16:SetCategory(CATEGORY_NEGATE)
e16:SetType(EFFECT_TYPE_QUICK_O)
e16:SetCode(EVENT_CHAINING)
e16:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e16:SetRange(LOCATION_MZONE)
e16:SetCountLimit(1)
e16:SetCondition(cm.negcon)
e16:SetTarget(cm.negtg)
e16:SetOperation(cm.negop)
c:RegisterEffect(e16)
--win
local e17=Effect.CreateEffect(c)
e17:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e17:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e17:SetCode(EVENT_ADJUST)
e17:SetRange(LOCATION_MZONE)
e17:SetOperation(cm.winop)
c:RegisterEffect(e17)
local e18=e17:Clone()
e18:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e18)
----
if not cm.global_check then
cm.global_check=true
local e10=Effect.CreateEffect(c)
e10:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e10:SetCode(EVENT_CHAIN_SOLVED)
e10:SetRange(LOCATION_EXTRA)
e10:SetCondition(cm.discon)
e10:SetOperation(cm.checkop)
c:RegisterEffect(e10)
end
end
function cm.ffilter(c,fc,sub,mg,sg)
return c:IsRace(RACE_DRAGON+RACE_WYRM) and c:IsType(TYPE_FUSION) and (not sg or not sg:IsExists(Card.IsFusionAttribute,1,c,c:GetFusionAttribute())) and c:IsLocation(LOCATION_ONFIELD)
end
function cm.efilter(e,re)
return e:GetHandlerPlayer()~=re:GetOwnerPlayer() and re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
end
function cm.confilter(c)
return c:IsRace(RACE_DRAGON+RACE_WYRM)
end
function cm.actcon(e)
local g=Duel.GetMatchingGroup(cm.confilter,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil)
return g:GetClassCount(Card.GetOriginalCode)>=e:GetLabel()
and Duel.GetAttacker()==e:GetHandler() or Duel.GetAttackTarget()==e:GetHandler()
end
function cm.effcon(e)
local g=Duel.GetMatchingGroup(cm.confilter,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil)
return g:GetClassCount(Card.GetOriginalCode)>=e:GetLabel()
end
function cm.winfilter(c)
return c:IsRace(RACE_DRAGON+RACE_WYRM)
end
function cm.winop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
--local WIN_REASON_SAINTS_WAY=0xc1b
local wg1=Duel.GetMatchingGroup(cm.winfilter,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil)
local wg2=Duel.GetMatchingGroup(aux.TRUE,e:GetHandlerPlayer(),LOCATION_EXTRA,0,nil)
if wg1:GetClassCount(Card.GetOriginalCode)>=3 then
c:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,3))
end
if wg1:GetClassCount(Card.GetOriginalCode)>=6 then
c:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,4))
end
if wg1:GetClassCount(Card.GetOriginalCode)>=9 then
c:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,5))
end
if wg1:GetClassCount(Card.GetOriginalCode)>=12 then
c:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,6))
end
if wg1:GetClassCount(Card.GetOriginalCode)>=25 then
c:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,7))
end
if wg1:GetClassCount(Card.GetOriginalCode)==30 and wg2:GetCount()==0 then
Duel.Hint(24,0,aux.Stringid(m,0))
Duel.Hint(24,0,aux.Stringid(m,1))
Duel.Hint(24,0,aux.Stringid(m,2))
--Duel.Win(tp,WIN_REASON_SAINTS_WAY)
Duel.SetLP(1-tp,0)
end
end
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
return rp==e:GetHandlerPlayer() and aux.IsCodeListed(re:GetHandler(),30682180)
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(e:GetHandlerPlayer(),m,0,0,1)
end
function cm.spfilter(c,fc,tp)
return c:IsSetCard(0xc1b) and c:IsReleasable() and Duel.GetLocationCountFromEx(tp,tp,c,fc)>0
and c:IsCanBeFusionMaterial(fc,SUMMON_TYPE_SPECIAL)
end
function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetFlagEffect(tp,m)>11 and Duel.CheckReleaseGroup(tp,cm.spfilter,1,nil,c,tp)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectReleaseGroup(tp,cm.spfilter,1,1,nil,c,tp)
c:SetMaterial(g)
Duel.Release(g,REASON_COST)
c:CompleteProcedure()
end
function cm.disable(e,c)
return c~=e:GetHandler()
end
function cm.aclimit(e,re,tp)
local rc=re:GetHandler()
return rc:IsLocation(LOCATION_MZONE) and re:IsActiveType(TYPE_MONSTER)
end
function cm.cfilter(c)
return c:IsLocation(LOCATION_GRAVE) and c:IsType(TYPE_MONSTER)
end
function cm.negcon(e,tp,eg,ep,ev,re,r,rp)
local ex,g,gc,dp,dv=Duel.GetOperationInfo(ev,CATEGORY_SPECIAL_SUMMON)
return Duel.IsChainNegatable(ev) and rp==1-tp
and (ex and (dv&LOCATION_GRAVE==LOCATION_GRAVE or g and g:IsExists(cm.cfilter,1,nil)) or re:IsHasCategory(CATEGORY_GRAVE_SPSUMMON))
end
function cm.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
end
function cm.negop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev)
end
--【特殊说明】
---仅供参考
---把场上的这张卡作为同调素材的场合,这张卡可以当作4星怪兽使用
--synchro level
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SYNCHRO_LEVEL)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(4)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(m)
e2:SetValue(aux.TRUE)
c:RegisterEffect(e2)
if not cm.check then
cm.check=true
cm[0]=Card.IsCanBeSynchroMaterial
Card.IsCanBeSynchroMaterial=function(tc,sc,...)
if tc:IsHasEffect(m) and tc:IsHasEffect(EFFECT_SYNCHRO_LEVEL) then
if tc:GetSynchroType()&TYPE_MONSTER==0 then return false end
if sc and tc:IsLocation(LOCATION_MZONE) and tc:GetControler()~=sc:GetControler() and not tc:IsHasEffect(EFFECT_SYNCHRO_MATERIAL) then return false end
if tc:IsStatus(STATUS_FORBIDDEN) then return false end
if tc:IsHasEffect(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL) then return false end
return true
else
return cm[0](tc,sc,...)
end
end
cm[1]=Card.GetSynchroLevel
Card.GetSynchroLevel=function(tc,sc)
local es={tc:IsHasEffect(EFFECT_SYNCHRO_LEVEL)}
local lev=0
for k,v in pairs(es) do
lev=v:GetValue(v)
break
end
if tc:IsHasEffect(m) and lev>0 then
return lev
else
return cm[1](tc,sc)
end
end
--[[
--for utility.lua load first before 2022.2.20
--now not available here
cm[2]=aux.AddSynchroProcedure
aux.AddSynchroProcedure=function(sc,f1,f2,min,max)
local maxc=max or 99
aux.AddSynchroMixProcedure(sc,f1,nil,nil,f2,min,maxc)
end
--]]
--fix for utility.lua load first 2022.2.20
--plan1
cm[3]=Duel.CheckTunerMaterial
Duel.CheckTunerMaterial=function(sc,smat,f1,f2,minc,maxc,mg1)
local f1=aux.Tuner(f1)
local tp=c:GetControler()
local mg
local mgchk=false
if mg1 then
mg=mg1
mgchk=true
else
mg=Auxiliary.GetSynMaterials(tp,sc)
end
if smat~=nil then mg:AddCard(smat) end
return mg:IsExists(Auxiliary.SynMixFilter1,1,nil,f1,nil,nil,f2,minc,maxc,sc,mg,smat,nil,mgchk)
end
cm[4]=Duel.CheckSynchroMaterial
Duel.CheckSynchroMaterial=function(sc,f1,f2,minc,maxc,smat,mg1)
return Duel.CheckTunerMaterial(sc,smat,f1,f2,minc,maxc,mg1)
end
cm[5]=Duel.SelectTunerMaterial
Duel.SelectTunerMaterial=function(tp,sc,smat,f1,f4,minc,maxc,mg1)
local f1=aux.Tuner(f1)
local g=Group.CreateGroup()
local gc=nil
local mg
local mgchk=false
if mg1 then
mg=mg1
mgchk=true
else
mg=Auxiliary.GetSynMaterials(tp,sc)
end
if smat~=nil then mg:AddCard(smat) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local c1=mg:FilterSelect(tp,Auxiliary.SynMixFilter1,1,1,nil,f1,nil,nil,f4,minc,maxc,sc,mg,smat,gc,mgchk):GetFirst()
g:AddCard(c1)
local g4=Group.CreateGroup()
for i=0,maxc-1 do
local mg2=mg:Clone()
if f4 then
mg2=mg2:Filter(f4,g,sc)
else
mg2:Sub(g)
end
local cg=mg2:Filter(Auxiliary.SynMixCheckRecursive,g4,tp,g4,mg2,i,minc,maxc,sc,g,smat,gc,mgchk)
if cg:GetCount()==0 then break end
local minct=1
if Auxiliary.SynMixCheckGoal(tp,g4,minc,i,sc,g,smat,gc,mgchk) then
minct=0
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local tg=cg:Select(tp,minct,1,nil)
if tg:GetCount()==0 then break end
g4:Merge(tg)
end
g:Merge(g4)
return g
end
cm[6]=Duel.SelectSynchroMaterial
Duel.SelectSynchroMaterial=function(tp,sc,f1,f2,minc,maxc,smat,mg1)
return Duel.SelectTunerMaterial(tp,sc,smat,f1,f2,minc,maxc,mg1)
end
--[[
--plan2
local tsg=Duel.GetMatchingGroup(Card.IsType,0,LOCATION_EXTRA,LOCATION_EXTRA,nil,TYPE_SYNCHRO)
for tsc in aux.Next(tsg) do
local esg={esc:IsHasEffect(EFFECT_SPSUMMON_PROC)}
end
--]]
end
end
---
---
---
---
---
---
---
\ No newline at end of file
--M·A·L·Yggdrasil
local m=183130
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddFusionProcFunFunRep(c,cm.matfilter1,aux.FilterBoolFunction(Card.IsRace,RACE_MACHINE),1,99,true)
c:EnableReviveLimit()
--extra summon
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(m,0))
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetTargetRange(LOCATION_HAND+LOCATION_MZONE,0)
e0:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
e0:SetRange(LOCATION_MZONE)
e0:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0xc19))
c:RegisterEffect(e0)
--indestructable
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DEFENSE_ATTACK)
e1:SetValue(1)
e1:SetCondition(cm.effcon)
e1:SetLabel(2)
c:RegisterEffect(e1)
--cannot attack
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_ATTACK)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetTarget(cm.target)
e3:SetCondition(cm.effcon)
e3:SetLabel(4)
c:RegisterEffect(e3)
--
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_REMOVE)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_CHAINING)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(cm.effcon)
e4:SetLabel(10)
e4:SetOperation(cm.op)
c:RegisterEffect(e4)
end
function cm.matfilter1(c)
return c:IsFusionSetCard(0xc19) and c:IsType(TYPE_FUSION)
end
function cm.effcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetMaterialCount()>=e:GetLabel()
end
function cm.target(e,c)
return c:IsStatus(STATUS_SUMMON_TURN+STATUS_FLIP_SUMMON_TURN+STATUS_SPSUMMON_TURN) and c:GetOriginalLevel()<8
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
for tc in aux.Next(eg) do
local rg=Duel.GetMatchingGroup(Card.IsCode,tc:GetControler(),LOCATION_EXTRA+LOCATION_DECK,0,nil,tc:GetCode())
Duel.Remove(rg,POS_FACEUP,REASON_RULE)
end
end
--M·A·L
local m=183475
local cm=_G["c"..m]
function cm.initial_effect(c)
--copy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m)
e2:SetTarget(cm.copytg)
e2:SetOperation(cm.copyop)
c:RegisterEffect(e2)
end
function cm.ffilter(c,e,tp)
return c:IsSetCard(0xc19)
end
function cm.copytg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.ffilter,tp,LOCATION_EXTRA+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end
end
function cm.copyop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local ac=Duel.SelectMatchingCard(tp,cm.ffilter,tp,LOCATION_EXTRA+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp):GetFirst()
if ac then
Duel.ConfirmCards(1-tp,ac)
if c:IsRelateToEffect(e) and c:IsFaceup() then
local code=ac:GetOriginalCode()
c:CopyEffect(code,RESET_EVENT+RESETS_STANDARD,1)
end
end
end
\ No newline at end of file
--M·A·L·C-E·U·P·Nuclear Warhead
local m=184025
local cm=_G["c"..m]
Duel.LoadScript("c100502.lua")
function cm.initial_effect(c)
end
function cm.odds(least,most)
least=tonumber(least)
most=tonumber(most)
cm.resultnumber=((cm.resultnumber*1103515245+12345)%32767)/32767
if least~=nil then
if most==nil then
return math.floor(cm.resultnumber*least)+1
else
most=most-least+1
return math.floor(cm.resultnumber*most+least)
end
end
return cm.resultnumber
end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if not cm.resultnumber then
local result=0
local g=Duel.GetFieldGroup(0,0xff,0xff):RandomSelect(0,8)
local ct={}
local c=g:GetFirst()
for i=0,7 do
ct[c]=i
c=g:GetNext()
end
for i=0,10 do
result=result+(ct[g:RandomSelect(0,1):GetFirst()]<<(3*i))
end
g:DeleteGroup()
cm.resultnumber=result&0xffffffff
end
Duel.SelectOption(tp,aux.Stringid(m,1))
Duel.SelectOption(1-tp,aux.Stringid(m,1))
local dice1=cm.odds(1,10)
e:GetHandler():SetTurnCounter(dice1)
Duel.Hint(HINT_NUMBER,tp,dice1)
Duel.Hint(HINT_NUMBER,1-tp,dice1)
local dice2=cm.odds(1,10)
e:GetHandler():SetTurnCounter(dice2)
Duel.Hint(HINT_NUMBER,tp,dice2)
Duel.Hint(HINT_NUMBER,1-tp,dice2)
local dice3=cm.odds(1,10)
e:GetHandler():SetTurnCounter(dice3)
Duel.Hint(HINT_NUMBER,tp,dice3)
Duel.Hint(HINT_NUMBER,1-tp,dice3)
local dice4=cm.odds(1,10)
e:GetHandler():SetTurnCounter(dice4)
Duel.Hint(HINT_NUMBER,tp,dice4)
Duel.Hint(HINT_NUMBER,1-tp,dice4)
Duel.SelectOption(tp,aux.Stringid(m,2))
Duel.SelectOption(1-tp,aux.Stringid(m,2))
local dice6=cm.odds(1,10)
e:GetHandler():SetTurnCounter(dice6)
Duel.Hint(HINT_NUMBER,tp,dice6)
Duel.Hint(HINT_NUMBER,1-tp,dice6)
local dice7=cm.odds(1,10)
e:GetHandler():SetTurnCounter(dice7)
Duel.Hint(HINT_NUMBER,tp,dice7)
Duel.Hint(HINT_NUMBER,1-tp,dice7)
local dice8=cm.odds(1,10)
e:GetHandler():SetTurnCounter(dice8)
Duel.Hint(HINT_NUMBER,tp,dice8)
Duel.Hint(HINT_NUMBER,1-tp,dice8)
local dice9=cm.odds(1,10)
e:GetHandler():SetTurnCounter(dice9)
Duel.Hint(HINT_NUMBER,tp,dice9)
Duel.Hint(HINT_NUMBER,1-tp,dice9)
local turn=Duel.GetTurnCount()
e:SetLabel(dice1,dice2,dice3,dice4,dice6,dice7,dice8,dice9,turn)
end
--M·A·L·C-E·U·P·Volatile Null
local m=184030
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(LOCATION_HAND)
e0:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e0:SetCondition(cm.con1)
c:RegisterEffect(e0)
--
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,m)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
--equip
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCategory(CATEGORY_EQUIP)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetTarget(cm.eqtg)
e2:SetOperation(cm.eqop)
c:RegisterEffect(e2)
--return
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetCondition(cm.retcon)
e3:SetTarget(cm.rettg)
e3:SetOperation(cm.retop)
c:RegisterEffect(e3)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetLabel(m)
ge1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ge1:SetOperation(aux.sumreg)
Duel.RegisterEffect(ge1,0)
end
end
function cm.cfilter1(c)
return c:IsType(TYPE_MONSTER) and not c:IsSetCard(0xc19)
end
function cm.con1(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and not Duel.IsExistingMatchingCard(cm.cfilter1,c:GetControler(),LOCATION_GRAVE,0,1,nil)
end
function cm.same_check(c,mc)
local flag=0
if c:GetAttribute()==mc:GetAttribute() then flag=flag+1 end
if c:GetLevel()==mc:GetLevel() then flag=flag+1 end
if c:GetAttack()==mc:GetAttack() then flag=flag+1 end
return flag==1
end
function cm.filter(c,e,tp)
return (not c:IsPublic())
and (not c:IsFaceup())
and c:IsType(TYPE_MONSTER)
and c:IsSetCard(0xc19)
and c:IsLevelAbove(1)
and Duel.IsExistingMatchingCard(cm.revfilter,tp,LOCATION_DECK,0,1,nil,e,tp,c)
end
function cm.revfilter(c,e,tp,pc)
return c:IsSetCard(0xc19) and c:IsType(TYPE_MONSTER)
and (not c:IsAttribute(pc:GetAttribute()))
and (not c:IsLevel(pc:GetLevel()))
and (not c:IsAttack(pc:GetAttack()))
and c:IsAbleToRemove()
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,c)
end
function cm.spfilter(c,e,tp,pc)
return c:IsSetCard(0xc19)
--and cm.same_check(c,pc)
and c:IsAttribute(pc:GetAttribute())
and c:IsLevel(pc:GetLevel())
and not c:IsAttack(pc:GetAttack())
and c:IsAbleToRemove()
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g1=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
Duel.ConfirmCards(1-tp,g1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectMatchingCard(tp,cm.revfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,g1:GetFirst())
Duel.Remove(g2,POS_FACEUP,REASON_COST)
e:SetLabelObject(g2:GetFirst())
Duel.ShuffleExtra(tp)
Duel.ShuffleDeck(tp)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:IsCostChecked() end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local pc=e:GetLabelObject()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or pc==nil then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g3=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,pc)
if #g3>0 then
Duel.SpecialSummon(g3,0,tp,tp,false,false,POS_FACEUP)
end
end
function cm.filter2(c)
return c:IsSetCard(0xc19) and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end
function cm.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,tp,LOCATION_GRAVE+LOCATION_DECK)
end
function cm.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
if c:IsFacedown() or not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.filter2),tp,LOCATION_GRAVE+LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
local atk=tc:GetTextAttack()
if tc then
if not Duel.Equip(tp,tc,c) then return end
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(cm.eqlimit)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetValue(atk)
tc:RegisterEffect(e2)
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
end
end
function cm.eqlimit(e,c)
return e:GetOwner()==c
end
function cm.retcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(m)~=0
end
function cm.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
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