Commit 75735548 authored by Nemo Ma's avatar Nemo Ma

fix

parent 55923274
......@@ -5,7 +5,7 @@ local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,11451581)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_SPELLCASTER),1,2)
aux.AddXyzProcedure(c,nil,1,2)
c:EnableReviveLimit()
--effect1
local e1=Effect.CreateEffect(c)
......
......@@ -5,7 +5,7 @@ local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,11451582)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_SPELLCASTER),4,2)
aux.AddXyzProcedure(c,nil,4,2)
c:EnableReviveLimit()
--effect1
local e1=Effect.CreateEffect(c)
......
......@@ -5,7 +5,7 @@ local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,11451583)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_SPELLCASTER),7,2)
aux.AddXyzProcedure(c,nil,7,2)
c:EnableReviveLimit()
--effect1
local e1=Effect.CreateEffect(c)
......
--空我龙 升华究极
function c25000038.initial_effect(c)
c:EnableReviveLimit()
--cannot special summon
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.FALSE)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_EXTRA)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(c25000038.spcon)
e2:SetTarget(c25000038.sptg)
e2:SetOperation(c25000038.spop)
c:RegisterEffect(e2)
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetValue(0)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE)
c:RegisterEffect(e2)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,1)
e2:SetValue(c25000038.actlimit)
c:RegisterEffect(e2)
--remove
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_SET_ATTACK)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,25000038)
e3:SetCost(c25000038.rmcost)
e3:SetTarget(c25000038.rmtg)
e3:SetOperation(c25000038.rmop)
c:RegisterEffect(e3)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetValue(0)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_SET_DEFENSE)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e5:SetCode(EFFECT_CANNOT_ACTIVATE)
e5:SetRange(LOCATION_MZONE)
e5:SetTargetRange(0,1)
e5:SetValue(c25000038.actlimit)
c:RegisterEffect(e5)
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(25000038,0))
e6:SetCategory(CATEGORY_REMOVE)
e6:SetType(EFFECT_TYPE_QUICK_O)
e6:SetCode(EVENT_FREE_CHAIN)
e6:SetRange(LOCATION_MZONE)
e6:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e6:SetCountLimit(1,25000038)
e6:SetCost(c25000038.rmcost)
e6:SetTarget(c25000038.rmtg)
e6:SetOperation(c25000038.rmop)
c:RegisterEffect(e6)
end
function c25000038.rfilter(c,tp)
return c:IsAttribute(ATTRIBUTE_DARK) and c:GetSummonLocation()==LOCATION_EXTRA and (c:IsControler(tp) or c:IsFaceup())
end
function c25000038.mzfilter(c,tp)
return c:IsControler(tp) and c:GetSequence()<5
end
function c25000038.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local rg=Duel.GetReleaseGroup(tp):Filter(c25000038.rfilter,nil,tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ct=-ft+1
return ft>-3 and rg:GetCount()>2 and (ft>0 or rg:IsExists(c25000038.mzfilter,ct,nil,tp))
return rg:CheckSubGroup(aux.mzctcheckrel,3,3,tp)
end
function c25000038.spop(e,tp,eg,ep,ev,re,r,rp,c)
function c25000038.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local rg=Duel.GetReleaseGroup(tp):Filter(c25000038.rfilter,nil,tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g=nil
if ft>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
g=rg:Select(tp,3,3,nil)
elseif ft>-2 then
local ct=-ft+1
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
g=rg:FilterSelect(tp,c25000038.mzfilter,ct,ct,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g2=rg:Select(tp,3-ct,3-ct,g)
g:Merge(g2)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
g=rg:FilterSelect(tp,c25000038.mzfilter,3,3,nil,tp)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=rg:SelectSubGroup(tp,aux.mzctcheckrel,true,3,3,tp)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
function c25000038.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.Release(g,REASON_COST)
g:DeleteGroup()
end
function c25000038.actlimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsLocation(LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED)
end
function c25000038.rlfil(c)
return
return c:IsType(TYPE_MONSTER) and (c:IsControler(tp) or c:IsFaceup())
end
function c25000038.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c25000038.rlfil,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end
local g=Duel.SelectMatchingCard(tp,c25000038.rlfil,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
Duel.Release(g,REASON_COST)
local g=Duel.GetReleaseGroup(tp,true):Filter(c25000038.rlfil,nil,tp)
if chk==0 then return #g>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=g:Select(tp,1,1,nil)
aux.UseExtraReleaseCount(rg,tp)
Duel.Release(rg,REASON_COST)
end
function c25000038.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_MZONE,1,nil,POS_FACEDOWN) end
......@@ -98,20 +91,6 @@ function c25000038.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),1-tp,LOCATION_MZONE)
end
function c25000038.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_MZONE,nil,POS_FACEDOWN)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
end
if g:GetCount()>0 then Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT) end
end
......@@ -30,6 +30,7 @@ function c33200957.initial_effect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_RELEASE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,33210957)
e3:SetCondition(c33200957.pencon)
e3:SetTarget(c33200957.pentg)
e3:SetOperation(c33200957.penop)
......
......@@ -30,6 +30,7 @@ function c33200958.initial_effect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_RELEASE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,33210958)
e3:SetCondition(c33200958.pencon)
e3:SetTarget(c33200958.pentg)
e3:SetOperation(c33200958.penop)
......
--暗金教
local m=10419901
local cm=_G["c"..m]
cm.named_with_Kabal=1
function cm.Kabal(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Kabal
end
function cm.Potion(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Potion
end
function cm.initial_effect(c)
--to hand
--E・HERO エアーマン
function c40044918.initial_effect(c)
--effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetDescription(aux.Stringid(40044918,0))
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
e1:SetTarget(c40044918.tg)
e1:SetOperation(c40044918.op)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
end
function cm.thfilter(c)
return cm.Potion(c) and c:IsAbleToHand() and c:IsType(TYPE_SPELL+TYPE_TRAP)
function c40044918.ctfilter(c)
return c:IsFaceup() and c:IsSetCard(0x8)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
function c40044918.schfilter(c)
return c:IsSetCard(0x8) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)>0 then
--Public
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(m,9))
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
g:GetFirst():RegisterEffect(e1)
function c40044918.desfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c40044918.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local ct=Duel.GetMatchingGroupCount(c40044918.ctfilter,tp,LOCATION_MZONE,0,c)
local sel=0
local tc=g:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,2))
sel=Duel.SelectOption(tp,aux.Stringid(m,3),aux.Stringid(m,4),aux.Stringid(m,5),aux.Stringid(m,6),aux.Stringid(m,7))+1
if sel==1 then
tc:RegisterFlagEffect(10419701,RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD,0,1)
--Public
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetDescription(aux.Stringid(m,3))
e2:SetProperty(EFFECT_FLAG_CLIENT_HINT+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_PUBLIC)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
elseif sel==2 then
tc:RegisterFlagEffect(10419702,RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD,0,1)
--Public
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetDescription(aux.Stringid(m,4))
e2:SetProperty(EFFECT_FLAG_CLIENT_HINT+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_PUBLIC)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
elseif sel==3 then
tc:RegisterFlagEffect(10419703,RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD,0,1)
--Public
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetDescription(aux.Stringid(m,5))
e2:SetProperty(EFFECT_FLAG_CLIENT_HINT+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_PUBLIC)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
elseif sel==4 then
tc:RegisterFlagEffect(10419704,RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD,0,1)
--Public
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetDescription(aux.Stringid(m,6))
e2:SetProperty(EFFECT_FLAG_CLIENT_HINT+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_PUBLIC)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
elseif sel==5 then
tc:RegisterFlagEffect(10419705,RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD,0,1)
--Public
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetDescription(aux.Stringid(m,7))
e2:SetProperty(EFFECT_FLAG_CLIENT_HINT+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_PUBLIC)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
if ct>0 and Duel.IsExistingMatchingCard(c40044918.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) then sel=sel+1 end
if Duel.IsExistingMatchingCard(c40044918.schfilter,tp,LOCATION_DECK,0,1,nil) then sel=sel+2 end
e:SetLabel(sel)
return sel~=0
end
local sel=e:GetLabel()
if sel==3 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(40044918,0))
sel=Duel.SelectOption(tp,aux.Stringid(40044918,1),aux.Stringid(40044918,2))+1
elseif sel==1 then
Duel.SelectOption(tp,aux.Stringid(40044918,1))
else
Duel.SelectOption(tp,aux.Stringid(40044918,2))
end
e:SetLabel(sel)
if sel==1 then
local g=Duel.GetMatchingGroup(c40044918.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
e:SetCategory(CATEGORY_DESTROY)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
else
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
end
function c40044918.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sel=e:GetLabel()
if sel==1 then
local ct=Duel.GetMatchingGroupCount(c40044918.ctfilter,tp,LOCATION_MZONE,0,c)
local g=Duel.GetMatchingGroup(c40044918.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if ct>0 and g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=g:Select(tp,1,ct,nil)
Duel.HintSelection(dg)
Duel.Destroy(dg,REASON_EFFECT)
end
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c40044918.schfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
......@@ -41,7 +41,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e2,tp)
end
function cm.spfilter(c,e,tp,dis)
return (c:IsSetCard(0x3536) or c:IsCode(53734009)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,dis)
return (c:IsSetCard(0x3536) or c:IsCode(53734009)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,dis) and not Duel.IsExistingMatchingCard(function(c,tc)return tc:IsCode(c:GetCode()) and c:IsFaceup()end,tp,LOCATION_ONFIELD,0,1,nil,c)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local dis=e:GetLabel()
......
......@@ -26,38 +26,21 @@ function c77693530.initial_effect(c)
--deck fusion material
if not c77693530.globle_check then
c77693530.globle_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD)
ge1:SetCode(EFFECT_EXTRA_FUSION_MATERIAL)
ge1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
ge1:SetTargetRange(LOCATION_DECK,0)
ge1:SetTarget(c77693530.mttg)
ge1:SetValue(c77693530.mtval)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
Duel.RegisterEffect(ge2,1)
end
--workaround
if not aux.fus_deck_mat_hack_check then
aux.fus_deck_mat_hack_check=true
function aux.fus_mat_deck_hack_exmat_filter(c,tp)
return c:IsHasEffect(EFFECT_EXTRA_FUSION_MATERIAL,tp)
end
_GetFusionMaterial=Duel.GetFusionMaterial
function Duel.GetFusionMaterial(tp)
local g1=_GetFusionMaterial(tp)
local g2=Duel.GetMatchingGroup(aux.fus_mat_deck_hack_exmat_filter,tp,LOCATION_DECK,0,nil,tp)
g1:Merge(g2)
return g1
_hack_fusion_check=Card.CheckFusionMaterial
function Card.CheckFusionMaterial(card,Group_fus,Card_g,int_chkf,not_mat)
local exg=Group.CreateGroup()
if card:GetOriginalCode()==77693530 then
exg=Duel.GetMatchingGroup(c77693530.filter0,int_chkf,LOCATION_DECK,0,nil)
if exg:GetCount()>0 then
Group_fus:Merge(exg)
end
end
return _hack_fusion_check(card,Group_fus,Card_g,int_chkf,not_mat)
end
end
end
function c77693530.mttg(e,c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
function c77693530.mtval(e,c)
if not c then return false end
return c:IsCode(77693530)
function c77693530.filter0(c)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial()
end
function c77693530.eqcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and re:IsActiveType(TYPE_MONSTER) and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
......
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