Commit 33a1c047 authored by salix5's avatar salix5

advance summon

parent eed9034a
...@@ -32,12 +32,13 @@ end ...@@ -32,12 +32,13 @@ end
function c35059553.sumlimit(e,c) function c35059553.sumlimit(e,c)
local tp=e:GetHandlerPlayer() local tp=e:GetHandlerPlayer()
if c:IsControler(1-tp) then if c:IsControler(1-tp) then
local mi,ma=c:GetTributeRequirement() local mint,maxt=c:GetTributeRequirement()
local x=Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0) local x=Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)
local y=Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE) local y=Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)
if ma==2 then return x<y+1 local ex=Duel.GetMatchingGroupCount(Card.IsHasEffect,tp,LOCATION_MZONE,0,nil,EFFECT_EXTRA_RELEASE)
elseif ma==3 then return x<y local exs=Duel.GetMatchingGroupCount(Card.IsHasEffect,tp,LOCATION_MZONE,0,nil,EFFECT_EXTRA_RELEASE_SUM)
else return false end if ex==0 and exs>0 then ex=1 end
return y-maxt+ex+1 > x-ex
else else
return false return false
end end
......
--霧の王 --霧の王
function c6614221.initial_effect(c) function c6614221.initial_effect(c)
--decrease tribute --summon with 1 tribute
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(6614221,0))
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_SUMMON_PROC)
e0:SetCondition(c6614221.ttcon)
e0:SetOperation(c6614221.ttop)
e0:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e0)
--summon with no tribute
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(6614221,1))
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DECREASE_TRIBUTE) e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetValue(0x2) e1:SetCondition(c6614221.ntcon)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--tribute check --tribute check
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
...@@ -12,7 +22,7 @@ function c6614221.initial_effect(c) ...@@ -12,7 +22,7 @@ function c6614221.initial_effect(c)
e2:SetCode(EFFECT_MATERIAL_CHECK) e2:SetCode(EFFECT_MATERIAL_CHECK)
e2:SetValue(c6614221.valcheck) e2:SetValue(c6614221.valcheck)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--give atk effect only when summon --give atk effect only when summon
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE) e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SUMMON_COST) e3:SetCode(EFFECT_SUMMON_COST)
...@@ -28,6 +38,20 @@ function c6614221.initial_effect(c) ...@@ -28,6 +38,20 @@ function c6614221.initial_effect(c)
e4:SetTargetRange(1,1) e4:SetTargetRange(1,1)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c6614221.ntcon(e,c,minc)
if c==nil then return true end
return minc==0 and c:GetLevel()>4 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
function c6614221.ttcon(e,c,minc)
if c==nil then return true end
return minc<=1 and Duel.CheckTribute(c,1)
end
function c6614221.ttop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectTribute(tp,c,1,1)
c:SetMaterial(g)
Duel.Release(g, REASON_SUMMON+REASON_MATERIAL)
end
function c6614221.valcheck(e,c) function c6614221.valcheck(e,c)
local g=c:GetMaterial() local g=c:GetMaterial()
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -3,7 +3,6 @@ function c78651105.initial_effect(c) ...@@ -3,7 +3,6 @@ function c78651105.initial_effect(c)
--summon & set with no tribute --summon & set with no tribute
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(78651105,0)) e1:SetDescription(aux.Stringid(78651105,0))
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SUMMON_PROC) e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetCondition(c78651105.ntcon) e1:SetCondition(c78651105.ntcon)
...@@ -15,7 +14,6 @@ function c78651105.initial_effect(c) ...@@ -15,7 +14,6 @@ function c78651105.initial_effect(c)
--summon with 3 tribute --summon with 3 tribute
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(78651105,1)) e3:SetDescription(aux.Stringid(78651105,1))
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetType(EFFECT_TYPE_SINGLE) e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SUMMON_PROC) e3:SetCode(EFFECT_SUMMON_PROC)
e3:SetCondition(c78651105.ttcon) e3:SetCondition(c78651105.ttcon)
......
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