Commit 004876c4 authored by POLYMER's avatar POLYMER

fix

parent 9d5c7993
...@@ -12,28 +12,31 @@ function cm.initial_effect(c) ...@@ -12,28 +12,31 @@ function cm.initial_effect(c)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1) e1:SetValue(1)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--ritual local e2=e1:Clone()
local e2=Effect.CreateEffect(c) e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_RELEASE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_HAND)
e2:SetCode(EVENT_CHAINING)
e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--tohand --ritual
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,3)) e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_RELEASE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetRange(LOCATION_HAND)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e3:SetCode(EVENT_CHAINING)
e3:SetCondition(cm.condition) e3:SetCondition(cm.spcon)
e3:SetTarget(cm.target) e3:SetTarget(cm.sptg)
e3:SetOperation(cm.operation) e3:SetOperation(cm.spop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--tohand
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,3))
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e4:SetCondition(cm.condition)
e4:SetTarget(cm.target)
e4:SetOperation(cm.operation)
c:RegisterEffect(e4)
end end
function cm.AOTU(c) function cm.AOTU(c)
local m=_G["c"..c:GetCode()] local m=_G["c"..c:GetCode()]
...@@ -60,7 +63,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -60,7 +63,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
c:SetMaterial(g) c:SetMaterial(g)
Duel.ReleaseRitualMaterial(g) Duel.ReleaseRitualMaterial(g)
Duel.BreakEffect() Duel.BreakEffect()
if code==14000322 then if code~=14000321 then
Duel.SpecialSummon(c,SUMMON_TYPE_RITUAL+1,tp,tp,false,true,POS_FACEUP) Duel.SpecialSummon(c,SUMMON_TYPE_RITUAL+1,tp,tp,false,true,POS_FACEUP)
else else
Duel.SpecialSummon(c,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP) Duel.SpecialSummon(c,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
...@@ -71,26 +74,15 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -71,26 +74,15 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
e1:SetDescription(aux.Stringid(m,4)) e1:SetDescription(aux.Stringid(m,4))
e1:SetCategory(CATEGORY_TOGRAVE) e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetTarget(cm.tgtg) e1:SetTarget(cm.tgtg)
e1:SetOperation(cm.tgop) e1:SetOperation(cm.tgop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,1)) c:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,1))
c:RegisterEffect(e1) c:RegisterEffect(e1,true)
end
if code==14000323 then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(function(e,c) return cm.AOTU(c) end)
e2:SetValue(1)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,2))
c:RegisterEffect(e2)
end end
end end
end end
...@@ -110,18 +102,17 @@ end ...@@ -110,18 +102,17 @@ 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_RITUAL+1 return e:GetHandler():GetSummonType()==SUMMON_TYPE_RITUAL+1
end end
function cm.thfilter(c) function cm.desfilter(c,e)
return cm.AOTU(c) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() return bit.band(c:GetType(),0x81)==0x81 and c:IsDestructable(e)
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.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.desfilter,tp,LOCATION_DECK,0,1,nil,e) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_DECK)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,cm.desfilter,tp,LOCATION_DECK,0,1,1,nil,e)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.Destroy(g,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end end
end end
\ No newline at end of file
...@@ -4,17 +4,20 @@ local cm=_G["c"..m] ...@@ -4,17 +4,20 @@ local cm=_G["c"..m]
cm.named_with_Aotual=1 cm.named_with_Aotual=1
function cm.initial_effect(c) function cm.initial_effect(c)
c:EnableReviveLimit() c:EnableReviveLimit()
--direct attack --immune
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK) e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(cm.immval)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--ritual --ritual
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0)) e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_RELEASE) e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_RELEASE)
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_HAND) e2:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e2:SetCode(EVENT_CHAINING) e2:SetCode(EVENT_CHAINING)
e2:SetCondition(cm.spcon) e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg) e2:SetTarget(cm.sptg)
...@@ -36,6 +39,9 @@ function cm.AOTU(c) ...@@ -36,6 +39,9 @@ function cm.AOTU(c)
local m=_G["c"..c:GetCode()] local m=_G["c"..c:GetCode()]
return m and m.named_with_Aotual return m and m.named_with_Aotual
end end
function cm.immval(e,te)
return te:IsActiveType(TYPE_MONSTER) and te:IsActivated()
end
function cm.rfilter(c) function cm.rfilter(c)
return c:IsReleasable() and c:IsType(TYPE_RITUAL) and c:IsType(TYPE_SPELL) return c:IsReleasable() and c:IsType(TYPE_RITUAL) and c:IsType(TYPE_SPELL)
end end
...@@ -57,61 +63,50 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -57,61 +63,50 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
c:SetMaterial(g) c:SetMaterial(g)
Duel.ReleaseRitualMaterial(g) Duel.ReleaseRitualMaterial(g)
Duel.BreakEffect() Duel.BreakEffect()
if code==14000322 then if code~=14000322 then
Duel.SpecialSummon(c,SUMMON_TYPE_RITUAL+1,tp,tp,false,true,POS_FACEUP) Duel.SpecialSummon(c,SUMMON_TYPE_RITUAL+1,tp,tp,false,true,POS_FACEUP)
else else
Duel.SpecialSummon(c,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP) Duel.SpecialSummon(c,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
end end
c:CompleteProcedure() c:CompleteProcedure()
if code==14000321 then if code==14000322 then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,4)) e1:SetDescription(aux.Stringid(m,4))
e1:SetCategory(CATEGORY_TOHAND) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetTarget(cm.thtg) e1:SetTarget(cm.sptg1)
e1:SetOperation(cm.thop) e1:SetOperation(cm.spop1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,1)) c:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,1))
c:RegisterEffect(e1) c:RegisterEffect(e1,true)
end
if code==14000323 then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(function(e,c) return cm.AOTU(c) end)
e2:SetValue(1)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,2))
c:RegisterEffect(e2)
end end
end end
end end
function cm.thfilter(c) function cm.spfilter(c,e,tp)
return c:IsType(TYPE_MONSTER) and c:IsAbleToHand() return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.sptg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsAbleToHand() and cm.thfilter(chkc) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and cm.spfilter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(cm.thfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(cm.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.thfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil) local g=Duel.SelectTarget(tp,cm.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end end
function cm.thop(e,tp,eg,ep,ev,re,r,rp) function cm.spop1(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT) Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end end
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_RITUAL+1 return e:GetHandler():GetSummonType()==SUMMON_TYPE_RITUAL+1
end end
function cm.cfilter(c) function cm.cfilter(c)
return cm.AOTU(c) and c:IsType(TYPE_SPELL) and c:IsAbleToHand() return cm.AOTU(c) and c:IsAbleToHand()
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.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_DECK,0,1,nil) end
......
...@@ -12,28 +12,32 @@ function cm.initial_effect(c) ...@@ -12,28 +12,32 @@ function cm.initial_effect(c)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetValue(aux.imval1) e1:SetValue(aux.imval1)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--ritual local e2=e1:Clone()
local e2=Effect.CreateEffect(c) e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetDescription(aux.Stringid(m,0)) e2:SetValue(1)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_RELEASE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_HAND)
e2:SetCode(EVENT_CHAINING)
e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--tohand --ritual
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,3)) e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_TOHAND) e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_RELEASE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e3:SetCode(EVENT_CHAINING)
e3:SetCondition(cm.condition) e3:SetCondition(cm.spcon)
e3:SetTarget(cm.target) e3:SetTarget(cm.sptg)
e3:SetOperation(cm.operation) e3:SetOperation(cm.spop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--tohand
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,3))
e4:SetCategory(CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e4:SetCondition(cm.condition)
e4:SetTarget(cm.target)
e4:SetOperation(cm.operation)
c:RegisterEffect(e4)
end end
function cm.AOTU(c) function cm.AOTU(c)
local m=_G["c"..c:GetCode()] local m=_G["c"..c:GetCode()]
...@@ -60,83 +64,56 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -60,83 +64,56 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
c:SetMaterial(g) c:SetMaterial(g)
Duel.ReleaseRitualMaterial(g) Duel.ReleaseRitualMaterial(g)
Duel.BreakEffect() Duel.BreakEffect()
if code==14000322 then if code~=14000323 then
Duel.SpecialSummon(c,SUMMON_TYPE_RITUAL+1,tp,tp,false,true,POS_FACEUP) Duel.SpecialSummon(c,SUMMON_TYPE_RITUAL+1,tp,tp,false,true,POS_FACEUP)
else else
Duel.SpecialSummon(c,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP) Duel.SpecialSummon(c,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
end end
c:CompleteProcedure() c:CompleteProcedure()
if code==14000321 then if code==14000323 then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,4)) e1:SetDescription(aux.Stringid(m,4))
e1:SetCategory(CATEGORY_EQUIP) e1:SetCategory(CATEGORY_TOHAND)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetTarget(cm.eqtg) e1:SetTarget(cm.thtg)
e1:SetOperation(cm.eqop) e1:SetOperation(cm.thop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,1)) c:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,1))
c:RegisterEffect(e1) c:RegisterEffect(e1,true)
end
if code==14000323 then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_CHANGE_CONTROL)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(function(e,c) return cm.AOTU(c) end)
e2:SetValue(1)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,2))
c:RegisterEffect(e2)
end end
end end
end end
function cm.eqfilter(c) function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
return c:IsType(TYPE_MONSTER) and c:IsAbleToChangeControler() local g=Duel.GetMatchingGroup(Card.IsAbleToHand,0,LOCATION_HAND,nil,tp)
end if chk==0 then return #g>0 end
function cm.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
if chkc then return chkc:IsLocation(LOCATION_MZONE+LOCATION_GRAVE) and chkc:IsAbleToHand() and cm.eqfilter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingTarget(cm.eqfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,LOCATION_MZONE+LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,cm.eqfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,LOCATION_MZONE+LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function cm.eqlimit(e,c)
return e:GetOwner()==c
end end
function cm.eqop(e,tp,eg,ep,ev,re,r,rp) function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local hg=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
local c=e:GetHandler() if hg:GetCount()>0 then
if Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and c:IsFaceup() local cg=hg:RandomSelect(tp,1)
and c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then local tc=cg:GetFirst()
Duel.Equip(tp,tc,c,false) Duel.ConfirmCards(tp,tc)
local e1=Effect.CreateEffect(c) if tc and tc:IsType(TYPE_MONSTER) and tc:IsAbleToHand(tp) then
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE) Duel.SendtoHand(tc,tp,REASON_EFFECT)
e1:SetType(EFFECT_TYPE_SINGLE) end
e1:SetCode(EFFECT_EQUIP_LIMIT) Duel.ShuffleHand(1-tp)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(cm.eqlimit)
tc:RegisterEffect(e1)
end end
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_RITUAL+1 return e:GetHandler():GetSummonType()==SUMMON_TYPE_RITUAL+1
end end
function cm.cfilter(c)
return cm.AOTU(c) and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
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.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_GRAVE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,PLAYER_ALL,LOCATION_GRAVE)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(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.cfilter,tp,LOCATION_GRAVE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,3,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end end
end end
\ No newline at end of file
...@@ -8,7 +8,7 @@ function cm.initial_effect(c) ...@@ -8,7 +8,7 @@ function cm.initial_effect(c)
e1:SetDescription(aux.Stringid(m,0)) e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY+CATEGORY_RELEASE) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY+CATEGORY_RELEASE)
e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCode(EVENT_CHAINING) e1:SetCode(EVENT_CHAINING)
e1:SetCondition(cm.spcon) e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg) e1:SetTarget(cm.sptg)
......
...@@ -8,7 +8,7 @@ function cm.initial_effect(c) ...@@ -8,7 +8,7 @@ function cm.initial_effect(c)
e1:SetDescription(aux.Stringid(m,0)) e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_RELEASE) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_RELEASE)
e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCode(EVENT_CHAINING) e1:SetCode(EVENT_CHAINING)
e1:SetCondition(cm.spcon) e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg) e1:SetTarget(cm.sptg)
......
...@@ -10,7 +10,7 @@ function c20248755.initial_effect(c) ...@@ -10,7 +10,7 @@ function c20248755.initial_effect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE) e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,20248755) e1:SetCountLimit(1,20248755*1)
e1:SetCost(c20248755.spcost) e1:SetCost(c20248755.spcost)
e1:SetTarget(c20248755.sptg) e1:SetTarget(c20248755.sptg)
e1:SetOperation(c20248755.spop) e1:SetOperation(c20248755.spop)
...@@ -24,7 +24,7 @@ function c20248755.initial_effect(c) ...@@ -24,7 +24,7 @@ function c20248755.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE) e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCountLimit(1,20248756) e2:SetCountLimit(1,20248755*2)
e2:SetTarget(c20248755.eqtg) e2:SetTarget(c20248755.eqtg)
e2:SetOperation(c20248755.eqop) e2:SetOperation(c20248755.eqop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
...@@ -48,8 +48,7 @@ function c20248755.initial_effect(c) ...@@ -48,8 +48,7 @@ function c20248755.initial_effect(c)
e4:SetType(EFFECT_TYPE_QUICK_O) e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN) e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE) e4:SetRange(LOCATION_MZONE)
e4:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE) e4:SetCountLimit(1,20248755*3)
e4:SetCountLimit(1,20248757)
e4:SetCondition(c20248755.rmcon) e4:SetCondition(c20248755.rmcon)
e4:SetCost(c20248755.rmcost) e4:SetCost(c20248755.rmcost)
e4:SetTarget(c20248755.rmtg) e4:SetTarget(c20248755.rmtg)
...@@ -149,12 +148,9 @@ end ...@@ -149,12 +148,9 @@ end
function c20248755.rmcon(e,tp,eg,ep,ev,re,r,rp) function c20248755.rmcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp return Duel.GetTurnPlayer()==1-tp
end end
function c20248755.costfilter2(c,g,tp)
return c:IsControler(tp) or c:IsOnField() and g:FilterCount(aux.TRUE,c)>0
end
function c20248755.rmcost(e,tp,eg,ep,ev,re,r,rp,chk) function c20248755.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c20248755.costfilter2,1,e:GetHandler()) end if chk==0 then return Duel.CheckReleaseGroup(tp,nil,1,e:GetHandler()) end
local g=Duel.SelectReleaseGroup(tp,c20248755.costfilter2,1,1,e:GetHandler()) local g=Duel.SelectReleaseGroup(tp,nil,1,1,e:GetHandler())
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function c20248755.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c20248755.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
...@@ -6,7 +6,6 @@ function c22022850.initial_effect(c) ...@@ -6,7 +6,6 @@ function c22022850.initial_effect(c)
--synchro effect --synchro effect
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetDescription(aux.Stringid(22022850,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_CHAINING) e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetProperty(EFFECT_FLAG_DELAY)
...@@ -30,23 +29,21 @@ function c22022850.initial_effect(c) ...@@ -30,23 +29,21 @@ function c22022850.initial_effect(c)
e2:SetOperation(c22022850.xyzop) e2:SetOperation(c22022850.xyzop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
c22022850.material_type=TYPE_SYNCHRO
function c22022850.sccon(e,tp,eg,ep,ev,re,r,rp) function c22022850.sccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp and rp==tp and re:GetHandler():IsCode(22021730) return Duel.GetTurnPlayer()~=tp and rp==tp and re:GetHandler():IsCode(22021730)
end end
function c22022850.sctarg(e,tp,eg,ep,ev,re,r,rp,chk) function c22022850.sctarg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
local mg=Duel.GetMatchingGroup(function(c) return c:IsCanBeSynchroMaterial() and c:IsSetCard(0x2ff1) end,tp,LOCATION_MZONE,0,nil) local mg=Duel.GetMatchingGroup(function(c) return c:IsCanBeSynchroMaterial() and c:IsSetCard(0x2ff1) end,tp,LOCATION_MZONE,0,nil)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,mg,nil,1,99) end if chk==0 then return e:GetHandler():IsSynchroSummonable(nil,mg,1,99) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end end
function c22022850.scop(e,tp,eg,ep,ev,re,r,rp) function c22022850.scop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local mg=Duel.GetMatchingGroup(function(c) return c:IsCanBeSynchroMaterial() and c:IsSetCard(0x2ff1) end,tp,LOCATION_MZONE,0,nil) local mg=Duel.GetMatchingGroup(function(c) return c:IsCanBeSynchroMaterial() and c:IsSetCard(0x2ff1) end,tp,LOCATION_MZONE,0,nil)
local g=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,mg,nil,1,99) if c:IsSynchroSummonable(nil,mg,1,99) then
if g:GetCount()>0 then Duel.SynchroSummon(tp,c,nil,mg,1,99)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),nil,1,99)
end end
end end
function c22022850.xyzfil(c,e,tp,mc) function c22022850.xyzfil(c,e,tp,mc)
......
...@@ -39,7 +39,7 @@ function c72100118.discon(e,tp,eg,ep,ev,re,r,rp) ...@@ -39,7 +39,7 @@ function c72100118.discon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev) return ep~=tp and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev)
end end
function c72100118.costfilter(c) function c72100118.costfilter(c)
return c:IsSetCard(0x105) and c:IsAbleToGraveAsCost() return c:IsSetCard(0x105) and c:IsAbleToGraveAsCost() and c:IsType(TYPE_MONSTER)
end end
function c72100118.discost(e,tp,eg,ep,ev,re,r,rp,chk) function c72100118.discost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -48,7 +48,7 @@ function c72100119.mmmfilter(c) ...@@ -48,7 +48,7 @@ function c72100119.mmmfilter(c)
return c:IsSetCard(0x105) and c:IsType(TYPE_MONSTER) return c:IsSetCard(0x105) and c:IsType(TYPE_MONSTER)
end end
function c72100119.filter(c) function c72100119.filter(c)
return c:IsSetCard(0x105) and c:IsAbleToHand() return c:IsSetCard(0x105) and c:IsAbleToHand() and c:IsType(TYPE_MONSTER)
end end
function c72100119.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c72100119.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c72100119.filter(chkc) end if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c72100119.filter(chkc) end
......
--海造贼-幽灵岛
function c93031069.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--atk/def down
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetValue(c93031069.value1)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
--to hand
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(93031069,0))
e4:SetCategory(CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_FZONE)
e4:SetCountLimit(1,93031069*1)
e4:SetCost(c93031069.thcost)
e4:SetTarget(c93031069.thtg)
e4:SetOperation(c93031069.thop)
c:RegisterEffect(e4)
--set
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(93031069,1))
e5:SetCategory(CATEGORY_TOHAND)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetProperty(EFFECT_FLAG_CARD_TARGET)
e5:SetRange(LOCATION_GRAVE)
e5:SetCountLimit(1,93031069*2)
e5:SetTarget(c93031069.settg)
e5:SetOperation(c93031069.setop)
c:RegisterEffect(e5)
end
function c93031069.filter(c)
return c:IsFaceup() and c:IsSetCard(0x13f) and c:GetSequence()<5
end
function c93031069.value1(e,c)
return Duel.GetMatchingGroupCount(c93031069.filter,e:GetHandlerPlayer(),LOCATION_SZONE,0,nil,0x13f)*-500
end
function c93031069.thfilter(c)
return c:IsSetCard(0x13f) and not c:IsCode(93031069) and c:IsAbleToHand()
end
function c93031069.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,Card.IsDiscardable,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
end
function c93031069.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c93031069.thfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
end
function c93031069.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c93031069.thfilter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c93031069.setfilter(c)
return c:IsFaceup() and c:IsSetCard(0x13f) and c:GetSequence()<5
end
function c93031069.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(tp) and c93031069.setfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c93031069.setfilter,tp,LOCATION_SZONE,0,1,nil) and e:GetHandler():IsSSetable() end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c93031069.setfilter,tp,LOCATION_SZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
function c93031069.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and Duel.SSet(tp,c)~=0 and tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
...@@ -33,6 +33,7 @@ function c97647362.initial_effect(c) ...@@ -33,6 +33,7 @@ function c97647362.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
local e4=e3:Clone() local e4=e3:Clone()
e4:SetCode(EVENT_LEAVE_FIELD) e4:SetCode(EVENT_LEAVE_FIELD)
e4:SetCondition(c97647362.thcon3)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c97647362.eqfilter(c,tp) function c97647362.eqfilter(c,tp)
...@@ -104,4 +105,7 @@ function c97647362.thop2(e,tp,eg,ep,ev,re,r,rp) ...@@ -104,4 +105,7 @@ function c97647362.thop2(e,tp,eg,ep,ev,re,r,rp)
end end
function c97647362.splimit(e,c) function c97647362.splimit(e,c)
return not c:IsSetCard(0x13f) return not c:IsSetCard(0x13f)
end
function c97647362.thcon3(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end end
\ No newline at end of file
...@@ -40,6 +40,7 @@ function c98769900.initial_effect(c) ...@@ -40,6 +40,7 @@ function c98769900.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
local e4=e3:Clone() local e4=e3:Clone()
e4:SetCode(EVENT_LEAVE_FIELD) e4:SetCode(EVENT_LEAVE_FIELD)
e4:SetCondition(c98769900.thcon3)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c98769900.thcon1(e,tp,eg,ep,ev,re,r,rp) function c98769900.thcon1(e,tp,eg,ep,ev,re,r,rp)
...@@ -126,4 +127,7 @@ function c98769900.thop2(e,tp,eg,ep,ev,re,r,rp) ...@@ -126,4 +127,7 @@ function c98769900.thop2(e,tp,eg,ep,ev,re,r,rp)
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
function c98769900.thcon3(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
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