Commit 5a58e381 authored by nanahira's avatar nanahira

update_dfc

parent 6cdae9d2
...@@ -19,9 +19,8 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -19,9 +19,8 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(0) e:SetLabel(0)
if chk==0 then if chk==0 then
local c=e:GetHandler() local c=e:GetHandler()
local tcode=c.dfc_front_side if not Senya.IsDFCTransformable(c) or l~=1 then return false end
if not tcode or l~=1 then return false end local tempc=Senya.GetDFCBackSideCard(c)
local tempc=Senya.IgnoreActionCheck(Duel.CreateToken,tp,tcode)
if not tempc:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,true,true) then return false end if not tempc:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,true,true) then return false end
local mg=Duel.GetRitualMaterial(tp):Filter(Card.IsCanBeRitualMaterial,e:GetHandler(),tempc) local mg=Duel.GetRitualMaterial(tp):Filter(Card.IsCanBeRitualMaterial,e:GetHandler(),tempc)
return Senya.CheckRitualMaterial(tempc,mg,tp,tempc:GetLevel(),nil,true) return Senya.CheckRitualMaterial(tempc,mg,tp,tempc:GetLevel(),nil,true)
...@@ -32,20 +31,14 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -32,20 +31,14 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
e:SetLabel(1) e:SetLabel(1)
if not cm.target(e,tp,eg,ep,ev,re,r,rp,0) or c:IsFacedown() or not c:IsRelateToEffect(e) or c:IsControler(1-tp) or c:IsImmuneToEffect(e) then return end if not cm.target(e,tp,eg,ep,ev,re,r,rp,0) or c:IsFacedown() or not c:IsRelateToEffect(e) or c:IsControler(1-tp) or c:IsImmuneToEffect(e) then return end
local tcode=c.dfc_front_side local tempc=Senya.GetDFCBackSideCard(c)
local tempc=Duel.CreateToken(tp,tcode)
local mg=Duel.GetRitualMaterial(tp):Filter(Card.IsCanBeRitualMaterial,c,tempc) local mg=Duel.GetRitualMaterial(tp):Filter(Card.IsCanBeRitualMaterial,c,tempc)
local mat=Senya.SelectRitualMaterial(tempc,mg,tp,tempc:GetLevel(),nil,true) local mat=Senya.SelectRitualMaterial(tempc,mg,tp,tempc:GetLevel(),nil,true)
c:SetMaterial(mat) c:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat) Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect() Duel.BreakEffect()
c:SetEntityCode(tcode,true)
c:ReplaceEffect(tcode,0,0)
Duel.SetMetatable(c,_G["c"..tcode])
Duel.Hint(HINT_MUSIC,0,m*16) Duel.Hint(HINT_MUSIC,0,m*16)
Duel.Hint(HINT_CARD,0,m+1) Senya.TransformDFCCard(c)
Duel.ConfirmCards(tp,Group.FromCards(c))
Duel.ConfirmCards(1-tp,Group.FromCards(c))
Duel.SpecialSummon(c,SUMMON_TYPE_RITUAL,tp,tp,true,true,POS_FACEUP) Duel.SpecialSummon(c,SUMMON_TYPE_RITUAL,tp,tp,true,true,POS_FACEUP)
c:CompleteProcedure() c:CompleteProcedure()
end end
\ No newline at end of file
...@@ -56,26 +56,13 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -56,26 +56,13 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then return Duel.GetMZoneCount(tp)>0 and Senya.IsDFCTransformable(e:GetHandler()) and Senya.GetDFCBackSideCard(e:GetHandler()):IsCanBeSpecialSummoned(e,0,tp,true,true) end
if Duel.GetMZoneCount(tp)<=0 then return false end
local c=e:GetHandler()
local tcode=c.dfc_front_side
if not tcode then return false end
local tempc=Senya.IgnoreActionCheck(Duel.CreateToken,tp,tcode)
return tempc:IsCanBeSpecialSummoned(e,0,tp,true,true)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not cm.target(e,tp,eg,ep,ev,re,r,rp,0) or c:IsFacedown() or not c:IsRelateToEffect(e) or c:IsControler(1-tp) or c:IsImmuneToEffect(e) then return end if not cm.target(e,tp,eg,ep,ev,re,r,rp,0) then return end
local tcode=c.dfc_front_side
c:ReplaceEffect(tcode,0,0)
c:SetEntityCode(tcode,true)
Duel.SetMetatable(c,_G["c"..tcode])
Duel.Hint(HINT_MUSIC,0,m*16+3) Duel.Hint(HINT_MUSIC,0,m*16+3)
Duel.Hint(HINT_CARD,0,m+1) Senya.TransformDFCCard(c)
Duel.ConfirmCards(tp,Group.FromCards(c))
Duel.ConfirmCards(1-tp,Group.FromCards(c))
Duel.SpecialSummon(c,0,tp,tp,true,true,POS_FACEUP) Duel.SpecialSummon(c,0,tp,tp,true,true,POS_FACEUP)
end end
...@@ -1645,7 +1645,7 @@ function cm.FusionFilter_3L(c,fc,mf,sub) ...@@ -1645,7 +1645,7 @@ function cm.FusionFilter_3L(c,fc,mf,sub)
end end
function cm.FusionCheck_3L(g,min,tp,fc,f,chkf,sub) function cm.FusionCheck_3L(g,min,tp,fc,f,chkf,sub)
--check sayuri_3L --check sayuri_3L
if not Senya.master_rule_3_flag and g:IsExists(aux.FCheckTuneMagicianX,1,nil,g) then return false end if g:IsExists(aux.FCheckTuneMagicianX,1,nil,g) then return false end
if chkf~=PLAYER_NONE and Duel.GetLocationCountFromEx(chkf,tp,g,fc)<=0 then return false end if chkf~=PLAYER_NONE and Duel.GetLocationCountFromEx(chkf,tp,g,fc)<=0 then return false end
if aux.FCheckAdditional and not aux.FCheckAdditional(tp,g,fc) then return false end if aux.FCheckAdditional and not aux.FCheckAdditional(tp,g,fc) then return false end
local ct=g:GetCount() local ct=g:GetCount()
...@@ -2319,11 +2319,7 @@ function cm.CloneTable(t) ...@@ -2319,11 +2319,7 @@ function cm.CloneTable(t)
return rt return rt
end end
function cm.GetPendulumCard(tp,seq) function cm.GetPendulumCard(tp,seq)
if cm.master_rule_3_flag then return Duel.GetFieldCard(tp,LOCATION_PZONE,seq)
return Duel.GetFieldCard(tp,LOCATION_SZONE,seq+6)
else
return Duel.GetFieldCard(tp,LOCATION_PZONE,seq)
end
end end
function cm.CheckPendulum(c) function cm.CheckPendulum(c)
local tp=c:GetControler() local tp=c:GetControler()
...@@ -2393,7 +2389,7 @@ function cm.CheckPlayerEffect(p,code,...) ...@@ -2393,7 +2389,7 @@ function cm.CheckPlayerEffect(p,code,...)
return false return false
end end
function cm.AddSummonMusic(c,desc,stype) function cm.AddSummonMusic(c,desc,stype)
if c:IsStatus(STATUS_COPYING_EFFECT) or Senya.master_rule_3_flag then return end if c:IsStatus(STATUS_COPYING_EFFECT) then return end
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetCode(EVENT_SUMMON_SUCCESS)
...@@ -2426,6 +2422,26 @@ function cm.IgnoreActionCheck(f,...) ...@@ -2426,6 +2422,26 @@ function cm.IgnoreActionCheck(f,...)
return table.unpack(ret) return table.unpack(ret)
end end
--no front side common effects --no front side common effects
function cm.IsDFCTransformable(c)
return c.dfc_front_side
end
function cm.GetDFCBackSideCard(c)
if not cm.IsDFCTransformable(c) then return end
return cm.IgnoreActionCheck(Duel.CreateToken,c:GetControler(),c.dfc_front_side)
end
function cm.TransformDFCCard(c)
if not cm.IsDFCTransformable(c) then return false end
local tcode=c.dfc_front_side
c:SetEntityCode(tcode,true)
c:ReplaceEffect(tcode,0,0)
Duel.SetMetatable(c,_G["c"..tcode])
Duel.Hint(HINT_CARD,0,tcode)
Duel.ConfirmCards(c:GetControler(),Group.FromCards(c))
if c:IsLocation(LOCATION_DECK) then
Duel.ConfirmCards(1-c:GetControler(),Group.FromCards(c))
end
return true
end
function cm.DFCBackSideCommonEffect(c) function cm.DFCBackSideCommonEffect(c)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
...@@ -2439,13 +2455,21 @@ function cm.DFCBackSideCommonEffect(c) ...@@ -2439,13 +2455,21 @@ function cm.DFCBackSideCommonEffect(c)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp) e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tcode=c.dfc_back_side local tcode=c.dfc_back_side
if not tcode then return end
c:SetEntityCode(tcode) c:SetEntityCode(tcode)
Duel.ConfirmCards(tp,Group.FromCards(c)) Duel.ConfirmCards(tp,Group.FromCards(c))
Duel.ConfirmCards(1-tp,Group.FromCards(c)) if c:IsLocation(LOCATION_DECK) then
Duel.ConfirmCards(1-tp,Group.FromCards(c))
end
c:ReplaceEffect(tcode,0,0) c:ReplaceEffect(tcode,0,0)
Duel.SetMetatable(c,_G["c"..tcode]) Duel.SetMetatable(c,_G["c"..tcode])
end) end)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetRange(0)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCode(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
c:RegisterEffect(e3)
end end
--for ritual update --for ritual update
function cm.CheckRitualMaterialGoal(g,c,tp,lv,f,gt) function cm.CheckRitualMaterialGoal(g,c,tp,lv,f,gt)
...@@ -2495,7 +2519,7 @@ function cm.SelectRitualMaterial(c,g,tp,lv,f,gt) ...@@ -2495,7 +2519,7 @@ function cm.SelectRitualMaterial(c,g,tp,lv,f,gt)
end end
--for anifriends sound effects --for anifriends sound effects
function cm.AddSummonSE(c,desc) function cm.AddSummonSE(c,desc)
if c:IsStatus(STATUS_COPYING_EFFECT) or Senya.master_rule_3_flag then return end if c:IsStatus(STATUS_COPYING_EFFECT) then return end
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetCode(EVENT_SUMMON_SUCCESS)
......
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