Commit 6211d384 authored by gggg's avatar gggg

update nanahira lib

parent ae8efffc
Pipeline #35160 passed with stages
in 58 minutes and 28 seconds
...@@ -847,15 +847,15 @@ end ...@@ -847,15 +847,15 @@ end
function cm.PrismProcCondition(e,c) function cm.PrismProcCondition(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
return Duel.CheckReleaseGroup(REASON_COST,tp,cm.PrismProcFilter,1,nil,tp) return Duel.CheckReleaseGroup(tp,cm.PrismProcFilter,1,nil,tp)
end end
function cm.PrismProcOperation(e,tp,eg,ep,ev,re,r,rp,c) function cm.PrismProcOperation(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectReleaseGroup(REASON_COST,tp,cm.PrismProcFilter,1,1,nil,tp) local g=Duel.SelectReleaseGroup(tp,cm.PrismProcFilter,1,1,nil,tp)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
--prism xyz multi-count xyz proc --prism xyz multi-count xyz proc
function cm.PrismXyzProcedure(c,min,max) function cm.PrismXyzProcedure(c,min,max)
cm.AddXyzProcedureCustom(c,cm.PrismXyzFilter,cm.PrismXyzCheck(min,max),1,max) cm.AddXyzProcedureCustom(c,cm.PrismXyzFilter,cm.PrismXyzCheck(min,max),1,max)
end end
function cm.PrismXyzFilter(c,xyzc) function cm.PrismXyzFilter(c,xyzc)
return c:IsXyzLevel(xyzc,3) and cm.check_set_prism(c) return c:IsXyzLevel(xyzc,3) and cm.check_set_prism(c)
...@@ -1060,7 +1060,7 @@ function cm.PendOperationNanahira() ...@@ -1060,7 +1060,7 @@ function cm.PendOperationNanahira()
local lscale=c:GetLeftScale() local lscale=c:GetLeftScale()
local rscale=rpz:GetRightScale() local rscale=rpz:GetRightScale()
if lscale>rscale then lscale,rscale=rscale,lscale end if lscale>rscale then lscale,rscale=rscale,lscale end
local eset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_EXTRA_PENDULUM_SUMMON)} local eset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_EXTRA_PENDULUM_SUMMON)}
local ft=Duel.GetUsableMZoneCount(tp) local ft=Duel.GetUsableMZoneCount(tp)
local mft=Duel.GetMZoneCount(tp) local mft=Duel.GetMZoneCount(tp)
cm.SetForceExtra(tp,true) cm.SetForceExtra(tp,true)
...@@ -1178,7 +1178,6 @@ function cm.NanahiraTrap(c,...) ...@@ -1178,7 +1178,6 @@ function cm.NanahiraTrap(c,...)
if te:GetCode()==EVENT_FREE_CHAIN then if te:GetCode()==EVENT_FREE_CHAIN then
e1:SetHintTiming(0x1e0) e1:SetHintTiming(0x1e0)
end end
e1:SetCountLimit(1)
e1:SetCost(cm.SelfReleaseCost) e1:SetCost(cm.SelfReleaseCost)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then return false end if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then return false end
...@@ -1814,7 +1813,7 @@ function cm.GainEffect_3L(c,tc,pres,pctlm) ...@@ -1814,7 +1813,7 @@ function cm.GainEffect_3L(c,tc,pres,pctlm)
e3:SetCode(EFFECT_REMOVE_TYPE) e3:SetCode(EFFECT_REMOVE_TYPE)
e3:SetValue(EFFECT_NORMAL) e3:SetValue(EFFECT_NORMAL)
c:RegisterEffect(e3,true) c:RegisterEffect(e3,true)
table.insert(efft,e3) table.insert(efft,e3)
c:RegisterFlagEffect(cd-4000,RESET_EVENT+0x1fe0000,EFFECT_FLAG_CLIENT_HINT,1,cm.order_table_new(efft),cd*16+1) c:RegisterFlagEffect(cd-4000,RESET_EVENT+0x1fe0000,EFFECT_FLAG_CLIENT_HINT,1,cm.order_table_new(efft),cd*16+1)
if pres then if pres then
local info_list={ local info_list={
...@@ -1996,7 +1995,7 @@ function cm.ContinuousEffectOperation_3L(f,excost) ...@@ -1996,7 +1995,7 @@ function cm.ContinuousEffectOperation_3L(f,excost)
for i,te in pairs(t) do for i,te in pairs(t) do
te:SetCondition(cm.ContinuousEffectReplaceCondition_3L(f,te:GetCondition(),tc:GetOriginalCode())) te:SetCondition(cm.ContinuousEffectReplaceCondition_3L(f,te:GetCondition(),tc:GetOriginalCode()))
if te:IsHasType(0x7e0) then if te:IsHasType(0x7e0) then
te:SetCost(cm.MergeCost(cm.CountCost_3L(tc:GetOriginalCode(),tc.single_effect_3L),te:GetCost(),excost(tc))) te:SetCost(cm.MergeCost(cm.CountCost_3L(tc:GetOriginalCode(),tc.single_effect_3L),te:GetCost(),excost(tc)))
end end
end end
end end
...@@ -2449,7 +2448,7 @@ function cm.TransformDFCCard(c) ...@@ -2449,7 +2448,7 @@ function cm.TransformDFCCard(c)
--Duel.Hint(HINT_CARD,0,tcode) --Duel.Hint(HINT_CARD,0,tcode)
--Duel.ConfirmCards(c:GetControler(),Group.FromCards(c)) --Duel.ConfirmCards(c:GetControler(),Group.FromCards(c))
--if c:IsLocation(LOCATION_DECK) then --if c:IsLocation(LOCATION_DECK) then
-- Duel.ConfirmCards(1-c:GetControler(),Group.FromCards(c)) -- Duel.ConfirmCards(1-c:GetControler(),Group.FromCards(c))
--end --end
return true return true
end end
...@@ -2468,10 +2467,10 @@ function cm.DFCBackSideCommonEffect(c) ...@@ -2468,10 +2467,10 @@ function cm.DFCBackSideCommonEffect(c)
local tcode=c.dfc_back_side local tcode=c.dfc_back_side
if not tcode then return end if not tcode then return end
c:SetEntityCode(tcode) c:SetEntityCode(tcode)
-- Duel.ConfirmCards(tp,Group.FromCards(c)) -- Duel.ConfirmCards(tp,Group.FromCards(c))
-- if c:IsLocation(LOCATION_DECK) then -- if c:IsLocation(LOCATION_DECK) then
-- Duel.ConfirmCards(1-tp,Group.FromCards(c)) -- Duel.ConfirmCards(1-tp,Group.FromCards(c))
-- end -- end
c:ReplaceEffect(tcode,0,0) c:ReplaceEffect(tcode,0,0)
Duel.SetMetatable(c,_G["c"..tcode]) Duel.SetMetatable(c,_G["c"..tcode])
Duel.RaiseSingleEvent(c,EVENT_CUSTOM+37564777,c:GetReasonEffect(),c:GetReason(),c:GetReasonPlayer(),c:GetReasonPlayer(),0) Duel.RaiseSingleEvent(c,EVENT_CUSTOM+37564777,c:GetReasonEffect(),c:GetReason(),c:GetReasonPlayer(),c:GetReasonPlayer(),0)
...@@ -2532,12 +2531,12 @@ function cm.RitualCheckAdditionalLevel(c,f,...) ...@@ -2532,12 +2531,12 @@ function cm.RitualCheckAdditionalLevel(c,f,...)
end end
end end
function cm.RitualCheckAdditional(c,lv,f,gt) function cm.RitualCheckAdditional(c,lv,f,gt)
if not gt then if not gt then
return function(g) return function(g)
return g:GetSum(cm.RitualCheckAdditionalLevel,f,c)<=lv return g:GetSum(cm.RitualCheckAdditionalLevel,f,c)<=lv
end end
else else
return function(g,ec) return function(g,ec)
if ec then if ec then
return g:GetSum(cm.RitualCheckAdditionalLevel,f,c)-cm.RitualCheckAdditionalLevel(ec,f,c)<=lv return g:GetSum(cm.RitualCheckAdditionalLevel,f,c)-cm.RitualCheckAdditionalLevel(ec,f,c)<=lv
else else
...@@ -2602,3 +2601,31 @@ function cm.GetPZoneCount(tp,g) ...@@ -2602,3 +2601,31 @@ function cm.GetPZoneCount(tp,g)
end end
return res return res
end end
function cm.HelltakerFilter(c)
return c:GetBaseAttack()==1700 and c:GetBaseDefense()==1400 and c:IsRace(RACE_FIEND) and c:IsType(TYPE_MONSTER)
end
function cm.HelltakerCommonEffect(c)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(35952884,1))
e4:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetCode(EVENT_LEAVE_FIELD)
e4:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end)
e4:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_DECK,0,1,nil,tp,POS_FACEDOWN) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
end)
e4:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_DECK,0,1,1,nil,tp,POS_FACEDOWN)
local tc=g:GetFirst()
if tc then
Duel.Remove(tc,POS_FACEDOWN,REASON_EFFECT)
end
end)
c:RegisterEffect(e4)
return e4
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