Commit 0016f286 authored by GuGu's avatar GuGu

Update c19114514.lua

parent f42bfadd
...@@ -2,170 +2,169 @@ ...@@ -2,170 +2,169 @@
local m=19114514 local m=19114514
local cm=_G["c"..m] local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
--synchro summon --synchro summon
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddSynchroMixProcedure(c,aux.Tuner(Card.IsSetCard,0x300),aux.NonTuner(Card.IsSynchroType,TYPE_SYNCHRO),nil,aux.NonTuner(Card.IsSetCard,0x186),1,1) aux.AddSynchroMixProcedure(c,aux.Tuner(Card.IsSetCard,0x300),aux.NonTuner(Card.IsSynchroType,TYPE_SYNCHRO),nil,aux.NonTuner(Card.IsSetCard,0x186),1,1)
--mudilaguai --mudilaguai
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0)) e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_EQUIP) e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCode(EVENT_SPSUMMON_SUCCESS)
-- e1:SetCondition(cm.condition) -- e1:SetCondition(cm.condition)
e1:SetTarget(cm.target) e1:SetTarget(cm.target)
e1:SetOperation(cm.operation) e1:SetOperation(cm.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--tograve --tograve
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1)) e1:SetDescription(aux.Stringid(m,1))
e1:SetCategory(CATEGORY_DESTROY) e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(2) e1:SetCountLimit(2,m)
e1:SetTarget(cm.tg) e1:SetTarget(cm.tg)
e1:SetOperation(cm.op) e1:SetOperation(cm.op)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--atkup --atkup
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE) e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetCode(EFFECT_UPDATE_ATTACK) e4:SetCode(EFFECT_UPDATE_ATTACK)
e4:SetRange(LOCATION_MZONE) e4:SetRange(LOCATION_MZONE)
e4:SetValue(cm.atkval) e4:SetValue(cm.atkval)
c:RegisterEffect(e4) c:RegisterEffect(e4)
--dfsup --dfsup
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE) e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetCode(EFFECT_UPDATE_DEFENSE) e4:SetCode(EFFECT_UPDATE_DEFENSE)
e4:SetRange(LOCATION_MZONE) e4:SetRange(LOCATION_MZONE)
e4:SetValue(cm.dfsval) e4:SetValue(cm.dfsval)
c:RegisterEffect(e4) c:RegisterEffect(e4)
--search --search
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1)) e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE) e3:SetCode(EVENT_TO_GRAVE)
e3:SetCountLimit(1,m) e3:SetCondition(cm.thcon)
e3:SetCondition(cm.thcon) e3:SetTarget(cm.thtg)
e3:SetTarget(cm.thtg) e3:SetOperation(cm.thop)
e3:SetOperation(cm.thop) c:RegisterEffect(e3)
c:RegisterEffect(e3)
end end
--function cm.condition(e,tp,eg,ep,ev,re,r,rp) --function cm.condition(e,tp,eg,ep,ev,re,r,rp)
-- return e:GetHandler():GetSummonType()==SUMMON_TYPE_SYNCHRO -- return e:GetHandler():GetSummonType()==SUMMON_TYPE_SYNCHRO
--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 return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(cm.filter1,tp,LOCATION_DECK+LOCATION_GRAVE,0,3,nil) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(cm.filter1,tp,LOCATION_DECK+LOCATION_GRAVE,0,3,nil) end
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end end
function cm.filter1(c) function cm.filter1(c)
return c:IsSetCard(0x186) and c:IsType(TYPE_MONSTER) and c:IsRace(RACE_MACHINE) return c:IsSetCard(0x186) and c:IsType(TYPE_MONSTER) and c:IsRace(RACE_MACHINE) and not c:IsForbidden()
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 Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,cm.filter1,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,3,nil) local g=Duel.SelectMatchingCard(tp,cm.filter1,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,3,nil)
local sg=g:SelectSubGroup(tp,aux.dncheck,false,1,ft) local sg=g:SelectSubGroup(tp,aux.dncheck,false,1,ft)
if sg and sg:GetCount()>0 then if sg and sg:GetCount()>0 then
local sc=sg:GetFirst() local sc=sg:GetFirst()
while sc do while sc do
if not Duel.Equip(tp,sc,c,true,false)then return end if not Duel.Equip(tp,sc,c,true,false)then return end
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE) e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT) e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+0x1fe0000) e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(cm.eqlimit) e1:SetValue(cm.eqlimit)
e1:SetLabelObject(c) e1:SetLabelObject(c)
sc:RegisterEffect(e1) sc:RegisterEffect(e1)
sc=sg:GetNext() sc=sg:GetNext()
end end
Duel.EquipComplete() Duel.EquipComplete()
end end
end end
function cm.eqlimit(e,c) function cm.eqlimit(e,c)
return c==e:GetLabelObject() return c==e:GetLabelObject()
end end
function cm.cfilter1(c,mc) function cm.cfilter1(c,mc)
return c:GetEquipTarget()==mc return c:GetEquipTarget()==mc
end end
function cm.cfilter2(c,mc) function cm.cfilter2(c,mc)
return c:IsDestructable() return c:IsDestructable()
end end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter1,tp,LOCATION_SZONE,LOCATION_SZONE,1,nil,e:GetHandler()) and Duel.IsExistingMatchingCard(cm.cfilter2,tp,0,LOCATION_ONFIELD,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter1,tp,LOCATION_SZONE,LOCATION_SZONE,1,nil,e:GetHandler()) and Duel.IsExistingMatchingCard(cm.cfilter2,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.SelectTarget(tp,cm.cfilter1,tp,0,LOCATION_ONFIELD,0,0,nil) local g=Duel.SelectTarget(tp,cm.cfilter1,tp,0,LOCATION_ONFIELD,0,0,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end end
function cm.op(e,tp,eg,ep,ev,re,r,rp) function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local dg=Duel.GetMatchingGroup(cm.cfilter2,tp,0,LOCATION_ONFIELD,nil) local dg=Duel.GetMatchingGroup(cm.cfilter2,tp,0,LOCATION_ONFIELD,nil)
local dg1=Duel.GetMatchingGroup(cm.cfilter1,tp,LOCATION_SZONE,LOCATION_SZONE,nil,c) local dg1=Duel.GetMatchingGroup(cm.cfilter1,tp,LOCATION_SZONE,LOCATION_SZONE,nil,c)
local ct=dg:GetCount() local ct=dg:GetCount()
local ct1=dg1:GetCount() local ct1=dg1:GetCount()
if ct>ct1 then if ct>ct1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,cm.cfilter1,tp,LOCATION_SZONE,LOCATION_SZONE,1,ct1,nil,c) local g=Duel.SelectMatchingCard(tp,cm.cfilter1,tp,LOCATION_SZONE,LOCATION_SZONE,1,ct1,nil,c)
Duel.Destroy(g,REASON_EFFECT) Duel.Destroy(g,REASON_EFFECT)
local sc=Duel.GetOperatedGroup():GetCount() local sc=Duel.GetOperatedGroup():GetCount()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,cm.cfilter2,tp,0,LOCATION_ONFIELD,1,sc,nil) local g=Duel.SelectMatchingCard(tp,cm.cfilter2,tp,0,LOCATION_ONFIELD,1,sc,nil)
Duel.Destroy(g,REASON_EFFECT) Duel.Destroy(g,REASON_EFFECT)
else else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,cm.cfilter1,tp,LOCATION_SZONE,LOCATION_SZONE,1,ct,nil,c) local g=Duel.SelectMatchingCard(tp,cm.cfilter1,tp,LOCATION_SZONE,LOCATION_SZONE,1,ct,nil,c)
Duel.Destroy(g,REASON_EFFECT) Duel.Destroy(g,REASON_EFFECT)
local sc=Duel.GetOperatedGroup():GetCount() local sc=Duel.GetOperatedGroup():GetCount()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,cm.cfilter2,tp,0,LOCATION_ONFIELD,1,sc,nil) local g=Duel.SelectMatchingCard(tp,cm.cfilter2,tp,0,LOCATION_ONFIELD,1,sc,nil)
Duel.Destroy(g,REASON_EFFECT) Duel.Destroy(g,REASON_EFFECT)
end end
end end
function cm.atkfilter(c,mc) function cm.atkfilter(c,mc)
return c:IsFaceup() and c:GetEquipTarget()==mc and bit.band(c:GetOriginalType(),TYPE_MONSTER)~=0 and c:IsSetCard(0x186) return c:IsFaceup() and c:GetEquipTarget()==mc and bit.band(c:GetOriginalType(),TYPE_MONSTER)~=0 and c:IsSetCard(0x186)
end end
function cm.atkval(e,c) function cm.atkval(e,c)
local g=Duel.GetMatchingGroup(cm.atkfilter,tp,LOCATION_SZONE,LOCATION_SZONE,nil,c) local g=Duel.GetMatchingGroup(cm.atkfilter,tp,LOCATION_SZONE,LOCATION_SZONE,nil,c)
local ct=g:GetFirst() local ct=g:GetFirst()
local cc=0 local cc=0
while ct do while ct do
local aa=ct:GetTextAttack() local aa=ct:GetTextAttack()
cc=cc+aa cc=cc+aa
ct=g:GetNext() ct=g:GetNext()
end end
return cc return cc
end end
function cm.dfsval(e,c) function cm.dfsval(e,c)
local g=Duel.GetMatchingGroup(cm.atkfilter,tp,LOCATION_SZONE,LOCATION_SZONE,nil,c) local g=Duel.GetMatchingGroup(cm.atkfilter,tp,LOCATION_SZONE,LOCATION_SZONE,nil,c)
local ct=g:GetFirst() local ct=g:GetFirst()
local cc=0 local cc=0
while ct do while ct do
local aa=ct:GetTextDefense() local aa=ct:GetTextDefense()
cc=cc+aa cc=cc+aa
ct=g:GetNext() ct=g:GetNext()
end end
return cc return cc
end end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp) function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end end
function cm.thfilter(c) function cm.thfilter(c)
return c:IsSetCard(0x186) and c:IsType(TYPE_MONSTER) and c:IsRace(RACE_MACHINE) return c:IsSetCard(0x186) and c:IsType(TYPE_MONSTER) and c:IsRace(RACE_MACHINE) and c:IsAbleToHand()
end end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_GRAVE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end end
function cm.thop(e,tp,eg,ep,ev,re,r,rp) function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_GRAVE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
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