Commit 72ce144c authored by wind2009's avatar wind2009

Replace

parent 3fdb3b6e
Pipeline #29951 passed with stages
in 1 minute and 22 seconds
No preview for this file type
--Mimighoul Throne --Giant Mimighoul
local s,id,o=GetID() local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
--xyz summon --xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x1b7),1,2) aux.AddXyzProcedure(c,nil,1,2)
c:EnableReviveLimit() c:EnableReviveLimit()
--spsummon --direct attack
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id) e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetCost(s.spcost) e1:SetCondition(s.dircon)
e1:SetTarget(s.sptg) e1:SetTarget(s.dirtg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--equip --search
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1)) e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_EQUIP+CATEGORY_TOHAND) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id) e2:SetCountLimit(1,id)
e2:SetCondition(s.eqcon) e2:SetCondition(s.thcon)
e2:SetTarget(s.eqtg) e2:SetTarget(s.thtg)
e2:SetOperation(s.eqop) e2:SetOperation(s.thop)
c:RegisterEffect(e2)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,2))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,id+o)
e2:SetCost(s.descost)
e2:SetTarget(s.destg)
e2:SetOperation(s.desop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function s.dircon(e)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end return Duel.IsExistingMatchingCard(Card.IsPosition,e:GetHandlerPlayer(),0,LOCATION_MZONE,1,nil,POS_FACEDOWN_DEFENSE)
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end end
function s.spfilter(c,e,tp) function s.dirtg(e,c)
return c:IsCode(55537983) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) return c:IsSetCard(0x1b7) and not c:IsType(TYPE_XYZ)
end end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function s.thcon(e,tp,eg,ep,ev,re,r,rp)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE)
end end
function s.spop(e,tp,eg,ep,ev,re,r,rp) function s.thfilter(c)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end return c:IsSetCard(0x1b7) and c:IsAbleToHand()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) end
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp) function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=g:GetFirst() if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
if tc then Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end end
function s.eqcon(e,tp,eg,ep,ev,re,r,rp) function s.thop(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2 Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,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
function s.eqfilter(c) function s.descost(e,tp,eg,ep,ev,re,r,rp,chk)
return c:IsFaceup() and c:IsSetCard(0x1b7) if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end end
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.eqfilter(chkc) end local ct=Duel.GetMatchingGroupCount(Card.IsPosition,tp,0,LOCATION_MZONE,nil,POS_FACEDOWN_DEFENSE)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 if chkc then return chkc:IsOnField() and chkc:IsFaceup() end
and Duel.IsExistingTarget(s.eqfilter,tp,LOCATION_MZONE,0,1,e:GetHandler()) end if chk==0 then return ct>0 and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
Duel.SelectTarget(tp,s.eqfilter,tp,LOCATION_MZONE,0,1,1,e:GetHandler()) local sg=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,ct,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end end
function s.eqop(e,tp,eg,ep,ev,re,r,rp) function s.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end if tg:GetCount()>0 then
local ct=c:GetOverlayCount() local dp=Duel.Destroy(tg,REASON_EFFECT)
local tc=Duel.GetFirstTarget() Duel.Damage(1-tp,dp*1000,REASON_EFFECT)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or c:GetControler()==1-tp or tc:IsFacedown() or not tc:IsRelateToEffect(e) then
Duel.SendtoGrave(c,REASON_EFFECT)
return
end
if not Duel.Equip(tp,c,tc) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(s.eqlimit)
e1:SetLabelObject(tc)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(1000)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e2)
if ct>0 and Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,ct,nil)
if #sg>0 then
Duel.HintSelection(sg)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
end end
end
end
function s.eqlimit(e,c)
return c==e:GetLabelObject()
end end
\ No newline at end of file
--Giant Mimighoul --Mimighoul Throne
local s,id,o=GetID() local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
--xyz summon --xyz summon
aux.AddXyzProcedure(c,nil,1,2) aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x1b7),1,2)
c:EnableReviveLimit() c:EnableReviveLimit()
--direct attack --spsummon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetDescription(aux.Stringid(id,0))
e1:SetCode(EFFECT_DIRECT_ATTACK) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0) e1:SetCountLimit(1,id)
e1:SetCondition(s.dircon) e1:SetCost(s.spcost)
e1:SetTarget(s.dirtg) e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--search --equip
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1)) e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetCategory(CATEGORY_EQUIP+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,id)
e2:SetCondition(s.thcon)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,2))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,id+o) e2:SetRange(LOCATION_MZONE)
e2:SetCost(s.descost) e2:SetCountLimit(1,id)
e2:SetTarget(s.destg) e2:SetCondition(s.eqcon)
e2:SetOperation(s.desop) e2:SetTarget(s.eqtg)
e2:SetOperation(s.eqop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function s.dircon(e) function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
return Duel.IsExistingMatchingCard(Card.IsPosition,e:GetHandlerPlayer(),0,LOCATION_MZONE,1,nil,POS_FACEDOWN_DEFENSE) if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
end e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
function s.dirtg(e,c)
return c:IsSetCard(0x1b7) and not c:IsType(TYPE_XYZ)
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end end
function s.thfilter(c) function s.spfilter(c,e,tp)
return c:IsSetCard(0x1b7) and c:IsAbleToHand() return c:IsCode(55537983) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
end end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE)
end end
function s.thop(e,tp,eg,ep,ev,re,r,rp) function s.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
if g:GetCount()>0 then local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SendtoHand(g,nil,REASON_EFFECT) local tc=g:GetFirst()
Duel.ConfirmCards(1-tp,g) if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end end
end end
function s.descost(e,tp,eg,ep,ev,re,r,rp,chk) function s.eqcon(e,tp,eg,ep,ev,re,r,rp)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) end
function s.eqfilter(c)
return c:IsFaceup() and c:IsSetCard(0x1b7)
end end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local ct=Duel.GetMatchingGroupCount(Card.IsPosition,tp,0,LOCATION_MZONE,nil,POS_FACEDOWN_DEFENSE) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.eqfilter(chkc) end
if chkc then return chkc:IsOnField() and chkc:IsFaceup() end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
if chk==0 then return ct>0 and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end and Duel.IsExistingTarget(s.eqfilter,tp,LOCATION_MZONE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local sg=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,ct,nil) Duel.SelectTarget(tp,s.eqfilter,tp,LOCATION_MZONE,0,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end end
function s.desop(e,tp,eg,ep,ev,re,r,rp) function s.eqop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e) local c=e:GetHandler()
if tg:GetCount()>0 then if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local dp=Duel.Destroy(tg,REASON_EFFECT) local ct=c:GetOverlayCount()
Duel.Damage(1-tp,dp*1000,REASON_EFFECT) local tc=Duel.GetFirstTarget()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or c:GetControler()==1-tp or tc:IsFacedown() or not tc:IsRelateToEffect(e) then
Duel.SendtoGrave(c,REASON_EFFECT)
return
end
if not Duel.Equip(tp,c,tc) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(s.eqlimit)
e1:SetLabelObject(tc)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(1000)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e2)
if ct>0 and Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,ct,nil)
if #sg>0 then
Duel.HintSelection(sg)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
end end
end
end
function s.eqlimit(e,c)
return c==e:GetLabelObject()
end end
\ No newline at end of file
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