Commit 38fa6b64 authored by nanahira's avatar nanahira

update_rule

parent 2fc587ee
......@@ -46,7 +46,7 @@ function Auxiliary.LoadDB()
local cat=tonumber(line:sub(col+1,#line))
if (cat & TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK)>0 then
table.insert(extra,code)
elseif (cat & TYPE_TOKEN)==0 and cat~=TYPE_MONSTER+TYPE_NORMAL then
elseif (cat & TYPE_TOKEN+TYPE_RITUAL)==0 and cat~=TYPE_MONSTER+TYPE_NORMAL then
table.insert(main,code)
if forbidden_check[code] then
table.insert(forbidden,code)
......@@ -119,6 +119,37 @@ function Auxiliary.Load2PickRule()
Auxiliary.LoadLFList()
Auxiliary.LoadDB()
local e2=Effect.GlobalEffect()
e2:SetDescription(1264319*16)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_EXTRA)
e2:SetValue(SUMMON_TYPE_FUSION)
e2:SetCondition(Auxiliary.FusionSummonCondition)
e2:SetOperation(Auxiliary.FusionSummonOperation)
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE | EFFECT_FLAG_SET_AVAILABLE)
e1:SetTargetRange(LOCATION_EXTRA,LOCATION_EXTRA)
e1:SetLabelObject(e2)
e1:SetTarget(function(e,c) return c:IsType(TYPE_FUSION) end)
Duel.RegisterEffect(e1,0)
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_ADD_TYPE)
e1:SetProperty(EFFECT_FLAG_IGNORE_RANGE | EFFECT_FLAG_IGNORE_IMMUNE | EFFECT_FLAG_SET_AVAILABLE)
e1:SetTargetRange(0xff,0xff)
e1:SetValue(TYPE_TUNER)
e1:SetTarget(function(e,c) return c:IsType(TYPE_MONSTER) end)
Duel.RegisterEffect(e1,0)
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_NONTUNER)
e1:SetProperty(EFFECT_FLAG_IGNORE_RANGE | EFFECT_FLAG_IGNORE_IMMUNE | EFFECT_FLAG_SET_AVAILABLE)
e1:SetTargetRange(0xff,0xff)
e1:SetValue(1)
Duel.RegisterEffect(e1,0)
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_ADD_RACE)
......@@ -140,3 +171,15 @@ function Auxiliary.Load2PickRule()
e1:SetOperation(Auxiliary.StartPick)
Duel.RegisterEffect(e1,0)
end
function Auxiliary.FusionSummonCondition(e,c)
if c==nil then return true end
local tp=c:GetControler()
local mg=Duel.GetFusionMaterial(tp):Filter(Card.IsOnField,nil)
return c:CheckFusionMaterial(mg,nil,tp)
end
function Auxiliary.FusionSummonOperation(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetFusionMaterial(tp):Filter(Card.IsOnField,nil)
local g=Duel.SelectFusionMaterial(tp,c,mg,nil,tp)
c:SetMaterial(g)
Duel.SendtoGrave(g,REASON_MATERIAL+REASON_FUSION)
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